[Solved] Only getting the first character of the array element

[ad_1] From your array the foreach loop should look like this $toilet_arr = array ( 0 => ‘Water Sealed’, 1 => ‘Open Pit’, 2 => ‘None’ ); if (count($toilet_arr)) { foreach($toilet_arr as $row) { $data = array(“hof_id”=>$last_id,”toilet_type”=>$row); $this->db->insert(‘toilet_tbl’,$data); } } This should insert values as they are if the problem still persists check the length … Read more

[Solved] Weird results in c [closed]

[ad_1] In addition to LihOs answer above this block looks wrong: if(tab1[i] != ‘\0′) tab1[i]==result[i]; else if (tab2[i] !=’\0′) tab2[i]==result[i]; else printf(” “); Don’t you mean to assign the value in tab1[i]or tab2[i] to result[i]like this? if(tab1[i] != ‘\0′) result[i] = tab1[i]; else if (tab2[i] !=’\0’) result[i] = tab2[i]; else printf(” “); Also using magic … Read more

[Solved] Can’t serve external CSS File in Go webapp

[ad_1] You have to set the Content-Type header in the response correctly. Without the content type, most browsers will not execute the css. Something like the following should work, but this is essentially just a sketch: http.HandleFunc(“/static/”,func(wr http.ResponseWriter,req *http.Request) { // Determine mime type based on the URL if req.URL.Path.HasSuffix(“.css”) { wr.Header().Set(“Content-Type”,”text/css”) } http.StripPrefix(“/static/”, fs)).ServeHTTP(wr,req) … Read more

[Solved] Create a list of all the lists whose entries are in a range in Python [closed]

[ad_1] Are you looking for the product of [5, 6, 7] with itself, 57 times? itertools.product() does that for you: from itertools import product for combination in product([5, 6, 7], repeat=57): print combination This will take a while to print all output, however. It’ll eventually print all 3 ** 57 == 1570042899082081611640534563 possible combinations. Don’t … Read more

[Solved] java android app execute every 10 seconds [closed]

[ad_1] A timer task will not work, as it will create a different thread and only originating thread may touch its views. For android the preferred way to do this is to use a handler. Ether by textMsg.post( new Runnable(){ public void run(){ doProcessing(); testMesg.setText(“bla”); testMsg.postDelayed(this,(1000*10)); } }; or having a seperate instance of the … Read more

[Solved] Asp.net dynamic User and activity based authorisation mixed with hide show site master html

[ad_1] You should switch from role based authentication to claims based authentication. Here’s an article describing the basics of claims based authentication: http://dotnetcodr.com/2013/02/11/introduction-to-claims-based-security-in-net4-5-with-c-part-1/ Claims will give you fine grained control over the rights for each individual user. ClaimsPrincipal can also be used in webforms: https://visualstudiomagazine.com/articles/2013/09/01/going-beyond-usernames-and-roles.aspx An attribute can be applied to pages and methods in … Read more

[Solved] Generate string containing escaped interpolation

[ad_1] You have not the ‘\’ in the string, it is added by the inspect: if you puts the string you will realize it: asd = ‘<%= asd %>’.gsub(/<%=(.*)%-?>/, “\#{\\1}”) #=> “\#{ asd }” p asd #=> “\#{ asd }” <- this is `asd.inspect`, which is returned by `p` “\#{ asd }” <- this is … Read more

[Solved] I am getting null as an output in Java [closed]

[ad_1] Reading your code was very hard. A method and a variable with the same name is bound to cause confusion. Anyway: You are never assigning any value to the field v2, so it is always printed as null — the default value that fields have when created. It maybe a copy-paste error where you … Read more

[Solved] How to I extract objects? [closed]

[ad_1] First load the img from the url import numpy as np import urllib.request from PIL import Image from matplotlib import pyplot as plt urllib.request.urlretrieve( ‘https://i.stack.imgur.com/GRHzg.png’, “img.png”) img = Image.open(“img.png”) img.show() Then consider the black part as “filled” and convert in numpy array arr = (np.array(img)[:,:,:-1].sum(axis=-1)==0) If we sum the rows values for each column … Read more

[Solved] MySQL and PHP Select Option with information from database

[ad_1] I’ll give you a short example. Right now, you’r code will give you 1 option <select name =”Employee Name” style=”width: 160px” > <option value =””>Please select …</option></select> Let’s take an array like: $array = array(‘0’ => ‘test’, ‘1’ => ‘test1’); To populate your array as options, you can simply do <select> <?php foreach ($array … Read more

[Solved] i am working on flip image but it’s not working [closed]

[ad_1] I think this is your perfect answer. .flip { height: 199px; width: 300px; margin: 0 auto; } .flip img { width: 300px; height: auto; } .flip .back { background: #2184cd; color: #fff; text-align: center; } <head> <script src=”https://code.jquery.com/jquery-2.1.4.min.js”></script> <script src=”https://cdnjs.cloudflare.com/ajax/libs/jQuery-Flip/1.1.2/jquery.flip.min.js”></script> <script> $(function () { $(“.flip”).flip({ trigger: ‘hover’ }); }); </script> <script> $(function () { … Read more

[Solved] Passing values between multiple pages php

[ad_1] Put all of that fields in just one form and validate the action or put validation into php before frontend start, I prefer the first one to your case, it’s easier: FILTERING IN THE ACTION <?php if (empty($_POST[‘user_name’])){ $action = ‘page1.php’; $structure = “<h2>Please enter your user name and age</h2>”; $submit=”Review”; } else { … Read more

[Solved] How to convert String and perform calculation in Swift? [closed]

[ad_1] I advise you to read the Apple docs at developer.apple.com “I have 67+89.06 Dollars.” // In order to get a Float value both operands need to be of type Float. let valueCalculate = “I have \(Float(67) + Float((89.06))) Dollars” print(valueCalculate) // Convert String to Int var stringNumber = “123456” var convertToInt = Int(stringNumber) // … Read more