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?
When the user check more than one (checkbox) option which are then combine into a string of "apple,orange,pear"
SELECT id, pos, FROM $db WHERE dtime>='$now' AND jsub IN ('$arr[1]') ;
When I pass the string to $arr[1], it won't work correctly, how do I split into array and get mysql IN function to process correctly?
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.
Hi guys;
Could you tell me whats wrong with this script:
I think the error is in IF statment
<script>
productID=new Array()
variaveis=location.search.replace(/\x3F/,"").replace(/\x2B/g," ").split("&")
if(variaveis!=""){
for(i=0;iflash1");
}
else if (flash = "flash2")
{
document.write("flash2");
}
else
{
document.write("another");
}
Hi,
I have a question about best practice on how to tackle a new project, any project. When starting a new project how do you go about tackling the project, do you split it into sections, start writing code, draw up flow diagrams.
I'm asking this question because I'm looking for advice on how I can start new projects so I can get going on them quicker. I can have it planned, designed and starting coding with everything worked out.
Any advice?
Thanks
Stephen
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?
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?
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 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]
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 everyone...
I'd asked a question about the splitting the a string like below:
Input string: "a=aa| b=b||b | c=cc"
and the output:
a=aa
b=b||b
c=cc
Kobi's answer was:
var matches = "a=aa|b=b||b|c=cc".match(/(?:[^|]|\|\|)+/g)
his answer was correct.
But I need to use "split" method and save store the outputs in a array.
so I can't use the Match Method.
So please help me...
Hi Folks,
I'm curious what would be the best practice to extend the Date constructor.
The problem I'm facing is, that the Internet Explorer (< 7+8) can't parse a date like
new Date('2010-05-11');
I have to admit that this is not a standard method to parse, anyways FireFox and Chrome perform well on that kind of date string.
Now I'm wondering, should I just split/parse/rebuild the string before calling new Date() or is there a more elegant solution ?
(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?
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?
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
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.
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 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.
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?
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?
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();
}
}
Inserting (pasting from clipboard) of text constants in the Delphi code editor requires some manual "postprocessing" ...
split up long text into multiple lines (and insert the string concatenation symbol)
escape quotes (replace single quotes with double quotes)
enclose the string with quotes
keep original white space (leadinng blanks, line feeds)
Is there a IDE plugin available which helps to reduce these manual steps?
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...
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!