[Solved] Find and replace dynamic values via for loop

[ad_1] I think this is what you want, List<string> keys = new List<string>() { “name”, “age”, “param3” }; string url = “http://www.test.com/test.aspx?testinfo=&|&;”; Regex reg = new Regex(“&”); int count = url.Count(p => p == ‘&’); for (int i = 0; i < count; i++) { if (i >= keys.Count) break; url = reg.Replace(url, keys[i], 1); … Read more

[Solved] How can I make the my listview interactive? [duplicate]

[ad_1] Try this: listView = (ListView) findViewById(R.id.my_list_view); listView.setAdapter(someAdapter); listView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { switch(position) { case 0: Intent intent = new Intent(); intent.setClassName(“com.test”, “com.test.SubMenuActivity”); startActivity(intent); break; case 1: // Do something else … break; // … } }); [ad_2] solved How can I make the my … Read more

[Solved] Turing Machine Simulator [closed]

[ad_1] Try something like this: #include <iostream> #include <string.h> #include <vector> #include <fstream> #include <cstdlib> #include <stdio.h> #include “tm.h” using namespace std; tm::tm(char *fn) { current = “”; readFile(fn); } void tm::readFile(char *fn) { char temp; string word = “”; ifstream indata; bool blank = false; indata.open(fn); //opens the file if(!indata) //error message if the … Read more

[Solved] PYTHON codes with a lesson from a book [closed]

[ad_1] Briefly: cities is instantiated as a dictionary, and some key/value are inserted here. Both key and values are string for CA -> San Francisco, MI -> Detroit, etc. etc. a function named find_city is defined, it takes two input parameters (themap and state); to the cities dictionary is added another key/value, where key is … Read more

[Solved] Free Web Servers PHP [closed]

[ad_1] I’ve found izfree to be pretty good when I’ve needed quick hosting in a pinch. I wouldn’t recommend it for anything in production though as its uptime isn’t as good as it could be. EDIT: Although looking at it, it may not even be maintained anymore. I last used it in 2009… 1 [ad_2] … Read more

[Solved] How to put the required parameters in link that accesses php?

[ad_1] First, you have to fix your query string, the ? starts the string and each additional argument is prefixed with &: www.example.com/[email protected]&Password=something50 Now all of the variables will be available in the $_GET array $_GET[‘Email’]; // is equal to “[email protected]” $_GET[‘Password’]; // is equal to “something50” You should never concatenate variables in a SQL … Read more

[Solved] How can I use the function toupper() in this code? [closed]

[ad_1] You need to toupper every single character, e.g. while( (leido = read(0,&buffer,sizeof buffer)) > 0){ for (int i=0; i<leido; i++) { buffer[i] = toupper((unsigned char)buffer[i]); } retorno = write(1,&buffer,leido); } 2 [ad_2] solved How can I use the function toupper() in this code? [closed]

[Solved] Combine each column from 2 different table into one table

[ad_1] Select t2.account_number,t2.proposedaddress, t1.currentaddress From table2 t2 left outer join table1 t1 on (t1.account_number=t2.account_number and Upper(Trim(t1.currentaddress)) like Upper(Trim(t2.proposedaddress))) 5 [ad_2] solved Combine each column from 2 different table into one table

[Solved] MS SQL Query for Opening Stock calculation

[ad_1] Thanks to all, i have worked out with my same query, although seed was slow. query is mentioned below:- select Item, Location,[Transaction Date],Price,Qty, Price_change , (select isnull(sum(qty),0) from #temp c where c.item=p.item and c.Location=p.Location and c.[Transaction Date] < p.[Transaction Date]) [Opening Stock] from #temp p [ad_2] solved MS SQL Query for Opening Stock calculation