1,076,453 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Posts by LateNightCoder

I recently uploaded an application to Google Play and since then have realised tht it has no supportive devices. After searching the web I found that maybe it was down to not having an 'active' APK. I checked that and it was active. Also other suggestion were that I hadn't added screen supports to the phone. I have since added them using

<supports-screens android:smallScreens="true"
              android:normalScreens="true"
              android:largeScreens="false"
              android:anyDensity="true"
             />

This has had no effect on the supported devices and it is still at 0. I am really stuck on what the problem is. Therefore does anyone else have an idea?

The rest of my manifest is:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="exx.example.name"
    android:versionCode="3"
    android:versionName="1.1.1" >

    <uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!-- Internet Permissions -->
    <uses-permission android:name="android.permission.INTERNET" />

    <!-- Network State Permissions -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <supports-screens android:smallScreens="true"
              android:normalScreens="true"
              android:largeScreens="false"
              android:anyDensity="true"
             />

    <application
        android:allowBackup="true"
        android:debuggable="false"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="exx.example.name.SplashScreen"
            android:label="@string/app_name"             
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
         <activity
            android:name="exx.example.name.MainActivity"
            android:label="@string/app_name"
             android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="exx.example.name.HighScores"
            android:label="@string/title_activity_high_scores"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="exx.example.name.PlayZone"
            android:label="@string/title_activity_play_zone"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="exx.example.name.PlayZone2"
            android:label="@string/title_activity_play_zone2"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="exx.example.name.SignIn"
            android:label="@string/title_activity_sign_in"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="exx.example.name.MainMenu"
            android:label="@string/title_activity_main_menu" 
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="exx.example.name.GlobalHighScores"
            android:label="@string/title_activity_global_high_scores" 
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name="exx.example.name.About"
            android:label="@string/title_activity_about" 
            android:screenOrientation="portrait" >
        </activity>

    </application>

</manifest>

Thanks in advance
LNC

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

I have been following this tutorial about "How to: Preserve and Restore Page State for Windows Phone" found at http://goo.gl/ct7ui and one of the lines of code is this:

 protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
        {
            // If this is a back navigation, the page will be discarded, so there
            // is no need to save state.
            if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back)
            {
                // Save the ViewModel variable in the page's State dictionary.
                State["ViewModel"] = _viewModel;
            }
        }

However visual studio does not seem to like this bit of code giving me the error below:

'System.Windows.Navigation.NavigationEventArgs' does not contain a definition for 'NavigationMode' and no extension method 'NavigationMode' accepting a first argument of type 'System.Windows.Navigation.NavigationEventArgs' could be found (are you missing a using directive or an assembly reference?) 

Any ideas on what i've messed up with here. Now considering 'e' is System.Windows.Navigation.NavigationEventArgs and the bit after the if statement shows System.Windows.Navigation.NavigationMode.Back, i don't for the life of me see how this is giving an error

LNC

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Skatamatic, ive updated the code and it looks like below. However this doesn't do anything either. I've madde the user be able to edit the buttons text but that now doesn't save.

Any suggestions?

Form newFrm = new Form();
Button newBtn =new Button();
newBtn.Name = controlName;
newBtn.Text = n["Text"].InnerText;
newBtn.Location = new System.Drawing.Point(Convert.ToInt32(n["X"].InnerText), Convert.ToInt32(n["Y"].InnerText));

if (n["Backcolor"].InnerText == "Color [LawnGreen]")
{
newBtn.BackColor = System.Drawing.Color.LawnGreen;
}
else if (n["Backcolor"].InnerText == "Color [Tomato]")
{
newBtn.BackColor = System.Drawing.Color.Tomato;
}
newFrm.Controls.Add(newBtn);
LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Hi there,

In my program i have given the user the possibillity to add new buttons to the form I then serialize the form to a xml file so it is saved. Any data that is edited while the program is running will be saved (for example user edits the buttons text) for next time the program runs, and it does successfully.

However when they add a new button, it get serialized to the xml file but when i run the program again and read from the xml file, that new button does not exist.

Code for serializing the forms data to the xml, saving any info about the buttons.

if (roomCtrl is Button)
                    {
                        xmlSerialisedForm.WriteElementString("Text", ((Button)roomCtrl).Text);
                        xmlSerialisedForm.WriteElementString("Backcolor", ((Button)roomCtrl).BackColor.ToString());
                        xmlSerialisedForm.WriteElementString("X", ((Button)roomCtrl).Location.X.ToString());
                        xmlSerialisedForm.WriteElementString("Y", ((Button)roomCtrl).Location.Y.ToString());
                    }

code for deserialing from the xml.

case "System.Windows.Forms.Button":


                                     ((System.Windows.Forms.Button)ctrlToSet).Name = controlName;
                                     ((System.Windows.Forms.Button)ctrlToSet).Text = n["Text"].InnerText;
                                    ((System.Windows.Forms.Button)ctrlToSet).Location = new System.Drawing.Point(Convert.ToInt32(n["X"].InnerText), Convert.ToInt32(n["Y"].InnerText));


                                    if (n["Backcolor"].InnerText == "Color [LawnGreen]")
                                    {
                                        ((System.Windows.Forms.Button)ctrlToSet).BackColor = System.Drawing.Color.LawnGreen;

                                    }
                                    else if (n["Backcolor"].InnerText == "Color [Tomato]")
                                    {
                                        ((System.Windows.Forms.Button)ctrlToSet).BackColor = System.Drawing.Color.Tomato;

                                    }


                                    break;

Any ideas on what it might be or if i am just missing something??

Thanks in advanced.

LNC

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

just to add i've tried making a new program and that also has the same problem

LNC

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Hi guys

I am currently learning WP7 and have a basic app built, the problem is i left it a few weeks back with everything fine. However I have just re-opened it and the forms will not load in Visual Studio 2010.

Does anyone know what could possibly be wrong?? It loads in expression blend 4 and the emulator perfectly

Thanks in advanced.

LNC

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

@mike_2000_17 Thank you very much, i'll give that a go and get this thing working again

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Basically i have made a binary class that inherits from a matrix class. and aparantly when i make the binary image the deconstructor doesn't work properly. the program runs, reads in the files and makes the binary matrix. However when the binary deconstructor and matrix deconstructors are called, the program fails and shoot to this line of code.
/* verify block type */_ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse));

I don't know what this means even after looking online, I'm going to guess the pointer isn't being deleted, so maybe somebody could help me.

This is the matrix class

class Matrix
{
private:

    //double* data;
    int value;


public:
    double* data;

    int M;
    int N;
    Matrix();
    Matrix(int MM, int NN);
    //Matrix(const Matrix&); 
    Matrix(const Matrix& rhs);  //deep copy
    Matrix(int MM, int NN, double* input_data);
    virtual ~Matrix();

    double getRead(int i, int j) const; 

    double getReadWrite(int i, int j); 
    void set(int i, int j, double val); 

    void Print();

    Matrix* sum1(Matrix* rhs); 
    double* to1DArray();
    ///operators
    virtual Matrix* operator +(Matrix* rhs) const;
    virtual Matrix* operator -(Matrix* rhs) const;
    virtual Matrix* operator *(Matrix* rhs) const;
    virtual Matrix* operator /(Matrix* rhs) const;
    virtual Matrix& operator =(Matrix* rhs);

    ///overload double operators
    Matrix* operator +(double* rhs) const;
    Matrix* operator -(double* rhs) const;
    Matrix* operator *(double* rhs) const;
    Matrix* operator /(double* rhs) const;
    Matrix* operator =(double* rhs);

    ///min,max,sum,mean
    double min(Matrix* rhs) const;
    double max(Matrix* rhs) const;
    double sum() const;
    double mean() const;

    //double SqaureRoot() const;

};

and this is the binary class which inherits from the matrix class

class BinaryImage: public Matrix
{
private:
    char ThreshData(double thresh); 


public: 
    double* input_data;

    BinaryImage();
    BinaryImage(int MM, int NN, double* input_data){ThreshData(0);};
    //BinaryImage(int MM, int NN){ThreshData(1);};
    ~BinaryImage();

    Matrix* operator +(Matrix* rhs) const;
    Matrix* operator -(Matrix* rhs) const;
    Matrix* operator *(Matrix* rhs) const;
    Matrix* operator /(Matrix* rhs) const;

    Matrix* operator +(double* rhs) const;
    Matrix* operator -(double* rhs) const;
    Matrix* operator *(double* rhs) const;
    Matrix* operator /(double* rhs) const;

};

BinaryImage::BinaryImage()
{
    cout << "BinaryImage Constructor...\n";
}

This next bit of code is what calls the class

void function()
{
    double* data = 0;
    double* shufData = 0;
    int M=0; int N=0; 

    cout << endl;
    cout << "Data from text file -------------------------------------------" << endl;
    M = 512; N = 512; //M and N represent the size of the image, e.g. for task 1, M = 512, N = 512
    char* fileName2 = "...\\logo_bi.txt"; 
    data = readTXT(fileName2, M, N);

    cout << endl;
    cout << "Data from text file -------------------------------------------" << endl;
    M = 512; N = 512; //M and N represent the size of the image, e.g. for task 1, M = 512, N = 512
    char* fileName3 = "...\\logo_shuf.txt"; 
    shufData = readTXT(fileName3, M, N);

    cout << "---------originalImage----------"<< endl;
    BinaryImage originalImage(32,32, data);
}

It was after this is called that it dies.

Thank you in advanced

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Hi everyone

I currently have a program that imports data from an excel sheet that is already made. The data also creates a chart. I need the chart to load into the program and I think that the only way to do that is by importing it into a picturebox.

If this is possible please help me

Thank you in advance

LNC

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Hi guys

Basically im making a application that holds certain data that is read into the app, those readings are sent to excel and make a grapgh, which can be viewed on to the same page in the application. Each different sections data is put on to a seperate "sheet" in excel.

What i was wounder is, is there a way i can make a new "sheet" throught the app when i make a new section in the app?

Thanks

LNC

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Hi there

I am currently creating a game, where you drop items in certain areas, at the moment i want the player to drop only a max of 6 bombs, but one at a time.

Currently my programignores the list count max of 6 and just keeps drawing until i let go of the A button.

any thourghts on how to fix this bug??

LNC

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
dictionary<char,int> myDict = new dictionary<char,int>();
foreach (char c in myString)
   myDict[c]++;

Thanks very much, so are you suggesting i use the above code for that line of code where the pointer is? or

sbyte *sentence = @string;
	while (add_letter(*sentence++, counters));

or you suggesting to use dictionary code instead of another part?

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

In the program i am currently building, i need to do a frequency analysis of the letter occurance in a string I know how to do this in c++ and the code for that is

#include <iostream>
using namespace std;


	// Function to increment the letter count in the counters array
	char add_letter( char letter, int letterCount[] ) 
	{
	// Only deal with lower case letters
	char lower_case_letter = tolower(letter);
 
	// Check if character is a letter
	if ( lower_case_letter >= 'a' && lower_case_letter <= 'z' ) 
	{
    ++letterCount[ lower_case_letter - 'a' ];
	}
 
	return letter;
	}

int main()
{
	int i=0;
	int count = 0;
	char string[600];
	char c;
	// One integer for each  letter
	int counters[26] = { 0 };

	cout << "Write something here: ";
	//the Answer to life, the Universe, and everything IS 42.
	cin.getline (string,600);
	
	// Pass each character to the add_letter
	// function until null-terminator is reached
	
	// Counting the number of occurences of each letter in this sentence
	
	char *sentence = string;
	while ( add_letter(*sentence++, counters) );
 
	// Display results
	for (int i = 0; i < 26; ++i) 
	{
		if ( counters[i] ) { 
		cout << '\n' << char(i + 'a') << ": " << counters[i] << '\n';
		}
	}
 
  
	//count number of words
	while (string[i])
	{
		c=int(string[i]);
		if (isspace(c)) count++;
		//putchar (c);		
		i++;

	}
	 	count++;	

	//Output: Number of words
	cout << "\nthe number of words are: " << count << " ";
	//Number of times letter appears

	return 0;
}

How ever i need to do it in c# and my linited knowledge of the similarities of both i have converted it manually to this:

using System;

	// Function to increment the letter count in the counters array
	private sbyte add_letter(sbyte letter, int[] letterCount)
	{
	// Only deal with lower case letters
	sbyte lower_case_letter = char.ToLower(letter);

	// Check if character is a letter
	if (lower_case_letter >= 'a' && lower_case_letter <= 'z')
	{
	++letterCount[lower_case_letter - 'a'];
	}

	return letter;
	}

static int Main()
{
	int i = 0;
	int count = 0;
	string @string = new string(new char[600]);
	sbyte c;
	// One integer for each  letter
	int[] counters = {0};

	Console.Write("Write something here: ");
	//the Answer to life, the Universe, and everything IS 42.
	@string = Console.ReadLine();

	// Pass each character to the add_letter
	// function until null-terminator is reached

	// Counting the number of occurences of each letter in this sentence

	sbyte *sentence = @string;
	while (add_letter(*sentence++, counters));
 
	// Display results
	for (int i = 0; i < 26; ++i)
	{
		if (counters[i] != 0)
		{
		Console.Write('\n');
		Console.Write((sbyte)(i + 'a'));
		Console.Write(": ");
		Console.Write(counters[i]);
		Console.Write('\n');
		}
	}


	//count number of words
	while (@string[i])
	{
		c = (int)(@string[i]);
		if (char.IsWhiteSpace(c))
			count++;
		//putchar (c);		
		i++;

	}
		 count++;

	//Output: Number of words
	Console.Write("\nthe number of words are: ");
	Console.Write(count);
	Console.Write(" ");
	//Number of times letter appears

	return 0;
}

As you can all imagine this has come up with multiple errors. and after speneding quite a few days on this i wounder whether there was anyone who can see where i have gone wrong or could know a much better way of doing this.

What i input is :the Answer to life, the Universe, and everything IS 42.
The outpur should be :
a=2
d=1
e=8
f=1
g=1
h=3
i=4
l=1
n=4
o=1
r=3
s=3
t=4
u=1
v=2
w=1
y=1

the number of words are: 10

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Thanks very much guys that's worked wonderfully. Can't believe it was something that little

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

In my program I read in a text file an decrypt the text from an array. once decrypted i then have to do through it again and search for every tenth array member and show their memory location.

The code so far:

int main( )
{
int* pCrypted = NULL;
int crypted;	//holds the number of the ASCII value

	cout << "Enter filename: " << endl;		//ask user to enter desired file
	char filename[50];						//saves name of file
	ifstream myFile;			
	cin.get(filename, 50);					//retreives text from file
	myFile.open(filename);					//opens file

	if(!myFile.is_open())					//checks if file is open
	{
		exit(EXIT_FAILURE);					//if cannot open then causes error
	}
	string temp;
	char word[400];				//array for the the text
	myFile >> word;				//puts the text retrieved, into the array
	while(myFile.good())		//while loop to see if the file is still good
	{
		myFile.get(word, 400);
		//cout << word;	//outputs the word to the command line
		//temp = temp + " " + word;
		//myFile >> word;			//puts next line retrieval into the array
		
	}
	cout << "Received text is: " << word << "\n";				//outputs final line to command line	

	int shift = 0;		//array for the shifting
	char response;		//variable ready for users response
	
	

	do
	{
		//system("CLS");//clear screen
		
		decrypt(word);											//calls the decryption one the word array
			
		cout << "\nDecrypted text is: " << word << endl;		//outouts the decrypted text to the screen
		shift++;												//increments shift by one
		cout << "is this the correct state Y or N" << endl;		//asks user if the text is correctly decrypted
		cin >> response;	
	}
	while(response != 'y');										//checks if users response was y for yes

	cout << "\nthe shift is: " << shift << endl;				//outputs the amount of shifts taken on to the screen
	
	///////////search array for every tenth memory location///////
	char d[400];
	
	pCrypted = &crypted;
	//search every tenth for pointer address
	for(int i=0; d[i] != 400; i+10) 
	{
		d[i] = crypted;
		cout << "Memory Location is: " << pCrypted << endl;
		crypted = crypted + 10;					
	}
	
	return 0;
}

What the program seems to do is find the first member and then just spam out that memory location for infinite times.

LateNightCoder
Newbie Poster
16 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
 
© 2013 DaniWeb® LLC
Page rendered in 0.1430 seconds using 2.62MB