[Solved] How do i add space between this php variables

You’re generating invalid HTML. This: ‘<option value=”. $spName . ” ‘ . $spPro .’>’ ^— WITH the added space Will produce something like this: <option value=SomeName SomeProfession> The browser has no way of knowing that these two values are part of the same attribute. In short, you forgot the quotes. You want to generate something … Read more

[Solved] POSITION STICKY CSS

If you want to avoid such overlap you need to consider more container where you wrap each date add its messages in the same container. Doing this, the previous day will scroll before the next one become sticky * { margin: 0px; padding: 0px; } .chat { overflow: auto; border: solid 1px black; left: 50%; … Read more

[Solved] What’s wrong in this JavaScript code?

I have to agree with comments above, not sure what you’re doing but…the problem is that a submit handler is a function not the string you’re assigning, this: subBut.onclick = (document.getElementById(‘helllo’).innerHTML=(submi(document.getElementById(‘user’).value, document.getElementById(‘passw’).value))); should be: subBut.onclick = function() { document.getElementById(‘helllo’).innerHTML= submi(document.getElementById(‘user’).value, document.getElementById(‘passw’).value); return false; //for testing, prevent form submission }; You can test the updated version … Read more

[Solved] Format a string, clear specific characters in a string? [closed]

According to what I understand from your question. This may work for you. string FormatString(string text) { // Get the last string and replace the “-” to space. string output = text.split(“https://stackoverflow.com/”).Last().Replace(“-“,” “); // convert it into title case output = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(output); return output; } solved Format a string, clear specific characters in a string? … Read more

[Solved] Simple password encryption – how do i do? [closed]

In future, I’d suggest you refrain from begging for answers without first showing some code you’ve tried. That being said, I’ll bite. import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.SecureRandom; public class EncryptHelper { public static String ehashAndSalt(String passedpass) throws NoSuchAlgorithmException, NoSuchProviderException { String passwordToHash = “password”; String salt = getSalt(); String securePassword = getSecurePassword(passwordToHash, … Read more

[Solved] javascript remove NULL from the result

First, you can get rid of some of that inner DOM selection by making your initial qSA selection more specific: “.product_card a .product_card__title”. Then you can use .filter() by returning the result of checking if each element .includes() the “rocker” text. Do this before mapping the .href. Finally, .map() those results to the .href of … Read more

[Solved] Fast Ruby but slow Rails

1.Why “rails” command is very slower than “ruby”? ruby invokes the Ruby interpreter, which is a compiled executable. rails invokes the Ruby interpreter plus loads many Ruby libraries that need to be located then parsed by the interpreter, before executing your Rails command. So rails –version will always take longer than ruby –version because it … Read more

[Solved] Why do I get a NumberFormatException when I convert this

If you don’t provide a valid long as input it throws NumberFormatException. See below: long converted = Long.valueOf( “3” ); System.out.println( converted ); Prints 3 try{ long converted = Long.valueOf( “TEST” ); System.out.println( converted ); } catch( NumberFormatException e ){ System.out.println( “Your input is wrong..” ); } This throws NumberFormatException, it’s because not a valid … Read more

[Solved] Sum of LCM range from 1 to 10^9 [closed]

// In pseudocode a very basic algorithm: main for i: 1 to 1000000000 if (TestValue(i)) Output(i) TestValue(i) for j: 1 to 99 if j does not divide i evenly return false return true Of course, this won’t be very performant. You might notice that if a number is evenly divisible by all numbers between 1 … Read more

[Solved] Generate similar domain names with Python [closed]

Good question… This is really hard to answer but I attempted a solution(what engineers try to do) that might work based on analyzing the pattern example you gave: import string import random def generate_similar(string): # Generates similar name by substituting vowels similar_word = [] for char in string: if char.lower() in ‘aeiou’: similar_word.append(random.choice(string.letters).lowercase()) else: similar_word.append(char) … Read more

[Solved] call method with parameters java [closed]

There’s a couple factors missing from your question that makes me unable to completely answer them, but: Is the courseGrade method in a separate class or in the same class as your public static void main method? Yes: Create a new instance of the separate class by doing: public SeparateClass instance = new SeparateClass(); inside … Read more

[Solved] Using sum operation

I think you need this query: SELECT CompanyName, SUM(COALESCE(salary, 0) + COALESCE(bonus, 0) + COALESCE(others, 0)) AS TotalRemunaration FROM yourTable GROUP BY CompanyName I use COALESCE(fieldName, 0) that will return 0 when value of fieldName is Null. 0 solved Using sum operation

[Solved] Grab link from database field and use it to turn another field I’ve grabbed into link [closed]

I fixed it myself. I simply updated the quote field in the database to include the link. For example: <a href=”http://www.bestmoviequote.com/movies/gone-with-the-wind.php”>”Frankly, my dear, I don’t give a damn.”</a> It correctly displays the link on the page. Thanks for all your help. solved Grab link from database field and use it to turn another field I’ve … Read more

[Solved] Password RegExpression [closed]

^(?=.*[A-Z]{1,})(?=.*[a-z]{1,})(?=.*[0-9]{1,})(?=.*[!@#\$%\^&\*()_\+\-={}\[\]\\:;”‘<>,./]{1,}).{4,}$ should do it. Explaination: ^ start (?=.*[A-Z]{1,}) at least one upper (?=.*[a-z]{1,}) at least one lower (?=.*[0-9]{1,}) at least one digit (?=.*[!@#\$%\^&\*()_\+\-={}\[\]\\:;”‘<>,./]{1,}) at least one of the mentioned chars .{4,} min length 4 $ end solved Password RegExpression [closed]