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.
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: 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..
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?..
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 ..
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..
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..
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..
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..
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..
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..
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..
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..
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 ..
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 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
..
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 ..
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..
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..
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 ..
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..
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..
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
..
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'..
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..
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..
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..
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..
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?..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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 =..
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..
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...
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 ..
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..
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..
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..
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 ..
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..
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..
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,..
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 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..
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..
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..
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..
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..
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..
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 ..
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..
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..
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};" & _
"..
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..
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..
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 ..
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 ..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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 ..
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..
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 ..
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
-----------------------------------------..
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..
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 ..
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..
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'..
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 ..
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..
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..
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..
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")..
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..
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..
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();..
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(..
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..
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..
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'..
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 ..
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..
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 ..
I have a spring webservice that returns a json response. I'm using the example given here to create the service:
http://www.mkyong.com/spring-mvc/spring-3-mvc-and-json-example/
The format the json is..
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 ?..
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..
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..
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 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...
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? 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..
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 =..
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..
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...
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..
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..
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..
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..
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 ..
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..
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 ..
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 whilst having access to the index in the stream?
String[] names = {"Sam","Pamela", "Dave", "Pascal", "Erik"};
List<String> nameList;
Stream<I..
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 ..
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..
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..
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..
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.
..
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 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..
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..
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?..
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..
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..
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..
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? ..
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..
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..
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 ..
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_..
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 =..
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 ..
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?..
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 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..
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..
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..
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 ..
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..
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', ..
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..
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..
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..
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 ..
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)?..
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 ..
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..
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 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...
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..
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..
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..
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..
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..
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..
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 ..
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 ..
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.
..
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..
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?..
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 ..
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>..
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..
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 ..
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..
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..
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..
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..
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 ..
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..
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..
I have a model:
public class DbUserRole
{
public int UserRoleId { get; set; }
public string UserRole { get; set; }
}
public class DbUserRoles
{
public List<DbU..
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....
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..
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..
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)
http://tinypic.com/v..
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..
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 ..
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 ..
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..
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..
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.
__init__.py
myapp.py
one.py
subdir\..
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..
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?..
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())),
..
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..
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..
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..
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..
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..
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..
TL;DR:
DNS resolution of a domain(s) must map to IP:port(s), instead of just IP.
Example,
sub1.example.com 1.2.3.4:567
sub2.example.com 1.2.3.4:678
I CAN modify DNS records.
I own the domain "..
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..
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..
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..
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..
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..
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..
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..
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..
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, ..
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..
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..
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 ..
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:
{
"..
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..
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 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 ..
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..
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..
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..
This is the code I am using and it is not working:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="f..
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..
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..
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 ..
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..
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..
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...
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..
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..
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;
..
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..
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 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..
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..
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..
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..
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 ..
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..
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..
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..
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 ..
I have noticed that in a Maven artifact's JAR, the project.version attribute is included in two files:
META-INF/maven/${groupId}/${artifactId}/pom.properties
META-INF/maven/${groupId}/${artifactId}/p..
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..
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..
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 ..
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..
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 )
>..
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?..
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 ..
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:..
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..
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..
I have two (or more) links. For example: http://google.com and http://yahoo.com.
How can I make them both open when I click on a single link?
For example, a link entitled "click here" which, when cl..
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?..
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..
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..
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))
..
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?..
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..
lets assume this URL...
http://www.example.com/page.php?id=10
(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..
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..
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..
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..
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..
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..
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..
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..
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..
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 ..
For example, in one place...
//---------------a
try
{
// some network call
}
catch(WebException we)
{
throw new MyCustomException("some message ....", we);
}
...and in another place...
//-..
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 ..
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...
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..
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,..
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..