Posts

java - In Eclipse, my exported executable jar doesn't do anything ! (LWJGL) -

java beginner here. i made small java app in eclipse (on windows), using lwjgl lib , slick. when export executable .jar file, , run resulting .jar, doesn't anything. no errors, no nothing - doesn't seem run. following tutorial : http://www.cs.bsu.edu/homepages/pvg/misc/slick_eclipse_tutorial.php here's manifest.mf file looks : manifest-version: 1.0 main-class: simpletest class-path: lib/lwjgl.jar lib/slick.jar apps don't use lwjgl export fine. doing wrong ? i tried using jarsplice, didn't work, though might misusing it. pointers ? my best bet missed reference main-class in manifest -file. have @ this shows how set manifest -file correctly. have fun! edit: manifest-version: 1.0 main-class: simpletest class-path: lib/lwjgl.jar lib/slick.jar <-- new line without content --> edit 2: ok, able reproduce behavior. tried run exported jar via console i've got following exception: exception in thread "main" java....

php replace first occurrence of string from 0th position -

i want search , replace first word in php follows: $str="nothing inside"; replace 'nothing' 'something' search , replace without using substr output should be: 'something inside' use preg_replace() limit of 1: preg_replace('/nothing/', 'something', $str, 1); replace regular expression /nothing/ whatever string want search for. since regular expressions evaluated left-to-right, match first instance.

c# - Read data in string from begin to end -

<td valign="top" class="m92_h_bigimg"> <a href="#pagetop" onclick="drop1('hotelinfos');" title="hotelinformationen einblenden"><img border=0 src="http://i2.giatamedia.de/s.php?uid=168846&source=xml&size=320&vea=5vf&cid=2492&file=007399_8790757.jpg" name="bigpic"></a> </td> <td valign="top" class="m92_h_bigimg2"> <table border=0 cellpadding=0 cellspacing=0> <tr> <td valign="top" class="m92_h_para">hotel:</td> <td valign="top" class="m92_h_name"> melia tropical <br> <img src="/images/star.gif" height=13 width=13 alt="*"><img src="/images/star.gif" height=13 width=13 alt="*"><img src="/images/star.gif" height=13 wid...

c# - How can I programmatically update log4net configuration file? -

i have log4net config in applications' app.config file, such: ... <section name="log4net" type="log4net.config.log4netconfigurationsectionhandler, log4net"/> </configsections> <log4net> <appender name="rollinglogfileappender" type="log4net.appender.rollingfileappender"> <file value="logs\service.log"/> <appendtofile value="true"/> <rollingstyle value="date"/> <datepattern value="yyyymmdd"/> <layout type="log4net.layout.patternlayout"> <conversionpattern value="%date [%thread] %-5level %logger - %message%newline"/> </layout> </appender> <appender name="consoleappender" type="log4net.appender.consoleappender"> <layout type="log4net.layout.patternlayout"> <conversionpattern value="%da...

java - Error creating SharedPreferences - couldn't create directory for SharedPreferences file -

i getting following error when trying create shared preferences file service: "couldn't create directory sharedpreferences file /dbdata/databases/dimappers.android.pub/shared_prefs/pubstore2.xml" i using samsung galaxy s i9000 test , have read else problems specific phone. however, swear working @ point in normal activity (though admittedly can't work more...) editor editor = getsharedpreferences(constants.savedataname, mode_private).edit(); editor.putstring(constants.savedataname, xmlstring); editor.commit(); if call string s = getsharedpreferences(constants.savedataname, mode_private).getstring(constants.savedataname, ""); immeditately after calling commit able it, if restart app isn't able find it. it appeared phone (samsung galaxy s i9000), worked (albeit still showing error) running same code on phone didn't show error message.

c# - Expression Encoder SDK - How to add audio track on a video -

i use on this. i'd overlay audio.mp3 file (or other format matter) onto video. i'm using free version of expression encoder 4, , video outputs wmv. thing is, don't know how add audio file video mediaitem. tried this, didn't add audio on result: mediaitem videotrack = new mediaitem(@"path\to\videofile.wmv"); videotrack.outputformat = new windowsmediaoutputformat(); videotrack.outputformat.videoprofile = new advancedvc1videoprofile(); mediaitem audiotrack = new mediaitem(@"path\to\audio.mp3"); videotrack.outputformat.audioprofile = audiotrack.sourceaudioprofile; job.mediaitems.add(videotrack); job.encode(); and when didn't work (perhaps because profile alone metadata, , not audio file itself), tried overlay audio way overlay image onto video, doing this: mediaitem videotrack = new mediaitem(@"path\to\videofile.wmv"); string overlayfilename = @"path\to\audio.mp3"; videotrack.overlayfilename = overlayfilename; job.medi...

selected - PHP Preselect check boxes from a String -

i have string $eventdays holds information regarding days selected. the format of data is: monday = mo tuesday = tu wedneday = thursday = th friday = fr saturday = sa sunday = su mo,tu,we,th,fr,sa,su so if example tuesday , friday selected, string be: tu,fr if monday, wednesday, , saturday selected be: mo,we,sa note: combination of days can selected. i wondering how information, , preselect checkboxes. checkboxes are: <input type="checkbox" name="days[]" value="mo" />monday<br /> <input type="checkbox" name="days[]" value="tu" />tuesday<br /> <input type="checkbox" name="days[]" value="we" />wednesday<br /> <input type="checkbox" name="days[]" value="th" />thursday<br /> <input type="checkbox" name="days[]" value="fr" />friday<br /> <input type="c...