Posts

Using PowerShell to convert XML to HTML -

i have xml file: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type='text/xsl' href='file:///c:/program%20files/application/log_format.xsl'?> <!doctype log [<!entity data system 'data/20130408.dat'>]> <log xmlns="runtime:log">&data;</log> the xsl file transforms html. can't open file in ie fine , view expected results. via powershell script convert in plain html. how go that? this blog entry has code snippet should work. uses system.xml.xsl.xslcompiledtransform .net class xsl transformation. rest getting input , displaying output. this comment, guess i'll make answer it's easier other people searching solution.

java - Checking if a message contains a string -

i have have class check id phrase contained in message, tried matcher , pattern , string.contains() , results returned odd. here class: public class motsclesfilter implements emailfilter { final string name = "filtrage par mots cles"; /*private pattern chainespam; private matcher chainecourriel;*/ private int nboccmotspam; private byte confidencelevel; @override public string getfiltername() { return this.name; } @override public byte checkspam(mimemessage message) { analyze(message); if(this.nboccmotspam==0) this.confidencelevel = 1; else if (this.nboccmotspam>0 && this.nboccmotspam<2) this.confidencelevel = cant_say; else if (this.nboccmotspam>1 && this.nboccmotspam<3) this.confidencelevel = 50; else if (this.nboccmotspam>3 && this.nboccmotspam<4) this.confidencelevel = 65; els...

mysql - how to get string in among of lines using php -

i having file settings.txt. contains lines like set version=3 set backup_drive=d:\ set backup_directory=backup\ set hourly_directory=hourly\ set input_directory=c:\mysql\data\cdr\ set username=username set password=password this file @ other location or on other server. have file using ... $frserver = file_get_contents("http://ip here/cdr/settings.txt"); i used $file = file_get_contents("http://ip heresettings.txt"); $filearr = explode("\r\n",$file); echo $filearr[5]; // output: set username=desired username and "set username=desired username" bt want "desired username"..just issue left nw now unable username , password it. how username , password can compare them in db... assuming $frserver = 'set version=3 set backup_drive=d:\ set backup_directory=backup\ set hourly_directory=hourly\ set input_directory=c:\mysql\data\cdr\ set username=username set password=password'; the whole solution these 2 l...

apache - user is "nobody" when creating directory PHP -

i have following code: mkdir($thumb_dir) which creates directory in proper location, when view permissions owner : nobody group : nobody i don't have shell access chown . how prevent user assigned nobody , how delete folder have made since don't have permission. it's godaddy shared server... you can delete empty directories rmdir(). nobody user runs apache process. can't change owner within php, nor can delete folder using shell access (or make changes on whatsoever) without root permissions; can manipulate through php

asp.net - Automating .Net 1.1 Web Applications deployment -

i have been researching little bit how automate vs2003 web application projects. "devenv.com" solution via command-line require iis , appropriate mapping show stopper tfs2012 team build box , possibly have build same projects different branches (diff physical path same virtual folder mapping issue). alternative far migrate away new project system. want know if able teambuild working web applications projects without altering code drastically (project system or .net target version). ps: aware of msbee , nant not offer of solution.

c++ - libpng warning in Eclipse -

i on ubuntu 12.04 lts using eclipse 3.7.2 trying use mathgl. simple, c++ looks like: #include <iostream> #include <mgl2/mgl.h> using namespace std; int main() { mglgraph gr; gr.fplot("sin(pi*x)"); gr.writepng("test.png"); return 0; } when run following warning : libpng warning: application built libpng-1.2.46 running 1.5.13 and test.png cannot displayed. any ideas on how fix it? thanks! you have re-build app use libpng-1.5.13. built 1.2.46. or read release notes 2 versions , determine supported in 1.2.46 , stay within boundaries. must trying use functionality in lidpng not in 1.2.46

scala - useless implicit keyword assigned to method ? / Play framework 2 -

as official documentation of play framework recommends, can use implicit request in order improve access objects associated request. sample: def index = action { implicit request => session.get("connected").map { user => ok("hello " + user) }.getorelse { unauthorized("oops, not connected") } } this due addition of following implicit method belonged controller trait: /** * retrieves session implicitly request. * * example: * {{{ * def index(name:string) = action { implicit request => * val username = session("username") * ok("hello " + username) * } * }}} */ implicit def session(implicit request: requestheader) = request.session question: why method declared implicit ? isn't enough declare request parameter implicit ? i expected see instead: def session(implicit request: requestheader) = request.session the first implicit keyword indeed not ne...