Posts

Showing posts from August, 2013

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...

ios - Issue making method run at application launch -

I am working on developing an app which uses the camera for different purposes just now, when I apply Launch I am struggling to get a tidbit of code to run: UIImagePickerController * imageView = [[UIImagePickerController alloc] init]; ImageView.delegate = self; ImageView.sourceType = UIImagePickerControllerSourceTypeCamera; ImageView.showsCameraControls = No; [Self present ViewController: animated imageView: yes complete: zero]; I need to execute on the imageView UIView object on the launch, when this application is opened, it goes directly to UIImagePickerController is. Here's my code for the app: - (zero) viewDidoadload {[Super stuffed]; // Setup an additional after loading the view, usually from any nib } - (zero) did risive memorianising [[super dysrhymmy warning]; // Any resource settlement which can be reproduced. } - (zero) Application FeedbackActive {UIImagePickerController * imageView = [[UIImagePickerController alloc] init]; ImageView.delegate = self; Ima...

regex - Use JavaScript String replace function to remove a function in a string -

मेरे पास यह स्ट्रिंग है str = 'function1 (function2 (function3 (param1, param2) , परम 3), परफॉर्मेंस 2)) ' और मैं फ़ंक्शन 3 को निकालना चाहूंगा और इसे param1 द्वारा प्रतिस्थापित करना चाहूँगा मैं फ़ंक्शन 3 के आसपास और अधिक फ़ंक्शंस कर सकता हूं लेकिन मुझे इस फ़ंक्शन का नाम पता है और यह परिवर्तित नहीं होता है। अपेक्षित परिणाम function1 (function2 (param1, Paramfunction2)) जावास्क्रिप्ट में मैं str.replace (/ function3 [(] (। *),। *,। * []] /, '$ 1') और मुझे हमेशा मिलते हैं, मैं केवल फ़ंक्शन 3 को अलग नहीं कर सकता function1 (function2 (param1, param2 आपका सवाल जावास्क्रिप्ट-विशिष्ट नहीं है। आपको लालची के बजाय गैर-लालची परिमाण का उपयोग करना चाहिए । str.replace (/ function3 [(] (। *?), *।,। *? []] /, '$ 1') प्रश्न चिह्नों पर ध्यान दें।

format - Parsing timestamp with value and plot by gnuplot -

Image
मेरे पास ये data.txt है: [1384395497218,679], [138439 9 07, 218, 679], [1384402697218,679] ... [टाइमस्टैम्प, वैल्यू] सबसे पहले टाइमस्टैम्प 1384395497218 - & gt; 1384395497-218 - & gt; गुरु, 14 नवंबर 2013 02:18:17 GMT दूसरा कुछ की गिनती है मैं एक्स-अक्ष पर तारों को रेखांकित करना चाहता हूं और y- अक्ष पर गिनती करना चाहता हूं। मैं यह कैसे कर सकता हूं? उदाहरण: x-axis = "14 नवंबर" y-axis = "679" .. यह काफी अजीब इनपुट स्वरूप है यदि आप कर सकते हैं, तो आप को चुनना चाहिए जो बेहतर अनुकूल है। Gnuplot इसे नियंत्रित नहीं कर सकता है, आपको इसे कस्टमाइज़ करने से पहले अपने डेटा फ़ाइल को प्रीप्रोस करना होगा। ऐसा किया जा सकता है perl के साथ और नियमित अभिव्यक्ति निम्नानुसार है: यदि आपके पास डेटा फ़ाइल test.txt के मानों के साथ [1384395497218,679], [138439 9 7218,679], [1384402697218,679] और कमांड लाइन पर निम्न कॉल का उपयोग करें: perl -pe 's / \ [(\ d +) ([\ d] {3}), (\ d +) \],? / \ 1. \ 2 \ 3 \ n / g' test.txt आपको अपने डेटा के रूप ...

java - Android - How to parse this date [ 2014-04-23T14:20:00.000-07:00 ]? -

मैं इस दिनांक स्वरूप को परिवर्तित करना चाहता हूं: 2014-04-23T14: 20: 00.000-07: 00 एक तिथि ऑब्जेक्ट में इसलिए मैं अंतर पाने के लिए इस विधि का उपयोग कर सकता हूं: DateUtils.getDateDifference (DATE_OBJECT); ... मैंने 'सरलडेटफ़ॉर्मेट' का उपयोग करने की कोशिश की है लेकिन यह एक अपवाद फेंकता है, कोड को कई बार जांचता है, लेकिन काम नहीं करता: स्ट्रिंग पबडेट = "2014-04-23T14: 20: 00.000-07: 00"; सरलडेट फ़ार्मैट डीएफ = नया सरलडेटफ़ॉर्मैट ("ईईई, डीडी एमएमएम याय केके: एमएम: एसएस जेड", लोकेल.एएनजीएलआईएसएच); {Date pDate = df.parse (pubDate) का प्रयास करें; PubDate = "यह पोस्ट प्रकाशित की गई" + डेट्यूलेट्स। डेट डिफ्रेंस (पीडीटी); } पकड़ (ParseException ई) {Log.e ("DATE ​​PARSING", "त्रुटि पार्सिंग डेट .."); PubDate = "पुनः प्राप्त नहीं किया जा सका।"; } इसे सफलतापूर्वक प्राप्त करने का सबसे आसान तरीका क्या है? एंड्रॉइड प्रलेखन के अनुसार (@ मार्कोआसिएर्नो की टिप्पणी में दी गयी लिंक) आपको टाइम ज़ोन ऑफसेट को पार...

c# - Sharing code between client and server to remove dependency on each other -

I am developing a multiplayer game in C # and XNA that includes a client and server project. Most codes have been built within the Customer project (server side verification is still being done), so the server executable client should be in the same directory while running. The reason (not a big issue, but unusual for the application) is because the server ( GameName.Server ) has the context of the GameName.Client namespace, which is the second Is within the project I thought the rational idea code should be separated into 3 parts: Clients (specific code using the rendering and "shared" project) Shared / common code (formerly: message type, block type, entity class) Server (server sharing logic) P> Currently (and I Apoligize for the length of the question) My (simplified) layout is like this: a "???" One "????" Line Customer ??? Entities A â â ???? An "F" an "app", "app", "player c" is an in...

css - Vertically centered, absolute positioned element only displaying correctly in Chrome -

I am trying to put a vertical navigation section on my website, which is standing on the left side of the screen and in the center . I am also trying to make the height of the screen responsive. I did it by setting the font height in VH, it works fine in Chrome, but the whole element in IE and Firefox is at the top of the page. I'm a bit new to web design, any help would be appreciated! HTML & lt; Nav> & Lt; Ul & gt; & Lt; A href = # & gt; & Lt; Li & gt; Home & lt; / li & gt; & Lt; / A & gt; & Lt; A href = # & gt; & Lt; Li & gt; About & lt; / li & gt; & Lt; / A & gt; & Lt; A href = # & gt; & Lt; Li & gt; Work & lt; / li & gt; & Lt; / A & gt; & Lt; A href = # & gt; & Lt; Li & gt; Contact & lt; / li & gt; & Lt; / A & gt; & Lt; / Ul & gt; & Lt; / Neo & gt; css navigation {below: 0; Display: Table; Font-size: 7vh; ...

Elasticsearch sum total values for specific hours within a month -

I have an elastic search server with fields: timestamp , user and bytes_down (among others) I would like to complete a byte_down value for a user for one month but only where the hours from 8 am to 8 pm Yes, I am able to get a daily sum with the date histogram along with the following query (I used the Perl API here I do not know one way to reduce it to the hour limit for every day. my $ query = {index = & gt; 'Cm', body = & gt; {Query = & gt; {Filtered = & gt; {Query = & gt; {Word = & gt; {User = & gt; $ User}}, filter = & gt; {And = & gt; [{Border = & gt; {Timestamp = & gt; {Gte = & gt; '2014-01-01', lte = & gt; '2014-01-31'}}}, {bool = & gt; {Should> & gt; {Word = & gt; {Zone = & gt; $ Zone}}}}}}}}, aspect => {Bytes_down = & gt; {Date_histogram = & gt; {Field = & gt; 'Timestamp', interval = & gt; 'Day', value_field = & gt; 'Downstr...

c# - Calculating coordinates in circle -

Image
My problem is basically to calculate the X and Y coordinates of the second element in the following situation. For Unity 3D in a Device, using C # Suppose the box size is the length of the object "LAN" (it would be really good to know what is happening, I fully understand I can not say.) And say That you have an angle of θ. I'm assuming that the center of the board coordinates (0,0). Then vertical distance from the center of the circle to the edge of that circle where the box touches y = taking * sin (θ) and for the horizontal distance, the lan * cos (¸¸¸). If you are going 2/5 to the box path, then you will use Lennon / 5 instead of lane. It's just math behind it in C # you want to use mathematical orbit. In this, all the functions you need are careful with radians and degrees

How to change the Control+Space autocomplete shortcut keys in Eclipse for Android -

Image
When I am in an Android XML file (for an activity menu, for example) Code> Android: Then the freezomblet came and I can choose one. However, if I have something like this then with my cursor inside the quotation marks, then I will have an auto- The option inside the quotation does not meet the complete quote I've heard that control + space should do this, but control on my computer is used to switch to the + space language input method. Is there any way in Eclipse to replace this shortcut key is? To change your keyboard shortcut: General Key From there you can filter the " Content Help " to search the list and specify the value you want.

eclipse - Regex to match word only in quotes -

I am trying to create a regex for a word match in quotes. If the text is as follows, I want to match the HelloWorld inside quotation marks, but not in the quotes (other than the HelloWald Example should match, but should not be the first one) HelloWald Showing "HelloWald" Use Case: I need to search for quotation marks in the search HelloWorld , but other HelloWorld examples Need to use as the name of Eriabl name or class when I discovered that my Eclipse IDE by Regex. You can use the following. 'HelloWald is showing HelloWald' Match (/"(..//)"+/ g); // ["" HelloWald Showing ""]

Perl inheritance same instance -

I am trying to create a small application with base module 'apps' and see "shared" in all modules "And as" Request "all the data and methods in the" Share "module will be available for all other modules, which are the extension code (example, see, request, app) below the example example code examples. App.cgi #! Use / usr / bin / perl mousse; Use the app; My $ app = Apps-> new; message (); # Export, works fine $ app- & gt; msg (); # Works fine as my $ view = $ app- & gt; View; $ View-> msg; # Scene class method, works fine print $ app- & gt; Charset "\ N"; # From Shared.pm, utf8 prints, default $ app- & gt; Charset ("windows-1256"); $ XP in shared PM print in windows-1256 from #Utf8- & gt; Charset "\ N"; #It's okay now, the window prints - 1256 print $ view- & gt; Charset "\ N"; # It's not okay, the same default utf8 exit; Apps.pm package application; ...

ember.js - Manual Ember computed property not working while helper properties do -

I have the following controllers with many mathematical properties, most of whom use auxiliary functions all referred to in the template Work flawlessly However, the two values ​​computed manually fail, if I add them to my template because those properties which are undefined when the reference is first run. I get the Unkot Type error: property 'length' can not be read from numeral.js 'undefined' because if this is the wrong way with the way I created it? Are the calculations properties built with helpers working properly while referencing the exact same model data? AdvisorAdvanced Controller = Ember.ArrayController.extend Open: Ember.computed.filterBy "Model", "Status", "Open" Pending: Ember.computed.filterBy "Model", "Status" , "Pending" OpenWells: Amber computed.mapbay "Open", "value" pending value: amber dot coop.map "pending", "value" opencount: ember.comput...

How to Get returned value from php in PHP -

I am using two files in php to make a function call and the second one processes and returns the Jason object Does. My question is, How to get back the value from PHP I File 1 calling function - $ realtimestats Obj = new realities (); $ Realities oz - & gt; GetDetails ($ IMEI, $ Conn); Buzz $ realtimestats oz; File 2 return value - $ response = json_encode ($ realtimestats); $ Refund; Return some values ​​to 2 files here. How to obtain return value and use that value in file 1 Find the result in a variable and echo: $ result = $ realtimestats obj-> GetDetails ($ imei, $ con); var_dump ($ result);

node.js - express - nodejs - Keep URL if in a subdomain instead of redirecting -

My current set is such that http://test.com/project indicates something Original index view. Use it, I am sure that http://mysubdomain.test.com redirects to the above URL. This is OK , but ideally I like that the subdomain remains in tact. I have not found any way to redirect URL, keeping the same. Redirect means to go to another URL. There is no way to keep the original URL, the only way to keep it is to map the subdomain to the same path or to use the parameter / reggae in the subdomain name. Express allows it completely: app.get ('/: subdomain.test.com/' or app.get (regesx (...)) In this way your call says that such callback Redirection is not called in your code and you serve all subdomains. Or, use it

Routes in Rails 4 -

I want to put a question about routing in rail. The 'user' model with roles is: user.restaurant_owner? And user.shop_owner ?. Besides the user is the only admin, besides there is a super user (this is me). I want the user input 'http://somesite.com/his_name' to be processed according to their role and name on the requesting 'restaurant' or 'shops'. For example, she looks "with" and "the", because 'Stanley' restaurant owner '5' with ID; If he sees the "and he", because 'Marilin is the shop owner with' 101 'id. I want to do this, because I want to show user friendly url, but my system is very big and There are 10 categories (restaurants, cafes, shops, etc.). There are different layouts and actions for the admin panel in each category Please, give me some suggestions, thank you. Update: The owner can see only in his place, with the model 'owner_id', model restaurants, shops etc. ...

c# - How to manage behindcode buttonclick event by jquery button? -

मेरे पास दो बटन हैं: & lt; center & gt; & lt; p & gt; & lt; बटन id = "newuserbutton" & gt; नया उपयोगकर्ता बनाएं & lt; / button & gt; & Lt; p & gt; & lt; बटन आईडी = "edituserbutton" & gt; उपयोगकर्ता संपादित करें & lt; / button & gt; & Lt; / केंद्र & gt; इनमें से किसी भी बटन को क्लिक करने से jQuery के फ़ंक्शन का उपयोग करके पॉपअप डायलॉग पर 'form1' खुलता है: & lt; script type = "text / javascript" & gt; // पर डोम तैयार (यह आपके $ (दस्तावेज़) के बराबर है .ready (फ़ंक्शन () {...}) $ (फ़ंक्शन () {// प्रारंभ करें मोडल (केवल एक बार) # div1 $ ('# div1' क्लिक करें (फ़ंक्शन () {$ ('# div1') // क्लिक करें। बटन सेट करें। Dialog ("विकल्प", "बटन", [{पाठ: "उपयोगकर्ता बनाएं", क्लिक करें: फ़ंक्शन () {$ (this) .dialog ("");}}, {text: "रद्द करें" क्लिक करें : Function () {$ (this) .dialog ("close")}}}]) // सेट ...

Voltdb Partitioning -

आइये कि मेरे पास टेबल है id col1 col2 col3 1 एबीसी डीईएफ एक्सवाईजेड 2 XXX YYY ZZZ अधिकांश अक्सर प्रश्नों को एक्सवाईजेड से SELECT * होने वाला है जहां x1Z से col1 = 'abc' और col2 = 'def' SELECT * जहां col1 = 'abc' और वोल्टडीबी डॉक्स के अनुसार: - विभाजन को स्तंभ पर किया जाना चाहिए जिस पर अधिकतर एक कॉलम पर विभाजन करना चाहिए मुझे कोई उदाहरण नहीं मिल सका जहां कई स्तंभों पर खोज की जाती है मुझे आश्चर्य है कि बहु स्तंभ खोजों के लिए विभाजन तालिका का सबसे अच्छा तरीका क्या है? संपादित करें: - या यदि मेरी क्वेरी की तरह हो तो: - SELECT * से XYZ जहां col1 IN ('abc', .. ।, ...) और col2 IN ('def', ...) और col3 IN ('xyz', ...)। एक स्तंभ चुनने के लिए दिशानिर्देश: सबसे पहले, आपको एक विभाजन कॉलम चुनना चाहिए जिसमें कई भिन्न मान हैं उदाहरण के लिए, यदि आपके पास दो से अधिक विभाजन (सामान्य) हैं, तो नर / महिला स्तंभ विभाजन को खराब करना। यह अन्य मूल्यों पर हावी होने वाले कुछ मूल्यों के साथ एक स्तंभ को चुनना भी एक बुरा विच...

where to save images in iOS app -

My app user will have a list of items, each item will have a thumbnail, thumbnails will be downloaded from the net, so I I want to save images in the app directory, so that the app does not download the thumbnails every time, I am now saving images in the NSLibraryDirectory , and there are several directories available, such as NSDocumentDirectory, NSApplicationSupportDirectory. . those images will be downloaded, if They do not exist in NSLibraryDirectory. My question is, what directory is the right place to save these thumbnails images so that the user did not download the image every time before I used the code but I have read that he was supported by iCloud And Apple can reject that app. Therefore, I have changed to NSLibraryDirectory and everything is working fine. Is it OK to do this? There is no better way to store images like this. Thank you. Here's everything about: I like to store the thumbnails in the temporary directory which the system automatically g...

css - How to reduce the spacing between rows designing with bootstrap -

itemprop = "text"> I am using the bootstrap grid system, I have to reduce the space between rows, the space between rows is very much Please help me, how can I reduce it. Thank you .. & lt; Div class = "row" & gt; & Lt; div class = "col-md-6" & gt; & Lt; h1 id = "heading" & gt; Heading & lt; / H1> & Lt; Div class = "line" style = "margin-left: 6px;" & Gt; & Lt; Div class = "col-md-12" & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-md-12" & gt; & Lt; div id = "rect" & gt; & Lt; span id = "title" style = "margin-left: 15px; font-weight: bold; font-size: 18pt; color: # 2373B3;" & Gt; Span & lt; / Span & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "col-m...

c# - Using jquery ajax, how do you post an object containing a list other objects -

इन सी # ऑब्जेक्ट्स को देखते हुए class foo {int fooId {get; सेट;} स्ट्रिंग fooName {get; set;} सूची & lt; बार & gt; सलाखों {प्राप्त करें; सेट;}} वर्ग बार {int barId {get; सेट;} स्ट्रिंग बारनाम {get; set;}} और एक वेबएपी विधि [एचटीटीपी पोस्ट] सार्वजनिक एचटीटीपी प्रेषक संदेश AddFooBar (foo मॉडल) {// ...} यह मानते हुए कि हमारे पास एक ऐसा फ़ॉर्म है जहां एक उपयोगकर्ता फ़ूनाम और बार आइटम की सूची में प्रवेश करता है, तो फॉर्म से डेटा को सीरियल करने और वेबएपी को सबमिट करने का सबसे अच्छा तरीका क्या है विधि मैं दृढ़ता से केवल के साथ एक गूंगा दृश्य बनाने की सलाह देता हूं। & Lt; फ़ॉर्म आईडी = "एफ" & gt; @ Html.TextBoxFor (एक्स = & gt; x.foo); @for (var i = 0; i & lt; Model.foo.bars.Length; i ++) {@ Html.TextBoxFor (x = & gt; x.foo.bars [i]);; } & Lt; / form & gt; $ (दस्तावेज़) .ready (फ़ंक्शन () {console.log ($ ('# f')। serialize ());}); तो आप उम्मीद की संरचना देख सकते हैं फिर आप अपने JSON को कैसे भर सकते हैं

creating a Yii calculator -

Image
I'm new to Yii and MVC, and I'm still trying to extract things. I'm trying to make a calculator in Yii, below is my file directory for my calculator module. DefaultController.php Default Controller Controller {Enhances Public Functions () {Return Array ('Page' => Array ('Square' => Seavuction);) Public Function Action Index () {$ this-> Render ('index');} Public Function Execution Collector () {/ * Credit calculation goes here ?? And my Calculator module.php and setImport (array ('calculator. Models. *', 'Calculator.com. *', ')); $ Model = new calculatorform ();} before public event Controller action ($ controller, $ number Or) {if (parent :: Before the controller action ($ controller, $ action)) {// this method is to perform a module controller is called before / / You can customized code. ; } And false return; }} This is my loan-calculator. Php true, 'client option' = & Gt; ar...

From JSON to XML and back in Java -

Changing XML to JSON is quite straight forward. XML attributes are created as string values ​​and XML elements JSON objects are created. Naming Connection is strictly for XML from JSON. The way back is more complicated if it is working in Java, then there is a way to firmly convert formats? When you make a bean, two libraries make your life easier: For JSON For XML Use the official format conversion between Bean JSON and XML using this example as a simple reference Do: Import java.io.biteArrayOutputStream; Import java.io.file; Import java.io.FileInputStream; Import java.io.FileOutputStream; Import java.io.IOException; Import java.io.InputStream; Import java.io.InputStreamReader; Import java.io.OutputStream; Import java.io.printWriter; Import javax.xml.bind.JAXBContext; Import javax.xml.bind.Marshaller; Import javax.xml.bind.Unmarshaller; Import javax.xml.bind.annotation.XmlRootElement; Import com.google.gson.son; Import com.google.gson.Gsonbuilder; @ XMLRealElement ...

c++ - How can/should I create automatic link between ui forms and data members in Qt? -

This is a common problem, I do not know how it is handled normally and I want to good (???) The way to do it: I have several types of UI with many programs. I have some structures using data provided by UI. I need to synchronize the form and data clearly. Right now I do this manually and I type this type of function: option fetches data from GetOptions () {// UI and stores it in my composition options. Fil.alpha = ui.fil_consecutive_alpha - & gt; value (); Options.fil.beta = ui.fil_consecutive_beta- & gt; Values ​​(); Options.fil.gamma = ui.fil_consecutive_gamma- & gt; Values ​​(); Options.fil.delta = ui.fil_consecutive_delta-> Values ​​(); Options.fil.k_max = ui.fil_consecutive_k_max- & gt; Values ​​(); Options.fil.radius = ui.fil_consecutive_radius-> Values ​​(); Options.fil.omega = ui.fil_consecutive_omega-> Values ​​(); Options.fil.side_length = ui.fil_consecutive_side_length- & gt; Values ​​(); Options.fil.norm = ui.fil_consecutive_norm- ...

JQuery Drag Column to a new Table and add to Row at specific position -

I have found more than one table and I want to be able to drag my column from one table to the column The current status should be added to the line I now have to do the following work: gt; & lt; / script & gt; it works, but it always end of the line Adds column (top right) The reason I want to do this now is that if there are 2 columns in the droppable table, I can also keep my drawing columns between those 2 columns. Any ideas how I manage it Can I do? By using the "first" and "after" function and adding the pure HTML code It has solved. Something like this: I'm wondering why I can not find any answer ....

openerp - How do I access a model's attribute from inside of the model's function -

I want to use the attribute of a model from within a function. Take a look at line (Lennon (self.order_line)> 0): How do I do this correctly? Because the above mentioned code does not work. The purpose of this function field is to read and modify the other attributes of the same model which is order_line . Therefore, it acts as a bridge to simplify the UI, the user needs to specify a property unit to represent only order_line so that I get from the function order_line Requires reaching . And I want to set the order_line value based on property_unit_rel sales.order before the value How can I do that _property_unit_inv function? Total code: from osv import osv, field class custom_sale_order (osv.osv): _name = "sale.order" _inherit = 'sale.order' def _property_unit_read (Self, CR, UID, IID, Property_init_Rail, AGR, context): If (Lane (order orderline)> 0): Second pass: return any def_property_unit_inv (self, CR, UID, IID, property_ent_l...

php - Tokenize string and know which part of delimiter grabbed -

I want to tokenize the functioning of PHP with a strtok () and it Want to know that the part of the delimiter caught the current token? So here's an example: Some of my comments: one, two, three if I use now : $ token = strtok ($ string, '#:,'. PHP_EOL); I get my comment as the first code because # and new line it was token Was there. So what is the probability of getting the starting and interval of the current token now? If you're looking for a way to include the delimiter again because they have something The special syntax is - you should use syntax tools to not separate your delimiter because it is not intended for this function. Instead you can try to use it: $ string = '#my comment something: one, two three'; // Note that & lt ;? Php is required to parse the PHP syntax: $ result = token_get_all ('& lt ;? php'. $ String); - This will parse the syntax and dividing lexam into the resulting array (so t...

php - run python script from phpstorm -

I have a php project that I am working on using PhpStorm. I have a python script that connects my CSS file in a certain way before uploading it to the server (this is irrelevant to the question, but if you are curious, mostly related to language support). I would love to be able to run it directly from phpstorm, but I'm sure how to do it (I think it is possible but I could not find any reference to anything, and I New to this IDE) I know that I can rewrite the script with PHP, but I'm rather (I'm still a dragon in the heart). Did anyone have to deal with this like this? Thanks in advance! PS If that matters, then I am running Ubuntu for this Use the File Monitorer plugin (must be bundled after v7 by default) - This type of script will automatically be run on every modified files to save automatically. Alternatively, you can use the external device functionality and desired when calling it manually.

security - Redirecting php post reply to client -

I have a webpage that allows the customer to enter some data. When the user submits the form, then my PHP script in the server now adds some other parameters that I do not want the client to be able to view and post their server B payment system. What I want to do should be seen in some other such question: customer - & gt; Server One Server A - & gt; Post - & gt; Server b client & lt; ------------------------ Server B for Server B, no session or nothing should be done To do this, it takes users directly to a form where they will set up their payment data How can I achieve this? Is there any alternative? Thank you very much. Whatever you are trying to do is not possible. Server B has no knowledge of the client, so there is no way to communicate with it. You should make it this way: Customer - & gt; Server One Server A - & gt; Post - & gt; Server B server A & lt; - Reply - Server B Client & lt; - Server A In (pseudo) code, on se...

Name of a document which provides information about the database logical design? -

I was looking around for a while but any authoritative name (not even an informal) is a document that is database Summarizes all the tables in the structures, which includes a brief description of the purpose of this field within field names and tables. Is such a document really an official or commonly used name? I help to understand the current database design of a company, while designing the new one, and creating a new database for the company to help others understand the design of the database. If such a document has an official name, I can get a definite document to ensure that I meet the requirements for it and may be more informative / professional. The document is formally called. A platform-specific example is the Data Description Specification (DDS) which allows the developer to describe the data attributes in the file description, which is the IBM System

JQuery numbers of cell, calculate sum in PHP -

I am trying to send the number of each cell, and I calculate the sum in php. Then show results in the text input but it does not work. How can I do this? This is my php code: & lt ;? Php if (isset ($ _POST ['keep'])) {$ sum1 = $ _POST ['sum1']; $ Sum2 = $ _POST ['sum2']; $ Sum3 = $ _POST ['sum3']; $ Resultado = $ sum1 + $ sum2 + $ sum3; Echo "Resultado:". '& Lt; Input type = "text" name = "resultado" value = "'. $ Resultado.'" & Gt; '; }? & Gt; Thank you in advance I looked at your full code quickly and it appears that the form tags are unavailable. You need to include your code in the middle of the form tag. Which will execute a script & lt; Form action = "yourphpfile" method = "post" & gt; & Lt; / Form & gt; If you do not want to load a new page, then you need to use Ajax which is a bit more complex. More information abou...

jsf 2.2 - JSF 2.2: request-param in navigation-rule not found -

I have face-config.xml that has many navigation rules but I am not able to get a redirect - my page But the ultimate I have searched a lot about this issue but I have not received any help. detail.xhtml: & lt; P: command link action = "# {bean.delete ()}" & gt; & Lt; F: setPropertyActionListener target = "# {bean.deletionSuccess}" value = "true" /> & Lt; P: Confirmation header = "Confirmation" message = "Are you sure?" & Lt; / P: commandLink & gt; faces-config.xml: & lt; Navigation-Rules & gt; & Lt; Se-view-id & gt; /myDetailPage.xhtml< / To-view-id & gt; & Lt; Navigation-case & gt; & Lt; From-result & gt; From-result & gt; DeletionSuccess & LT; & Lt; Two-View-ID & gt; /myOverviewPage.xhtml< / To-view-id & gt; & Lt; Redirect / & gt; & Lt; / Navigation-case & gt; & Lt; / Navigation rules & gt; Java-Bean: ...

HTML Entity for new line not working in IE10 -

शीर्षक के रूप में मैं कोशिश कर रहा हूं & amp; # 013; & Amp; # 010; एक बटन पाठ में नई लाइनों के लिए, लेकिन IE10 में यह नहीं दिखता, मैं मोड को IE9 में बदल सकता हूँ और यह दिखाता है विडंबना यह देखने के स्रोत में भी दिखाया गया है कि यह प्रदर्शन में ठीक ही नहीं दिखाया गया है। कोई भी विचार मुझे 2 घंटों तक कोई समाधान नहीं मिल सकता है): यह निम्नलिखित मार्कअप का उपयोग कर एक asp.net बटन है & lt; asp: बटन आईडी = " ImgViewQuoteDocument "runat =" server "text =" देखें उद्धरण और amp; # 010; दस्तावेज़ "टूलटिप =" उद्धरण चिह्न देखें "OnClientClick =" वापसी confirm_close (); " / & Gt; यह IE10 को छोड़कर सभी ब्राउज़रों में सही ढंग से अनुवाद करता है, जो इकाई संदर्भ को निकाल देता है, लेकिन एक नई पंक्ति डालने के बजाय बस संदर्भ को बटन पाठ छोड़कर संदर्भ को निकाल देता है "देखें उद्धरण चिह्न " के बजाय " बहुत उद्धरण - दस्तावेज़ " ps आपको जवाब देने के लिए उदाहरणों की आवश्यकता नहीं है कि क्यों आईई 10 एचटीएम...

android - How to map the touch screen event to virtual key event(eg: back, home, menu)? -

Environment: Android platform; Perhaps you know that the command of "getevent" can output events from "/ dev / input / eventX" Some devices have virtual keys such as backs, menus, home etc., and these keys are also applied through the touch screen. So how do I map the touch screen event to the right key event in the virtual key area (back-> Back, Home-> Home, Menu-> Menu etc.) back: override @ backed (public) at zero { // content} / html>

java - Phonegap Cordova Delete File (android) -

hello .. I'm new in the phone .. I Android There was a problem deleting the file in PhoneGrap 3.4 console.log (photo); window.requestFileSystem (FileSystem.root.getFile {photoSystem.root.getFile (file, {create: false}, function gotFileEntry (fileEntry) {fileEntry.remove ();}, onError);} at window.requestFileSystem (LocalFileSystem.PERSISTENT, 0, , OnError); log result 04-24 16: 29: 54.234: i / web console (16213): file: /// storage / sdcard0 / DCIM / camera / 1398331773136.jpg 04-24 16: 49: 01.989: W / Systems. Er (18864): org.apache.cordova.file.EncodingException: There is an invalid ":" in this path. 04-24 16: 49: 01.994: W / System.ARR (18864): at org.apache.cordova.file.LocalFilesystem.getFileFolLocalURL (localfilysystem.jewai -59) 04-24 16: 49: 01.994: W / Systems. Er (18864): at org.apache.cordova.file.FileUtils.getFile (FileUtils.java:698) 04-24 16:49: 03.664: I / Web Console (18864): 5 After searching, I found this (error code and list of...

sql - The Quantity of things in one table -

मेरे पास दो अलग-अलग टेबल हैं कुत्तों (आईडी, नाम) dogs_pref (id_dog, वरीयता (केवल एक)) प्राथमिकताएं (एक कुत्ते में 0, 1, 2 प्राथमिकताएं हो सकती हैं यह कार्य दो अलग-अलग अनुरोधों का निर्माण कर रहा है 1: अनुरोध जो कुत्तों को वरीयताओं से दिखाता है (एक या दो से अधिक) 2: बनाएं 1: SELECT dogs.Name, dogs_pref.id_dog, dogs_pref.preference। कुत्ते को छोड़ने से कुत्ते को छोड़ दें dogs_pref ON dogs.Id = Dogs_pref.id_dog जहां dogs_pref.preference> gt; = 1 ORDER द्वारा dogs.Id; 2: यहां सबसे बड़ा सवाल है कि इसे कैसे सरल तरीके से लिखना है ???? चुनें dogs.id, sum (to_number (dogs_pref.preference)) कुत्तों से छोड़ें dogs_pref ON dogs.Id = dog_pref.id_dog समूह dogs.id द्वारा ;

php - Can I use PDO::FETCH_GROUP to group results by two values -

I am using PHP and PDO to recover a set of values ​​from a database and then from the first column to the group Code with this: $ result = $ sth- & gt; Get All (PDO :: FETCH_GROUP | PDO :: FETCH_NUM); This means that if my data is in this format: | Column1. Column2. Column 3 | 1 | 2 | One | | 1 | 2 | B It comes back in this form: 1: {[column2: 2, column3: a], [Column 2: 2, Column 3: B]} How do I group the columns by column 1 and column 2, so I get something: 1: {2: { Column3: a, Column3: b}} Is it possible to do this with a combination of PDO constants? Thank you As you've seen, it's easy to easily arrange an array Grouping with code with PDO :: FETCH_GROUP can be easy. What needs to be done is to convert the 2-dimension array into a 3-dimensional array, but it is not possible to rebuild it this way. You need this to manually do it manually through the nested loop, such as: // Assume that the result of $ is: $ Result = [[1, 2, 'a...

jQuery have variable containing mulitple variables -

I have a list of variables, which is getting out of hand I was thinking That i can var content id = $ (cr) .fund ("content idid"). Text () var status = $ (cur) .find ("status"). Text () var title = $ (cur) .find ("title"). Text () var description = $ (cur) .find ("description") text () var coverUrl = $ (cur) .find ("coverUrl"). Standard JavaScript data structures (group of named data); var myThing = {foo: "Some Value", Bar: "Some Other Values"}; MyThing.baz = "yet another value"; Warning (myThing.foo); Warning (myThing ["bar"]); Var key = "baz"; Warning (myThing [key]);

openlayers - Use layers group on map box js -

I am learning JavaScript and started walking with example mapbox.js: And it did my But what I am trying to do is add line and marker with one click. How can I define, and use a group? I have received an email from the superb staff in the MapBox, and I change my code and use the group Was able to // variables var map = L.mapbox.map ('map', 'lucamoiana.i2f5jfg2'). SetView ([45.642, 8.954], 14); Var ristori = L.mapbox.featureLayer ('lucamoiana.i09fgicl'); Var Corpo = L. Mapbox. Tile layer ('Lukamonaa i 057 npjm'); Var corto_ristoro = L.mapbox.featureLayer ('lucamoiana.i057npjm'); Var medio = L.mapbox.tileLayer ('lucamoiana.i0588kkf'); Var medio_ristoro = L.mapbox.featureLayer ('lucamoiana.i0588kkf'); Var Lungo = L. Mapbox. Tile layer ('Lukamonaa i 058E92L'); Var lungo_ristoro = L.mapbox.featureLayer ('lucamoiana.i058i92l'); Var parachage = l.mapbox. FeatureLayer ('Lukamona. II 2F 34 PN3'); // A...

ios - Deep copy UIView subviews to one UIView -

I need to remove all Nested SubViews (from multiple views) and they have a UIView level 1 level deep. NSArray * contentViews; // Ideas with complex nesting of subViews UIView * flatView; // All SubViews but as a parent's simple subtitle [Self Deep Copy All Proof: [ContentViews [i ++] SubViews for New View]: Flat View]; My problem is how can I get the right origin in relation to flatView? AllSubviews: (NSArray *) SubViews NewView: flatView {[SubViews Enumerated Objects Using Block: ^ (ID OGJ, NSUnitezer IDX, Ball * Stop) {CGRact frame = [ (UIUU * OBG frame); Frame.origin.x = ?? [(UIView *) Oz set frame: frame]; [Flatview Aidview: OBG]; NSArray * subs = [(UIView *) OBG SubViews;; [Subs count]> 0} [[Successful deep comment all sessions: subs newView: flatview];}}];} You UIView . For example, try your ??? line, try: frame.corin = [((UIView * obj). Convert superview: frame. FlatView]; If the original view is still connected to its original supervision, and th...

ibm mobilefirst - IBM Worklight - How to Launch android emulator? -

Image
I have created an IBM Vertical Project and added an Android environment when I right-click on the Android folder and select Run A and I "Run in App" is not found. In addition, when I run as an Android Studio project, I get an error: Failed to run Android Studio: Window - Location of Android Studio Specify- gt; & Gt; Priority- & gt; Varklite If you have not done so clearly Will not work for you Verify that you have properly installed Android Studio. Also make sure that you right-click on the Generated Android project, you will see the option "Android Application" under Run Ent Entry. Also make sure that you have created an AVD (Android virtual device == emulator ...) for the first time. .

Force Visual Studio 2012 to use old C# compiler -

I recently found that (because only) installing Visual Studio 2012 on my machine, Visual Studio 2010 causes the new C # to be used. Compiler It also happens when setting the language version for 4 (). I want to know if it is possible to force the old sticker to use the old compiler, I think it is not possible because it seems that the compiler is installed in the framework of the framework which is NET 4 and .NET 4.5 are similar, but I was thinking that someone has managed to do it in any way. You can see the use of the command line compiler, and post your code on the old compiler in post build jobs. Can run

c# - GRID.mvc issue in changing language [ASP.net MVC 4] -

I am using in my project and I want to change the grid language. To do this I have made and Gridmvc.lang.fr.js file for my language: / *** * Grid.Mvc French language (fr -fr) http://gridmvc.codeplex.com/ * / window.GridMvc = window.GridMvc || {}; Window.GridMvc.lang = window.GridMvc.lang || {}; GridMvc.lang.fr = {filterTypeLabel: "Type:", FilterValueLabel: "Valeur:", applyFilterButtonText: "Applique", Filter Select Type: {equal: "agell", start: "command equals", includes: " "Fountain", "Finee Sam", Greateran: "Plus Queen", Cmthan: "Moin Kiey"}, code: 'fr', bulltru label: "wry", booleous labels: "foed", clear filter label: Wide "}; Then in my opinion I made it: @ html.grid (model). Named ("offresGrid"). Columns (Columns = & gt; {Columns.Add (item = & gt; item.REGION.NOM) .Filreable (true) .Tantable (true); ...}) with paging (20)...

not able to split string using regex in groovy -

Using iam, the following code is not able to split the string using regex string [] splitedEmail = email.split (/ \\ n \; \, \ s /); is giving it the same You probably want To wrap it in a square class, [] : string [] splitedEmail = email.split (/ [\ n ;, \s] /)