Search Results

Search found 4625 results on 185 pages for 'split tunnel'.

Page 34/185 | < Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • how can I split up this string

    - by lacrosse1991
    I am currently trying to sanitize some log files so they are in an easier format to read, and have been trying to use the gnu cut command, which works fairly well, although I cannot really think of a good way to remove the [INFO] part of the string logs/logs/server_1283258036.log:2010-08-31 23:06:51 [INFO] <NateMar> where?! logs/logs/server_1281904775.log:2010-08-15 22:59:53 [INFO] <BoonTheMoon> §b<BoonTheMoon>§ohhhhhh I would ultimately want to get the strings down to something that resembles the following 2010-08-31 23:06:51 <NateMar> where?! 2010-08-15 22:59:53 <BoonTheMoon> ohhhhhh how should I go about doing this? Have thought about using awk, although Im having a difficult time getting a grip on how that would work, so not sure how to set up something to do that, any help would be greatly appreciated, thanks!

    Read the article

  • How to get regex split from other var

    - by Dean
    Hi, $dbLink = mysql_connect('localhost', 'root', 't'); mysql_select_db('pc_spec', $dbLink); $html = file_get_contents('http://localhost/pc_spec/scrape.php?q=amd+955'); echo $html; $html = strip_tags($html); $price = ereg("\$.{6}", $html); $html = mysql_real_escape_string($html); $price = mysql_real_escape_string($price); $insert = mysql_query("INSERT INTO parts(part, price) values('$html','$price')") or var_dump(mysql_error()); How can I get $price to match $.{6} and insert this value (eg. $111.11) into a database and remove it from $html? Do I need to use explode? Thanks

    Read the article

  • Best practice- How to team-split a django project while still allowing code reusal

    - by Infinity
    I know this sounds kind of vague, but please let me explain- I'm starting work on a brand new project, it will have two main components: "ACME PRODUCT" (think Gmail, Meebo, etc), and "THE SITE" (help, information, marketing stuff, promotional landing pages, etc lots of marketing-induced cruft). So basically the url /acme/* will load stuff in the uber cool ajaxy application, and every other URI will load stuff in the other site. Problem: "THE SITE" component is out of my hands, and will be handled by a consultants team that will work closely with marketing, And I and my team will work solely on the ACME PRODUCT. Question: How to set up the django project in such a way that we can have: Seperate releases. (They can push new marketing pages and functionality without having to worry about the state of our code. Maybe even separate Subversion "projects") Minimize impact (on our product) of whatever flying-unicorns-hocus-pocus the other team codes into the site. Still allow some code reusal. My main concern is that the ACME product needs to be rock solid, and therefore needs to be somewhat isolated of whatever mistakes/code bloopers the consultants make in their marketing side of the site. How have you handled this? Any ideas? Thanks!

    Read the article

  • How to remove unwanted charecters using split in tcl

    - by Mallikarjunarao
    Here is an example Interface {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} IP-Address {} {} {} {} {} OK? Method Status {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {Protocol FastEthernet0/0} {} {} {} {} {} {} {} {} {} {} {} unassigned {} {} {} {} {} YES unset {} administratively down down {} {} {} { FastEthernet0/1} {} {} {} {} {} {} {} {} {} {} {} unassigned {} {} {} {} {} YES unset {} administratively down down I want remove {} in this. I assumed all the above string interface variable set interface [string trimright [string trimleft $interface "{}"] "{}"] but it doesn't work. How to remove the {} in my example?

    Read the article

  • python parallel computing: split keyspace to give each node a range to work on

    - by MatToufoutu
    My question is rather complicated for me to explain, as i'm not really good at maths, but i'll try to be as clear as possible. I'm trying to code a cluster in python, which will generate words given a charset (i.e. with lowercase: aaaa, aaab, aaac, ..., zzzz) and make various operations on them. I'm searching how to calculate, given the charset and the number of nodes, what range each node should work on (i.e.: node1: aaaa-azzz, node2: baaa-czzz, node3: daaa-ezzz, ...). Is it possible to make an algorithm that could compute this, and if it is, how could i implement this in python? I really don't know how to do that, so any help would be much appreciated

    Read the article

  • Split a string by two characters

    - by David
    Hi, Firstable i want to match if a string has the following format: $abc #xyz or $abc .xyz. The abc and xyz mean only alphanumeric string. If it's matched then i need to extract the first $abc and the last #xyz, all that using pure javascript and maybe regex. The pattern is in the following order: Dollar Sign Unlimited alphanumeric string space a hash or point Unlimited alphanumeric string Thanks in advance for any help.

    Read the article

  • Viewmodels and Models, howto split them up

    - by molgan
    Hello I'm using asp.net mvc 2 and I'm not sure howto structure the models and viewmodels. In the nerddinner there is only 1 of each. Shall I have only 1 viewmodel of each entity (?) and then have 1 model for each form-modifing viewpage? So that viewmodel contains like all it ever would need, like: PagedFoo FooClass ..., FooClass, Foowithbunnies, FooClassStats... ? /M

    Read the article

  • Split user.config into different files for faster saving (at runtime)

    - by HorstWalter
    In my c# Windows Forms application (.net 3.5 / VS 2008) I have 3 settings files resulting in one user.config file. One setting file consists of larger data, but is rarely changed. The frequently changed data are very few. However, since the saving of the settings is always writing the whole (XML) file it is always "slow". SettingsSmall.Default.Save(); // slow, even if SettingsSmall consists of little data Could I configure the settings somehow to result in two files, resulting in: SettingsSmall.Default.Save(); // should be fast SettingsBig.Default.Save(); // could be slow, is seldom saved I have seen that I can use the SecionInformation class for further customizing, however what would be the easiest approach for me? Is this possible by just changing the app.config (config.sections)? --- added information about App.config The reason why I get one file might be the configSections in the App.config. This is how it looks: <configSections <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" <section name="XY.A.Properties.Settings2Class" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" / <section name="XY.A.Properties.Settings3Class" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" / </sectionGroup </configSections I got the sections when I've added the 2nd and 3rd settings file. I have not paid any attention to this, so it was somehow the default of VS 2008. The single user.config has these 3 sections, it is absolutely transparent. Only I do not know how to tell the App.config to create three independent files instead of one. I have "played around" with the app.config above, but e.g. when I remove the config sections my applications terminates with an exception.

    Read the article

  • Split a sting array into a number array in javascript

    - by Wesley Skeen
    I am reading a value from a dropdown list depending on what option is selected. I am using jqPlot to graph the values. jqPlot expects an array of values like [91, 6, 2, 57, 29, 40, 95] but when I read the value in from the dropdown box it is coming in as a whole string "[91, 6, 2, 57, 29, 40, 95]" I tried splitting it but I got ["91", "6", "2", "57", "29", "40", "95"] which wont display the graph correctly. Is there anybody that has encountered something like this before and what can I do to make my values convert into a number array. Thanks for any help

    Read the article

  • php string to array and split

    - by RussP
    Hi folks Looking for suggestions as to the best way to do this (I know there are many options): take a variable like this: $args = ('post_type=post&order_by=DESC&limit=10'); the create a function to convert that variable into parts like this: $post_type = post; $order_by = DESC; $limit= 10; Reason is I want a client to be able to use a string like the first to pass variables to a sql query in much the same way (but doesn't have to be exact) as you can do it in WordPress.

    Read the article

  • Using Regex to Split String

    - by Janusz Jasinski
    So I have a string like this (the hashtags are delimiters) A1###B2###C3###12345.jpg I was wondering how would I access A1, B2 and C3 STRING1###STRING2###STRING3###STRING4.jpg SOME###THING###HERE###MEH.jpg EXTRACT###THIS###PLEASE###pah.jpg In one instance I'd like to extract the first string. In another the second, in another the third. I will be using this with Adobe Bridge to extract metadata items from the filename I am looping through each filename so would need Var1 = FirstString Var2 = SecondString Var3 = ThirdString

    Read the article

  • Split a binary file into chunks c++

    - by L4nce0
    I've been bashing my head against trying to first divide up a file into chunks, for the purpose of sending over sockets. I can read / write a file easily without splitting it into chunks. The code below runs, works, kinda. It will write a textfile and has a garbage character. Which if this was just for txt, no problem. Jpegs aren't working with said garbage. Been at it for a few days, so I've done my research, and it's time to get some help. I do want to stick strictly to binary readers, as this need to handle any file. I've seen a lot of slick examples out there. (none of them worked for me with jpgs) Mostly something along the lines of while(file)... I subscribe to the, if you know the size, use a for-loop, not a while-loop camp. Thank you for the help!! vector<char*> readFile(const char* fn){ vector<char*> v; ifstream::pos_type size; char * memblock; ifstream file; file.open(fn,ios::in|ios::binary|ios::ate); if (file.is_open()) { size = fileS(fn); file.seekg (0, ios::beg); int bs = size/3; // arbitrary. Actual program will use the socket send size int ws = 0; int i = 0; for(i = 0; i < size; i+=bs){ if(i+bs > size) ws = size%bs; else ws = bs; memblock = new char [ws]; file.read (memblock, ws); v.push_back(memblock); } } else{ exit(-4); } return v; } int main(int argc, char **argv) { vector<char*> v = readFile("foo.txt"); ofstream myFile ("bar.txt", ios::out | ios::binary); for(vector<char*>::iterator it = v.begin(); it!=v.end(); ++it ){ myFile.write(*it,strlen(*it)); } }

    Read the article

  • Regex for splitting a german address into its parts

    - by Christian
    Good evening, I'm trying to splitting the parts of a german address string into its parts via Java. Does anyone know a regex or a library to do this? To split it like the following: Name der Straße 25a 88489 Teststadt to Name der Straße|25a|88489|Teststadt or Teststr. 3 88489 Beispielort (Großer Kreis) to Teststr.|3|88489|Beispielort (Großer Kreis) It would be perfect if the system / regex would still work if parts like the zip code or the city are missing. Is there any regex or library out there with which I could archive this? EDIT: Rule for german addresses: Street: Characters, numbers and spaces House no: Number and any characters (or space) until a series of numbers (zip) (at least in these examples) Zip: 5 digits Place or City: The rest maybe also with spaces, commas or braces

    Read the article

  • Splitting only long words in string

    - by owca
    I have some random string, let's say : s = "This string has some verylongwordsneededtosplit" I'm trying to write a function trunc_string(string, len) that takes string as argument to operate on and 'len' as the number of chars after long words will be splitted. The result should be something like that str = trunc_string(s, 10) str = "This string has some verylongwo rdsneededt osplit" For now I have something like this : def truncate_long_words(s, num): """Splits long words in string""" words = s.split() for word in words: if len(word) > num: split_words = list(words) After this part I have this long word as a list of chars. Now I need to : join 'num' chars together in some word_part temporary list join all word_parts into one word join this word with the rest of words, that weren't long enough to be splitted. Should I make it in somehow similar way ? : counter = 0 for char in split_words: word_part.append(char) counter = counter+1 if counter == num And here I should somehow join all the word_part together creating word and further on

    Read the article

  • PHP - text to array by splitting at line break

    - by aSeptik
    Hi All! need help on splitting a large file at line break example: TEXT:some normal text TEXT:some long text here, and so on... sometimes i'm breaking down and... TEXT:some normal text TEXT:some normal text ok, now by using preg_split( '#\n(^\s)#' , $text ); i get [0] => Array ( [0] => some normal text [1] => some long text here, and so on... sometimes [2] => some normal text [3] => some normal text ) As you can see the [1] Element of the Array is cutted off! what Regex can get the entire line and also split at line break!?

    Read the article

  • Powershell - Splitting variable into chunks

    - by Andrew
    I have written a query in Powershell interrogating a F5 BIG-IP box through it's iControl API to bring back CPU usage etc. Using this code (see below) I can return the data back into a CSV format which is fine. However the $csvdata variable contains all the data. I need to be able to take this variable and for each line split each column of data into a seperate variable. The output currently looks like this: timestamp,"Utilization" 1276181160,2.3282800000e+00 Any advice would be most welcome $SystemStats = (Get-F5.iControl).SystemStatistics ### Allocate a new Query Object and add the inputs needed $Query = New-Object -TypeName iControl.SystemStatisticsPerformanceStatisticQuery $Query.object_name = $i $Query.start_time = $startTime $Query.end_time = 0 $Query.interval = $interval $Query.maximum_rows = 0 ### Make method call passing in an array of size one with the specified query $ReportData = $SystemStats.get_performance_graph_csv_statistics( (,$Query) ) ### Allocate a new encoder and turn the byte array into a string $ASCII = New-Object -TypeName System.Text.ASCIIEncoding $csvdata = $ASCII.GetString($ReportData[0].statistic_data)

    Read the article

  • Perl: parsing string enclosed by double quotes

    - by sfactor
    I need to parse tab/space delimited files that have a lot of columns in Perl. The values are such that the there are large strings enclosed within double quotes. These strings can have any characters such as tabs and spaces or anything else. When I try to parse them with the split function it splits these strings as well. Now how can I make perl understand that the strings within the " " are a single column entry? A simple example is, 12 345546.67677 "Hello World!!!" -567.55656 0.5465767 "Hello_Again; "

    Read the article

  • How can I put text from a multi-line text box into one string?

    - by Kevin van Zanten
    Dear reader, I'm faced with a bit of an issue. The scenario is that I have a multi-line text box and I want to put all that text into one single string, without any new lines in it. This is what I have at the moment: string[] values = tbxValueList.Text.Split('\n'); foreach (string value in values) { if (value != "" && value != " " && value != null && value != "|") { valueList += value; } } The problem is that no matter what I try and what I do, there is always a new line (at least I think?) in my string, so instead of getting: "valuevaluevalue" I get: "value value value". I've even tried to replace with string.Replace and regex.Replace, but alas to no avail. Please advise. Yours sincerely, Kevin van Zanten

    Read the article

  • Parsing String into multiple variable length String (C#)

    - by Nassign
    I am currently trying to convert a VB6 program into C#. There was extensive use of string splitting into structure. For example, Dim Sample AS String Sample = "John Doe New York Test Comment" Public Type Struct1 Name As String * 15 Address As String * 10 Comment As String * 20 End Type Dim dataStruct As Struct1 Set dataStruct = Sample When the dataStruct is set, it will automatically split value into the 3 structure member. Is there a special function to do this in C#. The only way I know how to do this is thru Attributes/Annotation describing the length and start position of string. Any other suggestion?

    Read the article

  • Get n Number of words using regex in Java

    - by Aymon Fournier
    I have a section of a book, complete with punctuation, line breaks etc. and I want to be able to extract the first n words from the text, and divide that into 5 parts. Regex mystifies me. This is what I am trying. I creates an array of index size 0, with all the input text: public static String getNumberWords2(String s, int nWords){ String[] m = s.split("([a-zA-Z_0-9]+\b.*?)", (nWords / 5)); return "Part One: \n" + m[1] + "\n\n" + "Part Two: \n" + m[2] + "\n\n" + "Part Three: \n" + m[3] + "\n\n" + "Part Four: \n" + m[4] + "\n\n" + "Part Five: \n" + m[5]; } Thanks!

    Read the article

  • Mail program splits link over two lines

    - by Joran
    Hi, In C#, I'm sending a mail with an activation link to users after they have registered. However, the link is split over two lines in the mail and thus doesn't work. I've checked in Visual Studio and the string containing the link looks fine. I've also tried: strMessage.Replace("\r", ""); strMessage.Replace("\n", ""); but without success. Do you have any ideas on how to solve this? I've googled it for hours and can't find the solution... Thanks! /J

    Read the article

  • How can I start with <a href=" and have an array element here then end with </a>?

    - by Noor
    The thing im trying to do right now is pulling in multiple links from a textarea, We can pretend that a user inputs c:\pics\img01.jpg and in the next row he'll have the next imglink. I want to pull those links, I allready have the code for that: var entered = $('#filedir').val(); var lines = entered.split(/\r\n/); var opttext = ""; for(var i=0;i<lines.length;i++) { opttext += '< img src="' + lines[i] + '">< /img>'; } ? the problem is in the output which is: < img src="file:///C:/pics/img01.jpgc:/pics/img02.jpg">< /img> There should be two < img> elements.. Where am I going wrong? I've been at it for a bit over 2 hours now..

    Read the article

< Previous Page | 30 31 32 33 34 35 36 37 38 39 40 41  | Next Page >