[Solved] Can’t insert data into mysql database using PHP [closed]

[ad_1] Edited: Try just adding this code: <?php $message = mysql_real_escape_string(bbcode_to_html($message)); $sqlquery1 = ‘insert into topics (id_parent, id, id_user, title, message, id_author, timestamp, timestamp_user) select “‘ . $dn1[‘id_parent’] . ‘”, “‘ . $id . ‘”, max(id_user)+1, “”, “‘ . $message . ‘”, “‘ . $_SESSION[‘userid’] . ‘”, “‘ . time() . ‘”, “‘ . time() … Read more

[Solved] Which Lists will/won’t compile?

[ad_1] The first one is a valid array declaration. The second one has an incorrect reference type. In the third one, you cannot create an object of type List as it is an interface For the last one, it’s ArrayList, not Arraylist. List[] myList2 = new List[5]; List myList5 = new ArrayList(); [ad_2] solved Which … Read more

[Solved] program can’t recognize a char

[ad_1] I have found : getting errors stray ‘\342’ and ‘\200’ and ‘\214’ and it coused by copy strange characters from web;) So it’s works now 1 [ad_2] solved program can’t recognize a char

[Solved] Multithreaded Windows Service

[ad_1] Yes it’s perfectly possible to create a multi-threaded windows service. Just spawn a new thread when you receive a message via your preferred way of handling things. This is the manual way, you could also use a background worker: Thread t = new Thread(() => { // Do some work }); There’s nothing preventing … Read more

[Solved] php class error, it wont echo teacher [closed]

[ad_1] As people have mentioned in the comments, your code is filled with all sorts of errors. What I believe you want is this: class Person { function __construct($firstname,$lastname,$age) { $this->isAlive = true; $this->firstname = $firstname; $this->lastname = $lastname; $this->age = $age; } } $teacher = new Person(“boring”, “12345”, 12345); $student = new Person(“boringw”, “12345w”, … Read more

[Solved] Cannot allocate a vector in R

[ad_1] Simplest answer: Purchase more RAM. If you work in R with large datasets often, it’s worth it. If you don’t have enough memory to load your files, you may not have enough to manipulate them as you want either. Let’s assume that you could hold this data in RAM and manipulate it as you … Read more

[Solved] Any one explain how this works? [closed]

[ad_1] The code calculates a number of even numbers (evenCount) and odd numbers (oddCount) in the array. Every two even numbers make a pair that gives an even number in sum. The number of such pairs is evenCount * (evenCount – 1) /2. There is evenCount ways to select the first even number, evenCount – … Read more

[Solved] Java: find the output of the code with double quotes and assignment operator [closed]

[ad_1] System.out.println(“”+4+2); -> 42 Because first you are adding and empty string and a int value. Result will be a string. Then you are adding an another int to that string. So it will concatenate the just string representation of value to the previous string and output 42 System.out.println(4+2+””); -> 6 Here you are first … Read more

[Solved] How to strip parts of the given url using preg_replace (php) [closed]

[ad_1] For this specific case, you don’t need a regular expression, you can just parse the url $url=”http://dev.time.com/wp-content/uploads/2014/08/sheep-shrek-300×199.jpg?w=360″; $parts = parse_url($url); echo $parts[‘host’] . $parts[‘path’]; Missed that you want to strip the size … $data = preg_replace(‘/(-\d+x\d+)\.jpg/’, ‘.jpg’, $data); 1 [ad_2] solved How to strip parts of the given url using preg_replace (php) [closed]