[Solved] Can you give me some suggestions on my problem?

[ad_1] I applaud your decision to follow your approach through. Allow me to start a step-by-step answer according to the compromise described here (applicable to homework, challenges and very disciplined self-learners like you):How do I ask and answer homework questions? Step 1: You program is able to look at digit by digit of the number … Read more

[Solved] How to find the maximum’s index?

[ad_1] You have declared: public double MaxKiv() { So yes, obviously this gives you a double. To get an int instead, simply change the declaration to return an int: public int MaxKiv() { The value you are returning, index, is already declared an int, so this should be enough fix your issue. 0 [ad_2] solved … Read more

[Solved] Can you help me to simplify codes OR in PHP

[ad_1] In answer to your question, no, you can’t use OR statements this way. What you can do is make $quantity conditionally based on the data you’ve got, for example: $price = !empty($item->unit_price) ? $item->unit_price : $item_kit->unit_price; $quantity = $fetch_barcode[‘item_price’] / $price [ad_2] solved Can you help me to simplify codes OR in PHP

[Solved] sorting by first digit

[ad_1] .sort() should reorder the items like that by default. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. console.log( [1, 2, 3, 4, 10, 11, 12, 20, 29, 30, 39, 40, 49, 101, 110, 119, 123].sort() ); 1 [ad_2] solved sorting … Read more

[Solved] Implementation of hash_multimap in C++

[ad_1] The problems seem pretty straightforward. warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use … Read more

[Solved] Prevent duplicate user from being added to database

[ad_1] To preserve the integrity of your database you should add a unique constraint to this column in your database and then catch the exception of the violation of this constraint when performing the UPDATE/INSERT query. [ad_2] solved Prevent duplicate user from being added to database

[Solved] Pure CSS static starfield [closed]

[ad_1] As an exercise in “let’s see what happens if…” the following code was directly stolen from here and modified slightly to be static. The result is predictable: a basic, repetitive star field. <html> <head> <title>Testing a starfield</title> <style> #space, .stars { overflow: hidden; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } … Read more

[Solved] F# : not sure how to start [closed]

[ad_1] 3. type Line = {a:double; b:double} let LinesIntersection x y = if x.a <> y.a then Some ((x.b – y.b)/(y.a – x.a), (y.a*x.b – x.a*y.b)/(y.a – x.a)) else None let l1 = {a = 2.0; b = -3.0} let l2 = {a = -3.0; b = 2.0} let l3 = {a = 2.0; b … Read more

[Solved] sql aggregate and split [closed]

[ad_1] This uses STRING_AGG to aggregate the strings into one long one, and then a Tally Table to split into the new rows. It is assumed you have a column to order by. if you do not, you cannot achieve what you are after without one as data in a table is stored in an … Read more