[Solved] Split multiple Words in a string [closed]

I am unsure about the language, but for C# you can use the following: string s1 = “1 AND 1 OR 1”; string s2 = s1.Replace(“AND”, “,”).Replace(“OR”, “,”); Console.WriteLine(s2); Which doesn’t use regular expressions. If you want an array, you can use the following: string s1 = “1 AND 1 OR 1”; string[] s2 = … Read more

[Solved] Getting the program to count the total amount of a char input from a user through a text file

Here is the code that u can formulate to find a letter count from a text file.i have pushed an harcoded letter ‘a’ u can change it to dynamic also. import java.io.*; import java.util.Scanner; public class CountTheNumberOfAs { public static void main(String[] args)throws IOException { String fileName = “JavaIntro.txt”; String line = “”; Scanner scanner … Read more

[Solved] How to insert to a database with foreach? [closed]

You need to add the MySQL query inside the foreach() function, as well: foreach ($qurum as $value) { $query2 = “INSERT INTO test (data_id, col2) VALUES ($id, $value)”; mysqlExecute($query2); } Note that mysqlExecute() does not exist, you need to use your own function to execute the query. Also note that executing SQL statements in a … Read more

[Solved] Get posts that matches specific terms of multiple custom taxonomies

I’ve finally solved this problem. I’m copying the code because it may help someone 🙂 I’ve found the solution by populating an arrray and checking if a brand is or is not there, so I only get each brand one time. <?php //Query to match department $args = array( ‘tax_query’ => array( array( ‘taxonomy’ => … Read more

[Solved] How to place an image into header.php? [closed]

Don’t use a relative URL. If you look at the source you are probably trying to load the image from http://sitename.com/images/ when what you likely want is http://sitename.com/wp-content/themes/themename/images/. Assuming the image is in the theme directory in a folder that shares a directory with style.css, do this: <img id=”topL” src=”https://wordpress.stackexchange.com/questions/78271/<?php echo get_stylesheet_directory_uri(); ?>/images/img01.png”/> http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri 3 … Read more

[Solved] How would I set up function to calculate the area of a circle – C

#include <stdio.h> void area_circum(double radius); int main() { double radius; printf(“Please enter the radius of the circle: “); scanf(“%lf”, &radius); area_circum(radius); return 0; } void area_circum(double radius) { double PIE = 3.141; double areaC = 0; areaC = PIE * radius * radius; printf(“Area of circle : %0.4f\n”, areaC); } 5 solved How would I … Read more

[Solved] Separated Comment from Post

ahaaa 😀 it’s success, I use CSS. Here the screenshot the code i use on single.php : <!– post section –> <section class=”post-section all-round grid”> <div class=”content_wrapper”> <!– YOUR CONTENT –> </div> </section> <!– end .post-section –> <!– comment section –> <section class=”comment-section all-round grid”> <?php if ( comments_open() || get_comments_number() ) : ?> <?php … Read more

[Solved] How to hide WordPress files / structure? [closed]

If you are new to php and mod_rewrite i suggest so you check with the section of my response. Or if you keen to try it yourself, you can use something like this to hide the wp-content/plugins path structure: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^modules/(.*) /wp-content/plugins/$1 [L,QSA] </IfModule> This will change the path to /modules … Read more

[Solved] How to build an HTML table using jQuery

Use this code: $(‘#myTable’).empty(); $(‘#myTable’).append(‘<thead><tr><th>Note</th></tr></thead>’); $(‘#myTable’).append(‘<tbody></tbody>’); $.each(data, function(index, valueAusData){ $(‘#myTable tbody’).append(‘<tr><td>’ + valueAusData.note + ‘</td></tr>’); }); solved How to build an HTML table using jQuery

[Solved] Linear regresion of rectangular table against one set of values

One way is to spread your data table using Country.Name as key: dat.spread <- dat %>% spread(key=”Country.Name”, value=”inflation”) dat.spread %>% str ‘data.frame’: 50 obs. of 31 variables: $ year : chr “1967” “1968” “1969” “1970” … $ Albania : num NA NA NA NA NA NA NA NA NA NA … $ Armenia : num … Read more

[Solved] Most efficient way to get custom database records from 20 buttons and 20 tables?

I suppose the easiest way would be to have the action or other parameters in the button itself, i.e. <div class=”mybutton” data-action=”get_quote” data-type=”literary”>Get a literary quote</div> <div class=”mybutton” data-action=”get_quote” data-type=”political”>Get a political quote</div> data-foo=”bar” attributes can easily be accessed in jQuery with .data(“foo”), so you could change the jQuery around a bit to listen to … Read more