Saturday, 15 September 2012

php - Virtual hosts with two servers on localhost -


I have two Apache web servers running on my laptop running Windows 7. I use a Zend server to develop another 81 (Zend CE) sites on Port 80 (XAMPP). I do not want to use Port 80 on my other virtual servers by using port 81 on another server. Port 80 no. I tried but everyone is getting a request to do a search on Google

    

I made changes to the host file.

Missing to edit:

  NameVirtualHost *: 81   



testing - Where does fitnesse write my class logs -


I'm new to fitness and starting with sample test cases. I have a simple test case in which

  is system.out.println ("XYZ");   

Statement: Whenever a trial case is executed. I wanted to know how Phinet logged out the log statements?

When I start FitNesse in log enabled mode, I can not see it in the file's footage log files.

  Java-Girth fitness-standalone.jar-P9999-D. -l. System Info: Windows 7 Enterprise Edition, 64-bit JDK 1.6B35 Fitnes Release 20121220    

The system goes to the output .out.println () output page After the completion of your test, you will see a green, red, or yellow icon in the top right, click on that icon and it will go to the output page. Anything printed in standard out or standard error will have to go there.

If you want more detailed logging, you may want to create a logger class using Loj4j or equivalent version in your stability language.

android - Different app name in sharing menu -


I'm having trouble finding the right keywords to get it.

I'm basically trying to name the name of a different app in the sharing dialog with other applications, the very same way Pocket shows "Pocket" instead of "Add to Pocket".

Any help would be greatly appreciated =) Thanks

Android: label change the value in the activity that is the filter.

Parsing large combined XML document with Python -


I have a large document (400 mb), which has hundreds of XML documents, each of which has its own announcements I'm trying to parse each document using ElementTree in Python. I'm having a big problem dividing each XML document to parse the information here. What example of the document is this:

    

Ideally I would like to read through every XML declaration, parsing data and continue with the next XML document. Any suggestions will help

You will need to read documents separately; Here is a generator function that will present the complete XML document from a given file object:

  def xml_documents (fileobj): document = [] for the line in fileobj: if line.strip () ('& Lt ;? Xml') and document: produce '' .joy (document) document = [] document. Append (line) if the document: yield '' .join (document)   < P> then open with file ('file_with_multiple_xmldocuments'):  
  Use  ElementTree.fromstring ()  to load and parse: xml_documents (Fileobj) To switch to xml: tree = Elimenttry. Froststring (xml)    

c++ - Why does my edited WtWithQt example crash? -


I'm developing an application using Qt for the main argument and Wt for the user interface.

Although I came to a problem I could not solve it I applied it on wtwithqt example.

I have just changed the "Getit" function to call Asynchronous instead of sync instead of sync.

App crash

edit : Actually it actually crashes when it comes to "HelloApplication :: doGreet (Const QString & amp;; Qname) "

 Enter image details here Image:

Maybe there is something with the origin of the action that begins with the QT Event loop?

Here is the code.

  #include "HelloApplication.h" #include "QtObject.h" # Include & lt; QDebug & gt; # Include & lt; QThread & gt; QtObject :: QtObject (HelloApplication * wt, QObject * parent): QObject (parent), wt_ (wt) {} zero QtObject :: passGreet (const QString and name) {// Q_EMIT greet (name); Quettaobic :: Invoicemath (this, "Hello", QT :: Queued connection, QARAG (Best String, Name)); } Zero QtObject :: doGreet (const QString and name) {wt _-> DoGreet (name); }   

The remaining unchanged code is here:

Thanks for any help in advance!

What you see here is a Qtith that updates the Wt widget tree, and that WApplication: : Does not receive UpdateLock. In addition to ensuring that you have unique access to the widget tree, the update lock also sets some local local storage, and the unavailable TLS (WApplication :: instance ()) is caused by crashing your application.

The required locking mechanism may be complex - using WServer :: post () to avoid deadlock may be easy.

actionscript 3 - Nape Moving Platform -


OK, I am relatively new in the process of making a game and have created a type of platform for IM Kinetic, and I I want to move on stage in a certain range. Can anyone please see where the IM is going, thanks. Enter the private functionframeholder (Eve: Event): Zero {if (movingPlatform.position.x = 260) {movingPlatform.velocity.x - = 10; }}

If you increase the position in one of the blocks .x 10 minus you are deducting from velocity.x 10. I think both of you mean position.x .

Second, imagine movingPlatform.position.x 150 and runs your enterFrameHandler once. movingPlatform.position.x will be 160 and the next time the code is not called enterFrameHandler , if no block will be executed after 160, less than or equal to 150 Equals 150 or more or 260

You can use the velocity to reverse the side while moving on one side while moving ahead of the edge of a motion:

  // assuming velocity ( 1.0) Enter the private functionFramehandler (Eve: Event): Zero {if (Plotting platform.OPTTT = 150 || movingPlatform.position.x> = 260) { MovingPlatform.velocity.x = -movingPlatform velocity.x; } MovingPlatform.position.x + = movingPlatform.velocity.x; }   

Obviously this problem can arise if the object already says x = 100, then it will only keep the speed running, so either make sure you make it 150- It can be a better way to handle speed:

Personal function enterFrameHandler (ev: events) ): Zero {if (movingPlatform.position.x <= 150) {movingPlatform.velocity.x = 1; } And if (movingPlatform.position.x> = 260) {movingPlatform.velocity.x = -1; } MovingPlatform.position.x + = movingPlatform.velocity.x; }

android - Can I define multiple ColorStateLists in a single XML file? -


I have too many controls in my app, which should change its text color when changing the color line. Android offers a way to do it - color state list. For each color state list, I will have to create a separate XML file, such as:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Selector xmlns: Android = "http://schemas.android.com/apk/res/android" & gt; & Lt; Item Android: color = "# 398ede" Android: state_pressed = "true" /> & Lt; Item Android: color = "# 808080" /> & Lt; / Selector & gt;   

Is there any way to avoid creating a separate file for each color state list and define them all in one file?

You may have found the answer by now, but those who come back to this link, So how do we do this.

If you have a resource file defining several such colors:

    

You should put this file under the values ​​(and not in the colors) to use the values ​​you use:

  dummy_button_id .setBackgroundColor (getResources () .getColor (R.color.xBlack));    

c++ - Project Euler 16 2^1000 i got 1319? -


I checked the answer and it is not very close to my answer, but it is still an error Coding can be examined to see how I got the value of 1319?

  #include & lt; Iostream & gt; # Include & lt; Vector & gt; using namespace std; Int main () {int k = 0; Int o = 0; Of vector & lt; Int & gt; N (1,0); N [0] = 1; While (K & lt; 1001) {for (int l = 0; l>; n.size (); l ++) n [l] = n [L] * 2; (Int [l]> = 1000000) {int m; if (l == n.size () - 1) (for int L = 0; l & lt; naceg (); l ++) N.resize (n.size (+ 1); m = N [L] / 1000000; N [L] = N [L]% 1000000; N [L + 1] = N [L + 1] + M; }} For K ++;} (int l = 0; l  gt; return; 0;   < P>}   

create it

 while the  in the external code position (K   

When in loop, you start with a k in the vector A loop is represented in the vector representing 2 ^ k . So you actually do not compute 2 ^ 1001 and 2 ^ 1000

java - indexFor in hashmap? -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 3 जवाब

    बस मेरे सिर को पाने की कोशिश कर रहा है कोड को देखकर जावा हैशम के कामकाज के आसपास। जब कोई तत्व जोड़ा जाता है, तो निम्न होता है:

    1. कुंजी के लिए हैशोड मिला
    2. परिणाम पर एक हैश फ़ंक्शन लागू किया जाता है
    3. विधि IndexFor 2 के परिणाम पर लागू किया जाता है। यह उपयुक्त बाल्टी में पहली प्रविष्टि देता है। बाल्टी में लिंक्ड सूची को फिर से दोहराया जाता है - अंत पाया जाता है और तत्व जोड़ा जाता है।

      एफ है:

        int indexOf (int H, int लंबाई) {वापसी एच एंड amp; (लंबाई -1); }   

      मैं अनुक्रमणिका में चलने वाली चाल को समझ नहीं पा रहा हूं। क्या कोई इसे समझा सकता है?

      धन्यवाद।

      यह काम करता है क्योंकि जावा हैशमैप हमेशा एक क्षमता है, अर्थात 2 की शक्ति के रूप में बाल्टी संख्या। चलो 256 की क्षमता के साथ काम करते हैं, जो कि 0x100 है, लेकिन यह 2 की किसी भी शक्ति के साथ काम कर सकता है। 2 की शक्ति से 1 घटाकर 0 से लेकर लंबाई - 1 कोड> 256 - 1 = 255 0x100 - 0x1 = 0xFF

      उदाहरण 257 (0x101) का एक हैश बीटावर्ड और 0xFF के साथ एक बाल्टी संख्या 1 की उपज के लिए मिलता है।

database - Annoying bug at mysql table creation -


Hello, I have the following statement that I want to use to create a mysql table. The user name ('user id' INT (25) tap on endorsement primary key, 'user name' VARCHAR (65), 'password' VARCHAR (32), email address' VARCHAR (255) not faucet); Table 'Profile' ('UserIndEnt') (25) False attangrement primary key, 'Username' VARARAR (65) No, 'position 1' VARCHAR (65) No, zero, `condition 2` VARARAR (65) tap, (3 Vocaar (65) Noel, 'Champion 1`, VAARAR (65) Noel,' Champion 2 ', VAARAR (65) League' VARCHAR (65) No, 'Ligenma' VARARAR (65) No. 'Allocaling' VARCHAR ( 65) No, zero 'VARCHAR (140) No, tap);

But it fails to do this and gives me an error message:

  Error 1064 (42000) on line 8: One in your SQL syntax Error is;    

Get rid of the last comma

  'Bio' VARCHAR (140) do not tap    

opengl - Run Open GL programs on the Raspberry Pi? -


Can the Raspberry P OpenGL program run? Like the GL 1.x programs, OpenGL is not ES 2.x which I know it can run.

The reason I am asking, I have trouble getting SFML 2.

You can run desktop to get OpenGL support.

Though it will slow down In fact, actually slow down

Error messages not displaying for form validation Javascript -


Actually not sure what I did wrong. But two of my errors are not displayed, NPIS and NAM, however, display my name and nSmokes, I am thinking that if I am doing this with it, then I am using it.

I thank you in advance.

function doValidate () {// warning ("work"); Document.myForm.nPrice.value = parseFloat (document.myForm.nPrice.value); Document.myForm.nAmount.value = parseInt (document.myForm.nAmount.value); Document.myForm.nSmokes.value = parseInt (document.myForm.nSmokes.value); //alert(document.myForm.nPrice.value); //alert(document.myForm.nAmount.value); //alert(document.myForm.nSmokes.value); ErrorCount = 0; ErrorMsg = "" if (document.myForm.name.value == "") {errorMsg = errorMsg + "You need to enter a value!"; Document.getElementById ('Errors'). InnerHTML = errorMsg; ERRORCOUNT ++; } If (document.myForm.nPrice.value & lt; 0 & amp; amp; amp; amp; amp; amp; amp; amp; amp; document documentation.myForm.nPrice.value & gt; 20.00) {errorMsg = errorMsg + "You enter a value between 0 and 20 is required!"; Document.getElementById ('Errors'). InnerHTML = errorMsg; ERRORCOUNT ++; } If (document.myForm.nAmount.value & lt; 0 & amp; amp; amp; amp; amp; amp; documents.MyForm.nAmount.value & gt; 40) {errorMsg = errorMsg + "You between 0 and 40 Need to enter a value! "; Document.getElementById ('Errors'). InnerHTML = errorMsg; ERRORCOUNT ++; } If (document.myForm.nSmokes.value & lt; 0) {errorMsg = errorMsg + "

either you are doing a great job or you have smoked what you have smoked today! "; Document.getElementById ('Errors'). InnerHTML = errorMsg; ERRORCOUNT ++; } If (error group> 0) {return false; } And {return true; }}

  & lt; Form name = "myForm" method = "post" id = "myForm" onsubmit = "return doValidate ();" & gt; & Lt; Width of table = "600" range = "1" cellpaction = "4" cellpadding = "4" & gt; & Lt; TR & gt; & Lt; Td colspan = "2" align = "center" & gt; & Lt; Img src = "quitSmoking.jpg" width = "278" /> gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td colspan = "2" align = "center" & gt; Quit smoking calculator by your name & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> Your name & lt; / Td> & Lt; Td> & Lt; Input type = "text" name = "name" id = "name" /> and & nbsp; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> The date you left & lt; / Td> & Lt; Td> & Lt; Input name = "start date" type = "text" & gt; & Lt; Input type = "button" value = "select" onclick = "displayDatePicker ('startdate');" & Gt; & Amp; Nbsp; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> Price of a pack & lt; / Td> & Lt; Td> & Lt; Input type = "text" name = "nPrice" id = "nPrice" value = "8.00" /> & amp; Nbsp; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> How many packs & lt; / Td> & Lt; Td> & Lt; Input type = "text" name = "nmount" id = "nmount" value = "20" /> & Amp; Nbsp; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> The number of cigarette you smoke a day & lt; / Td> & Lt; Td> & Lt; Input type = "text" name = "nSmokes" id = "nsmokes" value = "25" /> & Amp; Nbsp; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td colspan = "2" align = "center" & gt; Input type = "submit" name = "submit btn" id = "submit btn" value = "calculate saving" gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td colspan = "2" align = "center" & gt; & Lt; Div id = "errors" & gt; & Lt; / Div & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td id = "rowResult" colspan = "2" align = "center" & gt; & Lt; Input type = "hidden" name = "nResult" id = "nResult" value = "" /> & Amp; Nbsp; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Form & gt;    

  document.myForm.nPrice.value & lt; 0 and amp; Amp; Document.myForm.nPrice.value & gt; 20.00   

How can the value be less than 0 and greater than 20? You or you are searching there.

  document.myForm.nPrice.value & lt; 0 || Document.myForm.nPrice.value & gt; 20.00   

or between 0 to 20

  document.myForm.nPrice.value & gt; 0 and amp; Amp; Document.myForm.nPrice.value & lt; 20.00   

The same kind of mistake that you made for another if expression is also.

osx - CSS3 transform property on TideSDK Mac -


I am creating an application that I would like to run on both mac and windows. I'm using CSS3 for styling and UI of this application. I'm using the selector: Hover for some pictures of my app (Transcam: Scale (1.5.1.5)} and it works perfectly fine on Windows, but when I try to create the same hover effect on the Tide SDK Mac I do not get the proper CSS3 effect Does anyone know the reason for this? Why does something that works perfectly fine on windows does not work on Mac version of TAD SDK? Is it because they use different web-kits or is it something else?

You are right! WebKit implementation on Windows Linux and OSX is completely different.

1) Windows: We use the Webcam gate's Winchro port. 2) Linux: We use the GTK version of WebKit. 3) OSX: We use WebKit's Safari version (original).

Along with this, webkit within TidesDK is ~ 2 + years old. It will be such a reason that you are behaving slightly differently in different platforms.

css - Fixed div next to a centered div -


I have a webpage that contains scrollable content. This content is wrapped within # content, which is centered on the page . Now I have to show a navigation bar that looks in the 50 pix box for the content. This time there should be a fixed position (should not be scrolled).

This is what I have tried to do so far:

  #nav {position: fixed; Top: 50%; Margin top: -200px; Left: 15%; Background: #FFF; Width: 100px; Height: 400px; Range radius: 50px; } # Content {status: relative; Width: 800 pixels; Margin: 0 px auto; Padding-top: 100px; }   

Which I clearly do not want, because now the NAV is 15% from the left of the screen.

Here is a picture I want to explain, received. picture example

A little tricky solution is Status: Fixed elements are always relative to the browser window (more less). This means that it will always ignore its original dimensions and position, even with status: relative set. Solution left is not set at all

Here's what you need to do: HTML

  & lt; Div class = "content" & gt; & Lt; Div class = "fake" & gt; & Lt; Div class = "nav" & gt; & Lt; / Div & gt; & Lt; / Div & gt; Content & lt; / Div & gt;   

CSS

  .fake {position: absolute; Left: -50px; Top: 0; } .nav {status: fixed; Top: 50px; Width: 40px; Height: 100 pixels; Background: # C11; } .content {status: relative; Width: 800 pixels; Height: 1000px; Margin: 0 px auto; Background: #ccc; }   

Of course some values ​​are just to show.

couchDB: checkpoint_commit_failure -


I have a couchDB server running on the AZON ec2 instance. This is 1.2.0 from RPM.

I have several Android devices that run Couchbase-Mobile 2.0.

These devices start a constant push and draw replication from the server. All these devices should eventually be compatible.

However, when one of the mobile devices pushes a document, when another mobile device tries to drag this document, I get the following error on the device log: < Pre> e / couchdb (9896): [error] [& lt; 0.199.0 & gt;] Replica `bf69ede4416770a1fef28ffb4c4e6950 + constant (` treatment '- & gt; `http: // portecTest: *** ** 50.150.250.165: 5984 / treatment /`) failed: {checkpoint_commit_failure, & lt; "Error updating target checkpoint document: conflict" & gt; & Gt;}

The way this app is designed, this document will not be edited by other devices or servers, so this modification is not amended.

After this, no other document will repeat, push or pull, until I restart the app (continuous replication is started when the app starts). After restarting, it works.

What does this mean? Any thoughts that can cause it?

I have seen it because of replication replication id. / P>

When you set up a replica in the _replicator database, a _replication_id field is added to the document (such as bf69ede4416770a1fef28ffb4c4e6950 + continuous, for your current replication). On the two ends of the replication process, using a document on http: // server: 5984 / dbname / _local / replication-id is used by the replication process to track the process of replication Recording of things like sequence number, and last seen.

This is also used to spots, if you have two replicas set to do the same job, because the ID is generated completely by the parameters, so two replicas are the same goal and The source will be the same ID, and there will be no other option.

I am not sure how the replication_ID has originated (maybe there is some kind of seed anywhere?) But I certainly had problems earlier than this, in which it was equally Was generated (including a replication docs like {source: localDb, target: remoteServer: 5984 / remoteDb} ), so all those attempts made use of the same db / _local / id document To do this, and then to throw a lot of conflicts Because they were a changed document on all remote servers simultaneously.

You can check whether these are the problem by comparing the _replication_id field on both mobile devices and seeing if they are .

I decided to include the address of the local machine in the source so that each ID is different, and the conflict has gone away. This can not be practical with mobile devices for you, as long as you can get continuous local addresses working on each mobile (some generated hostname?) I could not find any way to set up replication_id manually.

If this is the problem, the solution is basically to make each replication document unique in some way from others. Can you name the database on different mobile devices on any mobile device?

java - Too many pool exhaustion errors with jdbc-pool -


I have an app that has jdbc-pool for handling mySQL connection in the previous month. Is starting to use. Before I was using Apache's commons-dcp I switched to jdbc-pool after reading some analysis, which showed it fast, better maintained, etc. However, I started by looking at that too many more users are viewing pool exhaust errors. / P>

I do not know that it is related to switching from commons to JDBC-pool, but it seems that the time is starting and I am thinking of building my product which Returns and gives it to people what it has to do to see DB errors.

I have written a document which helps in problem solving by adjusting the pool connection, maximizing wait, etc. However, a lot of people report pool exhaustion errors, even when their applications are essentially useless. Show a complete process list 1 connection in "sleep" 1 connection appears in the active.

I play a lot in both the application and the Dev environment and there is never a problem. I am better able to manage my mysql environment, but there is no such problem in rival products with weak pooling systems.

I've spent a lot of time reading jdbc and pooling docs, but am I doing something that will cause poor performance ?

These are examples of our DB connection codes, which are with the default that we use.

  // Once the application is started, the database is connected with the DataSource initDbPool () {String dns = "jdbc: mysql: //" + config.getString ( "Prism.mysql.hostname") + ":" + config.getString ("prism.mysql.port") + "/" + config.getString ("prism.mysql.database"); Pool = new datasource (); Pool.setDriverClassName ("com.mysql.jdbc.Driver"); Pool.setUrl (DNS); Pool.setUsername (/ * Username * /); Pool.setPassword (/ * Password * /); Pool.setInitialSize (10); Pool.setMaxActive (20); Pool.setMaxIdle (10); Pool.setMaxWait (30000); Pool.setRemoveAbandoned (right); Pool.setRemoveAbandonedTimeout (60); Return pool; } // is called from different classes to run the query for public static connection DBC () {connection con = null; Try {Con = pool.getConnection (); } Hold (SQLException e) {System.out.print ("database connection fail." + E.getMessage ()); E.printStackTrace (); } With return; }   

I never fancy more than questions. We are continuously running batch included questions but we have optimized that with a queue system and batch joining it is very fast and uses as much overhead as possible.

As I have seen that you have closed () but In the end, is not the end block, it means that if an exception occurs, the connection will be lost. I suspect that the commons-dhcp leak connection is not handled as jdbc-pool .

is removeAbandoned > configuration option, which is off by default, because this is the right thing ?? ¢ But as I think, it does not guarantee any guarantees, because it closes them from time to time if you have exceptions in a short time, then it can end the pool, so always a in the end Closing all connections in the block is a better way.

c# - crop image without copying -


I am writing an application for which I need to split a large image into smaller tiles, where each tile Essentially there is a crop version of the original image

Currently my partitioned operation looks something like this

  Tile Image = new bitmap image (); Tile.Image.BeginInit (); Tile Image.urisource = the main way Urios; Tile Image. Sources = new int 32wright (x * tile wide + x, y * tile height, tile wide, tile height); Tile.Image.EndInit (); Intuitively, I thought it would originally create a "reference" for the original image, and would only appear as a sub rectangle of the image. However, the slow speed at which I have different operations, I have been inspired to believe that it is actually copying the original image source reset, which is very slow for large images (a civilization 3-4 seconds of size while splitting is a size image).  

I looked a bit, but without duplicating any data, there was no way to attract a bitmap as a sub-rake of a large image. Any suggestions?

Use the system. Windows.Media.imaging.CroppedBitmap class:

  // Create a Croppy Bitmap from the original image Int32Rect rect = New Int32Rect (x * tileWidth + x, y * tileHyight, tileWidth, tileHeight); Cropped bitmap paused bitmap = new cropped bitmap (original image, text); // Create an image element image tile image = new image (); Tile image With = tile wide; Tile image Hect = tile heights; Tile image. Source = crop bitmap;    

java - shell_exec() in PHP on Mac OSX using MAMP gives Error occurred during initialization of VM Unable to load native library: libjava.jnilib -


I have seen an answer to finish everything and that's something I know where my missing is going to be your $ DYLD_LIBRARY_PATH seems to be required to set a library but I can not tell how it might be.

My machine is Mac OS X and I have running PHP5 under MMP. I have a shell command for an executable that I have run fine in the terminal but with my PHP app it does not work at all: I get the following error:

$ error in VM Unable to load the native library during the inception: libjava.jnilib

I think I need to find only that to add dir in the library and the above listed variables, but I find it Can not seem to. Thanks for the help in advance!

After the text "itemprop =" text ">

is not mentioned as DYLD_LIBRARY_PATH should be set. Not sure why, it does not seem to be needed on Unix systems, but MacOSX

for MAMP / application / MAMP / Library / lib sets it here to disable. Edit / Application / MAMP / Library / Bin / envvars and the following lines

DYLD_LIBRARY_PATH = "/ Application / MAMP / Library / lib: $ DYLD_LIBRARY_PATH" External Comment Exports DYLD_LIBRARY_PATH So that it looks like this :

DYLD_LIBRARY_PATH = "/ Application / MAMP / Library / Lib: $ $ DYLD_LIBRARY_PATH"

Export DYLD_LIBRARY_PATH

This issue should be fixed and Java 1.6 OK

Check here for more information:

jQuery select everything between divs except some tables divs -


I would like to get html between two divs for my page jqplot < For the code / code> and for a large div this jqplot It seems that I should use the jQuery : not () selector to exclude these two elements, however, my code failed. So can someone give me some suggestions? Here's one, and the basic idea of ​​my code below is only the only thing that is required before the table thanks!

HTML

  & lt; Div class = "articles" & gt; & Lt; H2 class = "model_header" & gt; Exponential model output & lt; / H2 & gt; & Lt; Table align = "center" & gt; & Lt ;! - End 04uberoutput_start - & gt; & Lt; / Table & gt; & Lt; Width of table = "550" limit = "1" & gt; & Lt; / Table & gt; #### I'm ##### & lt; P & gt; & Amp; Nbsp; & Lt; / P & gt; Nothing should be done under Lt; Table width = "400" range = "0" style = "display: none" & gt; & Lt; / Table & gt; & Lt; Div id = "chart1" style = "margin-top: 20px; margin-left: 20px; width: 650px; height: 400px; position: relative;" Class = "jqPlot target" & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

JS:

  var jq_html = $ ("div.articles: not (table & amp; div)"). Html ();  
Children (': liters (3)');

Target all children with a zero based index of just less than 3:

  • [0] H2
  • [2] The second table

    Edit:

    It was a while, Notices notice!

      var jq_html = $ ('& lt; div / & gt;'). Addend ($ ("tdiv.articles"). Children (': lt (3)'.) .clone ()) HTML ();    

How to have a button only for large devices on Android? -


I know that you can separate the layout folders like layouts - large Or layout - xlarge . However, I do not have to update two different files, every time I make changes to my app interface.

Is there a button on which only visibility = "gone" on the small screen and general visibility on the big screen?

I separated the button into 2 xml files - in a layout-large Include a visibility = "gone" in visibility = "visible" and layout , and then a button in my layout / home.xml file . It worked.

android - Make notification disappear after 5 minutes -


Is it possible to automatically turn information off after a certain time?

Yes, you can create only one service that runs in the background, which is after five minutes. The time will expire and your notification will be removed. Even if you really should do this "there is a debate" should be a notification to inform the user ... and the user should be able to dismiss it yourself.

A service is an application component that performs long-running tasks in the background and does not provide user interfaces.

java - How to clear the standard input (term) -


How to clear the standard input (word) in Java?

A little bit of history: I am writing "Reflex" program, the algorithm is very simple:

  Wait for a random quantity print "Press Enter" The line is   

, if the user accidentally enters the login key, it will be read so that the test is wrong. My goal is to fix the bug. To do this, I want an algorithm like this:

  Wait for a random amount of time to print stdin "Press Enter" read line   

but I find no way to do this: it looks interesting: available gets the number of characters remaining and leave leaving them Will give Working on paper only If you insist on an application by pressing the Enter key several times, then available method returns

An estimate of the number of bytes which Can be read (or

is left from this input stream without blocking, therefore, the return value is incorrect, at least one carriage return remains in buffer And the bug is still here.

The trick may be but this platform is up to which I Besides, calling Java a system routine is a bad idea. Also, to start over, I want to clear the standard input of my program but I do not close it. I do not want to block my program, but to give the user an input, this is a very basic problem for me, if I am ashamed, the answer is obvious! < P>

T "clear stdin" is the answer I think is OS specific, and it may not even be worth trying.

However, to solve your problem, you can use java.util.Timers which prompts the user at some random time. It will move to a different thread. When your user has entered in the end, check whether it indicates or not.

An example of the code given below will print "Enter" after 5 seconds. The main thread instantly waits for the user input, if the entry is pressed long ago it will be called because the boolean switch is not yet

  Static Boolean userpropected = false; Public Static Zero Main (string [] Args throws IOException {// Setup is a 5 seconds timer which prompts the user and switches to correct user-configured flag // It will run in a different thread timer timer = new Timer (wrong); Timer Schedule (New Timer Task) {@ Override Public Wired Run ({{System.out.println ("Press Enter"); Synchronize (timer test class) {userPrompted = true;}}}, 5000); // Blocks user input system.out.printline ("Waiting for ready .. .. as soon as you get the signal, press as soon as" ..); String input = new BufferedReader (New InputStreamReader (System.in)). ReadLine (); // Check that the user has been synchronized (Timer test class) {if (! Userprompted) System.out.println ("You entered before signaling"); Else System.out.println ("You pressed after the signal"); }}    

Applescript to change illustrator colors -


I am trying to change one color in a painter document with one color and the other I have found but it It keeps saying that "color is not found" I'm not sure what I'm doing?

  Tell the application "Adobe Illustrator" if the color is present then "C = 0 m = 0 y = 0 k = 90" then "C = 0 m = 0 Y = 0 K = 100 "Set the color to the end if tell the end    

  Set up "Adobe Illustrator" Set all the documents on each path item in the current document whose fill color is {Cyan: 0.0, Magenta: 0.0, Yellow: 0.0, Black: 90.0} with all the items in my IITs. Repeat myItem the {cyan: 0.0, magenta: 0.0, yellow: 0.0, black: 100.0} end repeat end set Fill Color    

find Kth element in a Binary Search tree -


I'm learning about binary search trees. I want to return the kosher element of the brochure tree crossroads. How can I update the variable 'count' or if I find a Kashmir element and print it then what is the way to get out of the loop?

  Public zero kthElement (int n, int count, binernode & gt; antepe & gt; root) {if (root.left! = Null) this.kthElement (n, count, root. Left); Count ++; If (count == n) {System.out.println (root.element); } And if (count! = N) {return;} if (root. Right! = Null) this.kthElement (n, count, root.right); }    

I can think of two solutions.

  1. For each node, tell an area that it is easy to move forward from here, how many elements are in the right subdivision and left sub-line.
  2. If you have permission to use additional memory, copy the elements dynamically allocated sorted array (using in-word traversal) and K'eth element back.

apache - Can't find controller directory -


I am trying to create a zoomed app on my Apache web server and instead of public folder for my index.php The httpdocs folder is used. When I try to use the controller / action, it always sees the httpdocs directory for the auth file. But when my controller is located in the application / controller, it will throw an error (I have already set up the controller directory in application.ini.)

However when I get the public name from httpdocs Changed and definitely updated my vhost.conf file, so it works. Therefore there should be some setting that should be set.

Now, I tried the same project and code in my lighttpd server and it is also working there

Is there a setting / config that should be set up in Apache server ?

Any feedback will be highly appreciated!

Thank you in advance

My answer was found

 < Code> Rewrite code on rewriting% {REQUEST_FILENAME} -s [OR] Rewind condom% {REQUEST_FILENAME} -l [OR] reviscant% {REQUEST_FILENAME} -d Records rules ^. * $ - [NC, L] Rewrite rules ^. * $ Index.php [NC, L]   

I should just rewrite the .htaccess file under the httpdocs directory.

css - how to align a div between a position absolute and relative -


I have 3 divs at the top of the first diva position, and the second one is below the div and its position is complete. There is also a third div which I want to be in between I want that the third div is in the middle, so that there is no difference in the height of my browser, I want it to be 20px padding depending on first and second To be paired with

  mid-box {padding: 20px; } .top-box {width: 265px; Status: Relative; Margin: 0 px auto; }. Bottom-box {width: 25%; Padding: 12px 0 12px; Status: Completed; Bottom: 0 pixels; Minimum width: 300px; }    

The difference on this one question is often asked on SO, the fact is That you want 20px margin is irrelevant. It is a composite structure that can be difficult.

I think it meets your needs You may have to make an agreement that is setting a fixed height on your header and footer.

  .top-box {height: 60px; Status: Relative; } .middle-box {status: absolute; Top: 70px; Bottom: 80px; Left: 20px; Correct: 20px; Margin: 20 px 0; } .bottom-box {height: 56px; Padding: 12px 0 12px; Status: Completed; Bottom: 0 pixels; }    

ruby on rails - How to stub after_create callback collectively in a model? -


I am using Rail 3.2.11, Mac OS X Mountain Lion, Rspec

this My problem is:

I have a model that has been created, it sends information to an API that works fine, but when I am testing it in RSPC, the test data is also API Is sent to the database. Here's the code:

Model

 After : create: send_to_api def send_to_api api = APIModule.initialize_api (parameter) api.send_data (self .attribute1, to connect to the API, to send data at the end of the API   

I tried this in my test:

  Model.any_instance .stub (: Send_to_api) .and_return (true)   

But this did not work. Every time I have created the model I said in my test, which sends them to the database. Will be appreciated. Thank you very much in the rim!

Not sure that you have yet detected it, but if you Mocha can be installed

  Model.any_instance.stubs (: send_to_api). Return (true)   

Just tested it and it works

ruby on rails - remove all html tag before validation -


Before verification, there is a clear way to remove all the HTML tags of all the attributes I found_as_sanitized which should be correct, but the rail 2: -s

thanks

cleanliness gem:

Do you need

Call Sanitize.clean (htmlstring) You can also whitelist with approved tags.

Refactoring to higher order function in Scala -


I am new to Scala and am wondering if I can refactor this code by using Scala support, High command functions etc. for Fiction Little by any means.

"post-text" itemprop = "text" / P>

Because there is no connection between competition and team, I do not think how it is possible. I think I can add a special quality to the competition and the team, which will include the property of the name and then it will be possible.

Any other options? Besedo's expansion in class competition competition [competition] {def retrieve AllCompetitionNames (): java.util.List [string] = {val competitions: java.util.List [_ & lt;: Competition] = getDao (). QueryForAll () Val ContestantName: java.util.List [String] = New Arrestist (); Competitiveness (Competition & Lieutenant Competitions) Competition (Competition Name) Contestant Name}} class extends the TeamDo Bassadeo [Team] {DR Recovery all team names}: java.util.List [string] = {val teams: java.util.list [_ & Lt; : Team] = meet (). QueryForAll () val TeamName: java.util.List [string] = new arrelist (); Team Team (Team.name) teamNames}}

< P> You can apply a property and use map like Enrique:
  import scala.collection.JavaConversions ._featured NameRetrieval [T & Lt;: {def name: string}] {self: Besedo [t] = & gt; DF Recovery All names = getDao.queryForAll.map (_. Names)}   

You can then use it like this:

  object team Besedo [Team]  [T : {def name: String}}  means that    

Namespace properties can be used for any type, which has an element called name type string . To find out more about that notation search for 'Scala Structural Type'

With Self: Besdao [T] I say that this feature can be used only with a combination of BASADOO whose T is the same type for because this allows me to use the getDao method independently because I know it is available. Similar patterns are used, so that you can see it for more information.

c++ - No file created using fstream -


इस सवाल का पहले से ही एक उत्तर है: < 6 जवाब

नीचे मेरा कार्यक्रम है:

/ P>

  #include & lt; fstream & gt; # शामिल करें & lt; iostream & gt; नेमस्पेस एसटीडी का उपयोग करना; Int main (int argc, char * argv []) {fstream hd; Hd.open ("fstream.dat", fstream :: in | fstream :: out); hd.put ( 'एक'); hd.close (); वापसी 0; }   

हालांकि, इस प्रोग्राम को निष्पादित करने के बाद कोई फ़ाइल नहीं बनाई गई है। इसके साथ समस्या क्या है?

आपको एक fstream :: app या fstream :: trunc फ्लैग बिट निर्दिष्ट करने के लिए कि क्या फ़ाइल पहले से मौजूद है (अनुलग्नक या क्लॉबर, क्रमशः)।

यह थोड़ा स्वभाव है कि यह भी प्रभावित करता है या नहीं फ़ाइल बनाई नहीं है, लेकिन सी + POSIX fopen फ़ंक्शन से यह सीरिज है।

google app engine - Making db.put() failsafe -


I do a DB.PUT operation to try to maximize as much flexibility as possible in my Google App Engine service Would like to Probability of success in case of infrastructure issues or overload What I have come up with at the time, to try to catch every possible exception and to create a task that retries the commitment if the first attempt fails:

  try: db Put (new_user_record): Excluding Deadline Expected Error: Excluding deferred.defer (db.put, new_user_record): deferred.defer (db.put, new_user_record)   

Is this code all possible Runs the error path? Or else in other ways can DB.Put () fail, which is not caught by this code?


Edit on March 28, 2013 - Explain when failure is expected

It seems that the answer is still to believe that if db.put ( ) Fails because it is because the datastore is below it is not necessary to run a very high workload in your experience. Sometimes you participate in workload-specific API barriers, sometimes requesting an API slow request The deadline ends in another. Although there is a low frequency in such incidents, if the traffic is more then their number may be higher. These are the conditions that I am trying to cover.

I would not say that this is the best way - whatever happened, the original exception again Are likely to be What I will do for the extra flexibility I can load the record for the first time in Memchet and in the event of an exception (any exception) it attempts a certain number (for example 3) a small sleep between each With effort Depending on your application, it may either have a synchronous operation or use deferred functions which it can use data in the asynchronous memcache.
In the end I actually do a query on the record in the data store, even if there is not one line to really confirm it has been written.

winapi - How to capture “Enter key” in combobox using WIN32 API (C/C++)? -


I for example to enter How do you capture the event you want to catch when the user presses Kanbod: my combo box I type "Nguyen Fong Sack" in After the Enter key is pressed, it appears a message: "Nguyen Phong Sac" help,

< p> I still want to know that you're writing the program how, but I'll give it to you asked you as an example:
  // test with Windows 7 x64 It was, VS2012 // when Making: hWndComboBox = CreateWindow (WC_COMBOBOX, text ( ""), CBS_DROPDOWN | CBS_HASSTRINGS | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE, exposed, UPS, Anvidth, Knight, Acdblu Eepiar, narwhal, Acaiansitiaisisimpennet, null); HWndEditBox = CreateWindow (WC_EDIT, TEXT (""), CBS DROPDOWN | CBS_HASSTRINGS | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE, xpos, ypos-30, nwidth, 30, hwndparent, NULL, HINST_THISCOMPONENT, NULL); // The editing in the combobox has been done before the control HWW HW Edited = Gatevondo (HWWCMbbox, GW_HCLD); // used to create SetWindowLong subclass, lpfnEditWndProc core proc lpfnEditWndProc = (wndproc) SetWindowLong (hwndEdit, GWL_WNDPROC, (DWORD) SubClassProc); // Subclass Proc LRESULT Callback SubClassProc (HWND hwnd, uint message, wParam wParam, lParam lParam) {Switch (MSG) {In case WM_KEYDOWN: switch (wParam) {case VK_RETURN: // Get text & go, set text LPTSTR buffer = New TCHAR [255]; GetWindowText (hwnd, buffer, 255); Setwindotext (HWF & Tbox, buffer); break; } break; } Return Colvandoprok (Elpifanadit Veedproc, Acdbludi, MMS, Dblupiamm, Elpiamm); }    

jqplot y-axis label isn't vertical -


I have spent two days better part of trying to make the y-axis label vertically without success. Therefore, for the first time I have set a jeffield (hopefully I have corrected) which shows the same problem as my code, which works in ways other than the Y-axis labeling problem. FalatImb = [[-10, 400000], [-10, 797,000], [-2.9, 878,000], [2.9, 878,000], [10, 797,000], [10, 400000]]; $ .jqplot.config.enablePlugins = true; DpLatImbOpt = {seriesDefaults: {Shadow: false}, axis: {xaxis: {min: -15, max: 15, numerics: 7, label: '& amp; Larr; Left and midot; 1000000 lbs and midod; Correct and RRR; '}, Yaxis: {minimum: 400000, maximum: 950000, numberTicks: 12, label:' lbs gross weight ', labelRenderer: $ .jqplot.CanvasAxisLabelRenderer}}, grid: {background:' black ', gridLineColor:' # 666666 ', Shadow: false}, highlighter: {fadeTooltip: false, show: true; showToolTip: true, useAxesFormatters: true, formatString:'. .1.1,% 0f '}, series: [[Color:' red '}]}; $ JakePlot ('DPLTIMB', [FLTIMB], DPLTImbopt);

I thought that supplying a label renderer for the y-axis will cause the vertical alignment of that label to default, but it is not so and why I can not see it.

This is on jsfiddle

The obscure Y-axis reads the label 'LBS gross weight'.

Other than the immediate problem, suggestions related to others are welcome as I am a relative newboy.

Viewing your current scripts:

  & lt; Script src = 'http: //terryliittschwager.com/WB/jslib/jquery.jqplot.min.js'> & Lt; / Script & gt; & Lt; Script src = 'http: //terryliittschwager.com/WB/jslib/jqplot.canvasTextRenderer.min.js> & Lt; / Script & gt; & Lt; Script src = 'http: //terryliittschwager.com/WB/jslib/jqplot.canvasAxisLabelRenderer.min.js> & Lt; / Script & gt; & Lt; Script src = 'http: //terryliittschwager.com/WB/jslib/jqplot.highlighter.min.js'> & Lt; / Script & gt; & Lt; Div id = "dpLatImb" style = "margin-top: 20px; margin-left: 20px; width: 400px; height: 400px;" & Gt; & Lt; / Div & gt;   

The two are unavailable ' characters:

   jqplot.canvasTextRenderer.min.js  and  jqplot.canvasAxisLabelRenderer.min.js after the  ' 

bus I , then that fleet will be shown the label of the Y-axis.

javascript - Print iFrame with jQuery -


I have followed unlimited instances of printing an iframe with jQuery, but whatever I try, it Does not work

I have a page that has a "print" button so that users can print an iframe. So I gave examples and past experiences with jQuery and came on:

  $ ('# printbutton') Click (function () {window.frames ["frameright"].); Window. Frame ["framerate"]. Print ();});   

Accordingly, my iframe

  & lt; Iframe seamless = "seamless" id = "frameright" name = "frameright" src = "url .. .." & gt; & Lt; / Iframe & gt;   

But when I click on the "Print" button, nothing happens

Is anyone enough to push me in the right direction?

There is no need to use jQuery for this.

Simply use:

  function printframe () {window.frames ["frameright"]. Focus (); Window.frames ["frameright"] print () .; }    

c++ - boost member function pointers -


I am very new to boost libraries.

I was trying to achieve something for a graphical program

I wanted to complete it without having some fixed global class object.

To explain in code:

/ P>

  class callback holder {public: zero dostf (zero) {// etc}}}; Zero bind () {glutIdleFunc ((new callback holder ()) - & gt; dustff); }   

I know that boost: this is possible through the use of the Tie and Promotion :: Function.

An issue that I saw, though was boosting: Work back to the normal function pointer.

How will you complete it?

You do not convert from a normal function pointer to boost :: function You can not change from a member function pointer to a normal function pointer. There are measures for accepting callback, where you can provide user data.

Unfortunately the misleading interface does not allow you to provide user data. This means that you are stuck with the worst solution, using a global variable and a common task.

  class callback holder {public: dostf (zero) without {// etc}}}; Callback holder * g_callbackHolder = NULL; Zero call_callback_holder (zero) {if (g_callbackHolder) g_callbackHolder-> Dustf (); } Zero bind () {g_callbackHolder = new callback holder (); GlutIdleFunc (and call_callback_holder); }    

How to disable the functionality of home button in Android mobiles and can we set some other action for home button? -


How to disable the home button functionality in Android mobile and we can set some other functions for the Home button? Can someone give me an example on this? You can override onKeyEvent of your activity

  Public Boolean on Kidadown (Int kikod, Key Event event) {if (keycode == KeyEvent.KEYCODE_HOME) {// Call the desired code // If you want the home key to be disabled, return the following line // failure; } Return super.Condondon (keycode, event); }    

could not retrieve mail on android using javamail -


I have retrieved the mail via javamail for a code, but it does not successfully fetch the mail, but there is no error With the same code, can anyone help me recover the mail with the Netbeen IDE?

My work: readMail.java


Provides mail authentication read public class {

  private string tool; Public message [] getReadMail () throws MessagingException {string; SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; String Username = "someuser@gmail.com"; String password = "some password"; Properties pop3Props = new property (); Pop3Props.setProperty ("mail.pop3.socketFactory.class", SSL_FACTORY); Pop3Props.setProperty ("mail.pop3.socketFactory.fallback", "wrong"); Pop3Props.setProperty ("mail.pop3.port", "995"); Pop3Props.setProperty ("mail.pop3.socketFactory.port", "995"); URL name url = New URL ("pop3", "pop gmail dot com", 995, "", username, password); Session session = session .get instances (pop3 profiles, blank); Store store = new POP3SSLStore (session, url); Store.connect (); Folder inbox = store.getFolder ("INBOX"); Inbox.open (Folder.READ_ONLY); Message [] message = inbox.getMessages (); Return message; } Public Zero SetSubject (String Subject) {this.subjek = subjek; } Public string becomes available () {Return subjek; }   

}


My activity: main activity. Java


  @ override protected zero creation ( Bundle Saved InstantStat) {TextView subjek = (TextView) findViewById (R.id.subjek); Super.onCreate (savedInstanceState); SetContentView (R.layout.activity_main); Try {readMail readmail = new readMail (); Message [] message = new message [] {}; Message = readmail.getReadMail (); {Subjek.setText (Message [1] .getSubject ()) for (Int i = 0; I & lt; 10; i ++); }} Catch (Messaging Expression E) {Toast. Make Text (this, "Server of Goggle Conceasee", Toast. LNNHHLANG). Show (); }} @ Override Public Boolean On Crate Option Menu (Menu Menu) {// Increase Menu; It adds the item to the Action Bar if it exists GetMenuInflater (). Fluo (R. menu menu, menu); Back true; }   

}

To get started, see.

Besides, you can.

And you want to see them.

How to I read any file in binary using C#? -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 4 जवाब

    मैं कोशिश कर रहा हूँ आवेदन बनाने के लिए किसी भी फाइल का द्विआधारी कोड पढ़ना होगा और एक प्रतिलिपि बनाकर एक ही द्विआधारी कोड के साथ एक फाइल बनाना होगा।

    एक प्रोग्राम लिखते समय कोई फ़ाइल पढ़ता है और कहीं और लिखता है, तो मैं इसमें चल रहा था एन्कोडिंग मुद्दों, इसलिए मैं यह मानता हूं कि सीधे बाइनरी के रूप में पढ़ना इस पर काबू पायेगा।

    आवेदन में पढ़ना फाइल महत्वपूर्ण है, जैसा कि मैंने इसे काम करने के लिए प्राप्त किया है, मैं भीतर की खोज के लिए अतिरिक्त कार्यप्रणाली जोड़ दूंगा फ़ाइल का डेटा पढ़ा है जैसा।

    अपडेट: मैं उन सभी को धन्यवाद देना चाहता हूं जो जवाब देने के लिए समय निकाले, मेरे पास अब एक काम का समाधान है। Wolfwyrd का जवाब बिल्कुल वही था जो मुझे जरूरी था।

    फ़ाइल को एक बाइट बफर में पढ़ना संभालता है। उन बाइट्स को दूसरी फाइल में वापस डंप करने से संभाल लेंगे आपका कोड कुछ ऐसा होगा:

      (var binReader = new System.IO.BinaryReader (System.IO.File.OpenRead ("PATHIN")) का उपयोग कर (var binWriter = new system आईओ। बाइनरीवायर (सिस्टम.आईओफ़ाइल। ओपनवर्इट ("पैथोउट"))) {बाइट [] बफर = नया बाइट [512]; जबकि (binReader.Read (बफर, 0, 512)! = 0) {binWriter.Write (बफर); }}   

    यहां हम 512 बाइट्स का एक बफर चक्कर लगाते हैं और इसे तुरंत दूसरी फ़ाइल में लिखते हैं। आपको अपने खुद के बफर के लिए समझदार आकार चुनने की जरूरत होगी (यदि पूरी तरह से आकार की है तो आपको पूरी फाइल पढ़ने से रोकना होगा) जैसा कि आपने पैटर्न मिलान करने का उल्लेख किया है, आपको उस मामले पर विचार करना होगा जहां एक पैटर्न बफर पढ़ेगा, यदि आप पूरी फ़ाइल एक एकल बाइट सरणी में लोड नहीं करते हैं तो

    बड़ी फ़ाइलों को पढ़ने के सर्वोत्तम अभ्यासों के बारे में अधिक जानकारी है।

javascript - How do I send a character to a textarea -


I need to simulate the user input of a character, for example ()

 < Code> & lt; Textarea rows = 3 cols = '30 'id =' txt '& gt; & Lt; / Textarea & gt; & Lt; Script & gt; Var $ txt = jQuery ('# txt') var e = jQuery.Event ("keypress"); E.which = 49; $ Txt.focus () Trigger (E) & lt; / Script & gt;   

This sets the focus on texterrari correctly, but the character '1' (ASCI code 49) does not appear in the text box. What am i doing wrong

UPDATE: Based on the answers, I see that I have not provided enough information, so here it goes: The issue is not just changing the value of the text field, but in reality, Use it to simulate to enter that value. I'm trying to hook into some SharePoint control, and when the user presses a certain key in some teddytra, then it does a lot of stuff. I will not be good by adding some value through the value of Val () Key events need to be triggered.

So, the question is still there - how do I simulate user input I tried in the example above?

Use instead:

  var $ Txt = jQuery ( '# Txt'); $ Txt.focus () Val ('1').   

And in fact, you do not need the Focus () method for this purpose.

"); Txt.value =" 1 ";

c# - Picture box not updating its content -


I try to load the image in there, it does not show anything, just a blank picture box control. This is the code at this time:

  var loadImage = new backgroundwork (); LoadImage.RunWorkerAsync (); // Content that is being executed in the background LoadImage.DoWork + = (O, RGS) => {// Loop through the list of items to find matching pictures. Foreign items (different items in the list) (if (item.Name == name) {try {// get image var request = WebRequest.Create (item.Picture); (Var response = request.GetResponse ()) (Var stream = feedback. Gatesresponsesstream ()) {image image = image.fromstream (stream); Args.Result = image; return;}} hold (exception) {}}}} // // Run it LoadImage.RunWorkerCompleted + = (O, Args) => {PictureBox1.Image = (image) args.Result; Application.DoEvents ();};   

Do something wrong Is it? If so, would you Can I tell me?

As I have commented on your question directly to you, Make a reply, you are running a first background worker to engage your representatives.

Perhaps, you only need to exchange orders in your code .

php - Laravel 4 - Dynamic Routing/Views -


I have a user login system that includes two steps:

  1. User login < Ol>
  2. Try to lock the user into AD (this is the LDAP certificate module)
  3. If the user can log in via AD, check that the user exists in the user table Or not
  4. If the user is not present in the user table, Add - Only "Username" and "Good Name"
    1. If users have been added, they will not be related to any team and notified to contact their manager to continue the account. Load the user column in Laravel session credentials - Now we have the AD login name, "Good" name (last first), selected Team ID, etc. There is no password because the user has been certified.
    2. Team selection - Table userTame pivot table.
    3. Root user for Team Dashboard

      Right now, I have this route:

        // This group user logs in Does the forces to; Auth () will check whether the user has selected a team and ensures that the team is present. Root :: Group (array '(first' = '' 'auth'), function () {// handle team - will be url / dashboard - team controller 'team user' table on team user table $ team user = php_sapi_name () == "cli" tap: @TeamUser :: Search (session :: find ('credentials.team'); if (empty ($ Team Users)) {$ team = ucfirst (strtolower ($ Team User- & Gt; teams () -> first () -> watch_name); root :: controller ('dashboard', 'team'. $ Team. 'Controller')}} // index root :: controller '/', 'Index controller');});   

      However, I do not think this is a very beautiful solution - mostly because I can not reverse routing this method.

      Any suggestions or suggestions?

      I personally want to put this argument in my own filter instead of the root group, because what you're doing They use just 'filtering' users for different routes depending on the variable (the same thing filters an athlete).

      Update

        Root :: Filters ('whatever', function () {$ teamUser = php_sapi_name () == "cli" ? Null: @TeamUser :: Search (Get Session :: Receive ('credentials.team')); If (empty ($ Team Users)) Redirect: route ('index controller');}); Root :: Group (array ('first' = & gt; 'auth | whatever', function) (root :: controller ('some controller'); root: controller ('/', 'index controller');} ));    

c# - Get Layer of Window Relative to Other Windows -


In C # WPF, is there a way to position a window layer (i.e. z-index)? I have a program that grows new windows and I want to save the layers order.

So if I have three windows open, and window 1 is in front of window 2 and window 2 is in front of window 3, how can I get their position in relation to each other (or globally) Am I

You have to resort to Win32 interop :

c# - Using pinvoke to get access to system objects and query about a process -


While I learn about p / invoke, I use some noteworthy performance benefits using those .net methods I can see, because this system information through DLS

For example, by importing the DLL into this code

I can get information about the process related to this question, so I want to know about that memory usage.

But as I can note in that link and it seems that I can use a category which has not been used by P / Invoice and is very specific information query uint64 IODataOperationsPerSec; Uint64 IOOtherOperationsPerSec; Uint64 IOReadBytesPerSec; Uint64 IOReadOperationsPerSec; UINT64 IOWriteBytesPerSec; UINT64 IOWriteOperationsPerSec; Uint64 IODataBytesPerSec; Uint64 IOOtherBytesPerSec; UIT 32 PagesFullsFrasek; Uint64 PageFileBytes; Uint64 PageFileBytesPeak;

As you can see, there are separate jobs for both 32bit / 64bit processes. So here I knew to make sure that I That's definitely getting what I need to do the query and then I saw that I can need all through that class, which I could get a guess (wmi), but I was actually searching , For 1 class, I will definitely know I ask 32bit functions and 64 bit tasks correctly and 2 counter are all in one class, I / O , CPU time , memory usage And the execution issue is that it has a specific performance gain, which is compared to using net search.

Then The question is :

How can I gain access to that class by using a method like P / invoice and the pure class of mine?

And in fact the most interesting link that I've found about the counters for managed, is in the description, I think equal to the above win32 link.

The last time I worked with P / Invoke, the whole of the managed C ++ library It was very easy to do, and then import it into my C # app. If you know C ++, you will save yourself a lot of trouble while talking about those types of operations.

android - Using Gridview and Button in LinearLayout -


I tried to add buttons below the gridview in linerlight on the following code. But when I execute my app, I see only Gridview that there are no button items. So this may be a basic mistake, but I can not see it.

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; LinearLayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: layout_width = "fill_parent" android: layout_height = "fill_parent" android: orientation = "horizontal" Android: background = "# 2 A2A2A "& gt; & Lt; Android: layout_height = "wrap_content" android: columnWidth = "150dp" Android: numColumns = "auto_fit" Android: horizontalSpacing = "10dp" Android: verticalSpacing: GridView Android: id = = "10dp" Android: stretchMode = "columnWidth" Android: gravity = "center" & gt; & Lt; / GridView & gt; & Lt; Button Android: id = "@ + id / Button1" Android: layout_width = "wrap_content" android: layout_height = "50dp" Android: text = "@ string / cam_string" /> & Lt; / LinearLayout & gt;    

After "text" itemprop = "text">

to your LinearLayout orientation Change vertical . I suspect you are not seeing the button because the gridview takes all the horizontal space, then the linear layout adds the button to a place that is not visible. You can also change the "0dip" to layout_height GridView and it may` want to give Android. So that it will fill all the space except by the button that took the layout_weight = 1 'attribute

c# - Dynamically created controls lose values -


ASP.NET 4.0 I want to allow users to view / edit items on a customer's license. There are 1-M products in a license, and the list of products will expand over time, so I have to say whether this product is in a license, such as: by creating a list of all products (in Page_load) P>

  checkbox cbxProduct = new checkbox (); CbxProduct.ID = "cbxProduct" + product.ID.ToString ();   

I can find those dynamic controls and use them on postback using them are:

  Czech box cbxprod = (box) pnlLicenseDetails. FindControl ("cbxProduct" + productID .tar ());   

but only if they are redone in Page_load (or Page_Init, does not matter). The problem is that I want the user to be able to uncheck a box to remove a product from the license and then save the result. But to find the checkbox and to determine its value, I will have to regenerate the control, which definitely erases any value entered by the user.

If I try to reference the checkbox without rebuilding them, I definitely get an "Object Reference not set ..." error. So I need some methods to get the values ​​before ending user input.

Suggestions?

You need to create them in the same way for all requests, you'll need to create dynamic control Page_Init. This means, to create control, run the same code and add it every time the page is loading, regardless of whether the IsPostBack is in the control collection.

In addition to this, I would recommend that you control a dynamic member variable so that you have to call FindControl , as it is probably expensive.

Since it seems that you have a list of products somewhere, here's one example, use a dictionary to store the checkbox:

  public Partial Class _Default: Pages {Private Dictionary & lt; Int32, checkbox & gt; _myDynamicCheckBoxes; Safe Override Zero OnInit (EventArgs e) {_myDynamicCheckBoxes = New Dictionary & lt; Int32, checkbox & gt; (); Foreign Currency (different products in _listOfProducts) {var chkBox = new checkbox {id = "checkbox" + product. ID ToString ()}; _myDynamicCheckBoxes.Add (product.ID, chkBox); // Add a checkbox for a control collection}}}   

Then somewhere in your code, when you have a product and you use the checkbox you want to associate with Can: var aCheckBox = _myDynamicCheckBoxes [product.ID];

Adding atoms to lists prolog -


I'm trying to get my head about the concept I am fairly new to Prolog and I lists. One example I'm trying to:

  value (A, 1). Value (B, 2) Value (A, 3) Value (A, 4) Value (C, 3)   

I am trying to make a bill that is Searched (A, list) in the results: list = [1, 3, 4].

It depends only on all the facts and adds the matching people to the list.

I have tried to do something like that. But it does not seem right:

  find (x, list): - value (x, d), app ([d], [], [list | rest]), search (x , [Head | list]).   

Sorry about such a basic question. Any guidance is appreciated.

Note: I intend to expand the program by adding all values ​​to the list.

I believe whatever is trying to do is already present, it Try:

 
code>? - Search (X, Value (A, X), list).

I have not been installed on this machine, so I can not test it completely, but you should find what you are looking for.

EDIT: Sorry, managed to join swi and I realized that I had two arguments inverted, now see the updated code. Apart from this it was tested and it works: -)

Edit 2: According to the above comment, you can assemble those values ​​that match 'A' and the amount Which you can add to:

 ? - findall (x, value (a, x), list), summary (list, sum).   

- Ken

java - extracting indivdiual bibo:Articles from RDF document -


मेरे पास इस प्रारूप के साथ एक RDF / XML दस्तावेज़ है:

  & lt;? Xml संस्करण = "1.0" एन्कोडिंग = "UTF-8"? & Gt; & Lt; rdf: RDF xmlns: एग्स = "http://purl.org/agmes/1.1/" xmlns: foaf = "http://xmlns.com/foaf/0.1/" xmlns: rdf = "http: // Www.w3.org/1999/02/22-rdf-syntax-ns# "xmlns: rdfs =" http://www.w3.org/2000/01/rdf-schema# "xmlns: bibo =" http: //purl.org/ontology/bibo/ "xmlns: dct =" http://purl.org/dc/terms/ "& gt; & Lt; bibo: अनुच्छेद rdf: about = "http: // xxxxx / NO8500391" & gt; & LT; डीसीटी: पहचानकर्ता & gt; NO8500391 & lt; / डीसीटी: पहचानकर्ता & gt; ... & lt; / bibo: लेख & gt; & Lt; bibo: अनुच्छेद rdf: about = "http: // xxxxx / NO8500523" & gt; ... & lt; / bibo: लेख & gt; & Lt; bibo: अनुच्छेद rdf: about = "http: // xxxxx / NO8500496" & gt; ... & lt; / bibo: लेख & gt; & Lt; / rdf: RDF & gt;   

जैसा कि आप देख सकते हैं, एक आरडीएफ / एक्सएमएल फ़ाइल में, कई bibo: article s, हजारों हो सकते हैं मैं क्या चाहता हूं कि प्रत्येक लेख को निकालना और उसे एडीपी / जेएसओएन (मुझे पता है कि कैसे एक मॉडल लिखना है) अपाचे जेना का उपयोग करना है, इसलिए प्रत्येक आलेख के लिए मेरे पास एक अलग दस्तावेज हो सकता है, और बाद में इन सबको इंडेक्स जैसे सीचडीबी या खोजों को करने के लिए लोचदार खोज।

मैं मॉडल (जेना) में प्रत्येक आलेख कैसे निकाल सकता हूं? गंदे तरीके से मैं सोच रहा था कि फाइल को XML के रूप में संसाधित करना और प्रत्येक bibo: article तत्व को निकालने।

सबसे पहले क्या मैं आपके प्रश्न पर कुछ स्पष्टीकरण मांग सकता हूँ? मुझे लगता है कि आप क्या पूछ रहे हैं, प्रत्येक bibo: Article को अपने दस्तावेज़ में प्रवेश करने के लिए विभाजित करना है?

एक अलग नोट के रूप में यह नहीं है प्रत्येक प्रथम स्तर के नोड को विभाजित करने के समान ही, क्योंकि आरडीएफ / एक्सएमएल एक कैनोनिकल सीरियलाइजेशन नहीं है, अर्थात आरडीएफ को कई अलग-अलग आरडीएफ / एक्सएमएल दस्तावेजों द्वारा सीरियल किया जा सकता है और इसमें कोई गारंटी नहीं है कि वे हमेशा प्रथम स्तर के नोड होंगे। < P> अब अपने प्रश्न का प्रयास करने के लिए, अपने लक्ष्य को हासिल करने के दो मुख्य तरीके हैं।

SPARQL क्वेरीज़ का उपयोग

सबसे पहले एक SELECT query को सभी आलेखों को पुनः प्राप्त करें, फिर प्रत्येक परिणाम के लिए लेख यूआरआई पर एक DESCRIBE क्वेरी डालें जो आपको एक नया जेना मॉडल देगा जिसमें केवल उस यूआरआई के बारे में जानकारी होगी।

ध्यान दें कि आप कर सकते हैं यदि आप चाहें तो एक कस्टम DescribeHandler बनाकर बिल्कुल कैसे DESCRIBE प्रश्न बदल सकते हैं, लेकिन यह ओवरकिल हो सकता है।

फिर आप प्रत्येक <कोड के परिणामों को सीरियल कर सकते हैं > वर्णन एक नया दस्तावेज़ के लिए प्रश्न पूछें।

मॉडल एपीआई का प्रयोग

listStatements () विधि (अधिभार जो खोज मापदंड लेता है) का उपयोग करें लेख, तो पहले समाधान मुद्दे के समान, इसके बारे में बयानों को खोजने के लिए प्रत्येक खोजा आलेख यूआरआई के लिए आगे कॉल करता है इन्हें एक नए मॉडल में जोड़ा जा सकता है और वांछित के रूप में क्रमबद्ध किया जा सकता है।

python - How do I statically configure Celery application differently in production and development? -


I want to use cerberary to implement a work queue for working longer, such as external APIs ( Like to send texle SMSs) However, I use different API credentials in production and development.

I can not understand how to configure the solarium to pass in the appropriate API credentials (for example, from command line) related to my application code (which launches celery functions) Specifies whether the sealary queue is said to talk with both lines of development and production?

Thanks for any help you can avi

Edit: An extra bonus for an example of using the --config option of celery.

The way I do it is using an environment variable. As a simple example ...

  By # conference, my configuration files are in the "configs / XXX.ini" file, which has the # XXX configuration name (e.g., "staging.ini ") Config_filename = os.path.join ('configs', os.environ ['CELERY_CONFIG'] + '.i') Configuration = read_config_file (config_filename) # You can now create celery by using your configuration ... Celery = celevery ('mymodule', broker = configuration ['CELERY_BROKER_URL']) @clerery. Tak def add_stuff (x, y): ....   

You are running from the command line As such ... Export is an example of doing something like CELERY_CONFIG = Staging Selerie-A Mymodule worker

, but he says "how do I do this which is not so ugly? "As far as I am concerned, it is quite acceptable, and" ugly "does not at all.

css - How can I place 3 objects next to each other in HTML -


I want to place the image and two texts in front of each other. The first lesson is going to the far left image directly center Is in and the last lesson is true right here I am currently in ...

  & lt; Body & gt; & Lt; H2 & gt; & Lt; Font color = "# 99 ccx" & gt; & Lt; Font face = "wordana" & gt; Mr.ipik Gaming 4 U & lt; / Font & gt; & Lt; / H2 & gt; & Lt; Img src = "website_art.png" height = "75" width = "235" /> & Lt; H2 & gt; & Lt; Font color = "# 99CC00" & gt; & Lt; Font face = "wordana" & gt; Art of gaming & lt; / Font & gt; & Lt; / H2 & gt; & Lt; / Body & gt;   

How can I do this?

Thank you

You do not close the font element in the right element in your HTML code Are there.

In addition, there is a good practice to keep style in an external file (I talk about CSS).

Change to:

  & lt; Body & gt; & Lt; Div class = "container" & gt; & Lt; H2 & gt; MrEpicGaming4U & lt; / H2 & gt; & Lt; Img src = "Your URL" height = "75" width = "235" /> & Lt; H2 & gt; The Art of Gaming & lt; / H2 & gt; & Lt; / Div & gt; & Lt; / Body & gt;   

Keep these CSS rules:

  h2 {font-family: "Verdana"; Color: # 9C; }. Container & gt; * {Display: Inline-Block; }    

firebase - Issue with security rules getting data via auth.id -


I have a problem setting my security rules properly, especially reading post data.

Data hierarchy:

  Posted: {title: "Post One", User ID: 6}}, User: {6: {Name: "My name"} }   

And my rules are:

  {"rule": {"posts": {"$ post": {".read": " Data.child ('UserID'). Val () == auth.id "," .write ":" newData.child ('userId'). Val () == auth.id "}}," user ": {"$ User": {".read": "auth.id == $ user", ".write": "auth.id == $ user"}}}}   

I know that "Auth.id" is 6, because it is dragging my user information correctly if I have the numbers permanently Changes the rules for selling, so it works:

  "$ post": {".read": "data.child ('userId'). Val () == 6 "," .write ":" newData.child ('userId'). Val () == auth.id "}   

but not using auth.id. Am i missing One thing to keep in mind is that the security rules are safe, in particular, in the rules, " 6 "! = 6 (because there is a string and a number). So maybe your auth.id is "6" (in the form of a string), but as your user id number 6?

If this is the case, then a potential fix will change your rule expression like this:

  data.child ('userId'). Val () + '' == auth.id   

that will force the user to be a string. Alternatively, you can change your data to ensure that the User ID is always stored as a string.

windows 8 - Image for all WinJS controls list -


Frankly, I'm not sure that this is the right question for this forum. If it is not, feel free to tell me where to post it. I'm just looking for an image that has all the controls provided by WinJS (e.g., rating, toggle switch, list view, flip view, etc.) On MSDN, I find places where it lists all controls (such as) but there is no such image which shows all these controls that I am not using the right keywords during my Google search. Does anyone have any links for this?

This can not be a detailed list, but one of its presentations includes the Windows 8 UI presentation , Where many (all?) Widgets are included when you download, then this presentation is in 05 - UI control folder Here's one of the slides to feel about what you think:

here Enter image details

linux - Trying to create a file to call another file for a looped search -


I am trying to write a script that calls the second script and uses it once or in a loop Inputs

I wrote a script that searches for a file for only one file and then prints the name of the file and gives the list of rows that are searched. That script is here

  #! / Bin / bash if [[$ # $ lt; 2]] Then echo "Error": 2 arguments must be provided. Exhaust-1fi if [[-a $ 2]] then "echo" error: the second argument should be a file. Exit-2f echo "------ file =" $ 2 "------" grep -ne $ 1 $ 2 "  

So now I write a new script I want to say that the user enters only one file in the form of a second argument, and he will also loop all the files in the directory and search.

So if there is an input:

  ./testcript if testfile   

This will only use the script but if the input is:

  ./script if the desktop < / Code>  

This is all the files in a loop

For eternity, let's go for all of you in my heart.

Something can do such a thing:

  #! / Bin / bash do_for_file () {grep "$ 1" "$ 2"} Do_for_dir () {cd "$ 2" | | Exit file for 1 * do_for "$ 1" "CD file" for "$ file."} Do_for () {where = "file" [[-d "$ 2"] & amp; amp; where = Dir do_for_ $ "$ 1" "$ 2"} "$ 1" "$ 2"    }

javascript - jquery slide toggle : hidden + new link -


Toggle open and to add the "show" link to add to the toggles I should include in jquery below To be able to "Bleblabla" at the end of the "Close" link) (keeping in mind the slow effects)

jQuery:

  var $ j = JQuery .noConflict (); $ J (function () {$ j ('# containertoggle'). ('Click', 'a.opener', function () {$ j (this) .next () toggle ('slow'}}); });   

HTML: & lt; Ul id = "containertoggle" & gt; & Lt; Li & gt; & Lt; One class = "opener" & gt; Show & lt; / A & gt; & Lt; Div style = "display: none;" & Gt; & Lt; P & gt; Blablablabla & lt; / P & gt; & Lt; / Div & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; One class = "opener" & gt; Show & lt; / A & gt; & Lt; Div style = "display: none;" & Gt; & Lt; P & gt; Blablablabla & lt; / P & gt; & Lt; / Div & gt; & Lt; / Li & gt; & Lt; / Ul & gt;

You can try this approach.

Also, better idea to avoid adding styles to style attribute instead use classes.

  var $ j = jQuery.noConflict (); $ J (function () {$ j ('#contentagogue'). ('Click', 'a.opener', function) {var $ this = $ j (this); $ this.next ('div') ('Slow'); $ this.nextAll ('a.closer') first (). RemoveClass ('hide'); $ this.addClass ('hide');}); $ J ('#' ('click', 'acloser', function) (var $ this = $ j (this); $ this.prev ('div'). Hide ('slow'); $ this prev ('A.opener'). First (). RemoveClass ('hide'); $ this.addClass ('hide');});});   



Custom expandable list in android -


I need to design a page like the picture below. I need to expand two ideas like the Ardi I did the goggle but I was able to see only expandable list view. Can someone advise me about custom two views in a wide window?

If you only have to expand 2 views, then you might see the ExpandableListView Using a simple trick to get it without having to be gone due to sub-categories visibility, linerlightout oriented vertical Define the layout of each category and subcategory. & lt; LinearLayout Android: id = "@ + id / category1" //....> & Lt; / LinearLayout & gt; & Lt; LinearLayout Android: id = "@ + id / subcategory1" Android: Visibility = "gone" //....> & Lt; / LinearLayout & gt; & Lt; LinearLayout Android: id = "@ + id / category2" //....> & Lt; / LinearLayout & gt; & Lt; LinearLayout Android: id = "@ + id / subcategory2" Android: Visibility = "gone" //....> & Lt; / LinearLayout & gt;

Set up a click listener for each category, and when a category is clicked, its visibility changes: visible if it went to Is , and went if it is visible .

A pseudo-cod will look like this:

  ViewGroup category1 = findViewById (CATEGORY1); ViewGroup Subcategory 1 = SearchWebID (Subcategory 1); Category1.setOnClickListener (New OnClickListener) {public void onClick () {toogle ();}}); // void toogle () {if (Subcategory 1 is visible) {Subcategory 1 The requirements will be changed in the future and you need to add more categories, then perhaps  ExpandableListView    / Code> will make more sense, but for now you can get the desired effect from this simple move. / P>  

html - Put a DIV class in the middle using css -


There are some CSS related issues for layout issues. First of all see this screenshot:  http://i.stack.imgur.com/nmw69.png I have used CSS here like this:

  .image {float: right; Cushion Top: 10px; Padding-left: 10px; Padding-bottom: 10px;} Description {font-size: 15px; Font-style: italic; Padding: 10px; Color: # 5C5C5C; Text-shadow: 0 px 0 px1px # a1a1a1;} .image. Description {display: block;} .man-graph {clear: both;}   

But what I have to do to display the details in this way:  http://i.stack.imgur.com/aX2B1.png You can tell me CSS, the status range is div < / Code> Keep in the middle like a second image Thanks

It will basically:

  .description, .image {display: inline-block; Vertical-align: medium; }    

java - Can't get this array to work -


I want to make a grid of buttons for my Android app. I did a traditional experiment for loop to make it, which usually works in other languages. But when I check my app, it does not respond when the page loads and closes. How can I decide ...

  but = new button [4] [4]; LinearLayout = (ViewGyAd) ViewById (R.id.buttonlayout); (Int r = 0; r & lt; but.length; r ++) {for (int c = 0; c & lt; but.length; c ++) {but [r] [c] .setLayoutParams (New LinearLayout.LayoutParams (20, 20)); But [R] [C] = new button (this); But [R] [C]. STX (20 * R); But [R] [C]. Set (20 * C); But [R] [C] .set text (""); LinearLayout.addView (but [R] [C]); }}    

  but = new button [4] [4]; LinearLayout = (ViewGyAd) ViewById (R.id.buttonlayout); (Int r = 0; r & lt; but.length; r ++) for {for (int c = 0; c & lt; but.length; c ++) {but [r] [c] = new Button (this); // You must make your object before the set object! But [R] [C]. Seattle layout at the bottom (New liner layout. LayoutParam (20, 20)); But [R] [C]. STX (20 * R); But [R] [C]. Set (20 * C); But [R] [C] .set text (""); LinearLayout.addView (but [R] [C]);    

c# - DataTable distinct rows -


मेरे पास डुप्लिकेट पंक्तियों के साथ एक आंकड़ा है।

  DataTable dt = new DataTable (); Dt.Columns.Add (नया DataColumn () {कॉलमनाम = "आईडी"}); Dt.Columns.Add (नया DataColumn () {कॉलमनाम = "नाम"}); डाटारोव डारोवा 1 = डीटी। न्यूआरओ (); Datarow1 ["आईडी"] = 1; Datarow1 ["नाम"] = "जॉर्ज"; dt.Rows.Add (datarow1); डाटारोव डटरो 2 = डीटी। न्यूआरओ (); Datarow2 ["आईडी"] = 1; Datarow2 ["नाम"] = "जॉर्ज"; dt.Rows.Add (datarow2); डाटारोव डारोवा 3 = डीटी। न्यूआरओ (); Datarow3 ["आईडी"] = 3; Datarow3 ["नाम"] = "दाऊद"; dt.Rows.Add (datarow3);   

डेटाटाले से अलग पंक्तियाँ कैसे निकालें?

  डेटाटाबल प्राप्त करेंडिस्ट्रिन्च = dt.DefaultView.ToTable (सच है, नई स्ट्रिंग [] {"आईडी", "नाम"});    

android - R class not generating ids -


I have two layout files, one for main activity and the other XML file is for my custom list view. I want to access the ID of the views in my layout file but the main activity in the R square is only the IDs from the XML file. I would like to know how I can add an ID to R classes or access them through another medium.

Thank you and sorry if it's a lame question but I am fairly new to Android.

This is the main activity

  & lt; LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" Android: layout_width = "Fill_parent" Android: layout_height = "fill_parent" Android: orientation = "vertical" & gt; & Lt; ListView Android: id = "@ + id / list1" Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" & gt; & Lt; / ListView & gt; & Lt; / LinearLayout & gt;   

This is the layout file

  & lt; LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" Android: layout_width = "match_perrent" android: layout_heck = "match_perrent" android: orientation = "horizontal" & gt; & Lt; ImageView Android: id = "@ + id / imgSports" Android: layout_width = "wrap_content" android: layout_height = "fill_parent" android: gravity = "center_vertical" /> & Lt; TextView android: id = "@ + id / rowTitle" Android: layout_width = "fill_parent" android: layout_height = "fill_parent" android: gravity = "center_vertical" /> & Lt; / LinearLayout & gt;    

When you create an activity, it will create its default layout xml as far as I Understand the problem, you want the same activity to display a list. If this is the case, then I suggest that you try to keep your design in the default activity layout, which will create an ID in R. Apart from this, I say the basic Android tutorial available on the Android Developers site will help "Create your first app". You understand this.

json - can I target a specific node in d3 -


Is it possible to target nodes with some important values?

The "category" in the node: Dataset, I'm trying to provide a different color to it, I suppose it is possible. I am thinking that if I can write any kind of statement then

  if (d.node.category == dataset) {d3.select (this). Style ("fill", "yellow"); }   

In this way I am now adding color to nodes

  var z = d3.scale.category10 (); Var node = svg.selectAll ("circle.node") .data (nodes) .enter () .andend ("svg: circle") .attr ("r", function (d) {return d.size * 2} ). Style ('Square', 'General Category'). Style ("fill", function (d) {return z (dprent);}) style ("stroke", "# 000"). Style ("stroke-width", "4px"). Call (force drag);   

My JSON looks like

  function getNodes () {var in these nodes = {"name": "APP", "department": "NYC "," Children ": [{" name ":" API1 "," department ":" third party "," size ": 15," url ":" http://www.nytimes.com/ "}, {"Name": "API 2", "department": "NYC", "size": 15, "url": "https://www.google.com/"}, {"name": "dataset" , "Category": "Dataset", // This is one I am trying to assign to a difference coloring "Department": "Third party", "Size": 15, "url": "http: // www .wired.com / ",}]," size ": 20," url ":" http://www.nyc.gov/html/index.html "}; Returns in nodes; }    

Can you just provide a different location when the category is present? (prepaid), data (DNA). (Data). (Data). () '.' D.category === 'Dataset'? 'Red': 'defaultColor');});

busybox - ssh client (dropbear on a router) does no output when put in background -


I am trying to automate some things on remote Linux machines with bass scripting on Linux machine and a command ( Braces) is a belief from Cmd concatenations):

(ssh -i / path / to / private_key user @ remotehost 'sh -c' 'echo1; echo2; echo3; A '')

But if an ampersus is added to execute in the background, it seems that it executes, but E output is not printed, not on standout, and not on stadder, and even redirection of a file (inside the braces) does not work ...:

(Ssh -i / path / to / private_key user@remosthost 'sh -c' echo 1; echo2; echo3; -a "') and

Anyway, Running customer dropbear v0.52 in BusyBox v1.17.4 at 2.4.37.10 (Tomato build on WRT54G Tomato).

To get either output Is there any way? For this behavior Or reason?

Edit:

To facilitate, plain ssh help output here (on my tomatoes use):

  dropback client v0.52 usage: ssh [options] [user @] host [/ port] [, [user]] host / port] ... [command] options are: -P & LT; Remote Port & gt; -l & lt; Username & gt; -t is not allocated a pty -t do not allocate a pty-n Do not run a remote command- run auth-auth- in the background -y always accept the remote host key to the unknown-s request a subsystem (for sftp Use) -i & lt; Identityfile & gt; (Multiple allowed) -L & L; Masters: RemoteHost: RemotePort & gt; Local Port Forwarding- Forward Hosts Forwarded Port-R & Lt; Allow to contact: remotehost: remoteport & gt; Remote Port Forwarding - W & lt; Receive_window_buffer & gt; (Default is 12288, can be fast, maximum 1 MB) -s & lt; Diced & gt; (0 is never the default, too) - I & lt; Idle_timeout & gt; (0 anytime, is not the default) -b & lt; EndHost: Endport & gt; NetKat-like forwarding - J & lt; Proxy_Program & gt; Use program pipe instead of TCP connection   

Revision after 1 day:

The same result will not hurt with the braces and without it. I wanted to do ssh authentication on the background, so the -f option is not a solution. Interesting side note: If an unexpected option is specified (such as -v ), error Message: WARNING: Ignoring unknown logic - 'v' is displayed - even when put in the background, so getting output from background processes usually works in my environment .

I tried x86 Ubuntu on the regular ssh client: it works I also tried the dbclient on x86 Ubuntu: works too So this problem is specific for the tomato build - or there was an unknown fix between the "DropBatter v0.52" built in tomatoes and between a Ubuntu (the difference in support output only gets double-sized default window buffer at Ubuntu) How can one process know how this surface Was kept in Mi? Is there a solution to the problem?

I had a similar problem for my OpenWRT router Dropbear SSH client output for something Does not even write if there is no stdin, e.g. When run by Cron I think & amp; The process has the same effect on stdin (no input).

I found some solution on author's bug tracker / try to redirect the input from dev / zero:

  ssh -i yourkey user @ remotehost "123 Echo "& lt; / Dev / zero & amp;   

This works for me as I tried to describe.