[Solved] can’t understand Angular 2

[ad_1] Without any additional information, it looks like you haven’t given the component’s metadata a selector. The selector identifies a matching HTML element in the app’s index.html file to insert the component’s HTML. An example: index.html <!doctype html> <html> <head> <meta charset=”utf-8″> <title>My App</title> <base href=”https://stackoverflow.com/”> <meta name=”viewport” content=”width=device-width, initial-scale=1″> <link rel=”icon” type=”image/x-icon” href=”favicon.ico”> </head> … Read more

[Solved] Parse error: syntax error, unexpected ‘{‘ in C:\wamp\www\reg.php [closed]

[ad_1] $requiredfields = (“firstname”,”lastname”,”password1″,”password2″,”gender”); This line is invalid. You should have the keyword array before the (. In general, use a code editor that has bracket matching. This would help you find missing )}] and extra ({[ more easily. Some even include HTML tag matching in a similar way. http://notepad-plus-plus.org/ is a good example. [ad_2] … Read more

[Solved] What is canvas in HTML 5?

[ad_1] canvas in HTML 5 The HTML element is used to draw graphics, on the fly, via JavaScript. The element is only a container for graphics. You must use JavaScript to actually draw the graphics. Canvas has several methods for drawing paths, boxes, circles, text, and adding images. check this link I’m added an example … Read more

[Solved] Reading a text file [closed]

[ad_1] Open file using fgets or get line function read the file into temporary string check first character… Make sure to use tolower, before comparing void findString(char *filename, char ch) { char temp[100]; FILE *infile = fopen(filename, “rw”); while(infile != NULL) { fgets(temp,100,infile); if(tolower(temp[0]) == ch) cout << temp; } fclose(infile); } [ad_2] solved Reading … Read more

[Solved] NPM command arguments

[ad_1] The -g is short for global. It installs the module globally instead of in the current directory. See this for more info: https://docs.npmjs.com/cli/npm [ad_2] solved NPM command arguments

[Solved] Switch case Java error in coding [closed]

[ad_1] char eng = jTextField1.getText().charAt(0); //if you method return a String it gets the 1st character switch(eng){ case’a’: case’e’: case’i’: case’o’: case’u’: jTextField2.setText(“It is a vowel”); break; default: jTextField2.setText(“It is not a vowel”); break; } But better way : char eng=jTextField1.getText().charAt(0); ArrayList<Character> list=new ArrayList<Character>(); list.add(‘a’); list.add(‘e’); list.add(‘i’); list.add(‘o’); list.add(‘u’); list.add(‘y’); if(list.contains(eng)){ jTextField2.setText(“It is a vowel”); … Read more

[Solved] Queue of Arrays in C# [closed]

[ad_1] This is actually pretty easy. A queue of ints is no different than a queue of any other type, really. You could just as easily have a queue of lists or a queue of queues or anything like that. I’m using the queue constructor that accepts an IEnumerable to initialize these by the way. … Read more

[Solved] How is this code in PHP vulnerable to SQL Injection?

[ad_1] First, $email = filter_input(INPUT_GET, ’email’); does nothing it’s the same as $email = filter_input(INPUT_GET, ’email’, FILTER_DEFAULT);, and FILTER_DEFAULT is documented as “do nothing”. Second, PDO’s Query function does appear to support multiple statements (albeit in a rather annoying to use manner, and I can’t say I’ve personally played with it). PHP PDO multiple select … Read more

[Solved] How to cluster with K-means, when number of clusters and their sizes are known [closed]

[ad_1] It won’t be k-means anymore. K-means is variance minimization, and it seems your objective is to produce paritions of a predefined size, not of minimum variance. However, here is a tutorial that shows how to modify k-means to produce clusters of the same size. You can easily extend this to produce clusters of the … Read more