Posts

Showing posts from June, 2012

Executing python commands from php script -

I have installed SymPi in the server and from the command line, I was able to execute it I have the following. dragon ./sympy-0.7.5/bin/isympy (This will open a console where I can type mathematical expressions 1 + 2 (will give 3 as output) My purpose is to do php using shell_exec . I have written one of the following PHP files, but it is not working. $ command = escapeshellcmd ('Python ./sympy-0.7.5/bin/isympy'); shell_exec ($ command); $ output = shell_xac ('1 + 2'); Help in understanding Why is it not working? Please note that the following script works fine which executes only a python script and retrieves the output. $ command = escapeshellcmd ('Python C: \ Pythonprograms \ test3 py'); $ output = shell_xac ($ command); $ echo output; My guess is that shell_exec is different from that person when you manually Do the execution. Your work example specifies a hard path that will work from anywhere. Whereas your non-

html - not able to get the value WebDriver using java -

After please search the HTML code I need to get this oldtitle value ("password does not match password policy") Zero values ​​are following my code (Java), but I'm getting string Validationmessagepwd = driver.findElement (By.cssSelector ("input # txtRegPassword")) getAttribute ("oldtitle");. Version code Note A zero value output: The oldtitle (dynamic) KO (knockout js) binding feature with the binding that I am not capable of getting this, please The guide Try it out. We go into a loop for a maximum of 500 seconds, as long as the method Every 500 ms does not apply. WebDriverWait wait = new WebDriverWait (driver, 5) .until (New ExpectedCondition & LT; Boolean & gt; () {Public Boolean Applied (WebDriver Driver) {WebElement inputElement = driver.findElement (By.cssSelector ("input # txtRegPassword"); if (inputElement.getAttribute ("old title") == faucet) return false;} Other {back true;} });

wpf - How to embed several DLL files into project in VB.NET -

I saw this, and I want to load many files How can I do this? The problem is that this return only allows one assembly (I do not know how to return to an assembly), so if I want more than one load? That event handler will be called for any assembly solution request that can not be completed by the system Therefore, it is applicable several times as the fact that it can only return 1 assembly, there is no problem, only make sure that the request has been made. Create a table or use a select ... case statement.

cordova - Phonegap with facebook login -

मैंने लिंक का पालन किया था - फेसबुक लॉगइन को फोनगैप पर स्थापित करें। इसके बाद, मैं प्लगइन फ़ोल्डर "com.phonegap.plugins.facebookconnect" से नमूना "उत्कृष्ट" कॉपी करता हूं। साथ ही, मैंने index.html में "ऐप आईडी" अद्यतन किया था। हालांकि, मुझे नीचे से लॉग के साथ भी त्रुटि मिलती है। मैं Google से पूछने की कोशिश करता हूं लेकिन मैं अभी भी इस समस्या को ठीक करता हूं। कृपया मदद करें। 2014-04-21 20: 02: 04.247 हैलोवाल्ड [2 9 811: 60 बी] मल्टी टास्किंग - & gt; डिवाइस: हाँ, ऐप: हाँ 2014-04-21 20: 02: 04.259 हैलो वर्ल्ड [29811: 60 ब] नेटवर्क संसाधनों के लिए असीमित पहुंच 2014-04-21 20:02 : 04.614 हॅलोवर्ल्ड [2 9 811: 60 ब] पृष्ठ लोड के कारण प्लगइन्स को रीसेट करना। 2014-04-21 20: 02: 04.847 हैलोवाल्ड [2 9 811: 60 बी] इनिट फेसबुक कनेक्ट सत्र 2014- 04-21 20: 02: 04.848 हैलोवाल्ड [2 9 811: 60 बी] त्रुटि: विधि 'init:' प्लगइन में परिभाषित नहीं 'org.apache.cordova.facebook.connect ' मुझे यह सटीक त्रुटि मिल रही है, और कहीं भी ठी

Laravel 4.1 - Detect app environment -

I am using Laravel 4.1. I have a local version of my project, I have a remote server like dev and two versions beta and output How do I find out the environment: beta , output or dev ? You must edit the bootstrap /start.php file in this file You should receive a detectEnvironment call: array 'production-machine-name'), 'beta' = & gt; array ('beta-machine-name'), 'dev' => dev-machine-name '),)); Check the Laravel document about the environment for more information:

php - Assign Key to Existing Array -

Assume that I have an array like this example: [{type "type And I want to specify this whole array by name as "dish" for a particular key: "food", "alias": "food"}] How can I archive it? The expected product should be something like this: "dish": [{"type": "food", "nickname": "food"}] I know how to create new key values ​​pairs but have never thought of assigning a key until now. $ json = '[{"type": "food", "alias": " food "}]'; $ Data = json_decode ($ json, true); $ Data = array ('dish' = & gt; $ data); Echo json_encode ($ data);

Why does the control always redirects to index.php in php? -

seems silly but I have a simple doubt that I have a file structure - - & gt; Client-login --- & gt; Index.fp --- & gt; Default.php But whenever I try to run client-login from the browser, it always ends up reaching index.php? What is the reason? Can anyone answer me? Because index.php is set to the directory in most Default index page (if not all) Apache installation If you want to show up to default.php , you can add the following snippet to the .htaccess file in that directory: DirectoryIndex default.php index.php DirectoryIndex Directive is set to set up a list of resources or files, when the customer directory Name a / guided at the end of a directory name in the end. It will provide the first source in the provided list (i.e. present).

android - eclipse Juno often close automatically after ubuntu upgrade to 14.04 TLS -

Before upgrading to 14.04, I was working with my Eclipse. But after upgrading to 14.04, my eclipse often closes without any warning message. And it generates an hs_err_pid4612.log file in my desktop. How can I fix this problem? Add the following line at the end of your eclipse.ini file. (The eclipse.ini file is located in the eclipse folder of the Eclipse package.) -Dorg.eclipse.swt.browser.DefaultType = mozilla

svn - Is it possible to have the same source code under 2 version control? -

In our team, we are using Accorvev as SCM and we also have local SVN setup. Just make all the modifications we want to check the SVN, then build and test our code. If everything works fine, then I will promote the same code in actuality. The Aquarius server is in the client location, so I want to double check my code before promoting it in the executable, where the client has a look in my code. In the general setup, you want to make a development main trunk off / feature branch (in the client's Acurae ) This dev / feature branch can be "tested" with automatic or manual build, and when you feel that it is quite good, you combine it in the main trunk. If your criteria is that the customer does completely, none of your work is in progress. Then by all means, you have to separate it, but now everything is responsible for keeping you in sync is. I have failed to see the real question. Is this possible? Of course, you can copy and paste as many times as you want. A

spring - Access server side property file in javascript -

I have written all the messages in the server side property file In the alert box, I have to show some message for verification. The path to the property file is "WebContent-Web-INF-APT Properties - Frequency.Properties". So how can I use ".js" file or server-side properties in Javascript. Any shrugs will be useful, thank you in advance ... !!! server side layer generates files, including HTML output is. Client side By the time the browser is getting, the source of the source of HTML does not matter anymore. It is directly HTML, which is completely devoid of its source. If you need something to be available on the server, then Customer Become a Client and the client has to go through the Uttar Pradesh

java - Can we create files in Linux server from front end html page? -

I would like to know whether we can create a file from the html page in the browser in the Linux server folder? I have a shell script that creates a text file. But when I trigger this script from a browser using Ajax, it does not make any file. I have given all the permissions for the parent directory, but However, I do not see the file creative nor any errors test.sh "first sh" java helowword echo "t1 test" & gt; T1s if [! -f t1s] Then the echo "Shell file is not created" .. and resonates "Shell file is created .." fi ------ first.php & lt; php $ output = shell_exec ('sh test.sh'); Echo "Hello php \ r \ n"; $ Echo output; Echo "done \ r \ n"; ? & Gt; ----------- It is output from the command line: Hello PHP hello Shell file has been created for the first time .. done ---------------- This is Broser Output from: Hello php Hello sho file is not created first .. when If scripts are executed throu

c# - File upload after dropdown selected -

I have a dropdown list & amp; File uploader Here I want to, when the dropdown list was selected & amp; After that the file uploader needs to be loaded. My coding always shows that there is no file. Here I need to have the selectedValue file passes to the database with the uploader. My code protected zero drpuser_SelectedIndexChanged (Object Sender, EventArgs e) {GUID SelectedUserId = Guid.Parse (drpuser .SelectedValue); FileUploader (); } FileUploader Public Zero FileUploader () {// user = Membership.GetUser (); If (roles.USUUSAEINOL ("Administrator")) {GUIDED SELECTED USIRIID = GID. Purse (doped value selected); // & lt; - Value the correct foreach (String S. files in request) {HttpPostedFile file = Request. Files]; Int fileSizeInBytes = file.ContentLength; String fileName = file.FileName; String file extension = ""; If (! String.IsNullOrEmpty (fileName)) fileExtension = path GetExtension (fileName); Guid UserGUID = (Guid) membership. GET

neo4j - Delete node with all incoming and outgoing relationships -

I want to delete the node with all incoming and outgoing relationships. This incoming and outgoing relationship is optional. (T: Teacher) - [: Tech] - & gt; (S: Students) (S: Students) - [: ATTENDS] - & gt; (C: class) Alternate relation with the teacher of the student node and an alternative relationship with the class. I want to delete the student node with {id: 1}. I know how to remove all nodes and relationships: matte (n) optical match (n) - [r] - () DELETE n, r < / code> but not able to convert it to a specific node. help please. just add discriminatory property in the first match section Matt ( S: Students {ID: 1}) Alternative matches- [R] - () DELETE r, s If instead instead of id is an internal node ID And you do not have a fixed asset, then matches (where) ID ID = 1 alternative matches- [R] - () DELETE r, s It is irregular and should usually work to capture the nodes from their internal ID. Interpretation is.

c# - How to bind data to DataTrigger in Silverlight -

मैं Silverlight DataGrid को grdActivities.ItemsSource = आइटम; XAML & lt; datagrid: डेटा ग्रिड एक्स: नाम = "grdActivities" AutoGenerateColumns = "false" & gt; & LT; एसडीके: DataGrid.RowStyle & gt; & Lt; शैली TargetType = "sdk: DataGridRow" & gt; & LT; iv: Interaction.Triggers & gt; & LT; आइए: DataTrigger बाइंडिंग = IsMarkedToDelete "मूल्य =" सही "& gt; & lt; आइए: ChangePropertyAction PropertyName =" दृश्यता "& gt; & lt; आइए: ChangePropertyAction.Value & gt; & lt; दृश्यता & gt; संक्षिप्त किए & lt; / दृश्यता & gt; & lt; / आइए: ChangePropertyAction.Value & gt; & lt; / Iia: ChangePropertyAction & gt; & lt; / ia: DataTrigger & gt; & lt; / iv: इंटरैक्शन.Triggers & gt; शैली / gt; & lt; / sdk: DataGrid.RowStyle & gt; & lt; डेटाग्रिड: DataGrid.Columns & gt; / / कुछ कॉलम यहाँ से & lt हैं; / datagrid: Dat

Attempting to use invalid JSON in Ruby? -

I am trying to test a test that returns a valid JSON 400 error code to a cURL request is. Unfortunately, Ruby will not allow me to use invalid JSON. if bad_json credentials = {"username" = & gt; Username "password" = & gt; Password} .to_json other credentials = {"username" = & gt; Username, "password" = & gt; Password} .to_json end When I try to run the test, it produces the following: /foo.rb:60: Syntax Error, unexpected tSTRING_BEG, expected '}' "password" = & gt; Password ^ /foo.rb:60: Syntax error, unexpected =>, Except keyword_end "password" = & gt; Is it possible to pass invalid JSON passwords without breaking the script? As others have commented that your Ruby has syntax errors, you must have a valid Ruby And if I understand your problem properly, then make errors in JSON. Specifically, you are asking Ruby to make a hash, then convert it to a string in which the compl

mysql - Searching from two columns is extremely slow -

Resolved : Andy Lester pointed me towards the right direction, this poor index definitions Was due to is a part of a query which is causing me a lot of trouble: Select from item i.id as i tag_ rel is tr2 ON (tr2) Connect). Item = i.id) T2 On (T.id = tr2.tag) as the left join tag WHERE T2.name like 'chocolate' group i.id Items item table tag_rel are the relationships between the object and the tag Tags has the name tag So the query above is OK, as it should: It gives returns to the items tagged as chocolate But whatever is doing here, the query Slows down (10 seconds +) so I think That I am doing something wrong: - / Select from item i.id as I add tag 2 to tr2 (tr2.item = i.id) in the form of LEFT tags In T2 (t2.id = tr2.tag and t2.sec_corrected = 0) Add tags AS T3 ON (T.sec_corrected = tr2.tag and t3.sec_corrected> 0) WHERE (T2.name such as' choclate 'Or' toc '), such as' choclate'), group I.id sec_corrected "ta

python - Propagate pandas series metadata through joins -

I want to be able to attach metadata to a series of dataframes (specifically, the original filename), so that After two dataframes, I can see metadata from where we came from each series. The current _metadata attribute () about the _metadata (,), but nothing in panda docs. So far, I can allow the protection of metadata estimated in the _metadata property, but after joining AttributeError df1 = pd.DataFrame (np.random.randint (0, 4, (6, 3)) df2 = pd.DataFrame (np.random (0, 4, (6, 3) df1._metadata.append ('filename') df1 [df1.column [0]] ._metadata.append ('filename') c in df1: df1 [c]] .filename = 'fname1.csv' df2 [ c] .filename = 'fname2.csv' df1 [0] ._ metadata # ['name', 'filename'] df1 [0] .filename # fname1.csv df2 [0] .filename # fname2.csv df1 [0 ] [: 3]. Filename # fname1.csv mgd = pd.merge (df1, df2, on = [0]) mgd ['1_x'] ._ metadata # ['name', 'filename'] mgd ['1_x ']. filename

how can I insert a link, in a Google Drive Document, pointing to a different Doc? -

I wanna put it using Google Apps Script, a link to an existing document, which is the same domain Opens a separate document in I tried with the HtmlService, by creating a web app, with a hyperlink inside, but cleansing the sanitization process link. Any sign? You enter links in documents as a paragraph with a link property. For example function myFunction () {var doc = DocumentApp.getActiveDocument (); Var para = doc.getBody (). The append paragraph ("this is a link") .setLinkUrl ("http://www.google.com")}

Meteor Deploy to .meteor.com Problems -

I am using the meteor for a while and the app on .meteor.com I am deploying. However, after updating my app v0.8 and new collection of FE recently, the terminal says that the app is whatever. Meter.com has been posted in , but when I go to the site, I see the meteor's code> the site is down. Try again later . I've compressed it to the new compilation package which is causing the problem, because with my old arch, my old app works fine. any idea? Edit The problem was due to the lengthy startup time due to my archive path: definition There are several reasons why your site may not be loaded when deployed. Inactivity of the site Your site has not been accessed shortly, and if requested that it takes some time to resume then Meteor deployed Service terminates, during that time you will see that message. Within a few minutes of the first request you should come back to the site. For more information, see this answer: excessive resource usage Anothe

ruby on rails - Generating seeds to tables not represented by a model -

If I have an intermediate table in my rail application that many authors and authors have many books, which are two objects (i.e., books and authors: representing associations between a book), I would refer this table to seed .rb How can I populate the file? Update class author & lt; ActiveRecord :: Base has_and_belongs_to_many: Books # ... and Class Book & lt; ActiveRecord :: Base has_and_belongs_to_many: Authors # ... end I think your If there is such a case between the two, between the two is is_ and_bollongs_to_me. you can do something like this: # seeds.rb Author = Author Creating (Name: 'Mark Twain') Writer Books & lt; & Lt; There is one more thing to check: Your model-less table is properly named: Authors / books ? Or try to write, which bang ! will cause more useful errors if it fails: # seeds.rb Author = Author.create! (Name: 'Mark Twain') Author.Books Make! (Title: 'Adventures of Tom Sawyer')

Delete directory content using WinSCP -

Is there a way to delete directory contents using WinSCP? I tried to do this: T work: synchronize remote-deletion To delete a directory, use. Synchronize ... - Installation Deletes only orphaned files or directories Also see

android - How to get buyer's info in PayPal Mobile SDK -

I'm using PayPal Mobile SDK for Android and I'm surprised that after the payment is successful, How can I get buyer's information in . Looking at the Onactivity Result () method on the "Confirmation" object, there is information about the seller, payment of amount, currency, state etc., but I did not know how I can get the buyer's information Do, e.g. email, etc. When you confirm mobile payments, you are doing a lookup of payment processing. What you come back in response to that lookup will be available to the buyer's information from that transaction. More information can be found on seeing payment resources.

php - Facebook OG Image If, or, or, else statement -

I have 3 sources in which users can contribute either an Instagram URL, an image URL or an image upload with. Users can contribute only to use 1 of 1 in 1. I am trying to help the Facebook OpenGraph remove from the project source / image URL / image upload either from the image. The embedded instagram image, I already have a custom field, but the image URL is not however and if any of these 3 is not provided by the user, the site icon will be turned on. I know how to include image uploads, but I'm not sure how should I include the instagram image (custom fielded) and image url, can someone help me? I have this code: add_action ('wp_head', 'add_fb_open_graph_tags'); Function add_fb_open_graph_tags () {if (is_single ()) {global $ post; If (get_the_post_thumbnail ($ post-> ID, 'thumbnail')) {$ thumbnail_id = get_post_thumbnail_id ($ post-> ID); $ thumbnail_object = get_post ($ thumbnail_id); $ Image = $ thumbnail_object- & gt; Guid; } Oth

ASP.NET Master Page Server Control Events -

Every time I had a lot of problems to try to keep a server control button and event handler on a master page If I clicked one of the content pages, the postback will not take me back to the content page, but on the site. Master url, therefore my application will crash automatically. I used the Internet for a solution, Take Under no I did not have to work for me. After all I decided one thing very easy and so I thought I would share it because someone else is in such kind of troubles. On the Page_Init () method of the master page, I paste the URL of the server control postback url to the current page Yuri, . Current. request. Url Assigned using the ASSOUUUURI; (UserLogin is the name of my button control) Protected Zero Page_Init (Object Sender, EventArgs e) {UserLogin.PostBackUrl = HttpContext.Current.Request.Url.AbsoluteUri; }

symfony - How can I fetch a value from the DB and display it in all templates? -

Assume that I have a user and a message my Symfony2 The unit is an app with a one to the relationship between the two organizations, so that the user can have more than one message, and I display the number of unread messages in this kind of main navigation Message (6) My Profile p> Where (6) unread messages To get this amount of number per user controller independently, I can think of defining the user unit method: public function getUnreadMessagesCount () {$ unreadMessagesCount = 0; Foreign exchange ($ this-> message as $ message) {if ($ message-> Unread ()) {$ unreadMessagesCount ++; }}} and call it in my menu.html.twig {% set umc = app.user }. GetUnreadMessagesCount ()%} {% if umc & gt; 0%} ({{umc}}} {% endif%} But for performance reasons, I would like to completely avoid looping through message messages just to check it For whether it is unread or not, I prefer to get it through DQL call (and keep this fame in UserRepository cla

c++ - Adding to a vector of pointers through a class function -

OK, I recently asked a similar question on some time ago, but I was tired and when I Post it, then delivered it. Basically, I have this original class unit which contains a vector of indicator for the qualification class. Public: vector & lt; Qualification * & gt; my abilities; To add new code to the unit and to make it easier to add, the new one is also in the class to add new capacities The function is. Code> Unreal Eligibility (Capability * Capability) {myAbilities.push_back (Capability); Cout & lt; & Lt; "Capability added" & lt; & Lt; Endl; The court's & lt; & Lt; Ability-> GetName () & lt; & Lt; Endl; } When I use it, it looks like: AddAbility (New Fireball ()); Now, my problem occurs when I test to see that the firefly information is still there, when it says the AddAbility () function goes. My output looks like this: added capacity fireball released Press any key to hold ...

Repairing a Corrupt MP4 Video File -

I have MP4 video that I took with the flip camera when I was blocking the recorder and now the video looks corrupt So the camera was compressed I can still download it from the camera, but this game can not play. Now, the video is still 2 gigabytes in size, so I think the data is still there. Therefore, I pressed the web that searched for solutions, and I found payment services and software which could be able to claim a diagnostic service (â € ¢ scarcity ') to fix such a thing, Showed me from the video, confirming me that there is probably something left unfortunately, however, the price is not in the budget to decide. A homecoming solution is required for this. Do anyone know how to fix a corrupt MP4? Or the service or software that does not cost too much money? Give it a shot This utility may be fine without leaving omitted MP4 / MOV files (or empty ) H.264 / AVC stream from the header. You have been tested with went files received Anfinilaijd file in case of damage

javascript - How to get the functionality of Object/Array .prototype without using prototype? -

OK, so I've blocked myself with a stupid move that is now using the jQuery library , And should say well to me, rather it is likely to break more than I have done after reading. Anyway I was trying to use the following bit: Array.prototype.contains = function (v) {for (var i = 0; i & lt; this.length; i ++) {if (this [i] === v) Returns the truth; } return false; }; Array.prototype.unique = function () {var arr = []; (Var i = 0; i & lt; this.length; i ++) {if (! Arr.contains (this [i])) {arr.push (this [i]); }} Return arr; } However, to achieve the unique values ​​of an array, it ended up breaking a lot of things due to the conflict for jQuery in my reason, so far I have been tasty To use the prototype forbidden idea? Especially in this case of unique values ​​required in an array? A common way to avoid modifying the prototype is the native type of static method: Array.unique = function (unit) {// your stuff}; // Example call var unique = Array.unique ([1, 1

time - change max output of Milliseconds from 1000 to 2000 in HTML -

I am thinking how 24 hours 60 minutes 60 seconds 1000 milliseconds 30 hours 30 minutes to change the timing of natural time format For 30 seconds 3200 milliseconds in HTML OK, now a bit more understandable First of all, Want to do it in javascript HTML markup is if you are saying that you want to change the time format, then I can give you examples of changing the format (i.e.: dd-mm-yyyy to mm-dd-yyyy, and many other variations). Check it out - there you feel if you want to change one day in 30 hours, then this is a suitable adaptation that you have to do. So basically a timer that connects a new hour every 30 minutes, and every 30 seconds is a minute, is it sure that if the effort of entertainment is worth the effort? Would you like to impress your friends with other things ... that is how fast you can lower a pint!

wordpress - Custom Fields/Meta Boxes - Only Display If Value is Present -

I am using WordPress add-ons to create custom fields for custom post types. I < p> Currently, I am using this code: & lt; php $ However, I have a value for a specific custom field, only then I need a way to display content. url = get_post_meta ($ post-> ID, 'snippet-context-url' is true); If ($ url) {resonant "<"; Lt; P & gt; & Lt; a href = '$ url' & gt; Reference URL & lt; / A & gt; & Lt; / P & gt; However, this field displays if the field exists (which is always in this situation). I need a code which is only a specific field. The check given on this example < code> & lt ;? php $ key_1_value = get_post_meta (get_the_id (), 'key_1', true); // Check if there is a value in custom field (! ($ key_1_value empty!) {echo $ key_1_value;} ? & gt;

printf - Java System.out and String.format errors -

Hello I'm new in Java and I have two errors, this is my code Class clauses {public static zero main (string [] args) {newcast ozose = new neoclass (7311994); // new object}} my other class public class new class {private int month; Private int de; Private int year; Public nuclass (int m, int d, int y) {month = m; Day = D; Year = y; System.out.printf ("Konstruktorius yra% s \ n", this); // Here is my first error) / Type the method in printfree (string, object []) is not applicable for printstrument argument (string, nucleus) / public string toString () {return string. Format ("% d /% d /% d", month, day, year); // Here is my second error}} / The method format (string, object []) is not applicable for arguments (string, int, int, int ) / Your language level should be low. Go to project & gt; Properties & gt; Set the Java compiler and it in Java 8 (or whatever you want above Java 1.5). You may need to enable the project specif

reporting services - SSRS Report Timeout inside Business Intelligence Studio -

Currently, I am trying to "refresh the field" within the Business Intelligence studio and I am getting the following error: "The timeout has expired. The timeout period has expired before the operation is completed or the server is not responding." Background information: Microsoft Visual Studio 2008 The report is very complex, usually it It takes 30-60 seconds to complete (filtered on the basis of criteria) query type: text Whatever I have tried: > "Connect timeout" on connection string for data source to 6 minutes Setting up Tools - & gt; Database tool - & gt; Question & Visual Designer, Cancel cancellation after 10 minutes. This will not return data (speed of execution time) to ensure setting parameters Top 0 in the query Select. "update timeout (in seconds):" Dataset's The field for which is taking a long time. If your query starts running a minute under dataset properties, t

c - waiting for ALL children with waitpid option __WALL -

I want a simple and elegant solution for the parenting process of all my children I have the following code, but it does not work That's how I want it and I do not know why anyone can explain to me, why? pid_t pid; For (int i = 0; i & lt; N; i ++) {if ((pid = fork ()) == -1) Return -1; // error, return from parent and if (pid == 0) {printf ("child:% d \ n", pid); Exit (0); // I have completed the baby} and if (PID & gt; 0) {waiting pump (-1, null, __WALL); // Waiting for all children, clone or non-stop printf ("I am a parent. All children have finished. \ N"); Return 0; // Everything is OK, returning from parents}} My output is: Children: 0 I'm a parent to end all children Have children: 1 I am a parent. All children have been eliminated Children: 2 and so on I want this: Children: 0 Children: 1. . I am a parent All the children have ended Why does the __WALL option not work for me? In your code, the basics in each loop are

jquery - Add css class to dynatable columns -

मैं dynatable उत्पन्न एक वर्ग नाम जोड़ने का प्रयास कर रहा / रही हूं & lt; td & gt; s, लेकिन मुझे नहीं पता कि कैसे मैंने इसे करने की कोशिश की है, लेकिन काम नहीं करता: & lt; तालिका id = "my-final-table" & gt; & LT; thead & gt; & LT; वें & gt; बैंड & lt; / वें & gt; & LT; वें & gt; सांग & lt; / वें & gt; & lt; th शैली = "प्रदर्शन: कोई नहीं;" वर्ग = "टीडी-आईडी" & gt; आईडी & lt; / वें & gt; & Lt; / thead & gt; & LT; tbody & gt; & Lt; / tbody & gt; & Lt; / तालिका & gt; मैं td-id को अंतिम & lt; td & gt; से जोड़ना चाहते हैं। वेर जसोंडाटा = ["बैंड": "वीज़र", "गाना": "एल स्कॉर्को", "आईडी": 1}, {"बैंड": "चैवेलल", "गाना": "परिवार प्रणाली", "आईडी" : 2}]; var processingComplete = function () {$ ('# my-final-table tr')। पर ("क्लि

c# - Compare without generics -

There is a little problem to solve me. I have a list of items, though later the list. Two of the examples will be filled in different types The first type is MyFirstType & LT; T1, T2 & gt; and the other is MySecondType & LT; T & gt; Now I need to run the list of objects and ask which of these items is there then I need to make some custom arguments on the item example for:. foreach (object obj in the list) {if (obj MyFirstType & lt; T1, T2 & gt;) {// do something} and if (obj is MySecondType & lt; ... {}} {}} The problem can be T or T1 and T2 in any way, so how can I write such a thing - what is a keyword statement that only types the waiver of the forgiveness , But the generic is not inside? If (obj MyFirstType & lt; T1, T2 & gt;) does not work, because it needs solid type for T1 and T2 Just refer to T1 And need to compare without T2 .. How to solve any idea You can use the property of IsGenericType If you can type

Why is Rails generating incorrect SQL for an order by clause? -

Why does Rail 3.2.14 generate wrong orders by section for this relationship? What's going on here 2.0.0p247: 306> U.comments.order (created_at :: desc) Refinery :: Group :: Select comment load (0.3ms) refinery_group group . * From refinery_group group WHERE refinery_group group . user_id = 56 command '---' \ n: created_it :: desc \ n ' In Rail, 3.2 or older, order is expected of a string: u.comments Style 4.0 was added. order (created_name :: desc)

swing - Java 2d coordinate transformation -

I am trying to plot a graph using the Java 2D graphics library and I thought it was with me Was there. I want to plot in the coordination system, where 0,0 is in the center of the panel on the left side, I used the following code and I was feeling that the result was necessary to me. Private Wide Doodro (Graphics G) {Graphics2D g2d = (Graphics2D) g; AffineTransform saveAT = g2d.getTransform (); // Get height height of panel height = getHeight (); // Find between dual panels = ((double) height) /2.0; AffineTransform tform = AffineTransform.getTranslateInstance (0.0, yTrans); g2d.setTransform (tform); // Draw the line for the x-axis G2d.drawLine (0, 0, 100, 0); / / Old Transform G2D. Restore the transformations (CATAT); } Plotted the original centered in this window. The problem shows when I added a menu, it was originally offset in the Y direction, it should be twice as high as the menu's size. Do I need an account for the menu size and other containers that I add to the

How can I get angular-ui-bootstrap tabs to fill the remaining height -

I have a plunker to show: I want the green areas to reach the remaining available height Fill up I can set the div height: 100% and millimeter I want, but it is less than desirable Is there any way to do this with CSS? Do I need to change some kind of size through JS? I have set the following sections in height: 100% and now it starts working: / p> .tabset, .tab-content, .tab-fane, .tabbable {altitude: 100%; }

regex to remove comma between double quotes notepad++ -

I'm trying to remove comS within double quotes from a CSV file in Notepad ++, I have it : 1070,17,2, GN3-670, "Collar B, M Stay", "2,606.45" And I need it: 1070,17,2, GN3-670, "Collar BM Stay", "2606.45" I use Notepad / Reg App I am trying to change the option with I pattern I tried all kinds of combinations, but did not manage to do this: (file has 1 million lines.) Today I'm not completely sure anymore what a simple regex could do is? Maybe I should go with a script ... Python? mrki, this is what you want (will be tested in N ++): Search: ("[^",] +), ([^ "] +") Change : $ 1 $ 2 Or \ 1 \ 2 How does this work? In the first bracket group 1, comma (but not included) captures the beginning of the string. Capture the end of the string after comma in the second bracket group 2. Replacement replaces string with combination of group 1 and group 2. In more detail: In the first bracket, if we

c# - How can I go to specific frame in animation? -

In my game I have created a world view to let the player see progress from one level to another It is that I have shortened "steppingstone", three between each level so if I have three levels, then there are six small points between them. Everything that I have done has been made a phantom where there is 1 dot in frame 1, 2 points in frame 2 are something like this: 0 - - - 0 - - - 0 Where the player has defeated 1 level, it will look like this: 0 - - - 0 < / pre> So I've cut my phantom, and added an animation. By default it plays again and again, I set this speed to 0. Gameback has been named "Leleadotts", this controller is an animator with "leveldots_0" I think the name of the animation is "Layleadots" because it has the property with the play icon? I am new to this ... Therefore, in my updates (in all places) in my camera I want to control the dots frame. For example, I know that the player has defeated 1 level,

c++ - Algorithm to convert double to long double -

यदि दोहरे एक 64 बिट आईईईई -754 प्रकार और लंबी दोहरी या तो 80 या 128 बिट आईईईई -754 प्रकार है, रूपांतरण को करने के लिए हार्डवेयर (या कंपाइलर?) द्वारा एल्गोरिथ्म का प्रयोग किया जाता है: डबल डी = 3.14159 ; लंबे डबल एलडी = (लंबी दोहरी) डी; इसके अलावा, यह आश्चर्यजनक होगा अगर कोई एल्गोरिदम के लिए एक स्रोत की सूची बना सकता है, क्योंकि मुझे कोई भाग्य नहीं मिल रहा है। 3.1415 9 जैसे सामान्य संख्या के लिए, प्रक्रिया निम्नानुसार है: संख्या को हस्ताक्षर में अलग करें, पक्षपातपूर्ण प्रतिपादक, और महत्व और एक्सपोनेंट में लंबे डबल और डबल (0x3fff - 0x3ff) के लिए एक्सपोनेंट पक्षपात में अंतर जोड़ते हैं। हस्ताक्षर, नए प्रतिपादक, और महत्व को इकट्ठा करें (इंटेल 80-बिट प्रारूप में अग्रणी बिट को स्पष्ट करने के लिए याद रखना) व्यवहार में, इंटेल 80-बिट प्रारूप के साथ सामान्य हार्डवेयर पर, एक "रूपांतरण" एक्स 7 स्टैक (एफएलडी) के लिए सिर्फ एक लोड निर्देश है बिना किसी हार्डवेयर समर्थन के प्लेटफॉर्म को लक्षित करते समय, वास्तविक प्रतिनिधित्व विवरण के साथ ही शायद ही कभी एक अनियमितता की

html - Is using bootstrap or a theme cheating? -

I am currently new to HTML and CSS. I have completed the HTML / CSS course of CodeCADADEMY yesterday and actually used it It has started working on some things, but it will touch everything and I will finish it as I learn more with PHP. I am using Bootstrap right now and it seems like I'm cheating. I have tried to do everything myself but it basically gives you a nave bar which I just do not steal and use, I will try to make my own later. This is my current site: What should I use? Should I try to do everything with my CSS by cutting the bootstrap? I mean that I have used my CSS for positioning but it does not appear very much, what is the use of professionals? Thank you. Professional mainly use bootstrap or foundation (since this is the most popular frameworks). If you are completely new, then perhaps there is no bad idea to correct some of the websites in order to improve from scratch and correct your basic HTML / CSS skills, and once you're comfortable So I advise

Installing Ruby on Rails on Mac -

To set up the ROR on my Mac (V10.9.2), I have decided to follow the instructions of Ruby 1.9.2: / p> "rvm install 1.9.2" was taking too long, so based on the suggestions on SO, I used "rvm requirements" to install each individual needs with the MacPorts I then performed "rvm install 1.9.2" and it ran very fast. When I tried to execute "Mani Rail", I received an error message Activesupport requires the Ruby version & gt; = 1.9.3 As a result, I went back and tried again with 1.9.3: rvm install 1.9. 3 rvm - default 1.9.3 gem update gem installed rails This time, during the rail-established order, the stuck in setting up the document for the process rail. I decided to interrupt it and run it instead: Install Gem --no-ri --no-rdoc rails This worked! I ran the following: Rail New Pong; CD Pong; The train generated the controller welcome index The last command in that string gave me the following error: /Users/me

Registering iOS devices for use with Amazon SNS (APNS) through Amazon Anonymous TVM -

Similar queries on Stack Overflow appear many times, with no solution for Amazon SNS. Indicates that Amazon SNS (APNS) can be completed through an anonymous token vending machine. Provides a template to deploy, which I have used, then specifies an IOS client that uses its usage However, in the template configuration source or in the iOS client instance, I can not see that the TVM from the SNS application allows device entries How to make it connected (referred to as the end point) Any idea where it happens? The context changes are linked to the client-side. The solution was as follows: Include: AWSRuntime.framework AWSSecurityTokenService.framework AWSSNS.framework #define SNS_PLATFORM_APPLICATION_ARN @ "Insert ARN Here" #define TOKEN_VENDING_MACHINE_URL @ "Enter vending machine url, found in the output tab "# USDSL1 # Define Progress Mark - Amazon TVM + (Zero) initSNS {Amazon Credentials * Credentials = [Get Amazon Chaindraffron credentials FraMe Chai

hibernate - Method to return a List to populate DataTable from a query containing inner join -

I have created a JSF project by using preprime components in Phlebps and by making the data firmness with being hibernate. In this project, for each model class, there are at least two views (xhtml page), a dao class and controller class. To return a list of items in the DAO, there is the following method which I use to populate the data cable. Below I am using to put snippets of DAO and XHTML pages. I'm using to populate the datatable. Textboxaido.Java Public list & lt; Textobase & gt; Listener () {List & lt; Textobase & gt; listTextobase = null; String query = "include SELECT * tbl_textobase from internal to tbl_disciplina tbl_textobase.disciplina_textobase = tbl_disciplina.id_disciplina"; {Try this.manager.getTransaction ().) Start (); listTextobase = this.manager.createNativeQuery (query, new textboxes). GetClass ()). getResultList (); . Committed to this.manager.getTransaction (); } Hold (exception before) {listTextobase = null; . This.manage

python - Downloading then deleting many files which together are very large, issues? -

itemprop = "text"> module pypdf2 and urlib I make a lot of planning There are many uses in Python. Massively (text) analysis of pdf files using my current plan pypdf2 to download files using urlib , save them on your computer, then open them / Extract text is The .pdf file is in size from 10-500 MB, which (that is ~ 16000 PDF files) means that the level of this project will be on GB to TB scale. Extracted data will be large, not just a tag set / count of word associations, but will be an issue for the .pdf file itself. I'm not planning to download them at once, but iteratively so that my system is not overwhelmed. Below is a high level workflow: pdf_url in all_list: download_using_urlib text (reader) (pdf_url) Most codes are already written and I can post it if it is relevant. My question is: can there be a problem in my computer by collecting and removing 8 TB data on my HD? As you can see, I am not collecting it once, but I am just a little worri

Computing the powers of a polynomial f(x) modulo irreducible polynomial h(x) in MATLAB -

मान लीजिए मेरे पास बहुपद एफ (x) = a_0 + a_1 * x + a_2 * x ^ 2 + ... + ए_ (एन -1) * एक्स ^ (एन -1) एफ_क के ए_आई तत्वों के साथ, क्यू प्राइम मैं किसी भी सकारात्मक के लिए डिग्री एन के एक बहुपदी एच (x) ^ कश्मीर modulo शक्तियों एफ (एक्स) ^ 0, एफ (एक्स) ^ 1, एफ (एक्स) ^ 2, ..., एफ (x) Matlab में पूर्णांक कश्मीर? मैं फ़ंक्शन deconv (conv (f (x)), h (x) का उपयोग कर रहा हूं लेकिन मुझे सभी व्यक्तिगत शक्तियां नहीं मिल रही हैं धन्यवाद! इसे आज़माएं u = f; मैं = 1 के लिए: टी [q {i}, r {i}] = deconv (f, h); च = रूपांतरण (एफ, यू); प्रत्येक शक्ति के लिए आपका जवाब सेल सरणी आर में होगा।

python - Keeping a connection open for the purposes of testing -

I am trying to test a database where I open the X number of the axle connection, when I against the database Run a transaction set database. That being said, I have started creating some arguments to open the connection to the database: import socket df open_connect (hostname, port): "makes a socket connection" Which function: Hostname: To connect to Hostname: Port: Port to connect to host. "" "" Ipaddr = socket.gethostbyname sock = socket.socket (socket.AFNAAT, socket.SOCKRRMAM) sock.connect ((ipad, port)) Sock.close () def main (): "" "main The task "" "" open_connect ('somedb', 3306) If __name__ == "__main__": main () I need to be added now that there is some argument which Can anyone please provide the connection on the best way to open a DB connection, while I will answer the actual questions. I will thank you in advance. I think I try to use a library such as MySQLdb that you do not

How do I fix error "use of undeclared identifier n" in C? -

I'm sure there are probably many syntax / other errors, but I'm trying to figure out that it's on I am very new to this, so I really do not know how to fix the undisclosed identifier. Note that #include & lt; Cs50.h & gt; is the only CS50 library #include & lt; Cs50.h & gt; # Include & lt; Stdio.h & gt; Int main (zero) {int sum, fee, disc; Printf ("For rates with tax and security deposits, type 10 percent, type n:"); String name = GetString (); If (name == y) {printf ("pretext amount:"); scanf ("% d", and fee); printf ("Well, I'll add 10% tax to% d. \ n", fee); Add = (1.1 * fee); printf ("plus tax amount =% d \ n", add); Printf ("Security deposit = 1000 dollars \ n"); Printf ("Total = (% D + 1000)", add); } And if (name == n) {printf ("pretext amount:"); Scanf ("% d% d", & amp; fee, & amp; disk); printf ("OK, I'll add 10% discount t

java - How can I map a custom image to a polygon in a game? -

इस सवाल का पहले से ही एक उत्तर है: < / p> 2 जवाब मैं मूल रूप से कोशिश कर रहा हूँ जावा में रीमेक क्षुद्रग्रह, लेकिन मैं एक गंजे ईगल को एक जहाज के रूप में उपयोग करने जा रहा हूं जो सोवियत ध्वज को गोली मारता है। अभी, मेरे गंजा ईगल छवि ईगल के चारों ओर एक सफेद रूपरेखा के साथ एक वर्ग है। मैं इसे निकालना चाहूंगा, क्या यह किसी एक प्रकार की एक बहुभुज को एक-एक-एक फैशन में मैप करने का कोई तरीका है? यहां मेरा कोड है, हालांकि मुझे नहीं पता कि यह कैसे मदद करेगा कुछ भी: पब्लिक क्लास मेन {/ ** * @ परम कमांड लाइन तर्क * / सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग [] आर्ग्स) IOException फेंकता है {गेमटास्ट टी = नया गेमटेस्ट (); } सार्वजनिक स्टेटिक क्लास गेमटेस्ट JFrame का विस्तार करती है {निजी स्थिर अंतिम पूर्ण WINDOW_WIDTH = 800; निजी स्थिर अंतिम अंत WINDOW_HEIGHT = 500; निजी गेमपैनेल गेमपैनेल; सार्वजनिक गेमटेस्ट () IOException {सुपर ("दीप फ्रीड फ्रीडम") फेंकता है; setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); setSize (WINDOW_WIDTH, WINDOW_HEIGHT); सेट लेआउट (नया बॉर्डर

Partition a seq by a "windowing" predicate in Clojure -

I would like to divide a seq into subseqs, in the same way, according to the partition, the function is not implemented The person element, but for many elements. For example: (gather (FN [ab] (> (- BA) 2)) [1 4 5 8 9 10 15 20 21 ]) will result in: [[1] [4 5] [8 9 10] [15] [20 21]] Similarly: (defn f [ab] (> (- BA) 2)) (F [1 2 3 4]) ;; = & Gt; [[1 2 3] [4]] (gathering f [1 2 3 4 5 6 7 8 9]) ;; = & Gt; [[1 2 3] [4 5 6] [7 8 9]] This is the idea that I apply the beginning of the list and the next element of the function, and if the function returns True, we split the current head of the list into a new partition till that point. I have written it: (defn collect [pred? Lst] (loop [ab] [l] [l] (let's [first (a) (First L) NXT (CONJR BR) RST (rest L)] (What is CONSIDED (empty? L) (blank) (again ACC NXT RST) ((Prepaid Pre?) AB (Repeat RIC NCT RSIR): Other (Cause ACC) [B] RST)))) And it works, but I know that there is a simple way. My question is:

Jquery / Javascript - Uncaught TypeError: undefined is not a function -

Google does not execute my JS code Everything works fine in Firefox $ ('a [href = "# pricend"]) Click (function () ($ ("div.text_1"). Text (($ ("Div.text_1"). Text () == 'smth1') 'smth2': 'smth1') $ ("div. text ("$ (" div.text_2 "). Text () = = 'Smth2') 'smth1': 'smth2') if ($ ('div.text_1'). "smth1")) {// smth here} The Chrome console output indicates the "if" line above. Uncaught TypeError: Undefined Any No function (anonymous function) f.event.dispatch jquery-1.7.2.min.js: 3h.handle.i How to fix it? Now anything in mind No, does the name work and before you can compare it? < p> You can not call. () contains the returned text value from Text (). If you value You should be fine after you remove it from jQuery. var divText = $ ('div.text_1'). Text (); if (divText.indexOf ("smth1" ) = -1) {// your stuff ...}

arrays - How to correct my php number_format error? -

I get the error below my array code How can I fix this error to display results? Error: Warning: the value of the number-format () is 1 parameter double, string is My code: $ account ['test'] = 775.57; $ Account ['savings'] = 2275.31; $ Account ['moneyMarket'] = 4554.43; Print ("& lt; Table & gt;"); Print ("& lt; tr & gt; & lt; td & gt; Checking Balance: & lt; / td> & lt; td & gt; $" Number-Detection (Check, 2). "& Lt ; / Td> & lt; / tr & gt; "); Print ("& lt; tr & gt; & lt; td & gt; Savings Balance: & lt; / td & gt; & lt; td & gt; $" No.-Format (saving, 2). "& Lt ; / Td> & lt; / tr & gt; "); Print ("& lt; tr & gt; & lt; td & gt; Money MkT Balance: & lt; / td & gt; & lt; td & gt; $" No.-Format (Money Market, 2). " & Lt; / td> & lt; / tr &

c# - Select an option from a dependent drop box Selenium web driver -

My application should be used in IE. I'm doing automated testing in which the first drop-box, the script is already selected to select an option in "Category", which is displayed in the second drop-box in the category, "Name". The script then selects an option in "name", and an associated page will appear. "Name" has no choice until the selection in "Category". HTML Source: & lt; Select ID = "drop_category" & gt; & Lt; Option value = "" /> & Lt; Option value = "category 1" & gt; Lesson - Category 1 & lt; Option value = "Class 2" & gt; Lesson - Category 2 & lt; Id = "drop_name" & gt; After selecting the option "Category 1", the HTML source changes to the following: & lt; Id = "drop_category" & gt; & Lt; Option value = "" /> & Lt; Option value = "category 1" & gt; Lesson

php - jquery html() losing spaces -

I am testing a preg_replace function, and I process data from an Ajax function (I preg_replace, I have it in htmlentities ( ): My test string is: pr example123 ~! @ # $% ^ & Amp;;; () - + = {} | []:; & lt; & gt;? "..., '/ ... I am trying to ensure that not all those characters are being changed My function is: $ String = preg_replace ('/ [^ a-zA-Z0-9 \ s + \ n \ r. \ / ~! @ # \ $% \ ^ & Amp; () \ + = {} \ [\] |: | << ']' -] / ',' ', $ String); I return from "echo" after going through htmlentities () to see both the data and the difference. (Data), I get it: PR example 123 ~! @ # $% ^ & Amp;;; () - + = {} | [ ]:; & Lt; & gt;? "..., '/ ... public relations examples 123 ~! @ # $% ^ & Amp; ;; () - + = {} | []:; & Amp; Lt; & Amp; Gt; & Amp; Quot ;. .., & amp; # 039; / ... respectively. However, when I put any of these in $ ("# div"). Html (data) , I fi

javascript - Can I configure Jade to generate readable well-indentated HTML code rather than single-line stream? -

I am searching for nodes, express and jade and it has generated a single-line consensual HTML code line. It is not necessary to say that this work is very inconvenient when it is discovered how things work and debug my first app can it be configured to prepare the code to teach humans? I mean the new lines tagged with tags and tagged with the appropriate indentation in the tag hierarchy? If you are the Z API, you can jade.compile (template, {pretty: true}) (Model) . .

Java ROBOT producing error in Excel -

I am looping through a column in Excel and searching for unique values ​​by saving it in an array: string [] center = new string [30]; Robot robot = new robot (); Robot.delay (5000); Robot.mouserelease (InputEvent.BUTTON1_MASK); Robot.delay (1000); // For Scroll Down Columns (Int i = 2; I & lt; 5428; i ++) {robot.press (KAVENT.VICE_DOWN); Robot.delay (5); Robot.keyRelease (KeyEvent.VK_DOWN); Robot.delay (5); // copy tile robot KeyPage (KeyEvent.VK_CONTROL); Robot.delay (5); Robot.keyPress (KeyEvent.VK_C); Robot.delay (5); Robot. KeyRelease (Key Event .VK_CONTROL); // Get the contents of the tile string data = (string) Toolkit.getDefaultToolkit () .getSystemClipboard (). GetData (DataFlavor.stringFlavor); Robot.delay (100); // Check that tile is in Array for value (int l = 0; l <30; l ++) {if (center [el]! = (Data)) {centers [l] = data; }} // Columns through scrolling} Any separate tile content variables (intL = 0; l <30; l ++) {if (centers [L] .equals (" "}}