Search Results

Search found 35302 results on 1413 pages for 'string literals'.

Page 170/1413 | < Previous Page | 166 167 168 169 170 171 172 173 174 175 176 177  | Next Page >

  • Excel macro to change external data query connections - e.g. point from one database to another

    - by Rory
    I'm looking for a macro/vbs to update all the external data query connections to point at a different server or database. This is a pain to do manually and in versions of Excel before 2007 it sometimes seems impossible to do manually. Anyone have a sample? I see there are different types of connections 'OLEDB' and 'ODBC', so I guess I need to deal with different formats of connection strings?

    Read the article

  • Splitting 25mb .txt file into smaller files using text delimiter

    - by user574141
    Regards, SO I am new to python and Perl. I have been trying to solve a simple problem and getting tied in knots with syntax. I hope someone has the time and patience to help. I have a 25mb file in ".txt" format which contains news-wire articles going back to 1970. Each news story is concatenated to the next, with only the "Copyright" statement to delimit. Each news story starts with "Item XX of XXX DOCUMENTS". There are certain metadata that are repeated throughout, I will use these for tagging later on. I wish to split this 25mb file into separate .txt files, each containing one news story (i.e. the text between "DOCUMENTS" and "Copyright", saving each with a different name (obviously). I am trying to 1 ) open the file... 2) iterate over lines in the file checking for the eof delimiter, and if it is not present writing the line to a list 3)write that list to a seperate small file. I'm having big problems with changing filenames using the counter, and how do I make Python start from where I left off, is the "seek" function appropriate? so far I have been trying this approach, completely unsuccessfully: myfile = open ("myfile.txt", 'r') filenumber = 0 for line in myfile.readline(): filenumber += 1 w=0 while myfile.readline() != '\s+DOCUMENTS\s*\n' ### read my line into a list mysmallfile()['w'] = [myfile.readline()] w += 1 output = open('C:\\Users\\dunner7\\Documents\###how do I change the filename each iteration???', 'w') output.writelines(mysmallfile) ###go back to start. Thank you for your time and patience. RD

    Read the article

  • mysql: get all rows into 1 column

    - by andufo
    hi, i have 3 tables: post (id_post, title) tag (id_tag, name) post_tag (id_post_tag, id_post, id_tag) Lets suppose that id_post 3 has 4 linked tags 1,2,3,4 (soccer, basket, tennis and golf). Is there a way to return something like this in ONE row? col 1 id_post = 3 col 2 tags = soccer basket tennis golf Thanks

    Read the article

  • Cocoa - Localized string from NSDate, NSCalendarDate...

    - by SirRatty
    I'm using NSDate to get a string such as "18 Jun 09", with code: NSDate *theDate = [NSDate date]; NSString *dateString = [theDate descriptionWithCalendarFormat:@"%d %b %y" timeZone:nil locale: nil]; This works, but only results in an English output. I need the output to be localized in the user's default language. Does Cocoa (Mac OS X 10.4, 10.5 in this case) provide a facility for this localization or do I have to manually localize for each case of day and & month names my self? (I have provided a locale, but although that does provide a locale-specific ordering of the date, it does not appear to do any localization of day-month names.)

    Read the article

  • Splitting a string into new rows in R

    - by user3703195
    I have a data set like below: Country Region Molecule Item Code IND NA PB102 FR206985511 THAI AP PB103 BA-107603 / F000113361 / 107603 LUXE NA PB105 1012701 / SGP-1012701 / F041701000 IND AP PB106 AU206985211 / CA-F206985211 THAI HP PB107 F034702000 / 1010701 / SGP-1010701 BANG NA PB108 F000007970/25781/20009021 I want to split based the string values in ITEMCODE column on / and create a new row for each entry. For instance, the desired output will be: Country Region Molecule Item Code New row IND NA PB102 FR206985511 FR206985511 THAI AP PB103 BA-107603 / F000113361 / 107603 F000113361 107603 BA-107603 LUXE NA PB105 1012701 / SP-1012701 / F041701000 1012701 SP-1012701 F041701000 IND AP PB106 AU206985211 / CA-F206985211 AU206985211 CA-F206985211 THAI HP PB107 F034702000 / 1010701 / SP-1010701 F034702000 1010701 SP-1010701 BANG NA PB108 F000007970/25781/20009021 F000007970 25781 20009021 I tried the below code library(splitstackshape) df2=concat.split.multiple(df1,"Plant.Item.Code","/", direction="long") but got the Error "Error: memory exhausted (limit reached?)" When i tried strsplit() i got the below error message. Error in strsplit(df1$Plant.Item.Code, "/") : non-character argument Any help from you will be appreciated.

    Read the article

  • How can I do the multiple replace in python?

    - by prosseek
    As asked and answered in HERE, I need to replace '[' with '[[]', and ']' with '[]]'. I tried to use s.replace(), but as it's not in place change, I ran as follows to get a wrong anwser. path1 = "/Users/smcho/Desktop/bracket/[10,20]" path2 = path1.replace('[','[[]') path3 = path2.replace(']','[]]') pathName = os.path.join(path3, "*.txt") print pathName -- /Users/smcho/Desktop/bracket/[[[]]10,20[]]/*.txt How can I do the multiple replace in python? Or how can I replace '[' and ']' at the same time?

    Read the article

  • XSLT 1.0: Sorting by concating portions of date string

    - by dscl
    I'm trying to take XML data and sort elements by their data attribute. Unfortunately the dates come over in mm/dd/yyyy format and are not static lengths. (Jan = 1 instead of 01) So I believe the string will have to be parsed into three components and the month padded. The newly concated value (yyyymmdd) then sorted descending. Problem is I have no idea how to do this. Here is an example of the data <content date="1/13/2011 1:21:00 PM"> <collection vo="promotion"> <data vo="promotion" promotionid="64526" code="101P031" startdate="1/7/2011 12:00:00 AM"/> <data vo="promotion" promotionid="64646" code="101P026" startdate="2/19/2011 12:00:00 AM"/> <data vo="promotion" promotionid="64636" code="101P046" startdate="1/9/2011 12:00:00 AM"/> </collection> </content> Also can anyone please recommend a good book on learning XSLT? Thanks!

    Read the article

  • How to connect 2 mysql tables with 2 connection string

    - by denonth
    Hi all I need to connect 2 tables from 2 mysql databases that have 2 different connection strings and each is on the different server. I have this query: cmd = new MySqlCommand(String.Format("INSERT INTO {0} (a,b,c,d) SELECT (a,b,c,d) FROM {1}", ConfigSettings.ReadSetting("main_table"), ConfigSettings.ReadSetting("main_table")), con); So both table have the same columns. Thats why I have only one ConfigSettings.ReadSetting("main_table") for both of them as they are same. I have 2 connection strings and each is pointing to their server: con.ConnectionString = ConfigurationManager.ConnectionStrings["con1"].ConnectionString; con2.ConnectionString = ConfigurationManager.ConnectionStrings["con2"].ConnectionString; How to make this cmd to be workking with 2 different connection strings and with the same name for the table. Table name will change that's why it is saved in config.

    Read the article

  • Structure's with strings and input

    - by Beginnernato
    so i have the following structure and function that add's things to the function - struct scoreentry_node { struct scoreentry_node *next; int score; char* name; } ; typedef struct scoreentry_node *score_entry; score_entry add(int in, char* n, score_entry en) { score_entry r = malloc(sizeof(struct scoreentry_node)); r->score = in; r->name = n; r->next = en; return r; } i have input that take it in the following main file: int score; char name[]; int main(void) { score_entry readin = NULL; while(1) { scanf("%s%d", name, &score); readin = add(score, name, readin); // blah blah I dont know why but when input a name it gets added to readin, but when i input another name all the name's in readin have this new name for example: input: bob 10 readin = 10 bob NULL jill 20 readin = 20 jill 10 jill NULL I dont know why bob disappear's... any reason why it does that ?

    Read the article

  • Login Problem Windows Authentication

    - by user109280
    Duplicate of: http://stackoverflow.com/questions/881928/windows-authentication-trusted-connection-problem I logged in the Windows Server(Machine 1) as "abc\user1 ". Windows Server machine is in abc domain. MSSQL Server is in the "abc" domain on Machine 1 and have mixed mode.authentication. It has account "abc\user1 " and "abc\user2 ". Both has role of sysadmin and serveradmin. I logged in another machine(Machine 2) using "abc\user2 ". Same Domain. Run the ant which connect to MSSQL Server. URL is formed as follows. jdbc:sqlserver://%DB_IP%:%DB_PORT%;SelectMethod=cursor;integratedSecurity=true;DatabaseName=dbname; 1) From Machine 2, If I use "abc\user2" credential for connection, then it works fine. since integratedSecurity=true. 2) From Machine 2, If I use "abc\user1" credential for connection, then it doesn't fine, since integratedSecurity=true and take System Credentials i.e "abc\user2". Even if I make integratedSecurity=false , then also it doesn't connect using "abc\user1" What changes to URL I have make to work for "abc\user1" from Machine2 for connection. what properties to be added in url? OR Driver doesn't support to use another domain\User Credentials? What need to set on MSSQL Server ?? Deepak

    Read the article

  • json array string covvertion to nsmutable array

    - by sudheer
    I am getting Json response from server. type = 2; "daysofWeek" = "(\n Mon,\n Tue\n)"; serviceType = 2; startDate = "2013-10-28"; In above format daysofWeek is Array string. I am trying to convert into NAMutableArray as NSString *weekDaysStr=[valueDict objectForKey:@"recrWeek_daysofWeek"]; NSMutableArray *weekDays=[[NSMutableArray alloc] initWithArray:[weekDaysStr componentsSeparatedByString:@","]]; But when i log this array i shownig as ("\n Mon", "\n Tue\n" ) How to remove those extra words from array. I have check each values to week day. NSString *day=@"Mon"; if([day isEQualToString:[weekDays objectAtIndex:0]){ } At that time its giving false condtion.Help me on this problem

    Read the article

  • #include <string> adding ~43 KB to my exe

    - by Lienau
    I'm using Code::Blocks to write my program and when I include <string> (or <iostream>) the size of my exe grows. My program is very simple and I need to keep it small <20kb. I'm pretty sure this is happening because of the C++ Standards Committee swapped the old .h versions for many new libraries without the .h. But how would I keep it from adding the ~43kb? Are there settings for Code::Blocks so that it wont add the extra kb or is there another native lib I can use?

    Read the article

  • Nokogiri find text in paragraphs

    - by astropanic
    I want to replace the inner_text in all paragraphs in my XHTML document. I know I can get all text with Nokogiri like this doc.xpath("//text()") But I want only operate on text in paragraphs, how I can select all text in paragraphs without affecting eventually existent anchor texts in links ? #For example : <p>some text <a href="/">This should not be changed</a> another one</a>

    Read the article

  • Compare versions as strings

    - by Dmitriy
    Comparing version numbers as strings is not so easy... "1.0.0.9" "1.0.0.10", but it's not correct. Obvious way to do it properly is parse these strings, convert to numbers and compare as numbers. Is it other way to do it more "elegant"? For example, boost::string_algo...

    Read the article

  • order array containing text and numbers

    - by ptrn
    I'm looking for the easiest way to sort an array that consists of numbers and text, and a combination of these. E.g. '123asd' '19asd' '12345asd' 'asd123' 'asd12' turns into '19asd' '123asd' '12345asd' 'asd12' 'asd123' This is going to be used in combination with the solution to another question I've asked here. The sorting function in itself works, what I need is a function that can say that that '19asd' is smaller than '123asd'. I'm writing this in JavaScript.

    Read the article

  • Parse multiple filters in SQL

    - by Jeff Meatball Yang
    I have a problem parsing a stored procedure parameter in the form: declare @S varchar(100) set @S = '4=2,24=1534' Here's the query: select cast(idx as varchar(100)) 'idx' , value , SUBSTRING(value, 1, charindex(value, '=')+1) 'first' , SUBSTRING(value, charindex(value, '=')+1, LEN(value)-charindex(value, '=')-1) 'second' from Common.SplitToTable(@S, ',') -- returns (idx int, value varchar(max)) where len(value) > 0 But here is the result I get: idx value first second 0 4=2 4 4= 1 24=1534 2 24=153 Here's what I expected: idx value first second 0 4=2 4 2 1 24=1534 2 1534 Help?

    Read the article

  • Concatenate String to Evernote Markup Language (ENML) in python

    - by Adam the Mediocre
    I am looking to add a string containing the user's text input to the note.content of my note. After reading, I have found how to add resources, but I don't want the resource to be an attachment, I want it to be the actual text. Here is some of the code: title= self.textEditTitle.text() body= self.textEditBody.text() auth_token = "secret stuff!" client = EvernoteClient(token=auth_token, sandbox=True) note_store = client.get_note_store() nBody = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" nBody += "<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">" nBody += "<en-note>%s</en-note>" % body note = Types.Note() note.title = title note.content= nBody Any advice would be great, as I'm just starting out with this api and it looks like it's full of potential once I figure it out! Here is what I have been mostly reading from: http://dev.evernote.com/documentation/cloud/chapters/ENML.php

    Read the article

  • Pre-formatting text to prevent reflowing

    - by mattjn
    I've written a fairly simple script that will take elements (in this case, <p> elements are the main concern) and type their contents out like a typewriter, one by one. The problem is that as it types, when it reaches the edge of the container mid-word, it reflows the text and jumps to the next line (like word wrap in any text editor). This is, of course, expected behavior; however, I would like to pre-format the text so that this does not happen. I figure that inserting <br> before the word that will wrap would be the best solution, but I'm not quite sure what the best way to go about doing that is that supports all font sizes and container widths, while also keeping any HTML tags intact. I figure something involving a hidden <span> element, adding text to it gradually and checking its width against the container width might be on the right track, but I'm not quite sure how to actually put this together. Any help or suggestions on better methods would be appreciated.

    Read the article

  • Serialize Dictionary with a string key and List[] value to JSON

    - by Patrick
    How can I serialize a python Dictionary to JSON and pass back to javascript, which contains a string key, while the value is a List (i.e. []) if request.is_ajax() and request.method == 'GET': groupSet = GroupSet.objects.get(id=int(request.GET["groupSetId"])) groups = groupSet.groups.all() group_items = [] #list groups_and_items = {} #dictionary for group in groups: group_items.extend([group_item for group_item in group.group_items.all()]) #use group as Key name and group_items (LIST) as the value groups_and_items[group] = group_items data = serializers.serialize("json", groups_and_items) return HttpResponse(data, mimetype="application/json") the result: [{"pk": 5, "model": "myApp.group", "fields": {"name": "\u6fb4\u9584", "group_items": [13]}}] while the group_items should have many group_item and each group_item should have "name", rather than only the Id, in this case the Id is 13. I need to serialize the group name, as well as the group_item's Id and name as JSON and pass back to javascript. I am new to Python and Django, please advice me if you have a better way to do this, appreciate. Thank you so much. :)

    Read the article

< Previous Page | 166 167 168 169 170 171 172 173 174 175 176 177  | Next Page >