Is there a reson why date can not append to a list?
vdate = str(dates.date)
vdats = vdate.split("")
vdats = vdats[0]
vbalance.append(vdats)
just did not work?
What am I doing wrong?
I use order by rand() LIMIT 1. I have a database with 150,000 rows and I'm getting split second results after a select of three tables. If I stay under a million rows, am I going to be OK?
At what point should I consider upgrading my code to something more sophisticated?
I am trying to read an ini file that has the following format:
SETTING=VALUE
SETTING2=VALUE2
I currently have the following code:
string cache = sr.ReadToEnd();
string[] splitCache = cache.Split(new string[] {"\n", "\r\n"}, StringSplitOptions.RemoveEmptyEntries);
Which gives me a list of settings, however, what I would like to do is read this into a dictionary. My question is, is there a way to do this without iterating through the entire array and manually populating the dictionary?
(Duplicate of C++ Code in Header Files)
What is the standard way to split up C++ classes between header and source files?
Am I supposed to put everything in the header file? Or should I declare the classes in the header file and define them in a .cpp file (source file)?
Sorry if I'm shaky on the terminology here (declare, define, etc).
So what's the standard?
I have some UI functionality for drag and drop, but when an element is dropped, the animation makes it flit about all over the place for a split second before it appears in the newly dropped location.
Can anyone advise how to tackle this, so that the draggable element moves more cleanly into place on success?
...
success : function() {
$(ui.draggable)
.parent().droppable("option", "disabled", false)
.end()
.appendTo(droppable)
.droppable("option", "disabled", true);
},
...
I'd like to know if there is a way to figure out if a key does something in vim. I know that I can use :map to see user-defined mappings, but is there something for the built-in stuff?
For example, I always had CTRL-W bound to close tab, because I thought that it was unused. After half a year, I found out that there are some sequences that use it, like CTRL-W CTRL-S to split the window, and it was a nightmare to retrain myself.
I have scheduled a CRON job to run every 4 hours which needs to gather user accounts information.
Now I want to speed things up and to split the work between several processes and to use one process to update the MySQL DB with the retrieved data from other processes.
In JAVA I know that there is a thread pool which I can dedicate some threads to accomplish some work.
how do I do it in PHP?
Any advice is welcome.
Thank
When this fires I see the added li for a split second and then it disappears....
What gives? Using jquery 1.4.2
$(function(){
$('a#add_phone').click(function () {
$('<li>Test</li>').appendTo('ol#phones');
});
});
Hi there,
I am in need of reorganizing a large CSV file. The first column, which is currently a 6 digit number needs to be split up, using comma's as the field separator.
For example, I need this:
022250,10:50 AM,274,22,50
022255,11:55 AM,275,22,55
turned into this:
0,2,2,2,5,0,10:50 AM,274,22,50
0,2,2,2,5,5,11:55 AM,275,22,55
Let me know what you think!
Thanks!
I have a table with 5 string columns, all can be NULLs. After I read the data from this table, I want to convert any null values into empty strings. The reason is that I need to compare these columns with columns in another table of the same schema (using conditional split), and null values would cause the comparison to evaluate to NULL.
Is there any functionality in SSIS that allows me to convert NULL's to empty strings, or just not having to deal with NULL's at all?
Hi all
I made a custom sharepoint workflow with Visual studio, the workflow starts when a new item is inserted in a list
I assigned the title of the task to reference a field in the new item
TaskProps.Title = "Please prepare Hardware for project " + workflowProperties.Item["Contract"].ToString().Split('#')[1];
the task title is correct but i find the string (exteranl participant) concatenated the title of the task
what can be the reason for this ?
thanks
Coming from a ruby background, I'm wishing NSString had some convenient methods like the following:
[@"John" contains:@"ohn"] => BOOL
[@"1,2,3,4," split:@","] => NSArray
Anyone know of such an NSString helper library?
I have recently switched from Subversion to Mercurial for source control and in doing so have split up one repository into several. I used subrepos to manage the dependencies between repositories. The problem is that pull is not suprepo aware so I have to go into each subrepo and pull changes in order to update a repository. Is there a better way to do this?
Hi,
The current situation encourages the design of the system to split object fields to seperate objects in order to reduce the chance of the JDOCanRetryException to be thrown.
If we could have the fields that were changed by the other client who changed the object in the exception content itself we could deside whether to re-retrieve the object or ignore...
This is my class Debugger. Can anyone try and run it and see whens wrong? Ive spent hours on it already. :(
public class Debugger {
private String codeToDebug = "";
public Debugger(String code) {
codeToDebug = code;
}
/**
* This method itterates over a css file and adds all the properties to an arraylist
*/
public void searchDuplicates() {
boolean isInside = false;
ArrayList<String> methodStorage = new ArrayList();
int stored = 0;
String[] codeArray = codeToDebug.split("");
try {
int i = 0;
while(i<codeArray.length) {
if(codeArray[i].equals("}")) {
isInside = false;
}
if(isInside && !codeArray[i].equals(" ")) {
boolean methodFound = false;
String method = "";
int c = i;
while(!methodFound) {
method += codeArray[c];
if(codeArray[c+1].equals(":")) {
methodFound = true;
} else {
c++;
}
}
methodStorage.add(stored, method);
System.out.println(methodStorage.get(stored));
stored++;
boolean stillInside = true;
int skip = i;
while(stillInside) {
if(codeArray[skip].equals(";")) {
stillInside = false;
} else {
skip++;
}
}
i = skip;
}
if(codeArray[i].equals("{")) {
isInside = true;
}
i++;
}
} catch(ArrayIndexOutOfBoundsException ar) {
System.out.println("------- array out of bounds exception -------");
}
}
/**
* Takes in String and outputs the number of characters it contains
* @param input
* @return Number of characters
*/
public static int countString(String input) {
String[] words = input.split("");
int counter = -1;
for(int i = 0; i<words.length; i++){
counter++;
}
return counter;
}
public static void main(String[] args) {
Debugger h = new Debugger("body {margin:;\n}");
h.searchDuplicates();
}
}
i have this code which prints the line number in infile but also the linenumber in words what do i do to only print the line number of the txt file next to the words???
d = {}
counter = 0
wrongwords = []
for line in infile:
infile = line.split()
wrongwords.extend(infile)
counter += 1
for word in infile:
if word not in d:
d[word] = [counter]
if word in d:
d[word].append(counter)
for stuff in wrongwords:
print(stuff, d[stuff])
the output is :
hello [1, 2, 7, 9] # this is printing the linenumber of the txt file
hello [1] # this is printing the linenumber of the list words
hello [1]
what i want is:
hello [1, 2, 7, 9]
In our oroject we already have a lots of tables (100+). Some of them contains a lot of columns (50-100) and we are facing the need of adding more columns from time to time.
What do you think is best - from maintenance and performance point of view - to split these huge tables in smaller entities or to keep the tables the way they are ?
We are using an ORM tools, so we don't need to write custom request.
Hi,
I'm trying to invoke a built-in activity from my custom CodeActivity for the TFS2010 Build Process.
I've got my own CodeActivity which generates a batch file and I want to invoke the InvokeProcess activity (built-in) to execute that generated file.
Of course I could split it into two activities, but it would be nicer if I could put these actions together. Can somebody push me in the right direction?
Thanks in advance!
When programming, I would like to split one large file(which contains main function) to many small files, so there is one common case: functions in small files can modify the var from main file, so i think extern is very useful!
for instance:
in main.c
extern int i = 100;
in small.c
extern int i;
fprintf(stdout, "var from main file: %d\n", i);
I just want to know is my understanding right?
ipString is a String representation of an IP address with spaces instead of dots.
String[] ipArray = ipString.split(" ");
String ip = "";
for (String part : ipArray){
if (part != null){
ip += part
}
}
ip = ip.trim();
int ipInt = Integer.parseInt(ip); // Exception is thrown here.
Exception in thread "main" java.lang.NumberFormatException: For input string: "6622015176".
Could someone explain why this exception is being thrown?
Our pom.xml currently contains both the build settings, as well as execution of selenium using selenium-maven-plugin.
I would like to split it in to two pom files, one for the build and unit tests and the second one for executing selenium tests. (This way I could first build the project in Hudson, and after successful build execute Selenium tests using another project).
Is it possible to configure maven to only execute the selenium-maven-plugin?
I am developing a VBA application which is quite large. I want to use SVN for that application developing.
How can I split my modules from the Excel document and how to upload my modules separately to source control?
Please help me.
We are using VSS for version control (changing to another version control system is not an option right now), and are occassionally running into issues where a file has been completely deprecated with its functionality split into other new files. For historical archival reasons we need to keep those files in the version control sytem. Is there some way to clearly mark them as deprecated and no longer used?
Is it possible to make a for-each loop in XSLT not for a node set, but for my own collection of elements? For example, I split some string and have a string collection as a result. And I need to create a node for each item in the collection. I know that issue can be solved with a recursive template, but I want to know if it is possible to avoid a recursion.