Posts

Showing posts from May, 2013

Accept Multiple inputs with php to update a mysql database -

I am working on a small project: a small number crunching game. I want a php file that can accept input and interpret them in specified database updates. Even so far I have this. This is not working for me. $ name = $ _GET ['n']; $ Action = $ _GET ['A']; $ Result = mysql_query ("Select * from players, where username = '". $ Name "."');); While ($ line = mysql_fetch_array ($ result)) {if ($ action = "rankup") mysql_query ("Update player set level 'level + 1' where username = '". $. "". "" "); } Mysql_close ($ con); I have not found any errors, but it is not working, and all database connections are fine. I do not know what the problem is. Here are many mistakes: You do not have to do your input About, please read You are not checking the output of your mysql_query . The query with the SET level 'level + 1' is invalid, you forgot = and delete the quo...

- Where Developers Learn, Share, & Build Careers

I can not seem to work with my SSSD element in my wsdl using PHP Sorchers. According to everything I have read and see how some other companies implement "loose type" wsdls should be enough to obtain and send record information. & lt; Complex type name = "record" & gt; & Lt; Sequence & gt; & Lt; Any name space = "## target namespace" minOccurs = "0" maxOccurs = "unbounded" process = "loose" /> & Lt; / Sequence & gt; & Lt; / ComplexType & gt; Unfortunately, it seems that the PHP Sopers class removes those elements which are not strictly defined. What I found is Request Records on Records Records and sends blank records to the reclamation / filter requests, although fields are clearly present before handling the SOAP server. If I specifically define those fields that are lost in this way .. & lt; Complex type name = "record" & gt; & Lt; Sequence & gt...

python - multiprocessing: variable being referenced before assignment in some cases but not others -

I found the following example on this site somewhere: import multi import ctypes import numpy NP shared_array_base = multiprocessing.Array (ctypes.c_double, built 10 * 10) shared_array = np.ctypeslib.as_array (shared_array_base.get_obj ()) shared_array = shared_array.reshape (10, 10) as # not copy loud shared_array.base Was there. Based shared_array_base.get_obj () # parallel processing def My_func (I, Def_param = Shared_array): Shared_array [i] = i if __name__ == '__main__': pool = multiprocessing.Pool (procedures = 4) pool.map ( my_func, (10)) print shared_array the above code works fine, but I want to add an array of shared array, some (like shared_array + = some_other_array Instead of shared_array [i,;] = i) i local variables referred to before 'shared_array' assignment Any reason is reason that I Can not? is that a variable is assigned anywhere in a function, it is regarded as a local variable Is shared_array + = some_other_array equals shared...

iphone - Hide IOS keyboard with multiple textFields -

मेरे पास 2 textFields किनारे, countryCodeTextField और cellphoneTextField countryCodeTextField पर है I मेरे पास एक एक्शन चयन है देश पर संपादित किया गया था संपादित करें देश - (IBAction) का चयन करेंदेश: (आईडी) प्रेषक {countryCodeTextField.delegate = self; [CountryCodeTextField इस्तीफा फर्स्ट रेस्पॉन्डर]; ध्यान दें कि स्वयं & lt; UITextFieldDelegate & gt; को लागू करता है। समस्या तब होती है जब उपयोगकर्ता क्लिक के सेलफोन कुंजीपटल यदि वह देश पर क्लिक करता है तो कोडटिफफ़िल्ड कुंजीपटल कभी भी खारिज नहीं होता है। यदि व्यक्ति देश पर क्लिक करता है तो पहले कुंजीपटल कभी नहीं दिखाई देता है (जो कि मैं चाहता हूं)। उपयोगकर्ता कुंजीपटल टेस्टफिल्ड को पहली बार और फिर देशकोड टेक्स्टफ़िल्ड पर क्लिक करते समय क्यों नहीं छुपाया जाता है? यदि आप उपयोगकर्ता को किसी विशेष यूआईटीफ़िक्फिल्ड को संपादित करने में सक्षम होने के लिए नहीं चाहते हैं, तो इसे सक्षम न करें। UITextField * textField = ... // किसी तरह पाठ क्षेत्र को आवंटित किया गया है। सक्षम = कोई या बस इंटरफ़ेस बिल्डर में...

xcode - IOS: How to detect make/model of paired Bluetooth 3.0 device? -

The IOS noob question is here, though I hope that it is not a repetition of iOS 4+ targeting to develop on XCode 4.3 I I am struggling to get guidance on how to get a list of Bluetooth devices. It seems that there are many Bluetooth interfaces but please correct me if I got the following error for the dedicated purposes: Core Bluetooth: Bluetooth LE (Bluetooth 4.0) gamekit: Peer-peer based on session ID EAAccessory: MFI Bluetooth device in XCode 3.0 There is also the useless "Bluetooth Manager" API. Can someone share with me how to get a list of Bluetooth devices with the current device running on my app? I am only interested in make, model, identifier (or serial number), I really do not need to communicate with the devices, just to be sure. thank you in advanced. Try downloading these examples and try to resolve your needs: Hope will be a helper

Programmatically trigger copy menu in iOS safari using javascript? -

I'm trying to implement a user-friendly way to copy some text from the text input field. IOS / Safari I think there is no way to program on this forum, but I was hoping that I can guide the user's experience as much as possible. On iOS / Safari, when a user manually highlights some text, a relevant copy menu pops up. I was hoping that the same menu pops up when the text is programmatically selected, but it is not. Is it possible to do this? If not, how to implement user-friendly experience in a best way to copy some text on the clipboard on iOS / Safari? The context, I am selecting the text using the method described in this question: This is unfortunately not possible. I can include some informative text under the input, hopefully the user will work properly in terms of friendship. Another option would be to go original, e.g. Wrapping using phonegaps, but I think you already know about that option if so, so some of the native code will work in: [UIPasteboar...

jquery - Alternative to :last selector to select the correct div -

I have several disks that are generated dynamically after uploading the file. I upload each file to a div in this format Makes: & lt; Div id = "uploadifive-fileupload-queue" class = "uploadifive-queue" & gt; & Lt; Div class = "uploadifive-queue-item full" id = "uploadifive-fileupload-file-0" & gt; & Lt; Div id = "input" & gt; Some text & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; Upload the item to the uploadifive-queue-item class of uploadifive-fileupload-file-0, uploadifive-fileupload-file-1, uploadifive-fileupload-file-2 Increased rise, etc. What am I trying to do that adds a class to #inputs , but only one has been created. I can do it using: The last time I only upload one time at a time, but if I select multiple at the same time, then it is only in that group The last final applies to the deal. What I see is like this $) or one way to target that unique uplo...

python - Using namedtuples to consolidate multiple dictionaries -

Given the number of models in which the key is m-number: add value, consolidate that information to named names Can one object be used to? By integrating, I mean refactor, so that I can cross this object and reach a special piece of information about it. How it is organized at present: Represents, the values ​​represent the beta coefficient, the calculation value (x), and an associated function ... that is the way: > Model_1_Dict ["Variable Name"] ("Beta coefficient", "Calculated value", "myClass.myfunction", & gt; ) Model_1_Dict ["variable name"] [1] code is updated later on I either start = any , and then could update the value on the calculation. Or later attach the value of the value list object (I think this is a non-issue). I want to know whether the model structure is a better way to use other structures such as designated thongs? Yes, you can use named designs - to the point where you said that ...

export external jar in blackberry but does'nt work -

I created a jar in which the class used in my application was included, but I Build Library Li> Add external jar or jar OK I can write my code as I use my libraries, but when I Award'm loaded project in the emulator or device he called My Library "Not Found". Please help, what is the correct way to use an external jar in Blackberry projects? Please try the following steps: Right click in project Please. Build Build Add external jar Order and select the Export tab Correct the check mark that you add .jar file Click OK

rails 3.2.6 routing error -

I'm new to rail, I followed the book "First Rail with Head" These are the steps I did: $ train ticket shaun @ master ~ / desktop / ticket $ railway scam ticket generated name: string seat_id_sag: string address: text value_pad: delays email_adder: string Sean @ Master ~ / Desktop / Ticket $ Rake Route Receipt Tickets / Ticket (. Format: Ticket) Ticket # Index Posts / Stamps (. Ticket # Create new ticket / receive new tickets (new:): New Edit / Ticket Receipt / Ticket / ID / Edit (. Format:) TICKET / TICKET / ADIDA (. PUT / TCTI: (.: Format) Ticket # Update Delit / TTK / Adid (Format:) Ticket # Destroy Shaun @ Master ~ / Desktop / Ticket $ Rake DB: Migrate == MakeTicket: Migrating ======== ======================================================= Twitter: Create Rated (0.1096) ========================================= When I am a localhost Trying to go to: 3000 / ticket This routing exits from the error and "Get a route mail [GET]" / ticket "& gt;...

Get HTML form fields from Facebook PHP? -

मेरे पास निम्न HTML फ़ॉर्म है: & lt; div id = "online_form" & gt ; & Lt; form id = "online_form_facebook" action = "user_form.php" नाम = "online_form_facebook" & gt; & Lt; div वर्ग = "फ़ील्ड" & gt; & Lt; div वर्ग = "लेबल" & gt; & Lt; label = "user_email" के लिए & gt; ईमेल: & lt; / label & gt; & lt; / div & gt; & Lt; div वर्ग = "इनपुट" & gt; & Lt; इनपुट आईडी = "user_email" नाम = "user_email" readonly = "readonly" type = "text" value = "& lt;? Php गूंज $ user_profile ['email']? & Gt;" / & Gt; & lt; / div & gt; & Lt; / div & gt; मैं फेसबुक से उपयोगकर्ता डेटा के साथ ईमेल फ़ील्ड (और अन्य फ़ील्ड) को कैसे पॉप्यूड कर सकता हूं? यह मुझे फेसबुक से मूल्य प्राप्त करने वाला कोड है: & lt ;? ob_start (); require_once ( 'पुस्तकालय / facebook.php'...

asp.net mvc - Single Page Application Server Separation of Concern -

I am in the process of putting together the base framework for multi-tenant enterprise systems. The client-side will be an asp.net mvc webpage which is talking to the database via AJAX via AJAX Web API. My question really lives around scalability, should I separate the client from the server? That means see client-side / frontend code / in a project and webpia in another separate project server. So if a server starts to load (server A) to start all the size / server frequency (server B) than all required and all new clients will point to webapi on server B. Or should all this be integrated as a project and the SQL Server side of things should be understood as load scaling (dynamic cloud scaling)? Before throwing our hat in the ring, we need some advice. In advance thank you We have a way to separate the API and single page The application has been The reason for this is that it forces you to treat single page applications only as a customer, resulting in an API resul...

- Where Developers Learn, Share, & Build Careers

I am working in a list of ViewModel with wpf and multibinding. Suppose I have an observation resolution, the same type of view modal is as follows: code: public class ShapeVM {color of public color {Get; Set; } Public string name {get; Set; }} OverviewCollection Size = IBM = New Observational Collection (); ShapeVMs.Add (...); ShapeVMs.Add (...); ShapeVMs.Add (...); ShapeVMs.Add (...); ShapeVMs.Add (...); // In the archive size of 5 sizes I see : & Lt; / UserControl & gt; Is it possible that whenever the chosen color of colored color changes, then the size of the size of the 5 size will automatically change to the selected color of the color box? If I set the DataContext of UserControl to one size or size, then only the sizes of the same size will change. However, at the same time I would like to change 5 SPVM, the color of the ColorBox has changed. Another simple solution is your problem & lt; Combo box x: name = "cbb" grid. Value =...

multithreading - when should I use 'lock' in multi-thread programing? -

When to use 'lock' in multi thread programming? Just lock that think that each thread will modify or lock that check which can access every thread even though it will not be modified? struct share_data {/ * share data * / thread_ID; } Thread 1 will start the main () function: initial share data / * lock required / all threads (share_data. Thread_id, and status) / * login share data thread_id, lock or not? */ Go out. Other threads would be: using share_data, / * locked or not? * / Modify share_data, / * lock * / exit Thank you for your attention, and if you have more time, more detail about the actual code: / * The number of threads will be user input Structure "tdata" and "tlist" information of each thread, which includes: "tid" - Thread ID, which is the sheath by the first argument of pthread_create (), "trader" which calls pthread_create () for each video The order is "status" stores the work state of each thread,...

jQuery UI Autocomplete, How to enable autocomplete only if user type in a special charactor? -

I have completely connected to different types of input boxes whenever the user types something correctly , Then loads the objects. However, in one of the texterrari , I want to completely disable it by default, and enable the user when typing it in "@". How to do this This will do the trick: $ ('Textarea'). Autocomplete ({source: availableTags}) Autocomplete ('disable') .on ('keypress', function (event) {// Determine whether '@' was closed if (event.shiftKey & amp;; Amp; event.keyCode == = 64) {$ (this). Autocomplete ('Enable'); Return False;}}); Live example -

c# - Equivalent of SQL Query with linq -

I search for LINQ equal with this query: Select from shapes I ABS (45.403703 - latitude), ABS (- 71.948638 - longitude) Does anyone have an idea? I started with linq class = "post-text" itemprop = "text"> (45.403703 - X. latitude), Math. Abs (- 71.948638 - X. Long) selection X;

translation - Java Translator API -

Are there any free online / offline translator APIs for Java that do not require payment or registration like Google and Microsoft Tax? I am trying to find something, but all of them have a limit or payment of some form is required. If all is needed to translate an occasional string or two, then is there a way to translate Google Translate? I have seen a post involving the use of a spreadsheet, but it was in JavaScript and I do not need it for Java. I am fine with registration, this payment goes to me because I am releasing this program to the public. Microsoft Translator offers free 2 million letters per month

javascript - Extend objects using functional invocation pattern. How? -

field here: I'm reading the book of Crockford and wondering what a proven approach is Can the child's objects be used to open the base constructor object and avoid adding an option to it? I thought I could use the prototype of my object and it appears that my current code is not possible. You have several errors: Your Constructor Function Completely Returns unrelated objects. Do not do this this (if a return statement does not exist, then the constructor stays on it) Super Constructor calls in JS very comfortable You are not ugly creation MySuperclass.call (this, arg1, arg2, ...); is needed, in your case breast cal (this, spec); cat class In order to immediately trigger the object using the prototype series, you need the new keyword. See for a certain version of your code.

ios - FirstViewController doesn't work on removing the subview of SecondViewController -

The first view controller I am using a UIStoryBoard, so that the first viewer View view as a subview, removing controller sub - (IBAction) btnMoveTo: (ID) sender {UIStoryboard * Storyboard = [UIStoryboard storyboardWithName: @ "Mainstoreboard" bundle: zero]; UIViewController * vc = [Storyboard Instant Viewer Identifier: @ "seconds"]; Vc.view.backgroundColor = [UIColor clear collar]; Self. Model Presentation Style = UIModal PresentationConfigurationSettings; [Self-Present Model Week Controller: Animated Vcc: No]; } second viewer. M - (zero) viewDidoad {self.view.opaque = YES; Self.view.backgroundColor = [UIColor clear collar]; } - Draw with (IBAction): (ID) sender {[with self-view removal zoom animation: 2 options: zero]; } When I use with the Dre function, the second view controller's view is removed and the first viewer is back. However, when I use the button - (IBAction) the btnMoveTo: (id) sender function. It does not work, nothing really do...

PHP Apache ImageMagick extension won't load -

I am running 64-bit Windows 7 with Apache 2.2, PHP 5.4.4 VC9. I downloaded and installed Image Magic 6.6.4 and successfully tested it from a command prompt. I have restarted my computer I have tried many different extension files and getting the following error in my Apache log. PHP Warning: PHP Startup: Dynamic Library 'C: \\ PHP \\ Ext \\ php_imagick_ts.dll' Unable to load - The specified process was not found. Unknown on the line in \ r \ n0 I have my extension_dir set to c: \ PHP \ ext . And I have definitely modified that file as I am trying to. = "text"> I have the Imagick PHP 5.4 (working on the command line only, but Apache should work) to work on Win7 x64 as compiled and hosted using beta libraries: ImageMagick-6.8 Windows-dll.exe file on .0-7-Q16. C: \ & gt; Php -v PHP 5.4.0 (CLI) (Created: February 29, 2012 19:24:02) Copyright (c) 1997-2012 PHP Group Z engine v2.4.0, Copyright (c) 1998-2012 Z Technologies C: \ & Gt; PHP-M [...

entity framework - Table per Concrete Type Mapping Issue in EF Code First 4.2 -

I do not have a defined key of EntityType 'user' key for this EntityType error Define. Model: Public Essentials KeyedEntityBase {Public Int ID {get; Private set; }} Public class user: KeyedEntityBase {public string username {get; Private set; } Receive public string email address { Private set; Public Lisbon PortalContext: DBCTTEX {Public LSB PortTaintex (): Base ("LSB PortraitDB") {} Public DBSet & lt; Users & gt; User {Received; Set; } Safe Override Zero OnModelCreating (DbModelbuilder Modalbuilder) {modelBuilder.Entity & lt; Users & gt; (). Map (M = & gt; {M.map Inherited Properties}; M.Totable ("user");}); Base.OnModelCreating (modelBuilder); The problem was that I did not actually map the KeyedEntityBase class. Once I did that all this worked well.

linux - looping through dates in hp unix via arthmatic operations -

Hello I am using HP Unix, I'm trying to loop through the last 20 days (current date In relation to) loop for one For , do the day ($ c = 1; c & lt; = 5; c ++) $ c = $ (perl -e 'use pOSIX; print strftime "% Y % M% D \ n ", local time-86400 * $ c; ') afterwards do some action with some $$ c , the issue is that some strange reasons 86400 * $ c is not being executed, can anyone point to the mistake? Thanks in advance. Try different quotes: day $ c = $ (Perl-e "use POSIX; print striptime cueq ( % Y% m% d \ n), local time-86400 * $ c; ") (I'm not familiar with HPUX, but it seems that $ c is not being interpolated by Shell.) Edit: Or slightly smaller: day $ c = $ (perl-MPOSIX -le) "Print strokefire '% Y% m% d', local time-86400 * $ c;")

soap - AxisFault: javax.xml.stream.XMLStreamException -

We are using drupal soapservice for webservices while we are trying to call soap service, this result gives, but axis2 throws following error ... org.apache.axis2.AxisFault: javax.xml.stream.XMLStreamException: element com text content com.chm.api.login .chm.api.login.client.DrupalSoapStub.fromOM (DrupalSoapStub.java:12249) can not be included START_ELEMENT on org.apache.axis2.AxisFault.makeFault (AxisFault.java:430) java.lang.Exception: .client DrupalSoapStub.userLogin javax.xml.stream.xmlStreamException due to SocketClient.main (DrupalSoapStub.java:1408) (SocketClient.java:144) Quick text can not contain START_ELEMENT on com .chm.api.login.client.DrupalSoapStub $ UserLoginResponse $ Factory.parse (DrupalSoapStub.java:59804) on com.chm.api.login.client.DrupalSoapStub.fromOM (DrupalSoapStub. java: 11473) ... 2 more due by: javax.xml.stream.XMLStreamException: element not included START_ELEMENT on org.apache.axiom.om.impl.SwitchingWrapper.getElementText (SwitchingWrapper.java:981...

mysql - Append data from Reference table to another table in Doctrine and Codeigniter -

मेरे पास एक विभाग संदर्भ सारणी है: आईडी का नाम 1. विभाग 1 2. विभाग 2 3. डिपार्ट 3 मेरे पास एक उपयोगकर्ता सारणी है: आईडी का नाम 1. उपयोगकर्ता 1 2. उपयोगकर्ता 2 एक उपयोगकर्ता को जोड़ने पर मैं उन्हें एक विभाग नियुक्त करने में सक्षम होना चाहता हूं। हालांकि मैं यूजर टेबल में डिपार्टमेंट का नाम स्टोर करना नहीं चाहता, इसलिए संदर्भ तालिका। इसलिए मैं सोच रहा था कि मुझे उपयोगकर्ता तालिका में एक विभाग_आदेश होना चाहिए ताकि विभाग की तालिका के संदर्भ में समस्या मुझे उपयोगकर्ता को जोड़ने के बाद यूजर आईडी, यूज़र नेम और डिपार्टमेंट का नाम आउटपुट करने की आवश्यकता है I चुनौती यह है कि मैं यह कर रहा हूं: $ array ['users'] = उपयोगकर्ता :: getUsersAll (); $ इस - & gt; तालिका - & gt; Set_heading (सरणी ('आईडी', 'नाम'); मॉडल में getUsersAll () विधि में शामिल है: $ Query = Doctrine_Query :: create () - & gt; ("आईडी, नाम") -> ("उपयोगकर्ता") से चुनें इस दृश्य में, मैं तालिका द्वारा : इस $ echo -> gt; तालिका - & ...

spring batch read write execution time -

I see the best way to measure the execution time of the spring batch, edit and write action I am thinking about it, but is this the right solution? Thank you for answering all of you! After the first and XXX methods, and the interface is the right way to measure in-step performance. P> Simply initialize your timer first to XXX and output the XXX () method after the result.

rabbitmq - Queue Size in Spring AMQP Java client -

I am using Spring AMPP version 1.1 as my Java client. I have a line, which has about 2000 messages, I want a service that checks the size of this queue and if it is empty then it will send a message saying "all items processed". I do not know how to get the current queue size? Please help I googled and found a square "RabbitBrokerAdmin" which was present in earlier version 1.0. I think it's not present in 1.1 yet. Any hint in the size of the current queue? So I know that this is a little late and a solution has already been found but here Another way is This solution assumes that you are using Spring Rabbit Framework and defined your queues in your application config with the following tags defined & Lt; Rabbit: queue & gt; & Lt; Rabbit: admin & gt; Java class: Public class questsstats processor {@ etvoir private rebate admin admin; @ Autonomous private list & lt; Que & gt; RabbitQueues; Public Zero GetCounts () ...

c - Why the byte are upside down? -

I have a "weird" issue with the C function fwrite . I have a Unsigned int is the indicator and I want to write it in a binary file, so I used the fwrite but the file is written inverted byte. For example, looking at FE 45 78 D4 4C E9 EA F1 etc., looking at unsigned int (4 bytes in my case), I see the file content As D4 78 45EFF1EAE94C etc. How can I fix this? A bit more information: When I say that bytes are written in the wrong order, I mean that every program I use to read the file Byte seeing the wrong sequence, error reading an error ... understand me Not only does the Fillit function use a different way to represent data ... More info: I tried fwrite (myuipointer, 4, size, file) ); Fwrite (myuipointer, 1, size * 4, file); The same result I also tried to use an unsigned four indicator which points to my data and writes it, no success ... "Post-text" itemprop = "text"> This is because your computer uses Little Endian storage...

linux - kill screen session in an expect script -

I start my screen connection with a span command on the expected screen: spawn screen / dev /... But I do not know how I can kill the screen when the script ends Screen-X leaving will send quit command in the running screen session.

vb.net - Shorten a string containing data -

I am creating an application to present unique keys for each computer, this information is taken from the OS serial number and processor ID has gone. Is there a way to 'reduce' the string? Perhaps by converting it to hex or something ... The reason for this is: I have a VB6 section of code (http://www.planet-source-code.com/vb ... 48 9 26 and LNGIID = 1) and the output is only 13 digits long. I have a very long time but get the same information ... BTW, I have posted the link above Wins the prize, but I have great difficulty in converting it to the net. Has it been changed by any chance, or is anyone aware of it? Or a tool that actually works? Thanks Edit Here is the full working link: It sounds as if you want 'hashing algorithm' or 'hash function', this is a common concept: Generally speaking You can write your function to take the string and return a palm number, but there is some appropriate code that uses the .NET framework:

visual c++ - Controlling a running VLC process via C++ in Windows -

I want to control the example running VLC (not a server with RC) under Windows, to do so Is COM Interface or other interface also? I have looked around, but I have come to know that some examples either mention or control about it. I have seen some ActiveX examples, am I confusing something? Or does VLC not support such a thing? Modify Just want to emphasize again I see how is already running VLC From my external process Please do not post about embedding in your application. As you mentioned yourself, the libvlc primary interface is that you must control VLC as follows There are some rappers ...

blackberry - How to reduce memory when loading image from website? -

मैं इस उपयोगिता का उपयोग कर रहा हूं सार्वजनिक वर्ग Util_ImageLoader {सार्वजनिक स्थिर बिटमैप _bmap; Util_ImageLoader (स्ट्रिंग यूआरएल) {HttpConnection कनेक्शन = शून्य; InputStream इनपुटस्ट्रीम = नल; एन्कोडेड छवि बिटमैप; बाइट [] डेटाअरे = नल; {Connection = (HttpConnection) कनेक्टर। ओपन (url + Util_GetInternet.getConnParam (), कनेक्टर.READ, सत्य) का प्रयास करें; इनपुटस्ट्रीम = connection.openInstreamStream (); बाइट [] प्रतिक्रियाडेटा = नया बाइट [10000]; Int लंबाई = 0; स्ट्रिंगबफ़र कच्चेरेस्पॉन्स = नया स्ट्रिंगबफर (); जबकि (-1! = (लंबाई = inputstream.read (responseData))) {rawResponse.append (नई स्ट्रिंग (प्रतिक्रिया डेटा, 0, लंबाई)); } Int responseCode = connection.getResponseCode (); यदि (responsecode! = HttpConnection.HTTP_OK) {नया IOEception ("HTTP प्रतिक्रिया कोड:" + responseCode); } अंतिम स्ट्रिंग परिणाम = rawResponse.toString (); डेटाअरे = परिणाम .getBytes (); } पकड़ (अंतिम अपवाद पूर्व) {} अंत में {try} {inputstream.close (); इनपुटस्ट्रीम = नल; connection.close (); ...

How to show a ProgressDialog using intent in Android? -

I have an activity that downloads data from the database. While the activity is working, I want to show progress with Progress Dealog . I use ProgressDialog.STYLE_HORIZONTAL because I want to show the actual value. I activity using a handler to start that displays the progress Deelaog : effect intended = new Intention (this, progressive program. Specialty class); Personal Handler Handler = New Handler () {@Override Public Zero Management Message (Message Message) {super.handleMessage (msg); If (msg.what == SET_PROGRESS) {intent.putExtra ("action", "show"); Intent.putExtra ("Progress", msg.arg1); Intent.putExtra ("max", msg.arg2); Intent.putExtra ("Message", Sync Message); Intent.putExtra ("Heading", R. String. Pellez_Wight); Intent.addFlags (Intent.FLAG_ACTIVITY_NEW_TASK); StartActivity; } And if (msg.what == SHOW_PROGRESS) {intent.putExtra ("action", "show"); Intent.putExtra ("title"...

- Where Developers Learn, Share, & Build Careers

I have document.form1.submit () in javascript. I want to know how it got behind this code. In which class, in which method? something like that. Coz I want to get the value inside a text box to store it in one session. And do I need a real "submit" button for this? It really confuses me. If I keep it like this: function callSubmit () {var thetext = document.getElementById ('textbox1'). Value; Document.form1.submit (thetext); } Can I be able to pass the value of textbox1 to the code behind a specific method, if so, such as, a received variable? I mean, how can I get the value of textbox 1? By the way, I am trying to do this before landing the page. Because I need to store text from TextBox 1, so that I can allocate the value again after page refresh. You can get value back to post using 'form' as 'back'. request. Form ["textbox 1"] and if you request this . Read the form You get all the data from the post Comment...

- Where Developers Learn, Share, & Build Careers

In the morning, I need to return a message from my web service below to one of my code Sample, and I'm returning a string. [Web method] Public string checkfidSubmission () {string responseText = ""; Try {// stuff goes here feedback text = "it worked!" } Hold (exception before) {responseText = "Apps have filed an error! Exception Message:" + Formerly. message; } Return reaction lesson; } I currently get the following response ... string xmlns = "http://tempuri.org/" /> I would like to return something like this {"success": true, "message": "*** message here ***" } I am sure once I get this information, I will be able to return the other items when I need it. All help is highly appreciated, thanks in advance :) UPDATE: Just found it ... return "{message: 'hello World '} " Do I need something responseText =" {"success": true, "message...

- Where Developers Learn, Share, & Build Careers

I have a method that accepts string logic. An integer in the string, double, boolean, or just plain old letters and numbers. I want an easy way to determine what type of string is. There is a way to catch a bunch of blocks and try to parse it in every type, and if an exception is thrown, then it is probably not that data type. It seems incorrect because it is an intuitive program, not a deterministic program. If you know how to once you enter the parameter You know, it is ok to parse that type of string and catch the exception - it's fair use of exceptions to capture invalid data (unless you're just trying one type ..)

java - JFileChooser doesn't return full file name on OSX 10.7 -

The problem is that the file is returned by object JFileChooser is incomplete file name. To be more accurate, the file extension returns a filename without the part. I have tried to retrieve the path by using getPath , getAbsolutePath and getCanonicalPath , but it is still the same path without the extension portion gives. The same program and code work on Windows, Linux, and OSX 10.6 is OK The issue occurs at OSX 10.7.4 with the issue SA 10.6.0_33-B3-424. Does anyone know a job for this, or can at least confirm this incident? Edit: Jeffery Charge myImageChooser = new JFileChooser (); MyImageChooser.setFileSelectionMode (JFileChooser.FILES_ONLY); Int val = myImageChooser.showDialog (Newsframe.This, "Choose Image"); JFileChooser myImageChooser = new JFileChooser (); MyImageChooser.setFileSelectionMode (JFileChooser.FILES_ONLY); Int val = myImageChooser.showDialog (Newsframe.This, "Choose Image"); If (val == JFileChooser.APPROVE_OPTION) {file f = my...

c++ - Assigning true value to float -

क्या यह गारंटी है कि एक फ्लोट चर परिणाम के लिए सच बताए 1.0 एफ फ़्लोट चर के लिए झूठी बताए 0.00 सत्य रिटर्न के रूप में अपेक्षित (सत्य और गलत क्रमशः?) हां पहले दो के लिए, 4.9 / 2 ("फ्लोटिंग-इंटिग्रल रूपांतरण"): यदि स्रोत का प्रकार bool है, तो मान झूठी को शून्य में परिवर्तित कर दिया जाता है और सत्य को एक के रूप में परिवर्तित किया जाता है। पिछले एक के लिए, 4.12 / 1 ("बूलियन रूपांतरण"): शून्य मान, शून्य सूचक मान, या रिक्त सदस्य सूचक मान झूठे में परिवर्तित; प्लस मुझे लगता है आपको यह जानना चाहिए कि यह शून्य की गारंटी है और कोई भी float के मान के रूप में प्रस्तुत किया जा सकता है। यह ऊपर से निहित है (अन्यथा रूपांतरण वर्णित रूप से व्यवहार नहीं कर सकता है), लेकिन मुझे यकीन नहीं है कि अगर और जहां यह स्पष्ट रूप से कहा गया है कि कौन से पूर्णांक मान को float में बिल्कुल प्रस्तुतीय होना आवश्यक है। कोटेशन N3337 से हैं, जो लगभग बिल्कुल सी ++ 11 है "C ++ 11" के बजाय टैग्स को "C ++" में बदल दिया गया है - सी ++ 03 में नियम समान है...

html - which element can i use instead of table that have the same properties? -

I have many photos with the same size and I want to use them for a slideshow. So they should be in a line and maybe the width of this row is larger than the width of the window and I want to move some pictures out of the screen instead they go to the next line before I make the table in line Used and I moved the table to create this slideshow. [Like this:] & lt; Table cellspacing = "0" cellpadding = "0" & ​​gt; & Lt; Img src = "..." /> & Lt; Img src = "..." /> & Lt; Img src = "..." /> & Lt; Img src = "..." /> & Lt; Img src = "..." /> & Lt; Img src = "..." /> ... & lt; / Table & gt; But I want to use any other element [for example, a div with some CSS rules that has the property of that table] because table some problems in my page A solution with a minimum code and a "hacks" & lt ; Div style = "white-space: nowrap...

android - Difference between loadUrl and loadData with javascript -

I try to load an html page in an Android webview with an AJAX post request. When I load the webview with LoadUrl, the javascript works fine, but when I try to load the load with data (I need it), I get an error: " NETWORK_ERR: XMLHttpRequest exception 101 ". This error looks like the basic problem of an access control. ParseSupup function changes some strings into html pages with good strings. I check the data passing the load data and does not change the part of the script. My Secret Function: Crate on Public Zero (Bundle Saved Instantstate) {super.onCreate (savedInstanceState); SetContentView (R.layout.main); String html = parsesup ("index.html"); SetContentView (R.layout.main); MyBrowser = (WebView) Find ViewById (R.id.mybrowser); MyBrowser.getSettings () setJavaScriptEnabled (true). MyBrowser.setWebViewClient (New MyWebViewClient ()); //myBrowser.loadUrl(file:///android_asset/index.html "); MyBrowser.loadDataWithBaseURL ("", html, ...

- Where Developers Learn, Share, & Build Careers

I've added a few words like the name of the fruit in the sample tutorials available in the voxforge julius tutorial. I think the grammar and the whoca file is correct and I got stuck in this final step on this last error. I have checked my monophones0 file, I have made a change to it, I am copying it as it is the tutorial made a tree with a parallel command. I do not know why I have this error now. TB 350.00 ST_a_2_ {} tree based clustering error [+ 2640] Tribulum Commands: TB command must be in order Need help !!! You need to modify perl script to work with your fornate. As a result, there should not be lines like plantation TB 350.00 ST_a_2_ {} Instead, the lines should be visible TB 350 "ST_jh_2_" {("jh", "* - jh + *", "jh + *", "* - jh") State [2]}

opacity - Making a transparent box with CSS -

I am trying to create a transparent box on the back of the container, however, I can not middle it Instead of the background, when I'm trying to use top-margin to get my design, it will also take down the background image, so I would like to ask that I like it as an example given by the W3C Why can not make it & lt ;! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.01 Transitional // N" "http://www.w3.org/TR/html4/loose.dtd"> & Lt; Html & gt; & Lt; Top & gt; & Lt; META http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt; & Lt; Title & gt; Portal & lt; / Title & gt; & Lt; Link rel = "stylesheet" href = "style.css" type = "text / css" /> & Lt; Script type = "text / javascript" src = "ajax.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body Onload = "Load ()" & gt; ...

- Where Developers Learn, Share, & Build Careers

I want to be able to use a UIViewAnimationCurve for rotations and the other for changes in status. Is this possible? For example (in pseudo code); Start animation // Rotation animation curve easily make some changes in the linear / / position in the InIn / // set position animation curve / rotate angle / make the animation less Edit: (CAAnimationGroup approach has been suggested below) - Though any ideas 2 different CABasic animation and a CAAnimationGroup are not started animation are not started? CABasicAnimation * postionAnimation = [with CABasic Animation Animation: @ "status"]; PostionAnimation.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear]; PostionAnimation.toValue = [NSVL Value WithCGPoint: [Self Conversion Point ToWorldSpaceFromViewSpace: self.spriteView.position]]; PostionAnimation.delegate = self; CABasicAnimation * rotationAnimation = [with CABasic Animation Animation: @ "Transform .z"]; Rotation animati...

android - ProgressDialog while refreshing a ListView -

मेरे पास एक SimpleAdapter द्वारा आविष्कृत एक ListView है, जो हाशमैप्स के एक ArrayList से मूल्य प्राप्त करता है I सरणी सूची को एक विधि load () द्वारा बनाया गया है जो मेरी साइट से डेटा लाता है मेरे पास एक मेनू विकल्प है जो उन्हें फिर से फ़ेच करके और adapter.notifyDataSetChanged () को कॉल करके डेटा को रीफ़्रेश करने की अनुमति देता है और यह वास्तव में ठीक काम करता है, सरणी सूची को अपडेट कर रहा है और सूची दृश्य को ताज़ा करता है अब, यह एचटीएन कनेक्शन स्थापित करने और डेटा प्राप्त करने के लिए load () के लिए कुछ सेकंड लेता है, इसलिए मैं एक प्रगति डीआईएलओॉग सेट करना चाहता हूं ताकि उपयोगकर्ता को जारी रखने की प्रक्रिया के बारे में सूचित किया जा सके। मुझे पता है कि मैं UI धागे पर प्रगति डीलाॉग नहीं डाल सकता जहां load () काम करता है, इसलिए मैंने एक एसिंक टास्क के साथ कोशिश की यह ठीक काम करता है, जबकि नए डेटा को प्राप्त किया जा रहा है और एडेप्टर को पास किया जा रहा है, लेकिन यह एक समस्या भी जोड़ता है: सूचीव्यू अब प्रदर्शित वस्तुओं को ताज़ा नहीं करता है, जब तक कि मैं संशोधित सूची आइटम को स्क...

image - Jquery changes position of div/img -

I have found an alternative solution to focus a large image (no background) in a small division. #pic {width: 60%; Height: 34 9px; float right; Hidden flurry; Status: Relative; } #pic img {left: 50%; Margin-left: -100%; Status: Relative; } I am happy with the positioning. However, once I use the Jaguar cycle plugin, it completely corrupts the position and size of the images. As I inspect the element (with DOM inspector), it is striking through the following values: left: 50%; Margin-left: -100%; This is causing reinstatement. Why are they all abort after using Jquery and you add Can! Important in CSS #pic {width: 60%! Important; Height: 34 9px; float right; Hidden flurry; Status: Relative; } #pic img {left: 50%; Margin-left: -100%! Important; Status: Relative; }

How to config and use multi master nodes in a Hadoop cluster? -

Can anyone please tell us how to configure and use the multi master node in the Hadoop cluster? Check if you are looking at more than one name-node. Must be available in both. In the 1x Hadop release in the JobTracker, there may be only one JobTracker in another owner and cluster. The functionality of BTW, JobTracker is divided into 2x headop release. Check for more information. There may be some alternative options, but many depend on the need to be masters. Is it available, scalability or something else?

c# - Call MouseEventHandler from another form -

मैं मुख्य रूप में एक माउसएवेंटहैंडलर बनाऊँ: सार्वजनिक होम () {InitializeComponent () ; यह। केप्रिव्यूव = सच; This.MouseMove + = नए MouseEventHandler (Home_MouseMove); } सार्वजनिक स्थिर शून्य Home_MouseMove (ऑब्जेक्ट प्रेषक, MouseEventArgs ई) {bomb.Stop (); bomb.Start (); मैं MouseEventHandler को किसी अन्य रूप से कैसे कॉल कर सकता हूं? कोई अन्य अच्छी विधि? Fisrt आपको Home_MouseMove ईवेंट को गैर-स्थिर करने के लिए बदलना होगा: सार्वजनिक शून्य Home_MouseMove (ऑब्जेक्ट प्रेषक, MouseEventArgs ई) {bomb.Stop () ; bomb.Start (); } प्रोग्राम.cs फ़ाइल पर जाएं और इससे कोड बदलें: स्थिर वर्ग कार्यक्रम {/// & lt; सारांश & gt; /// आवेदन के लिए मुख्य प्रवेश बिंदु /// & lt; / सारांश & gt; [STAThread] स्थिर शून्य मुख्य () {Application.EnableVisualStyles (); Application.SetCompatibleTextRenderingDefault (गलत); आवेदन। रुण (नया FrmMain ()); }} इस कोड में: स्थिर वर्ग कार्यक्रम {सार्वजनिक स्थिर FRMMain MainForm; // इस लाइन को जोड़ना /// & lt; सारांश & gt; ...

mysql - PHP PDO Security -

I am trying to work with PDO for the first time and I want to know what I am doing, how safe is it I , I'm also new to PHP. I have a question that when a user passes my page, the page takes a variable using GET and then runs. With PHP, I've always used mysql_real_escape to get my varietates sanitized. Can anyone see security flaws with this? // Get the person ID $ User ID = $ _GET ['userID']; // People $$ sql = "Select * Individuals with ID = $ userID"; $ Q = $ conn- & gt; Query ($ sql) or die ($ conn- & gt; error ()); While ($ r = $ q- & gt; Fetch (PDO :: FETCH_LAZY)) {echo ' Do not use the query, prepare: $ userID = $ _GET ['userID']; $ Sql ​​= "People from WHOE ID =: userid"; $ Q = $ conn- & gt; Ready ($ sql) $ q- & gt; Execute (Arrays (': userid' = & gt; $ userID)); While ($ r = $ q- & gt; Fetch (PDO :: FETCH_ASSOC)) {echo '& lt; Div class = "mis-per" & g...

c# - Selenium ChromeDriver stops working on Quit() -

Using MSTest in Visual Studio, I have a problem with Selenium WebDriver, in particular, ChromeDriver Whenever I get out of the chrome driver, I get the message "chromeaderier .exe" has stopped working "and the program is freeze. At the end of all the tests I have all my drivers Class cleanup: [code] [classclinify] Public Static Wide Class Clan () {Drivers. Forac (X => X. Quit ());} firefox driver fine ny Che stops, but the chrome driver always stops working. Can anyone help me with this? Edit: For a bit more clarity of my code, (chromedriver The exe program that I've added to my solution): Fixed IWebDriver driver; Fixed IWebDriver chromeDriver; Fixed String baseURL; Fixed list & lt; IWebDriver & gt; driver; [Classicalize] Public Static zero classInitialize (TestContext reference) {driver = new suggestion} & Lt; IWebDriver & gt; (); drivers = new Fayrfoksdraivr (); Kromdraivr = new Kromdraivr (route); Drivers.Add (driver); Drivers.Add (c...

how do i set proxy for chrome in python webdriver -

I am using this code: Profile = webdriver.FirefoxProfile () Profile . set_preference ( "network.proxy.type", 1) profile.set_preference ( "network.proxy.http", "proxy.server.address") profile.set_preference ( "network.proxy.http_port", "port_number") profile. update_preferences () driver = webdriver.Firefox (firefox_profile = profile) Python webdriver the proxy set to FF. It works for FF How to set proxy in Chrome like this? I found this but not very useful when I run the script nothing happens (the Chrome browser does not start). selenium imports webdriver proxy = "23.23.23.23:3128" # ip: port or Host: Port chrome_options = webdriver.ChromeOptions () chrome_options.add_argument ( '- proxy-server =% s'% proxy) Chrome = webdriver.Chrome (chrome_options = chrome_options) chrome.get ( "http://whatismyipaddress.com")

- Where Developers Learn, Share, & Build Careers

I am trying to use an array originally, which is data read from a file, and then Calculates the meaning and standard deviation from the data by using that array. I can not get the right number right now. Stable public double [] [] calcStats (string [] [] x) throws IOException {double [] [] array = new double [7] [2]; Double total = 0, std_dev = 0, zodiac = 0; Int row2 = 0; {Array [line2] [0] = (total) for (line line = 1; row; lt; x.length; line ++); Array [row 2] [1] = amount of mathematics (amount); Zodiac = 0; Total = 0; If (line & gt; = 2) {row2 ++; } (Int col = 1; col & lt; x [row] height; cola ++) {total + = integer ParseInt (x [row] [col]); If (colley == 4) {total = (total / 4); }} For (int col = 1; col & lt; x [row] .length; col ++) {std_dev = (integer. ParseInt (x [row] [col]) - (total); Std_dev = Math.pow (std_dev, 2); Zodiac = + std_dev; Std_dev = 0; If (colley == 4) {zodiac = (zodiac / 27); }}} Array [row 2] [0] = (total); Return array; } Array starts...

Odd behavior with Perl system() command -

Note that I know this is not the best or most optimal way to do this, but I have participated in it It's somewhere eager and I'm curious as the answer. I have a Pearl script which is called an init which runs and sometimes dies. To debug it instantly, I have a quick wrapper Perl script that is originally set with the path # $ path. While joining (1) {system ("$ path / command.pl") ("", @ ARGV). "& Gt; & gt; / var / log / outlog 2 & gt; and 1"); So 30 # later added this one to the bottom ...} Press it from the command line and it runs properly and expected, Command.pl is called and the script Basically there will not stop again until the hair process dies. However, when calling a start script (actually through start-stop-daemon), the system command returns immediately, command.pl is running. So it goes around to go one more and then again and again (it was not fun without order of sleep). PS shows (many) commands. The guard...

database - How do I add multiplicity values in StarUML -

I am studying database development and I am at that stage where I have to make my own ER model. Everything is fine with StarU so far, although in the course notes it is not mentioned how to add monthly analysis options between unit type (cardinality and particle). Am I expecting someone to help me out here positively? Many thanks Peter one on line / union Click the bar Place a Square Blocks on the mouseover at the end of the line so that you get the hand cursor and double-click. Then you will see a pop-up with a combobox dropdown menu on the right. Select plurality from the dropdown menu, can be selectable from multiple: 0..1, 1, 0. .. , 1 .. , And * or directly entered. Repeat the square block on the other end of the line.

c# - Merge Files in a directory, with a newline appended each time -

I have a bunch of txt files in a directory, which I want to merge into a file. At the end of each file I want to add a cart / return line. What is the best way to do this in C #? One-liner that is significantly worse on memory consumption: File. Merge all lines (targetFileName, Directory.GetFiles (srcFolder, "* .txt") .SelectMany (f => File.ReadLines (f) .Concat (new [] {Environment.NewLine}))); Hope you can stay in the end with additional Newline.

- Where Developers Learn, Share, & Build Careers

कहें कि मेरे पास एक जावास्क्रिप्ट फाइल का एक संदर्भ है: & lt; script type = " पाठ / जावास्क्रिप्ट "src =" http://blah.com/js/count.js "& gt; & lt; / स्क्रिप्ट & gt; Count.js की सामग्री के साथ : चेतावनी ("यह स्क्रिप्ट लोड हो रहा है:" + url); मैं count.js के अंदर से यूआरएल वैरिएबल में जाने वाले मान की पहचान कैसे करूं? जब एक बाहरी लिपि निष्पादित होती है, तो उसका SCRIPT तत्व पृष्ठ में अंतिम होगा, जो कि document.scripts [document.scripts] है तो, यदि SCRIPT तत्व है: जावास्क्रिप्ट "src =" http://blah.com/js/count.js "& gt; & lt; / स्क्रिप्ट & gt; और count.js फ़ाइल सामग्री है: चेतावनी ("यह स्क्रिप्ट लोड हो रहा है:" + दस्तावेज। स्क्रिप्ट [document.scripts.length-1] .src); यह प्रदर्शित करेगा: इस स्क्रिप्ट से लोड हो रहा है: http://blah.com/js/count.js ध्यान दें कि HTML5 में SCRIPT तत्व के लिए एक परिचय है, जो संभवतः उपरोक्त विधि बेकार बनाते हैं एसिंक्रोनस के मामले में...

c# - WPF slider style -

Image
I'm new to WPF, and I'm trying to add a style to my slider, but there are lots of options which I am confused in a way. Someone can see how a slider looks at me: Green = passes, brown hair track and I am trying to use it to show during the song, so the brown = balance, the easiest way is to apply it by dragging it That part of the song is skipped. I am using Noudio, I have got trackback sliding, while the song is playing: Private zero sender timerTit (object sender, EventArgues e) {LabelCurrentTime.Content = _musicManager.getPlayTime (); Double Total Seconds = _musicManager.totalSeconds (); Double serials = _musicManager.currentSeconds (); If (total seconds & gt; 0 & amp; amp; amp; & amp; amp ;; currentseconds & gt; 0) trackbar Value = ((Trackbar.Width / totalseconds * currentseconds) / total second) * 10; Xaml: slider with x: name = "trackbar" height = "25" canvas.lift = "50" canvas top = "10" width = ...

jQuery: wrap around substring...close, but not quite -

I am trying to select substrings - in character counting, in square brackets - in many paragraphs and each of them Wrap a class with & lt; Span & gt; In the tag, the "four way," applied here is HTML for one, and CSS: gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; P & gt; For more information about Pellentesque Hospice [100 character w / location] & lt; / P & gt; & Lt; A href = "/ give" & gt; Please & lt; / A & gt; & Lt; / Div & gt; & Lt ;! - end .featured_box - & gt; span.char_count {padding-top: 0; Color: # FF 6600! Important; } Follow my Nob jQuery conformation: var select_p = $ ('div # promo_area div.featured_box p'); Select_p.each (function () {var first_index = $ (this) .html (). IndexOf ('[']; var last_index = $ (this) .html (). IndexOf (')') + 1; var selected_text = $ (This) .html (). Substrings (first_ index, final_index); selected_text.Wap (...