Questions

How to align entire html body to the center?

How do I align entire html body to the center ?

4 Oct at 04:25

How to write a JSON file in C#?

I need to write the following data into a text file using JSON format in C#. The brackets are important for it to be valid JSON format. ``` [ { "Id": 1, "SSN": 123, "Message": "whatever...

28 Nov at 19:23

The POST method is not supported for this route. Supported methods: GET, HEAD. Laravel

I have a problem with my edit page. When I submit I get this error: > The POST method is not supported for this route. Supported methods: GET, HEAD. I have no clue where it comes from as I am prett...

13 Feb at 16:39

how can I enable PHP Extension intl?

I am going to install Magento2 at my local server and it gives me following error notice. [](https://i.stack.imgur.com/Ssudf.png) I am using XAMPP. When I tried to enable it from php.ini file it thr...

14 Dec at 14:10

Convert java.time.LocalDate into java.util.Date type

I want to convert [java.time.LocalDate](http://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) into [java.util.Date](http://docs.oracle.com/javase/8/docs/api/java/util/Date.html) type. Bec...

19 Jul at 15:31

recyclerview No adapter attached; skipping layout

Just implemented `RecyclerView` in my code, replacing `ListView`. Everything works fine. The data is displayed. But error messages are being logged: ``` 15:25:53.476 E/RecyclerView: No adapter atta...

16 Dec at 12:41

How to convert XML into array in PHP?

I want to convert below XML to PHP array. Any suggestions on how I can do this? ``` <aaaa Version="1.0"> <bbb> <cccc> <dddd Id="id:pass" /> <eeee name="hearaman" age="24" /> ...

1 Apr at 19:49

Default value of 'boolean' and 'Boolean' in Java

What are the default values of `boolean` (primitive) and `Boolean` (primitive wrapper) in Java?

26 Mar at 03:4

How to plot in multiple subplots

I am a little confused about how this code works: ``` fig, axes = plt.subplots(nrows=2, ncols=2) plt.show() ``` How does the fig, axes work in this case? What does it do? Also why wouldn't this wo...

What is the difference between a port and a socket?

This was a question raised by one of the software engineers in my organisation. I'm interested in the broadest definition.

28 Mar at 03:50

Fastest way to download a GitHub project

I need to download the source code of the project [Spring data graph example](https://github.com/SpringSource/spring-data-graph-examples/) into my box. It has public read-only access. Is there is an e...

20 Feb at 23:22

How to convert image to byte array

Can anybody suggest how I can convert an image to a byte array and vice versa? I'm developing a WPF application and using a stream reader.

24 Oct at 12:19

WHERE Clause to find all records in a specific month

I want to be able to give a stored procedure a Month and Year and have it return everything that happens in that month, how do I do this as I can't compare between as some months have different number...

12 May at 05:15

How to overlay image with color in CSS?

## Objective I want a color overlay on this header element. How can I do this with CSS? ## Code ``` #header { /* Original url */ /*background: url(../img/bg.jpg) 0 0 no-repeat fixed;*/ bac...

6 Feb at 11:8

Remove the last line from a file in Bash

I have a file, `foo.txt`, containing the following lines: ``` a b c ``` I want a simple command that results in the contents of `foo.txt` being: ``` a b ```

Set timeout for ajax (jQuery)

``` $.ajax({ url: "test.html", error: function(){ //do something }, success: function(){ //do something } }); ``` Sometimes `success` function works good, sometim...

16 Sep at 10:53

Mysql error 1452 - Cannot add or update a child row: a foreign key constraint fails

I'm having a bit of a strange problem. I'm trying to add a foreign key to one table that references another, but it is failing for some reason. With my limited knowledge of MySQL, the only thing that ...

24 May at 21:20

Is there a way to apply styles to Safari only?

I'm trying to find a way to apply CSS just to Safari, but everything I find also applies to Chrome. I know these are currently both WebKit browsers, but I'm having problems with div alignments in Chro...

20 Sep at 14:23

C# Double - ToString() formatting with two decimal places but no rounding

How do I format a `Double` to a `String` in C# so as to have only two decimal places? If I use `String.Format("{0:0.00}%", myDoubleValue)` the number is then rounded and I want a simple truncate wit...

28 Feb at 17:56

Add new field to every document in a MongoDB collection

How can I add a new field to every document in an existent collection? I know how to update an existing document's field but not how to add a new field to every document in a collection. How can I do...

10 Jul at 00:20

Get values from an object in JavaScript

I have this object: ``` var data = {"id": 1, "second": "abcd"}; ``` These are values from a form. I am passing this to a function for verification. If the above properties exist we can get their v...

1 Jul at 20:58

Using LIMIT within GROUP BY to get N results per group?

The following query: ``` SELECT year, id, rate FROM h WHERE year BETWEEN 2000 AND 2009 AND id IN (SELECT rid FROM table2) GROUP BY id, year ORDER BY id, rate DESC ``` yields: ``` year id rate ...

How does JavaScript .prototype work?

I'm not that into dynamic programming languages but I've written my fair share of JavaScript code. I never really got my head around this prototype-based programming, does any one know how this works?...

Why do I get TypeError: can't multiply sequence by non-int of type 'float'?

I am typing to get a sale amount (by input) to be multiplied by a defined sales tax (0.08) and then have it print the total amount (sales tax times sale amount). I run into this error. Anyone know wh...

28 Sep at 00:31

How to implement one-to-one, one-to-many and many-to-many relationships while designing tables?

Can anyone explain how to implement one-to-one, one-to-many and many-to-many relationships while designing tables with some examples?