[Solved] how to achieve polymorphism in java [closed]

Polymorphism in simple terms Polymorphism means “Many forms or shapes”, which is a phenomenon where objects behave differently although they are closely related. In the following example we have Cat, Dog and Wolf which are all Animal therefore are related but they perform “makesound” differently. In Java the fact that they are related is denoted … Read more

[Solved] how i make listbox and choose the items from it? [closed]

You should use either string captcha = listBox1.SelectedItem.ToString(); Or int captchaIndex = listBox1.SelectedIndex; In the code you posted, captcha contains a string representation of the listBox1.SelectedIndex instead of the item’s text. 0 solved how i make listbox and choose the items from it? [closed]

[Solved] Can you pass arguments to many constructor methods in C#? [closed]

If I got your question right, you’re looking for something like Constructor-Chaining public class Class1 { public Class1() : this(string.Empty) { } public Class1(string val1) : this(val1, string.Empty) { } public Class1(string val1, string val2) :this(val1, val2, string.Empty) { } public Class1(string val1, string val2, string val3) { // Do something with the val’s } … Read more

[Solved] How to pass method name as a parmeter? [closed]

Refactor the code that is repeated into a method that takes an Action<int[]> parameter. Something like this (untested): void Main() { Random rnd = new Random(Guid.NewGuid().GetHashCode()); int[] ArrayRandom = new int[200000]; for (int j = 0; j < ArrayRandom.Length; j++) ArrayRandom[j] = rnd.Next(int.MaxValue); performSort(“Heap Sort”, ArrayRandom, HeapSort); performSort(“Cocktail Sort”, ArrayRandom, HeapSort); performSort(“Selection Sort”, ArrayRandom, HeapSort); … Read more

[Solved] Can’t Insert to database CodeIgniter

Change your controller function with below code I think You are calling wrong model for inserting rating public function rateform($username,$id,$name) { $this->load->Model(‘Keluhan’); // load your model $rating = $this->input->post(‘rating’); $name2 = urldecode($name); $data = array ( ‘id’ => $this->input->post(‘id’), ‘username’ => $this->input->post(‘username’), ‘rating’ => $this->input->post(‘rating’) ); $result = $this->Keluhan->InsertRating($data); // change your model name where … Read more

[Solved] To reverse the values from up to down and change y-axis too in Matlab [duplicate]

To change direction of y axis, including axis labels and plotted values, you use set(gca,’YDir’,’reverse’) When you plot an image, for example using imagesc, the YDir property is automatically set to reverse. So, to change it, set it to normal: set(gca,’YDir’,’normal’) 2 solved To reverse the values from up to down and change y-axis too … Read more

[Solved] C++field of struct if error

restavracija is a type, not an object. You have to instantiate it to produce an object. In this particular case, it looks like you’re expecting an array of them, and you want to call that array polje. Such an array declaration will look something like: restavracija polje[10]; Accessing element i in that array will then … Read more

[Solved] different ways of declaring main function c# [closed]

I think the better question is, What does each part of the typical Main method declaration mean? Can you take out some keywords? Sure, but the method will not necessarily be the same as the one defined below. public static void Main(string[] args) public refers to the visibility, without public, the code will use its … Read more

[Solved] How minimize this mysql query [closed]

Ever heard of JOINing tables? SELECT photo.id FROM product_photo INNER JOIN product_photo AS photo ON photo.product_id = product_photo.product_id AND photo.order >= product_photo.order WHERE product_photo.id = ’33’; The FROM and WHERE parts will select your product id = 33 and then you join product_photo with different alias (yes, you can join the same table multiple times … Read more

[Solved] -[__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance [duplicate]

NSArray *retrievedJTrans = [NSJSONSerialization JSONObjectWithData:response options:0 error:&jsonParsingError]; is a dictionary what you might want NSDictionary *retrievedJTransD = [NSJSONSerialization JSONObjectWithData:response options:0 error:&jsonParsingError]; NSArray *retrievedJTrans = retrievedJTransD[@”data”][@”translations”]; 0 solved -[__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance [duplicate]

[Solved] what is in java importing packages

File.createNewFile() create new file if not exists already. public boolean createNewFile() throws IOException Atomically creates a new, empty file named by this abstract pathname if and only if a file with this name does not yet exist. The check for the existence of the file and the creation of the file if it does not … Read more

[Solved] php download button without submiting back to page [closed]

Use $_GET use a hyperlink instead of a submit button. <?php if(isset($_GET[‘download’]) && $_GET[‘download’]){ header(‘Content-Description: File Transfer’); header(‘Content-Type: application/octet-stream’); header(‘Content-Type: application/octetstream’); header(‘Content-Disposition: attachment; filename=”‘.$file_real_name.'”‘); header(‘Content-Transfer-Encoding: binary’); header(‘Expires: 0’); header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’); header(‘Pragma: public’); header(‘Content-Length: ‘ . (int)(filesize($file_path))); ob_clean(); flush(); readfile($file_path); } ?> <a href=”https://stackoverflow.com/questions/19016977/?download=true”>Download</a> 1 solved php download button without submiting back to page … Read more