[Solved] How can I have xy coordinates in a grid that can’t be used? [closed]

[ad_1] Just loop over the creation until your condition is satisfied: var forbidden = new List<Tuple<int, int>>(); forbidden.Add(new Tuple<int, int>(5, 5)); forbidden.Add(new Tuple<int, int>(7, 9)); while(true) { x = random.Next(0, 20); y = random.Next(0, 20); if(forbidden.All(t => x != t.Item1 || y != t.Item2)) break; } This way, the loop will only terminate if you … Read more

[Solved] How to open one window and close another on button click [closed]

[ad_1] Let’s say you have a main form. Call it frmMain. In frmMain before IntializeComponent frmLogin loginForm = new frmLogin(); //Set the dialog result on login form depending on ok and cancel button //close the application if user wants to cancel if(loginForm.DialogResult == DialogResult.Cancel) this.Close(); //else you can continue to call your frmMain initializeComponent method … Read more

[Solved] What is wrong about this SQL statement? [closed]

[ad_1] You can’t use IF as a statement in a query, it can only be used in a stored procedure. To do what you want, you need two separate queries. Try this: $del_query = “DELETE FROM favoritebills WHERE userid = ‘$userid’ and billid = ‘$billid'”; $ins_query = “INSERT INTO favoritebills (userid,billid) VALUES($userid,$billid) “; $res = … Read more

[Solved] How to delete items from recyclerview after 3 days automatically

[ad_1] You should save each date when you fill your recyclerView, maybe in a SQLite database, after that, you can check that register in onCreate() method of your activity, and add a condition (if has passed three days), if true, just refill it like this: mRecyclerAdapter = new mRecyclerAdapter(yourItemList); mRecyclerView.setAdapter(mRecyclerAdapter); mRecyclerView.getAdapter().notifyDataSetChanged(); After this, overwrite the … Read more

[Solved] MYSQL/PHP SELECT DISTINCT

[ad_1] Looks like the query is actually pulling 3 results as it should. You are just letting one of them go: function adminnav (){ $pagewcoms = mysql_query(…); // HERE YOU FETCH ONE ROW BUT DO NOTHING WITH IT $idnavrow = mysql_fetch_row($pagewcoms); while ($itest = mysql_fetch_row($pagewcoms)) { echo “$itest[0] <br />”; } } If you just … Read more

[Solved] Graph portion of Excel table in Word with a macro

[ad_1] go back to the beginning insert a document variable in a new word document using following sequence (word 2016) insert tab … text … quick parts … field … categories: document automation … field names: docVariable … put in variable name xxxx then run this code Sub aaa() ‘ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes ‘ toggle … Read more

[Solved] How I can convert this function to php?

[ad_1] This should do the trick: <?php function hash_data($data) { $data = mb_convert_encoding($data, ‘UTF-16LE’, ‘UTF-8’); $hash = hash(‘sha512’, $data, true); return base64_encode($hash); } $user=”admin”; $password = ‘secret’; $key = “7f9facc418f74439c5e9709832;0ab8a5:OCOdN5Wl,q8SLIQz8i|8agmu¬s13Q7ZXyno/yv.XSN1DsgKq9zi]XrE^gx8vPC^Av8=e/bF4pX1Oe hfqGb#JK~RONkS1wx5w=RE0$” . “DxZSu7evPfshBw7p5Gb&suEkw=RE0DxZSu7e´vPfshBw7p+5GbsuEkw=H1fTWFXfsXo}z0fOd{KTt[IdDG2y6E=”; $data = $user . $password . $key; // 6xecArT38JVtGKH2yQs/T6btOUF41vW5ptaPjgrd8hTaZZKnbJed5551LuYV7vR/Dr3Jb873JMvX0je+8XUpxw== echo hash_data($data); [ad_2] solved How I can convert this function to php?

[Solved] When I call the startActivity(i) the error is shown (see below) my code is Intent i=new Intent(getApplicationContext(),NewRecipe.class);

[ad_1] When I call the startActivity(i) the error is shown (see below) my code is Intent i=new Intent(getApplicationContext(),NewRecipe.class); [ad_2] solved When I call the startActivity(i) the error is shown (see below) my code is Intent i=new Intent(getApplicationContext(),NewRecipe.class);

[Solved] JAVA: Split main into methods and put in another class? [closed]

[ad_1] First, try to split your code in methods: while (action != 6) { printIntro() action = getAction(); switch (action) { case 1: { contact = readContact() contacts.add(contact); try { writeContact(contact); System.out.println(“Your contact has been saved.”); } catch (IOException e) { e.printStackTrace(); } } break; etc. For splitting this thing into classes, first determine the … Read more

[Solved] Print the same values for 10 times in active cell with comma separated

[ad_1] Put this into your Commandbutton_Click event handler: Dim strValueToPrint as String, strOutput as String Dim intRepeatCount as Integer, i as Integer strValueToPrint = “1” ‘Change this to be the value that you want to repeat for i = 1 to intRepeatCount strOutput = strOutput & strValueToPrint & “,” Next Activecell.Value = strOutput 5 [ad_2] … Read more