Initialize class fields in constructor or at declaration?

Initialize class fields in constructor or at declaration?

I've been programming in C# and Java recently and I am curious where the best place is to initialize my class fields.Should I do it at declaration?:public class Dice{ private int topFace = 1; private Random myRand = new Random(); p

Remote Debugging not working. “Unable to attach to process. The RPC server is not available.”

Remote Debugging not working. “Unable to attach to process. The RPC server is not available.”

My development workstation is running VS2012 Update 1. The OS is Windows 7 Professional Service Pack 1 x64. I have a laptop running Windows 8 onto which I've installed the VS2012 Remote Debugger. I've started msvsmon and it's quietly sit

Is it possible to change the layout width and height in Android at run time?

Is it possible to change the layout width and height in Android at run time?

I have two relative layouts. Both have width of fill parent and height of 100 dip. My requirement is when I click the first layout it should shrink to 50dip height and the other expand to the 150dip height. While doing this I got exception.

VS 2012: Post Build xcopy error 2

VS 2012: Post Build xcopy error 2

i want to make VS copy the .lib-file it created after the build process to a specific folder.So i went to the project config, post-build event, and entered the following command:if exist $(TargetPath)xcopy "$(TargetPath)" "C:\Users\Incubbus

Force break on any exception thrown in program

Force break on any exception thrown in program

When coding in C# I like not to handle exceptions because it makes it easier to figure out where and why things went wrong. However, I can't give anyone a program that doesn't handle exceptions.Can I somehow force Visual Studio to break on

How to reverse lines of a text file?

How to reverse lines of a text file?

I'm writing a small shell script that needs to reverse the lines of a text file. Is there a standard filter command to do this sort of thing?My specific application is that I'm getting a list of Git commit identifiers, and I want to process

How To Prevent Tab Hell With Visual Studio And FireFox Debugging?

How To Prevent Tab Hell With Visual Studio And FireFox Debugging?

How do I keep VS from opening a new tab in Firefox every time I hit F5 to debug a web application? I would really like it to re-use the same tab. 1:This may not work for you but, in a project's properties on the Web tab there is a setti

Command Prompt Error 'C:\\Program' is not recognized as an internal or external command,

Command Prompt Error 'C:\\Program' is not recognized as an internal or external command,

I am trying to run the following batch command. The command has been extracted from the IDE so is confirmed working. Getting the error mentioned below.I have tried a few variations with double quotes but they haven't worked. Even on powersh

Return type deduction for in-class friend functions

Return type deduction for in-class friend functions

Here is a little experiment with return type deduction for in-class friend functions (using Clang 3.4 SVN and g++ 4.8.1 with std=c++1y in both cases) that is not documented in the linked working paper#include struct A{ int a_; friend

Finding the actual runtime call tree of a Java Program

Finding the actual runtime call tree of a Java Program

Suppose I have a big program that consists of hundreds of methods in it. And according to the nature of input the program flow is getting changed. Think I want to make a change to the original flow. And it is big hassle to find call hierarc

How to access an audio stream using DirectShow.NET C#

How to access an audio stream using DirectShow.NET C#

What I would like to do is to pass an arbitrary audio file to a DirectShow filtergraph and receive a (PCM audio) stream object in the end using .NET 3.5 C# and DirectShow.NET. I would like to reach the point that I can just say: Stream Open

How can I know a dll is not a debug build

How can I know a dll is not a debug build

How do i know for sure that my production server uses release build dll's. Is there a way to find that info inside dll? Duplicate of: How to tell if .net app was compiled in DEBUG or RELEASE mode?How to check if DLL is debug-compiled 1:I

Any gotchas with objc_setAssociatedObject and objc_getAssociatedObject?

Any gotchas with objc_setAssociatedObject and objc_getAssociatedObject?

I’m looking into ways to add a property (an integer in this case) to all UIView instances, whether they are subclassed or not. Is using objc_setAssociatedObject() and objc_getAssociatedObject() within a category the appropriate, Apple-endor

Excel won't open/launch VSTO AddIn when running in debug mode of Visual Studio 2010

Excel won't open/launch VSTO AddIn when running in debug mode of Visual Studio 2010

I had previously installed the VS11 beta, and had some issues with my Visual Studio 2010 instance, which you can see here how they were resolved: Excel AddIn Click Once deployment issue.Now I have a code base which compiles/builds a vsto, w

exc_bad_access in Facebook sdk login Xcode 8 beta

exc_bad_access in Facebook sdk login Xcode 8 beta

recently I started adding my application IOS 10 features while I encountered a weird bug:When authenticating with facebook SDK via browser as soon as I click the confirmation button in facebook itself at the embeded browser, the app crashes

How can I display the output of a Opscode Chef bash command in my console?

How can I display the output of a Opscode Chef bash command in my console?

I use Vagrant to spawn a standard "precise32" box and provision it with Chef so I can test my Node.js code on Linux when I work on a Windows machine. This works fine.I also have this bash command so it auto installs my npm modules:bash "ins

Do I need Flex Builder?

Do I need Flex Builder?

I am completely new to Flex.Can I realistically develop, say, a medium complex application with the Flex SDK alone, or do I need Flex Builder?Also, apart from the SDK, what will I need to get started?Thanks for any help. 1:I was there a

AngularJS v1.2.5 script error with textarea and placeholder attribute using IE11

AngularJS v1.2.5 script error with textarea and placeholder attribute using IE11

I have an Angular JS v1.2.5 form that won't work in IE11. It works fine in Firefox, Chrome, Safari. My form uses a textarea with interpolation inside the placeholder attribute. Hello {{ name }}! If the placeholder attribute is spe

how to map levels of java.util.logging and slf4j logger?

how to map levels of java.util.logging and slf4j logger?

This is a basic question but it's really confusing me.I have to map java.util.logging to slf4j logging levels... SLF4J LEVELS :trace debug info warn error fatal JAVA.UTIL.LOGGING LEVELS :finest finer fine config info warning severe.Any sugg

npm install -g yo command gives -> ERR! yo@1.1.0 postinstall: `node scripts/doctor.js`

npm install -g yo command gives -> ERR! [email protected] postinstall: `node scripts/doctor.js`

I just tried to do a npm install but get this error about doctor,js at the end. Do I need to worry about it?npm install -g yo..npm http 304 https://registry.npmjs.org/graceful-fsnpm http 200 https://registry.npmjs.org/fstream/-/fstream-0.1.

windows version of the GDB frontend DDD

windows version of the GDB frontend DDD

Is there a native (not cygwin) version of DDD available for download somewhere? 1:There is also a GDB front-end for MS Visual Studio, called WinGDB. It supports both Cygwin and MinGW. You use it just like built-in debugger in VS. It's al

How to add source + javadoc for android-support-v7?

How to add source + javadoc for android-support-v7?

I added to my project support library android-support-v7-appcompat, but I can't add source and javadoc for it.I downloaded https://android.googlesource.com/platform/frameworks/support/+/master package with source and in Eclipse I set Source

Replace fixed size arrays with std::array?

Replace fixed size arrays with std::array?

Working with legacy code, I asked myself should I replace fixed sized C-style arrays with the new std::array? E. g.static const int TABLE_SIZE = 64;double table[TABLE_SIZE];replace withstd::array table;While I see the benefits from using st

TypeError: b'1' is not JSON serializable

TypeError: b'1' is not JSON serializable

I am trying to send a POST request as JSON.*email variable is of type "bytes"def request_to_SEND(email, index): url = "....." data = { "body": email.decode('utf-8'), "query_id": index, "debug": 1, "client_i

Google Play console reporting crashes from unreleased applications

Google Play console reporting crashes from unreleased applications

I would like to share a situation I am facing analysing the new features at Google Play console and try to find a solution for it.As many of you may already know, Google has released updates at Google Play console and introduced Android vit