Posts

Showing posts from August, 2014

c++ - Can I use port 80 in my VCL client-server app's -

Usually I use some random ports for my client-server applications in Delphi / C + + Builder. But, since I work in a building with a strong firewall policies, I would like to use Port 80 (TCP and / or UDP). My question is, do I have any problems with my client-server communication if there are other applications using the same port? I think my server will also take that communication? I would like to avoid any potential confrontation with other apps. Yes, you have problems, if an application that listen , You can not use that port. Notice, browsers use port 80 as target ports, they do not talk about 80. Therefore, when you want to use that port, do not count them.

c# - Calculating Center Of many blobs with aforge and manualy -

I am trying to get the center of all the detected blops in an image, so I changed it to two different Tried in ways, and I got two different results! has been followed as the first one: BlankConverterBlobCounter = NewBlackConverter (); BlobCounter.ObjectsOrder = ObjectsOrder.Area; BlobCounter.ProcessImage (image); Blob [] blobs = blobCounter.GetObjectsInformation (); AForge.Point Center = New AForge.Point (); If (blobs.Length> gt; {center.x = blobs.Average (c => c.CenterOfGravity.X); center. Y = Blobs Avg (C => c.CenterOfGravity.Y); } and followed in another way: System.Drawing.Point Center = new System.Drawing.Point (); Int count = 0; Int sum x = 0; Int'l = 0; For (int i = 0; i & lt; image.Width; i ++) for (int j = 0; j & lt; image.Height; j ++) {var p = image.GetPixel (i, J); If (! P.Name.ToLower (.) Equals ("ff000000") {sumX + = i; Sumy + = j; Count ++; }} If (calculation> 0) {center.x = sumX / count; center. Y = sumy / count; } Return...

Writing class that is subclass of Vector, java -

Just hope I can find someone to tell me whether I'm doing this right or not, just like I Never written before. So I want to write a class by the name of the process class which is a subclass of the vector, as well as a constructor which defines the blank queue. Apart from this, objects of vector type will be "objects". So here it is ... process value of the public class & lt; Vector & gt; {ProcessQueue () {}} vector anywhere Change your code to: public class process question & lt; T & gt; Vector extension & lt; T & gt; {} Anyway, I do not recommend you by using vector . check . If you have to do this then IMO ArrayList will be better. public class process question & lt; T & gt; ArrayList extension & lt; T & gt; {} and use list in your code: list & lt; SomeClass & gt; LstQueue = new process value & lt; SomeClass & gt; (); People fighting for the people of Orissa ¶ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ...

java - Best way to identify which button was pressed for method logic -

I have a method that is used for two different tasks, actions are identified, which button Suppresses I am using a boolean to identify button press. PDFButton.addSelectionListener (new selectionEditor () {Public Zero widget selected (SelectionEvent e) {buildArray (true);}}); Plot button Ad selector (new selectionEditor) (Public Zero widget selected (selection event e) {build array (wrong);}}); Public Zero Builder (Boolean Button ID) {Get Index etc ... if (true) {PDF.getInstance.buildArray (index); } Else {Plot.getInstance.buildArray (index); }} Is this the best way to do this? Edit tip button snippet pasted, there are no 2 buttons in it. I'm trying to do IF logic has a condition set, so I know what button The buildArray method was pushed to activate. Public Zero Builder () {Get Index, Mode Code. .... if ** (button press is equal to pdf button) ** {PDF.getInstance.buildArray (index); } Else {Plot.getInstance.buildArray (index); }} I know that in a way similar t...

html - Is there a way to specify the width of an embedded gist? -

I am trying to embed an abstract in a webpage. Take an example as an example: & lt; Script src = "https://gist.github.com/Astr0surf3r/5208714.js" & gt; & Lt; / Script & gt; I wonder if there is a way to determine the width of the essence. For example, I want to compile briefly compared to the default width I You use this summary Modifying the CSS class can control the width. .gist {width: 250px; } Example:

xcode - new tabs for different files -

I need to use Xcode as a general purpose editor. For example, I need to open the file .txt, .project, etc. If I open a file on time then it gets all right, but I have to put new files in a new tab. I tried cmd + t But the new tab is a text similar to the first tab ?? | And if I open a second file with double click, it opens a new window and does not have a new tab ?? | Is there a solution? Thanks a lot! Command + T will open a new tab with the same file, then you navigate to a new file And can open one in one tab. XCode does not want to assume that the file you want to open in a new tab and it does not want to open an empty tab, so it opens the existing tab in a new tab.

php - Variables not being sent to server when using POST -

उपयोगकर्ता अपने कंप्यूटर पर एक पृष्ठ निम्न JavaScript / अजाक्स : xmlhttp.open ("POST", "ProcessRequest.php", सत्य); Xmlhttp.setRequestHeader ("सामग्री-प्रकार", "एप्लिकेशन / एक्स-www-फ़ॉर्म-यूआरएलएक्सोडेड"); xmlhttp.send (encodeURIComponent ( "fname = श्री & amp; lname = परीक्षक")); सर्वर साइड स्क्रिप्ट ProcessRequest.php चर को एक्सेस नहीं कर पा रहा है। उदाहरण के लिए $ _ POST ['fname'] निम्न त्रुटि देता है : सूचना: अपरिभाषित सूचकांक: fname मैं क्या कर रहा हूँ गलत? मैं इसे WAMP का उपयोग कर चला रहा हूं। आप बहुत अधिक एन्कोडिंग कर रहे हैं। आपको क्या चाहिए: xmlhttp.send ("fname =" + encodeurIC घटक ("श्री") + "& lname =" + encodeurIComponent ("परीक्षक")); बेशक, आप इसे अधिक शुष्क बनाने के लिए एक फ़ंक्शन का उपयोग कर सकते हैं।

geolocation - MongoDb near/geonear query with variable distance -

I want to execute a query where the distance is a dynamic field from the collection. Examples of entries in the archive: {name: 'myName', location: {lat: 10, lng: 20}, max guideline: 10} {name: 'MyName2', location: {lat: 20, lng: 20}, maximum distance: 100} My goal is to get all the elements from this collection, where it the location is close to a given place, we say (10,10) but where the distance calculation is less than this maximum distance field I have one in the nearest query Constant value (i want all I can set up maximum distance in high enough to retrieve elements and then filter into my Java code but I would prefer to do it on query, maybe SQL oriented. You will not be able to do this with a common query because you can not set dynamically the documents per distance As MongoDB 2.4 you can do it with the aggregation framework because they have added the geographical operator for the introduction of pipelines. The first step would be GOA...

Video from photos using mencoder? -

During the day, I take photos from the camera every minute. I would like to make a video with pictures 1 day - & gt; 1 video I use the mancoder to do this: maincoder "mf: //*.jpg" -mf fps = 25: type = jpg -ovc lavc - Lavcopts vcodec = mpeg4 : Mbd = 2: trell: vbitrate = 7000 -vf scale = 1024: 768 - OK copy -o movie.avi this works fine, but: The problem is that I Need to do raspberry P (700 MHz ARM) and take about one hour about the video (it works at about 0.5 fps) while taking 1500 photos during the day. How can anyhow create a video "continuous" - how to transmit each image right after moving it to the encoder - and stop making video every night? Then it will only take a picture, process it 2-3 seconds and wait for another minute to do it again. Thank you. Requirements: strong> All photos should be constantly numbered (i.e. PicName1.png, picName2.png, etc.) All photos must be in the same folder. You must have the latest...

html - PHP $_GET not get value of RewriteRule in case of "index" -

I am having a problem I am trying to get this url: MySite.com/index.php?url=category/value1/value2/value3 From: MySite.com/category/value1/ Value2 / value3 I have this .htaccess file: & lt; IfModule mod_rewrite.c & gt; RewriteEngine rewrite %% {REQUEST_FILENAME}! -f rewrite code% {REQUEST_FILENAME}! -d RectitRule ^ (. *) $ Index.php? Url = $ 1 [L, QSA] & lt; / IfModule & gt; If everything is "index" then everything is working fine, so if I put urls: MySite.com/ Content / tv / color array is equal to $ _GET: array ([url] => content / tv / color /) but when I enter: MySite.com/index/option1/option2 The array is empty array () I checked my apache.conf file and I do not see the problem. & lt; VirtualHost *: 80 & gt; ServerAdmin user@site.com DocumentRoot / home / htdocs & lt; Directory / & gt; Allow all & lt; / Directory & gt; & Lt; Directory / home / htdocs & gt; # & Gt; & Gt...

ruby on rails - To use the :country input, please install a country_select plugin -

I have a country specialty in my guideline model. I do not want to use a plugin, I just use the country as string Have to be Unless I try to edit a guideline in the activeadmin and then I get an error message: ActionView :: Template :: Error (To use country input, please use country_select plugin Install this, like this: :): 1: insert_tag renderer_for (edit) in my form My Administrators / Guidelines. I have index column in RB: Title column: Attribute column: Content column: Hospital column: Country column: User default_ End of responses I'm not sure where you get this form code but I had the same issue with the active admin and the field string To explicitly direct the form to behave as It was resolved: ActiveAdmin.register guidelines form | F | F.inputs 'Description' is done f.input: Country ,: as in = & gt; : String ending f.actions end

java - HttpClient from apache in Android? -

I have already developed a desktop application using Java and now I want to develop the same application on Android the wanted. In my Java application, I used the httpclient library from APK to do all HTTP transactions, my question is, can I use the same class I used with HTTPPLL in my Java application in my new Android app is ??? Yes, very, most, or all your code can work in Android. Just make sure to continue using Apache Import and do not have Google equivalent (near). For example: import com.google.api.client.http .HttpResponse; Make sure you continue to use it: import org.apache.http.HttpResponse;

c# - Interfacing barcode scanner with microcontroller -

I am doing a project related to barcode scanner, netdino plus 2 (microcontroller). I came to the barcode scanner for various types of interfaces (PIN Standard Standards like USB etc ..) which is for Keyboard Wash, RS232, USB (which works again as a keyboard wedge or RS 232). I have selected datalogic QW2170 (Barcode Scanner) which supports both USB and RS232. USB interface is plug-and-play type. I was thinking that I could use the barcode (specific 1D barcode) from the barcode scanner to capture the stream of data that comes after scanning the USB (using the USB cable from the barcode scanner to connect to NetCino Plus 2) I can save it in MicroSD card (NetDino Plus 2 has a slot for microsoft card up to 2 GB) or do I need to use RS232 interfacing for this purpose. You RS232 Reader - The microcontroller that you mention refers to the USB reader attached to host-mode USB does not seem to be any kind of functionality. As stated, I'm sure you will get more input in electronics....

linux - Grep an XML file for certain patterns -

I have a large XML file that has thousands of elements the same elements: & lt ; RootElem & gt; & Lt; Filoj buzz = "true" & gt; 234 & lt; / Fizz & gt; & Lt; Fizz buzz = "false" & gt; 384 & lt; / Fizz & gt; & Lt; Philos buzz = "true" & gt; & Lt; / Fizz & gt; & Lt; Filoz buzz = "true"> 39494 I will run a grep which will be & lt; Fizz & gt; Prints prints, which do not contain text / body data (the number between the opening and closing tags). In the example above, grep 3 and 5th & lt; Fizz & gt; will generate 2 lines for elements, which will not contain numeric data, the file name is phizze_20.xml . I tried to run the following, but it did not work: grep fizzes_20.xml "> Grep fizzes_20.xml "/> Any thoughts? thank you in advanced! The xmllint command can be used to implement xpath expression tests for empty nodes: $ xml...

Git - How to Undo an Unsync'ed Discard-All Rollback? -

Image
I've made three commitments in git but have not synchronized my changes I used to commit a local using GUI Rolled for and some drawbacks are lost in the GUI. Can I restore those commands? I am scared to synchronize my current changes because I want them to store those local commands in the archive. Is it possible to recover those local commands? if so, how? Here's an example, except that my changes are not synchronized: The above image is a commute history. The image above is when I change my changes Given, [left my changes, and git-reset ] done. Since you should know that you want to rollback the HASH code, just click on the git Can go back to reset --hard d513712892 .

Spot the PHP mySQL syntax error -

I get an error on line 50 that an unexpected ';' In my code if (mysql_num_rows ($ result) & gt; {mysqli_query ($ con, "UPDATE COOL_USERS SET COUNT = COUNT + 1 WHERE USERNAME = '" .mysql_real_escape_string ($ user) "." } The line is WHERE USERNAME ... line can anyone see it? {Mysqli_query ($ con, "UPDATE COOL_USERS SET COUNT = COUNT + 1 WHERE USERNAME = '" .mysql_real_escape_string ($ user). "'"); }

How to detect which submit button is clicked in a web form using jquery -

यदि मेरे पास एक फार्म पर 2 सबमिट बटन हैं: & lt; input name = " सबमिट करें "प्रकार =" सबमिट करें "मान =" बटन 1 "& gt; & Lt; इनपुट नाम = "सबमिट करें" प्रकार = "सबमिट करें" मान = "बटन 2" & gt; मेरे पास यह jquery है लेकिन हर बार मैं बटन पर क्लिक करता हूं 2 मुझे बटन 1 के लिए चेतावनी मिलती है। $ ('form.profile')। सबमिट करें (फ़ंक्शन () (यदि ($ ("इनपुट [प्रकार = सबमिट करें]")। Val () == 'बटन 1') {चेतावनी ('आपने बटन 1 पर क्लिक किया था); वापस लौटा;} elseif ($ ("इनपुट [प्रकार = सबमिट करें] ")। Val () == 'बटन 2') {चेतावनी ('आपने बटन 2 पर क्लिक किया था); वापसी वापस;}}); फ़ॉर्म को सर्वर से भेजा जाने से पहले मुझे फॉर्म सत्यापन करने की आवश्यकता है और मुझे यह निर्धारित करने में सक्षम होना चाहिए कि 2 बटनों में से किस पर क्लिक किया गया था। क्या यह संभव है कि यह पहचानने के लिए कि 2 बटनों में से किसके कारण जेक्यूआर का इस्तेमाल किया जा सकता है? क्या यह मदद क...

How to write a whole string to a file in Python and where does the file go? -

I am making an assignment on text formatting and alignment (wrapping text) and I have to type my formatted string in a new file . But once I have written the file (or think I have written) where does that file go? Is it really making a file on my desktop or am I stupid? This is my code: txtFile = open ("Output.txt", "w") TxtFile.write (string) txtFile.close () return txtFile Cheers, jt your In the working directory, a text is written in a file named "output.txt" (which is usually the directory in which the script is executed). To display the work directory, you can use it: & gt; & Gt; & Gt; Import OS & gt; & Gt; & Gt; Os.getcwd () '/ home / adam'

ios - Maximum Iphone Application size that apple store allows -

इस सवाल का पहले से ही एक उत्तर है: 7 जवाब क्या है अधिकतम एप्लिकेशन आकार जो कि सेब स्टोर एक आईफोन एप्लिकेशन या गेम के लिए अनुमति देता है। 2 जीबी का है अधिकतम आकार अपने आईओएस एप हो सकता है जांचें

xml - Shifting row data in xsl 1.0 -

After I have multiple rows of data in my XML like this - I have to display my output in the image, as if this row data works in each loop. And the requirement is that ROW TYPE = "TOTAL" id = "1" should first be displayed with its ROW TYPE = "SPECIFICATION" data then moving forward in the loop, line type = "total" id = "2" first to be displayed So its line type = "specification" data Basically it should come in this way -. Code1 English 1 Mathematics 1 Code 2 English 2 Math 2 For the XSLT code sequence -2 works for ech loop functions. But I need to move the first row for that ID, suggest the argument for it. this change : Lt; Xsl: stylesheet version = "1.0" xmlns: xsl = "http://www.w3.org/1999/XSL/Transform" & gt; & Lt; Xsl: output omit-xml-declaration = "yes" indent = "yes" /> & Lt; Xsl: strip-space element = "*" /> & Lt; Xsl: key...

javascript - Jquery get class name -

OK, then resolves my problem. I have a PHP file running that pulls my menus apart and Also all the content also So for example my index.php load index.php menu.php and loading a dropdown.js file. The menu is working and drops down. My problem is that I want to call a cloud of navigation and would like to list the names "li & gt; a and id; id" which will be home, about us, etc. I have many different Try it in ways that understand why I can not understand a simple script to do this in JPE. Anyone have any suggestions? Below is my code for the menu page. This is my code which I was just trying to do for a warning that would not work. // Navigation $ ("a.navigation"). Click (function () {warning ("hello");}); Finally, find out what code worked, if someone has this problem then I use it here. Thanks to everyone who helped !!! // Navigation $ (document) .ready (function () {$ ("a.navigation"). Click (function () {warning (...

jquery - Change background on scroll -

How do I make background-color changes while scrolling, not particularly based on the top, but the base of the div Background on I do not know if you understand, but here is an example of what I want to do here like this site:. $ (document) .scroll (function () {$ ('body'). CSS ('background-color', '# 9966' + ($ (this) .scrollTop () / 10))}); OR $ (window) .scroll (function () {$ ('body'). CSS (' Background-color ',' # 9966 '+ ($ (this) .scrollTop () / 10));});

java - Android - Lockdown All Other Apps -

I am currently creating that app for which you have to specify the amount of time to lockdown in that app the wanted. Basically, it disables all other functions (notifications, home, back, long press, etc.) for the amount of time determined by the user, I believe it is called kiosk mode. Is it possible to do this by using Android SDK? If so, how can this be achieved? Thank you in advance, ~ Pkmmte Xeleon Yes, you can do this Unfortunately SDK will not provide much help, so you have to go with manual tweaking. In the background, a service would be killing all running processes except your app. You can disable the Home key. I do not remember the exact method name, so search for it. To disable the override key back () / on backpress ().

asp.net - Base64 string and Image -

When I use the image database for my ASP.NET web application, I found two ways! The first method is using the "image" data type, the second image converts the base 64 string into it and stored in "byte" data type. I want to know which method is better in the process and why? The type is deprecated so there is no substitute in the SQL server byte is not type, there is a type that is said to be equal to a byte type but I'm pretty sure what you are asking is not it. Then this is your real question, correct of incorrect terminology: When I use the image database for my ASP.NET Web application I do, I got two ways! The first method is using the data type, the second image converts the base 64 string into it and stores it in the data type. The encoding adds significant size to the binary data, it converts 3 octets into 4 octets, so it adds 33% overhead to the real estate consumed in your storage (this is the database or File). However will...

objective c - making ccsprites from an array of strings -

I have made a method that mails the Storm object to each member in an ARM. I want to add sprites to each member of matching bArray with their respective string as images, how can I do this? + (NSArray *) name {static NSMutableArray * _names = nil; Static transmissions_access_one talk; Send_conce (& amp; one time token, ^ {_names = [NSMutableArray arrayWithCapacity: 20]; [_names insertObject: @ "image1.png" index: image1]; [_names insertObject: @ "image2.png" atIndex: image2]; [_names insertObject: @ "Image3.png" at index: image 3]; [_names insertObject: @ "image4.png" atIndex: image4]; [_names insertObject: @ "image5.png" at index: image5]; [_names InsertObject: @ "image6 PNG" index: image 6]; ....)}; _Name back; } - (zero) Phantom group {NSArray * sgArray; SgArray = [[spManager name] Objects endindex: [NSIINXSet indexSetWithindexchange: NSMKrange (0, 3)]]; CCSprite * groupSprite = [CCSprite spriteWithFile: [sgArray...

PHP: Persist form data across redirect -

I have an existing website that has many references to it. We want to apply https to pages, so I added a simple code snippet: if ($ _ SERVER ["HTTPS"]! = "At") {dead (header (" Location: Https: // ". $ _SERVER [" HTTP_HOST "]. $ _SERVER [" REQUEST_URI "])); Go out(); // To make sure that the script prevents here, in the case of the bus) This works, except that many files have self-referenced forms with HTML in action. For example, on page.php: & lt; Form action = "http://domain.com/page.php" method = "post" & gt; & Lt; Input type = "text" name = "sample" /> & Lt; Input type = "submit" value = "next" /> & Lt; / Form & gt; Do I have any way to apply this redirect snippet without breaking all these forms? No, You can not be redirected only because you are submitting unsafe content in any way, since redirects to https will be mea...

c# - Dynamic Div creation asp.net -

I'm trying to dynamically create div on the bilateral button click. For this, I link it to & gt; & Gt; and the code was formatted as follows on the server side (.cps page) & gt; & Gt; public fixed int i = 0; Protected Zero Button 1_Click (Object Sender, EventArgs e) {i ++; HtmlGenericControl newControl = New HtmlGenericControl ("div"); NewControl.ID = "newcroll" + i; NewControl.InnerHtml = "This is a dynamically created HTML server control."; PlaceHolder1.Controls.Add (newControl); } This code was giving me one division every time when I pressed the button, I wanted to be apart of divs. I tried using Javascript on the client & gt; & Gt; & lt; Body & gt; & Lt; Form id = "form1" runat = "server" & gt; & Lt; Div & gt; & Lt; ASP: Button ID = "Button 1" Runat = "Server" OnClick = "Button 1" link "Text =" Button "On-clientCl...

asp.net - Pointer on google map -

I need to display an address at one click of a button, for which I got the latitude and longitude of the desired location In this way, While mapping in the URL https://maps.google.com/?ll=28.64036031970850,77.24250191970849 I do not get the issue pointers on Google Maps, like we get a red pointer. I would appreciate any help. Try it out as per your requirement Change the lat / long.

iphone - Want calendar to be responder of UITextView -

Image
I am creating an app in that app in which I am displaying a date in the UITSweetWives. And that text should be chosen from UIDActicker, but instead of the UIDTipiker I want to display the calendar when the user starts editing the text view and selects the date from the calendar and that date will be shown in the textview. How can I do that? Is apple allowed? The code will be better. You can use and link to the display popover calendar, it will display the calendar in this way: And this:

java - Floyd Warshall Algorithm for Shortest Path -

I was looking through some old competition questions, and I found this one, it looked fun, Trying to use Warshal algorithm to get the least path from any node to any node, can you see what I did wrong? This contest does not give the desired output set on the question page import java.io. *; Import java.util. *; Public class distance throws fileNotFoundException (scanner S = new scanner) (new file ("DATA5.txt")); Net N = integer. ; Int [] [] for dist = new int [60] [60]; for (int y = 0; y & lt; 60; ++ y) (int x = 0; x & lt; 60; + + X) dist [y] [x] = 10000000; map & lt; character, integer & gt; map = new tree mark & ​​lt; character, integer & gt; (); for (int i = 0; i & lt ; N; ++ i) {string text [] = s.nextLine (). Partition (""); int c = 0; if (! Map.contai NsKey (text [0] .charAt (0)) {map.put (text [0] .charAt (0), c); c ++;} if (! Map.containsKey (text [0] .charAt ( 1))) {map.put (text [0] .charAt (1), c); c ++;} Dist [map.get (...

javascript - jquery validation position in form -

I have a text box and have been validated to use jquery but verification errors are next to the text box Is being displayed. How to align the verification error to appear in a specific place. If you use the jquery validate plugin, just add this code $ ("element") Validate ({errorLabelContainer: $ ("element"), Error class: ".class"});

batch file - Getting ip adress on win 7 and XP -

I need a batch file to detect that the IP address is empty or unavailable. Sometimes the batch file will run on Windows 7 and occasionally on Windows XP. So I need this kind of output. If missing or not empty "Your IP% ip%, everything is OK If missing or empty" Error IP not found " connection-specific DNS suffix .: Dxtnxx.naits.local IP address; ...:: 11.73.11.111 subnet mask: 255.255.254.0 IP address: ... ...: fe80 :: 21b: 77ff: Fake 3: F5 9% 5 Default gateway ... ...: 10.11.11.1 Try it: @echo off & setlocal / F" tokens = 2delims = [] "%% ('Ping-N1 -4% Computam% ^ | Search / I "% computername% ') set" ip = %% a "if"% ip% " == "127.0.0.1" set "ip =" If not defined IP (resonance error IP not found) other echo. Your IP is% ip%, everything is OK Endlocal

php - Set Parameter with TableGateway Select Function show error undefined variable -

I am creating a function in my model: public function getAllMenuByOnlyActionPage ($ actionlot) ) {$ Act = Trim ($ Action Lot); $ (Result ('position! =?' & Gt; 13)) - & gt; Where (array ('action' => $ act)) - & gt; Order ('id asc');}); $ Result = array (); Foreign Currency ($ result as $ line) {$ result [] = $ line; } Returns $ results; } When I try to execute, its show me the notice: undefined variable: act . I already see this link but I want to set parameters for this function. Thanks Try $ result = $ this- & gt; ; Table Gateway - & gt; Select (Select function $) Usage ($ Act) {$ select- & gt; where (array ('position! =?' = & Gt; 13)) -> where (array ('action' = & Gt; $ Act)) - & gt; Order ('ID ASC');});

python - How to apply custom column order to pandas boxplot? -

I can get a box plot of pay column in the penda dataframe ... Train.boxplot (column = 'predictionError', = 'range', sym = '') ... but I can not understand how the index- Define the order on the 'Category' column - I want to place my own custom order according to another criteria: category_order_by_mean_salary = train.groupby ('category') ['salary' ]. Meaning () Order () Key () How do I apply my custom column order to the boxplot column? (In addition to defaming column names with the prefix to emphasize the organization) 'Category' is a string column that has 27 specific values: ['Accounting & amp; Finance jobs', 'administration jobs', ...,' travel jobs'] . Therefore it can be easily focused on pd.Categorical.from_array () , pandas.tools.plotting.py: Boxplot () , which changes the column object without the permission to order: a passthrough which instantiates ... which ...

How to have 2 controller methods with same name in Asp.net MVC4 -

क्या समान नाम के साथ 2 नियंत्रक विधियां संभव हैं? आप नियंत्रक विधियों का जिक्र कर रहे हैं जो मुझे भ्रमित करता है कि आप किस बारे में बात कर रहे हैं यह सी # वर्ग तरीकों या नियंत्रक कार्यों है? मुझे दोनों का जवाब दें। शुद्ध सी # की अनुमति नहीं है सी # में समान हस्ताक्षर के साथ दो विधियां संभव नहीं हैं। इसका अर्थ समान नाम और समान प्रकार के मानकों की संख्या है। सार्वजनिक इंट गणना (int a, int b) {...} सार्वजनिक int गणना (int first, int second) {। ..} // कंपाइलर त्रुटि लेकिन asp.net mvc नियंत्रक कार्रवाई की अनुमति यदि आप asp.net MVC नियंत्रक कार्यों के बारे में बात कर रहे हैं, यह निश्चित रूप से है मुमकिन। जो कुछ भी आपके लिए आवश्यक है उसे पूरा करने के लिए ActionName विशेषता का उपयोग करें: सार्वजनिक कार्यवाही आम () {...} [ActionName ("आम")] सार्वजनिक कार्यवाही आम आम () { ...} // सी # हस्ताक्षर अलग करता है लेकिन कार्रवाई निमंत्रक के लिए इनमें से किसी एक पर कोई अन्य विधि चयनकर्ता विशेषता होना चाहिए, यह जानने के लिए कि जब अनुरोध कब आता है .. जैसे कि आप 404 रन...

performance - Which of these C "MAX" macros would be best? -

I see two possible implementations for the maximum macro in C. Which of these would be best? define MAX (X, Y) ((x) & lt; (y) ?: (y): (x)) Define MAX (X, Y) 0.5 * (X + Y + ABS (XY)) The second is hard to read, and really broken is actually a bad idea. Second, always uses doubles. You will get round errors, I definitely do not expect to get a result which is not equal to either side. When applied to the whole, Floats is also promoted as double. If you "correct" it instead of "0.5" / 2, then those other types would "work", but you get an unexpected overflow on a large integer I also recommend works, not macros, so the argument is not evaluated twice. Sometimes there are situations where such difficult versions are suitable, for example, the calculation of the maximum two integers in constant time but they are rare, and of course MAX should not be used as a default implementation.

java - GWT DOM not working -

मैं अंदर div & lt; TH & gt; GWT तत्व tr = DOM.createTR (); DOM.appendChild (thead, tr); (इंट इंडेक्स = 0; इंडेक्स & lt; हेडर्स.size (); इंडेक्स ++) के लिए {एलिमेंट थ = डीओएम.क्रेतेथ (); तत्व div = DOM.createDiv (); DOM.appendChild (वें, div); // यह काम नहीं कर रहा है ! DOM.appendChild (tr, th); } क्या मेरे कोड में कोई भी गलत है? मैं मान लें कि यह आपको समय त्रुटि संकलित करेगा क्योंकि विधि `DOM.appendChild (वें, div); ' दूसरा पैरामीटर पैकेज संरचना का हिस्सा होना चाहिए: com.google.gwt.user.client.Element के बजाय com.google.gwt.dom.client.Element

javascript - Can't remove double quotes from image path after JSON.stringify -

Image
I have a JSO file that has a file path for an image. I am trying to change the source ARTR of an image tag using jQuery, but no matter what I do, as long as I try to change the source, the path to the quotation marks around the file path Finishing encoding is finished and thus fails I have tried: decodeURIcomponent regex Neither worked, but I And more > getPics: function () {$ .ajax ({{type: 'GET', url: this.BASE_URL + 'js / image1.js', data type: "json ", Success: function (data) {var pic = data.images.image [0] .image_one; console.log (pic); setTimeout (function () {var image = JSON.stringify (pic); image = image $ ('^' ("[^ (\") "] +) \": / G, "$ 1:"); Console.log (image); $ ('# pic1 img'). Attr ("src" , Image);}, 5000);}}); } This part of the problem is here: setTimeout (function () {var image = JSON.stringify (pic); image = image $ ( Attr ("src", "$": ...

android - Opening a Web View -

I have an image button, when clicked, opens a new activity with the web view. The web view will display some custom HTML. When I click the button the web view does not show anything. This is the code for my button view: - Public Zero GoToContact (see view) {WebView webView; SetContentView (R.layout.webview); Webview = (webview) Find VVBIID (RIDMMView); WebView.getSettings () setJavaScriptEnabled (true). String custom HTML = " gt; gt; & lt; h1 & gt; Hello, webview & lt; / h1 & gt; & lt; / body & gt; & lt; / html & Gt; "; WebView.loadData (customHtml, "text / html", "UTF-8"); } This is my web view layout: - Android: Lineline Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: Orientation = "Horizontal" & gt; & Lt; Android: layout_height = "60dp" Android: Content Circles = "@String": Android: id = "@ + id / GoToHom...

java - synchronizing current database entries with new data to insert -

I have to synchronize the data in my database table with the new data from the SQL query, where I will have to delete the current entries Not in new data and insert new entries that are not in current data. I was able to do this in Java using this pseudo code: // 1) Get all the data in the database and enter it in the list (currentList) // 2) SQL Synchronize both lists for the finalList.add (entry)} (if.FinalList) (list: currentList) {if (newList.contains (entry)) for the new data received through the entry (entry: newList) Entry (Entry)} / 4) Delete all data from DB / 5) Last Insert Enter a list for DB This works fine, although I think it will be a matter of performance when working with a large set of data because I can add new entries and new data Instead of removing the missing entries, I am restoring the entire list and adding the full list again. Do you suggest a better way of doing this? Is it possible to create a SQL query that can take care of the synchronization o...

osx - Grunt fails trying to load an empty module -

I am stuck together with my Jenkins setup at OSX Lion 10.7.3. To use a gaskin test, use a grunt in my webpage, make less, create cash manifolds and more. Everything works on my laptop lion 10.7.5, but server box grants fails periodically with the following error: $ grunt less module.js: throwing 340; ^ Error: Can not find 'module on function' Module._resoloveFilename (module.js: 338: 15) on function. Module ._load (module .js: 280: 25) requires the .quare (module .js: 362: 17) module (module .js: 378: 17) in the hair process. & Lt; Anonymous & gt; (/ Usr / local / lib / node_modules / grunt-cli / bin / grunt: 44: 3) at ChildProcess.EventEmitter.emit (events.js: 99: 17) at process._handle.onexit (child_process.js: 678: 10) It is intermittent, it fails once in about five runs and the work is not specific. This fails at the same rate when the hardest manifest or grunt test goes. Once I see that it works, when it starts, it takes one to two or so, but when it ...

Does CouchBase (2.0.1) supports windows 32 bits? -

The page does not have a Windows build for the latest version - 2.0.1. Version 2.0.0 is the installation of Windows 64 bits. I did not support Windows 32 bits since 2.0.0 and was thinking about the causes of Windows since 2.0.1. Is it that they do not provide binaries, but can anyone make it for Windows 32 bits too? Or is there a deeper reason, such as using unavailable APIs for Windows 32 bits .0) or unavailable to all (2.0.1)? I'm asking because I'm considering building 32 and 64 bit on Windows, but it should be ensured that the effort is not wasted from failure to beginning. We know very well about the situation. The plan is to release 2.0.1 for 64bit soon. There are some delays to make our windows and to ensure that the higher the quality is as high as possible. So expect 2.0.1bit 64bit soon. He said, I do not think we have a ready version of 2.0.x 32 bit. What we are currently doing is a 32 bit build, which people can use to develop against it, but use i...

semantics - RDF Data for online NEWS sites -

I want to get a list of major news sites in different languages. Is there a provider that provides major website details in the RDF format? DBipedia has information from Wikipedia, and there is a SPARQL closing point, there are some relevant categories in Wikipedia, which That can help you find the type of information you are looking for. For example, we can select individual news sites and get 302 results: SELECT * WHERE {? NewsSite dcterms: subject category: News_websites} There is a bit more difficult to obtain other piece of information reliably, because some information is not available for any page For example, some of these pages have their news site DBProp: Web SELECT * WHERE {newsseite dcterms: subject category: news_websites record with. Alternative {? NewsSite dbpprop: web? Web}} use the other dbpprop: website . You can call dbpprop: web to dbpprop: web | With the dbpprop: website , you can switch to the previous query, however this dBipedia mo...

random genaration of image from drawable folder in android -

Android version: 4.2 I'm developing Android app. I need to create a picture randomly from the drawable folder. In my picture, I have 45 images, which are different names. My XML code: Android: Image = "@ + ID / Image View 1" Android: layout_width = "wrap-content" Android: layout_height = "wrap_content" /> I have tried with this code: ImageView img = (ImageView) findViewById (R.id.imageView1); Random rand = new random (); Int rndInt = rand.nextInt (52) + 1; String Drawable name = "photo" + rndInt; Int resID = getResources (). GetIdentifier (drawableName, "drawable", getPackageName ()); Img.setImageResource (Resid); But with this code I have to change my image names to photo1 , photo2 and I do not want to do this for. Any suggestions about applying it? Thank you. One way to create an array with the required image ID and take random one from that array That approach is explained in the other answer. Ano...

how to select a value in combo boxes with geb groovy -

I tried to select a value outside the combo box through groovy (geb). The HTML code is: & lt; Id = "entity-list-form: status search button" name = "entity-list-form: status search button" size = "1" style = "width: 200px;" & gt; & Lt; Option value = "" & gt; LAL & lt; / Options & gt; & Lt; Option value = "registered" selected = "selected" & gt; Wartet auf Bestätigung & lt; / Option & gt; & Lt; Option value = "Rejected" & gt; Registered Zur ¼qquininen & lt; / Options & gt; & Lt; Option value = "Approved" & gt; Regarding angle & lt; / Options & gt; & Lt; Option value = "UNSUBSCRIBED" & gt; Abgemeldet & lt; / Options & gt; & Lt; / Select & gt; I have tried to use these elements through $ ("entity-list-form"). StatusSearchBtn = "alle" or $ ("entity-list...

jsp - Google line chart x-axis shrinks on transition -

I am using a Google line chart on my page, which refreshes every 5 seconds but weird thing It is that every refresh chart causes the line to be removed, although the size of the chart remains the same. My script - google.load ('visualization', '1', {package: ['corechart']}); Google.setOnLoadCallback (drawLine); // call clickChart when the google.load () function meets the drawLine () {var gaugeData = new google.visualization.DataTable (); GaugeData.addColumn ('string', 'time'); // X-axis gazeta.dk column ('number', 'memory'); // Y-axis gazedata.edc column ('number', 'cpu'); // Y-axis square gauge option = {title: 'system description'}; // tile of var gauge chart; Var tempArray; // store json object value from server var tempArray2; // Server gauge = Modify the json object value = new google.visualization.LineChart (document.getElementById ('line_chart_div')); SetInterval (function () {$ aja...

declaration - MIPS - loading individual bits -

Peer SO user, If I have a value, then 1010 is saved in memory, How do I load each of the bits starting with the LSB one at a time from MSB? By this I mean, while the number of loop load $ 1 T1 with 1 pipes loads with a value of $ 1 t1 (1) from the amount indicated by $ 1 Is there some number in the number of 0 signal numbers, from the value in the value of $ T1 (0), unless you do not load the LSB, at MSB (right?) And loop This value is the .data segment in memory first. Do I declare it like this: Value: Byte 00001010 And how do I load individual bits in the registers? You can call it SLT You can do this with instructions. Here's some pseudo: lbu $ s0, value # load byte slal $ s0, $ s0, 24 # move it to the upper byte of $ s0 (i = 0; i & lt; 8; I ++) {# $ t0 is set to 1, if signature bit of $ s0 (i.e. bitt 31) slt $ t, $ s, $ zero # $ t is set, now value Keeps the value of ith bit. . . # $ TLL $ s0, $ s0, change it to the next bit with # 1 In t...

Tomcat servlet mapping error 404 -

इस सवाल का पहले से ही एक उत्तर है: 1 उत्तर क्षमा करें अगर यह एक सामान्य है सवाल है, लेकिन मैं पागल हो रहा हूँ मैं जेएसपी विकास के साथ शुरू कर रहा हूं, उबंटू सर्वर पर टॉमकेट का इस्तेमाल कर रहा हूं मेरे पास सर्वर पर निम्न सामग्री है: वेबएप डायरेक्टरी है: / var / lib / tomcat6 / webapps / में webapps मैंने संदर्भ-रूट बना दिया है हैलो / निर्देशिका हैलो / इसमें index.html और वेब-आईएनएफ / वेब-आईएनएफ इसमें web.xml और classes / HelloServlet.class यह है Index.html : & lt; html & gt; & LT; बॉडी & gt; HelloServlet अनुरोध करने के लिए क्लिक करें & Lt; फ़ॉर्म एक्शन = "/ हैलो / नरकॉर्ल्ड" विधि = "मिलें" & gt; & Lt; इनपुट प्रकार = "सबमिट करें" मान = "अनुरोध" / & gt; & Lt; / प्रपत्र & gt; & Lt; / body & gt; & Lt; / html & gt; यह WEB-INF / web.xml : & lt;? Xml संस्करण = "1.0" एन्कोडिंग = " ISO-8859-1 "& gt; & Lt; web-ap...

html - Witdh div in div use 100% and have padding -

I want to insert a div in another, and that div has a padding of 10px, and this div width is 100 %. But to do this, div goes out of the parents. Example in jsFiddle here: . Caixa {float: left; Width: 100%; Background color: white; Padding: 25px; } I have another problem, I have one left to the left with a width of 150px, and there is a device to capture all the space and padding. By default, the CSS box designates the last width of the model element as its width , by default range and padding . You can remove this deceptive behavior by using box-sizing property: . Caixa {float: left; Width: 100%; Background color: white; Padding: 25px; -MOZ Box-Size: border-box; Box-size: border-box; } Read about: Browser Support:

android - How to Shrink WebView size dynamically according to its content? -

The problem can be understood from a detailed explanation because the user added the image to make it better. I am loading HTML content in my webview. There are several views in my layout and are located inside the webview scrollview (as required by layout). Please do not reply - "Do not insert webview inside scrollview" . I know that there is no good reason to keep webview in the scroll-vee, but I need to do this as per requirement. Therefore, I have left section (showing list item) and right piece (showing data shown on selection of list item from left pieces). Now, first of all, when I load the HTML content in WebView, it shows the right. After this, when I refresh the webview with the new HTML content, the problem arises. Suppose, my first HTML content is 100 lines which show correctly and then I reload the webview with my new HTML content which is 40 lines webview with 40 lines Containing content and not fitting, it is still showing up to 100 lines white / spa...

xslt - XSL Generating CSV -

इसे बदलने की कोशिश कर रहा है: & lt; list & gt; & LT; प्रविष्टि & gt; & LT; parentFeed & gt; & LT; feedurl & gt; http: //rss.nzherald.co.nz/rss/xml/nzhrsscid_000000001.xml< / feedurl & gt; & LT; आईडी & gt; 68 & lt; / आईडी & gt; & Lt; / parentFeed & gt; & Lt; content & gt; स्कूलों को सरकार द्वारा घोषित किए जाने के बाद एक और आठ हफ्तों के लिए नोवोपी के माध्यम से प्रशासित समस्याग्रस्त वेतन का सामना करना पड़ेगा, यह अस्थिर प्रणाली के साथ जारी रहेगा। नोवोपी, स्टीवन जॉइस के लिए जिम्मेदार मंत्री, देरी हुई ... & lt; / content & gt; & LT; लिंक & gt; http: //www.nzherald.co.nz/nz/news/article.cfm c_id = 1 & amp; amp; ObjectId = 10,872,300 & amp; amp; ref = आरएसएस & lt; / लिंक & gt; & Lt; title & gt; नोवपे: सरकार अस्थिर प्रणाली से चिपक जाती है & lt; / title & gt; & LT; आईडी & gt; 55,776 & lt; / आईडी & gt; & Lt; प्रकाशित वर्ग = "एसकेएल-टाइमस्टैम्प...

mysql - How to select a user from many-to-many table that is in two groups? -

I really do not need the following question, but I'm awake with this "theoretical problem" that I'm having trouble Are finding out. Say that I have three tables: a user table, group table, and user_group table which are many-to-many, so if a user comes under groups 1 and 2 then there will be two separate rows for each. Now, assuming that there are many groups, I especially users who are group 2 and both 3, for example? I tried to do something with these lines, but it was shown blank: SELECT * from 'users_groups' GROUP user_id by HAVING group_id = 2 and group_id = 3 I believe that both groups are in the same line, which will not work clearly, how will I do this? Edit: How about both forms: Where should the user be in these two groups, and the user should be at least in both of these groups? select by user_groups GROUP BY user_id WHERE group_id IN (2,3) HAVING COUNT ( 1) = 2 It surely assumes that { user_id , group_id } is unique (and ...

opengl - how to draw 3d cylinder with flat shading -

I would like to know how to draw the cylinder with flat shading. We have done so far. zero coordinator (intm major, intu ninometer, float height, float radius) {double key phase = height / number major; Double Minority Phase = 2.0 * M_PI / numMinor; Int i, j; For (i = 0; i & lt; numMajor; ++ i) (float z0 = 0.5 * height - i * majorStep; float z1 = z0 - key step; glBegin (GL_TRIANGLE_STRIP); for (j = 0; j & Lt; = numminor; ++ j) {double a = j * small phase; float x = radius * cos (a); float y = radius * sin (a); glyormal 3f (x / radius, y / radius GlTexCoord2f (j / numminor, i / nummajor); GlVertex3f (x, y, z0); GlTexCoord2f (j / numminor, (i + 1) / nummajor; GlVertex3f (x, y, z1);} Glend ();}} I understand that I know a general definition, but this general has given me a smooth shadow rather than flat I know how can I flatten it in OpenGL and GLUT? If you If you want flat cinematography, you just need to specify it. glShadeModel (GL_FLAT);

php - Yii an Memcache -

We are using memcatch for UI framework and caching. We have the following problem: We create a DB query q If q is already cached, then we get data from lacquer Otherwise yii queries MySQL Set cache value We get results from the memory If we request the same query que, then the key is not set before the set of memes (before step 4) we again query the DB. We want to change this behavior to do something like this: We create a DB query q If the key for q Memcache exists and the value is not an empty return value otherwise if the key is set and the value is set to blank memcache key = & gt; Set cache value We get results from the memory Here's the pseudocode and what we want get (q): if q not in memcache: value = query_db (q) memcache [q] = value return memcache [q] else: returm memcache [q] getNew (q): if q memcache Not in: memcache [q] = null value = query_db (q) memcache [q] = memcache and memcache in [q] elif q returns value in memcache [q]! =...

oracle10g - Retrieving a row number of a specific row from a group of rows in a table in Oracle 10g -

मेरे पास ओरेकल 10 जी में USER_ROLES नामक सारणी है। USER_ROLE_ID USER_ID AUTHORITY 28 2 ROLE_ADMIN 45 3 ROLE_USER 61 3 ROLE_ASSISTANT 27 3 ROLE_SUPERVISOR कहां USER_ID तालिका का एक विदेशी कुंजी USER_TABLE । मुझे विशिष्ट उपयोगकर्ता ( USER_ID ) से जुड़े पंक्तियों के समूह से एक विशिष्ट पंक्ति की पंक्ति संख्या जानना होगा (और इस तालिका में सभी पंक्तियों के आधार पर नहीं)। निम्न तालिका इस तालिका में सभी पंक्तियों के आधार पर दिए गए USER_ROLE_ID (28 इस मामले में) के लिए पंक्ति संख्या प्राप्त करती है। row_num से चुनें (user_role_id desc के अनुसार user_role का आदेश user_role_id desc के रूप में) user_role_id = 28 यह पंक्ति 3, में यह मामला। लेकिन पंक्तियों के एक समूह से पंक्ति संख्या को पुनः प्राप्त करने की आवश्यकता है जो केवल किसी विशिष्ट उपयोगकर्ता के साथ जुड़ा हुआ है। ऐसा होने के लिए, यदि मैं निम्न एसक्यूएल, को चुनें, पंक्ति_एनयूएम को चुनें (row_number () के ऊपर (user_role_id descending द्वारा क्रम) पंक्ति के रूप में पंक्ति_num, user_role_id से user_role का आदेश...

c++ - Convert pointer to data member to void * -

I know that I can get an indicator for a class or structure for the data member, but the following code Last line fails compiled: straight ABC {int a; Int b; Four c; }; Int main () {typedef struct abc abc; Four ABC :: * ptt1 = & amp; ABC :: C; Zero * another_ptr = (Zero *) ptt1; } Why can not I convert ptt1 to another_ptr? We are talking about pointers, so a pointer should have the same dimension as each other (though conceptually different) A Pointer is not equal to non-static class member type an object pointer type ; They behave very differently. In fact, you can not even remove an indicator with the member for * . To make a member access the member through an indicator, you can replace the * and - & gt; * use operators. If you might be put it in an object pointer type, what would happen, if you deleted it from * ? > CV T , "where T is an object type, it should be" from cv zero "can be converted into t...