[Solved] Create directory structure in unix [closed]

current_year=$(date +%Y) next_month=$(($(date +%m) + 1)) locale_next_month=$(date -d$current_year/$next_month/1 +%B) for day_of_month in $(seq 1 31) do if day_of_year=$(date -d$current_year/$next_month/$day_of_month +%j 2> /dev/null) then mkdir -p /home/applications/app_name/$current_year/$locale_next_month/$day_of_year fi done 1 solved Create directory structure in unix [closed]

[Solved] ggplot Grouped barplot with R

You can try library(tidyverse) d %>% gather(key, value, -PtsAgRdTm) %>% ggplot(aes(x=PtsAgRdTm, y=value, fill=key)) + geom_col(position = “dodge”) You transform the data from wide to long using tidyr’s gather function, then plot the bars in a “dodge” or a “stack” way. 3 solved ggplot Grouped barplot with R

[Solved] How to convert a letter to an another letter in Java [duplicate]

You could use something like the following algorithm to accomplish this: // Our input string. String input = “I love fish”; // Contains the “encrypted” output string. StringBuilder encrypted = new StringBuilder(); // Process each character in the input string. for (char c : input.toCharArray()) { if (Character.toLowerCase(c) != ‘a’ && Character.isLetter(c)) { // If … Read more

[Solved] How to put javascript in html file

Following can be a reason for your issue Invalid src path in the script tag Javascript might be disabled in your browser. You have a script error/exception that stopped entire page’s script execution. Maybe you have an Ajax request that won’t work if your open it as a local file protocol. e.g., file:// What can … Read more

[Solved] Reading multiple lines of strings from a file and storing it in string array in C++

NumberOfStrings++ is outside of your for loop when you read (i.e. it only gets incremented once). Also please consider using std::vector<std::string> instead of a dynamic array. Here’s a version of your code using std::vector instead of an array: #include <vector> #include <fstream> #include <iostream> #include <string> class StringList { public: StringList(): str(1000000), numberOfStrings(0) { std::ifstream … Read more

[Solved] Sort results of query ASC [closed]

ORDER BY user.LName ASC is correct. You’re probably just missing a space between it and the id. Check for the sql error $sql = ” SELECT user.FName, user.LName, user.HerbalifeID, user.UplineS, registratie.PartnerFName, registratie.PartnerLName, registratie.NaamVIP1, registratie.NaamVIP2, registratie.NaamVIP3 FROM registratie INNER JOIN user ON registratie.userID = user.UserID AND registratie.eventID=$id ORDER BY user.LName ASC “; $res=mysqli_query($con,$sql); if (!$res) { … Read more

[Solved] Kendo UI Grid – Add/Remove filters dynamically

In order to filter by text box you can hook up a keyUp event in order to retrieve the value. You can then add this as a filter to the existing filter object. $(‘#NameOfInput’).keyup(function () { var val = $(‘#NameOfInput’).val(); var grid = $(“#yourGrid”).data(“kendoGrid”); var filter = grid.dataSource.filter(); filter.filters.push({ field: “NameOfFieldYouWishToFilter”, operator: “eq”, value: val, … Read more

[Solved] Starting an Activity on Condition

Try using this: if ( “Both”.equals ( s2 ) ) { //Do something } s2 == “Both” will not compare the text in Java. You can also use this to ignore casing: if ( “Both”.equalsIgnoreCase ( s2 ) ) { //Do something } 0 solved Starting an Activity on Condition

[Solved] algorithm removing duplicate elements in array without auxillay storage

OK, here’s my answer, which should be O(N*N) worst case. (With smaller constant, since even worstcase I’m testing N against — on average — 1/2 N, but this is computer science rather than software engineering and a mere 2X speedup isn’t significant. Thanks to @Alexandru for pointing that out.) 1) Split cursor (input and output … Read more

[Solved] Regex pattern for split

This regex does the trick: “,(?=(([^\”]*\”){2})*[^\”]*$)(?=([^\\[]*?\\[[^\\]]*\\][^\\[\\]]*?)*$)” It works by adding a look-ahead for matching pairs of square brackets after the comma – if you’re inside a square-bracketed term, of course you won’t have balanced brackets following. Here’s some test code: String line = “a=1,b=\”1,2,3\”,c=[d=1,e=\”1,11\”]”; String[] tokens = line.split(“,(?=(([^\”]*\”){2})*[^\”]*$)(?=([^\\[]*?\\[[^\\]]*\\][^\\[\\]]*?)*$)”); for (String t : tokens) System.out.println(t); Output: … Read more

[Solved] How to create custom type in angular [closed]

It depends on what you mean by type exactly. If you want to define a “type” that you can use in TypeScript strong typing, then you have several choices. You can build an interface like this: export interface Product { productId: number; productName: string; productCode: string; releaseDate: string; price: number; description: string; starRating: number; imageUrl: … Read more

[Solved] How to make Java Set? [closed]

Like this: import java.util.*; Set<Integer> a = new HashSet<Integer>(); a.add( 1); a.add( 2); a.add( 3); Or adding from an Array/ or multiple literals; wrap to a list, first. Integer[] array = new Integer[]{ 1, 4, 5}; Set<Integer> b = new HashSet<Integer>(); b.addAll( Arrays.asList( b)); // from an array variable b.addAll( Arrays.asList( 8, 9, 10)); // … Read more