Questions

Order of items in classes: Fields, Properties, Constructors, Methods

Is there an official C# guideline for the order of items in terms of class structure? Does it go: - - - - - I'm curious if there is a hard and fast rule about the order of items? I'm kind of all o...

How to animate RecyclerView items when they appear

How can I animate the RecyclerView Items when there are appearing? The default item animator only animates when a data is added or removed after the recycler data has been set. How can this be achieve...

Postgres FOR LOOP

I am trying to get 25 random samples of 15,000 IDs from a table. Instead of manually pressing run every time, I'm trying to do a loop. Which I fully understand is not the optimum use of Postgres, but ...

Running Command Line in Java

Is there a way to run this command line within a Java application? ``` java -jar map.jar time.rel test.txt debug ``` I can run it with command but I couldn't do it within Java.

8 Sep at 15:53

How do I execute a stored procedure once for each row returned by query?

I have a stored procedure that alters user data in a certain way. I pass it user_id and it does it's thing. I want to run a query on a table and then for each user_id I find run the stored procedure o...

6 Apr at 04:31

Initialising mock objects - Mockito

There are many ways to initialize a mock object using MockIto. What is best way among these ? 1. ``` public class SampleBaseTestCase { @Before public void initMocks() { MockitoAnnotations.i...

16 Oct at 09:1

Initialise a list to a specific length in Python

How do I initialise a list with 10 times a default value in Python? I'm searching for a good-looking way to initialize a empty list with a specific range. So make a list that contains 10 zeros or so...

4 Nov at 13:28

JavaScript Loading Screen while page loads

This is a little hard to explain, So I'll try my best So while a HTML page loads, I'd like there to be a cool loading screen going on. When it finishes loading, I want the loading screen to clear and...

19 Jul at 06:49

specifying goal in pom.xml

I am creating a new maven project with `pom.xml` as below:- ``` <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://m...

8 Nov at 06:45

String variable interpolation Java

String building in Java confounds me. I abhore doing things like: ``` url += "u1=" + u1 + ";u2=" + u2 + ";u3=" + u3 + ";u4=" + u4 + ";"; url += "x=" + u1 + ";y=" + u2 + ";z=" + u3 + ";da1=" + u4 + ";...

26 Feb at 22:15

SQL server stored procedure return a table

I have a stored procedure that takes in two parameters. I can execute it successfully in Server Management Studio. It shows me the results which are as I expect. However it also returns a Return Value...

Getting full URL of action in ASP.NET MVC

Is there a built-in way of getting the full URL of an action? I am looking for something like `GetFullUrl("Action", "Controller")` that would return something like `http://www.fred.com/Controller/Act...

5 Jan at 13:59

Only numbers. Input number in React

I'm trying to exclude minus and plus from input, but it's going wrong: ``` handleChange(event) { const value = event.target.value.replace(/\+|-/ig, ''); this.setState({financialGoal: value}); } `...

27 Mar at 17:41

Why did I get the compile error "Use of unassigned local variable"?

My code is the following ``` int tmpCnt; if (name == "Dude") tmpCnt++; ``` Why is there an error ? I know I didn't explicitly initialize it, but due to [Default Value Table](http://msdn.micros...

7 Jan at 19:22

concatenate char array in C

I have a a char array: ``` char* name = "hello"; ``` I want to add an extension to that name to make it ``` hello.txt ``` How can I do this? `name += ".txt"` won't work

7 Feb at 21:48

ASP.NET MVC Html.DropDownList SelectedValue

I have tried this is RC1 and then upgraded to RC2 which did not resolve the issue. ``` // in my controller ViewData["UserId"] = new SelectList( users, "UserId", "DisplayName", sele...

9 Mar at 03:3

SSL handshake alert: unrecognized_name error since upgrade to Java 1.7.0

I upgraded from Java 1.6 to Java 1.7 today. Since then an error occur when I try to establish a connection to my webserver over SSL: ``` javax.net.ssl.SSLProtocolException: handshake alert: unrecogn...

17 Jan at 14:17

What is the best way to implement "remember me" for a website?

I want my website to have a checkbox that users can click so that they will not have to log in each time they visit my website. I know I will need to store a cookie on their computer to implement this...

16 Aug at 12:20

Exception from HRESULT: 0x800A03EC Error

I am getting "HRESULT: 0x800A03EC" error when running Excel add-in with following code: ``` Excel.Range rng = ActiveSheet.Cells[x, y] as Excel.Range; string before = rng.Value2; stri...

3 Oct at 18:31

Laravel - Forbidden You don't have permission to access / on this server

My laravel installation was working fine yesterday but today I get the following error: ``` Forbidden You don't have permission to access / on this server. Additionally, a 403 Forbidden error was e...

7 Oct at 02:29

Automapper missing type map configuration or unsupported mapping - Error

Entity Model ``` public partial class Categoies { public Categoies() { this.Posts = new HashSet<Posts>(); } public int Id { get; set; } public string Name { get; set; } ...

8 Oct at 19:9

Double Iteration in List Comprehension

In Python you can have multiple iterators in a list comprehension, like ``` [(x,y) for x in a for y in b] ``` for some suitable sequences a and b. I'm aware of the nested loop semantics of Python's...

29 Jul at 08:30

How to implement a pop-up dialog box in iOS?

After a calculation, I want to display a pop up or alert box conveying a message to the user. Does anyone know where I can find more information about this?

9 Sep at 00:8

Validation failed for one or more entities while saving changes to SQL Server Database using Entity Framework

I want to save my Edit to Database and I am using Entity FrameWork Code-First in ASP.NET MVC 3 / C# but I am getting errors. In my Event class, I have DateTime and TimeSpan datatypes but in my databas...

What are the rules about using an underscore in a C++ identifier?

It's common in C++ to name member variables with some kind of prefix to denote the fact that they're member variables, rather than local variables or parameters. If you've come from an MFC background,...