Showing posts with label 2. Show all posts
Showing posts with label 2. Show all posts
Monday, February 2, 2015
Android 4 4 2 Kitkat for Samsung Galaxy S4 I9500 Smartphone
Latest Updates Android 4.4.2 Kitkat XXUFNB3
Offical Firmware for Samsung Galaxy S4 I9500 Smartphone.
To update world wide Samsung Galaxy S4 19500 smartphone download the Latest update Android 4.4.2 Kitkat by selecting your country.
Download firmware file. Unzip downloading files and make sure there is file with extension of .tar.md5 as shown in image.

- Download Odin 3.09 Download driver for Samsung smartphones or install Samsung Kies for reliable and best drivers for smartphones.
![]() |
| odin 3.07 |
- Put your Samsung Galaxy S4 I9500 smartphone in Downloading mode by Pressing "Home+Volume Down (-)+Power Button". if your phone is not rooted then you will see android logo with text "Downloading".
- If your smartphone is rooted then you will see warning message with triangular mark. Press volume up button to turn on download mode for smartphones.
- Insert usb cable into smartphone . Now computer will install drivers and successfully install drivers for your smartphones .(Make sure install Samsung Kies for better driver installation.)
- Run Odin . Odin will automatically select com port for your smartphone in ID COM tab.

- Now Tick on second option PDA and click on PDA tab . A pop up will come . Select downloading files.
- Odin will install some files manually . wait for few second .
- Click on start . installation will be start and take place on your Samsung Galaxy S4 smartphone. You can monitor what odin is doing with your device by left tab of odin tool.As mention in picture.

- Installation bar will take place on Samsung Galaxy S4 smartphone . Wait and let odin done. Do not remove your Samsung Galaxy S4 I9500 smartphone until you will recive message on Odin "PASS".

- Congrats. You have successfully update your Samsung Galaxy S4 I9500 to android 4.4.2 Kitkat .
- Do not remove your smartphone ,or your turn off your Computer during flashing process. Make sure to charge battery to 100% for safe flash.
- Backup your personal data before updating.
How to Create a Quiz in Flash ActionScript 3 Tutorial PART 2
[Read PART 1 here]
In the first part of this lesson, we added the functionality that will allow the user to take the quiz - we added the questions and the correct answers, and we enabled the user to submit his or her own answers by using the input field and clicking on the submit button. All of that happens in frame 1 of our simple Flash quiz.
In this part of the How to Create a Quiz in Flash using ActionScript 3 tutorial, we will be working on the following:
TextFields for the USERs answers - userAnswer0_txt, userAnswer1_txt, userAnswer2_txt, userAnswer3_txt
TextFields for the CORRECT answers - correctAnswer0_txt, correctAnswer1_txt, correctAnswer2_txt, correctAnswer3_txt
TextField for the SCORE - score_txt
The TextField names for the answers have numbers in them so that they will match the index values of the answers in the arrays (aUserAnswers and aCorrectAnswers). userAnswer0_txt will be for aUserAnswers[0], userAnswer1_text will be for aUserAnswers[1], and so on...
So now lets go ahead and add the code. Make sure you select frame 2 of Actions layer and then go to the Actions Panel. Lets first create a number variable:
Ok, so in the first method, we displayed the answers this way:
textField.text = array[index];
ex.
correctAnswer0_txt.text = aCorrectAnswers[0];
For this other method that were doing, we need to learn another way of targeting our TextField. For example, instead of typing in correctAnswer0_txt.text, we can replace correctAnswer0_txt with this["correctAnswer0_txt"] instead. So this is what well have:
this["correctAnswer0_txt"].text = aCorrectAnswers[0];
This is but another way of targeting our display objects (like Buttons, MovieClips and TextFields). Lets take a look at the example again:
this["correctAnswer0_txt"]
Here, since our code is placed in the main timeline, then the this keyword in this instance would refer to the main timeline. And then inside the square brackets, we place the name of the child object that we want to target (the name must be specified as a string, so it should be in quotation marks). So what were doing here is we are telling Flash to target the correctAnswer0_txt TextField which can be found inside this (which in this example would be the main timeline).
So what is the benefit of writing it this way instead?
In this other method of targeting display objects, we are specifying the name of the instances as strings. Because were doing it this way, we can replace the numbers in the names with variables instead. That way, we can just have that variable be incremented inside a for loop so that we dont have to hard code in the numbers for each text field (here you see why its important that we numbered our text fields within their respective names). If this sounds a bit confusing, lets take a look at how the new text assignment statement will look inside of the for loop:
this["correctAnswer" + i + "_txt"].text = aCorrectAnswers[i];
Here, the numbers are replaced with the variable i. For the text fields name, the join operator (+) is used to combine the variable with the rest of the name. Then as the for loop updates, so does i, therefore allowing us to iterate through the text fields and the items in the arrays. Note that i is a number, and it is being combined with strings. In this example, there is no need to convert i into a string. Because the number data is being combined with strings, Flash will automatically convert that number data into a string. So now lets go ahead and write our for loop. Well start with the variable i being equal to 0, and then as long as i is less then aQuestions.length, well keep the for loop running (you can also use aCorrectAnswers.length or aUserAnswers.length since they all have the same lengths anyway). So our for loop will look like this:
Go ahead and test your movie and you should see that this will yield the same results as with the previous method that we used. This second method would be more efficient to use since we wont have to type in the text assignment statements one by one. Imagine if our quiz had 100 questions!
Ok, so now we can move on to the part that checks whether the users answers are correct. So how do we write the code that will determine whether each answer is correct or not? If the answer that the user submitted is the same as the corresponding item in the aCorrectAnswers array, then it means that the user got the correct answer. We know that the users answers are stored in the aUserAnswers array so we could just compare if the items in aUserAnswers match their partners (the ones with the same index value) in the aCorrectAnswers array. Well use an if statement for that. For each match that is detected, we will give the user a point by incrementing nScore by 1 (nScore is that variable that we created earlier, which was initialized to 0). We will place that if statement in the for loop as well, since we want to go through each item in both of the arrays. So our updated for loop is now:
So now, if you test the movie and try out the quiz again, you should see nScore update in the output window (provided that you get at least one answer right, if you dont get any answers right, then nScore never gets updated and wont get traced).
Lastly, wed like to display the final score in the score_txt text field. Well display the score once the for loop has finished checking all the answers. To check whether the for loop is finished, we can check whether i is equal to aQuestions.length - 1. If i is equal to the array length minus one, then it means that the for loop is already at the last item (we subtract the length by 1 because the index values start at 0, where as the length count starts at 1). So well use another if statement inside the for loop to check for that. If i is equal to aQuestions.length - 1, then we assign nScore to score_txt using the text property of the TextField class (be sure to convert nScore to a string using the toString() method). So lets go ahead and update the code:
Here is the code in full:
FRAME 1
Read more »
In the first part of this lesson, we added the functionality that will allow the user to take the quiz - we added the questions and the correct answers, and we enabled the user to submit his or her own answers by using the input field and clicking on the submit button. All of that happens in frame 1 of our simple Flash quiz.
In this part of the How to Create a Quiz in Flash using ActionScript 3 tutorial, we will be working on the following:
- Displaying the users answers alongside the correct answers
- Checking the users answers and computing the score
- Displaying the users score
TextFields for the USERs answers - userAnswer0_txt, userAnswer1_txt, userAnswer2_txt, userAnswer3_txt
TextFields for the CORRECT answers - correctAnswer0_txt, correctAnswer1_txt, correctAnswer2_txt, correctAnswer3_txt
TextField for the SCORE - score_txt
The TextField names for the answers have numbers in them so that they will match the index values of the answers in the arrays (aUserAnswers and aCorrectAnswers). userAnswer0_txt will be for aUserAnswers[0], userAnswer1_text will be for aUserAnswers[1], and so on...
So now lets go ahead and add the code. Make sure you select frame 2 of Actions layer and then go to the Actions Panel. Lets first create a number variable:
var nScore:Number = 0;This variable is going to be used to store the users score. Im initializing it to 0 just in case the user does not get any answer correctly. If that happens then the score will just stay at 0. Ok, so well go back to that variable later. For now, lets work on the code that will display the answers in their respective text fields. We will get the data from the arrays using array access notation, and assign each piece of data to its corresponding text field using the text property of the TextField class. We can do it this way:
userAnswer0_txt.text = aUserAnswers[0];If you add in this code and then test the movie, you should see all the answers displayed in the text fields after you answer all the questions. So at this point, we can actually move on to the next part of the code that will check whether the answers the user gave are correct. But before we do that, Id like to show you another way of displaying the answers in the TextFields. Instead of manually assigning each item to its corresponding text field one by one, well use a for loop instead. So go ahead and remove or comment out the code above, and well try this other method of displaying the answers.
userAnswer1_txt.text = aUserAnswers[1];
userAnswer2_txt.text = aUserAnswers[2];
userAnswer3_txt.text = aUserAnswers[3];
correctAnswer0_txt.text = aCorrectAnswers[0];
correctAnswer1_txt.text = aCorrectAnswers[1];
correctAnswer2_txt.text = aCorrectAnswers[2];
correctAnswer3_txt.text = aCorrectAnswers[3];
Ok, so in the first method, we displayed the answers this way:
textField.text = array[index];
ex.
correctAnswer0_txt.text = aCorrectAnswers[0];
For this other method that were doing, we need to learn another way of targeting our TextField. For example, instead of typing in correctAnswer0_txt.text, we can replace correctAnswer0_txt with this["correctAnswer0_txt"] instead. So this is what well have:
this["correctAnswer0_txt"].text = aCorrectAnswers[0];
This is but another way of targeting our display objects (like Buttons, MovieClips and TextFields). Lets take a look at the example again:
this["correctAnswer0_txt"]
Here, since our code is placed in the main timeline, then the this keyword in this instance would refer to the main timeline. And then inside the square brackets, we place the name of the child object that we want to target (the name must be specified as a string, so it should be in quotation marks). So what were doing here is we are telling Flash to target the correctAnswer0_txt TextField which can be found inside this (which in this example would be the main timeline).
So what is the benefit of writing it this way instead?
In this other method of targeting display objects, we are specifying the name of the instances as strings. Because were doing it this way, we can replace the numbers in the names with variables instead. That way, we can just have that variable be incremented inside a for loop so that we dont have to hard code in the numbers for each text field (here you see why its important that we numbered our text fields within their respective names). If this sounds a bit confusing, lets take a look at how the new text assignment statement will look inside of the for loop:
this["correctAnswer" + i + "_txt"].text = aCorrectAnswers[i];
Here, the numbers are replaced with the variable i. For the text fields name, the join operator (+) is used to combine the variable with the rest of the name. Then as the for loop updates, so does i, therefore allowing us to iterate through the text fields and the items in the arrays. Note that i is a number, and it is being combined with strings. In this example, there is no need to convert i into a string. Because the number data is being combined with strings, Flash will automatically convert that number data into a string. So now lets go ahead and write our for loop. Well start with the variable i being equal to 0, and then as long as i is less then aQuestions.length, well keep the for loop running (you can also use aCorrectAnswers.length or aUserAnswers.length since they all have the same lengths anyway). So our for loop will look like this:
for(var i:Number = 0; i < aQuestions.length; i++)
{
this["userAnswer" + i + "_txt"].text = aUserAnswers[i];
this["correctAnswer" + i + "_txt"].text = aCorrectAnswers[i];
}So the first time the for loop runs, i will be equal to 0, therefore aUserAnswers[0] and aCorrectAnswers[0] will be assigned to the userAnswer0_txt and correctAnswer0_txt TextFields respectively. Then as i updates, the rest of the items in the arrays will be assigned to their respective text fields as well.Go ahead and test your movie and you should see that this will yield the same results as with the previous method that we used. This second method would be more efficient to use since we wont have to type in the text assignment statements one by one. Imagine if our quiz had 100 questions!
Ok, so now we can move on to the part that checks whether the users answers are correct. So how do we write the code that will determine whether each answer is correct or not? If the answer that the user submitted is the same as the corresponding item in the aCorrectAnswers array, then it means that the user got the correct answer. We know that the users answers are stored in the aUserAnswers array so we could just compare if the items in aUserAnswers match their partners (the ones with the same index value) in the aCorrectAnswers array. Well use an if statement for that. For each match that is detected, we will give the user a point by incrementing nScore by 1 (nScore is that variable that we created earlier, which was initialized to 0). We will place that if statement in the for loop as well, since we want to go through each item in both of the arrays. So our updated for loop is now:
for(var i:Number = 0; i < aQuestions.length; i++)
{
this["userAnswer" + i + "_txt"].text = aUserAnswers[i];
this["correctAnswer" + i + "_txt"].text = aCorrectAnswers[i];
if(aUserAnswers[i] == aCorrectAnswers[i])
{
nScore++;
trace(nScore);
}
}So what the if statement in the for loop will do is it will compare the items with the same index value from both arrays. Each time they match, then nScore gets incremented by 1. Ive added in a trace statement so we could verify if the correct computation is being made. But theres still one more modification that we need to make with regard to the comparison of the answers. You see, when strings are being compared, the process is case-sensitive. So a lower case a will not be considered equal to an uppercase A. So what happens here is that the user may have submitted the correct word, but if the casing of even just one letter is different from the item in the aCorrectAnswers array, then it will not be considered equal and the user will not be given the corresponding point. In order to fix this, we need to make sure that when the items are compared, the strings from both arrays have identical casings. It doesnt matter if they are in uppercase or lowercase, the important thing is that they are the same. So what we can do is, we can convert the casing to either uppercase or lowercase when the items are being compared in the if statement. We can convert the items by using either the toUpperCase() or toLowerCase() methods of the String class. Im going to use the toUpperCase() method. So lets go ahead and update the code:for(var i:Number = 0; i < aQuestions.length; i++)
{
this["userAnswer" + i + "_txt"].text = aUserAnswers[i];
this["correctAnswer" + i + "_txt"].text = aCorrectAnswers[i];
if(aUserAnswers[i].toUpperCase() == aCorrectAnswers[i].toUpperCase())
{
nScore++;
trace(nScore);
}
}So now, when each pair is compared, they will be converted into the same casing. Note that this will not affect how the words are displayed in the text fields. The conversion to upper case (or lower case, if thats what you chose), will only be for the if statement condition in this example.So now, if you test the movie and try out the quiz again, you should see nScore update in the output window (provided that you get at least one answer right, if you dont get any answers right, then nScore never gets updated and wont get traced).
Lastly, wed like to display the final score in the score_txt text field. Well display the score once the for loop has finished checking all the answers. To check whether the for loop is finished, we can check whether i is equal to aQuestions.length - 1. If i is equal to the array length minus one, then it means that the for loop is already at the last item (we subtract the length by 1 because the index values start at 0, where as the length count starts at 1). So well use another if statement inside the for loop to check for that. If i is equal to aQuestions.length - 1, then we assign nScore to score_txt using the text property of the TextField class (be sure to convert nScore to a string using the toString() method). So lets go ahead and update the code:
for(var i:Number = 0; i < aQuestions.length; i++)
{
this["userAnswer" + i + "_txt"].text = aUserAnswers[i];
this["correctAnswer" + i + "_txt"].text = aCorrectAnswers[i];
if(aUserAnswers[i].toUpperCase() == aCorrectAnswers[i].toUpperCase())
{
nScore++;
}
if(i == aQuestions.length - 1)
{
score_txt.text = nScore.toString();
}
}So there you have it. Our quiz app is now complete.Here is the code in full:
FRAME 1
stop();
var nQNumber:Number = 0;
var aQuestions:Array = new Array();
var aCorrectAnswers:Array = new Array("Jupiter", "Mars", "war", "Titan");
var aUserAnswers:Array = new Array();
aQuestions[0] = "What is the biggest planet in our solar system?";
aQuestions[1] = "Which planet in our solar system is the 4th planet from the sun?";
aQuestions[2] = "Mars is named after the Roman god of ___.";
aQuestions[3] = "What is the name of Saturns largest moon?";
questions_txt.text = aQuestions[nQNumber];
submit_btn.addEventListener(MouseEvent.CLICK, quiz);
function quiz(e:MouseEvent):void
{
aUserAnswers.push(answers_txt.text);
answers_txt.text = "";
nQNumber++;
if(nQNumber < aQuestions.length)
{
questions_txt.text = aQuestions[nQNumber];
}
else
{
nextFrame();
}
}FRAME 2var nScore:Number = 0;
for(var i:Number = 0; i < aQuestions.length; i++)
{
this["userAnswer" + i + "_txt"].text = aUserAnswers[i];
this["correctAnswer" + i + "_txt"].text = aCorrectAnswers[i];
if(aUserAnswers[i].toUpperCase() == aCorrectAnswers[i].toUpperCase())
{
nScore++;
}
if(i == aQuestions.length - 1)
{
score_txt.text = nScore.toString();
}
}PREV: How to Create a Quiz in Flash - ActionScript 3 Tutorial - PART 1Friday, January 30, 2015
Cherry Mobile Sapphire 2 0 Remove Pattern Lock Hard Reset Google Account TMPA
Did you forgot your google account or you cannot enable the data connection so that you can enter your google account to your phone to recover your phone.
In this tutorial we will remove the pattern lock of your phone (Sapphire). Just follow the instructions carefully so that you can fully restore your phone into its normal state.
*** Note: I am not responsible for bricking your phone, files uploaded are proven tested to support Sapphire 2.0 and 1.0..
"For Windows OS 64bit users I am not sure if this tutorial will work, because there is an issue with Research Downloa. But I can guarantee that this will work in 32bit Windows OS"
"TO ALL SAPPHIRE 2.0 USERS, DO NOT PROCEED IF YOU DO NOT WANT TO RISK BRICKING YOUR PHONE. NO AVAILABLE ROM FOR 2.0 AS OF THE MOMENT. THIS IS ONLY THE ALTERNATIVE WAY TO REMOVE FORGOTTEN PATTERN LOCK, PASSWORD OR GMAIL ACCOUNT. BUT AS IVE SAID I HAVE TRIED AND TESTED THIS FILE IN VERSION 2.0"
Lets proceed. Download First the 3 files.
Research Download ----> Here
UserBlock ------> Here
Spreadtrum Driver -------> Here
Spreadtrum Driver for Windows 7 ---> Here
After downloading the files. Extract it in one folder.
After downloading the files. Extract it in one folder.
1. Open Research Download
2. Load Packet, it is the first button in Research Download, look for CM Sapphire userdata(firmwares2you.blogspot.com).pac file...
3. Check the following below: ONLY THE THREE
✓FDL1
✓FDL2
✓UserData
4. Click in Calibration Page or Back up page (newest version) in Research Download. And UnCHECK ALL
5. Press OK, and Press Play Button.
Check Picture for you reference
To Connect your phone.
1. Press the Play button in Research Download. You notice that it is waiting for your phone to establish a connection.
2. Insert USB Cable while holding Volume UP or Down
3. If you correctly installed the driver for spreadtrum chip, it should detect your phone and continue flashing/resetting your phone.
I hope this tutorial helps. If you have any questions just drop a comment. Stay stuned for more tutorials.
If you find this post useful. A simple thank you in the comment box will suffice. ;)
If you find this post useful. A simple thank you in the comment box will suffice. ;)
Sunday, January 25, 2015
Seven Languages in Seven Weeks Ruby Day 2
In my previous post, I went through the Day 1 Ruby problems from Seven Languages in Seven Weeks. Today, Ill share my solutions to the Day 2 problems and some more thoughts about Ruby.
Ruby, Day 2: Thoughts
I originally learned Ruby (and many other programming languages) the "hacker way": that is, I did a 10 minute syntax tutorial, browsed other peoples code a bit, and then just started using the language, looking up missing pieces as I went. Although this is the most fun and productive way Ive found to get started with a language, it can also lead to missing some of the finer points and subtleties.
For example, until the "Ruby, Day 2" chapter, I never had a full appreciation for Ruby code blocks and the yield keyword. For example, even though I frequently used "times" to do looping, I never thought deeply about how it worked:
It turns out that times is just a function (slightly obscured because Ruby doesnt require parentheses for function calls) on the Integer class that takes a code block as an argument. Times could be implemented as follows:
This style of coding allows for some powerful possibilities. For example, it is surprisingly easy to introduce a "do in a transaction" function:
Using this, I can now trivially wrap any number of statements in a transaction:
The equivalent in less expressive languages, such as Java, often involves vastly more code, implementing arbitrary interfaces, anonymous inner classes, and a lot of very hard-to-read code. For comparison, here is an example of how Javas Spring Framework recommends wrapping JDBC code in transactions:
Ruby, Day 2: Problems
The Day 2 problems are only slightly tougher than Day 1. The most fun part was coming up with a way to keep the code as concise as possible.
Print 16
Print the contents of an Array of 16 numbers, 4 numbers at a time, using just "each". Now, do the same with "each_slice" in Enumerable.
Tree
Modify the Tree class initializer (original code here) so it can accept a nested structure of Hashes. Trickiest part here was that the "collect" function can call the passed in block with either one argument thats an Array or two arguments that represent the (key, value) pair.
Grep
Write a simple grep that will print the lines and line numbers of a file having any occurrence of a phrase anywhere in that line.
Ruby vs. Java, Round 2
I couldnt resist implementing the grep code in Java to see how it compares:
Its 33 lines long. The Ruby solution was a one-liner.
Ruby, Continued
Check out more Ruby goodness on Ruby, Day 3.
Read more »
Ruby, Day 2: Thoughts
I originally learned Ruby (and many other programming languages) the "hacker way": that is, I did a 10 minute syntax tutorial, browsed other peoples code a bit, and then just started using the language, looking up missing pieces as I went. Although this is the most fun and productive way Ive found to get started with a language, it can also lead to missing some of the finer points and subtleties.
For example, until the "Ruby, Day 2" chapter, I never had a full appreciation for Ruby code blocks and the yield keyword. For example, even though I frequently used "times" to do looping, I never thought deeply about how it worked:
It turns out that times is just a function (slightly obscured because Ruby doesnt require parentheses for function calls) on the Integer class that takes a code block as an argument. Times could be implemented as follows:
This style of coding allows for some powerful possibilities. For example, it is surprisingly easy to introduce a "do in a transaction" function:
Using this, I can now trivially wrap any number of statements in a transaction:
The equivalent in less expressive languages, such as Java, often involves vastly more code, implementing arbitrary interfaces, anonymous inner classes, and a lot of very hard-to-read code. For comparison, here is an example of how Javas Spring Framework recommends wrapping JDBC code in transactions:
Ruby, Day 2: Problems
The Day 2 problems are only slightly tougher than Day 1. The most fun part was coming up with a way to keep the code as concise as possible.
Print 16
Print the contents of an Array of 16 numbers, 4 numbers at a time, using just "each". Now, do the same with "each_slice" in Enumerable.
Tree
Modify the Tree class initializer (original code here) so it can accept a nested structure of Hashes. Trickiest part here was that the "collect" function can call the passed in block with either one argument thats an Array or two arguments that represent the (key, value) pair.
Grep
Write a simple grep that will print the lines and line numbers of a file having any occurrence of a phrase anywhere in that line.
Ruby vs. Java, Round 2
I couldnt resist implementing the grep code in Java to see how it compares:
Its 33 lines long. The Ruby solution was a one-liner.
Ruby, Continued
Check out more Ruby goodness on Ruby, Day 3.
Subscribe to:
Posts (Atom)
