Posts

php - Duplicating a mysql row with null variables -

I have a table with multiple columns I have a function that has an update in my new line Duplicated with auto-incremented ID. The function, however, on some of my INT columns, sometimes I have a tap as the default when the record is repeated, it changes my null placement to 0. I am assuming this because I am assuming "code". '' Can anyone help me how i value zero value ".null." I can include as and my other values ​​are ''. Value '. ' ? Edit I am having trouble in differentiating a null and a blank value. I have tried empty () and is_null () and with no value a varchar and INT is not showing a difference with a zero value Note : I understand that I am using an old MySQL extension. For now, I'm just trying to process my tap variable properly. Function DuplicateTorrent ($ table, $ id_field, $ id_value) {// Copy copy of the record you wish to clone $ unit = mysql_fetch_array (mysql_query ("Select * From {$ table}...

multithreading - Looping audio on separate thread in Java -

I'm making a 2D RPG game and I wanted to do background music work. I wrote a sound class that plays music on a different thread but I can not understand how to make a loop in my voice class: Package tile RPG.gfx; Import java.io.file; Import java.io.IOException; Import javax.sound.sampled.AudioFormat; Import javax.sound.sampled.AudioInputStream; Import javax.sound.sampled.Audio system; Import javax.sound.sampled.DataLine; Import javax.sound.sampled.LineUnavailableException; Import javax.sound.sampled.SourceDataLine; Public class sound tools runner {personal string file location = "res / bgMusic.wav"; Public Sound () {} Public Zero Games () {Thread T = New Thread (This); T.start (); } Public Zero Run () {playSound (fileLocation); } Private Zero place (string filename) {file sound file = new file (filename); Audioindstream audioInputTream = faucet; Try {audioInputStream = AudioSystem.getAudioInputStream (soundFile); } Hold (exception e) {e.printStackTrace (); } AudioF...

wordpress - Redirect example.com/uplaod/*/*/*.zip to example.com/down.php?file=*.zip -

उदाहरण के लिए .htaccess example.com/uplaod/2009/10/test.zip द्वारा कैसे redirect.text Php? File = test.zip यह काम है: विकल्प + अनुवर्ती लिंक पुनर्विन्यास इंजन पर पुनर्लेखन ^ uplaod /(.*)$ http://example.com/ Test.php? File = $ 1 [R = 301, L] लेकिन, मुझे केवल विशेष फ़ाइल एक्सटेंशन (ज़िप, 7z & amp; rar) को पुनर्निर्देशित करने की आवश्यकता है, और अन्य फ़ाइलों को रीडायरेक्ट नहीं किया जाएगा। इसके अलावा मुझे अपलोड के बाद अन्य फ़ोल्डर नाम को हटाने की जरूरत है (वर्ष और महीने), और केवल आउटपुट पर फ़ाइल नाम। आप इस नियम का उपयोग कर सकते हैं: विकल्प + अनुवर्ती लिपिक पुनर्लेखन इंजन पर पुनर्लेखन नियम ^ uplaod / [0- 9] {4} / [0-9] { 2} / (। +? \। (?: zip | 7z | rar)) $ /test.php?file=$1 [R = 301, L, NC]

bash - How can I split and re-join STDOUT from multiple processes? -

I am working on a pipeline that has some branch points that merge later - they do something like this Looks like: command2 / \ command1 command4 \ command3 each command writes STDOUT and accepts input through STDIN is. Command1 to STDOUT both command2 and command3, which are run sequentially , need to be passed, and their outputs are effectively communicated. Need to go and pass in Command 4. I initially thought that something like this would work: $ command1 | (Command2; Command3). Command4 This does not work, because only the STDOUT is sent to 4 commands from Command2, and when I remove Command4, it is clear that Command3 In other words, it seems that the command2 is tired or is consuming the stream - not passing the proper stream from Command1 -. I have the same result {command2; Command3; } In the middle then I thought I should use, and tried to do this: $ command1 | T & gt; (Command2). Command3 | Command4 But surprisingly it also does not work - it app...

java - How to use Eclipse to trace into functionality within a .jar file -

I've gone for almost a dozen tutorials on IDE, and so far, there is no luck, I'm hoping That somebody can shed some light here ... the solution to this problem should be relatively straight forward. I have provided .jar files from another party (included in the source code) Something Code I can set the system variable (sadly it is being done in the windblog) and execution can run depending on the functionality of the code, in which there is a problem with the command line Do not have the .jar file together. The problem is that I should be able to set Eclipse IDE. Hook files in .jar files so that I can repeat the command line functionality but trace it with IDE debugger I am So, the question is basically two times, 1) It is possible in eclipse (v.4.3) and 2) How to make a jar file in a project ' Hook 'can be done which just needs to execute the command line. Example of a command-line code working: C: \ Task \ tmp & gt; Set MY_DIR = C: / Ta...

Rename multiple files with bash for loop, mv, and sed -

My goal 'img_MM-DD-YY_XX.jpg' to rename the form of files folder 'newyears_YYYY' - MM-DD_XXX.jpg 'by using sed to substitute each file name again and based on character positions. Unfortunately I do not seem to be working on status-based swaps. For example s /. [4 \} [0-9] [0-9] / Trying to change MM with YY Here's my attempt (Ignore for _XX part): [0- 9] [0-9] / P> for file name in images * * new name = $ (echo $ filename | sed / s. {4 \} [0- 9] [0-9] /. \ {10 \} [0-9] [0-9] /; s /. \ {7 \} [0-9] [0-9] /. \ 4 \} [0-9] [0-9] /; s /. \ {10 \} [0-9] [0- 9] /. \ {7 \} [0-9] [0- 9] /; c / Yng_ / Nevyears_20 / ') mv $ filename $ Nunme Done Any ideas how can I fix this? $ echo 'img_11-22-14_XX.jpg' | Sed -r 's / [^ _] * _ ([0- 9] {2}) - ([0- 9] {2}) - ([0- 9] {2}) / NewIer_20 \ 3- \ 1- \ 2 / 'newyears_2014-11-22_XX.jpg Any sound above the thing and includes locates the first after the date of 6 points. It replaces the in...

touch - Handle single tap on LayerColors in Cocos2d-x 3.0 -

I have a LayerColor subclass called MyLayer. I have some examples of MyLayer in the scene, I want to tap each example And just want to do something for that example. I'm setting up touch handling like this: EventListenerTouchOneByOne * listener = EventListenerTouchOneByOne :: create (); Listener-> SetSwallowTouches (true); Audience & gt; OnTouchBegan = CC_CALLBACK_2 (MyLayer :: Touchback, this); Audience & gt; OnTouchEnded = CC_CALLBACK_2 (MyLayer :: touchEnded, this); Director: getInstance () - & gt; GetEventDispatcher () - & gt; addEventListenerWithSceneGraphPriority (listener, this); Then I handle touch with these methods: MyLayer :: touchBegan (touch * touch, event * event) {point touchpoint = It->; convertToNodeSpace (touch & gt; getLocation ()); This- & gt; Return the boundingbox () Point of view (touchpoints); } Zero MyLayer :: touchEnded (touch * touch, event * event) {} The problem is not correctly stated for touching it works...