Posts

Showing posts from July, 2011

objective c - How to create a action to a button in Cocoa programmatically? -

I am trying to create a button in Mac program in Maco, but I do not know how, Trying to: NSRact frame = NSMKAct (10, 200, 80, 100); NSButton * btn = [[NSButton alloc] initWithFrame: frame]; [BTN Set button type: NsmemberRepash Inbutton]; [BTN set bezel style: NSRattbeizle style]; [BTN SETTITAL: @ "Click Me"]; [BTN Set Action: @Selector (hide labels :)); [Adsview view: BTN] See; but line [BTN set action: @Selector (hide label)]; Do not work, how can I make an action here? The method hides the labels in the function, because I used it with the second button. Does your hidden label method take an argument? If not, leave it: Selector

c# - Two datagrids that share scroll positions, share datasource but do not sync scroll postion -

Hello Stack Overflow, I have a winforms app that has two data grid views in the same To control that point on the same binding resource, its purpose is to show the column 'Customer Name' at all times and the remaining datagrid can be reviewed (horizontally scrolled.) Can I sync up? At present, if the user opens below in the list of scrolling customers, then only one datagrid is affected. Do I need to remove scroll bars from one, and it needs to spin both scenes? Thank you You can use the first grid's scrolling event and the first Set the offset scroll of the second grid with the value of the grid scroll

Using Jasmine to test embedded javascript code -

मेरे पास कोड है जो html में एम्बेड किया गया है: & lt; script type = "text / javascript" & gt; फ़ंक्शन जोड़ें (ए, बी) {वापसी a + b; } & Lt; / script & gt; और मैं सोच रहा था कि क्या किसी को पता था कि यह जैस्मीन और जेक्चर जुड़नार का उपयोग करने के लिए संभव है? मैं जैस्मीन के लिए नया हूँ और समझ में नहीं आ रहा हूं कि इस तरह की कोड का परीक्षण कैसे करें। धन्यवाद मुझे लगता है कि @ pawlik यह सुझाव दे रहा है कि यह अपने आप में बेहतर है। Js फ़ाइल आपके प्रश्न का उत्तर देने के लिए एकमात्र विकल्प यह है कि इस फाइल को स्थिरता के रूप में (लोड फाइलें ('फाइल') विधि का उपयोग करके) स्रोत पर है लेकिन आप सामान्यतः यह टुकड़े (कुछ भी नहीं जिसमें html, सिर या शरीर टैग हैं) के साथ करते हैं और यदि डॉम तैयार घटनाओं में से किसी को जो स्क्रिप्ट टैग्स में निकाल दिया जाता है या इसमें शामिल हैं कि वे चमेली के साथ अच्छी तरह से नहीं रख सकते। आप फ़ाइल को बदल नहीं सकते हैं, इसका मतलब यह नहीं हो सकता कि आप संरचना को बदल नहीं सकते (यानी इसे पुश करें एक अलग स्क्रिप्ट फ़ाइल के...

java - Add tools.jar to Maven 1.x and Eclipse -

Does anyone know how to add / remove MEN in Sun / Oracle JDK in device / generator? After running it, the eclipse will be added to the build path: & gt; Meowen Eclipse I can add the device. George Dependency is pregol in my maven.xml, but when my above order does not help me to set up my project dependencies in Eclipse Please note that this is for Maven 1.x Should be, because our project is very large and has a lot of configuration, which is a source code for manually editing your project dependencies in Elypes. All who examine are required. potential sample. No matter the size of the project, I strongly recommend scheduling time to migrate from Maven 3 to Maven 3. (Do not even think of going to Maven 2, because it will not be so important) I understand. I had to do large migration (200-400 modules in both companies) from Ent to Meven 2.x and Maven 1. To To Maven 2.x. I mean that Maven 1.x has reached the end of life 2-3 years ago (maybe even more). There are som...

php - json_decode returning an array of 1 -

I am trying to decode some JSON into a PHP array. Here's the code excerpt: $ getfile = "{" fname ":" Bob "," lname ":" Thomas "," Cascade ":" Bathoma "," Public ":" Reserves "," Location ":" home2 "}"; $ Arr = json_decode ($ getfile, true); $ Arr ['day3'] = $ selector; Echo (print_r ($ Arrival)); The only thing that is back is '1'. I have checked JSONLint and it is a valid JSON, so I am thinking that json_decode is failing. I have also checked that what is the array before adding the day 3 key, and I still return '1', any help is appreciated! Actual code: $ getfile = ""; $ Getfile = file_get_contents ($ file); If ($ getfile == "") {writeLog ("error reading file."); } Write ("getfile" is $ Getfile); WriteLog ("Dododing JSON Data"); $ Arr = json_decode ($ getfile, true); WriteLog ("de...

c# - Saving List<KeyValuePair to a DB with EF 4.3 -

I have an information that is related to my logical unit class, which is list & lt; KeyValuePair & lt; Int, string & gt; & Gt; . How do I correctly reflect this in my EF code to save the data in the database in the first institutions classes? When your listing organizations can do one more object, it resolved as one relationship from one to another can go. Therefore, there will be two relationships with two tables in this database. So you can add parent to parent bodies car car = new car (); Car.Parts.Add (new part ()); Where a car parts are a navigation property, it defines one in relation to several parts Good luck!

- Where Developers Learn, Share, & Build Careers

I have 8 nodes Kasndra cluster, cassandra 1.0.8. I am trying to insert a lot of small in the loop with batch_matet (). After some time (~ 200K puts) server resets the connection with the following exceptions: org.apache.thrift.transport.TTransportException: java.net.SocketException: org.apache. Reset connection on thrift. transport.TIOStreamTransport.write (TIOStreamTransport.java:147) on org.apache.cassandra.thrift.Cassandra $ Client.send_batch_mutate org.apache.thrift.transport.TFramedTransport.flush (TFramedTransport.java:157) (on Cassandra.java: org.scale7.cassandra.pelops.Mutator at $ 1.execute (Mutator.java:46) org.scale7.cassandra 998) on org.apache.cassandra.thrift.Cassandra $ Client.batch_mutate (Cassandra.java:986) . pelops.Mutator $ 1.execute (Mutator.java:42) org.scale7.cassandra.pelops.Operand.tryOperation (Operand.java:56) on org.scale7.cassandra.pelops.Mutator.execute (Mutator.java:51 At) ... due to: reset the connection to java.net.SocketOutputStream.socketWrit...

c# - Return values from Function -

I have a function that requests the person, the person returns the id, however, if the method detects a mistake , Then I want to return an error (with details). Then, say that my work is: public int GetPersonId (string username) {// logic return person ID; } Within logic, I call a proc, and return an id. However, if no result was returned, I could return -1, and handle it in the calling code - but I think it is not good. Would it be better to make an exception, this, or what? I am sure that I have read once, throwing an exception to the type of business rules is not a good practice. What is the best way to deal with it. In addition, the proc will probably return the other conditions, such as 'the person is present but marked as deleted', 'such a person is not present' etc. I mean there is more than one 'exception'. I think that what you do and what's not in your function clearly distinguish it is required. If no result is found then i...

authentication - How to handle additional login after pressing back with Devise in Rails -

I am creating an application in Rail, which plans for authentication. When you sign into the app, it redirects you to the home page. But if you press back again, then you are presented again with the entrance form. If you then log in to a new user account, you are redirected to the home page again, but still logged in as the original user. Instead, I need an error to pop up on the second login which is saying that we were unable to log in to another account because they were already logged in. From my research it seems that I should be able to do this with a custom controller, is there any easy way? In your controller, determine whether the login page already has a signed user. If there is, redirect it to where they should go after login. Viewing this login page prevents any login usage.

matlab - cell array of struct-Files -

After I have created a cell array of structure-files like this, for example: & Gt; & Gt; Res2 res2 = column 1 through 7 [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] column 8 to 10 [1x1 struct] [1x1 struct] [ 1x1 by struct] & gt; & Gt; Res2 {1} ans = nchi005_randchi005: 0.1061 nfdr_randfdr: 0.0011 nlgt_randlgt: 2.9517e-004 nphast_randphast: 0.6660 ndd_rand_dd: 0.0020 ndd_rand_dd_larger: 1 & gt; & Gt; Res2 {1} .nlgt_randlgt ans = 2.9517e-004 & gt; & Gt; Res {:}. Nlgt_randlgt ??? Poor cell reference operation There is a possibility to access all of the nl2t_randlgt-fields of res2-cellarray at a time? All you need to do is get a struct array from a cell array for your res2 convert (using cell2mat ). You can then get the structure members in the same way you want. Here's an example, where cdat is a cell array of stricuttes with two members, s1 and s2 . cdt [[1x1 structure] [1x1 structure] [1x1 str...

c# - Why not allow Extension method definition in nested class? -

I will be convenient / rational to write my expansions for a class in the nested class, the main reason is that I just Let me name the class extension and let us call the external naming area a unique type name for the compiler. What is the reason for the technical disapproval: Public Sector Fu {ObjectSet & lt; Bars & gt; Bar {receive; Set; } Public Static Class Extensions {Public Static Bar Bye Names (This Object Siteme & lt; Bar & gt; Bar, String Name) {return bars.FirstOrDefault (c => c.Name == Name); }}} While now I have to create a separate free class. Update / Note: I was not thinking this was the fact that an internal class will affect the scope of the availability of the extension method. I just wanted to address the practical coding issue with a different class with a different name. The main point here The following code works: public class Foo {private bool _field; Public Static Class Extension {Public Stable Bull GetField (Foo...

spring - How to POST to database through URL -

I am writing a web application in Spring / Hibernate that handles basic voting functionality / vote / {gameId} There is a link that will add that vote to the database for that specific ID. I'm actually in the form of a loss, though how to complete it. Here I have tried my controller: @RequestMapping (value = "/ vote / {id}", method = RequestMethod.POST) public string addVote (@PathVariable ("gameId") integer game ID) Vote vote = new vote (); Vote.setGameId (GameID); VoteService.addVote (vote); Return "redirect: /games/wanted.html"; } This is where the link appears in a jsp: & lt; C: If test = "$ {! Empty games}" & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; Th & gt; Game title & lt; / Th & gt; & Lt; Th & gt; Votes & lt; / Th & gt; & Lt; Th & gt; & Nbsp; & Lt; / Th & gt; & Lt; / TR & gt; & Lt; C: forEach item = "$ {games}" var = "g...

- Where Developers Learn, Share, & Build Careers

I have successfully used JAXB to make some XML file uncompressed but I have another case Is more complex. Basically my XML file looks like this: & lt; BCLCurrenciesInflation & gt; & Lt; CurrenciesInflation & gt; & Lt; Currency & gt; & Lt; CurencyName & gt; Yen & lt; / CurencyName & gt; & Lt; COUNTRYNAME & gt; Japan & lt; / COUNTRYNAME & gt; & Lt; IssuingDate & gt; 1900/01/01 & lt; / IssuingDate & gt; & Lt; ExpirationDate & gt; & Lt; / ExpirationDate & gt; & Lt; Inflation & gt; & Lt; Years & gt; 1900 & lt; / Year & gt; & Lt; Percentage & gt; 16 & lt; / Percent & gt; & Lt; / Inflation & gt; & Lt; Inflation & gt; & Lt; Years & gt; 1901 & lt; / Year & gt; & Lt; Percentage & gt; 17 & lt; / Percent & gt; & Lt; / Inflation & gt; & Lt; / Currency & gt; & Lt; Currency & gt; & Lt; Curency...

android - PendingIntents won't fire after attempting to add 2nd Home screen widget -

I have a widget that sets many pending candidates is. As long as there is only one widget on my home screen, all the widgets are working just fine. For that time I decided that I was going to restrict the user to one of my home screens widget. If someone is already in use, then ConfigureActivity tells the user a warning dialog box that they can not add a second and then setResult (RESULT_CANCELED, null ). and then finish (). It works just fine and keeps the user from being able to setup any Home Screen Widget, but that will not be the highest pending anticipated fire The logic tells me "pending intention can not be sent:" Each pending entries are set to start a service that is used to update the widget If i do electricity The cast and I'd reset it, it does just fine works fine, as long as I do not try to add another widget. At this point it is a little confused for me. Someone has any idea as to why to start adding another widget, but by completing...

cordova - Android PhoneGap: use res/drawable/img.png in html file -

I'm new to PhoneGap, I want to display images from Android Research. My index.html file is worth drawing / img.png Is it possible in Android Phonegap? Can anyone explain clearly? If you need to insert an image into your custom HTML file, then you will see the images in the reserve directory With no problems, it is on Android ICs. img src = "file: ///android_res/drawable/myimage.png" Depending on the DPI, Android will choose the right image.

Django: Full fledge Facebook and Twitter integration (Django-Facebook, django-social-auth, django-allauth) -

Before posting my question, let me tell you that I will know about some excellent Django packages, Facebook integration: So, my question is: What do i want I want to: Allow users to register through Facebook and Twitter. (It is easy to use any of the above). Allow the integration of multiple social accounts into a user account (I think both # 2 and # 3 can do this.) Create a profile from Facebook or Twitter data (Extended permissions are required in the case of FB), that is, we also need to access data from Facebook and Twitter. Allow the user to post to the Facebook app and app on the Demo app (via form as an action form). Invite and find Facebook friends (# 3 can do this.) Provide the same functionality as the Facebook app (# 3 can do this.) Post to the user-owned Facebook page. (I'm not sure that # 3 can do this.) What do I think If I had to deal with Facebook only So I think Django-Facebook answers all of my questions but since I also want t...

scala - GlassFish 3.1.2 + Cluster + Web Container Properties -

I have an issue in a glassfish in which we are working with the properties for establishing a web application. A package is moving forward from using in the environment Setting up with the glassfish on Amazon AWS Traditionally speaking while dealing with the Servlets you tend to use a .properties file when you Want to parse the environment variable, l Do what you use distributed environment will keep the .properties file in each cluster node). Glassfish has the ability to configure the properties of the web container through their admin console, which means that the properties will be automatically delivered through the cluster The problem is, I want to retrieve the variable I am about to behave randomly. The first time I ran a test application, I could not retrieve the variable, though it does not work anymore Actually I'm setting environment variables through the admin UI. Under the configuration, 3 configuration statches are for a cluster (usually named config), a defa...

- Where Developers Learn, Share, & Build Careers

I have been configured as YUICompressor.NET, an MSBILD job and it is working on my development machine is. When I push the code to the app, I get the following build error: D: \ temporal \ q2hapsex.50d \ input \ Projects \ CroquetScores.Web \ Build \ YUICompressor Goal (21,9): Error MSB4062: "Compressor Tasks" can not be loaded with Assembly D: task \ Projects \ CroquetScores.Web \ Build \. . Compressor.MsBuildTask.dll. The file or assembly file can not be loaded: /// D: \ Temporary \ q2hapsex.50d \ input \ Projects \ CroquetScores.Web \ Bin \ Yahoo.Yui.Compressor.MsbuildTask.dll 'or its dependencies specify one of the systems Unable to locate the file. Confirm that & lt; Using & gt; The announcement is correct, the assembly and all its dependencies are available, and that includes a public class that applies Microsoft.Build.Framework.itask Use of YUICompressor.targets Tasks: & lt; Using Task Function = "Compressor Task" Assembly file ...

- Where Developers Learn, Share, & Build Careers

I currently self-host my chrome extensions - but with recent changes, Chrome for less technical users Extension, I'm considering moving it to the Web Store. The problem is: I do not see a 500,000 + users downloaded a new version from the Web Store to download the next updated version once I get it there. Is it as easy to upload my new version and point to the update_arnal in the manifest. Journals to that download link? Update_url Could there be something that indicates a different domain name than the original extension? The main issue is that the same version of your self-hosted version of Chrome Web Store It needs to be - which means that it has to be signed with the same certificate. In order to achieve this, you also need to upload your signature certificate at the Web Store. Add your certificate to the zip file as the first time in the form of key.pem , when you are uploading your extension, the web store will automatically use it to sign it (remove it from the ...

- Where Developers Learn, Share, & Build Careers

What I'm doing is creating a command line "Game" where there is a 3x3 grid where you have "1" By typing direction (top, bottom, left, right) For example: 0 0 0 0 0 0 0 0 0 I have made it, if 1 is on the edge of the array then it is not allowed to go beyond the boundaries (read: resulting in an index error). I am completely lost whenever I try to move right, I receive the following: Exception in thread "main" java.lang. ArrayIndexOutOfBoundsException: Logic.setMove at 3 (Logic.java:87) on Logic.getMove (Logic .java: 10) at GridGameMain.main (GridGameMain.java13) This is my code: public class GridGameMain {static int [] [] board = new int [3] [3]; Public Static Zero Main (String [] Args) {Board [(Int.) (Math.Rendam) * 2.5)] [(Int. (Math.Rendem) * 2.5)] = 1; For (int i = 0; i I'm not sure that I can not move right when I can move up, down, and just fine. Please tell me that I am not mad! I think there is a problem, to make...

Converting mp3 data to wav data C# -

In my project I'm getting MP3 data in a byte array. I want to convert that data into wav format and store it in another byte array. I have searched the Internet for the Wii Converter for MP3, but all of them have to support the file to file the conversion. None of them is taking raw data as input, is there any way that I can get in C #? The function is a prototype that I am attempting to create. bool converttoowav (byte [] buffer) {// store the data in some processing and buffer buffer 2. Blockcopy (buffer2,0, buffer, 0, buffer.length -1); } This is a long reaction, but I understand it myself NuGet Pad is called NAudio, it offers great functionality for what you want to do. using NAudio.Wave; Private WaveFileWriter.CreateWaveFile (_outPath_, pcm);) using Private Static Zero ConvertMonspov (String_Enpath_, string_outPath_) {(MP3 Fillder MP3 = New MP3 Fill Reader (_inPath_)) {WaveStream pcm = WaveFormatConversionStream.CreatePcmStream ( Mp3))}}} there you go.

android - Uninstall app icon from home screen when app is uninstall -

Once installed, I have put the app_icon on the home screen Want to remove it now, when the app is about to uninstall I know how to remove ap_icon , but I do not know how to do this Can anyone give me a solution for this? In advance thank you When you uninstall an app, app shortcut The icon will be removed (though many copies you have made).

Working with portrait and landscape mode programmatically in android -

I want to create a layout for both portrait and landscape mode (in Java) and want to change the orientation programmatically in the Java file I am Can anyone help me? After the text "itemprop =" text "> you can force a change in the orientation using the program setRequestOrientation (). method of activity class public class example activity extends {@Override public zero onCreate (bundled savedInstanceState) {super.onCreate (savedInstanceState); SetContentView (R.layout.main); // --- Changing to Landscape mode --- Setified Orientation (Activity Infoda. SCREEN_ORIENTATION_LANDSCAPE); To change to portfolio mode, ActivityInfo. SCREEN_ORIENTATION_PORTRAIT Stable: Use, for more information, see. Edit You can add orientation in your specific activity to AndroidManifest.xml Can: & lt; Activity Android: Name = "Demo Activity" Android: label = "@ string / app_name" Android: Screen Orientation = "Portrait" & ...

- Where Developers Learn, Share, & Build Careers

I have come from the world of C # which is doing something like it is allowed. When I try in C ++, I do not get any compiler errors, but I'm not sure it's actually working. So more experienced people are allowed to do this: unit-> gt; Setpozzi (vector 2 (200, 400)); As Vector 2 has a square and the condition of the set requires a vector parameter? Is this permission or I need to pre-start the variable like this: vector 2 aquacare (200, 400); Entity-> SetPosition (aVector); Thanksgiving Vector 2 (200, 400)); OK (and better) If you have defined SetPosition as one of the following: zero set (vector 2 constant and v); // OK: const reference zero setPosition (vector 2V); // OK: value is such, accepting the setposition argument as const context , Or just as value . This will not work though: Zero Setposi (vector 2 and v); // is not ok: non-constitutional reference - In C +11, you can write it (provided you have vector 2 to) : ...

shell - using grep in if statment in unix -

I am a newbie in UNIX, I am trying to write a script that grep and line and file on a certain word It will be printed where it was found that if it is not available and is not available, then it is not available This is my code #! Set the / bin / csh foreach file (`cat file1 ') a =` echo $ file | Grep -n "ok" `if (" $ a "-ne 0) then" $ a "| Encoding $ file second echo "not found" and end and correct syntax #! / Bin / csh foreach file (`cat file 1`) set a =` echo $ file | Grep -n "ok" `if (" $ a "! =" ") Then" $ a "echo $ file else resonant" Android and "

android - AdWhirl not showing AdMob ads -

I have integrated AdWhirl in my project and I just want to display Admob only. But only one advertisement has been shown ... there are no other ads coming ... In logcat this is a refreshing advertisement after 30 seconds but they are not appearing on the screen. I am using the same coding on the adverral official website. Please tell me how I can do this ... I need a very important thing about this: Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: layout_marginBottom = "5dp" Android: Orientation = " & gt; & Lt; TextView Android: Layout_width = "FillPrint" Android: Layout_Hyhat = "Wrap-content" Android: Text = "" /> & Lt; Com.adwhirl.AdWhirlLayoutAndroid: id = "@ + id / adwhirl_layout" Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" /> & Lt; / LinearLayout & gt; And this is in my main ca...

java - Android: Directories & sub-directory listing continuous Activity issue -

I am trying to create a directory list that shows a list of folder names. If the user clicks on the directory name and if that directory has sub-directories then a new activity will be asked to list all the sub-directories. And this process will continue. I have made the first page list, but now because it is a continuous looping process, what approach should I use whether this parental activity can call itself or do I use the initial activity for the result or viewflipper or something else Please suggest please. edit [code added:] main activity class public class main activity list extension provides OnClickListener {button ended, canceled Select, select all; See list view list; ArrayAdapter & LT; Directory & gt; Adapter; & Lt; Directory & gt; List; Hashmap & lt; String, Boolean & gt; CheckedMap; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); Try {setContentView (R.layout.main); Did = (button) findViewByI...

javascript - HTML form validation using JS -

I am creating form validation, but how can using preg_match check in variable works just for empty fields Is doing this, but its not enough any advice? var tekst = / ([a-zA-Z0-9] | [a-zA-Z0-9]) /; Var myForm = document.forms.formaa; Var prek = myForm.elements ['preke']; Var kina = myForm.elements ['kina']; Var k = myForm.elements ['kiekis']; Var uzsak = myForm.elements ['uzsakymas']; If (uzsak.value == '') {Warning ("Needs Spilled"); return false; } (Var i = 0; i & lt; prek.length; i ++) {var preke = prek [i]; Var Kei = Canna [I]; Of Var = of [ii]; If (preke.value == '' || (preke.value). Test (tekst) == incorrect) {alerts ("nezspined"); return false; } If (kai.value == '') {Warning ("Needs Spilled"); return false; } If (kie.value == '') {Warning ("Needs Spilled"); return false; }} You can also use this way, if (x == faucet | x == "") {/ document.getEleme...

java - easiest way to make a web service that reads/writes files -

I'm new to developing web services, so I need an advice about the following: Online service reads two files from user (should I read them from the user's machine or should I save them on the server and read them from there?) Must appear in the table. When a user clicks on a cell, then the row and column of this cell must be saved for later use (should I save these numbers in variables or local files?) The Java program on the server should be called, it uses numbers (produced from step 3) as input. How can this be done? Which language should be used? Your help is appreciated! I would like to go with PHP as you are trying to complete it directly Further JavaServlet may end up (using a CGI called a Java program will be called red), and Javascript is normally a client side which does not sound like what you want.

ruby on rails - How to use paypal-report gem in my views? -

I want to work with PayPal's report When users enter their PayPal email and password If you sign up then I need storage, to use it later, yes? I found this gem - & gt; . How do I use it? I need 'paypal / report' in my business manager . And the documentation says: 'paypal / report' api = paypal :: report.new (user, password, vendor, partner) is required api .daily.inspect I want to add to my merchants. Show.erb, Something like this: & lt;% = api (@ user papoe__mail, @ user.paypal_password) .daily.inspect% & gt; So I can not call from the scene? If the user has messed up the account (this gem is used) is it easy or should I only collect PayPal login data? I think the better solution is to complete all the actions within the controller and assign the result frequencies Which you can use in your view. Caching & amp; Examination will be very easy Example: requires 'PayPal / Report' Class MerchantsController d...

c# - How to return JSON from webservice -

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

android - application should minimize on backkey press -

I have a requrement in my application, if I suppress the backkey application, then I should not quit (as I have Instead of just one activity app, it should reduce the application, such as with the Home key press, any help is being appreciated. Override public null at @BackPressed () {moveTaskToBack (true); }

node.js - callback to handle completion of pipe -

I am using the following node. Js code to download documents from some URL and save it in disk. I should be informed about the document when the document has been downloaded. I have not seen any callback with pipes. Or is there any 'end' event that can be captured upon completion of the download? request (some_url_doc) .pip (fs.createWriteStream ('xyz .doc')); is the stream EventEmitter s so you can hear something . As you said, there is a finish event for the request (first end ). var stream = request (...). Pipe (...); Stream.on ('finish', function () {...}); For more information, you can test which incidents are available.

How to ask the network for the hardware specs from each computer using python -

I do not understand why I'm looking to create a spreadsheet of all the hardware and all software in every computer on my network How do I get hardware or software information from every computer without a computer one by one thanks to everyone! You can use WMI. Look for: should help.

shell - Netgem n5200 (or other) - How to get into linux operating system layer? -

After logging from Puti to NetGam N 5200 device, I open with around 40 fans in the terminal shell, but there is no information about it. I do not know how to close it and work directly on Linux. 99% installed hardhat Linux distribution for the device (Montevista Linux). I can use some simple Linux commands like "simple!", "! Ls -l", "! Ps", from the outlined shell level. Maybe it would be useful that I am in TMP DIR and I can not leave it at this time. I am already searching for NetGam SDK information and I did not find anything, so I came here looking for help. Perhaps you can try to open it using ! Sh or ! Bash command. If not, can you please provide a list of available commands (such as pwd , ls ), some of them A shell can be used (like vi ).

post - Can't access to event posted values -

I'm writing a little Google App Script which allows me to select several names in the developer's list but my doPost (e) In the method, I can not access the array of values ​​posted (this is undefinded), event if I check all the checkboxes ... function on open () {var ss = SpreadsheetApp.getActiveSpreadsheet (); // Add new menu var menu entries = []; MenuEntries.push ({name: "edit page", function name: "start"}) ss.addMenu ("My Tools", menu entries); } Start function () {var app = UiApp.createApplication (); App.setTitle ("Edit Page"); Var formapel = app.createFormPanel (); Var mainPanel = app.createVerticalPanel (); Var GridPanel = app.createGrid (1, 2); // Developer var developperPanel = app.createVerticalPanel () var developer = []; Developers Peash ("John", "Peter", "Max", "Johnny"); (Var i = 1; i & lt; developpers.length; ++ i) {var checkbox = app.createCheckBox (developer [i]). SetN...

ios - Use two different UIViewAnimationCurves in the same animation -

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

.NET application memory usage concerning private bytes vs peak private bytes -

I am testing a long-running .NET application that interacts with an unmanaged DLL and stores memory I am using ProcessExplorer to monitor usage. / P> Private bytes do not increase and it lasts around 21-25 MB, but I get a huge increase in peak private bytes ~ 242 MB What does the peak private byte indicate ? Does the application require memory at some time during processing for your needs or do I have to face a memory leak? I should also mention that the virtual size is about 160 MB

html - CSS: How to set hover effect on menu-item when submenu-item is displayed -

Sorry with the title If it does not look bad, then I do not know how to write a title for my issue I can. / P> So I have a menu bar with some menu items and submenu items: Even what I have done so far. What do I want to keep the menu item in : hover state if its submenu item is hovering , As if my mouse should be dark menu submenu or submenu2 > menu 2 . How can I do this with CSS? I hope that I am clear from my question. Edit: Wooo Many Thanks - Every One It is found: # menu li: hover # menu: hover, # menu a: hover, menu & gt; Add In a last line of your CSS {} > #Menu Li: To target selectors Here's an example updated:

ruby on rails - is REST always feasable when designing an app? if not, what then? -

I am working on a site, but can not come up with a good design for its implementation. Here's the flow: The user selects a shirt. The user's choice is the size of the shirt what the user says what they have to do, and it is added to their car. They can repeat or go checkout. The problem I have is for the line_item to be added to the car, it requires a sku and a design record. Design records are made at the point where they add it to their car. Right now, I have everything in the Store_computer Then I have the preparations like- prepare_for_cart, add_shirt_to_cart, confirm_order, add_design, show_receipt ... I do not know how I would like this stuff I can put some rest in it. It is something that can always be worked with the rest, or does it really work in some cases? What to do to try and make it more powerful and understandable? Are there other applicable design patterns to consider? In almost all cases REST is a possibility, but this is not always the bes...

c# - Find DLL name by having name of the Namespace -

कोड में इस तरह एक पंक्ति है: Company.Security.Logs लॉगएवेंट myLog = null; अब एक अन्य परियोजना में मैं ऐसा करना चाहता हूं लेकिन मुझे नहीं पता कि मुझे अपनी परियोजना में कौन सा "संदर्भ" जोड़ना चाहिए? तो मुझे कैसे पता चलेगा कि इस सुरक्षा के संदर्भ में किस संदर्भ में हमारे पास यह सुरक्षा वर्ग है? राइट क्लिक दृश्य स्टूडियो में कक्षा नाम पर और घोषणा पर जाएं। यह आपको या तो DLL दृश्य या कोड दृश्य में ले जाएगा, जिनमें से कोई भी आपको बताएगा कि वर्ग किस विधान में रहता है।

c++ - using of extern "C" without function -

I book Dale Rojrson "Inside COM" read a chapter 5, He wrote (sorry, I translated into English Is): extern "c" is for linkage. So has been marked as a function Exile 'C' , not wil compiler, for example, change the function name to another :? CreateInstance @@ YAPAUIUncnown @@ XZ . It does not explain the obvious to me but uses the author's extern "C" before the other place because: Include # lt; Objbase.h & gt; Execution 'C' {// {32bb8320-b41b-11cf-a6bb-0080c7b2d682} Execution Constituency IID IID_IX = {0x32bb8320, 0xb41b, 0x11cf, {0xa6, 0xbb, 0x0, 0x80, 0xc7, 0xb2, 0x82, 0x82} near} ; // {32bb8321-b41b-11cf-a6bb-0080c7b2d682} exile constant IID IID_IY = {0x32bb8321, 0xb41b, 0x11cf, {0xa6, 0xbb, 0x0, 0x80, 0xc7, 0xb2, 0xd6, has 0x82}}; // {32bb8322-b41b-11cf-a6bb-0080c7b2d682} exile constant IID IID_IZ = {0x32bb8322, 0xb41b, 0x11cf, {0xa6, 0xbb, 0x0, 0x80, 0xc7, 0xb2, 0xd6, has 0x82}}; // Extern C ++ is necessary...

linux - Ruby on rails: cannot install FFI 1.1.5 and bundler cannot continue -

I am following the tutorial and am on the third chapter (static page). When I try to immediately install bundle by listing 3.1, the command returns an error message which indicates a failed linking. A snippet of error is shown below: Using bundler (1.2.1) Using nogogiri (1.5.5) Installing FFI (1.1.5) with local extension gem: : Installer :: ExtensionBuild Errors: Error: Failed to create gem native extension Check for / usr / bin / ruby18 extconf.rb ffi_call () in -lffi ... check for ffi_prep_closure () ... yes check for ffi_raw_call () ... yes check for ffi_prep_raw_closure () .. There is no check for rb_thread_blocking_region () ... ruby_native_thread_p () checking for yes ... no checks for rb_thread_call_with_gvl () ... make any extconf.h makefile create .... .. ... x86_64-pc-linux-gnu-gcc - i - I -i / usr / lib64 / ruby ​​/ 1.8 / x86_64-linux -I -DRUBY_EXTCONF_H = \ "extconf.h \" -fPIC -O2 -Pipe -fno-strict aliasing -fPIC I / usr / lib64 / libffi-3.0 .10 / -c Last...

sql - duplicate rows in table, but need to change data in one column -

मेरे पास तालिका step_year है: id, step_id, वर्ष I उन सभी पंक्तियों का डुप्लिकेट बनाना है जो वर्ष = 1011 (चरण = वर्ष से * चुनें * वर्ष = 1011), लेकिन उसी वर्ष (1011) होने वाली उन नव निर्मित पंक्तियों के बजाय मैं इसे 1112 में बदलना चाहता हूं। किसी भी मदद की सराहना की जाती है। आप INSERT कोड> सेलेक्ट लेकिन इसे क्वेरी से खींचने के बजाय वर्ष निर्दिष्ट करें `step_year` (` आईडी`, `कदम_आईडी`,` वर्ष`) में शामिल करें चयन 'आईडी' , `Step_id`, 1112 के रूप में` वर्ष` से `चरण_ययार` जहां` वर्ष` = 1011 यह वाक्य-रचना MySQL के लिए है, लेकिन अधिकांश डेटाबेस के लिए अनुकूलनीय होना चाहिए।

How to get Rails 3 to run in production mode on server w/ Passenger -

Hi, I'm turning Passenger / Occasions / Rail 3.2 (with an active record or mysql) with a Capistrano deployment script. I'm trying to run my app in production mode on my Linux server. I have the following in my Apache configuration file ... & lt; VirtualHost *: 80 & gt; ServerName example.com ServerAlive www.example.com DocumentRoot /srv/www/example.com/current/public Error Log /srv/www/example.com/current/log/error.log CustomLog /srv/www/example.com / Current / log / access.log combined passenger default user www-data & lt; Directory /srv/www/test.example.com/current/public> Allow all options - Multi-view & lt; / Directory & gt; RailsEnv production & lt; / VirtualHost & gt; Edit: My environment. I do not have the following in the RB file ... Railway_NV = "production" RAILS_ENV.freeze In my Capistrano deploy.rb I have the following ... set: rails_env, "output" edit: but when I deployed via capistrano ...

cakephp - i18n in cake - how to use language shortcut like en instead of eng -

My app is ready for my translation but unfortunately I use the 'N', 'D' and 'PL' language shortcuts Instead of developing it, instead of 'ng', 'jer' and 'pole' now I think that when I do the Configure :: write ('Config.language', 'pl') I do not want to read the translation from App / Locale / pl / LC_MESSAGES / default .po - but it works with pol for example. The problem is that using all my links, internalized files and so on 'N', 'D', 'PL' - I can not convert it to 'IG', 'Poll' and so on ... Could the cake be forced to use my configuration? "post-text" itemprop = "text"> You can use 2 code language code for config configuration values ​​and your url but your local Name the folders using the same 3 letter code. Therefore folders locale / nag , local / dU , locale / pole for your language code 'n', 'd', 'pl' The cake w...

- Where Developers Learn, Share, & Build Careers

I would like to do Solr to store the whole index instead of multiple segments The closest thing to customize it, is documented here: Generally, a Lusen optimization Reduces the index Some variables in a segment can change that behavior, such that an optimize can not be reduced in a segment . Note that this is a very expensive operation, and generally it should not be done very often, documents will have to be added, modified or deleted, and will have to resize you. Will be required.

javascript - Dynamically Written script not functioning -

I'm bashing my head against a wall for about 4 hours, trying to figure out That's why it does not work I have a program that needs to write code based on the number of results from SQL query. I am using an easy library. When it's hard-coded, it works: & lt; Body id = "body" onload = "bodyLoaded ()" & gt; & Lt; An id = "link" href = "# test" title = "snowflake" rel = "lightbox" & gt; Hello & lt; / A & gt; & Lt; Div id = "test" style = "display: none; width: 320px; height: 240px" & gt; & Lt; P & gt; Test Content & lt; / P & gt; & Lt; / Div & gt; & Lt; Script type = "text / javascript" & gt; Function body loaded ($ {'(# link'). Etr ('onclic', 'logext ("hello")'); } Function log text (message) {console.log (message); } & Lt; / Script & gt; However, when the link has been ...

swing - How to grey out JButton in Java -

How do I gray in / out swing pocket? What method can I use? Also, how can I create it in Netbeans by default? button.Set enabled (false); The above should fix a button properly. I'm sure you have this document bookmarks or will be downloaded and read a bit about it Edit My impression is that you are using a GUI constructor in Netbeans, I would recommend reading on swing and learning the language instead of IDE (There may be times when you have Netbeans Compared to using a different IDE The Hta and how GUIs, it does not have a clue)

c# - String.indexOf returns non-negative index when search string does not occur in string -

I am parsing some log files to create a report, but String.IndexOf () On some lines, using C # is the easiest to understand with some code here. string line = "June 29 14:34:19 localhost axis 2_http_server: CEF: 0 | AOPTix | IRIS | 4.1.0.1664.2839 | AD 214030000301-2610017 | 114 | SDK_ACCACS | 4 | Time = 1340 9 80459 comp = 10 compinfo = = 8 results = = User = admin thread = 1305: 1 9 62 msg = ation = 0.00, face collar = 11.49 HR face ICAO compliant, inter-disciple distance = 140.00 Capture LEFT_uid = -1, blacklist = 0 No match found on right eye (database is empty) RIGHT_uid = -1, blacklist = 0 Capture successfully completed - send SOAP reply Done. " Int ctIndex = line.IndexOf ("CaptureTime ="); Return ctIndex; Expected: -1 Real: 11 This would only be about 2 lines for a gig of log files is. Actual implemented method Personal Timespace Pars calibration {string line} {int ctIndex = line.IndexOf ("CaptureTime ="); CtIndex = ctIndex + ...

perl - Why does 'chop' not work with ? -

I am trying to explain why the chat function does not work for me to try to take input from the user Has been: My $ string = & lt; STDIN & gt; My $ chr = peak ($ ​​string); Print "string: $ string \ n"; Print "Four: $ chr \ n"; output perl chop.pl Hello string: Hello four: But if I use a string I do it, so it works! My $ string = "frong"; My $ chr = peak ($ ​​string); Print "string: $ string \ n"; Print "Four: $ chr \ n"; output [583] perl chop.pl string: fron char: g When you pass the input from the console, cutting chop to newline At the end is the string, which exists when you press Enter while your string does not have this.

Unexpected nested loop behavior in javascript -

I am implementing in a way, and I have run some unforeseen behavior: Var searches = ['beta', 'alpha']; Var i = 0; J = 0; (I = 0; i & lt; search.length; i ++) for {min = i; // Through the first time, i = 0 warning (i); For (J = I; J & LT; Searches; Long; J ++); {// First through Jammu 2. If I = 0, then how is J = 2? Warning (j); // Sort code}} In fact, which is always 2. When this is not set to Jammu on entering the loop? Here is JSField: You have a semi-colon at the wrong place : for (j = i; j and lt; searches; length; j ++); // & lt; - The remainder is interpreted as a block that executes the loop after (when j == 2 ) . Take it out and it works fine and it works fine.

javascript - Form popup window getting block in internet explore -

This form is estimated to go to the next and open another popup window. I am passing this form of data on both pages. The problem I have is that the popup window is visible in all the browsers except IE, it keeps getting blocked by popup blockers in IE. I need popup to show without blocking me. & lt; Script language = "javascript" & gt; Function myChangeHandler () {var form = document.getElementById ('TheForm'); Form.method = 'POST'; Form.action = 'https://test.com/page1'; Form.target = 'window_1'; Window.open ('', 'window_1', 'fullscreen = 1, scrollbar = 1'); This.form.submit (); Var state_ac = document.getElementById ('stdroop'); Var state_dd = state_ac.options [state_ac.selectedIndex] .value; Window.location = 'https://test.com/page2'; } & Lt; / Script & gt; & Lt; Form id = "TheForm" verb = "https://test.com/page2" method = "post" & gt; ...

- Where Developers Learn, Share, & Build Careers

It appears that the innocuous pattern is generating a pattern syntax expression: String pattern = "^ (?.: *) \\ * {$" s; // is pattern: ^ (?:. *) \ S * {$ As you can see when you are looking at it, it seems that working properly . For example, that string should match: name { The message I'm bringing back is " Index 9 has illegal repetition "but I do not know what I am doing, which is illegal, criminal character should match any number of white space between the final section and Is anyone wrong who I am? prevent you from { to \\ is required.

- Where Developers Learn, Share, & Build Careers

Recently I found that I need to create a mono 3.0 for CNOS 6, to request my infrastructure Otherwise the system is close to CentOS as possible (i.e. if possible, a third-party package). Because there is currently no mono 3.0 rpm which I can get, I clean it, install Minos of CentOS 6.3. It is possible to build Mono 3.0 with an external package on CentOS 6.3. install a CentOS 6.3 at least ifup eth0 yum -y update yum -y install glib2-devel yum -y install libpng-devel yum -y install libjpeg-devel Yum -y install giflib-devel yum -y install libtiff-devel yum -y install libexif-devel yum - Y install libX11-devel yy -y install fontconfig-devel yum -y install gettext yum -y install yum -y install install gcc -c ++ # Entertaining hack export echo = echo # build libgdiplus curl -O http://download.mono-project.com/sources/libgdiplus/libgdiplus-2.10.9.tar .bz2 Binzip 2 libgdiplus-2.10.9.tar.bz2 tar xvf Libgdiplus-2.10.9.tar cd libgdiplus-2.10.9 .configur E --prefix = / usr /...

java - Is it possible to distribute a recursive algorithm? -

I'm unsure of distributing an indefinite program. It is currently run as a recursive and a single program, but my goal is to distribute this program to other machines which only generate a subset of data. The background of this program is here, I give it a list of targets (10 in this case) and minimum / maximum weight items and it gives a combination of each. with 3 items, and lower = 2, 2, 2 high = 6, 6, 6 target = 10 The result is: 2 2 4 2 3 3 2 4 2 3 2 3 3 3 2 4 2 2 Here's the way to work : zero distribution (int i, int [] low, int [] high, last int breast, int [] size) {// System.out.println (i + "+ + + + "+ Size"); If (I == sizes, length - 1) {if (left & lt; high [i]) {size [i] = rest; Result.add (Arrays.copyOf (size, size, length)); }} For (int c = 0; c & lt; = java.lang.math.min (high [ii] - less [i], rest); ++ c) {size = i] = c; Distribute (i + 1, low, high, comfort - c, size); }} Let's think if anyone has any idea ho...

- Where Developers Learn, Share, & Build Careers

मैं उपयोग करने की कोशिश कर रहा हूं: itms-services // action = download-manifest यूआरएल को स्थानीय रूप में फ़ाइल, वहाँ है कि के माध्यम से plist फ़ाइल का उपयोग करने का कोई मानक तरीका है? मैंने इसे डेवलपर्स के लिए ओटीए एप अद्यतन करने के साथ एक ऐप में किया है; मैंने सोर्स कोड में क्या देखा था कि एक फ़ाइल: // लिंक इस्तेमाल किया गया था यदि आप ऐसा करना चाहते हैं, तो आपको फाइल सिस्टम में फ़ाइल का स्थान जानना होगा। उसके बाद, आप एक मानक plist फ़ाइल का प्रयोग करेंगे, लेकिन यूआरएल कुंजी में, आप फ़ाइल डाल देंगे: // location / to / your / ipa / फाइल और यह अनिवार्य रूप से एक ही होगा यद्यपि, यह काम करने का सबसे अच्छा तरीका नहीं है, क्योंकि यह अज्ञात है कि उपयोगकर्ता के पास उनके डिवाइस पर आईपीए फाइल है या नहीं।

javascript - twitter bootstrap modals not working when pushed to Heroku -

Models work locally, but when I push, they are not showing to me , Or those people who should be shown automatically. Was anyone ever on this issue? & lt ;! - Model window to explain - & gt; & Lt; Div class = "modal feed center" id = "self -b" tabindex = "- 1" role = "dialog" area-labeling = "myModalLabel" aria-hidden = "true" & gt; & Lt; Div class = "modal-header center" & gt; & Lt; H3 style = "font-weight: normal;" & Gt; First things first & lt; / H3 & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Script type = "text / javascript" & gt; $ ('# Self-b'). Model () & lt; / Script & gt; Answer to this thread: A gem was updated and the sequence to load js in appliction.js was reversed. Put tree is required at the end it was fixed.

java - What's wrong with this code to make it not add the divisors to sum each time? -

I am trying to write a program for a laboratory in class, and I believe that I , But it will not add partners by joining the div (code in the code) and if they return the correct number and wrong otherwise the truth will compile. My code compiles and runs fine, but only a false return, Staying on (it starts after 1) Each number in the denominator). The number is brought from a private built-in constructure and is related to the set statements. public boolean is successful () {int x = number -1; Int div = 0; Int sum = 1; Whereas (x> 1) {if (number% x == 0) {div = x; Sum = + div; } X--; } If (amount == number) {return true; } Other {return false; }} as well as + = / = + Issue, your code also says that 1 is one, which is wrong (6 is the first complete number). The reason for this is that you start with the sum of 1, the loop is not executed exactly, then you compare sum and number That is equal to 1. You can only add a check for this particular case, for example ...