Search Results

Search found 300 results on 12 pages for 'concatenation'.

Page 3/12 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • String Concatenation Issue

    - by Nano HE
    Hi, Could you please have a look at my code below. #!C:\Perl\bin\perl.exe use strict; use warnings; use Data::Dumper; my $fh = \*DATA; my $str1 = "listBox1.Items.Add(\""; my $str2 = "\")\;"; while(my $line = <$fh>) { $line=~s/^\s+//g; print $str1.$line.$str2; chomp($line); } __DATA__ Hello World Output: D:\learning\perl>test.pl listBox1.Items.Add("Hello ");listBox1.Items.Add("World "); D:\learning\perl> Style error. I want the style below. Is ther anything wrong about my code? thanks. D:\learning\perl>test.pl listBox1.Items.Add("Hello"); listBox1.Items.Add("World"); D:\learning\perl>

    Read the article

  • what's wrong with concatenation in blackberry application?

    - by sexitrainer
    For the life of me, I can't understand why adding a concatenated string to the MainScreen is causing the BB simulator to throw an exception. If I run a VERY simple hello program with the following control, all is well: RichTextField rtfHello = new RichTextField("Hello There !!!"); add(rtfItemDescription); But if I add a concatenated string, the entire app breaks: String MyName = "John Doe"; RichTextField rtfHello = new RichTextField("Hello There !!!" + MyName); add(rtfItemDescription); So what am I doing wrong? Why would the simulator throw an exception for the second example?

    Read the article

  • Path String Concatenation Question.

    - by Nano HE
    Hi. Please see my code below. ifstream myLibFile ("libs//%s" , line); // Compile failed here ??? I want to combine the path string and open the related file again. #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; ifstream myfile ("libs//Config.txt"); // There are several file names listed in the COnfig.txt file line by line. if (myfile.is_open()) { while (! myfile.eof() ) { getline (myfile,line); cout << line << endl; // Read details lib files based on the each line file name. string libFileLine; ifstream myLibFile ("libs//%s" , line); // Compile failed here ??? if (myLibFile.is_open()) { while (! myLibFile.eof() ) { cout<< "success\n"; } myLibFile.close(); } } myfile.close(); } else cout << "Unable to open file"; return 0; } Assume my [Config.txt] include the content below. And all the *.txt files located in libs folder. file1.txt file2.txt file3.txt

    Read the article

  • Improving Javascript Load Times - Concatenation vs Many + Cache

    - by El Yobo
    I'm wondering which of the following is going to result in better performance for a page which loads a large amount of javascript (jQuery + jQuery UI + various other javascript files). I have gone through most of the YSlow and Google Page Speed stuff, but am left wondering about a particular detail. A key thing for me here is that the site I'm working on is not on the public net; it's a business to business platform where almost all users are repeat visitors (and therefore with caches of the data, which is something that YSlow assumes will not be the case for a large number of visitors). First up, the standard approach recommended by tools such as YSlow is to concatenate it, compress it, and serve it up in a single file loaded at the end of your page. This approach sounds reasonably effective, but I think that a key part of the reasoning here is to improve performance for users without cached data. The system I currently have is something like this * All javascript files are compressed and loaded at the bottom of the page * All javascript files have far future cache expiration dates, so will remain (for most users) in the cache for a long time * Pages only load the javascript files that they require, rather than loading one monolithic file, most of which will not be required Now, my understanding is that, if the cache expiration date for a javascript file has not been reached, then the cached version is used immediately; there is no HTTP request sent at to the server at all. If this is correct, I would assume that having multiple tags is not causing any performance penalty, as I'm still not having any additional requests on most pages (recalling from above that almost all users have populated caches). In addition to this, not loading the JS means that the browser doesn't have to interpret or execute all this additional code which it isn't going to need; as a B2B application, most of our users are unfortunately stuck with IE6 and its painfully slow JS engine. Another benefit is that, when code changes, only the affected files need to be fetched again, rather than the whole set (granted, it would only need to be fetched once, so this is not so much of a benefit). I'm also looking at using LabJS to allow for parallel loading of the JS when it's not cached. So, what do people think is a better approach? In a similar vein, what do you think about a similar approach to CSS - is monolithic better?

    Read the article

  • Concatenation of many lists in Python

    - by Space_C0wb0y
    Suppose i have a function like this: def getNeighbors(vertex) which returns a list of vertices that are neighbors of the given vertex. Now i want to create a list with all the neighbors of the neighbors. I do that like this: listOfNeighborsNeighbors = [] for neighborVertex in getNeighbors(vertex): listOfNeighborsNeighbors.append(getNeighbors(neighborsVertex)) Is there a more pythonic way to do that?

    Read the article

  • Concatenation in jQuery

    - by Nimbuz
    var os = $.client.os; // mac var browser = $.client.browser; // firefox var browserversion = $.client.browserversion; // 3 $('#root').addClass( os + browser + browserversion ); .. results in <div id="root" class="macfirefox3">. How do I add spaces between them?

    Read the article

  • Concatenation yields error with underscore

    - by Daniel
    I am trying to create a macro that brings in the name of the sheet and combine it with text. For example, for sheet one, I want it to say "ThisIs_Sheet1_Test" in I5 of Sheet1. There are several sheets but it should work for all of them. What is wrong with my code? I think the underscore might be ruining it all. Here's what I have: Dim SheetName As String Public Sub CommandButton1_Click() SheetName = ActiveSheet.Name Sheets("Sheet1").Range("I5", "I5") = ThisIs_" & SheetName.text & "_Test Sheets("Sheet2").Range("H5", "H5") = ThisIs_" & SheetName.text & "_Test Sheets("Sheet3").Range("G5", "G5") = ThisIs_" & SheetName.text & "_Test End Sub

    Read the article

  • concatenation of all combination from different Lists in c#

    - by shan
    i have a List and i m grouping it into different lists. like:-List("a","b","c","it","as","am","cat","can","bat") 3 list List1:-a,b,c List2:-it,as,am List3:-cat,can,bat how can i concat the all possible combination from this lists. output like: a,it,cat b,it,cat c,it,cat a,am,cat b,am,cat c,am,cat . . . . etc so on...

    Read the article

  • Concatenation awk outputs

    - by Rookie_22
    I'm using regex to parse NMAP output. I want the ip addresses which are up with the corresponding ports open. Now I've a very naive method of doing that: awk '/^Scanning .....................ports]/ {print substr ($2,1,15);}' results.txt awk '/^[0-9][0-9]/ {print substr($1,1,4);}' results.txt | awk -f awkcode.awk where awkcode.awk contains the code to extract numbers out of the substring. The first line prints all the ips that are up and 2nd gives me the ports. My problem is that I want them mapped to each other. Is there any way to do that? Even sed script would do.

    Read the article

  • string concatenation in Groovy seems unconvenient

    - by Zombies
    My goal is to write this: println "this should be 3: ($1+2)" //this is invalid groovy, it won't run Yet this is valid in ruby. Is there a way I can put statements that will eval inside a string or must I use complete variables names? I am basically looking for the Ruby equivalent of: puts "this shoud be 3: #{1+2}" #this is valid ruby

    Read the article

  • concatenation output problem (toString Array) - java

    - by dowln
    Hello, I am trying to display the output as "1(10) 2(23) 3(29)" but instead getting output as "1 2 3 (10)(23)(29)". I would be grateful if someone could have a look the code and possible help me. I don't want to use arraylist. the code this // int[] Groups = {10, 23, 29}; in the constructor public String toString() { String tempStringB = ""; String tempStringA = " "; String tempStringC = " "; for (int x = 1; x<=3; x+=1) { tempStringB = tempStringB + x + " "; } for(int i = 0; i < Group.length;i++) { tempStringA = tempStringA + "(" + Groups[i] + ")"; } tempStringC = tempStringB + tempStringA; return tempStringC; }

    Read the article

  • Question on Split usage in Perl

    - by Nano HE
    Hello. I wrote an small script to use Split() as this, use strict; use warnings; use Data::Dumper; my $fh = \*DATA; while(my $line = <$fh>) { my @values = split(':', $line); foreach my $val (@values) { print "$val\n"; } } __DATA__ 1 : Hello World String10 : NO : A1B2,B3 11 : Hello World String11 : YES : A11B2,B3,B14,B25 A1B2,B3 and A11B2,B3 are characters form like Only One Letter A and One or Two Number 2, 3, 14,25 etc then concatenated with Only One Letter B and one or two Numbers like 2, 3, 14,25. etc Now out put as this 1 Hello World String10 NO A1B2,B3 11 Hello World String11 YES A11B2,B3,B14,B25 How can I hold the last array member from @values and made concatenation and out put as this. 1 Hello World String1 NO A1B2,A1B3 11 Hello World String11 YES A11B2,A11B3,A11B14,A11B25 Appreciated for your comments and replies. [update] My out put need the concatenation followed the rule. A and one or two numbers and joined by B and one or two numbers split by ,

    Read the article

  • How do I concatenate strings in Objective-C?

    - by Typeoneerror
    Are there any shortcuts to (stringByAppendingString:) string concatenation in Objective-C or shortcuts for working with NSString or other objects in general? e.g. I'd like to make this: NSString *myString = @"This"; NSString *test = [myString stringByAppendingString:@" is just a test"]; something more like this: string myString = "This"; string test = myString + " is just a test";

    Read the article

  • Python/Django Concatenate a string depending on whether that string exists

    - by Douglas Meehan
    I'm creating a property on a Django model called "address". I want address to consist of the concatenation of a number of fields I have on my model. The problem is that not all instances of this model will have values for all of these fields. So, I want to concatenate only those fields that have values. What is the best/most Pythonic way to do this? Here are the relevant fields from the model: house = models.IntegerField('House Number', null=True, blank=True) suf = models.CharField('House Number Suffix', max_length=1, null=True, blank=True) unit = models.CharField('Address Unit', max_length=7, null=True, blank=True) stex = models.IntegerField('Address Extention', null=True, blank=True) stdir = models.CharField('Street Direction', max_length=254, null=True, blank=True) stnam = models.CharField('Street Name', max_length=30, null=True, blank=True) stdes = models.CharField('Street Designation', max_length=3, null=True, blank=True) stdessuf = models.CharField('Street Designation Suffix',max_length=1, null=True, blank=True) I could just do something like this: def _get_address(self): return "%s %s %s %s %s %s %s %s" % (self.house, self.suf, self.unit, self.stex, self.stdir, self.stname, self.stdes, self.stdessuf) but then there would be extra blank spaces in the result. I could do a series of if statements and concatenate within each, but that seems ugly. What's the best way to handle this situation? Thanks.

    Read the article

  • Char * reallocation in C++

    - by JTom
    Hi, I need to store a certain amount of data in the "char *" in C++, because I want to avoid std::string to run out of memory, when exceeding max_size(). But the data comes in data blocks from the network so I need to use reallocation every time I get the data block. Is there any elegant solution for char * reallocation and concatenation in C++?

    Read the article

  • Join mp4 files in linux

    - by Jose Armando
    I want to join two mp4 files to create a single one. The video streams are encoded in h264 and the audio in aac. I can not re-encode the videos to another format due to computational reasons. Also, I cannot use any gui programs, all processing must be performed with linux command line utilities. FFmpeg cannot do this for mpeg4 files so instead I used MP4Box e.g. MP4Box -add video1.mp4 -cat video2.mp4 newvideo.mp4 unfortunately the audio gets all mixed up. I thought that the problem was that the audio was in aac so I transcoded it in mp3 and used again MP4Box. In this case the audio is fine for the first half of newvideo.mp4 (corresponding to video1.mp4) but then their is no audio and I cannot navigate in the video also. My next thought was that the audio and video streams had some small discrepancies in their lengths that I should fix. So for each input video I splitted the video and audio streams and then joined them with the -shortest option in ffmpeg. thus for the first video I ran avconv -y -i video1.mp4 -c copy -map 0:0 videostream1.mp4 avconv -y -i video1.mp4 -c copy -map 0:1 audiostream1.m4a avconv -y -i videostream1.mp4 -i audiostream1.m4a -c copy -shortest video1_aligned.mp4 similarly for the second video and then used MP4Box as previously. Unfortunately this didn't work either. The only success I had was when I joined the video streams separetely (i.e. videostream1.mp4 and videostream2.mp4) and the audio streams (i.e. audiostream1.m4a and audiostream2.m4a) and then joined the video and audio in a final file. However, the synchronization is lost for the second half of the video. Concretelly, there is a 1 sec delay of audio and video. Any suggestions are really welcome.

    Read the article

  • Concatenate cells that change daily automatically?

    - by Harold
    I use concatenate to pull data together from different cells in my spreadsheet. Since my data changes daily, I want the formula to also change daily without having to manually input the new cell in the concatenate formula. I am looking for a way to do this but not sure how. Can anyone out there help me out please!? I appreciate the assistance in advance! Maybe this will help to explain what I need. I have a row of data from D4:AH4 that I insert daily based on the new day. When I use the concatenate and us the following formula: =CONCATENATE(TEXT('Raw Data'!B4,"m/d")," ",TEXT('Raw Data'!C4,"")," ", TEXT('Raw Data'!E4,"0.0%"))... E4 being the cell that changes daily where next day would be F4, G4, etc... All other parts of the formula will stay the same. I hope this helps! Thanks! :)

    Read the article

  • How do I combine MP4 videos? [closed]

    - by LoopyWolf
    Possible Duplicate: How can I merge two mp4 files without losing quality? I hunted all over the web but found nothing - I'm trying to compile a bunch of MP4s into a single video file. VirtualDub won't touch it.. and ultra-vibe no longer exists and the other "freeware mp4 combiners" all didn't work or were hobbled. Does anyone know a way?

    Read the article

  • concatenate files including path in header - path contains spaces

    - by manolo
    I have to concatenate a number of files in a directory structure which contains spaces in the folder names looking like this: ./CH 0000100014/A10/11XT/11xt#001.csv find . -name "*.csv" -type f -print0 | xargs -0 cat > allmycsv.txt does the job, however now I need to include the information contained in the path, i.e. CH 0000100014/A10/11XT as a header of each inputfile to cat. find . -name "*.csv" -type f -print0 | xargs -0 -I % sh -c 'echo %; cat %' >allmycsv.txt would do the job, if I had no spaces in the path, but in my case, cat does not get along with the space in the path name. Is there a way out? Cheers, E P.S. I am working on bash on OSX

    Read the article

  • Using string.Format for simple things?

    - by Gerrie Schenck
    In my early .Net programming days, I used string.Format() only for complex string concatenations, for example to compile strings as Problem with customer order 234 of date 2/2/2002 and payment id 55543. But now I use string.Format for almost every string concatenation I have to do, also simple ones such as prefixing a string with something. Console.WriteLine(string.Format("\t\t{0}", myString)); Is there any possible overhead on this? Maybe I should use the regular + operator to do these simple operations? What's your opinion on this?

    Read the article

  • How can I join multiple .mpg movie files?

    - by Kapsh
    I create a lot of these small clips on my digital camera. These are in .mpg format and before I share them with others, I would love to just join, clip a few seconds here and there. I use Google Picassa to create new start and end points, but I dont know a good way to join mpgs yet. Whats the best free software i can use for this?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >