How do you know if main left?

In both C and C++, atexit functions are called either inside exit, or after main returns (which notionally calls exit: __libc_start_main(argc,argv) { __libc_constructors(); exit(main(argc,argv)); }). Is there a way to find out if we're inside the exi

Convert a column to a string of Power Query cells

I need to fit all the values of a column in Power Query into a 1-cell string separated by commas, as the example below: To do this, I have the following piece of code: let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Transp

Where null document = doctype

I am trying to do - Where doctype is not null (doctype=documenttype) I had a look at the SQL on MSDN for not null and where clauses and i cannot seem to find anything. My last attempt was where DocType is not null (f4111dt.DocType=f0911.documenttype)

YUI: checked check in IE?

I had a query written as: Y.all('.myClass:checked'); It worked great in everything but IE (8). I can't seem to get ':checked' to work at all with IE. Is it possible to query for only checked checkboxes like this and be compatible with IE?Have you inc

T-SQL Is there an abbreviated version of CASE WHEN ..?

With years of handling special cases in some of my queries, I'm curious if there is a simlified version of the CASE logic below: SELECT CASE WHEN AverageRate < 0.1 THEN 0 ELSE AverageRate END AS [AverageRate] FROM AdventureWorks.Sales.CurrencyRate Id

Can I use boost :: make_shared with a private constructor?

Consider the following: class DirectoryIterator; namespace detail { class FileDataProxy; class DirectoryIteratorImpl { friend class DirectoryIterator; friend class FileDataProxy; WIN32_FIND_DATAW currentData; HANDLE hFind; std::wstring root; Director

Unable to run & ldquo; Rhc setup & rdquo;

I am unable to execute the command "rhc setup" after installation of gem. I used a windows installer from Please see output below after executing rhc setup: > C:\Users\Admin>rhc setup > /usr/lib/ruby/1.9.1/rubygems/

SQL Server INSERT & hellip; The SELECT statement will not parse

I am getting the following error message with SQL Server 2005 Msg 120, Level 15, State 1, Procedure usp_AttributeActivitiesForDateRange, Line 18 The select list for the INSERT statement contains fewer items than the insert list. The number of SELECT

Regex matching a string - lookahead positive

Regexp: (?=(\d+))\w+\1 String: 456x56 Hi, I am not getting the concept, how this regex matches "56x56" in the string "456x56". The lookaround, (?=(\d+)), captures 456 and put into \1, for (\d+) The wordcharacter, \w+, matches the whole

Changing the value of the xml tag using perl

I am having a very long xml and I wish to update the attribute value of one of the tag which is very deep nested so don't want to go node by node. Also structure is not same for the intended node always as can be seen below: Input XML is: <Re> <C

Rails has_many foreign key producing an empty array

I'm can't figure out some weird behaviour that im getting in the rials console while I'm testing out some code. My models are as follows: profile.rb class Profile < ActiveRecord::Base belongs_to :user belongs_to :company attr_accessible :first_name,

Can I record / trigger my custom event?

Lets say I would like to trigger a custom event, something like: var foo = 5; if(foo == 5){ event(window,'fooIsFive'); } and then $(window).live('fooIsfive',function(){ alert('hey! foo is five!'); }); (Please excuse my poor imagination right now.) Is

Intent to send a null error

This question already has an answer here: What is a NullPointerException, and how do I fix it? 12 answers Code on sender class: public void sendQuestion(){ Random randomNumber = new Random(); final int rand = randomNumber.nextInt(19)+1; Intent number

svn find a file with a different revision

I have a basic SVN repository and this scenario: I have a shared server using SVN to update the source code. At first I update the whole repo using svn up to the lastest revision, ex: 12. But few time after someone (do not ask me why) use svn up -rXX

What version of ruby?

What the current stable recommended release of Ruby? 1.8.7 or 1.9.x? I will be deploying a rails(v 2.3.8) app & was wondering what version of ruby should I be using. My deployment environment is Ubuntu/Apache/passenger (mod_rails) web

How do I unShow () after (HtmlOutput)?

I have this working very nicely : var theForm = HtmlService.createTemplateFromFile('aForm').evaluate(); var theSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();; When the user has submitted data I want to close "theFor

Can I ignore the error without using try catch ()?

So I want to now if that possible for .NET languages to ignore error without using try catch construction ? I can ignore warring with #nowarring 40 for example, can I ignore error ? Why I want it ? simply wanted to call system pause with this way ope

All carriers and CSRF

We are building 3 different applications MVC application, API, SPA (not Angular) with ASP.NET Core. All the actions in this application are only for authorized users. That's why we protect them with IdentityServer. We use a cookie to store the value

Excel VBA dialog box locked in front of screen during macro

I've looked for this everywhere in vain. I have a macro in one Excel file (SplitTickets.xlsm) that loops through 3 separate Excel files. When SplitTickets is opened a dialog appears with a button to launch the macro. Since I don't want users to mess