[Solved] Array to string Error while uploading an Image

You study cakephp manual properly HOW form type can be File ?????? 🙂 Use this <?php echo $this->Form->create(‘User’,array(‘enctype’=>’multipart/form-data’)); echo $this->Form->input(‘profile_pic’, array(‘type’=>’file’)); echo $this->Form->end(‘submit’); ?> 5 solved Array to string Error while uploading an Image

[Solved] jQuery Adding new option to select element doesn’t pick up the string [closed]

Change: var str = $(‘#country-select’).val() + ” ” + $(“#” + $(“#country-select option:selected”).val() + “-select option:selected”).val(); to: var str = $(‘#country-select, .sub-menu’).val() + ” ” + $(“#” + $(“#country-select option:selected”).val() + “-select option:selected”).val(); jFiddle example You need to trigger the change on both the first and second selects, so $(‘#country-select, .sub-menu’) is needed. solved jQuery … Read more

[Solved] Writing drivers for Windows [closed]

Indeed, this would be too broad. Driver writing is a complicated thing which requires a good understanding of how a computer and the OS works. Also, C# (and .NET itself) indeed isn’t available in Kernel Mode, so C/C++ is the preferred way. Although theoretically any unmanaged language (like Pascal) could do, I haven’t heard of … Read more

[Solved] Assign the value to the variable in Java

if(rain && temperature < 0) snow = true; But you also need to set snow = false by default, so: public class Q8 { boolean snowForecast() { boolean snow = false; int temperature=-5; boolean rain=true; if(rain && temperature < 0) snow = true; return snow; } } Right now, this is what your doing: 1) … Read more

[Solved] How to parse a simple text file in java

import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class Read_Text_File { public static void main(String[] args) { System.out.println(getValues()); } public static ArrayList<String> getValues() { FileInputStream stream = null; try { stream = new FileInputStream(“src/resources/java_txt_file.txt”); } catch (FileNotFoundException e) { e.printStackTrace(); } BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); String strLine; ArrayList<String> … Read more

[Solved] Java File Name Printing

Loop through both the ArrayLists you have. Each ArrayList contains the file names as it is. You’ll need a nested loop (a loop inside a loop). In the core of the nested loops, you want to do a compare between current position of each ArrayList. You can use .equals() method for this. The pseudo code … Read more

[Solved] Convert specific eregi_replace to preg_replace function [closed]

But to help. Just add delimeters to the begining and end of the pattern, I used # and escape any delimiters that are in the pattern with \ so the engine knows its not a delimeter, so \#: $sText = preg_replace(‘#(((f|ht){1}tp://)[-a-zA-Z0-9@:%_+.~\#?&//=]+)#’, ‘<a href=”https://stackoverflow.com/questions/19717752/” target=”_blank”><font color=”black”>\1</font></a>’, $sText); 3 solved Convert specific eregi_replace to preg_replace function [closed]

[Solved] Generating random matrix in c [closed]

int main() { int random[3][3]; int i, o; srand(time(NULL)); for(o = 0; o<3; o++) for(i = 0; i<3; i++) random[o][i] = rand(); return 0; } That’ll do it. If you want a particular subset of data you can use the % operator on the output from rand(), for example: rand() % 10; // generates a … Read more

[Solved] Retain Checked the checkbox inside While

refer to in_array <?php if(isset($_GET[“poscon”])) { $_SESSION[“poscon”] = $_GET[“poscon”]; $dr=$_SESSION[‘poscon’]; if(isset($_POST[‘submit’])) { if(!empty($_GET[‘poscon’])) $_SESSION[‘poscon’] = $_POST[‘poscon’]; $part=$_GET[“poscon”]; } $poscon=mysqli_real_escape_string($link,$_GET[‘poscon’]); $p = mysqli_query($link,”select distinct PossibleCondition,Symptoms from healthguide where Subpart like ‘%$poscon%’ and PossibleCondition REGEXP ‘^[N-Z].*$’ Order by PossibleCondition “); while($r=mysqli_fetch_array($p)) { $pc=$r[“PossibleCondition”]; $sym=$r[“Symptoms”]; if(isset($_POST) && isset($_POST[‘poscon’]) && in_array($pc,$_POST[‘poscon’])) $strIsChecked=’checked=”checked”‘; else $strIsChecked=null; echo ‘<tr>’; echo ‘<td><input type=”checkbox” … Read more