[Solved] C# How to modify text file [closed]

Add this reference first System.IO Then: For reading: string[] accounts= File.ReadAllLines(“accounts.txt”); //each item of array will be your account For modifying : accounts[0] += “|1”;//this adds “|1” near password accounts[0].Replace(“|1″,”|0”); this will change the “|0” text to “|1” And For writing: File.WriteAllLines(“accounts.txt”,accounts); 4 solved C# How to modify text file [closed]

[Solved] Merging arrays of dictionaries

How about the following: //define data1 and Data2 var data1 = new[]{ new {id = 1, name = “Oneeee”, version = 2}, new {id = 2, name = “Two”, version = 1}, new {id = 3, name = “Three”, version = 2}, new {id = 4, name = “Four”, version = 1}, new {id = … Read more

[Solved] In C#, is there any more elegant way to take a DateTime and calculate how many months until the “next” Quarter? [closed]

This should do it: int untilNextQuarter = 4 – (currentMonth % 3); Or a slightly clearer but slightly less efficient approach: int[] remainingMonths = new[] { 3, 2, 4 }; int untilNextQuarter = remainingMonths[(currentMonth – 1) % 3]; solved In C#, is there any more elegant way to take a DateTime and calculate how many … Read more

[Solved] How to echo url and database variable [closed]

You need to use dot to concate constant string with variables: echo ‘<a href=”‘.$url.'”>’.$name.'</a>’; for security reason you need to take care about propper variable escaping. Check php.net doc for htmlspecialchars and htmlentities 1 solved How to echo url and database variable [closed]

[Solved] Objective C: How to read from saved files? [closed]

Using NSURLs NSString *fileName = [NSString stringWithFormat:@”%f.mp4″,[[NSDate date] timeIntervalSince1970]]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSURL *documentsDirectoryURL = NSURL *URLForDirectory = [[fileManager URLsForDirectory: NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; NSURL *fileURL = [NSURL URLWithString:fileName relativeToURL:URLForDirectory]; solved Objective C: How to read from saved files? [closed]

[Solved] Javascript ajax don’t work

First callback is not defined and second you also need to call get_lan() function to get it work Updated code function get_lan() { var lan_code = document.getElementById(‘customDropdown1′).value; var params = “lan=” + lan_code; $.ajax({ type: “POST”, url: “api/get_lan.php”, data: params, success: function(result) { document.getElementById(“lan_code”).innerHTML = result; } }); } get_lan(); solved Javascript ajax don’t work

[Solved] Javascript time spent playing [closed]

Your question doesn’t give much details to help you. But here are some links for javascript timers. http://javascriptweblog.wordpress.com/2010/06/28/understanding-javascript-timers/ http://ejohn.org/blog/how-javascript-timers-work/ You may have a play/pause button. And trigger functions on pressing that button. Try something using this information, when stuck in some problem, post what you tried, and people will help you. solved Javascript time spent … Read more

[Solved] Create an array of array values by key [closed]

I could write the code for you, but that feels wrong. Let me point you in the right direction. Start here: http://php.net/manual/en/control-structures.foreach.php You can iterate the array using a key-value foreach and use each array item, which is another array, to access the count and create your new array. Good luck! 1 solved Create an … Read more

[Solved] When I run this PHP code nothing prints to the screen [closed]

There are multiple problems with your latest revision: Problem #1: You should use some variant of mysql_fetch_ in order to fetch the rows from the resource returned by mysql_query(). Using mysql_result can be inefficient. Usually, people use mysql_fetch_assoc(). This will return an array, which you can then access using its key, which depends on which … Read more

[Solved] how to post data to two php pages simultaneously & parallely execute them? [closed]

You can send two ajax request using javascript. Using jQuery it will be something like $.post(‘first_page.php’, {data: ‘Some Data’}, function(response) { // process 1st page }); $.post(‘second_page.php’, {data: ‘Some Data’}, function(response) { // process 2nd page }); solved how to post data to two php pages simultaneously & parallely execute them? [closed]