Questions

Calling ASP.NET MVC Action Methods from JavaScript

I have sample code like this: ``` <div class="cart"> <a onclick="addToCart('@Model.productId');" class="button"><span>Add to Cart</span></a> </div> <div class="wishlist"> <a onclick="ad...

PHP: Get key from array?

I am sure that this is super easy and built-in function in PHP, but I have yet not seen it. Here's what I am doing for the moment: ``` foreach($array as $key => $value) { echo $key; // Would out...

How to run test cases in a specified file?

My package test cases are scattered across multiple files, if I run `go test <package_name>` it runs all test cases in the package. It is unnecessary to run all of them though. Is there a way to spec...

5 Jun at 09:14

Opening a new tab to read a PDF file

I am probably missing something simple here, however i will ask anyway. I have made a link to open up a PDF file, however it opens up in the current tab rather than a new one. What code shall i use in...

15 Dec at 16:54

Text on image mouseover?

I am trying to get a small box to appear on the bottom-left side of an image when a mouse moves over it. Inside the box there will be a link to a different page. [Here](http://theme-frsch2.tumblr.com...

4 Jan at 00:15

Get Number of Rows returned by ResultSet in Java

I have used a `ResultSet` that returns certain number of rows. My code is something like this: ``` ResultSet res = getData(); if(!res.next()) { System.out.println("No Data Found"); } while(res.ne...

25 Jul at 19:44

What does the @Valid annotation indicate in Spring?

In the following example, the `ScriptFile` parameter is marked with an `@Valid` annotation. What does `@Valid` annotation do? ``` @RequestMapping(value = "/scriptfile", method = RequestMethod.POST) ...

Getting Access Denied when calling the PutObject operation with bucket-level permission

I followed the example on [http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_examples.html#iam-policy-example-s3](http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_examples...

18 Nov at 18:45

Allowed memory size of 536870912 bytes exhausted in Laravel

In the same system, I can make call to db, and there is no problem, but in some case ( with the biggest table ), I get > "PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to a...

9 Sep at 16:25

How to start jenkins on different port rather than 8080 using command prompt in Windows?

I have jenkins.war and I started it from command prompt in Windows as: ``` java -jar jenkins.war ``` It was started well and easily browsed as `http://localhost:8080` I want to start on 9090 port....

How can I properly URL encode a string in PHP?

I'm making a search page, where you type a search query and the form is submitted to `search.php?query=your query`. What PHP function is the best and that I should use for encoding/decoding the search...

2 Dec at 22:33

Shell script to copy files from one location to another location and rename add the current date to every file

I have a folder in my server which contains some files. These are automated that means everyday we get new files automatically which will overwrite the old ones. So want to take a back up for this dat...

28 Sep at 10:36

Is there an easy way to return a string repeated X number of times?

I'm trying to insert a certain number of indentations before a string based on an items depth and I'm wondering if there is a way to return a string repeated X times. Example: ``` string indent = "-...

20 Sep at 19:23

How can I increase the JVM memory?

HI, I like to know can I increase the memory of the JVM depending on my application.If yes how can I increase the JVM memory? And how can I know the size of JVM?

19 Feb at 05:30

How to change a css class style through Javascript?

According to the book I am reading it is better to change CSS by class when you are using Javascript. But how? Can someone give a sample snippet for this?

11 Jun at 10:26

Virtual Memory Usage from Java under Linux, too much memory used

I have a problem with a Java application running under Linux. When I launch the application, using the default maximum heap size (64 MB), I see using the tops application that 240 MB of virtual Memor...

22 Nov at 11:45

How to Edit a row in the datatable

I have created a data table. It has 3 column , and ``` Datatable table= new DataTable("Product"); table.Columns.Add("Product_id", typeof(int)); table.Columns.Add("Product_name", typeof(str...

28 Oct at 08:23

Function that creates a timestamp in c#

I was wondering, is there a way to create a timestamp in c# from a datetime? I need a millisecond precision value that also works in Compact Framework(saying that since DateTime.ToBinary() does not ex...

Spring Boot YAML configuration for a list of strings

I am trying to load an array of strings from the `application.yml` file. This is the config: ``` ignore: filenames: - .DS_Store - .hg ``` This is the class fragment: ``` @Value("$...

11 Dec at 09:48

Reset Entity-Framework Migrations

I've mucked up my migrations, I used `IgnoreChanges` on the initial migration, but now I want to delete all my migrations and start with an initial migration with all of the logic. When I delete the ...

Mean Squared Error in Numpy?

Is there a method in numpy for calculating the Mean Squared Error between two matrices? I've tried searching but found none. Is it under a different name? If there isn't, how do you overcome this? D...

Flutter: Run method on Widget build complete

I would like to be able to run functions once a Widget has finished building/loading but I am unsure how. My current use case is to check if a user is authenticated and if not, redirect to a login vie...

26 Dec at 10:0

PHP - auto refreshing page

I am using following code for a refreshing page, it is not reloading on completion. The following code is not working sometime. ``` $page = $_SERVER['PHP_SELF']; $sec = "10"; header("Refresh: $sec...

6 Jan at 02:28

How to get response from S3 getObject in Node.js?

In a Node.js project I am attempting to get data back from S3. When I use `getSignedURL`, everything works: ``` aws.getSignedUrl('getObject', params, function(err, url){ console.log(url); });...

How to SELECT in Oracle using a DBLINK located in a different schema?

We have an Oracle DBMS (11g) and the following configuration: - - - - - : When logged on as "MYUSER", what is the correct syntax to access tables using the DB link of "SCHEMA_B"? Is it possible to ...