[Solved] Wrap string in brackets but also having random value in string: [closed]

You can try this: str = str.replace(/\w*\(\d*\)/g, function () {return ‘(‘ + arguments[0] + ‘)’;}); A live demo at jsFiddle EDIT Since you’ve changed the conditions, the task can’t be done by Regular Expressions. I’ve put an example, how you can do this, at jsFiddle. As a side effect, this snippet also detects possible odd … Read more

[Solved] C for loop not working

I tried to run that and my outputs for r1 and r2 are qwdaweqwe asdas–sd (two spaces) and basically it is what the code should be doing. But if I get your intention right, you want to work with those empty strings. Then you should be feeding your function with different numbers, because array indexing … Read more

[Solved] How to make small changes for console output without repeating all unchanged values

You should not reprint all the map for each cycle. The better way is to use Console.SetCursorPosition method and rewrite just modified symbols: foreach(var changedSymbol in changes) { Console.SetCursorPosition(changedSymbol.Row, changedSymbol.Column) Console.Write(changedSymbol.Value); } 1 solved How to make small changes for console output without repeating all unchanged values

[Solved] How to find and calculate the number of duplicated rows between two different dataframe? [closed]

You can sorted both DataFrames – columns c_x and c_y, for movies is used DataFrame.pivot, count non missing values by DataFrame.count and append to df1: df2[[‘c_x’,’c_y’]] = np.sort(df2[[‘c_x’,’c_y’]], axis=1) df2[‘g’] = df2.groupby([‘c_x’,’c_y’]).cumcount().add(1) df2 = df2.pivot(index=[‘c_x’,’c_y’], columns=”g”, values=”movie”).add_prefix(‘movie’) df2[‘number’] = df2.count(axis=1) print (df2) g movie1 movie2 number c_x c_y bob dan c f 2 uni a … Read more

[Solved] Hadamard matrix code

scanf doesn’t print that string, that’s just used to check the format of the input. Try: printf(“Input N value: “); scanf(“%d”, &N); solved Hadamard matrix code

[Solved] Not sure what it wrong here and how to fix it [duplicate]

myDictionary appears to be a Dictionary<string, string> type. Seeing as you store “Pokemon Name:” and “name” just fine one line above. As such, you can just call hp.ToString() to store it. Make sure to once again convert it back to int when using it though. Alternatively, you can make a Dictionary<string, object> storage to keep … Read more

[Solved] How to insert a div in PHP properly? [closed]

The “best” way (in my opinion) to prevent “spaghetti” style is to differentiate php and html like: <?php while($row = mysqli_fetch_array($result){ ?> <div class=”imagem”> <img src=”<?php echo $row[‘logo’];?>” width=”180px”> </div> <?php } Side note: Next time if your question have a code use the tools <> (html/js) or {} (php and others lang) 1 solved … Read more