Posts

Showing posts from July, 2014

UIWebview and IPhone content does not postback (ASP.NET Browser Capability issues) -

मेरे पास एक सरल पृष्ठ है, इसकी संरचना निम्नानुसार है (छद्म कोड): & Lt; एएसपीएक्स पृष्ठ & gt; & Lt; एस्कक्स नियंत्रण & gt; & Lt; asp: dropdownlist id = "dd1" ऑटोपॉस्टबैक = सच / & gt; & Lt; asp: dropdownlist id = "dd2" / & gt; & Lt; / ascx नियंत्रण & gt; & Lt; / aspx पृष्ठ & gt; किसी भी डेस्कटॉप ब्राउज़र में, वापस dd1 पोस्ट और "चयनित इंडेक्स चेंगर्ड" सर्वर इवेंट को निकाल दिया गया है। हालांकि, आईफोन सफारी या आईफोन वेबव्यू में कोई पोस्टबैक नहीं किया गया है। मुझे यह पता है क्योंकि कोई भी नेटवर्क गतिविधि संकेतक नहीं दिखाया गया है और मैंने उस साइट पर डिबगर को लगा दिया है जो सभी सर्वरों की घटनाओं को पकड़ता है और इसे कभी भी नहीं मारा जाता है कभी-कभी, हर 2 घंटों के बारे में एक बार, पोस्टबैक आईफोन पर काम करता है, लेकिन बहुत कम और अंतर से। डीडी 1 एक डेट ड्रापडाउन है जो एक स्लॉट ड्रॉप डाउन लोड करता है जो कि चयनित आइटम पर निर्भर होता है तिथि ड्रॉपडाउन यह प्रपत्र कई जगहों में फिर से उपयोग किया जाता है और मैं मूल...

php - If server doesn't have mod rewrite -

I have a question about mod_rewrite. I know in htaccess that i & lt; IfModule & gt; , but what is in PHP? In HTML I am writing my links like projects / 24 which is actually action = projects and id = 24 . If a person has installed this app, then there is no mod_rewrite in it, so how can I change the link to get Vars in PHP? use edit: It is not what obstacles vote for the correct answer, but he can not apparently do an RTM. For example, some code is given: Use this to decide which type of link you want to write.

Uploadify Rails 3.0 - Nothing happens after file is chosen -

I am trying to get uploadify to work with railways 3 but with very little success, Everything has read a lot to read, and tried a lot, but nothing seems to work here with my javascript / jquery ..... form field . & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () click on {$ ('# video_upload') (function (event) {event.preventDefault ();}); $ ('# video_upload') uploadify ({'Uploaders ':: / Javascripts/uploadify/uploadify.swf', 'script': '/ video / create', 'sizeLimit': '2000.bytes',' cancelImg ':' /images/cancel.png ',' Multi ': false' scriptData ': {' Format ':' json ',' authenticity_token ': encodeurIComponent (' & gt;; '}}}); $ (' # video_submit ') Click (function (event) {event.preventDefault (); $ ('# video_upload') Upload Upload ();});}); & Lt; / Script & gt; & Lt; Input i...

Algorithm for matching strings between two large files -

itemprop = "text"> I have a question about a search algorithm. I currently have 2 files in plain text, each of them has at least 10 million lines for now, every line is a string, and I want to find every string in the first file which also appears in the second file is. Is this a good way to do it efficiently? Any suggestion by the algorithm or the convenience of a particular language is appreciated. "post-text" itemprop = "text"> If you do not know anything about the structure of the files (such as they are 're-sorted), many different There are approaches that you can take to solve the problem, depending on your obstacles used to memory and location, what you want to be. If you have a free RAM available, you will have to make a hash table in memory to capture an option string. You can then load all the strings from the first file into the hash table. Then, load each string from the second file at a time, for each string, check whether th...

Reading from text files C++ -

I have a text file that has three columns of numbers; Each column for a group of digits is x, y, z . All the codes are between 0 and 1 . I have created the following structure: typedef struct {double Xcd, ycd, zcd; } Point; I want to create structures of type-N array type point then I want to scan the text file line by line and n th particle, I want to place the n th line in the related code in three numbers> Xcd , ycd and zcd statuses Tell me if there are some effective ways to go about this. ifstream Just like it, before it has been shown five million billion kajillion times , vector and other other accouterments. ifstream infile ("myfile.txt"); // Check that the file has been opened successfully (! Infel) {cerr & lt; & Lt; "Failure Can not Open File" & lt; & Lt; Endl; Cin.get (); Return EXIT_FAILURE; } // container in which all the points vector and lieutenant; Point & gt; Points; // To keep three call...

sql - CASE statement in update -

I have a scenario here where I am running 2 different update queries. By using the case, How can I add to the question? Update Table 1 SET ACTV_IND = 0 where is the name (NAME is selected by NAME, where SID = 'child' is going to be MAX MAX CAST (INT as ACTV_IND) = 0 ) And SID = 'original' update table 1 SET ACTV_IND = 1 where is the name (select NAME from tab3 where SID = 'child' by NAME MAX (CAST (ACTV_IND) INT) = 1) AND SID = 'parent' Question 1: I suppose That this solution can be done ACTV_IND = MAX (CAST (ACTV_IND INT)) Question 2: This is to be included for updates It is possible Update T1 SET T1.C1 =: Val1 to TABLE1 T1 in table T2 ON T1.KEY1 = T2.KEY2 I will try to do something like this, assuming that MAX ( Select DATA_SOURCE (NAME, VAL) AS (NAME, MAX (CAST () as ACTV_IND INT) with CAST (ACTV_IND INT) 0 or 1 ) from TABLE to VAL where SID = Group 'NAME' by group UPD ATE Table 1 SET ACTV_IND = DSLL From TABLE ...

Why can't I import static java.lang.System.out.println? -

It seems weird that I can not import static java.lang.System.out.println, when I import static Java I can .lang.Math.abs. Is there any reason behind this or am I really doing something stupid that I do not see at this time? (Using eclips.) math is a class on which Ab is a static method, system.out is a static field instead of a class, so its println method is not actually a static method, rather There is an example method on a static field.

flex - how to upload local user image and overlay onto flash video/animation -

I want to create a custom video such as video on jibb, that means uploading and pasting the image of your face to the user A character's face is on video. Can anyone tell me in the right direction how to go about this? Any sign will be appreciated thanks There is no built-in method Do, and I suspect that any library can help you, because no one can detect the face outline with 100% accuracy Create a new movie clip Insert a video to the timeline of this movie clip Create a shape with the same framework as the face in your video Rotate the frame, move, shape and rotate the frame so that it follows the face in the video Once you do this work, Swap the shape with the face and your custom video will be

javascript - onmousedown hide/show div -

I want to create a function that hides / shows a div when clicking on a button The ID will be able to pass which I want to hide through the event. But I'm not sure how to do this. This is what I have done so far: & lt; Div onmousedown = "toogleDiv (badge)" & gt; // click here, div id = hide badge Icons v toogleDiv (id) function {var s = document.getElementById (id ).Style; S.display = s.display === 'None'? 'Block': 'None'; } Then you use the ID as a string as togglediv (item) togglediv (instead of 'item') Can

ruby on rails - What's a smart way to implement a Maintenance page in a Heroku app? -

Is there a clean, elegant way to implement the Maintenance Page in a Hearoku app? So if something breaks you can easily switch a switch and the maintenance page goes ahead for all the requests? Preferably a method which is not needed? Thoughts? Thanks Or Harko's own maintenance mode for this scenario -

javascript - .animate() not working? -

Can not animate my background image ' $ (function () {$ ('# Nav1'). Bind ('click', function) {$ ('ul.nav'). Stop (). ({Background page: 'right head'}, 1000);}) ; $ ({Backgroundposition: 'right 38px'}, 1000) ($ ('(right)'; ()) $ $ (function () {$ ('# nav3'). Bind ('click', function } {$ ('Ul.nav'). Stop (). Chetan ({background page: 'right 76px (), $ 1000 () () ($) () ($) ($ (function) ($ (' # Nav4 '). Bind (' click ', function (event) {$ (' ul.nav '). Background: Administration:' right 114px '}, 1000);}); and html code what would id = "nav3" & gt; Portfolio & lt; a href = "# contact" id = "nav4" & gt; Contact & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; I have not tried using pixels like this background, but it is still not animating, it just changed the situation And another...

javascript - To use getAttribute(), or not to use getAttribute(): that is the question -

संभव डुप्लिकेट: कई बार, मंचों या स्थानों जैसे यूज़नेट I में कुछ (जब मेरे कोड की आलोचना करते हुए) कहा गया है कि कहने के बजाय, उदाहरण के लिए var link = a.href मुझे उपयोग करना चाहिए var लिंक = a.getAttribute ('href'); इसके बजाय। और अपने पूरक setAttribute () का उपयोग करना चाहते समय का उपयोग करें। वे कहते हैं कि ऐसा करने का सही तरीका है, मैं गलत हूँ, ब्ला ब्ला ब्ला ... मैं नहीं सामान्य रूप से उन पर ध्यान देते हैं और जब मैं पूछता हूं कि कोई भी असली जवाब क्यों नहीं देता। अब मैं इस बारे में उत्सुक हूँ कि किस मामले में यह एक या दूसरे का उपयोग करने के लिए अधिक उपयुक्त होगा। कौन से मामलों में अधिक होगा var लिंक = a.getAttribute ('href') कहने के लिए उपयुक्त; के बजाय var link = a.href ? और किस मामले में मैं SetAttribute () एक सदस्य को उसके पहचानकर्ता द्वारा सीधे मान निर्दिष्ट करने के बजाय असाइन करने के लिए? यानी: `a.href = 'someURL'; जब भी कोई एक अभ्यास की सिफारिश करता है, तो उसे हमेशा सही ठहराना चाहिए सलाह। getAttribute और setAttribute ...

Why I'm getting an error informing that "a result was not expected" when executing stored procedures on PostgreSQL from Java in a batch? -

I have this process in the database: create or replace functions Functions per page Return to Zero Outline as Copy (ID INT, Value REAL) $$ Page Relevance Values ​​(ID, Value); Exception when unique_iolation then updated page relevance SET relevance = value WHERE pageId = id; END $ $ LANGUAGE plpgsql; and this code that calls this function: Select the private last string PAGE_RELEVANCE_SQL = "replace page copy (?,?,: Real) "; Try (cobbler ctm = conn.prepareCall (PAGE_RELEVANCE_SQL)) {for (Entry & lt; integer, double> entry: weightMap.entrySet ()) {cstm.setInt (1, entry.getKey ()); Cstm.setDouble (2, entry.getValue ()); Cstm.addBatch (); } Cstm.executeBatch (); } Hold (SQLException e) {LOGGER.error ("error in search of page relevance:" + e.getNextException ()); }} When I execute a batch, the value is converted or converted into a table, but after that, I get an exception while informing that There was a result when no one was expecting to retu...

How do you overwrite instead of append to a text file in Android? -

फ़ाइल myDir = new file (getFilesDir)। GetAbsolutePath ()); फ़्वाइरटर एफडब्ल्यू = नए फ़्रीवेयर (myDir + "/score.txt"); Fw.write ("हैलो वर्ल्ड"); fw.close (); उपरोक्त कोड टेक्स्ट फ़ाइल को जोड़ता है। आप इसे कैसे ओवरराइट करते हैं? जवाडॉक्स आपका दोस्त हैं: आपूर्ति झूठी और आप ऐपेंड के बजाय अधिलेखित करेंगे। फ़्वाइरटर एफडब्ल्यू = नया फ़्वाइरेटर (माइडीर + "/ स्कोर .txt ", झूठी);

javascript - How to make IFRAME listen to scroll events as parent when click event within parent iframe is triggered -

मेरे पास एक एचटीएमएल पृष्ठ में दो iframes हैं & lt; तालिका सीमा = "1" चौड़ाई = "100%" ऊंचाई = "100%" & gt; & LT; टीआर & gt; & Lt; th & gt; आईफ़्रेम आईडी = "i1" width = "100%" height = "100%" src = "/ wordpress" & gt; & lt; / iframe & gt; & lt; / th & gt; & Lt; th & gt; आईफ़्रेम आईडी = "आई 2" चौड़ाई = "100%" ऊंचाई = "100%" src = "/ वर्डप्रेस" & gt; & lt; / iframe & gt; & lt; / th & gt; & Lt; / टीआर & gt; & Lt; / तालिका & gt; मैं क्लिक करें घटना दे रहा हूँ "" टैग href बदलने के लिए करने के लिए इतना है कि जब कि iframe के भीतर किसी भी लिंक पर क्लिक किया जाता है और आईडी "i1" के साथ iframe के स्रोत दूसरा iframe के स्रोत में परिवर्तन बाद में भी बदलाव और दोनों iframe का एक ही पृष्ठ दृश्य है। $ ('a')। क्लिक करें (फ़ंक्शन (e) {var id = $ (this) .attr ('id...

Android Eclipse Break Point Problem -

I am using Eclipse 3.6 for my Android app and I do not know how to eclipse and break in Eclipse Insert point so you please give me a link or guide me I tried to do a lot to search on Google but none of them was easy to understand. I also tried this link: but it was also not useful. Try these links:

How did this pointer get resolved in this C code? -

I have some code (below) where I am specifying the address of an integer array for an indicator. I am telling two ways and expecting two separate outputs, but in both cases the output is similar. main () {int a [] = {11,2,3}; Int * p = & amp; A; Printf ("% d", * (P +1)); } This should give me some garbage because p is pointing to the next 1D array main ( ) {Int a [] = {11,2,3}; Int * p = a; Printf ("% d", * (P +1)); } It should print 2 . Although the print of both of these tasks 2 It is not what I expected that someone could tell what is happening? Can someone tell me how I point the pointer to the whole array just as compared to the different element. If you compile the program first, you will receive a compiler warning: Warning: Getting Started with Incompatible Notifier Type Because the type of p is the indicator for the integer, but the and type It is OK to compile the other program, because again the p type int * ...

oracle10g - SQL Query Start and End Date -

This is slightly different from this: And I do not know how to I suck in English table name. Date Foo | 1-Sep Foo | 2-Sep Fu | 3-Sep Foo | 5-Sep Foo | 6-Sep Fu | 7-Sep Foo | 1-Dec Fu | 2-Dec Fu | 4-Dec Fu | 5-Dec Foo | 6-Dec Fu | 7-Dec Fu | 8-Dec Fu | February 1-Fu | February 14 FU | February 15 FU | February 16 Fu | February 17 FU | February 18 FU | February 19 Fu | February 20 FU | 22-February I need to create a query with the following result query results names | Start date Last date fu | 1-Sep | 3-Sep Foo | 5-Sep | 7-Sep Foo | 4-Dec | 8-Dec Fu | February 1 | February 1-Fu | 1-Dec | 2-Dec Fu | 14-Feb | February 20 FU | February 22 | 22-Feb Update: Start date: The first day of a series of consecutive days End date: Last day of a series of consecutive days If a date is not included in the series of consecutive days, as above 22 February, the beginning and end Date Not sure what's the best way to do it first You can filter the dates that ar...

css - Weird image moving on html site -

I am creating a web site and suddenly I ran into a problem. It is not very big, but I would like to fix it. I have many images on my site but there is a mess that the images are "dragable" I mean, when you click on an image and dragging the image instead of moving your mouse. How can this be fixed? It is always the case that nothing seems strange in it. Still, this link can help you: You can use javascript to avoid drawing a picture: html file: & lt ;! - Correct image (dragging disabled) - & gt; & Lt; Img src = "image.png" onmousedown = "if (event.preventDefault) event.preventDefault ()" & gt; javascript: // Anonymous event with online event window.onload = function (e) {var evt = e || Window.event, // defined events (cross-browser) imgs, // images collection i; // Used in local loop // If preventDefault is present, then define the onmousedown event handler if (evt.preventDefault) {// Gather all the images on the p...

osgi - Installing a fragment requires a refresh on the host, how can this be avoided? -

I have two bundles: Bundle A and Bundle B, which is configured as a piece of bundle: Fragment -Host: Whenever I install Bundle B, it fails to start (has been installed) and so it is necessary to attach bundle A. At this point when I look at the condition of Bundle A, I think that it still recognizes' Bundle B as its piece. If I refresh the bundle, then this problem solves the problem - Bundle B is switched to the resolution and is able to attach it to the bundle, Bundle A will be able to attach the bundle B to its pieces My question is how can this refresh be avoided, such as Bundle B, it should be attached to its host soon as it is already active. Thank you. You can not do this without refreshing, and it is also in OSGI glasses - right one Attach the slice bundle, Resolve a host from the installation to the host bundle. I is required 4.3 See the OSGI Core Specification Section 3.14.

scroll - iScroll jquery mobile plugin. Better to initiate this 50 times or turn touchmove even listener back on again? -

This is actually a common question for each scrollable area, to use iScroll with my mobile app , You have to start a new scroller: If no devices are mounted by memory / CPU, there is no limit to the number of iScrolls. The type and length of content affects the number of ISCrols you can use together " But I have 50 odd pages that require scrolling functionality. Using IScroller For this, I have to disable this event to touch: document.addEventListener ('touchmove', function (e) {e.preventDefault ();}, false); I can reduce the amount of scrollers on just 4 if I (somehow!) Workout To enable touch event events on some pages I can. Know what I want, do I want to improve and disable the TouchMov event, or better to start just 50 scrollers? ? Thanks in advance. The page on which you enable / disable You can use pagecreate to decide touchmove . To do this, copy per page Add: $ ('# myPageName'). Live ('pagecreate', function (event) {c...

Check the dates in JavaScript -

I want to see two dates in java script. The date format is YYYY-MM-dd. var date1 = 2011-9-2; Var date1 = 2011-17-06; Can someone say how I can write the condition? If you mean you want to compare them and your variable is string, just for comparison Use ==. var date1 = '1990-26-01'; Var date2 = '2000-01-05'; If (date1 == date2) {warning ('date1 = date2')} other {warning ('something went wrong'); }

How to use Eclipse Mercurial Plugin to produce a patch? -

I'm new to Mercury and Eclipse Mercurial Plugin. This is the thing that I have made changes in a file, and committed. I have two modifications to this file and I need to create a patch / digf file between the first and second revisions. How can I achieve this with Mercurial / Eclipse Mercurial Plugin? I do not think that You can export a patch to a certain file or file (Team -> Export Patch) you can do via Eclipse GUI. You have to use the command line (HG log-P) on the modification that you want to patch.

objective c - Multiview app memory leak warning. -

I created a multiviapp app based on this. This is my code appdelegate.h @class Disclaimerviewcontroller; @ Interface GAINSAppDelegate: NSObject & lt; UIApplicationDelegate & gt; {Disclaimer Controller * First view; } @ Property (Nonomatic, Retaining) IBOutlet UIWindow * Window; @property (nonatomic, retained) Disclaimerviewcontroller * firstview; - (zero) switchviewview: (UIView *) View 1 overview: (UIView *) view2; I have the following in @end and ".m" - (BOOL) Application: (UIApplication *) Application FinishLaunchingWithOptions: (NSDictionary * ) Launchoptions {// Override Point after application launch [auto Windows and knowledgeable]; Disclaimerviewcontroller * aview = [[Disclaimerviewcontroller alloc] initWithNibName: @ "Disclaimerviewcontroller" bundle: zero]; Self.firstview = aview; [_window addSubview: aview.view]; [Overview]; Yes come back } - (zero) switchviewview: (UIView *) View 1 overview: (UIView *) View 2 [[UivView startup perm...

php - Foreach group and subgroup dynamic loop -

I have this problem. I have a table of the group (below). This is a recurring type of table because in each new group A similar table can have an original group. Therefore, we effectively have a group & gt; Sub group & gt; Sub group & gt; Subgroup worm model ** ID | Label | Parent_id ** 1 | Terrace 0 2 | Window | 0 3 | Wall | 0 4 | Short | 2 5 | Big | 2 6 | Big | 1 7 | Paint | 4 Then something that looks like this looks like this: Window & gt; Small window & gt; Paint I have created forms and tables to create the group but this is a database query and I think that there is a problem getting data in the above format. The bit too big to handle my brain: ( I am doing this in this format because I want to have complete control over the depth of groups and subgroups. Actually there is no code to give an example because I am after solving this problem. ** UPDATE ** A little more specific: I want to go to the list each Parent group (such a group tha...

android - How to switch to an Activity that is running through an already running Activity -

I know there is a lot of discussion about this but I can not get it to work properly. Activity (a) = Eklitap and android.intent.action.SEND can get Activity (b) = SingleTask When I select a photo from the Android gallery and open it with (A) - (A) Redirect (B) intends. It is working properly and if I press home and select (A) from Lankar then (B) is brought in front. Now, if I press Home and reopen the Android Gallery then (A) is > Onstart () and onResume () . And I'm looking (A). I would like to switch this problem to (b) because the user needs to complete what he was doing. I can not see a good way to start the Android Gallery (A) Why does it? Maybe I do something wrong with opening the Android gallery (A) Any help would be appreciated Based on limited information in the question, it is possible logic, assuming A is redirecting B to intent to its secret (). 1) Open Gallery, select a picture, open it with A., redirect it to B. In the...

tfs - Renaming TFS2010 Team Project -

Is it possible to rename the TFS 2010 Team Project? The project in question is based on CMMI 5.0 Team Project template, but it has been modified with several custom modifications (new WITs and link types). It is possible to rename, all history should be maintained. In Everyone: No, it can not be done. Your only shot is to create a new team project that you want and then take it all. It involves serious work from hand. After this, you can not erase your old team project - you will lose history, you can lock it and make it unavailable to everyone. After doing so many times we think about the names of our team projects very if at some point their name is wrong (wrong), then I say That we will stay with mismatches.

javascript - How to store a list in the web sql or any type of storage in the browser -

How to store a list in any kind of storage in web SQL or Browser, I have three ways to store data In the browser, i.e. with local storage, session storage and web SQL 5, I need to store java.util.List in the browser and it needs to be modified in the future, what is the way to do this? ? I'm not sure - you need to store and manipulate the 'list' on the server or on the client is? In the first case you can use the session. In the second case you can not use the session because you can not use session variables in javascript. In such a situation, I usually create a hidden field (if it is a related page) or cookie (if it is some related application). Using base 64, you can convert the client to a string list, modify them and save them. Of course you can later read the data on the server.

php - Retrieve and replace email address using preg_match & preg_replace -

I want to retrieve an email address from an article when the article is submitted and * . I'm using preg_match ($ pattern, $ theme, $ matches). Does not work throws an error. $ pattern looks like this ^ [_ a-z0-9 -] + (\. [_A-z0-9-] +) * @ [A-z0-9 -] + (\ [A-z0-9 -] +) * (\. [Az] {2,3}) $ I email addresses I want to retrieve it and I want to change it in article. I appreciate any help. is regex: # ^ [^.] [ \ W - \.] {1,64} [^ \.] @ ([\ W-.] *) (\. \ W {2,6}) $ # i

objective c - iPhone - Dismiss View problem -

I'm looking at some augmented reality examples using ARKIT. I try to dismiss it to try to add a button at the top of the camera view, so it goes to its previous screen when I try to dismiss the scene, the camera stops and the camera shutter off animation Prevents / stops at (At this point I can still see the button, if I press it again then it crashes the app). The current setup looks like this: see main menu - & gt; ARViewController - & gt; Augmented Reality Controller Maybe someone can tell me where I'm going wrong? Or how easy it is to close all the scenes and display the main menu. Here are some code: Main Menu if ([ARKit Device Spypers]) {ARViewController * viewController = [[ARViewController alloc] initWithDataSource: self]; ViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [Self-Present Model View Controller: Animated Visual Controller: Yes]; [See Controller Release]; } ARViewController .h Revised Realtor Controlle...

SMF forum login for iPhone -

I have enough Google, but I can not find an example or tutorial, so people can help me A code that will be logged in the SMF Forums? My guess is that should I use the ASIHTPPX? __ block ASIFormDataRequest * request; // Login to SMF - This works Request = [with ASIFormDataRequest request: URL: [NSURL URLWithString: @ "https://imtgapp.com/forum/index.php?action=login2"]]; [Request setPostValue: @ "test" for that: @ "user"]; [Request setPostValue: @ "12345" for: @ "passwrd"]; [Request Setpost Value: @ "1" for Key: @ "Kukanai Air XP"]; [Request setPostValue: @ "" for: @ "hash_password"]; //to do ? [Request setValidatesSecureCertificate: no]; [Request setcompletionblock: ^ {// TODO verify that the login succeeds NSLog (@ "% @", [request response string]); }]; [Request setFailedBlock: ^ {NSLog (@ "Unsoltered Error% @,% @", [Request Error], [[Request Error] userInfo]); }];...

python - Does converting json to dict with eval a good choice? -

I am getting a Jason object from a remote server, and converting it into a string string like this: A = eval (feedback) Is it stupid in any way, or do I have a better option? JSON isn ' true , false , and null also does not have valid python. The Python code will be executed for eval , so you can come to the mercy of the malicious injection of code. json is available in the standard library instead of the module: import json data = json.loads ( "[1, 2, 3]") Using a version of older Python than 2.6, you have to download the module. It is called simplejson and may be.

How can we add sms programatically in sim card in android -

I'm trying to use this content: // sms / sim URI but I just use the data base I can, but can not add to it. I really want to implement the 'copy to sim' functionality in my application. This is my code snippet: ArrayList listName = new ArrayList (); ArrayList listContactId = new ArrayList (); Array list list mobile number = new arrivate (); ArrayList ListEmail = New Arrayist (); Uri Simuri = Uri.Parse ("Content: // SMS / SIM"); Cursor cursor = this.getContentResolver () Query (symmetry, empty, empty, empty, empty); String [] coloumnName = new string [cursorSim.getColumnCount ()]; (Int i = 0; i & lt; cursorSim.getColumnCount (); i ++) {coloumnName [i] = cursarum .getColumnName (i); Logs. I ("colman name ------- !!!!! ----------------", colonym [i]); } While adding (cursorSim.moveToNext ()) {listName (cursorSim.getString (cursorSim.getColumnIndex ("name"))); ListContactId Add (cursorSim.getString (cursorSim.getColumnIndex ("_ ID...

python multithreading synchronization -

I am having a synchronization problem while threading with cpython. I have two files, I parse them and return the desired result. However, the code below works strangely and returns three times instead of two plus, in order that I do not put them in the queue. Import the line import threading from the HtmlDoc import document OUT_LIST = [] Class Threader (threading.read): "" Start Threading "" "DRF __Inte__ (Self, Qi, Out_Q)): Threading.Thread .__ init __ ( Self) self.queue = queue self.out_queue = out_queue def run (self): while true: if self.queue.qsize () == 0: break path, get host = self.queue () F = open (path) , "R") source = f.rade () f.coz () self Self.queue.task_done () class processor (threading.): "" "Threading process" "def __init __ (auto, out_kline): self.out_queue = out_queue self.l_first = [ ] Self.f_append = self.l_first.append self.l_second = [] self.s_append = self L_second.append threading.Thread .__ ini...

c++ - fopen vs ofstream -

I have a strange problem that I think I have an alternative solution, but I have a basic reason on the analysis. I am developing an application that runs on the embedded version of Ubuntu 10.04 LTS. When the application starts, it reads in a config file off of an SD card, launches some classes, launches a logger, which writes on the SD card, and then proceeds with its operation. During development, when I start manually through SSH Terminal, then it is running fine. I have been applying to start automatically automatically when OS starts. I have a script in init.d which is just that. However, I found that no log files are being created anymore. I thought this is not a problem with the SD card because the config file is properly read at startup, but when I try to open the log file to write the FOPN, an error is thrown. Open the // file mLogFile = fopen (filename, "wb"); If (mLogFile == NULL) {printf ("Error opening file [% d]. \ N", lnRetval); Return -1; /...

sql - Join Oracle and Sqlite tables -

I have a local (read and write) crypt database and a remote (read-only) Oracle database. I use DBS to use (I use an application to access the DBS by the ODBC and ask questions like this: Exec-query, "Sayple ..." or EXECUTE-QUERY ORACLE "SELECT ... "). I tried to search the net to be able to run a query that included the tables from 2 databases, but I think that is to create a database link from Oracle to other DBS, but it does not help me Because I have no written permission for Orkale DB, database links, databases, tables, views are not allowed in Oracle, what I can do That's the query there. Do I have an effective way of doing this with such abstinence? How big is the table in the oracle? Given the extent of access and the techniques you employ (Sequoite and Oracle world are different), your best bet would be to export the table from Oracle to Saclegate, then put your questions inside it.

how to get the sound fade in functionality in alarm application using media player in android -

Hello I am new to Android. I am developing an application with alarm functionality here to give me sound fade in functionality I'm using media player to open ringtone for alarm. Here is my code for playing alarm sound try {if (mp == null) {System.out.println ("------- mp" is now zero - -------- "); Uri Mayuri = Uri.Pars ("android.resource: //com.android.crazy/raw/airtel"); Mp = MediaPlayer.create (alarm. This, myURI); } Mp.setDataSource (songName); Mp.prepareAsync (); Mp.setLooping (true); } Hold (exception e) {e.printStackTrace (); } Mp.start (); Here I have to give sound Fadin functionality Please advise me how to insert sound fade for any particular amount like 5 minutes Thanks in advance You can use this method: set volume (float left volumes, right volume Float); To create a "feed in" effect, you will just start with zero and keep it at a slightly higher interval. In this way, some things will increase the volume of hal...

c++ - PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) -

In the past I have created a shared library which I would now like to use it inside a php extension. Is it possible to do that? As I have seen in the config.m4 file PHP_NEW_EXTENSION () asks for the .cc problem, the problem is that I do not want to display my code. I just send headers and share I want to use the library which I have ordered under Ubuntu in C. For php extention I have created one: config.m4, php_c.h and php_c.cc. Please help! While appreciating THX, I put it in the config file: libs = mylib.so; PHP_ADD_LIBRARY_WITH_PATH (Libs, $ EXTERNAL_LIB_DIR, ?? to add here); I get the following: PHP Warning: PHP startup: Invalid library (probably not a PHP library) '/ home / foder / mylib So unknown 'on line 0 php: symbol lookup error: / usr / php5 / 20090626 + lfs / vehicles.so: undefined symbol: _ZN3CarC1Ei (where vehicles.so) is a php with the following: phpize, ./configure - enable-vehicle. This message means that there is no "get_mo...

ajax - PHP variable question -

यह मेरा कोड है गूंज ("& lt; br / & gt;"); अगर ($ APIkbpersec & lt; 30) {वैश्विक $ SpeedTest; गूंज ("धीमी गति"); $ SpeedTest--; } अगर ($ APIkbpersec & gt; 30) {वैश्विक $ SpeedTest; गूंज ("उच्च गति"); $ SpeedTest ++; } $ SpeedTest गूंज; इस कोड में एजेएक्स और $ APIkbpersec 40 और 0 के बीच में बदलाव के साथ हर सेकंड पुनः लोड हो जाता है। मैं मूलतः चाहता हूं $ APIkbpersec के आधार पर एक चर ( $ SpeedTest ) बढ़ाने या decrese के लिए। यदि $ APIkbpersec 30 से भी कम है, मुझे $ SpeedTest कम से कम 0 तक प्रत्येक रीफ़्रेश से कम करना है। यदि $ APIkbpersec बड़ा है 30 , मैं चाहता हूं कि $ SpeedTest से अधिकतम 10 में से प्रत्येक को ताज़ा करने के लिए। समस्या यह है कि मुझे पता नहीं है कि पोर्नम्बिल क्या है .... आईएम वर्तमान में $ SpeedTest को एक txt फ़ाइल में लिखने की कोशिश कर रहा है ताकि मैं इसे हर रीफ्रेश में पढ़ सकूं ताकि उस पर गणित को हर ताज़ा करने के लिए बिना पीएचपी में रीसेट किया जा सके कोई भी मदद इसकी पुष्टि की जा रही है ...

terminology - What does HTTP look like? -

I'm working a lot with related things related to HTTP - HTTP requests, HTTP responses, HTTP methods, etc. Not sure I understand how the protocol itself looks like. Is it a document like a specification? Is this a document such as a specification? Yes, HTTP is a protocol on TCP / IP defined in the following protocols: This protocol is implemented by the web server and client browser for example.

cocoa - What about performance in core data? -

I would like to write an application based on core data, but I do not know what this value is, several or several thousand The applause of data What is the position of the front? There are several thousand records in the grand scheme of things, many people, and that's likely to be correct though the data Despite knowing what to do with or on which platform you are running it, it is difficult to make sure.

cocoa - iOS Core Data unique object fetch -

I am quite new to iOS / Cocoa and I have a very basic question about core data. I was looking for an appropriate answer / solution on the internet but I was not able to. The question is, how do you manage the specificity of the core data? I know that core data is not a database, something like an object graph. Let's say we have a unit named 'user' that has some relation with attribute 'id' and 'name' and other institutions. Now we want to update the name of a specific user (such as the web service gave us the ID and new name). The way I did it earlier: NSFetchRequest * request = [[NSFetchRequest alloc] init]; [Request Set Entity: [NSTTTD Decision Unit FERN: @ Managed Object Contains in "User": context]]; [Confirmed request: [NSPredicate predicateWithFormat: @ "id ==% @", anId]]; NSError * Error = Zero; NSArray * result = [reference executeFetchRequest: request error: & amp; Error]; User * User = [Results Final Object]; B...

SQL Server injection -

Get new and no code in web development. To prevent SQL injection for SQL Server database, they have a function. The function is safe (val, max) slowed, word = array ("cast", "select", "varchar" , "Drop", ";", "insert", "delete", "xp_"), "I = 0 to val = left (val, maxsize) val = trim (val)", declare " Val = Substitution (Val, "'", "'"), makeafe = val end function (Val, word (i), "e_" and val and "_e", vbTextCompare) The Hesitant to touch it, but is this missing anything? The following article should help: This path follows the string.Replace

Determine if given job is currently running using Hudson/Jenkins API -

Is there an API to determine if a given job is currently running? Ideally, I also like to be able to complete my estimated% completion and get details of the SVN revision number and also comment! Edit: I got the answer. http: // host / job / project / lastbuild / api / almost all I need is this! If you kick the manual build, it will not tell you the SCM changes, but it makes sense. It still tells you the latest SCM modification, so it's good. Everything is fine, enough for my purposes right now Gareth_Bables and Sagar using Jenkins said the way to know the API is if you add depth to 1 , You will see what you are looking for: http: // host / job / project / lastbuild / api / xml? Depth = 1 You will see whether this build is running or not ... You will see & lt; Construction & gt; tag & lt; Action & gt; & Lt; Reason & gt; & Lt; ShortDescription & gt; User-initiated Zageyiff & lt; / ShortDescription & gt; & Lt; ...

c - stack function call problem -

I have a function called fun1 () , which is used for recursive I'm confused about the first call for fun (- n); What will it do and how will my stack pop up after each function ends? zero fun (int n) {if (n> gt;) {fun (- n); Printf ("% d", n); Fun (- n); }} My main task is given below: int a; One = 3; Fun (a); I want to know the order of execution and what will happen before, during and after the function call of my stack first funny (n) Your output will be 0, then 1, then 2, and then 0. initially called 3 Larger than 0, it makes fun calls (- n), which makes it 2. It does not go until it stays 0. until it continues. It continues in printf (), and prints 0 on the console. What you are not seeing is an intermediate call, it is a complete output (before n & gt; part): Before n fun Call & gt; 0; N = 3 n & gt; Funny call before 0; N = 2 n & gt; Funny call before 0; N = 1 n & gt; Funny call before 0; Fun Call Befor...

Using Python to break a continuous string into components? -

This is what I want to do: This is my specific "string" 00000000110000000000011000000000 P> I need to add a new text file as the header with the original string. I know how to split the string, if there were spaces like divisive but my string is continuous They can be treated as 32-bit and 8-bit binary numbers, but they are just text in a text file (for now)! I'm new to programming in Python Please, I need patient details, no generalization, no generalization. Let's say I do not know anything. Thanks, Ralph You should do this Which should do. See for more details. & gt; & Gt; & Gt; S = "00000000110000000000011000000000"> gt; & Gt; & Gt; For the [i: i + 8] i.e. [0, lane (s) for [0: 00000000, '11000000', '00000110', '00000000'] Div>

ruby - What version of Rails is this? -

Image
I have a railway app that I do not know which version it is. Here is the app directory: Take a look at your config / environment.rb file You should see a line like this: RAILS_GEM_VERSION = 'xxx' as long as not defined? RAILS_GEM_VERSION Where xxx should be your version. It is being said, you also need to make sure that your seller does not have any version of Rail directory, whatever the gem version loads possible Could try

Get Latitude and Longitude from SQLite database for use in Android MapOverlay -

How do I get these values ​​if I store the latitude and longitude of a bunch of locations in the SQLite database And will I move them into an OverlayItem class for use in Google's map code? Database Name: Database Table Name: Location Location Table: id title details latitude longitude How do I get latitude and longitude data for each location And add it to an Arrayite item overlay? Do you have any ideas or an example? Thank you very much You want to do a query like this: Choose from title, description, latitude, location This can be done in Android: / * databaseObject = yourDbHelper #getReadableDatabase (); * / Arrestist & lt; Overlayem & gt; Item = new arreelist & lt; Overlayem & gt; (); Cursor space casser = database object.query ("location", new string [] {"title", "description", "latitude", "longitude"}, empty, empty, empty, null, blank); LocationCursor.moveT...

c++ - How can I iterate over two vectors simultaneously using BOOST_FOREACH? -

मैं निम्न को बूस्ट FOREACH के साथ दोहराना चाहूंगा std :: vector & lt; Int> gt; :: const_iterator i1; Std :: vector & lt; int & gt; :: const_iterator i2; के लिए (i1 = v1.begin (), i2 = v2.begin (); i1 और lt; v1.end () और amp; i2 और lt; v2.end (); ++ i1, ++ i2) {doSomething ( * I1, * i2); } एक साथ दो चीजों को दोबारा बदलना एक "ज़िप" कहा जाता है (कार्यात्मक प्रोग्रामिंग से) , और: ज़िप इटरेटर एक साथ कई नियंत्रित दृश्यों को समानांतर-पुनरावृत्त करने की क्षमता प्रदान करता है। एक ज़िप iterator इटरेटर के एक ट्यूपल से बनाया गया है। ज़िप इटरेटर चलते हुए समानांतर में सभी iterators को स्थानांतरित करता है। ज़िप इटरेटर के संदर्भ में एक ट्यूपल देता है जिसमें अलग-अलग इरेटरर्स को डीरेंसिंग के परिणाम शामिल हैं। ध्यान दें कि यह एक इरेरेटर है, एक श्रेणी नहीं है, इसलिए BOOST_FOREACH का उपयोग करने के लिए फिर से उनमें से दो सामान को एक या जोड़ी में रख सकते हैं तो यह बहुत अच्छा नहीं होगा, लेकिन कुछ सावधानी के साथ आप शायद एक सरल zip_range लिखकर लिख सकते हैं: B...

java - Cannot bookmark a JSP page -

I have a JSP page which I am using within the Stratus Framework. When I navigate through my pages of my web app using the buttons on a menu bar, it navigates accurately and I get all the pages (page 1.do, page2.do) without any problems. I can reach. When I bookmark any one of the pages (page 1.do) and tries to go to the bookmark, I get an error Request [/ adminmanagement] The handler parameter is not If I manually "page1.do?directive=init" in the instruction object, I have no problem accessing the page. Here's my stratus-config.xml & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt ;! DOCTYPE struts-config PUBLIC "- // Apache Software Foundation // DTD Stropes Configuration 1.2 / N" "Strats-config_1_2.dtd" & gt; & Lt; Struts-config & gt; & Lt; Form beans & gt; & Lt; Form-bean name = "FileUploadForm" type = "net.cmpny.cc.forms.FileUploadForm" /> & L...

identity - Java implementations of SCIM -

SCIM उपयोगकर्ता, Google, Salesforce, Ping Identity..etc द्वारा आगे रखा गया प्रावधान के लिए एक ताजा मानक है। क्या वर्तमान जावा हैं इस का समर्थन करने के लिए कार्यान्वयन? यहाँ पर अच्छा है कि किसी ने मुझे एक के बाद से scimproxy परियोजना पाया है उस प्रोजेक्ट के मालिक हालांकि मुझे पता है कि कम से कम दो अन्य जावा परियोजनाएं जो एससीआईएम लागू करती हैं और UnboudID के पास

Including an association if it exists in a rails query -

Update: Something that might not be possible TLD: How do you make a union Conditional loads (say, association load only for existing users), while the record is included in which the association is not included at all? Rail 3.1, here's the model with which I'm working. class user has_many: subscriptions_many: archive ,: through = & gt; : Subscription and Class Collection is has_many: Things and Class Thing is_Im: User_Mest_States, Dependent = & gt; : Is destroyed: belong_to: collection end membership to membership belong_to: user belongs_to: archive end class UserThingState belongs_to: user is_to: thing end There are many things that exist in many collections Subscribes to the collections and thus they subscribe to many things. Users have a state in relation to things, but not necessarily, and still subscribe to those things, even if there is no situation for them. When a user subscribes to a collection and its related things, then a state is not prepared ...

javascript - Enable button when checkboxes selected -

I have more than one checkbox and a submit button that is initially disabled. When checking a box, the button is enabled and when unchecked, the button is again disabled. If multiple checkboxes are selected but uncheck one, then the button is disabled even if I have selected other checkboxes. How can I fix this problem? & lt; Script type = "text / javascript" & gt; $ (Function () {$ ("checkbox"). (Function () {$ ("delete."). Et ("disabled",! This.checked);});}); & Lt; / Script & gt; HTML & lt; Input type = "checkbox" name = "msg []" value = "32" square = "checkbox" /> & Lt; Input type = "checkbox" name = "msg []" value = "44" class = "checkbox" /> & Lt; Input type = "checkbox" name = "msg []" value = "26" square = "checkbox" /> & Lt; Button type = "submit" class =...

how to get the result from a php file into a string -

उदाहरण में मेरे पास एक फ़ाइल है template.php: & lt; table & gt; & LT; टीआर & gt; & Lt; td & gt; & lt;? Php $ डेटा ['nombre']? & Gt; & lt; / td & gt; & Lt; / टीआर & gt; & Lt;? Php foreach ($ डेटा ['मान] $ मान के रूप में):? & Gt; & LT; टीआर & gt; & Lt; td & gt; & lt;? Php ईको $ मान? & Gt; & Lt; / टीडी & gt; & Lt; / टीआर & gt; & Lt;? Php endforeach; ? & Gt; & Lt; / तालिका & gt; और मुझे स्ट्रिंग $ result = get_content_process ('template.php', $ डेटा) में परिणाम की आवश्यकता है; अन्य प्रक्रिया में उपयोग के लिए। $ परिणाम गूंज; & LT; तालिका & gt; & LT; टीआर & gt; & LT; टीडी & gt; जुआन & lt; / टीडी & gt; & Lt; / टीआर & gt; & LT; टीआर & gt; & LT; टीडी & gt; नर & lt; / टीडी & gt; & Lt; / टीआर & gt; & LT; टीआर & gt; & LT; टीडी & gt; ब्राउन & lt; / टीडी & gt; ...

objective c - Table view as an object in a view - how to initialize with an array of data? -

My goal is something like the "select" option in an HTML form, but now it's in my app. It is best to do this with the table view after doing research, although I have a view of the picker, but the fixed height is very large. With the interface builder I just placed a table view on my subclass of UIViewController. How do I view the table with options? I have seen many tutorials, but all of them are for a UITableView in the form of their class and to fill the entire screen. In my application this is a small piece of the entire form. What is a nightmare to make a relatively simple thing like table view? It either crashes or I get a table view that covers my entire scene and is not full of anything. Variable is the object in the Desertable Interface Builder. After a difficult day of disappointed work, anyone got the complete work code? that would be great. I have tried many things, but this is my current code: @interface myView: UIViewController {NSArray * ...

ios - Standard arguments in main file -

After Is the standard argument in the main file. I think I have set incorrect standard arguments in the main file, and need to change them back. I think the problem is zero and zero in the UIApplicationMain arguments Here is the code: #import & lt; UIKit / UIKit.h & gt; Integer main (int argc, char * argv []) {NSAutoreleasePool * pool = [[NSAutorelease Pool alloc] init]; Int retVal = UIApplicationMain (argc, argv, zero, zero); [Bridge release]; Return rate; } Error code: 1420. 2011-09-02 Attached to action on 14: 33: 04.440 HypnoTime [1420] 207] *** assertion UIApplicationMain (), failure /SourceCache/UIKit_Sim/UIKit-1448.89/UIApplication.m:1359 2011-09-02 14: 33: 04.588 HypnoTime [1420: 207] *** not come the exception 'NSInternalInconsistencyException' because of his closing applications, because: 'UIApplication representative example is not load a class called Aepdileget unable to instantiate. '*** Call stack on first throw: (0 Core forwarding 0...

Cakephp model named "Club" not working at all! Reserved keyword? -

In CapeFIF-2.0, I have a model named "Club" and I'm removing it from "Club Controller". If I $ - this-> Club- & gt; When I search inside my controller, it says, "Error: Database Table Club for Model Club was not found." In the stack trace is . ... clubbs controller.fp (7): model- & gt; Search ('first', array) The actual database table is called "ClubTable" which I have specified in the class $ useTable = 'ClubTable' . From this I believe that it is automatically making a model called "Club" which is different from my model. Such folder structure: /app/Model/Club.php/app/Plugin/Admin/Controller/ClubsController.php Kicker here now That is, if I change my model to Club123.php with the model name of "Club123" Then in the controller I just have to go to $ this-> loadModel ('Club 123'); works and it works perfectly to my model and connects to my database and "ClubTable...

file - Grails - logging from Quartz job and Filter -

I would like to submit my logs to the file: Here's how I declare my offenders in Config.groovy: 3 files are created properly but only scrolls Prsewadetedted logger is stored properly log the other two files are empty I log is honored logging levels call. What am I missing? Thank you for any assistance provided. Try the logger prefix of 'grails.app.task' for quartz jobs info scraperServiceLogger: "grails.app.task.personalcreditcomparator.ScraperJob" and try the 'grails.app.filters' logger prefix for the filter Information filterLoggers: "grails.app.filters.personalcreditcomparator.AdministratorInterfaceProtectorFilters"

php - How to handle dependencies that aren't "real" dependencies? -

I have a "validator" class that can perform arbitrary check on the array of data, for example, given within the array Check the length of the string for the value. Valuator can also check a given value and see whether it is unique in a database. I would like to have proper dependency injection on this class, however, how do I implement it on this scenario. All other verification checks work fine without database connection that does not require a database connection to perform validation functions. Right now, I have the option of specifying the connection using property injection. Or, if a connection property is not specified by injection, then I am using Service Locator Pattern to resolve the default connection from the IoC container. Am I doing this wrong? What is the correct way to handle the dependence of the class which is not necessary for the class to work? I currently consume such verification: $ rules = array 'email' = & gt; 'Expected | ...