When should I write the keyword 'inline' for a function/method?

When should I write the keyword 'inline' for a function/method?

When should I write the keyword inline for a function/method in C++?After seeing some answers, some related questions:When should I not write the keyword 'inline' for a function/method in C++?When will the compiler not know when to make a f

How does scoped_lock avoid emitting an “unused variable” warning?

How does scoped_lock avoid emitting an “unused variable” warning?

boost::mutex::scoped_lock is a handy RAII wrapper around locking a mutex. I use a similar technique for something else: a RAII wrapper around asking a data interface to detach from/re-attach to a serial device.What I can't figure out, thoug

Understanding the WPF Dispatcher.BeginInvoke

Understanding the WPF Dispatcher.BeginInvoke

I was under the impression that the dispatcher will follow the priorityof the operations queued it and execute the operations based on the priorityor the order in which the operation was added to the queue(if same priority)until I was told

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.

Split comma-separated values

Split comma-separated values

I am using Visual Studio 2005 and C# 2.0, and I am trying to split a comma-separated string using the string.Split function and a lambda expression as follows:string s = "a,b, b, c";string[] values = s.Split(',').Select(sValue => sValue.Tri

SIGSEGV SEGV_ACCERR Crash Reports - What to do?

SIGSEGV SEGV_ACCERR Crash Reports - What to do?

I've just released an app on the AppStore with Crittercism crash reporting and I've been getting quite a few crash reports pertaining to a SIGSEGV error. Crittercism gives me a StackTrace and a few handy details about usage statistics, etc.

What is the _REENTRANT flag?

What is the _REENTRANT flag?

which compiling a multithreaded program we use gcc like below:gcc -lpthread -D_REENTRANT -o someprogram someprogram.cwhat exactly is the flag -D_REENTRANT doing over here? 1:Defining _REENTRANT causes the compiler to use thread safe (i.e

Stop threads before close my JavaFX program

Stop threads before close my JavaFX program

I'm having problem to close my application beacause some threads still running after I close the application. Somebody can help me with some method to stop all Threads being execute in background before kill the main thread???[EDITED]With m

Keyboard Shortcut for Moving Between Words in Camel Case in Notepad++

Keyboard Shortcut for Moving Between Words in Camel Case in Notepad++

In Notepad++, is there a keyboard shortcut for moving between the compound words in a camelCase word? When I use the shortcut Control + Right/Left, the caret moves to the next "real" word, not the next compound word. 1:Right : Ctrl\Left

NoClassDefFoundError: android.app.ANRManagerProxy

NoClassDefFoundError: android.app.ANRManagerProxy

Does anyone know why this happens? I see this crash reported by my app but I have no idea what it is.java.lang.NoClassDefFoundError: android.app.ANRManagerProxyThread: Binder_3, Exception: java.lang.NoClassDefFoundError: android.app.ANRMana

How to debug a deadlock?

How to debug a deadlock?

Other than that I don't know if I can reproduce it now that it's happened (I've been using this particular application for a week or two now without issue), assuming that I'm running my application in the VS debugger, how should I go about

Customize CSS of Google Docs Viewer

Customize CSS of Google Docs Viewer

How do i customize the CSS of the google docs view iframe?I realize that the iframe is getting the content from a cross domain source which i do not control, i was just wondering if anyone has some sort of hack around this? 1:I asked thi

XDebug is not loaded in PHP (Vista, Apache Module)

XDebug is not loaded in PHP (Vista, Apache Module)

I downloaded php_xdebug-2.0.5-5.3-vc9.dll, added at the end of PHP.ini the following line: zend_extension_ts="C:/Program Files/php5/ext/php_xdebug-2.0.5-5.3-vc9.dll"When I use phpinfo(), xdebug is not loaded.When I run command "php.exe -m"

Which .Net Timer() to use

Which .Net Timer() to use

I have a legacy WinForms Mdi App in VB.Net 2.0 which I am adding functionality to. One of the additions is a warning which needs to be raised when the current time nears a specified value (a deadline). My intention is to check the time once

How do I make an ellipse blink?

How do I make an ellipse blink?

I am trying to make a custom control in WPF. I want it to simulate the behavior of a LED that can blink.There are three states to the control: On, Off, and Blinking.I know how to set On and Off through the code behind, but this WPF animati

how to use onclicklistener for grid view

how to use onclicklistener for grid view

i used gridview to display numbers, so if i click on any number the next activity should start. i tried this code but the app crashes private GridView gridView = null; gridView.setOnClickListener(new OnClickListener() {

Printing an Image using a Bluetooth Thermal Printer From an Android App?

Printing an Image using a Bluetooth Thermal Printer From an Android App?

I have been trying to get a print of an Image but I have not been successful so far.The printer is a locally manufactured 2" thermal printer having a printing resolution of 8dots/mm, 384dots/line, 203 dpi. The printer is based of a board ha

Can you give an example of stack overflow in C++?

Can you give an example of stack overflow in C++?

Can you give an example of stack overflow in C++? Other than the recursive case:void foo() { foo(); } 1:The typical case that does not involve infinite recursion is declaring an automatic variable on the stack that is too large. For exam

DI and Singleton Pattern in one implementation

DI and Singleton Pattern in one implementation

I want to refactor some code using the Windsor IOC/DI framework, but my issue is that I have some Singleton classes and Factory pattern classes and I am not sure that one can implement a Singleton or Factory using DI.Has anyone any ideas if

IBAction inside UITableViewCell not called in iOS 9

IBAction inside UITableViewCell not called in iOS 9

I have a custom UITableViewCell subclass which contains a few IBAction methods wired up from a nib.Under iOS 8 everything works as expected. If the user taps one of the buttons, the appropriate IBAction is called. If the user taps anywhere

android android.provider.MediaStore.ACTION_VIDEO_CAPTURE return null onActivityResult with nexus 7

android android.provider.MediaStore.ACTION_VIDEO_CAPTURE return null onActivityResult with nexus 7

I am using intent for record video.so i use following code on recordVideo button's clickVideofilepath = "";Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);startActivityForResult(intent,REQUEST_VIDEO_CAPTURED);an

Oracle 11g connection reset error

Oracle 11g connection reset error

Am seeing the below error while trying to connect to Oracle 11g on Red Hat Linux, 64-bit using thin jdbc drivers. Would highly appreciate if anyone can throw more light on how to go about troubleshooting this. Caused by: java.net.Soc

Read-Write lock with GCD

Read-Write lock with GCD

My application makes heavy use of GCD, and almost everything is split up in small tasks handled by dispatches. However, the underlying data model is mostly read and only occasionally written. I currently use locks to prevent changes to the

Xcode building and resources folders

Xcode building and resources folders

I have several resources in my iPhone app and when they get compiled they all get added to the root of the resources folder in the app regardless of the Xcode grouping structure. This is fine for most things, however there is a set of files

Sending mail: java.net.SocketException: Network is unreachable: connect

Sending mail: java.net.SocketException: Network is unreachable: connect

Try send mail via javax.mail:Properties props = new Properties();props.put("mail.smtp.host", "xxxxx");props.put("mail.smtp.port", "25");props.put("mail.smtp.auth", "false");Session session = Session.getInstance(props, new javax.mail.Authen