Posts

Showing posts from August, 2013

c# - Cannot parse simple XML into an object? -

एक्सएमएल & lt; meterWalkOrder & gt; & Lt; नाम & gt; लाल मार्ग & lt; / नाम & gt; & LT; मीटर & gt; & LT; मीटर & gt; & LT; MeterID & gt; 1 & lt; / MeterID & gt; & LT; serialnumber & gt; 12345 & lt; / serialnumber & gt; & Lt; / मीटर & gt; & LT; मीटर & gt; & LT; MeterID & gt; 2 & lt; / MeterID & gt; & LT; serialnumber & gt; एसई & lt; / serialnumber & gt; & Lt; / मीटर & gt; & Lt; / मीटर & gt; & Lt; / MeterWalkOrder & gt; मैं किसी भी सीरियलइज़र का उपयोग करके किसी वस्तु में सरल XML नहीं प्राप्त कर सकता var xml = File.ReadAllText ("WalkOrder.xml"); Var xmlSerializer = नया NFormats.Xml.XmlSerializer (); Var obj = xml सेरियलाइजर। डायरेरिअलाइज़ & lt; मीटरवाकऑर्डर & gt; (नई स्ट्रिंगरेडर (एक्सएमएल)); मैं अभी 2 मीटर की ऑब्जेक्ट्स वापस लेता हूं जिनके पास कोई भी विशेषता सेट नहीं है और नाम चलने के क्रम में भी सेट नहीं है। सार

Running makefile based C project in Xcode 6 on OS X 10.9 -

I have a C project that compiles using the makefile, basically to rely on an external build tool Xcode). Since I updated Xcode 5 to Xcode 6, I am not able to run that project (still works). Every time I try to execute, I get the following error message: My Mac OS X 10.9.5, which is less than the minimum deployment target of the project. I have configured the MACOXXDELETMTMTTMTT for 10.9, and it does not change anything. Then, replace the minimum deployment target of your project or upgrade Mac Mac to the version of OS X. In the end I just removed and rebuilt the goal and resolved this issue ...

symfony - Symfony2, get file type from request -

I have a form in my template with a file input. In my Controller, I can retrieve $ request- & gt; File-> Receive (my file with 'file'); But how can you get the type? Is there any way with Symphon 2? get () function FileBag class will throw you if an object is returned lands (or if there is an error.) you can get the mIME type of the file: $ file = $ request- & gt ; File-> File '); $ Type = $ file- & gt; GetMimeType ();

php - Conditional return empty fields instead true or false -

I have the following problem. When I try to log in, this is an empty field $ left = $ right = FALSE; $ Correct = $ end & lt; ($ Index + 1) * $ arr [$ index] ['sec'] & amp; Amp; $ End & gt; $ Index * $ arrival [$ index] ['seconds']; $ Left = ($ start <($ index + 1) * $ arr [$ index] ['sec']) & amp; ($ start> = $ index * $ arr [$ index] [' Sec '])); Echo $ left "-". $ Right ". & Lt; / br & gt;"; When you resonate false boolean, then it For the purpose of debugging purposes, use var_dump , as it will show you the exact value of the variable, this is an empty string '' To display the string value of incorrect and true , use a threesome: resonance ($ left? "True": "wrong"). "-". ($ True? "True": "wrong"). "";

c# - Code to be run on program close and pc shutdown -

I have a formless application that runs in the form of a system tray application. When the computer stops or the application stops, then it is struggling to run the code. This is what I have done so far class sysTrayIcon {public sysTrayIcon () {AppDomain.CurrentDomain.ProcessExit + = New EventHandler (ExitCode); SystemEvents.SessionEnding + = New Session End Event Handler (ExitCode); } Close the public zero exitCode (object sender, EventArgs e) {contactCman app = new contactCman (); bool didWeSuceed = appClosing.stampUserOut (); If (didWeSuceed == false) {MessageBox.Show ("Stump Out Function Run Returns Failed !!"); } Other {Mailboxes} Show ("Function Run Stump Out Function Success"); }}} Class contact key {public dictionary & lt; String, string & gt; GetUrlResponse (string toDo) {var url = main SiteUrl + "/" + apiFileName + "?" + "User Id =" + User Id + "& amp; pw =" + pw + "and Tudo =" + Two To

javascript - Node js offline speech to text -

I want to create a robot with Node.js and Tessel.io, I bought an audio module and I am thinking If Can anyone help me? Thanks is a node module for CMUSphinx It works offline It's a little initial state but let me know if you have questions about it.

c - Discover number of CPU cores using threads -

I have an assignment in which I have to write a program on Linux in C (I use Sentos), which is the thread / Processes to determine the number of cores from the CPU First of all I tried to print the current time in Microsoft / Microsounds, because I know that 1 thread / core (or 2 with HT) can run. But more than 10 threads from the millisecond printed at the same time and none of the microseconds was equal. Second, I tried to measure the execution time of the thread with the clock, I have given 4 cores, at the same time the execution time of 4 thread should be taken as the execution of approximately 1. But any of my programs bring me close to the number of CPUs, can you help me with some suggestions? Programming current time: pthread_t and [n]; Zero * APIS () {// Now time; // time (& amp; now); // printf ("% s", ctime (and now)); Structure Timel Start, End; Long meats, seconds, usercandes; Gettimeofday (and start, tap); // blue (2000); Gettimeofday (and end, tap); Sec

linux - Hiding STDIN echo after pressing Enter -

I am working on a messaging system which uses the Unix terminal to make message output more user-friendly For, I wanted to hide & lt; STDIN & gt; In the other message output, use it after pressing the Enter button my $ user = "any"; My $ message = & lt; STDIN & gt; #must shows what the user types, but after hiding the message, the message should be hidden $ chomp $ message; Print message file "& lt; $ user & gt; $ message \ n"; I have read in the forum that some method is using the word :: ReadKey , but unfortunately I am not able to do that because in that module The system does not exist borrowed It reads a letter at the time, and when the entry is entered, this current line \ r Use strict; Use warnings; Sub get_pass {local $ | = 1; My $ ret = ""; While (1) {my $ found = match (); Final if $ is found "" \ n "; $ print; $ ret. = $ Found;} print" \ r "," "x length ($ ret),&qu

java - Add subclass objects to an ArrayList -

I have been a month in my BSc in software, and we are working on this forest project where we have different types There are trees (ash and bee) which grow at different speeds, they are sub-squares of normal class trees. My problem is now that I have been asked to add two trees of any kind of tree (ash and beech) to an array list. Their int age and double height should all be different Public Square Tree {Public Interval Age; Public double height; Public Zero Growth One Year () {age ++; } Public Zero Show () {System.out.println ("trÃÆ'à ¢ â,¬Å¡Ãƒâ € šÃ, ° + + + +" + "+ "M +" meter "); Public class ash tree (public ash) {extended} { ash for the source age = 1; height = 1.0;} one year for public zeros () {super.growOneYear (); if (height <15) {height = height * 1.20;}} public zeros show () {System .out.println ("Ask:"); super.show ();}} Keeping in mind that you already have extended tree class mani

java - Output the first letter of each string in an array list? -

This is for my homework assignment, so I do not want any code to give only an explanation about how to proceed. . I have installed a program that takes user input and adds them to an array list. I can output the list using System.out.println (list); But I need to print only the first letter of each word. How should I go about doing this? Cheers ... The basic idea is your list There will be a loop on each string , and for each it takes the first character (see for it) and then print it in your normal way (I think that system.out println () ).

ColdFusion 9 CFCHART CFCHARTSERIES Issue -

Image
I am displaying a chart with one or more line series data comes from a query and works correctly If the chart is higher than the series, however, if only one series has been returned, then it is not being displayed correctly. The code used here is: & lt; cfchart format = "flash" tipstyle = "mouseover" showlegend = "yes" xaxistitle = "date" yaxistitle = "hits" chartwidth = "1200" chart -text = "300" & gt; & Lt; cfoutput query = "qryReport" group = "APP_SYS_NR" & gt; & Lt; Cfchartseries serieslabel = "# qryReport.APP_NA #" type = "line" & gt; & Lt; Cfoutput & gt; & Lt; cfchartdata item = "#date format (qryReport.CDR_DT," mm / day / yyyy ") #" value = "# qryReport.TOT_HIT_CNT #" & gt; & Lt; / Cfoutput & gt; & Lt; / Cfchartseries & gt; & Lt; / Cfoutput & gt; & Lt; / Cfchart &a

oracle11g - I can't modify a created job -

Image
I want to modify a job that I have made. But I was assigned 'database object that does not exist' at the level of the name & gt; 'Jb_do' BEGIN SYS.DBMS_SCHEDULER.set_attribute (name => 'jb_do', attribute = & gt; 'JOB_ACTION', value = & gt; 'my processor'); End ; Edit: How did I create my work BEGIN SYS.DBMS_SCHEDULER.CREATE_JOB (job_name = & gt; Nol "'ts'', job_type = & gt; 'PLSQL_BLOCK', job_actification = & gt;", number_of_graze = & gt; 0, start_data => faucet, repeat = interval => null, and_data & gt; ; Faucet, Job = class = & gt; DEFAULT_JOB_CLASS ', enabled = & gt; wrong, auto_drop = & gt; true; comment = & gt; NULL, credential_name = & gt; NULL, destination_name = & gt; NULL); End; Select all_scheduler_jobs * where job_name = 'ts'; < Based on the query results shown in your question, div class = "post-te

Page Template select list not appearing in WordPress Child Theme -

I am using a WordPress child theme and the page template selection list is not appearing when I create a page Or edit my page templates are set correctly, they start with all: / * Template name: blog * / Are you sure your child theme is set up properly? Appearance & gt; Navigate to Themes and make sure templates are unavailable, this is not an error message. Before me was this issue, and after adding the index.php file from the original theme I was able to change the page template Child Theme

c# - RGB 24 to BitMap Resulting in Black Image -

I can not wrap my brain around the images and byte [] one Raw RGB colors in Bitmap . I found a solution that enables me to use a code in RGB 24 BPP byte [] in the bitmap to setPixel , but I I've read that lockbits is very fast, so I'm trying to explain how to do it. Using the SetPixel method, I am getting an inverted image: Create a Public Static BitmapBitcom 24BPRGB (Byte [] BMPData, Int width, intensity height) {var BMP = new bitmap (width, height, pixel format.form 24 bpRGB); Var pos = 0; For (var y = 0; y & lt; height; y ++) {for (var x = 0; x I do not understand this how to reverse it. But when I try to use LockBits , the image is black only, and I'm sure what I am doing, it comes quite straight forward. Public static bitmap CreateBitmap24bppRgb (byte [] data, integer width, height of intensity) {var bmp = new bitmap (width, height, pixel format.form 24bpprbb); // Create a bitmap data and write to launch all the pixels var bmpData = bmp.LockB

wordpress - How to forward domain/url to website content host, but show old/real/company url? -

Sorry, if some of these apps are specific, then I will try to keep it normal. I am creating a website that uses the Unioro WebHotel for DNS and I am using the WordPress hosted wp-engine for the website. "Www.wpengine.com/mydomain" from showing content to more or less "www.MyDomain.com", but definitely when people go to Mydomon, they should not be seen WPNJen / Mydomain. When I navigate to the site, it should also be done through MyDomain - like - & gt; "Www.MyDomain.com/SubDomain". (I think this part has been detected because the WebHotel has the option to include the path in the "Forwarding") UnoEuro gives me the option between forwarding of 301 and 302, I do not seem to be, but I (Generally speaking, how do you do it in most DNS services? (I need to know that I'm moving forward DNS service is no longer used from Old Hotel And I was not the one who set it up, so I do not know how this is done.) The OK solution was to

java - Changing color character text of a JLabel? -

I am trying to change the color of a JLabel color text I have a JLabel is text: "JLABEL" and I only want to change the color character "L" After changing, I need "JLABEL" display text with the letter "L". How can I do this? I am trying this: private zoom character format () {jlabel.setText ("JLABEL"); Four [] t = jlabel.getText (). ToCharArray (); String txtFormat = ""; (Int x = 0; x & lt; t.length; x ++) {if (t [x] == 'L') {txtFormat + = String.format ("& lt; html> Lt; font color = red>% S & lt; / font> & lt; / html & gt; ", t [x]); }} Jlabel.setText (txtFormat); } I do not believe that I think your question is right. To change just one JLables text and highlight the 'L' character in red, you can do the following: string text = jlabel.getText (); Text = "& lt; html> & lt; body & gt;" + Text.replaceAll ("L", " &qu

javascript - Strip HTML tagName with Regular Expression -

इस सवाल का पहले से ही एक उत्तर है: < / P> 35 उत्तर मैं HTML को अलग करने की कोशिश कर रहा हूं एचटीएमएल-कोड से टैग नाम मेरा HTML- कोड इस प्रकार है: & lt; div id = "MyDiv" शैली = "बाएं: 100px; शीर्ष: 10px;" & Gt; Div & lt; strong & gt; में कुछ पाठ & LT; उन्हें & gt; एएम के लिए कुछ पाठ & lt; p & gt; & lt; b & gt; बी, & lt; span id = "MySpan" & gt; span1, रीग-एक्स को कॉल करने के बाद मुझे उम्मीद है कि सभी मान्य HTML-Tagname स्ट्रिंग से जैसे एचटीएमएल-कोड से ऊपर से कुछ का परिणाम निम्नानुसार होगा: div, strong, em, p, b, span। यह मेरा दृष्टिकोण है: sTagName = sTagName.replace (/ & lt; * (। *) * & Gt; /, '$ 1'); चेतावनी (sTagName); उपरोक्त RegEx- स्टेटमेंट & lt; div & gt; परिणाम: div यह ठीक है। लेकिन यह & lt; Div stlye = "..." & gt; परिणाम: div stlye = "..." यह गलत है मैं इसके लिए केवल एक div की अपेक्षा करता हूं दूसरे शब्दों में

cloud - Insert Sales Order by graph in Acumatica -

I'm trying to insert a sales order through the graph My code is working, but it is not included in the database It is my code. Create a sales order. I am using Acumatica 4.0 Zero Zones (String Outlet CD, String SelmanCd) {Customer Seas = PX Selection and Customer; Where and lieutenant; Customer. ACTD, Equal and LT; Required and lt; Client.ACDD & gt; & Gt; & Gt; & Gt; . Select (this, outlet CD); Salesperson Salesman = PXSelect & lt; SalesPerson, where & lt; SalesPerson.salesPersonCD, similar & lt; Required & lt; SalesPerson.salesPersonCD & gt; & Gt; & Gt; & Gt; . Select (this, seller's CD); If (kus! = Null & amp; cus.BAccountID! = Null) {Soderter graph = pxgrf.ct instance & lieutenant; Sodarantra & gt; (); Soudar new order = graph Document insert (); NewOrder.OrderType = "SO"; NewOrder.OrderDate = DateTime.Now; NewOrder.RequestDate = DateTime.Now; NewOrder.CustomerID = cus.BAccountID; Graph.Document.Cac

css - sass watching multiple directories -

What is the correct way of sass to see many directories from a shell script? I have the following in a shell script: sass --style compressed --Watch branches / mysite / assets / css / sass: branches / mysite / assets / css & Amp; SAS --style compressed --Watch branches / mysite2 / themes / css / sass: branches / mysite2 / themes / css & amp; Sass --style compressed --watch trunk / assets / css / sass: trunk / assets / css However, it creates 3 processes and when I stop Ctrl + C to stop I am not all out of the processes. How can I get more information about seeing more than one directory and getting out of the right way? I hope that you have already tried it, but you have given all the folders a command Can add to line: sass --watch path / to / sass1: path / to / css1 path / to / sass2: path / to / css2 path / to / sass3: path / to / css3

c# - Why does using Process.Start makes the started app run from the parent app location instead of the started app's actual location? -

I have run into a problem where for another application process.start Using that, the app must warn about the missing files and then the crash. After a little investigation and debugging it seems that, by any means, the process When using Start , it is run from the location of the targeted unit that is run from the original program location, Exe is actually located. Why does this happen? Is it deliberate design? It is not necessary to say that the targeted app is completely screwed, so how should this method of launching any other XE should be used? Here's an example to demonstrate the problem: Let's create a simple small app that searches for a file and "Success" , And if it does not get it, then "fails". using the system; Using System.IO; Using System.Windows.Forms; Namespace testap {public partial class} form 1: form {public form 1 () {initial group (); } Private Zero Button 1_Click (Object Sender, EventArgs E) {try (if.exists (@ ".

java - How to get the right input for the String variable using scanner class? -

इस सवाल का पहले से ही एक उत्तर है: < / p> 12 जवाब मैं जावा और मैं सीख रहा हूँ एक इनपुट प्रोग्राम की कोशिश कर रहा था जब मैंने एक पूर्णांक और स्ट्रिंग क्लाइंट को आवृत्ति का प्रयोग करने की कोशिश की, तो एक त्रुटि है जिसके द्वारा मैं इनपुट स्ट्रिंग नहीं कर सकता। जब मैं इनपुट स्ट्रिंग पहले और int के बाद, यह ठीक काम करता है जब मैं स्कैनर वर्ग में एक अलग ऑब्जेक्ट का उपयोग करता हूं तो यह ठीक काम करता है। लेकिन इस पद्धति में समस्या क्या है जब मैं इनपुट को पहली और स्ट्रिंग को स्कैनर क्लास के समान आवृत्ति का उपयोग करने की कोशिश करता / करती हूं? import java.util.Scanner; सार्वजनिक कक्षा कार्यक्रम {सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग [] आर्ग्स) {स्कैनर इनपुट = नया स्कैनर (System.in); // स्कैनर इनपुट 2 = नया स्कैनर (System.in); System.out.println ("अपना नंबर दर्ज करें:"); Int ip = input.nextInt (); System.out.println ("आपका नंबर है:" + ip); System.out.println ("अपना नाम दर्ज करें:"); स्ट्रिंग का नाम = input.nextLine (); System.out.println ("आ

c++ - How to access/write a matrix in a function using Eigen? -

I am trying to write a function using Eigen which makes a diagonal matrix slightly different from normal. When the element of the diagonal is zero (or relatively close to zero), then it should be set to zero for diagonal element, but otherwise the value should be 1 / (this element). I tried to write a function which receives the diagonal matrix, which I want to reverse (this is actually a nx1 matrix, hence the name) and the second pointer, where I have to put the result: template & lt; Typename m1, typename m2 & gt; Void invertSingularValues ​​(Eigen :: EigenBase & lt; m1 & gt; sing_val_vector, Eigen :: EigenBase & lt; m2 & gt; & amp; res) {for (int i = 0; i < sing_val_vector.rows (); i ++) res (i, i) = (sing_val_vector [i] & lt; 0.0000001 0: 1 / sing_val_vector [i]); }; It seems that I can not access the elements of the matrix using (i, j) or [i] because I get these errors: < P> No match for an operator [] A ???? (Operant types are:

java - Generating PDF containing SVG images using Apache FOP in an Oracle database -

I am trying to use Apache FOP for PPD documents within an Oracle 11g database. Using the loadjava tool, I have placed sections from the following jar files in my schema: Commons-Logging-1.0.4.jpg Commons-oo-1.3.1.jpg Avalon-Framework-4.2.2.0 jar xml-apis-ext-1.3.04.jar xalan-2.7.0.jar serializer-2.7.0.jar xmlgraphics-commons-1.5.jar batik-all-1.7 Jar fop.jar Inside the database, I can generate PDF documents without graphics. The same code outside the database (command line) creates a PDF document with all related graphics. Inline SVG graphics are only ignored while implementing the database. They are presented correctly by the boutique outside the database. Have you successfully used Apache FOP to create PDF documents containing SVG graphics in OPEC database? I have a graphic defined & lt; fo: external-graphic content-width = ".5in" content-height = ".5in" src = "data: image / png; base64, iVBORw0KGgoAAAANSUhEUgA ..."

c - Pointers to structures, fields changing values inexplicably -

I am ready to complete that I am doing something stupid / wrong; This is what I expect. I feel a feeling for the structures and the crop is coming from the fields to reach the fields. Follow the code. Matrix. H: #ifndef MATRIX_H_INCLUDED #define MATRIX_H_INCLUDED #include & lt; Stdlib.h & gt; Typefif structure {size_t size; Int * vector; } Vector_t; #endif // MATRIX_H_INCLUDED main.c: #include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; #include "Matrix." Vector_t * vector_new (size_t size) {int vector [size]; Vector_t v; V.size = Size; V.vector = vector; Return & amp; V } Int main (int argc, char * argv []) {vector_t * vec = vector_new (3); Printf ("v size is% d. \ N", vec-> size); Printf ("v is size% d. \ N", vec-> size); Return EXIT_SUCCESS; } So this is a very simple program where I am creating a vector structure of size 3, return the pointer to the structure and print its size. This is the f

java - number of objects for garbage collection -

दिया गया: इंटरफ़ेस जानवर {शून्य मेनोओज़ (); } क्लास हॉर्स औजार पशु {लंबा वजन = 1200 एल; सार्वजनिक शून्य मेनोइज़ () {System.out.println ("व्हाइनी"); }} सार्वजनिक वर्ग आइसलैंडिक घोड़े को बढ़ाता है {सार्वजनिक void makeNoise () {System.out.println ("विनी"); } सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग [] args) {आइसलैंडिक i1 = नया आइसलैंडिक (); आइसलैंडिक i2 = नया आइसलैंडिक (); आइसलैंडिक i3 = नया आइसलैंडिक (); I3 = i1; I1 = i2; I2 = नल; I3 = i1; // & lt; - लाइन 14}} जब रेखा 14 पहुंच गई है, तो कचरा कलेक्टर के लिए कितने ऑब्जेक्ट पात्र हैं? ए 0 बी 1 सी। 2 डी। 3 ई 4 एफ। 6 जवाब ई है क्यों?

memory - Share variables between hosts with Go -

I have an application in Golong, and this will load basic data globally, so that the application responds faster Create and export a http interface to update the version while the user changes the database. But I launch another server, and I use a proxy. There is a problem, when the user sends an update URL to the URL, it will load the traffic from any of the servers. Not others utils.go: Basic data map to package utilities [string] * MyModel func UpdateVar () {// some work} func PreLoadVar () { // preload data in original data} and main.Go package main import ("codebase / utils") func main () {Utils. PreLoadVar ()} So is there any sharing between multiple hosts? Or can any worker help in this work? Nsq.io is a good option, but if I think I want one more simpler. Thank you :) Your global variable is a very simple form, which is known to be problematic when There are several ways to fix this problem: There are several ways to fix this problem: As

encryption - AES/Blowfish: random IV vs. random data at the begining -

In the encryption algorithm such as AES or Blowfish, the purpose of initialization vector (IV) has been understood (see also) > But I'm not like to transmit IV every time and I want to use it every time (easy coding). To get the randomness of messages with the same general prefix, I will add a randomly generated random white block of the same size as the fourth to the beginning of the encrypting message when decryption occurs, I will ignore it / first I will leave the bytes. Does this start of random data messages provide equal protection such as a random IV? Four essentially "Block 0" for the mode that mixes the last block with the existing encryption is. Therefore, adding a random block is manually equivalent. For more information (and perhaps a better forum for such questions), see.

java - Why is a null value provided to my JSP snippet from the form submission? -

Hi, I want a user to get the age from a form and convert the string to an int and want to use somewhere else in the Java class. .jsp snippet looks like this & lt;% string str = request.getParameter ("age"); Int convertInt = integer Parasont (str); & Gt%; & Lt;% myProgram.com Overheas (Not Converted);% & gt; However, I'm getting the HTTP status 500 - java.lang.NumberFormatException: Null I think this form is being created for the first time in a UI class Is the field empty? Is this a mistake and can I decide to thank it The suggestion that .getParameter ("age") is empty back. This means that there is no parameter named "age" presented through the form, to ensure that "age" is the name of your form parameter, i.e. Input type = "text" id = "parameter" name = " age " value = "test" They should ensure that cases are also match.

python - How to remove a button created by pygbutton -

I want to delete the button I created. I have created it: Button1 = pygbutton.PygButton ((50, 50, 60, 30), '1') button2 = pygbutton.Pygbutton ((120, 50, 60, 30), '2') button3 = pigbutton. Piegbutton (All for Biton = (Button 1, Button2, Button3) All Button =) (BB.Dre (Screen)) However, when a button is clicked, I would like to clean the button in the screen and show something else on the screen. How can I do this? A common thought I thought was to create a new screen after pressing a button. Actually, I have a boole that I had called buttonhubbed . As long as no button is pressed, we are just checking to see if the event was a button press. After pressing it, we set bool to true , making the background "clear" (by creating a new screen on the old one), and then continue to do whatever we want. My example code only "deletes" the button, changes the color of the background, and changes the caption on the window, but you use this ide

How to change column names in shell/bash? -

This question can be very easy for most of you, but I really do not want to do it manually. Assume that I have a file in the terminal such as: [dz2t @ edison-s GWAS] $ head $ PHENO GWASID CHILDID VSTNUM GENDER GA 1001 1001 11 Woman -9 1002 1002 11 Male-9 1003 1003 11 Male-9 1004 1004 11 Male-9 1005 1005 11 Female -9 1006 1006 11-9 How will the names of two columns change before "GWASID" and " Children "to" FID "and" IID " You can: < Pre> SD-A '1S / GWAISID / FID / A-A' 1S / ChildID / IID / 'Your file' It says that L'1 line, alternative Jeedblyuesaidi with FID and Chaildaid with IID. If you want to overwrite this file, you will need to add the -i flag after the sed word to edit the encode.

java - WebSocket async send can result in blocked send once queue filled -

I have very handy JT-based websites which are responsible for streaming small binary messages to connect to customers . I was using the sendBytesByFuture method to avoid any block on the server side. After increasing the load from 20 to 20 customers, they stop receiving any data. During the problem solving I decided to switch to the synchronous sending method and eventually found possible reasons: java.lang.IllegalStateException: blocking message for 10000 org.eclipse .jetty.websocket.common.WebSocketRemoteEndpoint on .Olog (WebSocketRemoteEndpoint.java:130). Org.eclipse.jetty.websocket.common.WebSocketRemoteEndpoint.sendBytes (WebSocketRemoteEndpoint.java.0044) There are no calculations on receiving customer data, potentially connecting them slowly They can not be. So I wonder what can I do to solve this problem? (Using JT 9.2.3) If you receive an error message from sending a synchronous Thread - Protocol copy is nothing you have attempted to send messages to mult

excel - Formula to search rows for certain value and get corresponding cells -

I am trying to write a formula for searching all the cells in a certain range (a certain limit in a column) Something like this: Obtain the line ID of any cell that matches a certain value, then a value from a different column (all the cells Matching) AB 1 ABC 123 2def 456 3GPi 78 9 4 ABC 100 Now what I need, I need to look for ABC A1: A4 Which will return the A1 and A4, and get the value. I could not understand B1 and B4. I know that I can do it in VBA. But it will not be updated while changing the formula. Excel for i = 2 Worksheet Function. Couta (range ("a: a")) if range ("a" & amp; i). Value = "ABC" then the MSBbox Range ("B" & amp; i). Value and if next I This code searches the column "A" in the "A" column and returns the "B" column row value.

loops - (Python) Stuck on skipping range values for the sum of a randint list -

I need to create a program in Python, which generates ten random numbers 1-100 which is a list In the store. Then a second loop should show the list, then display them also to calculate the amount of strange elements. Whatever I have done so far, any help is greatly appreciated. Random DEF main (): number list = [0] * range for 10 (10): numlist [r] = random.randint (1,100) print (numlist) list_length = Lane (number list) print ('number of elements in the list', list_length) More specifically, this is the part I got stuck on. I have to add the amount of elements and weird still. I have tried everything around me that has given me only the sum of the total elements. (0, 10, 2) for class in category: numlist [x] = numlist print ('sum of strange numbers', sum (numlist)) main () import random nums = [random.randint (1,100) _ range (10)] (Lambda i: i% 2 = You can also type lambda and filter = 0, nums) oddSum = sum (filter (lambda i: i% 2, nums))

mysql - Select all post and its comments for a specific user -

I have a general situation, I want to choose all posts and comments for a specific user. For example: 1) Post: 1 (post id), some title, some text 2 (post id), some title, some text comments: 1, 1 (post id), comment comment, comment Text, User ID (1 - 2, 1 (Post ID), CommentTitle, CommentTest, UserID (1 - from second table) 3, 2 (Post ID), CommentTitle, CommentTest, UserID (2 - from second table) 4, 2 ( Post id), comment title, comment text, UserId (2 - from second table) for example , I want to select the first post in a result set and his comments in other results as determined by the User ID. In short, I would like to select all the comments and comments made by the user. Can anyone help me? And I was thinking of making SP as a post ID parameter, but I had problems. This selects All posts are Select Post from where in Post ID (select PostID from comments where URIID = 1); Select all these comments and comments: Postp From SELECT *, comments ASC WHERE C.PostID =

angularjs - how get a list from google endpoint with angular $resource? -

I'm trying to make a list call with a google endpoint with $ resource, before I use http But the $ resource seems to be more pronounced with just one filling for the combobox. My service. JS looks like this: Provincial Services '(' Provincia ', [' $ resource ', function ($ resource) {return $ resource (' https://local.appspot.com/_ah/api/provinciaendpoint/v1/:provinciaId ', {}, {query} : {Method: 'GET', Params: {provinciaId: 'provincia'}}}});}]); And under my control, I call the list from the following line: $ scope.provincias = Provincia.query (); to interact with an endpoint API via the client's library Read the link If you're angular with endpoints, then there is nothing - it's a great resource. You can use $ http to kill your Endpoint API as a RESET service, but it requires some careful use of routes and HTTP actions. , And OAuth is a bit more difficult, if you think you want to do this later. I&

jquery - Get count and height of Html.ListBoxFor item -

का उपयोग करना सी # MVC 5 < li> उस्तरा 3 मेरे पास एचटीएमएल। लिस्टबॉक्स है ... @ html.ListBoxFor (x = & gt; x.SunSelectedList, Model.sunList , नई {@class = "पात्र उपलब्ध लिस्टबॉक्स"}) मेरे पास jQuery के जावास्क्रिप्ट है .. @section scripts {& lt; script type = "text / जावास्क्रिप्ट "& gt; $ (फ़ंक्शन () {var ssList = $ ("# sunSelectedList"); // उपरोक्त चर वैध है और सभी आइटम शामिल हैं}); & Lt; / स्क्रिप्ट & gt; } चर ssList के साथ, मैं कैसे विकल्पों की गिनती और प्रत्येक आइटम की क्लाइंट ऊंचाई कैसे प्राप्त करूं? विकल्पों की संख्या प्राप्त करने के लिए var विकल्प = $ (" # sunSelectedList ")। बच्चों ('विकल्प'); Var विकल्प = कोट = options.length; प्रत्येक विकल्प उपयोग की ऊंचाई प्राप्त करने के लिए या options.each (फ़ंक्शन (इंडेक्स, आइटम) {var optionHeight = $ (this)। OuterHeight , चाहे उनके चुने हुए राज्य की परवाह किए बिना। " तो .height () या .outerHeight () वास्

java - Oracle OPAM REST API checkout method returns an http 409 code -

Image
I am trying to use OPAM REST API I have written several Java methods Those who are working correctly (although some details have taken some time to find out), but now I am stuck in this one. https: // host: port / Opam / account / accountUID / checkout which gives me a 409 return. any clue? I am following the following (I have an example on how to write an HTTP request to Java) It is related to the user who is in OPAM which I used to call clients I certify that I am not authorized to check the password. If this is the case, what do I allow to do this OAPAM user? It appears that the privileged account must have explicit permission for the user, which is mine REST client is using to authenticate In this way, I can successfully see the account using OPAM client

javascript - tooltip in angularjs for form validation -

I want to show tooltips next to the invalid and dirty input elements in a bootstrap model form in the angularjs application. I am not currently using angular-UI I tried to search and get an implementation related to writing a command. Since we already use bootstrap and angulars, I was thinking that as the input field reaches an invalid and dirty state, what would be the best way to show tooltips. Perhaps something like this in your HTML (typical Bootstrap form structure): & lt; Div class = "form-group" verification-tooltip & gt; & Lt; Label & gt; My label & lt; / Label & gt; & Lt; Input type = "text" ng-model = "myModel" name = "someName" data-toggle = "tooltip" data-placement = "true" title = "your tooltip text." Class = "form control" & gt; & Lt; / Div & gt; Then type a command to stop formality using the event of your choice. In my example I have g

Asset Pipeline not serving assets, specifically Bootstrap in Rails 4.1 -

I have a relatively new Rail 4.1 app which is not serving JS / CSS through asset pipeline. The app is primarily a JSON API (designated subdomain) with some web-based administration tools. I have established a Rail Admin (which is successfully getting its CSS / JS and looks good), but any other web view does not get the property from the pipeline. My specific goal is to use bootstrap gem to bootstrap all non-rail admin views. One thing to note - initially I took away the gemstone file, it would be a pure API, then several related gems will be added back. Maybe it has changed some default behavior? I have definitely installed the bundle. TL; DR: When I visit a visual boycott of rails_admin, I can not find Bootstrap CSS / JS and the pages have been unstable. The gem of the current situation (Showing only relevant gems, note I do not have turboilines) Mani rail ',' 4.1.6 'Mani' PG Mani 'vs' Mani 'rails_admin' gem 'sprockets-rails'

ember.js - How to properly inject property into controller -

This was my initial approach but I get an error code: amber. Start ({name: "currentUser", initialize: function (container, application) {var store = container.lookup ('store: main'), attributes = $ ("meta [name = 'current-user']") attr ('Content'); if (attributes) {var object = store.push (App.User, JSON.parse (attributes)), user = App.User.find (object.id), controller = container.lookup (' Controller: Current User '). Set (' Content ', User); Container Type Injection (' Controller ',' Current User Narrator ',' controller: current user ');}}}); Error: Error: Controller on other Controller (Controllers): Current-user 'can not inject. Register 'Controller: Current-User' as a different type and type inject. So I did something after the start of the "Store", after Ember.Application.initializer ({name: "currentUser",) Methods): Function (container, app) {var

android.view.InflateException Caused by: java.lang.OutOfMemoryError -

This problem occurs only on some devices, but crashes the entire app for those users. The app loads two images at a time, is a basic, a staining copy for a scrolling effect. I am now using Picasso to load images which reduce issues Gives it, but it still happens to choose something. A new set of images (original and dimmed) is opened every time the app is opened. This type of images are initialised in onCreateView method: nonBlurImageView = (imageView) layoutView.findViewById (R.id.orginal_image); .. Picasso.with (getActivity ()) Load (GetResources () getIdentifier (bgNum, "drawable", getActivity () getPackageName ())) (nonBlurImageView); BlurredImageView = (ImageView) layoutView.findViewById (R.id.blored_image); . In Picasso.with (getActivity ()) load (. GetResources () getIdentifier (bgNum + "_ blur", "drawable", getActivity () getPackageName ()).) (BlurredImageView). with stack trace starts android.view.InflateException: binary XML fil

html5 - CSS Rules Involving the Value of data-* In Ancestors Not Working Well With IE When Value of data-* Is Changed -

इस सवाल का पहले से ही एक उत्तर है: < / P> 2 जवाब @ डुप्लीकेट फ्लैग: समस्या उस पुराने प्रश्न के समान है, लेकिन वही नहीं शुरुआत के लिए, उनकी समस्या आईई 8 के साथ थी और आईई 9, 10 और 11 में इसका समाधान हुआ। मेरा IE 10 & amp; 11। मेरे पास अवधारणा पृष्ठ का एक सच्चा सबूत है कि मैं किस बारे में बात कर रहा हूं। असल में, मैं एचटीएमएल 5 डाटा- एट्रिब्यूट्स को बढ़ाने के लिए कोशिश कर रहा हूं। जावा स्क्रिप्ट के साथ शो / छिपाना तर्क का उपयोग करने के बजाय सीएसएस नियमों का उपयोग करें। नीचे दिए गए कोड फ़ायरफ़ॉक्स / क्रोम में अच्छी तरह से काम करता है, लेकिन इंटरनेट एक्सप्लोरर 10 और 11 में विफल रहता है। p> मुझे लगता है मैं इसी तरह के व्यवहार को प्राप्त करने के बजाय माता-पिता में कक्षाओं का उपयोग कर सकता हूं, लेकिन एचटीएमएल 5 विशेषताओं इस के लिए भी बेहतर अनुकूल लग रहे हैं और मुझे आईई बग के साथ काम करने के लिए उन्हें नहीं मिल सकता है। < p> कोई अंतर्दृष्टि? & lt;! doctype html & gt; & LT; html & gt; & Lt; शीर्ष & gt; & Lt; मेटा वर्णसेट = &

java - Check if String contains regex match -

I am working on a program that is an interpreter for a simple language that works with the group and sets Operates. It currently works with the holding numbers set. When the user defines the set, then the input looks like this: set1 = {1, 25, 5, 6}; such as set1 = {1, 25, 5, 6} can also work, but do something like this Set1 = {1 25, 5,6}; should not so basically it does not matter to the empty space, if any "," between numbers it's OK. What I need to check is what is there in string between any "," , anywhere After the blank space and the second number, I am doing this: Pattern Pattern = Pattern.compile ("[0-9] [\" \ "] + [0- 9]" ); Matcher matcher = pattern.matcher (input); If (matcher.find ()) false return; And it works just fine. But this is a university assignment and I'm not sure that I have permission to use the pattern and Matcher . So my question is, is there any other way that I can see that

r - How to write function that takes uses the single ouput from another function as starting point for new analysis? -

i am having trouble writing the function calls another function and output to run a new analysis in the loop Uses as a base (or its equivalent). For example, suppose that function 1 creates this output: 10. The second function will take it as the starting point to run the new analysis. The single data point from the second output will be the basis of the next round of analysis, and so on. Here is a simple example: The question is how to create a loop for this or perhaps a more effective way to use spoiled. In any case, the first task can be as follows: f.1 < -function (x) {xa & lt; -seq (x, by = 1, length.out = 5) a.1 & lt; The second function, which calls the first function, can run in the following ways: F.2 & Lt; -function (x) {f.1 & lt; -function (x) {a & lt; -seq (x, by = 1, length.out = 5) a.1 & lt; -ail (a, 1)} z & lt; -f.1 (x) y = z + 1 seq (y, by = 1, length.out = 5)} How do I modify f2 () so that it Runs the calculation again whic

xcode - Swift class to interact with Interface Builder via IBOutlet -

Image
Good evening everyone, I'm slowly working through my first OS X app I am In order to interact with NSPopUpButton, I have been having difficult times for my SWIFT class to ensure that I was correcting it, I created a new project and wiped all the entries and the text was appended to the NSPopup Button Erased through delilet. However, as soon as I try to move the same functionality in my own classroom, I can not even get IBotlet connections up to the new category. Is a new class necessary for a specific class to work properly with the interface builder? Here is a screenshot of the class I created, as well as AppDelegate where I am trying to call the function related to this class. Finally, here IB element in question, should I be able to choose my own class under the 'custom class' inspector? I'm an iOS developer, but I think the same situation will apply to your situation. The interface built into a View Controller Class and Interface Builder is t

java - Why does this compile in Java7 and does not in Java8? -

Generic are difficult and it seems that they are treated differently in different versions of Java. This code is compiled successfully in Java 7 and fails to compile with Java 8. import java.util EnumSet; Public Sector Main {Public Stable Zero Main (String [] Args) {Enum foo = null; TryCompile (EnumSet.of (foo)); } Fixed & lt; C Enum & lt; C & gt; & Amp; One more & gt; Void trycompile (iterable & lt; c & gt; i) {} Static Interface Other {}} Here is an error message from Java 8. I used it to compile it: /tmp/java_A7GNRg/Main.java:6: error: try the method not to be applied to the main given types in the compilation class can; TryCompile (EnumSet.of (foo)); ^ Required: Iterable & lt; C & gt; Found: EnumSet Reason: Estimated type does not conform to upper bound (s): Enum Upper bounds: Enum & lt; Enum & gt; Another where there is a type-variable: C Enum & lt; C & gt; Expanded, other declared in law & lt; C & gt; Simp

CSS for circumventing ananoymous DIV -

I am using a CMS, when a form is created then all its contents are wrapped with To comply, it is called "Anamika", XHTML, unfortunately the subject was designed without this insight and then the submit button is CSS: . Contact form div.control input [type = submit] This works if markup is: & lt; Section class = "contact" & gt; & Lt; Form & gt; & Lt; div class = "control" & gt; & Lt; Input type = "submit" / & gt; However, because of this additional DIV added by CMS: & lt; Section class = "contact" & gt; & Lt; Form & gt; & Lt; Div & gt; & Lt; div class = "control" & gt; & Lt; Input type = "submit" / & gt; How can I write a bit more adaptive CSS, so additional markup does not affect it much, but without styling different elements through the ID or class ?? ? Your selector can still select the input, so div Will not affect it

jquery - Can I update session via Ajax and after PHP read this session? -

In my "estabelecimento.php" I send data to "carrinho.php" via Ajax and in one session Is stored. I want to use the session created on "carrinho.php" while refreshing the browser. estabelecimento.php & lt ;? Php session_start (); If (project ($ _ session ['prato'])) {echo 'session'; } Else {echo'session not found '; }? & Gt; & Lt; Script & gt; $ .ajax ({url: "carrinho.php", type: 'post', data: {idPrato: idPrato, quantidade: quantidade, detalhes: detalhes, acao: acao}}); & Lt; / Script & gt; Carrinho.FP add session_start (); After opening estabelecimento.php in tag.

arrays - What's the name of this method to find a value in a very efficient way -

If you have a table / array with lots of sorted int values, and Rather than finding one you want, instead of finding one, I know that this is a very efficient method that does this: First of all, it goes to the middle element if the element value is from the value searched It is more, then it ignores all the elements above one and goes to the middle, then it goes up in the middle. And it continues until the value is found. This will be something in pseudo search_value = x real_index = length (array) / 2 offset = real_index while (true) {if array [actual_index] = search_value Then actual_irect if array [actual_index] & gt; I know that this method has a name, it is detected again / output = round_down (offset / 2) real_index = real_indack - offset off offset = round_up (offset / 2) real_indix = but i can not miss it I believe that you are thinking of a binary search. / P> I do not know what language you are working in, but this can be an API call.

javascript - Why my ng-template not showing the value of $scope and ng-repeat in angularJS? -

I have a problem with a ng-template now. This is my code: HTML: & lt; Script id = "template / popover.html" type = "text / ng-template" & gt; & Lt; Ion popup-view & gt; & Lt; Ion material & gt; & Lt; Div class = "list" & gt; & Lt; One class = "item" ng-repeat = "chapter in chapters" & gt; {{Chap}} & lt; / A & gt; & Lt; / Div & gt; & Lt; / Ion content & gt; & Lt; / Ion popover-view & gt; & Lt; / Script & gt; Controller $ scope.Chapters = [1,2,3,4]; $ IonicPopover.fromTemplateUrl ('template / popover html', function (popover) {$ scope.popover = popover;}); I think this site is working with 'Ionic popovers'. Why my ng-repeat is not showing anything .. < / P> Please help me .. Thanks Popup function passes you in a radius value lets you. I suppressed the pen to do this: The original change is here: $ sc