Questions Tagged with #Excel

Only for questions on programming against Excel objects or files, or complex formula development. You may combine the Excel tag with VBA, VSTO, C#, VB.NET, PowerShell, OLE automation, and other programming related tags and questions if applicable. General help regarding MS Excel for single worksheet functions is available at Super User.

How to copy only a single worksheet to another workbook using vba

I have 1 WorkBook("SOURCE") that contains around 20 Sheets. I want to copy only 1 particular sheet to another Workbook("TARGET") using Excel VBA. Please note that the "TARGET" Workbook doen't exist ..

Excel function to get first word from sentence in other cell

Excel: What function can I use to take the all the characters from the beginning to the first '<". I am trying to strip out the first word from A1 and put it into B1 Eg: A1 Toronto<b> is ni..

vba: get unique values from array

Is there any built-in functionality in vba to get unique values from a one-dimensional array? What about just getting rid of duplicates? If not, then how would I get the unique values from an array?..

Count unique values in a column in Excel

I have an .xls file with a column with some data. How do I count how many unique values contains this column? I have googled many options, but the formulas they give there always give me errors. For ..

How to easily get network path to the file you are working on?

In Excel 2003 there used to be a command that I added to my toolbar that was called Address (if I remember correctly) and it would show the fully-qualified network path to the file I had open. For ex..

How to Remove Line Break in String

I want to Remove the Line Break from the string if my string Ends with Line Break. Sub linebreak(myString) If Len(myString) <> 0 Then If Right$(myString, 1) = vbCrLf Or Right$(myStri..

How to open spss data files in excel?

I want to open spss .sav data files in excel without open the spss files(i don't want to convert spss data file into excel file), I know this is possible using OLDB connection, but i don't know how to..

Excel cell value as string won't store as string

I can’t get this code here to grab cell content and store as string. I get a double: 54.6666666667 instead of N03:DM: (example cell contents). If I use Cstr(Sheet1.Cells(i, 5).Value) I still get sa..

Detect whether Excel workbook is already open

In VBA, I opened an MS Excel file named "myWork.XL" programmatically. Now I would like a code that can tell me about its status - whether it is open or not. I.e. something like IsWorkBookOpened("myWo..

IF formula to compare a date with current date and return result

I'm looking for a formula which allows me to look at a cell and check if it greater than or equal to today's date and to return a worded result such as "overdue". If it is blank to return another word..

Performing SQL queries on an Excel Table within a Workbook with VBA Macro

I am trying to make an excel macro that will give me the following function in Excel: =SQL("SELECT heading_1 FROM Table1 WHERE heading_2='foo'") Allowing me to search (and maybe even insert) data i..

excel vba getting the row,cell value from selection.address

For i = 1 To 20 '' select the cell in question Cells.Find(...).Select '' get the cell address CellAddr = Selection.Address(False, False, xlR1C1) Next The above is my code for searchin..

How do I set the background color of Excel cells using VBA?

As part of a VBA program, I have to set the background colors of certain cells to green, yellow or red, based on their values (basically a health monitor where green is okay, yellow is borderline and ..

Multiple axis line chart in excel

I'm looking for a multiple axis line chart similar to the one in the image below, (which is a javascript chart made by amcharts). Does excel have an option to draw charts line these? Note there are 3..

How do I express "if value is not empty" in the VBA language?

How do I express the condition "if value is not empty" in the VBA language? Is it something like this? "if value is not empty then..." Edit/Delete Message ..

macro for Hide rows in excel 2010

I'm kinda new to programming in VBA. I read some stuff on the internet but I couldnt find what I need or couldnt get it working. My problem: in worksheet 'sheet 1' in cell B6 a value is given for how ..

Copy/Paste from Excel to a web page

Is there a standard way or library to copy and paste from a spreasheet to a web form? When I select more than one cell from Excel I (obviously) lose the delimiter and all is pasted into one cell of th..

Referencing value in a closed Excel workbook using INDIRECT?

I want to refer to a cell value in another closed workbook with a formula (not VBA!). The Sheet name is stored as a variable (in the following example, C13 is "Sheet2"). If the other file is open, th..

How to give a time delay of less than one second in excel vba?

i want to repeat an event after a certain duration that is less than 1 second. I tried using the following code Application.wait Now + TimeValue ("00:00:01") But here the minimum delay time is one ..

Excel VBA - select a dynamic cell range

I want to be able to dynamically select a range of cells (the heading row), where the row is 1 but the columns with be for 1 to last column, where "A" is the first Column and where "M" is the last col..

Export DataTable to Excel File

I have a DataTable with 30+ columns and 6500+ rows.I need to dump the whole DataTable values into an Excel file.Can anyone please help with the C# code.I need each column value to be in a cell.To be p..

How to check for empty array in vba macro

I want to check for empty arrays. Google gave me varied solutions but nothing worked. Maybe I am not applying them correctly. Function GetBoiler(ByVal sFile As String) As String 'Email Signature ..

How can I combine multiple nested Substitute functions in Excel?

I am trying to set up a function to reformat a string that will later be concatenated. An example string would look like this: Standard_H2_W1_Launch_123x456_S_40K_AB Though sometimes the "S" doesn'..

If Cell Starts with Text String... Formula

I have formula that checks if the cell starts with text "A" returns Pick up "B" for Collect and C for Prepaid. But it doesn't seems to be working properly Both A and C returns Prepaid... =LOOKUP(LE..

Saving results with headers in Sql Server Management Studio

I am using SQL Server Management Studio. I wish to save the results of a query to an excel file. I choose "save as" and then save to CSV file which I can open in excel. All good except I am missi..

How to merge rows in a column into one cell in excel?

E.g A1:I A2:am A3:a A4:boy I want to merge them all to a single cell "Iamaboy" This example shows 4 cells merge into 1 cell however I have many cells (more than 100), I can't type them one by one..

Reference excel worksheet by name?

I have the name of a worksheet stored as a string in a variable. How do I perform some operation on this worksheet? I though I would do something like this: nameOfWorkSheet = "test" ActiveWorkbook.W..

What does an exclamation mark before a cell reference mean?

In a text about Excel I have read the following: =SUM(!B1:!K1) when defining a name for a cell and this was entered into the Refers To field. What does this mean?..

How to import an excel file in to a MySQL database

Can any one explain how to import a Microsoft Excel file in to a MySQL database? For example, my Excel table looks like this: Country | Amount | Qty ---------------------------------- Americ..

Getting Excel to refresh data on sheet from within VBA

How do you get spreadsheet data in Excel to recalculate itself from within VBA, without the kluge of just changing a cell value?..

How do I import from Excel to a DataSet using Microsoft.Office.Interop.Excel?

What I want to do I'm trying to use the Microsoft.Office.Interop.Excel namespace to open an Excel file (XSL or CSV, but sadly not XSLX) and import it into a DataSet. I don't have control over the work..

2 ways for "ClearContents" on VBA Excel, but 1 work fine. Why?

Good evening friends: I have in mind 2 ways for clearing a content in a defined range of cells of a VBA project (in MS Excel): Worksheets("SheetName").Range("A1:B10").ClearContents Worksheets("Shee..

Using Excel as front end to Access database (with VBA)

I am building a small application for a friend and they'd like to be able to use Excel as the front end. (the UI will basically be userforms in Excel). They have a bunch of data in Excel that they wou..

Application.WorksheetFunction.Match method

I have seen a lot of Topics to the "unable to get the match property of the Worksheetfunction class" problem. But I can't get my code fixed. Why isn't this code work? rowNum = Application.WorksheetF..

Import and Export Excel - What is the best library?

In one of our ASP.NET applications in C#, we take a certain data collection (SubSonic collection) and export it to Excel. We also want to import Excel files in a specific format. I'm looking for a lib..

Run-time error '1004' - Method 'Range' of object'_Global' failed

I have a problem in VBA with a line throwing back an error. What the macro is intended to do is find a particular cell then paste data into it. The code is as following: 'To find Column of Custome..

Excel column number from column name

How to get the column number from column name in Excel using Excel macro? ..

In Excel, sum all values in one column in each row where another column is a specific value

I'm wondering if there is an easy way to do what I'm looking for. Basically, I have a balance sheet in Excel 2011 with a bunch of data. One specific piece of information I always want visible is the a..

Excel: Creating a dropdown using a list in another sheet?

Let's say in Sheet1 I have a list of codes ("AA", "QF", etc). In Sheet2, I want a particular column to have cells that, when you click them, have a dropdown that consists of values from the code-lis..

How to detect if user select cancel InputBox VBA Excel

I have an input box asking user to enter a date. How do I let the program know to stop if the user click cancel or close the input dialog instead of press okay. Something like if str=vbCancel then ex..

Compare cell contents against string in Excel

Consider the following: A B 1 ENG 1 2 ENG 1 3 FRA 0 4 FOO 0 I need a formula to populate the B column with 1 if the A column contains the string ENG, or 0 otherwise. I've tried (in c..

Excel to CSV with UTF8 encoding

I have an Excel file that has some Spanish characters (tildes, etc.) that I need to convert to a CSV file to use as an import file. However, when I do Save As CSV it mangles the "special" Spanish cha..

ImportError: No module named win32com.client

I am currently using python 2.7 and trying to open an Excel sheet. When using the code below: import os from win32com.client import Dispatch xlApp = win32com.client.Dispatch("Excel.Application") xlA..

simple vba code gives me run time error 91 object variable or with block not set

So I have a simple little macro/sub defined when a command button is clicked. The problem is it gives me: Run Time Error '91' : Object Variable or With Block not Set My code is: Dim rng As Range rng =..

Declare a Range relative to the Active Cell with VBA

I need to declare a range object relative to the Active Cell. The problem is, the number of rows and columns I want to select is different each time the macro runs. For example, I have two variables..

VBA Subscript out of range - error 9

Can somebody help me with this code, I am getting a subscript out of range error: The line after the 'creating the sheets is highlighted in yellow in debugger 'Validation of year If TextBox_Year...

If WorkSheet("wsName") Exists

I'm wondering if there is clean cut functionality that returns True or False if a worksheet inside a workbook exists? It would be good, but not essential, if it's possible to do it without skipping ..

VBA: Conditional - Is Nothing

There is an If condition in a VBA application as seen below: If Not My_Object Is Nothing Then My_Object.Compute When the code is run in debug mode, I found that the If condition returns a true even..

VBA Macro On Timer style to run code every set number of seconds, i.e. 120 seconds

I have a need to run a piece of code every 120 seconds. I am looking for an easy way to do this in VBA. I know that it would be possible to get the timer value from the Auto_Open event to prevent ha..

Excel VBA: AutoFill Multiple Cells with Formulas

I have big amount of data that I collected from different files. In this main workbook, I have different types of formulas for every cells. In range A to F is where the data from other files are colle..

Excel telling me my blank cells aren't blank

So in excel I'm trying to get rid of the blank cells between my cells which have info in them by using F5 to find the blank cells, then Ctrl + - to delete them, and shift the cells up. But when I try ..

How to change Format of a Cell to Text using VBA

I have a "duration" column in an Excel sheet. Its cell format always changes — I want convert the duration from minutes to seconds, but because of the cell formatting it always gives me di..

How do I get the last character of a string using an Excel function?

How do I get the last character of a string using an Excel function?..

Excel VBA - Sum up a column

I'm trying to sum up a column in Excel VBA , however because there are blank spaces, I'm getting 0 as the sum. Dim rExternalTotal As Range , dExternalTotal as Double Set rExternalTotal = Range(rRepor..

Clear contents of cells in VBA using column reference

I am trying to get a piece of code to clear the data in some cells, using the column references. I am using the following code: Worksheets(sheetname).Range(.Cells(2, LastColData), .Cells(LastRowData,..

Saving a Excel File into .txt format without quotes

I have a excel sheet which has data in column A.There are many special characters in the cells.When I save the sheet in .txt format I get inverted commas at the start of each line. I tried both manual..

How to determine the last Row used in VBA including blank spaces in between

How can I determine the last row in an Excel sheet, including some blank lines in the middle? With this function: Function ultimaFilaBlanco(col As String) As Long Dim lastRow As Long..

Changing cell color using apache poi

I'm using Apache POI to read data in a spreadsheet of part numbers. I look up the part number in our database, if we have a CAD drawing of the part I color the part number cell green, if we don't I c..

How to add headers to a multicolumn listbox in an Excel userform using VBA

Is it possible to set up the headers in a multicolumn listbox without using a worksheet range as the source? The following uses an array of variants which is assigned to the list property of the list..

How do I get the old value of a changed cell in Excel VBA?

I'm detecting changes in the values of certain cells in an Excel spreadsheet like this... Private Sub Worksheet_Change(ByVal Target As Range) Dim cell As Range Dim old_value As String Dim new_value A..


I would like to include an "AND" condition for one of the conditions I have in my COUNTIFS clause. Something like this: =COUNTIFS(A1:A196;{"Yes"or "NO"};J1:J196;"Agree") So, it should return the n..

VBA Object doesn't support this property or method

I need to simply count the number of areas on a sheet. The code I have is : Sub areas() Dim i As Long i = Worksheets("Sheet2").Selection.Areas.Count MsgBox i End Sub But for some reason I..

Declaring variables in Excel Cells

Is it possible to declare variables in Excel cells and use them as parameters for formulas in other cells? For example I would declare var1=10 in one of the cells. In another cell I would use var1 f..

How to specify the current directory as path in VBA?

I have a macro-enabled WorkBook. I need to specify the current folder in which the macro-enabled file is present as the path. I tried setting path = ActiveWorkbook.Path and path = CurDir() but ..

Formatting MM/DD/YYYY dates in textbox in VBA

I'm looking for a way to automatically format the date in a VBA text box to a MM/DD/YYYY format, and I want it to format as the user is typing it in. For instance, once the user types in the second nu..

Count if two criteria match - EXCEL formula

I have this table and I would like to create a formula which would count values based on true conditions from column A and column C. Example: If in column A value is M (male), and in column C is YES..

How can VBA connect to MySQL database in Excel?

Dim oConn As ADODB.Connection Private Sub ConnectDB() Set oConn = New ADODB.Connection Dim str As String str = "DRIVER={MySQL ODBC 5.2.2 Driver};" & _ "..

VBA test if cell is in a range

I want to test if a given cell is within a given range in Excel VBA. What is the best way to do this?..

How to write/update data into cells of existing XLSX workbook using xlsxwriter in python

I am able to write into new xlsx workbook using import xlsxwriter def write_column(csvlist): workbook = xlsxwriter.Workbook("filename.xlsx",{'strings_to_numbers': True}) worksheet = workbo..

Running an Excel macro via Python?

I'm trying to run a macro via python but I'm not sure how to get it working... I've got the following code so far, but it's not working. import win32com.client xl=win32com.client.Dispatch("Excel.App..

Ignore cells on Excel line graph

I am trying to draw a line graph in Excel 2010. The y column data source has some gaps in it and I want these to be ignored for the graph. Seems to default these to zero. I know the "Hidden and Empty ..

what is this value means 1.845E-07 in excel?

I am reading the excel sheet from C# by using interop services. My sheet has one of cell value as 0.00. but run time when I am checking the value of that cell in C# code I am getting "1.845E-07" this ..

Convert Text to Date?

I have a column of dates (column A) stored as text in the format yyyy-mm-dd which I'm trying to convert to dates, ultimately so that I can do look ups against them. I've read a few topics on here and..

VBA: How to display an error message just like the standard error message which has a "Debug" button?

As usual, I create an error-handler using On Error Goto statement, there I put a few lines of cleaning codes and display the error message, but now I don't want to lose the comfortableness of the defa..

Declaring variable workbook / Worksheet vba

I know this might come off as a trivial question, but I can't seem to declare a workbook or a worksheet as a variable in VBA. I have the following code, but I can't figure out what I am doing wrong, i..

Saving to CSV in Excel loses regional date format

I have a .xls I need to convert to .csv The file contains some date columns. The format on the date is "*14/03/2001" which, according to Excel means the date responds to regional date and time settin..

How to insert a picture into Excel at a specified cell position with VBA

I'm adding ".jpg" files to my Excel sheet with the code below : 'Add picture to excel xlApp.Cells(i, 20).Select xlApp.ActiveSheet.Pictures.Insert(picPath).Select 'Calgulate new picture size With xlAp..

VBA for filtering columns

I have a big database-like sheet, first row contains headers. I would like a subset of rows of this table based on column values. Two issues: 1) VBA-wise I would like to loop through the columns, whe..

Using VBA code, how to export Excel worksheets as image in Excel 2003?

Please suggest the better way of exporting range of data from excel worksheets as image either in .jpeg or .png or in .gif...

VBA setting the formula for a cell

I'm trying to set the formula for a cell using a (dynamically created) sheet name and a fixed cell address. I'm using the following line but can't seem to get it working: "=" & strProjectName &am..

VBA - Select columns using numbers?

I'm looking for an alternative to this code, but using numbers. I want to select 5 columns, the start column is a variable, and then it selects 5 columns from this. Columns("A:E").Select How do I u..

Create Excel file in Java

I want to create an Excel file and write data just like writing a text file with Java. I tried to change file extension from .txt to .xls. But I want to bold letters in the Excel file. How can I do th..

VBA check if file exists

I have this code. It is supposed to check if a file exists and open it if it does. It does work if the file exists, and if it doesn't, however, whenever I leave the textbox blank and click the submit ..

Loop through each row of a range in Excel

This is one of those things that I'm sure there's a built-in function for (and I may well have been told it in the past), but I'm scratching my head to remember it. How do I loop through each row of..

How can I use a for each loop on an array?

I have an array of Strings: Dim sArray(4) as String I am going through each String in the array: for each element in sarray do_something(element) next element do_something takes a string as a ..

In excel how do I reference the current row but a specific column?

Let's say I had the datasheet A B C D ----------- 5 4 6 3 4 4 3 2 5 4 6 2 And I wanted to do something like A B C D E F -----------------------------------------..

VBA equivalent to Excel's mod function

Is there a vba equivalent to excel's mod function?..

Find row number of matching value

I've been trying several different methods of finding the row number of bingo (listed and separated by asterisks) but none seem to work. What am I doing wrong? In all instances I've tried looking both..

How to continue the code on the next line in VBA

I would like to type the mathematical forumla in VBA code which many lines. I would like to split it into many lines. How do I do it? For example: U_matrix(i, j, n + 1) = k * b_xyt(xi, yi, tn) / (4 ..

How to read single Excel cell value

I have excel file with sheet1 that has a value I need to read on row 2 and column 10. Here is my code. Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false..

Multiple IF AND statements excel

I need to write an "if" statement in Excel based on text in two different cells. If E2 ='in play' and F2 ='closed' output 3 If E2= 'in play' and F2 ='suspended' output 2 If E2 ='In Play'..

Simulate string split function in Excel formula

I am trying to split a string in an excel formula, something like I can do in many programming languages, e.g. string words = "some text".split(' '); The problem is that I can't be sure that there ..

What exactly is the function of Application.CutCopyMode property in Excel

Well first of all I found couple of answers while googling but most of the forums are blocked in my Office Network hence asking this question here! One more intention is to get an answer in plain Engl..

Excel: VLOOKUP that returns true or false?

In Excel we have the VLOOKUP function that looks for a value in a column in a table and then returns a value from a given column in that table if it finds something. If it doesn't, it produces an erro..

Java - Writing strings to a CSV file

I am trying to write data to a csv file with java, however when I try opening the produced file with excel I am getting an error saying the file is corrupt. Upon opening the file in notepad it looks t..

VBA code to set date format for a specific column as "yyyy-mm-dd"

I have a macro which I specify the date (in mm/dd/yyyy) in a textbox and I want to set this value for column A in yyyy-mm-dd format. I have the following code: Sheets("Sheet1").Range("A2", "A50000")..

Excel VBA function to print an array to the workbook

I've written a macro that takes a 2 dimensional array, and "prints" it to equivalent cells in an excel workbook. Is there a more elegant way to do this? Sub PrintArray(Data, SheetName, StartRow, Sta..

Using Excel OleDb to get sheet names IN SHEET ORDER

I'm using OleDb to read from an excel workbook with many sheets. I need to read the sheet names, but I need them in the order they are defined in the spreadsheet; so If I have a file that looks like..

Object of class stdClass could not be converted to string - laravel

I am following this documentation to implement export to Excel in my laravel 4 project. So am trying to generate excel file from array like this: //$results is taken with db query $data = array();..

Conditional formatting using AND() function

I'm trying conditional formatting on a sheet. I need to fill the cells with a certain color according to the following conditional statement: =AND((INDIRECT(ADDRESS(4;COLUMN()))>=INDIRECT(ADDRESS(..

Using json_encode on objects in PHP (regardless of scope)

I'm trying to output lists of objects as json and would like to know if there's a way to make objects usable to json_encode? The code I've got looks something like $related = $user->getRelatedUse..

PHP array printing using a loop

If I know the length of an array, how do I print each of its values in a loop?..

Pass parameter from a batch file to a PowerShell script

In my batch file, I call the PowerShell script like this: powershell.exe "& "G:\Karan\PowerShell_Scripts\START_DEV.ps1" Now, I want to pass a string parameter to START_DEV.ps1. Let's say the pa..

How to use select/option/NgFor on an array of objects in Angular2

I'm having trouble creating a select in Angular2 that is backed by an array of Objects instead of strings. I knew how to do it in AngularJS using ngOptions, but it doesn't seem to work in Angular2 (I'..

How to test if a string contains one of the substrings in a list, in pandas?

Is there any function that would be the equivalent of a combination of df.isin() and df[col].str.contains()? For example, say I have the series s = pd.Series(['cat','hat','dog','fog','pet']), and I ..

#1045 - Access denied for user 'root'@'localhost' (using password: YES)

This might seem redundant but I was unable to find a correct solution. I was unable to login to mysql using the mysql console.It is asking for a password and I have no clue what I actually entered.(I..

Does Python have a ternary conditional operator?

If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs?..

Write code to convert given number into words (eg 1234 as input should output one thousand two hundred and thirty four)

Write C/C++/Java code to convert given number into words. eg:- Input: 1234 Output: One thousand two hundred thirty-four. Input: 10 Output: Ten Does it require a complete switch case for digits 0 ..

Spring REST Service: how to configure to remove null objects in json response

I have a spring webservice that returns a json response. I'm using the example given here to create the service: The format the json is..

Install GD library and freetype on Linux

I'm trying to use imagefttext. And I need to have GD library and/or freetype installed. I'm new to this kind of stuffs, How can I install GD library and freetype in Linux ?..

Export data from R to Excel

I am writing codes to export database from R into Excel, I have been trying others codes including: write.table(ALBERTA1, "D:/ALBERTA1.txt", sep="\t") write.csv(ALBERTA1,":\ALBERTA1.csv") your_filena..

How can I make setInterval also work when a tab is inactive in Chrome?

I have a setInterval running a piece of code 30 times a second. This works great, however when I select another tab (so that the tab with my code becomes inactive), the setInterval is set to an idle s..

How do you convert a JavaScript date to UTC?

Suppose a user of your website enters a date range. 2009-1-1 to 2009-1-3 You need to send this date to a server for some processing, but the server expects all dates and times to be in UTC. Now s..

How do you get a timestamp in JavaScript?

How can I get a timestamp in JavaScript? Something similar to Unix timestamp, that is, a single number that represents the current time and date. Either as a number or a string...

int object is not iterable?

inp = int(input("Enter a number:")) for i in inp: n = n + i; print (n) ... throws an error: 'int' object is not iterable I wanted to find out the total by adding each digit, for eg, 110. 1..

Does bootstrap 4 have a built in horizontal divider?

Does bootstrap 4 have a built in horizontal divider? I can do this, <style type="text/css"> .h-divider{ margin-top:5px; margin-bottom:5px; height:1px; width:100%; border-top:1px solid gray..

Get year, month or day from numpy datetime64

I have an array of datetime64 type: dates = np.datetime64(['2010-10-17', '2011-05-13', "2012-01-15"]) Is there a better way than looping through each element just to get np.array of years: years =..

Socket.IO - how do I get a list of connected sockets/clients?

I'm trying to get a list of all the sockets/clients that are currently connected. io.sockets does not return an array, unfortunately. I know I could keep my own list using an array, but don't thin..

"CSV file does not exist" for a filename with embedded quotes

I am currently learning Pandas for data analysis and having some issues reading a csv file in Atom editor. When I am running the following code: import pandas as pd df = pd.read_csv("FBI-CRIME11...

Is a Python dictionary an example of a hash table?

One of the basic data structures in Python is the dictionary, which allows one to record "keys" for looking up "values" of any type. Is this implemented internally as a hash table? If not, what is i..

How do I get an element to scroll into view, using jQuery?

I have an HTML document with images in a grid format using <ul><li><img.... The browser window has both vertical & horizontal scrolling. Question: When I click on an image <im..

How can I set the color of a selected row in DataGrid

The default background color of a selected row in DataGrid is so dark that I can't read it. Is there anyway of overriding it? Tried this <dg:DataGrid.RowStyle> <Style TargetType="{x:Ty..

How to select only date from a DATETIME field in MySQL?

I have a table in the MySQL database that is set up with DATETIME. I need to SELECT in this table only by DATE and excluding the time. How do I SELECT in this table by only date and bypassing the time..

How to resolve "Error: bad index – Fatal: index file corrupt" when using Git

After git init, I added and committed a few files, made some changes, added and committed. Set up the git daemon (running under Cygwin on WinXP) and cloned the repository once. Now, I get this error ..

creating a random number using MYSQL

I would like to know is there a way to select randomly generated number between 100 and 500 along with a select query. Eg: SELECT name, address, random_number FROM users I dont have to store this n..

Git - remote: Repository not found

I have SourceTree with local working copy. And all operations work good, I can simple fetch, push, pull and etc via SourceTree. I just needed to make force push which does not exist in SourceTree. I ..

VB.NET: how to prevent user input in a ComboBox

How do you prevent user input in a ComboBox so that only one of the items in the defined list can be selected by the user?..

Changing Java Date one hour back

I have a Java date object: Date currentDate = new Date(); This will give the current date and time. Example: Thu Jan 12 10:17:47 GMT 2012 Instead, I want to get the date, changing it to one hour..

Is there a concise way to iterate over a stream with indices in Java 8?

Is there a concise way to iterate over a stream whilst having access to the index in the stream? String[] names = {"Sam","Pamela", "Dave", "Pascal", "Erik"}; List<String> nameList; Stream<I..

The remote host closed the connection. The error code is 0x800704CD

I receive error emails from my website whenever an exception occurs. I am getting this error: The remote host closed the connection. The error code is 0x800704CD and don't know why. I get about ..

PHP array: count or sizeof?

To find the number of elements in a PHP $array, which is faster/better/stronger? count($array) or sizeof($array) ? Edit Thanks to Andy Lester, I have refined my question to mean from a multilingual..

How to deserialize a list using GSON or another JSON library in Java?

I can serialize a List<Video> in my servlet on GAE, but I can't deserialize it. What am I doing wrong? This is my class Video in GAE, which is serialized: package legiontube; import java.uti..

How can I get customer details from an order in WooCommerce?

I have a function that does this: $order = new WC_Order($order_id); $customer = new WC_Customer($order_id); How can I get customer details from this? I have tried everything in the documentation, but..

VBA macro that search for file in multiple subfolders

I have macro, if I put in cell E1 name of the file, macro search trough C:\Users\Marek\Desktop\Makro\ directory, find it and put the needed values in specific cells of my original file with macro. ..

How can I delete a newline if it is the last character in a file?

I have some files that I'd like to delete the last newline if it is the last character in a file. od -c shows me that the command I run does write the file with a trailing new line: 0013600 n t ..

How can I restart a Java application?

How can I restart a Java AWT application? I have a button to which I have attached an event handler. What code should I use to restart the application? I want to do the same thing that Application.Re..

How do I create a timer in WPF?

I am a newbie in timer in wpf and I need a code that every 5mins there is a message box will pop up. .can anyone help me for the simple code of timer. That's what I tried so far: System.Windows.Thr..

Howto: Clean a mysql InnoDB storage engine?

Is it possible to clean a mysql innodb storage engine so it is not storing data from deleted tables? Or do I have to rebuild a fresh database every time?..

How do I set browser width and height in Selenium WebDriver?

I'm using Selenium WebDriver for Python. I want instantiate the browser with a specific width and height. So far the closest I can get is: driver = webdriver.Firefox() driver.set_window_size(1080,800..

Number format in excel: Showing % value without multiplying with 100

When I set format of a cell as %, it automatically multiply the value with 100 & show the value. So 5.66 becomes 566 %. I want to apply % format on a column but want to keep the values same as be..

Display DateTime value in dd/mm/yyyy format in Asp.NET MVC

Is it possible to display a DateTime value in dd/mm/yyyy format with the help of HTML Helper methods in Asp.NET MVC? I tried to do this by using some formats in @Html.LabelFor and adding some annotati..

How to serve up a JSON response using Go?

Question: Currently I'm printing out my response in the func Index like this fmt.Fprintf(w, string(response)) however, how can I send JSON properly in the request so that it maybe consumed by a view? ..

Absolute and Flexbox in React Native

I would like to put a white bar which would take all of the width at the bottom of the screen. To do so I thought about using absolute positioning with the inherited flexbox parameters. With the fol..

Disable LESS-CSS Overwriting calc()

Right Now I'm trying to do this in CSS3 in my LESS code: width: calc(100% - 200px); However, when LESS compiles it is outputting this: width: calc(-100%); Is there a way to tell LESS not to comp..

How to use a global array in C#?

I am making an text-based adventure game for my first little project in C#. In order for my vision to work I need a few arrays that can be accessed in any of the functions. The game will only consist ..

PHP mail not working for some reason

I am new to PHP and I'm using the mail function to send emails which is not working. I get a success message, but still it does not work same code <?php $email_to = "[email protected]"; $email_..

how to convert numeric to nvarchar in sql command

I need to convert a numeric value to nvarchar in sql command. Can anyone please help me...

C# List of objects, how do I get the sum of a property

I have a list of objects. One property of the individual object entry is amount. How do I get the sum of amount? If my list was of type double I may be able to do something like this: double total =..

How can I interrupt a running code in R with a keyboard command?

Can anyone tell how can I interrupt a running script in R? Let's say I have an infinite loop or some other problem, and I want to stop the script from running. Is there a keyboard command that does ..

Why does ++[[]][+[]]+[+[]] return the string "10"?

This is valid and returns the string "10" in JavaScript (more examples here): _x000D_ _x000D_ console.log(++[[]][+[]]+[+[]])_x000D_ _x000D_ _x000D_ Why? What is happening here?..

What are these ^M's that keep showing up in my files in emacs?

So I think it may have to do with textmate, but we work in a small team and are having some issues with full-file conflicts of nearly identical files in git because each line of one branch has a ^M ap..

How to detect when cancel is clicked on file input?

How can I detect when the user cancels a file input using an html file input? onChange lets me detect when they choose a file, but I would also like to know when they cancel (close the file choose di..

When should I use File.separator and when File.pathSeparator?

In the File class there are two strings, separator and pathSeparator. What's the difference? When should I use one over the other?..

How to find tag with particular text with Beautiful Soup?

I have the following html (line breaks marked with \n): ... <tr> <td class="pos">\n "Some text:"\n <br>\n <strong>some value</strong>\n </td>..

How to quickly drop a user with existing privileges

I'm trying to make restricted DB users for the app I'm working on, and I want to drop the Postgres database user I'm using for experimenting. Is there any way to drop the user without having to revoke..

How do I use a pipe to redirect the output of one command to the input of another?

I have a program which sends text to an LED sign. prismcom.exe To use the program to send "Hello": prismcom.exe usb Hello Now, I wish to, for example use a command program called Temperature. te..

SQL Server: Attach incorrect version 661

When trying to attach a database file to: Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (X64) Sep 16 2010 19:43:16 <X64> (Build 7600: ) I get this error message: The database cannot be ..

How do I use checkboxes in an IF-THEN statement in Excel VBA 2010?

I need to use the value of checkboxes for an IF-THEN statement. Based on what the user checks, the way I have to calculate things changes. However, I can't figure out how to use the checkbox values, o..

Using lodash to compare jagged arrays (items existence without order)

I know I can do it using loops, but I'm trying to find an elegant way of doing this: I have two jagged arrays (array of arrays): var array1 = [['a', 'b'], ['b', 'c']]; var array2 = [['b', 'c'], ['a', ..

How to sort in-place using the merge sort algorithm?

I know the question is not too specific. All I want is someone to tell me how to convert a normal merge sort into an in-place merge sort (or a merge sort with constant extra space overhead). All I..

AttributeError: 'module' object has no attribute 'urlretrieve'

I am trying to write a program that will download mp3's off of a website then join them together but whenever I try to download the files I get this error: Traceback (most recent call last): File "/h..

How can I get name of element with jQuery?

How can I get name property of HTML element with jQuery?..

How to format code in Xcode?

I wonder how can I format my code to align it neatly? Does it have a feature similar to Eclipse's ctrlshiftf?..

FPDF error: Some data has already been output, can't send PDF

I am using the fpdf library for my project, and I'm using this to extend one of the drupal module. These lines $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Cell(4..

How to use a wildcard in the classpath to add multiple jars?

I have been using so many 3rd party libraries(jar files) that my CLASSPATH is completely messed up as i have to include the path for every single jar file that i use. I've been wondering if there is ..

How to read the content of a file to a string in C?

What is the simplest way (least error-prone, least lines of code, however you want to interpret it) to open a file in C and read its contents into a string (char*, char[], whatever)?..

What are Covering Indexes and Covered Queries in SQL Server?

Can you explain the concepts of, and relationship between, Covering Indexes and Covered Queries in Microsoft's SQL Server?..

jQuery AJAX submit form

I have a form with name orderproductForm and an undefined number of inputs. I want to do some kind of jQuery.get or ajax or anything like that that would call a page through Ajax, and send along all ..

Change font size of UISegmentedControl

Can anyone please tell me how can I change the font type and size of UISegmentedControl?..

Get element type with jQuery

Is it possible, using jQuery, to find out the type of an element with jQuery? For example, is the element a div, span, select, or input? For example, if I am trying to load values into a drop-down li..

Commenting out a set of lines in a shell script

I was wondering if there is a way to comment out a set of lines in a shell script. How could I do that? We can use /* */ in other programming languages. This is most useful when I am converting/using/..

What's the best UI for entering date of birth?

What is the best method for date of birth selector? 3 text inputs (month / day / year) or one mask input. User MUST use keyboard 3 select boxes. User can use keyboard or mouse. One nice datepicker...

How to get a key in a JavaScript object by its value?

I have a quite simple JavaScript object, which I use as an associative array. Is there a simple function allowing me to get the key for a value, or do I have to iterate the object and find it out manu..

Can an abstract class have a constructor?

Can an abstract class have a constructor? If so, how can it be used and for what purposes?..

How do I sort a dictionary by value?

I have a dictionary of values read from two fields in a database: a string field and a numeric field. The string field is unique, so that is the key of the dictionary. I can sort on the keys, but how..

How can I convert an RGB image into grayscale in Python?

I'm trying to use matplotlib to read in an RGB image and convert it to grayscale. In matlab I use this: img = rgb2gray(imread('image.png')); In the matplotlib tutorial they don't cover it. They ju..

How to convert integer timestamp to Python datetime

I have a data file containing timestamps like "1331856000000". Unfortunately, I don't have a lot of documentation for the format, so I'm not sure how the timestamp is formatted. I've tried Python's st..

how do I loop through a line from a csv file in powershell

I want to process a csv file in powershell, but I don't know what the column headings in the CSV file will be when it is processed. For example: $path = "d:\scratch\export.csv" $csv = Import-csv -p..

Using custom fonts using CSS?

I've seen some new websites that are using custom fonts on their sites (other than the regular Arial, Tahoma, etc.). And they support a nice amount of browsers. How does one do that? While also prev..

getting the table row values with jquery

I am trying to get the values from an html table row. When I click on the table row delete button, I want to put those values on variables to send to the server. I have found something from here that ..

How can I delete multiple lines in vi?

I have tried to follow the following: How to delete selected text in VI editor but 5dd gives E492: Not an editor command: 5dd I then tried: 5d Which only deletes a single line. How can ..

How can I get the sha1 hash of a string in node.js?

I'm trying to create a websocket server written in node.js To get the server to work I need to get the SHA1 hash of a string. What I have to do is explained in Section 5.2.2 page 35 of the docs. ..

What is java pojo class, java bean, normal class?

Possible Duplicate: Difference between DTO, VO, POJO, JavaBeans? Hi please don't say my question is duplicate :-) I saw all questions but didn't understand the exact difference. Can someon..

Tri-state Check box in HTML?

There is no way to have a tri-state check button (yes, no, null) in HTML, right? Are there any simple tricks or work-arounds without having to render the whole thing by oneself?..

How do I pull my project from github?

I have a project on github that I have been working on before. However, I wiped out my computer and I am wondering which git command should I invoke under my username to checkout my project again so ..

Where is SQLite database stored on disk?

Where is the SQLite database stored i.e. directory path on windows 7 when created ?..

Invalid CSRF Token 'null' was found on the request parameter '_csrf' or header 'X-CSRF-TOKEN'

After configuring Spring Security 3.2, _csrf.token is not bound to a request or a session object. This is the spring security config: <http pattern="/login.jsp" security="none"/> <http>..

Is object empty?

What is the fastest way to check if an object is empty or not? Is there a faster and better way than this: function count_obj(obj){ var i = 0; for(var key in obj){ ++i; } re..

How to duplicate sys.stdout to a log file?

Edit: Since it appears that there's either no solution, or I'm doing something so non-standard that nobody knows - I'll revise my question to also ask: What is the best way to accomplish logging when ..

Full Screen Theme for AppCompat

I would like to know how can I apply full screen theme ( no title bar + no actionbar ) to an activity. I am using AppCompat library from support package v7. I've tried to applied android:theme="@and..

html cellpadding the left side of a cell

I want to pad my text in a cells on the right side with additional space . I don't use css style sheets . this is my code <table border="1" CELLPADDING="5"> on right size for example I want 1..

How to define partitioning of DataFrame?

I've started using Spark SQL and DataFrames in Spark 1.4.0. I'm wanting to define a custom partitioner on DataFrames, in Scala, but not seeing how to do this. One of the data tables I'm working with..

How can I split a string into segments of n characters?

As the title says, I've got a string and I want to split into segments of n characters. For example: var str = 'abcdefghijkl'; after some magic with n=3, it will become var arr = ['abc','def','gh..

understanding private setters

I don't understand the need of having private setters which started with C# 2. Having a setter method for me is letting the user to set some variables in that class. In doing so, we will not expose ..

2D array values C++

I wanted to declare a 2D array and assign values to it, without running a for loop. I thought I could used the following idea int array[5] = {1,2,3,4,5}; Which works fine to initialize the 2D arr..

How does ifstream's eof() work?

#include <iostream> #include <fstream> int main() { std::fstream inf( "ex.txt", std::ios::in ); while( !inf.eof() ) { std::cout << inf.get() << "\n"; } ..

jQuery AJAX single file upload

I know this question has been asked a lot, and I tried at least 10 different codes to run this without success. I'm trying to upload a single file with jQuery.ajax(), but it doesn't work. The code be..

Populating a razor dropdownlist from a List<object> in MVC

I have a model: public class DbUserRole { public int UserRoleId { get; set; } public string UserRole { get; set; } } public class DbUserRoles { public List<DbU..

How to recognize swipe in all 4 directions

I need to use swipe to recognize swipe gesture down and then right. But on swift UISwipeGestureRecognizer has predeterminate Right direction.. And I don't know how make this for use other directions....

TCP: can two different sockets share a port?

This might be a very basic question but it confuses me. Can two different connected sockets share a port? I'm writing an application server that should be able to handle more than 100k concurrent conn..

Datagrid binding in WPF

I know this has been asked already but I have done almost everything what is suggested by developers. <DataGrid x:Name="Imported" VerticalAlignment="Top" DataContext="{Binding Source=list}" AutoG..

In NetBeans how do I change the Default JDK?

Possible Duplicate: Changing Java platform on which Netbeans runs Here is an image of my default JDK (which is 1.6) and the JDK I want to set as default (which is 1.7)

How to equalize the scales of x-axis and y-axis in Python matplotlib?

I wish to draw lines on a square graph. The scales of x-axis and y-axis should be the same. e.g. x ranges from 0 to 10 and it is 10cm on the screen. y has to also range from 0 to 10 and has to be al..

Magento: Set LIMIT on collection

The question that I tried to find out was how do we set a Limit on a Collection, the answers that I found on Google was only available for the Catalog with a setPage($pageNum, $pageSize). That didn't ..

Query an object array using linq

I would like to know how can I query an array of objects. For example I have an array object like CarList. So CarList[0] would return me the object Car. Car has properties Model and Make. Now, I want ..

git: can't push (unpacker error) related to permission issues

I have this problem when i try to push in git: error: insufficient permission for adding an object to repository database ./objects fatal: failed to write object error: unpack failed: unpack-objects..

Blurring an image via CSS?

On many smartphones (Samsung Galaxy II being an example) when you browse through a photo gallery, its blurred copy is laid out in the background. Can this be achieved by CSS dynamically (ie. without t..

PyLint "Unable to import" error - how to set PYTHONPATH?

I'm running PyLint from inside Wing IDE on Windows. I have a sub-directory (package) in my project and inside the package I import a module from the top level, ie. subdir\..

What is the difference between int, Int16, Int32 and Int64?

What is the difference between int, System.Int16, System.Int32 and System.Int64 other than their sizes?..

Maintain model of scope when changing between views in AngularJS

I am learning AngularJS. Let's say I have /view1 using My1Ctrl, and /view2 using My2Ctrl; that can be navigated to using tabs where each view has its own simple, but different form. How would I make..

Change directory command in Docker?

In docker I want to do this: git clone XYZ cd XYZ make XYZ However because there is no cd command, I have to pass in the full path everytime (make XYZ /fullpath). Any good solutions for this?..

<Django object > is not JSON serializable

I have the following code for serializing the queryset; def render_to_response(self, context, **response_kwargs): return HttpResponse(json.simplejson.dumps(list(self.get_queryset())), ..

How to convert list of numpy arrays into single numpy array?

Suppose I have ; LIST = [[array([1, 2, 3, 4, 5]), array([1, 2, 3, 4, 5],[1,2,3,4,5])] # inner lists are numpy arrays I try to convert; array([[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2,..

efficient way to implement paging

Should I use LINQ's Skip() and Take() method for paging, or implement my own paging with a SQL query? Which is most efficient? Why would I choose one over the other? I'm using SQL Server 2008, ASP.N..

What is the best way to update the entity in JPA

I am doing some CRUD operations using JPA. For updating an object which is the right way to do? Through update query or through the find method of EntityManager? I have one Employee object I need to..

How to add an element to Array and shift indexes?

I need to add an element to Array specifying position and value. For example, I have Array int []a = {1, 2, 3, 4, 5, 6}; after applying addPos(int 4, int 87) it should be int []a = {1, 2, 3, 4, 87..

Why am I getting "void value not ignored as it ought to be"?

I have the following function : void getdata(int arr[], int n) { for (int i = 0; i < n; i++) { int a = srand(time(NULL)); arr[i] = a; } } And I call it in main: ge..

How can I show current location on a Google Map on Android Marshmallow?

I want google maps to show the location of the user. I tried this code, but it did not work on Android 6. private GoogleMap map; LocationManager lm; LocationListener ll; Location l; LatLng pos; @Ov..

Project with path ':mypath' could not be found in root project 'myproject'

I'm migrated from Eclipse to android studio 0.5.8, after importing my project to android studio i was getting the error Project with path ':progressfragment' could not be found in root project 'projec..

How to redirect DNS to different ports

TL;DR: DNS resolution of a domain(s) must map to IP:port(s), instead of just IP. Example, I CAN modify DNS records. I own the domain "..

gnuplot - adjust size of key/legend

How do I adjust the size of the legend in gnuplot (4.6.0)? By this I mean the size of the lines and not just the font size. When I switched from the pdf to pdfcairo terminal the size suddenly jumped a..

Insert data to MySql DB and display if insertion is success or failure

I am inserting data to a MySQL DB, In case if the insertion fails i need to give an appropriate error message indicating so. According to my code below i will be Echo-ing the message Inserted if the i..

How do I disable fail_on_empty_beans in Jackson?

Using jackson 2.1, how do I disable the fail_on_empty beans that the error message seems to want me to disable? I'm assuming this is just the simplest thing in the world, but hell it is late and I h..

use of entityManager.createNativeQuery(query,foo.class)

I would like to return a List of Integers from a javax.persistence.EntityManager.createNativeQuery call Why is the following incorrect? entityManager.createNativeQuery("Select P.AppID From P", Int..

Dynamically Fill Jenkins Choice Parameter With Git Branches In a Specified Repo

I have a parameterized Jenkins job which requires the input of a specific Git branch in a specific Git repo. Currently this parameter is a string parameter. Is there any way to make this parameter a..

C error: undefined reference to function, but it IS defined

Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header file, point.h: //type for a Cartesian point typedef struct { double x; double y..

How to export private key from a keystore of self-signed certificate

I just created a self-signed certificate on a linux box running tomcat 6. I created the keys like this, valid for 10 years: keytool -genkey -alias tomcatorange -keyalg RSA -validity 3650 and copie..

Browser Caching of CSS files

Quick question regarding CSS and the browser. I tried searching SO and found some similar posts, but nothing definitive. I use one or two CSS files in my web projects. These are referenced in the HEA..

Count textarea characters

I am developing a character count for my textarea on this website. Right now, it says NaN because it seems to not find the length of how many characters are in the field, which at the beginning is 0, ..

How to downgrade php from 5.5 to 5.3

Is there a way to downgrade php 5.5 to 5.3 in xampp? I searched on google but every one just tell me to uninstall xampp and install an older version. Could I have php 5.5 downgrade to 5.3 without rein..

Remove blank values from array using C#

How can I remove blank values from an array? For example: string[] test={"1","","2","","3"}; in this case, is there any method available to remove bl..

Compare two objects' properties to find differences?

I have two objects of the same type, and I want to loop through the public properties on each of them and alert the user about which properties don't match. Is it possible to do this without knowing ..

Send POST data via raw json with postman

I've got Postman (the one that doesn't open in Chrome) and I'm trying to do a POST request using raw json. In the Body tab I have "raw" selected and "JSON (application/json)" with this body: { "..

javascript cell number validation

I want to validate cell number using JavaScript. Here is my code. if(number.value == "") { window.alert("Error: Cell number must not be null."); number.focus(); return false; } if(numbe..

Conditionally displaying JSF components

First, I am new to Java EE, came from a strong ASP .NET development background. I have gone through the net, and I might miss this but it seems like there is no simple and straight-to-the-point tutori..

Is there a numpy builtin to reject outliers from a list

Is there a numpy builtin to do something like the following? That is, take a list d and return a list filtered_d with any outlying elements removed based on some assumed distribution of the points in ..

How to select into a variable in PL/SQL when the result might be null?

Is there a way in to just run a query once to select into a variable, considering that the query might return nothing, then in that case the variable should be null. Currently, I can't do a select in..

How to install Laravel's Artisan?

I want to create migrations in Laravel but according to the tutorials I need the Artisan CLI. The php command works fine and I'm on Windows. I type in php artisan or php artisan list and I get the fol..

What is the benefit of using "SET XACT_ABORT ON" in a stored procedure?

What is the benefit of using SET XACT_ABORT ON in a stored procedure?..

Must JDBC Resultsets and Statements be closed separately although the Connection is closed afterwards?

It is said to be a good habit to close all JDBC resources after usage. But if I have the following code, is it necessary to close the Resultset and the Statement? Connection conn = null; PreparedStat..

How to right align widget in horizontal linear layout Android?

This is the code I am using and it is not working: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="" android:layout_width="f..

How do I pass options to the Selenium Chrome driver using Python?

The Selenium documentation mentions that the Chrome webdriver can take an instance of ChromeOptions, but I can't figure out how to create ChromeOptions. I'm hoping to pass the --disable-extensions fl..

How can I insert values into a table, using a subquery with more than one result?

I really would appreciate your help. Probably it's a quite simple problem to solve - but I'm not the one .. ;-) I have two tables in SQL Server: article prices Now I want to select a certain set..

Use basic authentication with jQuery and Ajax

I am trying to create a basic authentication through the browser, but I can't really get there. If this script won't be here the browser authentication will take over, but I want to tell the browser ..

Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

I created a windows application developed in .NET 3.5 in a 32 bit Windows 2008 server. When deployed the application in a 64 bit server it shows the error "Microsoft.Jet.OLEDB.4.0' provider is not reg..

Run Java Code Online allow you to run C,C++,D etc code online but not Java... is there a site that I can use for Java?..

Adding git branch on the Bash command prompt

I tried adding the git branch I'm currently working on (checked-out) on the bash prompt without success.. (while keeping my current path which shows the active directory/file intact) I have a .bashrc..

What does cmd /C mean?

I can understand cmd but not cmd /c. I was trying to invoke a java program from the current for which I use Runtime.getRuntime().exec("cmd /C java helloworld"); There arises my doubt...

Node.js - Maximum call stack size exceeded

When I run my code, Node.js throws a "RangeError: Maximum call stack size exceeded" exception caused by too many recursive calls. I tried to increase Node.js stack size by sudo node --stack-size=16000..

What is the (function() { } )() construct in JavaScript?

I used to know what this meant, but I'm struggling now... Is this basically saying document.onload? (function () { })(); ..

Fiddler not capturing traffic from browsers

I've been using Fiddler for quite a while, but all of a sudden it no longer captures internet traffic. I'm on Chrome 29 and Fiddler v4.4.5.1. I've checked all filters and rules and nothing is on. I..

Blurry text after using CSS transform: scale(); in Chrome

Seems like there has been a recent update to Google Chrome that causes blurry text after doing a transform: scale(). Specifically I'm doing this: @-webkit-keyframes bounceIn { 0% { opacity: 0; ..

MultipartException: Current request is not a multipart request

I am trying to make a restful controller to upload files. I have seen this and made this controller: @RestController public class MaterialController { @RequestMapping(value="/upload", method= R..

Check if string contains only whitespace

How can I test if a string contains only whitespace? Example strings: " " (space, space, space) " \t \n " (space, tab, space, newline, space) "\n\n\n\t\n" (newline, ..

How to add an existing folder with files to SVN?

How do you add a folder without version control to a specific SVN location? I often start writing code and only after I have a few folders containing code files do I add it to SVN. What I usually do..

java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer in java 1.6

Even I'm casting Object into int, but this exception occur... Actually my Hibernate-JPA method was return Object then I'm converting that Object into int... Here is my Hibernate code: @Transactiona..

Laravel stylesheets and javascript don't load for non-base routes

Okay--I know this is a really elementary issue, but I can't figure it out. This is a question regarding Laravel. Basically, I have my stylesheets embedded in my default layout view. I'm currently jus..

Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?

I have applied every solution available on internet but still I cannot run Docker. I want to use Scrapy Splash on my server. Here is history of commands I ran. docker run -p 8050:8050 scrapinghub/s..

How do you properly use WideCharToMultiByte

I've read the documentation on WideCharToMultiByte, but I'm stuck on this parameter: lpMultiByteStr [out] Pointer to a buffer that receives the converted string. I'm not quite sure how to properly ..

NSString property: copy or retain?

Let's say I have a class called SomeClass with a string property name: @interface SomeClass : NSObject { NSString* name; } @property (nonatomic, retain) NSString* name; @end I understand that..

Could not find folder 'tools' inside SDK

I am starting Android Development using Eclipse. I have downloaded all the required software but I am having the same problem as discussed here. Now I do not find the solution of the problem on that d..

setTimeout or setInterval?

As far as I can tell, these two pieces of javascript behave the same way: Option A: function myTimeoutFunction() { doStuff(); setTimeout(myTimeoutFunction, 1000); } myTimeoutFunction(); O..

How to install mcrypt extension in xampp

how to install mcrypt in xampp on windows? My PHP Version 7.0.5 and xampp pack have not mcrypt extension so how can i install mcrypt on xampp ? ..

How to automatically update an application without ClickOnce?

For the project I am working on, I am not allowed to use ClickOnce. My boss wants the program to look "real" (with an installer, etc). I have installed Visual Studio 2012 Professional, and have been ..

Get Maven artifact version at runtime

I have noticed that in a Maven artifact's JAR, the project.version attribute is included in two files: META-INF/maven/${groupId}/${artifactId}/ META-INF/maven/${groupId}/${artifactId}/p..

Pandas - Plotting a stacked Bar Chart

I am trying to create a stacked bar graph that replicates the picture, all my data is separate from that excel spreadsheet. I cant figure out how to make a dataframe for it like pictured, nor can I..

@Resource vs @Autowired

Which annotation, @Resource (jsr250) or @Autowired (Spring-specific) should I use in DI? I have successfully used both in the past, @Resource(name="blah") and @Autowired @Qualifier("blah") My instin..

How can a LEFT OUTER JOIN return more records than exist in the left table?

I have a very basic LEFT OUTER JOIN to return all results from the left table and some additional information from a much bigger table. The left table contains 4935 records yet when I LEFT OUTER JOIN ..

JavaScript - XMLHttpRequest, Access-Control-Allow-Origin errors

I'm attempting to send a XMLHttpRequest to a paste site. I'm sending an object containing all the fields that the api requires, but I keep getting this issue. I have read over the issue, and I thought..

Frequency table for a single variable

One last newbie pandas question for the day: How do I generate a table for a single Series? For example: my_series = pandas.Series([1,2,2,3,3,3]) pandas.magical_frequency_function( my_series ) >..

How do I import a namespace in Razor View Page?

How to import a namespace in Razor View Page?..

How to delete all files and folders in a folder by cmd call

I use Windows. I want to delete all files and folders in a folder by system call. I may call like that: >rd /s /q c:\destination >md c:\destination Do you know an easier way?..

How to use HTTP GET in PowerShell?

Possible Duplicate: Get $webclient.downloadstring to write to text file in Powershell Powershell http post with .cer for auth I have an SMS system that provide me the ability to send SMS ..

How to set time to 24 hour format in Calendar

I need to set the time on the current date. The time string is always in 24 hour format but the result I get is wrong: SimpleDateFormat df = new SimpleDateFormat("kk:mm"); Date d1 = df.parse("10:..

Android Canvas.drawText

I have a view, I'm drawing with the Canvas object in the onDraw(Canvas canvas) method. My code is: Paint paint = new Paint(); paint.setColor(Color.WHITE); paint.setStyle(Style.FILL); canvas.drawPaint..

Python pandas: how to specify data types when reading an Excel file?

I am importing an excel file into a pandas dataframe with the pandas.read_excel() function. One of the columns is the primary key of the table: it's all numbers, but it's stored as text (the little g..

How to make a link open multiple pages when clicked

I have two (or more) links. For example: and How can I make them both open when I click on a single link? For example, a link entitled "click here" which, when cl..

How can I monitor the thread count of a process on linux?

I would like to monitor the number of threads used by a specific process on Linux. Is there an easy way to get this information without impacting the performance of the process?..

Getting a machine's external IP address with Python

Looking for a better way to get a machines current external IP #... Below works, but would rather not rely on an outside site to gather the information ... I am restricted to using standard Python 2.5..

ORA-01653: unable to extend table by in tablespace ORA-06512

I tried to generate some test data by running the following sql. BEGIN FOR i IN 1..8180 LOOP insert into SPEEDTEST select 'column1', 'column2', 'column3', 'column4', 'column5', 'column6..

Why am I getting "IndentationError: expected an indented block"?

if len(trashed_files) == 0 : print "No files trashed from current dir ('%s')" % os.path.realpath(os.curdir) else : index=raw_input("What file to restore [0..%d]: " % (len(trashed_files)-1)) ..

Get an array of list element contents in jQuery

I have a structure like this: <ul> <li>text1</li> <li>text2</li> <li>text3</li> </ul> How do I use javascript or jQuery to get the text as an a..

C++ IDE for Macs

I teach a C++ course using Visual Studio. One of my students has a Mac and was looking for an IDE to use on his machine. What would be good to recommend?..

SQL Server format decimal places with commas

How can I convert the decimal values to have some commas? this Helps me. But my problem the decimal places are set to 2 only..I want the decimal to be 2, 3, or 4..example 1,234.123 or 1,234.123..

Sending HTTP POST Request In Java

lets assume this URL... (Here id needs to be sent in a POST request) I want to send the id = 10 to the server's page.php, which accepts it in a PO..

Wildcards in a Windows hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost. The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.lo..

How to call another controller Action From a controller in Mvc

I need to call a controller B action FileUploadMsgView from Controller A and need to pass a parameter for it. Code---its not going to the controller B's FileUploadMsgView(). In ControllerA pr..

How to embed PDF file with responsive width

I'm embedding pdf files using something like this: <div class="graph-outline"> <object style="width:100%;" data="path/to/file.pdf?#zoom=85&scrollbar=0&toolbar=0&navpanes=0" t..

Why use the 'ref' keyword when passing an object?

If I am passing an object to a method, why should I use the ref keyword? Isn't this the default behaviour anyway? For example: class Program { static void Main(string[] args) { TestR..

JPA 2.0, Criteria API, Subqueries, In Expressions

I have tried to write a query statement with a subquery and an IN expression for many times. But I have never succeeded. I always get the exception, " Syntax error near keyword 'IN' ", the query stat..

Replacing instances of a character in a string

This simple code that simply tries to replace semicolons (at i-specified postions) by colons does not work: for i in range(0,len(line)): if (line[i]==";" and i in rightindexarray): line..

.gitignore and "The following untracked working tree files would be overwritten by checkout"

So I added a folder to my .gitignore file. Once I do a git status it tells me # On branch latest nothing to commit (working directory clean) However, when I try to change branches I get the follow..

What is the most compatible way to install python modules on a Mac?

I'm starting to learn python and loving it. I work on a Mac mainly as well as Linux. I'm finding that on Linux (Ubuntu 9.04 mostly) when I install a python module using apt-get it works fine. I can im..

Android - Activity vs FragmentActivity?

I am new in Android. I want to build an app with tab format. I found many documentation where Activity has been used. Also in many cases have used FragmentActivity. I am not sure which will be better ..

How to print full stack trace in exception?

For example, in one place... //---------------a try { // some network call } catch(WebException we) { throw new MyCustomException("some message ....", we); } ...and in another place... //-..

Java finished with non-zero exit value 2 - Android Gradle

I'm getting this error executing my Android app (I cleaned it and then built it, but the error is still present) Sync: OK Make Project: OK Clean: OK Run: Error Error:Execution failed for task ..

Command line for looking at specific port

Is there a way to examine the status of a specific port from the Windows command line? I know I can use netstat to examine all ports but netstat is slow and looking at a specific port probably isn't...

Skip first line(field) in loop using CSV file?

Possible Duplicate: When processing CSV data, how do I ignore the first line of data? I am using python to open CSV file. I am using formula loop but I need to skip the first row because it h..

Generating combinations in c++

I have been searching a source code for generating combination using c++. I found some advanced codes for this but that is good for only specific number predefined data. Can anyone give me some hints,..

Getting "NoSuchMethodError: org.hamcrest.Matcher.describeMismatch" when running test in IntelliJ 10.5

I'm using JUnit-dep 4.10 and Hamcrest 1.3.RC2. I've created a custom matcher that looks like the following: public static class MyMatcher extends TypeSafeMatcher<String> { @Override pr..