Search Results

Search found 6715 results on 269 pages for 'preg match'.

Page 92/269 | < Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >

  • creating new application in IIS 7 can cause other applications running on same IIS to log out?

    - by mokokamello
    Hi Experts I am new to IIS 7 and i am running a 16 user Application Server i received complains from my colleagues that their application log out suddenly and not saving edits. i compared the time of complains and they match the time when i was trying to install a new asp.net application or modify an existing one (of course not the very one they complained from) does this make sense? i mean are these events (application crash and installing new application on IIS) related together. note that i did not restart IIS

    Read the article

  • Mod_security Logging

    - by Hekuran S. Doli
    Im trying to run mod_security as standalone service with nginx as reverse proxy everything works fine except logging. Mod_security logs reverse proxys ip addres instead of clients ip address. I would appreciate if someone can help. The following is an example of logfile where mod_security is logging 127.0.0.1 instead of clients ip address. 2012/08/29 14:18:13 [info] 206862#0: [client 127.0.0.1] ModSecurity: Access denied with code 403 (phase 2). Pattern match ...

    Read the article

  • How can I include a line until # but without the # when parsing 'sources.list' with regex?

    - by stwissel
    I want to parse my sources.list to extract the list of repositories. I have: ## Some comment deb http://some.vendor.com/ubuntu precise stable deb-src http://some.vendor.com/ubuntu precise stable deb http://some.othervendor.com/ubuntu precise experimental # my current favorite I want: http://some.vendor.com/ubuntu precise stable http://some.othervendor.com/ubuntu precise experimental So I need: only lines with deb at the beginning and until the end of the line or a # character but excluding it. So far I have: grep -o "^deb .*" But how to match # or LineEnd and excluding the #?

    Read the article

  • iis7 url rewrite (remove .aspx) and getting error 404

    - by eimeim
    I have an issue with IIS7 url rewrite module, when I add following rule I get an 404 error on all pages. <rule name="Remove .aspx" stopProcessing="true"> <match url="(.+)\.aspx" /> <action type="Redirect" redirectType="Permanent" url="{R:1}" /> All I want to do to remove all files extensions. I get lost with this, maybe someone knows the solution? Thanks in advance. Regards, eimeim

    Read the article

  • How to prevent MediaWiki removing non default signatures?

    - by WikiSpeedia At Area51
    We recently upgraded MediaWiki from 1.13.2 to 1.15.4. One of the side effects is that people's signatures are automatically deleted. That is, a signature added under MY PREFERENCES gets changed to match the Real Name field after a couple of minutes. We set $wgCleanSignatures = false in LocalSettings.php but this does not change the behaviour. Does anyone know what is going on and how to prevent this?

    Read the article

  • vBulletin 5 + lighthttpd url rewriting

    - by Boots
    I'm trying to get vBulletin 5 up and running under lighttpd but I'm having some problems with url rewriting. Here is the apache .htaccess provided by vBulletin. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA] #needed because admincp is an actual directory. RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA] </IfModule> If this helps, this is the IIS config provided by vBulletin <?xml version="1.0" encoding="UTF-8"?> <!-- This file is to support redirection in IIS. It is harmless if you are running under Apache --> <configuration> <system.webServer> <rewrite> <rules> <rule name="Main Redirect" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> </conditions> <action type="Rewrite" url="index.php/{R:1}" /> </rule> <rule name="Admincp" stopProcessing="true"> <match url="^(admincp/)$" ignoreCase="false" /> <action type="Rewrite" url="index.php/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration> Anyone have any suggestions as to the lighttpd url.rewrite equivalent? All my experiments have failed thus far. I'm running lighttpd-1.4.31-1 I tried this but it didn't work. I think it has something to do with me not properly emulating [QS] in the .htaccess url.rewrite-once = ("^(.*)$" => "index.php?routestring=$1", "^(admincp/)$)" => "index.php?routestring=$1") This has gotten me closer but not fully functional yet. url.rewrite-if-not-file = ("^(.*)$" => "index.php?routestring=$1", "^(admincp/)$)" => "index.php?routestring=$1")

    Read the article

  • Test and Production Server

    - by Mike Silvis
    I am using Git for a test and production server and I'm trying to figure out the best way to update the production server. I have limited SSH access, and don't want to manually update my production server using FTP. I essentially would like to just be able to run a simple command and have the whole production server files match my dev. It is also important to note that users will be uploading images, and other files to our production server only, that we can not lose. Thanks,any help is appreciated

    Read the article

  • vBulletin 5 + lighttpd url rewriting

    - by Boots
    I'm trying to get vBulletin 5 up and running under lighttpd but I'm having some problems with url rewriting. Here is the apache .htaccess provided by vBulletin. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA] #needed because admincp is an actual directory. RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA] </IfModule> If this helps, this is the IIS config provided by vBulletin <?xml version="1.0" encoding="UTF-8"?> <!-- This file is to support redirection in IIS. It is harmless if you are running under Apache --> <configuration> <system.webServer> <rewrite> <rules> <rule name="Main Redirect" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> </conditions> <action type="Rewrite" url="index.php/{R:1}" /> </rule> <rule name="Admincp" stopProcessing="true"> <match url="^(admincp/)$" ignoreCase="false" /> <action type="Rewrite" url="index.php/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration> Anyone have any suggestions as to the lighttpd url.rewrite equivalent? All my experiments have failed thus far. I'm running lighttpd-1.4.31-1 I tried this but it didn't work. I think it has something to do with me not properly emulating [QS] in the .htaccess url.rewrite-once = ("^(.*)$" => "index.php?routestring=$1", "^(admincp/)$)" => "index.php?routestring=$1") This has gotten me closer but not fully functional yet. url.rewrite-if-not-file = ("^(.*)$" => "index.php?routestring=$1", "^(admincp/)$)" => "index.php?routestring=$1")

    Read the article

  • Python crash issue in Fedora 12

    - by MA1
    How to fix the following issue and what's the problem. Due to this problem, everything that uses python is not working. /lib/librt.so.1: symbol pthread_barrier_wait, version GLIBC_2.2 not defined in file libpthread.so.0 with link time reference Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.6.2 (r262:71600, Aug 21 2009, 12:22:21) [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)]

    Read the article

  • VPN says connected but cannot ping tunnel ip

    - by Owl
    I have a VPN set up on a Symantec Gateway 320 and the status of the VPN is connected but the feature it provides is not working which means it is not actually connected..The only way to test it other than trying to use it in the program that utilizes it is to ping the remote subnet IP we use. mask numbers match, no settings have been changed it just stopped working.

    Read the article

  • What's a lightweight alternative to Word / Writer? [closed]

    - by vemv
    I'm looking for a desktop, cross-OS, Word/Writer-like program (this is, that lets the user format the content, as opposed to source code editors) without all the feature bloat + performance overhead I'd get with an office suite. Ideally, most of its features would be focused on: the text editing itself - clever replaces, indentation control, etc, and separating the content from its presentation, à la HTML/CSS. Which programs match these features?

    Read the article

  • yum erase tells me pkg not installed. yum install tells me package is already installed

    - by barrrista
    erase complains pkg not installed yum erase libstdc++-4.1.2-52.el5_8.1.x86_64 Setting up Remove Process No Match for argument: libstdc++-4.1.2-52.el5_8.1.x86_64 Package(s) libstdc++-4.1.2-52.el5_8.1.x86_64 available, but not installed. No Packages marked for removal install complains pkge already installed yum install libstdc++-4.1.2-52.el5_8.1.x86_64 Setting up Install Process Package matching libstdc++-4.1.2-52.el5_8.1.x86_64 already installed. Checking for update. Nothing to do What gives?

    Read the article

  • Rails 3 Form For Custom Action

    - by Andrew
    I'm having trouble routing a form to a custom action in Rails 3. Here are my routes: resources :photos do resources :comments collection do get 'update_states' end member do put 'upload' end end Here's the form_for: form_for @photo, :remote => true, :url => { :action => upload_photo_path(@photo) }, :html => { :multipart => :true, :method => 'put' } do |f| And here's the error message: No route matches {:action=>"/photos/42/upload", :controller=>"photos"} ... this is especially frustrating because "photos/:id/upload" is exactly the correct action for this form. What am I missing? EDITS - Here are the original Photo-related routes: photo_comments GET /photos/:photo_id/comments(.:format) {:action=>"index", :controller=>"comments"} POST /photos/:photo_id/comments(.:format) {:action=>"create", :controller=>"comments"} new_photo_comment GET /photos/:photo_id/comments/new(.:format) {:action=>"new", :controller=>"comments"} edit_photo_comment GET /photos/:photo_id/comments/:id/edit(.:format) {:action=>"edit", :controller=>"comments"} photo_comment GET /photos/:photo_id/comments/:id(.:format) {:action=>"show", :controller=>"comments"} PUT /photos/:photo_id/comments/:id(.:format) {:action=>"update", :controller=>"comments"} DELETE /photos/:photo_id/comments/:id(.:format) {:action=>"destroy", :controller=>"comments"} update_states_photos GET /photos/update_states(.:format) {:action=>"update_states", :controller=>"photos"} upload_photo PUT /photos/:id/upload(.:format) {:action=>"upload", :controller=>"photos"} photos GET /photos(.:format) {:action=>"index", :controller=>"photos"} POST /photos(.:format) {:action=>"create", :controller=>"photos"} new_photo GET /photos/new(.:format) {:action=>"new", :controller=>"photos"} edit_photo GET /photos/:id/edit(.:format) {:action=>"edit", :controller=>"photos"} photo GET /photos/:id(.:format) {:action=>"show", :controller=>"photos"} PUT /photos/:id(.:format) {:action=>"update", :controller=>"photos"} DELETE /photos/:id(.:format) {:action=>"destroy", :controller=>"photos"} Here are the relevant routes when I changed the route to match 'upload': photo_comments GET /photos/:photo_id/comments(.:format) {:action=>"index", :controller=>"comments"} POST /photos/:photo_id/comments(.:format) {:action=>"create", :controller=>"comments"} } new_photo_comment GET /photos/:photo_id/comments/new(.:format) {:action=>"new", :controller=>"comments"} edit_photo_comment GET /photos/:photo_id/comments/:id/edit(.:format) {:action=>"edit", :controller=>"comments"} photo_comment GET /photos/:photo_id/comments/:id(.:format) {:action=>"show", :controller=>"comments"} PUT /photos/:photo_id/comments/:id(.:format) {:action=>"update", :controller=>"comments"} DELETE /photos/:photo_id/comments/:id(.:format) {:action=>"destroy", :controller=>"comments"} update_states_photos GET /photos/update_states(.:format) {:action=>"update_states", :controller=>"photos"} upload_photo /photos/:id/upload(.:format) {:action=>"upload", :controller=>"photos"} photos GET /photos(.:format) {:action=>"index", :controller=>"photos"} POST /photos(.:format) {:action=>"create", :controller=>"photos"} new_photo GET /photos/new(.:format) {:action=>"new", :controller=>"photos"} edit_photo GET /photos/:id/edit(.:format) {:action=>"edit", :controller=>"photos"} photo GET /photos/:id(.:format) {:action=>"show", :controller=>"photos"} PUT /photos/:id(.:format) {:action=>"update", :controller=>"photos"} DELETE /photos/:id(.:format) {:action=>"destroy", :controller=>"photos"} Unfortunately 'match' didn't work any better... -- EDIT -- Just to confirm another scenario here... with this in the routes: resources :photos do resources :comments collection do get 'update_states' end member do match 'upload' end end and this in the view: form_for @photo, :remote => true, :url => { :action => 'upload' }, :html => { :multipart => :true, :id => 'photo_upload' } do |f| I still get: No route matches {:action=>"upload", :controller=>"photos"}

    Read the article

  • XSL unique values per node per position

    - by Nathan Colin
    this get ever more complicated :) now i face another issue in last question we managed to take unique values from only one parent node now with: <?xml version="1.0" encoding="ISO-8859-1"?> <roots> <root> <name>first</name> <item> <something>A</something> <something>A</something> </item> <item> <something>B</something> <something>A</something> </item> <item> <something>C</something> <something>P</something> </item> <item> <something>A</something> <something>L</something> </item> <item> <something>A</something> <something>A</something> </item> <item> <something>B</something> <something>A</something> </item> <item> <something>D</something> <something>A</something> </item> </root> <root> <name>second</name> <item> <something>E</something> <something>A</something> </item> <item> <something>B</something> <something>A</something> </item> <item> <something>F</something> <something>A</something> </item> <item> <something>A</something> <something>A</something> </item> <item> <something>A</something> <something>A</something> </item> <item> <something>B</something> <something>H</something> </item> <item> <something>D</something> <something>G</something> </item> </root> </roots> now i need to get the unique values depending only from one node before but just from the elements on the second position <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="text"/> <xsl:key name="item-by-value" match="something" use="concat(normalize-space(.), ' ', generate-id(./ancestor::root))"/> <xsl:key name="rootkey" match="root" use="name"/> <xsl:template match="/"> <xsl:for-each select="key('rootkey','first')"> <xsl:for-each select="item/something[1]"> <xsl:sort /> <xsl:if test="generate-id() = generate-id(key('item-by-value', concat(normalize-space(.), ' ', generate-id(./ancestor::root))))"> <xsl:value-of select="."/> </xsl:if> </xsl:for-each> <xsl:text>_________</xsl:text> <xsl:for-each select="item/something[2]"> <xsl:sort /> <xsl:if test="generate-id() = generate-id(key('item-by-value', concat(normalize-space(.), ' ', generate-id(./ancestor::root))))"> <xsl:value-of select="."/> </xsl:if> </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> with this XSL i get ABCD__LP where the result i need is ABCD__ALP any ideas?

    Read the article

  • XSLT adding elements on the same path

    - by Stefan
    Consider the following XML: <?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <cd> <title>Empire Burlesque</title> <artist> <name>Bob</name> <surname>Dylan</surname> </artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> </catalog> I want to add elements to this XML using XSLT, to get the following result: <?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <cd> <title>Empire Burlesque</title> <artist> <name>Bob</name> <surname>Dylan</surname> <!-- NEW --> <middlename>???</middlename> </artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> <!-- NEW --> <comment>great one</comment> </cd> <!-- NEW --> <cd> <title>Hide your heart</title> <artist> <name>Bonnie</name> <surname>Tyler</surname> </artist> <country>UK</country> <company>CBS Records</company> <price>9.90</price> <year>1988</year> </cd> </catalog> To achieve that, I wrote the following XSLT: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template name="injectXml"> <xsl:param name="whatToInject"/> <xsl:copy> <xsl:copy-of select="node() | @*"/> <xsl:copy-of select="$whatToInject"/> </xsl:copy> </xsl:template> <xsl:template match="//catalog"> <xsl:call-template name="injectXml"> <xsl:with-param name="whatToInject"> <cd> <title>Hide your heart</title> <artist> <name>Bonnie</name> <surname>Tyler</surname> </artist> <country>UK</country> <company>CBS Records</company> <price>9.90</price> <year>1988</year> </cd> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="//cd[year=1985]"> <xsl:call-template name="injectXml"> <xsl:with-param name="whatToInject"> <comment>great one</comment> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template match="//cd[year=1985]/artist"> <xsl:call-template name="injectXml"> <xsl:with-param name="whatToInject"> <middlename>???</middlename> </xsl:with-param> </xsl:call-template> </xsl:template> </xsl:stylesheet> Why it's not working? How to do it?

    Read the article

  • Retrieving XML node from a path specified in an attribute value of another node

    - by Olivier PAYEN
    From this XML source : <?xml version="1.0" encoding="utf-8" ?> <ROOT> <STRUCT> <COL order="1" nodeName="FOO/BAR" colName="Foo Bar" /> <COL order="2" nodeName="FIZZ" colName="Fizz" /> </STRUCT> <DATASET> <DATA> <FIZZ>testFizz</FIZZ> <FOO> <BAR>testBar</BAR> <LIB>testLib</LIB> </FOO> </DATA> <DATA> <FIZZ>testFizz2</FIZZ> <FOO> <BAR>testBar2</BAR> <LIB>testLib2</LIB> </FOO> </DATA> </DATASET> </ROOT> I want to generate this HTML : <html> <head> <title>Test</title> </head> <body> <table border="1"> <tr> <td>Foo Bar</td> <td>Fizz</td> </tr> <tr> <td>testBar</td> <td>testFizz</td> </tr> <tr> <td>testBar2</td> <td>testFizz2</td> </tr> </table> </body> </html> Here is the XSLT I currently have : <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:output method="html" indent="yes"/> <xsl:template match="/ROOT"> <html> <head> <title>Test</title> </head> <body> <table border="1"> <tr> <!--Generate the table header--> <xsl:apply-templates select="STRUCT/COL"> <xsl:sort data-type="number" select="@order"/> </xsl:apply-templates> </tr> <xsl:apply-templates select="DATASET/DATA" /> </table> </body> </html> </xsl:template> <xsl:template match="COL"> <!--Template for generating the table header--> <td> <xsl:value-of select="@colName"/> </td> </xsl:template> <xsl:template match="DATA"> <xsl:variable name="pos" select="position()" /> <tr> <xsl:for-each select="/ROOT/STRUCT/COL"> <xsl:sort data-type="number" select="@order"/> <xsl:variable name="elementName" select="@nodeName" /> <td> <xsl:value-of select="/ROOT/DATASET/DATA[$pos]/*[name() = $elementName]" /> </td> </xsl:for-each> </tr> </xsl:template> </xsl:stylesheet> It almost works, the problem I have is to retrieve the correct DATA node from the path specified in the "nodeName" attribute value of the STRUCT block.

    Read the article

  • PHP, MySQL, jQuery, AJAX: json data returns correct response but frontend returns error

    - by Devner
    Hi all, I have a user registration form. I am doing server side validation on the fly via AJAX. The quick summary of my problem is that upon validating 2 fields, I get error for the second field validation. If I comment first field, then the 2nd field does not show any error. It has this weird behavior. More details below: The HTML, JS and Php code are below: HTML FORM: <form id="SignupForm" action=""> <fieldset> <legend>Free Signup</legend> <label for="username">Username</label> <input name="username" type="text" id="username" /><span id="status_username"></span><br /> <label for="email">Email</label> <input name="email" type="text" id="email" /><span id="status_email"></span><br /> <label for="confirm_email">Confirm Email</label> <input name="confirm_email" type="text" id="confirm_email" /><span id="status_confirm_email"></span><br /> </fieldset> <p> <input id="sbt" type="button" value="Submit form" /> </p> </form> JS: <script type="text/javascript"> $(document).ready(function() { $("#email").blur(function() { var email = $("#email").val(); var msgbox2 = $("#status_email"); if(email.length > 3) { $.ajax({ type: 'POST', url: 'check_ajax2.php', data: "email="+ email, dataType: 'json', cache: false, success: function(data) { if(data.success == 'y') { alert('Available'); } else { alert('Not Available'); } } }); } return false; }); $("#confirm_email").blur(function() { var confirm_email = $("#confirm_email").val(); var email = $("#email").val(); var msgbox3 = $("#status_confirm_email"); if(confirm_email.length > 3) { $.ajax({ type: 'POST', url: 'check_ajax2.php', data: 'confirm_email='+ confirm_email + '&email=' + email, dataType: 'json', cache: false, success: function(data) { if(data.success == 'y') { alert('Available'); } else { alert('Not Available'); } } , error: function (data) { alert('Some error'); } }); } return false; }); }); </script> PHP code: <?php //check_ajax2.php if(isset($_POST['email'])) { $email = $_POST['email']; $res = mysql_query("SELECT uid FROM members WHERE email = '$email' "); $i_exists = mysql_num_rows($res); if( 0 == $i_exists ) { $success = 'y'; $msg_email = 'Email available'; } else { $success = 'n'; $msg_email = 'Email is already in use.</font>'; } print json_encode(array('success' => $success, 'msg_email' => $msg_email)); } if(isset($_POST['confirm_email'])) { $confirm_email = $_POST['confirm_email']; $email = ( isset($_POST['email']) && trim($_POST['email']) != '' ? $_POST['email'] : '' ); $res = mysql_query("SELECT uid FROM members WHERE email = '$confirm_email' "); $i_exists = mysql_num_rows($res); if( 0 == $i_exists ) { if( isset($email) && isset($confirm_email) && $email == $confirm_email ) { $success = 'y'; $msg_confirm_email = 'Email available and match'; } else { $success = 'n'; $msg_confirm_email = 'Email and Confirm Email do NOT match.'; } } else { $success = 'n'; $msg_confirm_email = 'Email already exists.'; } print json_encode(array('success' => $success, 'msg_confirm_email' => $msg_confirm_email)); } ?> THE PROBLEM: As long as I am validating the $_POST['email'] as well as $_POST['confirm_email'] in the check_ajax2.php file, the validation for confirm_email field always returns an error. With my limited knowledge of Firebug, however, I did find out that the following were the responses when I entered email and confirm_email in the fields: RESPONSE 1: {"success":"y","msg_email":"Email available"} RESPONSE 2: {"success":"y","msg_email":"Email available"}{"success":"n","msg_confirm_email":"Email and Confirm Email do NOT match."} Although the RESPONSE 2 shows that we are receiving the correct message via msg_confirm_email, in the front end, the alert 'Some error' is popping up (I have enabled the alert for debugging). I have spent 48 hours trying to change every part of the code wherever possible, but with only little success. What is weird about this is that if I comment the validation for $_POST['email'] field completely, then the validation for $_POST['confirm_email'] field is displaying correctly without any errors. If I enable it back, it is validating email field correctly, but when it reaches the point of validating confirm_email field, it is again showing me the error. I have also tried renaming success variable in check_ajax2.php page to other different names for both $_POST['email'] and $_POST['confirm_email'] but no success. I will be adding more fields in the form and validating within the check_ajax2.php page. So I am not planning on using different ajax pages for validating each of those fields (and I don't think it's smart to do it that way). I am not a jquery or AJAX guru, so all help in resolving this issue is highly appreciated. Thank you in advance.

    Read the article

  • Good coding style to do case-select in XSLT

    - by Scud
    I want to have a page display A,B,C,D depending on the return value from XML value (1,2,3,4). My approaches are by javascript or XSLT:choose. I want to know which way is better, and why? Can I do this case-select in .cs code (good or bad)? Should I javascript code in XSLT? Can the community please advise? Thanks. Below are the code. Javascript way (this one works): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:js="urn:custom-javascript"> <xsl:template match="page"> <msxsl:script language="JavaScript" implements-prefix="js"> <![CDATA[ function translateSkillLevel(level) { switch (level) { case 0: return "Level 1"; case 1: return "Level 2"; case 2: return "Level 3"; } return "unknown"; } ]]> </msxsl:script> <div id="skill"> <table border="0" cellpadding="1" cellspacing="1"> <tr> <th>Level</th> </tr> <xsl:for-each select="/page/Skill"> <tr> <td> <!-- difference here --> <script type="text/javascript"> document.write(translateSkillLevel(<xsl:value-of select="@level"/>)); </script> </td> </tr> </xsl:for-each> </table> </div> </xsl:template> </xsl:stylesheet> Javascript way (this one doesn't work, getting undefined js tag): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:js="urn:custom-javascript"> <xsl:template match="page"> <msxsl:script language="JavaScript" implements-prefix="js"> <![CDATA[ function translateSkillLevel(level) { switch (level) { case 0: return "Level 1"; case 1: return "Level 2"; case 2: return "Level 3"; } return "unknown"; } ]]> </msxsl:script> <div id="skill"> <table border="0" cellpadding="1" cellspacing="1"> <tr> <th>Level</th> </tr> <xsl:for-each select="/page/Skill"> <tr> <td> <!-- difference here --> <xsl:value-of select="js:translateSkillLevel(string(@level))"/> </td> </tr> </xsl:for-each> </table> </div> </xsl:template> </xsl:stylesheet> XSLT way: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="page"> <div id="skill"> <table border="0" cellpadding="1" cellspacing="1"> <tr> <th>Level</th> </tr> <xsl:for-each select="/page/Skill"> <tr> <td> <xsl:choose> <xsl:when test="@level = 0"> Level 1 </xsl:when> <xsl:when test="@level = 1"> Level 2 </xsl:when> <xsl:when test="@level = 2"> Level 3 </xsl:when> <xsl:otherwise> unknown </xsl:otherwisexsl:otherwise> </xsl:choose> </td> </tr> </xsl:for-each> </table> </div> </xsl:template> </xsl:stylesheet> EDIT: Also, I have some inline javascript functions for form submit. <input type="submit" onclick="javascript:document.forms[0].submit();return false;"/>

    Read the article

  • Desktop Fun: Dual Monitor Wallpaper Collection Series 1

    - by Asian Angel
    Sometimes it is hard to find good wallpapers suited to a dual monitor setup, so today we present the first in a series of wallpaper collections geared specifically towards dual monitors. Note: Click on the picture to see the full-size image—these wallpapers vary in size so you may need to crop, stretch, or place them on a colored background in order to best match them to your screen’s resolution. For more wallpapers be certain to see our great collections in the Desktop Fun section. Latest Features How-To Geek ETC The 50 Best Registry Hacks that Make Windows Better The How-To Geek Holiday Gift Guide (Geeky Stuff We Like) LCD? LED? Plasma? The How-To Geek Guide to HDTV Technology The How-To Geek Guide to Learning Photoshop, Part 8: Filters Improve Digital Photography by Calibrating Your Monitor Our Favorite Tech: What We’re Thankful For at How-To Geek Settle into Orbit with the Voyage Theme for Chrome and Iron Awesome Safari Compass Icons Set Escape from the Exploding Planet Wallpaper Move Your Tumblr Blog to WordPress Pytask is an Easy to Use To-Do List Manager for Your Ubuntu System Snowy Christmas House Personas Theme for Firefox

    Read the article

  • Send regular keyboard samples OR keyboard state changes over network

    - by Ciaran
    Building a multi player asteroids game where ships compete with each other. Using UDP. Wanted to minimize traffic sent to server. Which would you do: Send periodic keyboard state samples every from client every to match server physics update rate e.g. 50 times per second. Highly resilient to packet loss and other reliabilty problems. Out of date packets disacarded by server. Generates a lot of unnuecessary traffic. Only send keyboard state when it changes (key up, key down). Radically less traffic sent from client to server. However, UDP can lose packets without you being informed. So the latter method could result in the vital packet never being resent unless I detect and resend this in a timely manner.

    Read the article

  • Installing missing package that provides Xm/Xm.h

    - by Nicholas Kinar
    I'm compiling a software package that requires a header file. The header file is missing from my Ubuntu 11.10 (64-bit) installation. During the compilation using make, gcc and gfortran, I receive the following error message. XMstr.c:7:19: fatal error: Xm/Xm.h: No such file or directory Googling for an answer leads me to believe that a MESA library needs to be installed on my system, but I can't find an exact match for the package name. What might be the name of the package that I need to install? Does the package have the same name on more recent Ubuntu distros?

    Read the article

  • Silverlight TV 14: Developing for Windows Phone 7 with Silverlight

    Silverlight TV is here at MIX10 where Windows Phone 7 (WP7) and Silverlight just became the best match since peanut butter and chocolate! Mike Harsh, Program Manager for the Silverlight team working on WP7, joins John Papa to demonstrate the WP7 device and the tooling used to create applications for it. Mike covers the phone, how to write a Silverlight app for it, how to run that app in the emulator, and how to deploy it to the phone. The simplicity of this demo is how easy it truly is to take your...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

< Previous Page | 88 89 90 91 92 93 94 95 96 97 98 99  | Next Page >