Search Results

Search found 9872 results on 395 pages for 'preg replace callback'.

Page 63/395 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • replace html tags within xml content with wordML formatting tags

    - by Josh
    I am taking an XML document and creating a word document using XSLT and OpenXML. The problem is that when I create the word document, all of the HTML that is within the CDATA tags are not escaped and look like this: GET /recipe/recipe/cat.php/&gt;&quot;&gt;&lt;script&gt;alert(document.domain)&lt;/script&gt; I have tried defining "cdata-section-elements" in my xsl:output; however I receive an error stating that p tag doesn't match the w:t tag.(the p tag is apart of the CDATA HTML). Here is what one of my xsl templates looks like: <xsl:template match="SECTION"> <w:p w:rsidR="00272D24" w:rsidRPr="00272D24" w:rsidRDefault="00272D24"> <w:pPr> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/> </w:rPr> </w:pPr> </xsl:template> <w:r w:rsidRPr="00272D24"> <w:rPr> <w:rFonts w:ascii="Arial" w:hAnsi="Arial" w:cs="Arial"/> </w:rPr> <w:t> <xsl:value-of select="INFORMATION"/> </w:t> </w:r> </w:p> Here is what the xml looks like: <INFORMATION> <![CDATA[ <P> line 1 of information <P> line 2 of information.......]]> </INFORMATION> Here is what the word output looks like: (white space and poor formatting) DIAGNOSIS: <P> line 1 of information. <P> line 2 of information I need to be able to somehow render the HTML or strip out the HTML. If I strip out the HTML then I would have to search for every possible HTML element, which is madness! Any help at all would be appreciated... Thanks.

    Read the article

  • Understanding an interesting array update/replace function

    - by dave
    I'm a PHP amateur. This array function is an adaption of a function I noticed while reading this article. I thought this was an interesting type of array function, but I have a question about the way it works. my_func( array( 'sky' => 'blue' ) ); function my_func( array $settings = array() ) { $settings = $settings + array( 'grass'=>'green','sky'=>'dark' ); print_r( $settings ) ; // outputs: Array ( [sky] => blue [grass] => green ) } but..................... my_func( array( 'sky' => 'blue' ) ); function my_func( array $settings = array() ) { $settings = array( 'clock'=>'time' ) ; $settings = $settings + array( 'grass'=>'green','sky'=>'dark' ); print_r( $settings ) ; // outputs: Array ( [clock] => time [grass] => green [sky] => dark ) } Why does [sky] not equal 'blue' in the second instance? Thanks.

    Read the article

  • php - replace array elements with another array's elements?

    - by Simpson88Keys
    Not sure how to go about this... But, I have two arrays, one with updated information, another with outdated information... There are a lot more elements in the second array, but I'm looking to "update" the outdated one with the updated information. Here's what the arrays look like: //Outdated Array ( [0] => Array ( [anum] => 3236468462 [cid] => 4899097762 [mid] => 1104881401 [na_title] => [na_fname] => JOHN [m_initial] => [na_lname] => DOE [na_suffix] => [na_addr1] => 1234 SAMPLE AVENUE [na_addr2] => [na_city] => NORWALK [state] => OH [zip] => [zip_plus_4] => [route] => R002 [dma_code] => 510334 ) ) //Updated Array ( [1] => Array ( [0] => YUD990 [1] => 98 [2] => 1234 Sample Avenue [3] => [4] => Norwalk [5] => OH [6] => 44857-9215 [7] => 3236468462 ) ) To clarify, I want to: (1) Match up the value for [7] from the updated array with the value for [anum] in the outdated array, and then update [na_addr1], [na_addr2], [na_city], [state], [zip], [zip_plus_4] in the outdated array with the values for [2],[3],[4],[5],[6] (I know I'll need to split the updated [6] in order to get it to map corrected to the outdated) Feel like I'm making this very confusing... sorry about that...

    Read the article

  • Replace click() with document.ready() in jquery....

    - by bala3569
    I downloaded jquery effects example and all effects are appearing only onclick but i want it to be executed on document.ready() and continue... <script type="text/javascript"> var ImgIdx = 2;//To mark which image will be select next function PreloadImg(){ $.ImagePreload("images/im2.jpg"); $.ImagePreload("images/im3.jpg"); $.ImagePreload("images/im4.jpg"); $.ImagePreload("images/im5.jpg"); } $(document).ready(function(){ PreloadImg(); $(".SlashEff ul li").click(function(){ $(".Slash").ImageSwitch({Type:$(this).attr("rel"), NewImage:"images/im"+ImgIdx+".jpg", speed: 4000 }); ImgIdx++; if(ImgIdx>5) ImgIdx = 1; }); }); </script> and my <div class="SlashEff"> <ul> <li class="TryFadeIn" rel="FadeIn">Fade in</li> <li class="TryFlyIn" rel="FlyIn">Fly in</li> <li class="TryFlyOut" rel="FlyOut">Fly out</li> <li class="TryFlipIn" rel="FlipIn">Flip in</li> <li class="TryFlipOut" rel="FlipOut">Flip out</li> <li class="TryScroll" rel="ScrollIn">Scroll in</li> <li class="TryScroll" rel="ScrollOut">Scroll out</li> <li class="TrySingleDoor" rel="SingleDoor">Single Door</li> <li class="TryDoubleDoor" rel="DoubleDoor">Double Door</li> </ul> </div> Here is the link http://www.hieu.co.uk/blog/index.php/imageswitch/ I tried this, $(document).ready(function(){ PreloadImg(); $(".Slash").ImageSwitch({Type:$(this).attr("rel"), NewImage:"images/im"+ImgIdx+".jpg", speed: 4000 }); ImgIdx++; if(ImgIdx>5) ImgIdx = 1; }); I tried this but it gets executed only once.... I want to execute this every 5000ms... Is this possible...

    Read the article

  • Using .htaccess to replace backslash in URL with forward-slash

    - by DamienL
    I realise that a backslash should never appear in a URL in a form other than a URL escape code, however in this case the URL's are being generated by a .NET application for generating flashbooks. I have contacted the developer of this application with a bug report. In the interim i would like to use .htaccess to rewrite the offending backslashes. This is how the URLs appear in fiddler debugging proxy. www.example.com/folder/folder/thumbs%5C1.jpg I am using Firefox and it looks as though Firefox is translating them into the URL encoded equivalent ( \ == %5C1 ). Interestingly IE translates the backslash into a forward-slash automatically (not adhering to standards but convenient in this case). Is there a way to use .htaccess to rewrite all \ to /?

    Read the article

  • Help replace this SQL cursor with better code

    - by user318573
    Can anyone give me a hand improving the performance of this cursor logic from SQL 2000. It runs great in SQl2005 and SQL2008, but takes at least 20 minutes to run in SQL 2000. BTW, I would never choose to use a cursor, and I didn't write this code, just trying to get it to run faster. Upgrading this client to 2005/2008 is not an option in the immediate future. ------------------------------------------------------------------------------- ------- Rollup totals in the chart of accounts hierarchy ------------------------------------------------------------------------------- DECLARE @B_SubTotalAccountID int, @B_Debits money, @B_Credits money, @B_YTDDebits money, @B_YTDCredits money DECLARE Bal CURSOR FAST_FORWARD FOR SELECT SubTotalAccountID, Debits, Credits, YTDDebits, YTDCredits FROM xxx WHERE AccountType = 0 AND SubTotalAccountID Is Not Null and (abs(credits)+abs(debits)+abs(ytdcredits)+abs(ytddebits)<>0) OPEN Bal FETCH NEXT FROM Bal INTO @B_SubTotalAccountID, @B_Debits, @B_Credits, @B_YTDDebits, @B_YTDCredits --For Each Active Account WHILE @@FETCH_STATUS = 0 BEGIN --Loop Until end of subtotal chain is reached WHILE @B_SubTotalAccountID Is Not Null BEGIN UPDATE xxx2 SET Debits = Debits + @B_Debits, Credits = Credits + @B_Credits, YTDDebits = YTDDebits + @B_YTDDebits, YTDCredits = YTDCredits + @B_YTDCredits WHERE GLAccountID = @B_SubTotalAccountID SET @B_SubTotalAccountID = (SELECT SubTotalAccountID FROM xxx2 WHERE GLAccountID = @B_SubTotalAccountID) END FETCH NEXT FROM Bal INTO @B_SubTotalAccountID, @B_Debits, @B_Credits, @B_YTDDebits, @B_YTDCredits END CLOSE Bal DEALLOCATE Bal

    Read the article

  • PHP replace string help...

    - by MILESMIBALERR
    i am designing a site with a comment system and i would like a twitter like reply system. The if the user puts @a_registered_username i would like it to become a link to the user's profile. i think preg_replace is the function needed for this. $ALL_USERS_ROW *['USERNAME'] is the database query array for all the users and ['USERNAME'] is the username row. $content is the comment containing the @username i think this should not be very hard to solve for someone who is good at php. Does anybody have any idea how to do it?

    Read the article

  • replace the line to add some text

    - by shantanuo
    The MySQL dump backup file has the following line... # head -40 backup20-Apr-2010-07-32.sql | grep 'CHANGE MASTER TO ' -- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000068', MASTER_LOG_POS=176357756; a) I need to complete the statement with the parameters like Master host, user and password. b) I do also need to remove the comment "--" The line should look something like this... CHANGE MASTER TO MASTER_HOST='111.222.333.444', MASTER_USER='slave_user', MASTER_PASSWORD='slave_user', MASTER_LOG_FILE='mysql-bin.000068', MASTER_LOG_POS=176357756;

    Read the article

  • How to replace a div container with javascript

    - by Kovu
    Hi, I must have a little design in javascript. I have a menu with 5 entrys and only 1 HTML-page. So I will have a content-div and enabled and disabled different static content in it, each menu-entry is another content. I tried with 5 divs and disable 4 of them and enable 1, but the element under each other means every div is like a - enabled or not, so the "content" is moving then. Hope its understandable. Here is the code so far: <html><head><title>Des Einsame-Katerchen's kleine Homepage</title> <style type="text/css"> a:link { font-weight:bold; color:blue; text-decoration:none; } a:visited { font-weight:bold; color:blue; text-decoration:none; } a:focus { font-weight:bold; color:blue; text-decoration:none; } a:hover { font-weight:bold; color:blue; text-decoration:line-through; } a:active { font-weight:bold; color:blue; text-decoration:none; } h1:focus { background-color:red; } h1:hover { background-color:silver; } h1:active { background-color:green; } </style> <script> function an(id) { document.getElementById('start').style.visibility = 'hidden'; document.getElementById('start').style.height = '0px'; document.getElementById('me').style.visibility = 'hidden'; document.getElementById('me').style.height = '0px'; document.getElementById('rpg').style.visibility = 'hidden'; document.getElementById('rpg').style.height = '0px'; document.getElementById('musik').style.visibility = 'hidden'; document.getElementById('musik').style.height = '0px'; document.getElementById('screens').style.visibility = 'hidden'; document.getElementById('screens').style.height = '0px'; document.getElementById(id).style.visibility = 'visible'; document.getElementById(id).style.height = '500px'; } </script> </head> <body style=" " > <div style="width=100%; text-align:center; border: 1px red solid; height:40px;"> <div style="float:left; width:100px;"><a href="#" OnClick="an('start')" >Startseite</a></div> <div style="float:left; width:100px;"><a href="#" OnClick="an('me')" >Über mich</a></div> <div style="float:left; width:100px;"><a href="#" OnClick="an('rpg')" >RPG-Chars</a></div> <div style="float:left; width:100px;"><a href="#" OnClick="an('musik')" >Musik</a></div> <div style="float:left; width:150px;"><a href="#" OnClick="an('screens')" >Knuddels-Screens</a></div> </div> <br> <div id="start" style="border:1px red solid; width:500px; height:500px; overflow: visible; " > a </div> <div id="me" style="border:1px red solid; width:500px; height:0px; overflow: visible; visibility: hidden; " > b </div> <div id="rpg" style="border:1px red solid; width:500px; height:0px; overflow: visible; visibility: hidden; " > c </div> <div id="musik" style="border:1px red solid; width:500px; height:0px; overflow: visible; visibility: hidden; " > d </div> <div id="screens" style="border:1px red solid; width:500px; height:0px; overflow: visible; visibility: hidden; " > e </div> </body>

    Read the article

  • Cascading S3 Sink Tap not being deleted with SinkMode.REPLACE

    - by Eric Charles
    We are running Cascading with a Sink Tap being configured to store in Amazon S3 and were facing some FileAlreadyExistsException (see [1]). This was only from time to time (1 time on around 100) and was not reproducable. Digging into the Cascading codem, we discovered the Hfs.deleteResource() is called (among others) by the BaseFlow.deleteSinksIfNotUpdate(). Btw, we were quite intrigued with the silent NPE (with comment "hack to get around npe thrown when fs reaches root directory"). From there, we extended the Hfs tap with our own Tap to add more action in the deleteResource() method (see [2]) with a retry mechanism calling directly the getFileSystem(conf).delete. The retry mechanism seemed to bring improvement, but we are still sometimes facing failures (see example in [3]): it sounds like HDFS returns isDeleted=true, but asking directly after if the folder exists, we receive exists=true, which should not happen. Logs also shows randomly isDeleted true or false when the flow succeeds, which sounds like the returned value is irrelevant or not to be trusted. Can anybody bring his own S3 experience with such a behavior: "folder should be deleted, but it is not"? We suspect a S3 issue, but could it also be in Cascading or HDFS? We run on Hadoop Cloudera-cdh3u5 and Cascading 2.0.1-wip-dev. [1] org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory s3n://... already exists at org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.checkOutputSpecs(FileOutputFormat.java:132) at com.twitter.elephantbird.mapred.output.DeprecatedOutputFormatWrapper.checkOutputSpecs(DeprecatedOutputFormatWrapper.java:75) at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:923) at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:882) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:396) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1278) at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:882) at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:856) at cascading.flow.hadoop.planner.HadoopFlowStepJob.internalNonBlockingStart(HadoopFlowStepJob.java:104) at cascading.flow.planner.FlowStepJob.blockOnJob(FlowStepJob.java:174) at cascading.flow.planner.FlowStepJob.start(FlowStepJob.java:137) at cascading.flow.planner.FlowStepJob.call(FlowStepJob.java:122) at cascading.flow.planner.FlowStepJob.call(FlowStepJob.java:42) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.j [2] @Override public boolean deleteResource(JobConf conf) throws IOException { LOGGER.info("Deleting resource {}", getIdentifier()); boolean isDeleted = super.deleteResource(conf); LOGGER.info("Hfs Sink Tap isDeleted is {} for {}", isDeleted, getIdentifier()); Path path = new Path(getIdentifier()); int retryCount = 0; int cumulativeSleepTime = 0; int sleepTime = 1000; while (getFileSystem(conf).exists(path)) { LOGGER .info( "Resource {} still exists, it should not... - I will continue to wait patiently...", getIdentifier()); try { LOGGER.info("Now I will sleep " + sleepTime / 1000 + " seconds while trying to delete {} - attempt: {}", getIdentifier(), retryCount + 1); Thread.sleep(sleepTime); cumulativeSleepTime += sleepTime; sleepTime *= 2; } catch (InterruptedException e) { e.printStackTrace(); LOGGER .error( "Interrupted while sleeping trying to delete {} with message {}...", getIdentifier(), e.getMessage()); throw new RuntimeException(e); } if (retryCount == 0) { getFileSystem(conf).delete(getPath(), true); } retryCount++; if (cumulativeSleepTime > MAXIMUM_TIME_TO_WAIT_TO_DELETE_MS) { break; } } if (getFileSystem(conf).exists(path)) { LOGGER .error( "We didn't succeed to delete the resource {}. Throwing now a runtime exception.", getIdentifier()); throw new RuntimeException( "Although we waited to delete the resource for " + getIdentifier() + ' ' + retryCount + " iterations, it still exists - This must be an issue in the underlying storage system."); } return isDeleted; } [3] INFO [pool-2-thread-15] (BaseFlow.java:1287) - [...] at least one sink is marked for delete INFO [pool-2-thread-15] (BaseFlow.java:1287) - [...] sink oldest modified date: Wed Dec 31 23:59:59 UTC 1969 INFO [pool-2-thread-15] (HiveSinkTap.java:148) - Now I will sleep 1 seconds while trying to delete s3n://... - attempt: 1 INFO [pool-2-thread-15] (HiveSinkTap.java:130) - Deleting resource s3n://... INFO [pool-2-thread-15] (HiveSinkTap.java:133) - Hfs Sink Tap isDeleted is true for s3n://... ERROR [pool-2-thread-15] (HiveSinkTap.java:175) - We didn't succeed to delete the resource s3n://... Throwing now a runtime exception. WARN [pool-2-thread-15] (Cascade.java:706) - [...] flow failed: ... java.lang.RuntimeException: Although we waited to delete the resource for s3n://... 0 iterations, it still exists - This must be an issue in the underlying storage system. at com.qubit.hive.tap.HiveSinkTap.deleteResource(HiveSinkTap.java:179) at com.qubit.hive.tap.HiveSinkTap.deleteResource(HiveSinkTap.java:40) at cascading.flow.BaseFlow.deleteSinksIfNotUpdate(BaseFlow.java:971) at cascading.flow.BaseFlow.prepare(BaseFlow.java:733) at cascading.cascade.Cascade$CascadeJob.call(Cascade.java:761) at cascading.cascade.Cascade$CascadeJob.call(Cascade.java:710) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)

    Read the article

  • Replace .sln with MSBuild and wrap contained projects into targets

    - by Filburt
    I'd like to create a MSBuild project that reflects the project dependencies in a solution and wraps the VS projects inside reusable targets. The problem I like solve doing this is to svn-export, build and deploy a specific assembly (and its dependencies) in an BizTalk application. My question is: How can I make the targets for svn-exporting, building and deploying reusable and also reuse the wrapped projects when they are built for different dependencies? I know it would be simpler to just build the solution and deploy only the assemblies needed but I'd like to reuse the targets as much as possible. The parts The project I like to deploy <Project DefaultTargets="Deploy" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <ExportRoot Condition="'$(Export)'==''">Export</ExportRoot> </PropertyGroup> <Target Name="Clean_Export"> <RemoveDir Directories="$(ExportRoot)\My.Project.Dir" /> </Target> <Target Name="Export_MyProject"> <Exec Command="svn export svn://xxx/trunk/Biztalk2009/MyProject.btproj --force" WorkingDirectory="$(ExportRoot)" /> </Target> <Target Name="Build_MyProject" DependsOnTargets="Export_MyProject"> <MSBuild Projects="$(ExportRoot)\My.Project.Dir\MyProject.btproj" Targets="Build" Properties="Configuration=Release"></MSBuild> </Target> <Target Name="Deploy_MyProject" DependsOnTargets="Build_MyProject"> <Exec Command="BTSTask AddResource -ApplicationName:CORE -Source:MyProject.dll" /> </Target> </Project> The projects it depends upon look almost exactly like this (other .btproj and .csproj).

    Read the article

  • How to replace "(" with "\(" in the regexp, Emacs/elisp flavor?

    - by polyglot
    Question as title. More specifically, I'm rather tired of having to type \(, etc. every time I want a parenthesis in Emacs's (interactive) regexp functions (not to mention the \\( in code). So I wrote something like (defadvice query-replace-regexp (before my-query-replace-regexp activate) (ad-set-arg 0 (replace-regexp-in-string "(" "\\\\(" (ad-get-arg 0))) (ad-set-arg 0 (replace-regexp-in-string ")" "\\\\)" (ad-get-arg 0))))) in hope that I can conveniently forget about emacs's idiosyncrasy in regexp during "interaction mode". Except I cannot get the regexp right... (replace-regexp-in-string "(" "\\\\(" "(abc") gives \\(abc instead of the wanted \(abc. Other variations on the number of slashes just gives errors. Thoughts? Since I started questioning, might as well ask another one: since lisp code is not supposed to use interactive functions, advicing query-replace-regexp should be okay, am I correct?

    Read the article

  • Java variables -> replace? RAM optimization

    - by poeschlorn
    Hi guys, I just wanted to know what happens behind my program when I declare and initialize a variable and later initialize it again with other values, e.g. an ArrayList or something similar. What happens in my RAM, when I say e.g. this: ArrayList<String> al = new ArrayList<String>(); ...add values, work with it and so on.... al = new ArrayList<String>(); So is my first ArrayList held in RAM or will the second ArrayList be stored on the same position where the first one has been before? Or will it just change the reference of "al"? If it is not replaced...is there a way to manually free the RAM which was occupied by the first arraylist? (without waiting for the garbage collector) Would it help to set it first =null? Nice greetings, poeschlorn

    Read the article

  • Search and replace with sed

    - by Binoy Babu
    Last week I accidently externalized all my strings of my eclipse project. I need to revert this and my only hope is sed. I tried to create scripts but failed pathetically because I'm new with sed and this would be a very complicated operation. What I need to do is this: Strings in class.java file is currently in the following format(method) Messages.getString(<key>). Example : if (new File(DataSource.DEFAULT_VS_PATH).exists()) { for (int i = 1; i <= c; i++) { if (!new File(DataSource.DEFAULT_VS_PATH + Messages.getString("VSDataSource.89") + i).exists()) { //$NON-NLS-1$ getnewvfspath = DataSource.DEFAULT_VS_PATH + Messages.getString("VSDataSource.90") + i; //$NON-NLS-1$ break; } } } The key and matching Strings are in messages.properties file in the following format. VSDataSource.92=No of rows in db = VSDataSource.93=Verifying db entry : VSDataSource.94=DB is open VSDataSource.95=DB is closed VSDataSource.96=Invalid db entry for VSDataSource.97=\ removed. So I need the java file back in this format: if (new File(DataSource.DEFAULT_VS_PATH).exists()) { for (int i = 1; i <= c; i++) { if (!new File(DataSource.DEFAULT_VS_PATH + "String 2" + i).exists()) { //$NON-NLS-1$ getnewvfspath = DataSource.DEFAULT_VS_PATH + "String 1" + i; //$NON-NLS-1$ break; } } } How can I accomplish this with sed? Or is there an easier way?

    Read the article

  • Replace HTML entities in a string avoiding <img> tags

    - by Xeos
    I have the following input: Hi! How are you? <script>//NOT EVIL!</script> Wassup? :P LOOOL!!! :D :D :D Which is then run through emoticon library and it become this: Hi! How are you? <script>//NOT EVIL!</script> Wassup? <img class="smiley" alt="" title="tongue, :P" src="ui/emoticons/15.gif"> LOOOL!!! <img class="smiley" alt="" title="big grin, :D" src="ui/emoticons/5.gif"> <img class="smiley" alt="" title="big grin, :P" src="ui/emoticons/5.gif"> <img class="smiley" alt="" title="big grin, :P" src="ui/emoticons/5.gif"> I have a function that escapes HTML entites to prevent XSS. So running it on raw input for the first line would produce: Hi! How are you? &lt;script&gt;//NOT EVIL!&lt;/script&gt; Now I need to escape all the input, but at the same time I need to preserve emoticons in their initial state. So when there is <:-P emoticon, it stays like that and does not become &lt;:-P. I was thinking of running a regex split on the emotified text. Then processing each part on its own and then concatenating the string together, but I am not sure how easily can Regex be bypassed? I know the format will always be this: [<img class="smiley" alt="] [empty string] [" title="] [one of the values from a big list] [, ] [another value from the list (may be matching original emoticon)] [" src="ui/emoticons/] [integer from Y to X] [.gif">] Using the list MAY be slow, since I need to run that regex on text that may have 20-30-40 emoticons. Plus there may be 5-10-15 text messages to process. What could be an elegant solution to this? I am ready to use third-party library or jQuery for this. PHP preprocessing is possible as well.

    Read the article

  • Search and replace

    - by zx
    Hi, I have a really large SQL dump around 400MB. It's in the following format, "INSERT INTO user VALUES('USERID', 'USERNAME', 'PASSWORD', '0', '0', 'EMAIL', 'GENDER', 'BIRTHDAY', '182', '13', '640', 'Married', 'Straight', '', 'Yes', 'Yes', '1146411153', '1216452123', '1149440844', '0', picture', '1', '0', '0', 'zip', '0', '', '0', '', '', '0')" Is there anyway I can just get the email and password out from that, I want to import the users into another table. Anyone know how I can do this and just get email-password stripped out from that content? Thank you in advance

    Read the article

  • Replace UpdatePanel with JQuery

    - by Daud
    I'm using UpdatePanel to asynchronously call a button click event in a page that calls a method in another class which writes out an XML file on the output. Is there a way to do this with JQuery instead of UpdatePanel?

    Read the article

  • Find any type of url, and replace "click here" text with regexp jquery

    - by Takács Zsolt
    Hi! I need a little script in jQ because I have to change the long urls to a shorten "click here" text. I want to change only the url text not the value of href's attrib like this: <a href="http://verylongurl.ext/ohshitwhatlongisit/yaythatstoolongforme">http://verylongurl.ext/ohshitwhatlongisit/yaythatstoolongforme</a> to.. <a href="http://verylongurl.ext/ohshitwhatlongisit/yaythatstoolongforme">click here</a> The script must work on any possible type of url for example: http: https: ftp: and so on... tyvm girls and guys! Regs!

    Read the article

  • java runtime tracing library to replace system.out.println

    - by Grzegorz Oledzki
    Have you heard of any library which would allow me to set up a tracing for specific methods at runtime? Instead of adding (and removing) lots of System.out.println in my code (and having to re-compile and re-deploy) I would like to have a magic thing which would print out a line for each call of selected method without any change in the code. This would work without re-compiling, so some kind of JVM agent (or some non-standard JVM would be needed?). Sounds like a job for aspect programming? A typical scenario would be to start an application, configure the traced methods dynamically (in a separate file or similar) and then everytime a selected method is called a line with its name (and arguments) is printed out to System.out (or some log file). Naturally one could think of tens of additional features, but this basic set would be a great tool. BTW, I use Eclipse interactive debugger too, not only the System.out tracing technique, but both have some advantages and sometimes Eclipse is not enough.

    Read the article

  • SQL Server T-SQL statement to replace/delete sub-strings

    - by StefanE
    Hi, I have a table with 6 columns containing HTML content with some markups in it and now when moving to a new designed site most of this HTML code has to be deleted. More or less all tags except <B> and </B>. Is there a nice way of doing this, identify all tags end delete them within the data? I'm sure there are no < symbols in the test so a regular expression would maybe work? My alternative is to fetch every row, process it and update the database but I'm guessing this is possible to do in T-SQL directly. My server is an MSSQL 2008 and is located in a hosted environment but I can fetch a local copy if needed. Thanks, Stefan

    Read the article

  • MS-SQL statement to replace/delete sub-strings

    - by StefanE
    Hi, I have a table with 6 columns containing HTML content with some markups in it and now when moving to a new designed site most of this HTML code has to be deleted. More or less all tags except and . Is there a nice way of doing this, identify all tags end delete them within the data? I'm sure there are no < symbols in the test so a regular expression would maybe work? My alternative is to fecth every row, process it and update the database but I'm guessing this is possible to do in SQL directly. Thanks, Stefan

    Read the article

  • XCode: compiling doesn't always replace plist?

    - by Brian Postow
    I have an application and I will sometimes just change the plist, say to change the version number. Sometimes I'll actually make a change to the code, AND the version number....in the latter case, SOMETIMES the version number of the resulting app will change, in the former it will never change. The only way I've found that surely does it right is when I delete the .app before compiling. In case it matters, the resulting app is being put in a folder that isn't in the build folder, but I doubt that that's relevant. any thoughts?

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >