Posts

Showing posts from March, 2012

c# - Using a Button Tag -

Program logic changes a button tag based on random things - but using the UI thread. Is the button tag value reliable to use in a click event? That is, will it be the same value as the event occurs at the handler, because it was at the time of the click? If not, what is the best way to pass an event specific parameter on the button, click on the event that will be safe? Update An example was added as a request. (Remember this is just theoretical). windows.form. Timer timer = new timer (); Timer Interval = 1; Timer Tick ​​+ = new event handler (timer_tick); Timer.start (); Zero timer_tick (object sender, event events e) {this.button.Tag = Random.NextInt (100). Ostring (); } Zero button_click (object sender, eventArgse E) {string s = (string) ((button) sender) .tag; Console. Light line ("tag value as push button:" + s); } Enter another way, the question has emerged: Events can be covered in the GUI event queue which pushed the position of the button and allows ...

firefox - JavaScript memory assignment -

Image
I am running on an issue where I compile values ​​and values ​​in different arrays in an object, But only the final iterations are value savings in different parts of the object. Here in the picture, I have given minimum and maximum values ​​in the console. Then I can use that value Which can be stored in my array before going into my use. Is it around Is there any way? In the second picture, these values ​​are used which ends, and it prevents me from proceeding. EDIT: Loop I am using for assignment: prefix for (var i = 0; i & lt; partition; i ++) {var Cellobject = new object (); CellObject.minX = WatchBound Minute [0] + box langam *; Cell object.mxx = quietband.mm [0] + boxlandi * i + boxlength; For {var j = 0; j & lt; partitions; j ++} {cellObject.minY = sceneBounds.min [1] + boxwidth * j; CellObject.maxY = ViewBound.man [1] + Boxwidth * J + BoxWith; (Var k = 0; k & lt; partitions; k ++) {// index index = height * width * k + width * j; Var index = pa...

c++ - Stop QListView from deleting entries on drag-drop -

मैंने एक QStringListModel के साथ एक QListView बनाया है। listModel = नया QStringListModel (ui- & gt; listView); UI- & gt; listView- & gt; setModel (listModel); UI- & gt; listView- & gt; setEditTriggers (QListView :: NoEditTriggers); UI- & gt; listView- & gt; setDragDropMode (QListView :: InternalMove); और मैं इनका उपयोग कर आइटम जोड़ता हूं: शून्य मुख्य विंडू :: addItem (QString परिणाम) {यदि (परिणाम == "") वापसी; listModel- & gt; insertRow (listModel- & gt; ROWCOUNT ()); QModelIndex a = सूचीमोडेल- & gt; सूचकांक (सूचीमोडेल- & gt; पंक्तिकाउंट () - 1); listModel- & gt; setData (एक, परिणाम); } समस्या यह है, जब आप सूची में किसी आइटम को खींचते हैं और इसे दूसरे स्थान पर स्थानांतरित करने का प्रयास करते हैं, तो वह उस आइटम को ओवर-लिखना पसंद करता है जिसे आप इसे खींचते हैं मैं ड्रैग-ड्रॉप एक्शन से कभी भी एक आइटम को हटाना नहीं चाहता। दस्तावेज़ से हम इस पर ध्यान दें कि इसमें अधिलेखित व्यवहार को नियंत्रित करने के लिए कहां है:...

node.js - passport.authenticate not working as expected -

Strange behavior, here. When I hit / login with the correct username / password combo, it actually sends me / secret passage when I use the wrong combination, then it's right back to my right where I started Had redirection there. However, if I try to "lock down" a route, say: app.get ('/ mySecretRoute', passport.authenticate ( 'Local'), function (Rick, race, next) {res.json ({test: "secret"}}}; Then I have a 401: unauthorized if I try to hit it after entering, it seems that a cookie is actually set, but probably is not correct. I have verified that the user is in the local strategy Has come, and this serialization captures the right user. How can I configure the passport correctly and lock the routes to use the local strategy? I have seen through the medium and it seems that I am following the instructions. / / all environment app.set ('port', process.env.port || 3000); App .set ('idea', path .jound (__deirna...

hover - jQuery only works when clicked F12 to activate developer mode -

I'm using a jquery for the direction awakening hover effect to sleephunter.js. When the page loads, the hover effect only works when F12 is clicked or the element is identified in Chrome and IE10. Once the developer mode is activated or the active developer mode has already shut down, this page starts working until it reloads. I am using several jquery plugins as the following. & lt; Script src = "js / jquery-1.11.0.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / jquery.sliphover.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / superfish.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "js / jquery.mmenu.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / jquery.singlePageNav.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "js / modernizr.min.js" & gt; & Lt; /...

amazon s3 - create a temp image file for upload -

I have created an HTML5 image uploader using the canvas. I have image data Canvas.toDataURL (); Which data: image / png; Base64, & lt; Base64image string & gt; I have sent the above data to php which will be used to upload an image to the Amazon server. I usually file_get_contents (path_to_file_to_upload); Amazon SDK is used to work and how can I now convert the code to file file_get_contents for uploading base 64 image data file. I do not have permission to create a file in the server. Create a temp image and get file_get_contents data from that temp file ?? Pass the return value of base64_decode () instead of file_get_contents in the AWS SDK.

database - Bigcouch Clustering not Working -

I'm new to bigcouch. I have successfully saturated on two different systems which are working perfectly well. In the first big coach, I have some DBS which I want to repeat on another big coach. And I copied all shoulders from big coach to second to first. And then I used the clustering command to make them cluster. Curl-X PUT db01.yourhostname.com:5986/nodes/bigcouch@db02.yourhostname.com -d {} gives its success The result. But when I try to create a new database it gives an internal breakdown error. My first question, is this a good way to clustering after shards from one to the other. I am not sure it is the right way to do this. So someone can tell me how to do this successfully or I am missing something. Thank you. Check that the two servers know each other about each other by visiting the following. curl 127.0.0.1: 884 / _membership if it looks ok to properly ensure that it is able to be resolvable Try pinging from one to the other using Bigcouch ta...

no output file generated when using Ghostscript to convert PDF to TIFF -

यहां कमांड है जिसका उपयोग मैं करता हूं: जीएस -आर 300 -q -dNOPAUSE -sDevice = Tiffgray -sOutputFile = sample1.tiff sample1.pdf -c छोड़ दिया मैं अपने वर्तमान कार्य निर्देशिका में sample1.tiff नहीं देखता। मैं ओएस मावेरिक्स चला रहा हूं। बिना- b को चलाने का प्रयास करें ताकि संदेशों को दबाया न जाए, घोस्टस्क्रिप्ट संभवत: आपको यह बताने की कोशिश कर रहा है कि क्या गलत है।

javascript - passing @ symbol to mailto field, or how to bypass URL encoding in google-app-script -

I'm trying to specify the mallet link in an HTML template for a Google app script. Unfortunately, the link & lt; A href = "mailto: foo@bar.com" & gt; to & lt; A href = "mailto: foo% 40bar.com" & gt; Has been converted to. Because processing involves how will I return the correct mailto link? At most when I return HTML via call: function doGet (request) {return HtmlService.createHtmlOutput ('& lt; a href = "foo@bar.com" & Gt; mail me & lt; / a & gt; '); } Returned HTML: I do not have much experience with Google Apps Script, but if I say the following: Force-printing screenplate, which is the syntax & Lt;?! = ...? & Gt; , these are just like print scriptlets, they avoid avoidable context. Contemporary skipping is important if your script allows unreliable user input. By contrast, you will need to force-print if your Scriptlet's output intentionally is HTML or the scri...

Autocomplete up-down key navigation in JqGrid -

I found JqGrid with modified cell edit (full-up-down-left-right cell navigation). Here is the fragment of jqgrid.src: if (e.keycode === 37) {if (! $ T.grid.hDiv.loading) {{ $ ($ T) .jqGrid ("PRECEL", IRO, ICL);} // left} and {return false; }} If (e.keycode === 39) {if (! $ T.grid.hDiv.loading) {{$ ($ t) .jqGrid ("Next cell", IROO, IOCL);} right-right} and { return false; }} If (e.keycode === 38) {if (! $ T.grid.hDiv.loading) {{$ ($ t) .jqGrid ("prevro", iRow, iCol);} // above} else { return false; }} If (e.ccode === 40) {if (! $ T.grid.hDiv.loading) {{$ ($ t) .jqGrid ("nextRow", iRow, iCol);} // below} and { return false; }} and other next cell: function (iRow, iCol) {return.Each (function () {var $ t = this, nCol = Incorrect, i; if (! $ T.grid || $ tpcellEdit! == true) {return;} // Try to find the next editable cell (i = iCol + 1; i = 0; i--) tries to search for {if ($ tpcol model [i]. Correct == = True) {NCol = i; break;}} if (n...

java ee - How to know the j2ee version? -

हमारे पास यूएटी सर्वर है uat.wfgls.com/vtpOnline हम Jboss5 GA अनुप्रयोग सर्वर का प्रयोग कर रहे हैं । अब समस्या यह है कि क्लाइंट कह रहा है कि जेडीके हम 1.6 का उपयोग कर रहे हैं, लेकिन जेएसआई संस्करण 1.4 है। क्या कोई मुझे इन बिंदुओं पर मदद कर सकता है: 1 - हम जे 2 संस्करण को परिभाषित करते हैं? 2 - कैसे किसी भी चल रहे आवेदन के J2EE संस्करण की जांच करने के लिए? आप jboss प्रलेखन में जांच सकते हैं जो j2ee का संस्करण विशिष्ट कंटेनर का उपयोग करता है (जैसे jboss5 ga अनुप्रयोग सर्वर)। J2ee घटक संस्करण का कुछ हिस्सा और जावा संस्करण भी आप गुणों में जांच कर सकते हैं - & gt; परियोजना पहलुओं हो सकता है कि आपको सिर्फ अपने jboss दोपहर के भोजन की दोबारा कॉन्फ़िगरेशन की आवश्यकता हो। उदाहरण के लिए अलग-अलग जेडीके स्थान सेट करें।

php - Change Base link of website using .htaccess file -

The .htaccess file can be edited. Will change the base address of the site for all links on the home page? Scenarios : My OSClass hosted on the relation cloud with the URL. After adding the alias to the server side, I am using www.mydomain. Com with forwarding masking feature Everything is fine for home page everywhere. But when users click on any link on the website, instead of www.mydomain.com, the changes to the broiler URL field instead of www.mydoamin.com/link.but, instead of the user, type www.mydomain.com/link It works and this browser URL is not changing. Hover also does not show on the link www.mydomain.com/link I also try to edit the config.php file define ('WEB_PATH', 'http: // www .mydomain.com / '); But it is not working. It can get my issue with editing. Trying to open an HTCX file with minimal effect or any other way before the custom domain for the oscillas? WordPress and Oscaloes are very similar in architecture. Does WordPress users have s...

The best way to call optional method in PHP? -

How better it will be, Check the existence of the method of getting started: square fu times {public function __ composition () {. . If (is_callable ([$ obj, 'myMethod'])) {$ obj- & gt; MyMethod (); }. . }} or b. Parent class has an empty method class bar {secure function myMethod () {}} class foo bar {public function __ composition () {. . . $ Obj- & gt; MyMethod (); . . . }} You never have to guess that an object is a method or not . You need to know whether the method is based on the type of object or not. You should either want its type, in general, you should have a sensible class hierarchy and need the right type in the appropriate places: function foo MyType $ bar ) {...} This function requires an object of class MyType , and you know that MyType and so on can not do. So there is no need to check anything. However, in some circumstances you may have to manually check, in which case instanceof : if ($ foo instanceof MyType)...

ios - AFNetworking 2.0 update on an existing project -

I recently updated my project to AFNetworking 2.0 and it seems that the AFHTTPClient file is missing. I read the following: It seems that I must now use AFHTTPRequestOperation? If so, how can I modify the following code? New AFHTTPRequestOperation? NSURL * url = [NSURL URLWithString: WEB_SERVICE_BASE_URL]; AFHTTP Client * Client = [[FHTP Client Elok] Init Withbase: URL]; [Client Register HTTP Operation Class: [AFJSONQuest Operation Class]]; [Client set default header: @ "Accept" value: @ "Application / Jason"]; [Customer postPath: LOGIN_PATH parameter: [NSDictionary dictionaryWithObjectsAndKeys: self.userNameOrEmail.text, @ "userNameOrEmail", self.password.text, @ "password", zero] Success: ^ (AFHTTPRequestOperation * operation, ID responseObject) {bool success = [[Response object valuecapcap: @ "success"] Bull Valley]; NSString * displayMessage = [responseObject valueForKeyPath: @ "displaymessage"]; If (success) {NSU...

inheritance - Passing enum types as parameters in java -

मेरे पास दो प्रकार के enums हैं: सार्वजनिक स्थिर enum Type1 {T1_A, T1_B} और सार्वजनिक स्थिर enum type2 {T2_A, T3_B} मैं लिखने में सक्षम होना चाहता हूँ एपीआई जो इनमें से किसी भी एंमान ( Type1 या Type2 ) पैरामीटर के रूप में ले सकता है और उनके साथ कुछ कर सकता है शून्य मज़ा (? टाइप 1_ओर_ टाइप 2) {/ / कुछ यहाँ जाता है ...} आप बिना किसी तरीके के एक मार्कर इंटरफ़ेस बना सकते हैं इसमें और enums उस अंतरफलक को लागू करने दें। इसके बाद, अपनी पद्धति पर पैरामीटर प्रकार के रूप में इंटरफ़ेस का उपयोग करें।

PHP json object -

यह मेरी json फ़ाइल है: $ json = '{"mainmenu": [ {"शीर्षक": "मुख्य मेनू 1", "url": "कुछ यूआरएल"}, {"शीर्षक": "मुख्य मेनू 2", "url": "कुछ url2"}], "सबमेनू": {"मेरा सबमेनू 1 ": [{" शीर्षक ":" उप मेनू शीर्षक "," यूआरएल ":" कुछ यूआरएल "}, {" शीर्षक ":" उप मेनू शीर्षक "," यूआरएल ":" कुछ यूआरएल "}]," दूसरा सबमेनू ": [" शीर्षक ":" उप मेनू शीर्षक "," यूआरएल ":" कुछ यूआरएल "}, {" शीर्षक ":" उप मेनू शीर्षक "," यूआरएल ":" कुछ यूआरएल "}, {" शीर्षक " : "उप मेनू शीर्षक", "url": "कुछ यूआरएल"}]}} '; मैं इसके साथ मुख्य मेन्यू की संख्या ढूंढने में सक्षम हूं: & lt;? Php $ data = json_decode ($ json); गूंज sizeof ($ डेटा- & gt; मुख्य मेनू); लेकिन मैं सबमेनू की ...

How to get the content of the "Favorites" folder for any OS, if it has any, in Java? -

Image
I have a cross-platform Java application and give me OS favorite for the folder, if there is any. How can I get this property in Java ? Downvote, here's what I mean: Windows File Explorer Favorites: Mac OS File Explorer Favorites: Windows Explorer to Favorites HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ User Shell Folders \ Favorites . is stored in the registry, Apple Finder is stored in the preferred file ~ / library / preferences / com.apple.sidebarlists.plist . Note: This file can be in XML or Binary format based on OS version (10.0-10.4 uses XML, 10.4 has introduced binary format, 10.7 allows JSON ). There is no easy way to access these resources in Java.

maximum size of array in c -

इस सवाल का पहले से ही एक उत्तर है: 7 जवाब अधिकतम सरणी क्यों बदलता है स्थानीय घोषणा और वैश्विक घोषणा से? मैंने कुछ ब्लॉग में पढ़ा है कि अधिकतम आकार के सरणी को हम घोषणा कर सकते हैं, स्थानीय घोषणा के मामले में और 10 ^ 7 से 2 * 10 ^ 8 के बीच 10 ^ 6 होगा वैश्विक घोषणा के मामले में इसके लिए क्या कारण है? ये संख्या सामान्यतः एक चीज का अर्थ नहीं है, वे विशिष्ट हैं ओएस + मशीन के लिए लेकिन स्थानीय घोषणा और वैश्विक घोषणा आभासी स्मृति के विभिन्न क्षेत्रों में की जाती है। स्थानीय वेरिएबल्स स्टैक पर हैं, जो आमतौर पर ढेर (गतिशील रूप से आवंटित ग्लोबल वैरिएबल के लिए उपयोग किए जाते हैं) से छोटा होता है

Hashtable output repeats in asp.net -

I have tried the following code to bind the hashtable to the list box. .aspx: & lt;% @ page language = "VB" AutoEventWireUp = "False" Codefile = "hashtable.exx.web" inherits = "hashtable" & gt%; & Lt ;; DOCTYPE HTML PUBLIC "- // W3C // DTT XHTML 1.0 Transcription // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Head id = "head1" runat = "server" & gt; & Lt; Title & gt; Untitled Page & lt; / Title & gt; & Lt; / Head & 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_Click" Text = "Button" /> & Lt; Br / & gt; & Lt; ASP: List Box ID = "ListBloc 1...

javascript - Saving mouse-click coordinates with the CENTER of click.box as origin -

I am trying to write bits of code in the html webpage so that when the user clicks the mouse within my click box, So the x and y coordinates are saved and then sent to my databases. But for now, click handler ... even how far I've got: This works, but the click displays coordinates in a manner that is clear that the original is not the center or top left corner of my clickbox, how do I modify these snippets so that My click-box is located on my webpage, but I get exact coordinates with the center coordinate center of my ClickBox Original ? Thank you in advance, Coordinate relative to top and left side coordX = e.pageX - $ ('# clickbox'). Offset (). Left; Coordination = E. Paging - $ ('#clickbox') Offset (). Top; coordinate with the origin of the Clickbox as the center coordX = e.pageX - $ ('# clickbox'). Offset (). Left - ($ ('# Clickbox') width () * 0.5); Coordination = E. Paging - $ ('#click box') Offset ()....

java - Simple Set with only "contains" method -

I am looking for a simple set in Java that only provides the following functionality. set add (string); Set contains (string s); There is no need to retrieve any elements of the set. I want to see what I have to do, to see whether the string is contained or not. Is there any such data structure in Java? Edit: I know that I can use a set implementation like Hussett, etc. ... but I want a minimum data structure with only two methods listed above. / P> EDIT2: Im has a memory constraint system. Use, both of which have functionality, but this will not allow duplicates

matlab - Draw multiple draggable rectangles on image? -

Image
With the following code, I can easily draw a draggable rectangle on the image. figure; Imshow ('image.png'); H = true; P = wait (h); Get the% reset status rectangle ('position', p, 'linewidth', 2, 'edge collar', 'r'); % Come here The problem is: How can I attract more than one dragable rectangle on the image? And besides, Number of rectangles is not pre-operated is not known. PS If it is already possible to attract the number of rectangles it will be easier, for example, if I want to draw 2 rectangles, the following code will work, i.e. only Wait () : figure; Imshow ('image.png'); H = true; P = wait (h); Get the% reset status rectangle ('position', p, 'linewidth', 2, 'edge collar', 'r'); % Draw here p2 = wait (h); Get the% reset status rectangle ('position', P2, 'linewidth', 2, 'edge collar', 'R'); One way to wrap position acquisitions in the loop on on...

java - Unparseable date exception when converting a string to "yyyy-MM-dd HH:mm:ss" -

Hi, I'm trying to convert a string 19611015 to a date format ("yyyy-MM-dd HH: mm: ss" ") Before trying to store it in a sibbase database table, I have tried the following code which gives me an error: Unstarred date:" 19611015 " / P> date format formattor = new simpledate format ("yyyy-MM-dd HH: mm: ss"); Println (formatter.parse ("19,611,015")); I read some of its long and complex solutions Yes, some people suggest using some people: Can someone possibly convert an alternate simple solution into a string, I have a date format which I am in the above version. Thanks. date is in yyyyMMdd format in the string and want to convert it to yyyy-MM-dd HH: Mm: ss then use the code below: dateFormat originalFormat = new SimpleDateFormat ("yyyyMMdd"); Date format target format = new simpleformformat ("yyy-mm-dd hh: mm: ss"); Date date = original format Prs ("19611015"); String formatteddet = tar...

Assembly and c-language - a comparison of filesizes -

I made two Hello-World programs - using the debugger in CMD in an x86 assembly, in the second c-language. As the assembly language gives the CPU very precise instructions, it is not surprising that executable file captures fewer bytes in memory compared to executable C-files. But I was surprised that the difference is really huge: put it down: Hello World in x86 assembly: 30 bytes Hello world in C-language: 102 KB / Pre> This is - The program has 3400 assembly assembly programs. I first thought that in this context, it can be explained by adding header file as stdio.h but without compiling it, the file-size should be reduced to only 95 KB. Gaya. So - I have a question - is that the assembly file is quite heavy in the C-file bytes? Could it be a definite DL-file that it is executable? x86 assembly code: jmp 115 db 'hello world! $ '-A 115 mh AH, 09 mop dx, 102 int 21 int 20 C-code: # Include & lt; Stdio.h & gt; Int main (zero) {printf (...

amazon web services - AWS route53 failover by using cloudwatch alarms -

मैं एडब्लूएस मार्ग 53 हेल्थकेक के साथ क्लाउड वॉच अलार्म का उपयोग करके असफल होने की कोशिश कर रहा हूं मैंने निम्नलिखित को जोड़ लिया है प्राथमिक और द्वितीयक ए रिकॉर्ड (रिकार्ड सेट) नाम = www.example.com (प्राथमिक और माध्यमिक का एक ही नाम है) प्रकार = ए-रिकॉर्ड्स (प्राथमिक और माध्यमिक का एक ही नाम है) टीटीएल = 60 एसईसी (प्राथमिक और माध्यमिक का एक ही नाम, एडब्ल्यूएस द्वारा अनुशंसित है) मूल्य = प्राथमिक और द्वितीयक सर्वरों का मान = रूटिंग नीति = विफलता विफलता रिकॉर्ड प्रकार = प्राथमिक के लिए प्राथमिक / प्राथमिक माध्यमिक का चयन करें माध्यमिक स्वास्थ्य जांच के लिए संबद्ध करें = मेरे पास केवल सहयोगी स्वास्थ्य जांच है प्राथमिक ए-इकॉर्ड (रिकॉर्डसेट) के साथ स्वास्थ्य जांच सेटिंग्स आईपी = आईपी पता होस्ट नाम = www2 यूआरएल = / एबीसी / प्रोटोकॉल = HTTP स्ट्रिंग = एडीसी क्लाउडवॉच अलार्म सेटिंग्स जब भी = अधिकतम स्वास्थ्य जांच स्थिति आईएसआईटी = 0 के लिए कम से कम = 2 = 5 मिनट की लगातार अवधि डिफ़ॉल्ट रूप से AWS 3 मील लेता है फेलओवर के लिए नट्स, लेकिन मैंने अलार्म सेट अप करने के लिए ...

jquery - Render layout through ajax -

I'm calling a view called "thisweek" through a controller called "thisweek" to see an array And will return an object. Now I want to change it through Ajax. So I called an Ajax which again the controller calls "this" and calls to pass the data. But this layout fails to render. Controller is: - public function action_thisWeek () {$ keyword = input :: post ("keyword"); $ User = (Input :: Post ("Users") == "")? -2: Input :: post ("user"); $ Direction = Input :: Post ("Direction"); If (isset ($ _ POST ['from_date']) & amp; amp; amp; amp; and isset ($ _ POST ['to_date'])): $ data ['from'] = $ _POST [ 'From_date']; $ Data ['from'] = $ _POST ['to_date']; Else: $ data echo ['from'] = (date ('n', time ()) == 1)? Date ('Y-M-D'): Date ('Y-M-D', Stromatem ("Last Monday")); $ Data ['from'] = date echo ('w...

java - Extracting digits from a string -

मेरे पास जावा स्ट्रिंग ऑब्जेक्ट है। चलिए > स्ट्रिंग str = "5N7BS में संख्या 33 और 55c हो रही है"; वांछित आउटपुट: 33 55 पैटर्न p = Pattern.compile ("[0-9] +"); Matcher m = p.matcher ("5N7BS में संख्या 33 और 55 हो रही है"); जबकि (m.find ()) {System.out.println (m.group ()); } आउट कोड 5 7 33 55 को आउटपुट देता है। मुझे केवल वह आउटपुट चाहिए जो में वर्णों के बाद वर्णों का पालन किया जाता है। उदाहरण के लिए: 55 सी आउटपुट: - 55 लेकिन 55c5 या cc5 के लिए मुझे कोई परिणाम नहीं चाहिए। अग्रिम धन्यवाद: -) आप जोड़ने के लिए शब्द सीमाओं ( \\ b ) का उपयोग कर सकते हैं आप चाहते हैं कि बाधाओं यह केवल संख्या से मेल खाती है अगर यह सीमा के तुरंत बाद होती है, और अगर इसके बाद अगले शब्द सीमा से पहले अक्षर (यदि कुछ भी) से कुछ भी नहीं है। नोट करें कि यह संख्या को पकड़ने के लिए एक समर्पित समूह का उपयोग करता है: पैटर्न p = Pattern.compile ("\\ b ([0-9] +) [a-zA-Z] * \\ b"); Matcher m = p.matcher ("5N7BS में संख्या 33 और 55c हो रही है...

Watir-Webdriver: How to click on an element location? -

We have a custom input element that contains several div elements which is the mask behind the canvas element Div element click event Handles it, and it works fine in all browsers. How can we click such an element in Watir-Webdriver? If we search for div element and use the .click method, then this causes the error: element is not clickable on point (423, 247) other elements Will receive a click: & lt; Canvas & gt; & Lt; / Canvas & gt; This, of course, will occur before the event bloop. What we want to do is click on the place where the div element (which first clicks the canvas, then bubbles on the div). We do not want to throw Java events straight in the division, because it does not properly test event bubble. You can, of course, click on the canvas element like you click on the div but your To answer a question raised by: You can try to access the built-in Selenium-WebDowner browser driver and use the Selenium-WebDrive methods to do this. drive...

amazon web services - AWS auto start specific instance -

I currently have an example that includes frequency A (Program A and website A, 7/24 execution). What I'm trying to do, for example, start out automatic traffic traffic, for example B (website A), when a CPU usage is more than 90%. I tried to configure the auto-scaling group, however, I do not see any options that gives me the opportunity to choose which example starts and which example is closed. My requirements 1) Instance A will have to run 7/24) 2 When the instance CPU is more than 90, start the instance b to automatically share the traffic. Any solutions know? Automatically create and expire for example Is used as needed, in the case of your use, you do not really need Example B. You need to assign a AMI to the AutoScalling group, and when a condition is found on instances that are running (for example - 90% CPU) - AWS is a new example Launch, and add it to your load balancer. When a different status is completed (for example - all CPUs you can speci...

javascript - how to adjust position of an element after showing header and footer bar in iPhone safari -

Image
The version of the iPhone is 7.0.4 - I use javascript to calculate the position of the image of the shipment Show in the middle of the "Available" field in The problem is: When the vertical position changes from the horizontal to the phone, I can keep using the resize event in the middle of the screen (without the touch screen) (â ?? -á¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ Area (blue square area â ?? ¢) (â ?? ¡- ?? ¢) I know if some events are triggered when the header and footer show bar so that I can bind it and adjust the position of the image? Or is there any other way to make it? You can use media queries in your CSS to do this. In CSS you will need all your break points. I do not believe there is such an event that you can tap to see that it has been shown repeatedly because it is the original browser.

svm - LibSVM one class classification nu parameter is not a fraction of outliers? -

Image
Please correct me if I am wrong, but a class SVM principle states that nu parameter upper bound (UB) training Outliers in Datasets and LBs of the number of SVs say that I am using RBF Gaussian Kernel, so considering the nu parameter, no matter what the value of gamma I choose, the result of the model Be able to generate Is there a UB outlayer dataset in parameter NU training? However, it is not what I have seen that I have seen using a few simple examples with LbsM in Little: [heart_scale_label, heart_scale_inst] = libsvmread ('.. / heart_scale') ; Ind_good = (heart_scale_label == 1); Heart_scale_label = heart_scale_label (ind_good); Heart_scale_inst = heart_scale_inst (ind_good); Train_data = heart_scale_inst; Train_label = heart_scale_label; Gamma = 0.01; New = 0.01; Model = svmtrain (train_label, train_data, ['-s 2 -t 2 -n' num2str (nu) '-g' num2str (gamma) '-h 0']); [Predict_label_Tr, accuracy_tr, dec_values_Tr] = svmpredict (train_label, trai...

javascript - Reverse JS select menu order and add custom option at the end -

I am slightly new to JS, so I apologize in advance if I ask any stupid questions. I found this script in script overflow and made some small tweaks. With the help of script Calvin, the user comes from "user2935177" My problem is that I want to change the order of the year (new, old) and adding a custom option below ("before 50s"). I have received many questions / answers about giving custom order in JS but in the code it is novice to implement it. Whoever is willing to help and if possible, how can I finally add a custom option from the list? & lt; Script & gt; Var max = new date (). Choose GetFullYear (), minimum = 1930 = document.getElementById ('selectElementId'); {Var opt = document.createElement ('option') for (Var i = min; i & lt; = max; i ++); Opt.value = i; Opt.text = i; Select.appendChild (optional); } & Lt; / Script & gt; Many, many thanks in advance! Change your loop to maximize, and instead of going ...

java - SealedObject vs Stream Cypher, pros and cons -

I have 2 ways to encrypt and decrypt Java objects: a) SealedObject Using and saving and using this load FileOutputStream and FileInputStream b) with the normal to the serial object To save CipherOutputStream and CipherInputStream Is there a difference between performance and / or security between these two options? Looking at any serializable object, one can produce its serial content in a serial format (i.e., a "deep copy"), containing a sealedObject key object, and encrypts, such as DES Using a cryptographic algorithm, up To protect the privacy. Encrypted content can be decrypted later (with the same algorithm using the correct decryption key) and D-serial, the original object yield. Note that the cipher object is completely The right algorithm should start with the key, the padding scheme, etc., before being applied to a seal object. CipherInputStream: An InputStream and Made up of a cipher, so that reads () methods There should be data r...

javascript - How to use underscore template tag from a backbone model? -

After I have a very simple simple time app using json from an API, mandatory form By leaving everything from calling the template json value inside the template var time = new couple application (); Time. AddRegions ({Main Regions: "Main Area"}); TimeModel = Backbone.Model.extend ({Error: {Time: "Now", milliseconds_since_epoch: 1234, Date: "Today"}, urlRoot: 'http://date.jsontest.com/'}); Var Tudetime = New Timemodel (); TimeView = Marionette.ItemView.extend ({Template: "#template", Model: TodaysTime, onRender: function () {TodaysTime.fetch ({Success: Function (apiTime) {console.log (apiTime.attributes.time); TodaysTime = API;}}}}}}} Var timeline = new time view (); Time.mainRegion.show (timeView); Time.start (); and then in my template I have this & lt; p & gt; & lt;% - time%> & lt;% - milliseconds_sense_pok% & gt; & lt; / p & gt; I have not found any errors and nothing is showing, but is...

python - Many-to-many db.relationship implementation in saving to database. SQLAlchemy -

Text after " My app looks: app = bottle (__name__, template_folder = 'templates ') App.config.from_object (' config ') db = SQLAlchemy (application) Looks like my SQLAlchemy classes: connection = db .Table ('connection', db.metadata, db.Column ('book_id', db.Integer, db.ForeignKey ('books.id')), db.Column ('author_id', db.Integer, db.ForeignKey ('Authors .id'))) Category Writer (db.Model): __tablename__ = '__searchable___ of the authors = [' a_name '] __table_args__ = {' sqlite_autoincrement ': is true,}? Id = db.Column (db.Integer, primary_key = true) a_name = db.Column (db.String (80), unique = true) def __repr __ (self): return unicode (self.a_name) class book (db. Model): __tablename__ = 'Books' __searchable__ = ['b_name'] __table_args__ = {'sqlite_autoincrement': is true,}? Id = db.Column (db.Integer, primary_key = true) b_name = db.Column (db.String (80)) authors ...

ruby on rails - Using url variables in dossier reporting gem -

I am trying to file a file for reporting. Find out in any document how to report URLs like reports / test.csv? Id = 1 Have tried some things, either get errors or blank values. This answer is probably a little too late but I think I share the future for Google Will do tl; Dr / report / test? Option [p1] = v1 and options [p2] = v2 TestReport Inside the example options [available: p1] # = & gt; 'V1' and option [: p2] # = & gt; 'V2' Explanation: By going to a URL like /reports/test.csv To be done, test report will trigger and finally the CSV output will be received if you want to pass the dynamic options from the URL, then you will add them to the : options parameter, which Instant will be sent in immediate report. To say all this is to use a format in the URL such as: /reports/test.csv?options [id] = 1 more option [so_fancy] = true . To do this, call ReportReport.new (id: '1', hence_fancy: 'true') to call...

java - No class 'com.sun.proxy.$Proxy33' was registered - BadRequest on GAE endpoints -

Suddenly, Google App Engine (JAVA) finishing points started throwing me at: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request {"Code": 400, "Errors": [{"Domain": "Global", "Message": " Java.llegalArgumentException: a class' com.sun.proxy. $ Proxy33 'was registered "," Reason ":" badRequest "}," Message ":" java.lang.IllegalArgumentException: no class' com. Sun.proxy $ Proxy33 'was registered "} I implemented the endoweuse method from the Android app in this way. Class I: CollectionResponseRPlayer response = endpoint.checkResult (gameId, answer, hash). Execute (); gameId is tall , and answer and hash are to preview what values ​​have been passed in gameId , answer The execute () line is stopped on the I code> and hash why this data may be incorrectly requested are: GameID = 8113932860298394396 Answe...

How to loop python to read a set of HTML files and dump into JSON -

I have a program that removes some variables from a group of 20 HTML files. Someone advises me how to loop the program to read all the HTML files from a directory and print information in personal JSN documents? Import from bs4 BeautifulSoup #open data file get_data = open ("Book1.html", 'r'). Html Soup # Beautiful #Encourse (get_data) # Title and author title = soup.find ("span", id = "btAsinTitle") Author = receives title. ("A", href = True) # Soup provides the definition for the price. All ('span', {"class": 'bb_price'}): definition = definition.renderContents () #finds ISBN, shipping weight, product dimension printed soup.fund ('B', text = 'ISBEN-10:' ). Next printing soup.fund ('b', text = 'shipping weight:'). Next_sibling #prints All information print definition print titles. Get_text () print author.get_text () To loop through all of you You can use the html f...

c++ - correct syntax for merge -

This question may be very stupid but I do not know how to merge two sorted vectors with std :: merge To do I tried some code using cplusplus references. struct t {t (int x): a (x) {} int a; }; The Bull Operator & lt; (Cost T & P, Const T & B) {Return P. A & LT; B.A. } Int main () {Vector & lt; T & gt; A, b, c, a.push_back (t (10)); A.push_back (t (20)); A.push_back (t (30)); B.push_back (t (1)); B.push_back (t (50)); Merge (a.begin (), a.end (), b.begin (), b.end (), c.begin ()); Return 0; } There is a split fault with this code. You want to make sure that it is large, or increases: std :: merge (a.begin (), a.end (), bb.gen (), bend (), std :: back_inserter (c)); Alternatively: c.resize (a.size ()) + b.size ()); Std :: merge (a.begin (), a.end (), b.begin (), b.end (), c.begin ()); See this #include & lt; Algorithm & gt; #include & lt; Vector & gt; #include & lt; Iterator & gt; Struct {t (int x): a (x) {...

ios - Calculator that displays entire equation -

In my application, I have created a number pad in which operators such as + - x / . All I want to know is that they have to be displayed in a label when the user inputs them. For example, if the user wants to know 3 + 5, then the user will press the button for each and the label will show 3 + 5 and then count the user The side will push and the answer will be displayed in the second label. So basically how can I display all this in a label together? I'm trying to do it in a different way but it only gives me a headache. User input by adding track operation to an NSArray If the user taps the '+' button, Add to the array of "+", if they "-" tap, then add a @ "" to the array. From here you can generate an integrated NSSSring of all the works to generate the equation. In addition to this, as the operation is stored in NSARR, if the user clears the delete button, then instead of simply comparing and manipulating the string to remov...

objective c - Storing email in keychain impossible (KeychainItemWrapper) -

I'm using ARCified version KeychainItemWrapper, and I can not get email it and passwords to both store key icon Itemvepr * key Icons item = [[key Itamwapr Olok] initWithIdentifier: @ "myApp" access group: @ "MY_APP.com.yourcompany.GenericKeychainSuite"]; [Set used the key object: [own Kmel Detaupyoging Encoding Anstif 8 string encoding]: (__ bridge ID) Kessiattiattiarakount]; [Keychain Itam Set Object: To Self Password: (SVVAdata of __Pull ID); I work perfectly until I store an email ... which is not signed (@). Otherwise, I get an error failure to failure *** - [Key Itamwapr Liknatokekecn] *** without invalidating the exception of 'Afais' Ansaiaianaianaiannistensi Akspasn', because: 'Keychain item could not be added. ' which comes from those lines Result = Add Sekandaitam ((__ bridge Siafaksaarafarafaraf) [Spi Dikshnussiaitiamformet: Chaichen Itamdata], NULL); NSAssert (Results == NoRR, @ "Could not add Keychain item....

html - Child divs not wrapping to stay inside parent -

इस बेला पर एक नज़र डालें html है: & lt; div id = "parent" style = "width: 150px; डिस्प्ले: इनलाइन-ब्लॉक; सफ़ेद-स्पेस: अबॉपर" & gt; & Lt; div id = "एक" वर्ग = "बच्चों" & gt; & LT; अवधि & gt; हाय के & lt; / span & gt; & Lt; / div & gt; & Lt; div id = "two" वर्ग = "बच्चों" & gt; & Lt; span & gt; बॉब अपने वायलिन पर खेलना चाहता है & lt; / span & gt; & Lt; / div & gt; & Lt; / div & gt; सीएसएस के साथ #parent {background-color: #aaaaaa} #one {background-color: # ff0000} #two {background-color : # 00ff00} .kids {display: inline-block; पैडिंग: 2px; सफेद स्थान: सामान्य; } मैं कैसे div # दो लपेटो पहले बना सकता हूँ ताकि मैं माता-पिता div के अंदर दोनों बच्चे div रख सकूं? बस माता-पिता से जुड़ी चौड़ाई को हटा दें। यह माता-पिता div को इसकी ऊंचाई बढ़ाने के लिए डिव #two में सामग्री को समायोजित करने के लिए मजबूर करता है। इसलिए पैरेंट डिवेल को इ...

html - How to style CSS for input box's width as a percentage when it has border and padding? -

If the container is 500 pix width wide, and the label is 30% wide, and the input box is 70% wide, then it is considered Everything should be fine, but the catch is that the border in the input box is left and right for 4px, left and right padding for 2px, it is composed of 6px wide. We can hack it by making the width is not 70%, but 68% or something else, but it is somewhat hackneyed. Is there any way to handle it? (We can not reset the CSS, because the input box usually requires a border, assuming that we do not hack it using the outline, which is not in any place). CSS: # my-container {width: 500px} # First-name-label {display: inline-block; Width: 30%} # first-name {display: inline-block; The following are a few examples: Outwidth: 356 (for input box, as shown in Debug Console) External width 34 9 External width 349 Do not wrap, but the input box will move from the container width This is the reason that the width is not accurate because they are set to t...

python - Django, Update Profile, exclude current user email -

मैंने एक अपडेट प्रोफाइल पृष्ठ बनाया है I तो फ़ील्ड हैं: ईमेल, प्रथम नाम, अंतिम नाम। सत्यापन में, मैं उपयोगकर्ता के ईमेल पते को बाहर करने का प्रयास नहीं कर रहा हूं, और मैं अन्य उपयोगकर्ता के ईमेल पते को भी फ़िल्टर कर रहा हूं। मुझे लगता है कि अगर आप कोड देखते हैं तो आप समझेंगे कि मैं किस बारे में बात कर रहा हूं। मैंने यहां कई सवाल पढ़े लेकिन कुछ नहीं मिला। कुछ उपयोगकर्ताओं को एक ही समस्या थी। तो नीचे दिए गए कोड के साथ, मुझे जो मुद्दा मिल रहा है वह है: प्रकार वस्तु 'उपयोगकर्ता' का कोई विशेषता 'ईमेल' नहीं है। > मैंने मौजूदा उपयोगकर्ता का ईमेल पता प्राप्त करने के कई तरीकों की कोशिश की (फ़ॉर्म को सहेजने से पहले) परन्तु अब भी कुछ नहीं। forms.py वर्ग UpdateProfile .ModelForm): ईमेल = forms.EmailField (अपेक्षित = सच) first_name = forms.CharField (अपेक्षित = false) last_name = forms.CharField (अपेक्षित = false) वर्ग मेटा मॉडल = उपयोगकर्ता क्षेत्रों = ( 'ई-मेल', 'first_name' 'last_name') डीईएफ़ clean_email (स्वयं): ईमेल = self.cleane...

jquery - JSON returned, but Kendo Grid does not display data -

I'm trying to create a grid hierarchy as shown here:. My basic structure is a main grid that has been started with an HTML table which insists in detail, and produces a child grid. The child reads the grid from a controller method, which gives JSON. I have verified that the controller method is returning the correct, valid JSON, but the hair grid shows only column titles, without any data in the table's rows, the only exception I get is a JavaScript exception: UnkeyType error: Undefined no function Controlling method: Public JsonResult GetDBA (String DBaname, [DataSourceRequest] DataSourceRequest request) { Back Json (Repository. DBA. Where (M => M. Dinem == DBname). TODataSourceResult (Request)) ; Example: JSON returned: {"data": [{"DBAId": 25, "DBAName" : "Adam's HotDog Store", "Legal Entity": "Adam", "Business Phone": "1234567890", "Alternative Phone": blank, ...

ruby - Return 0 when select returns nothing? -

Say I have an array of palm like: items = [[: User = & gt; 1,: zodiac = & gt; 484}, {: user = & gt; 2 ,: zodiac => 0}, {: user = & gt; 3 ,: zodiac = & gt; 8633}] To get the amount for a user, I want something like this: items.select { | Key | Key [: User] == 1}. But if there is no ID then is not user , then it will not work: & Gt; Items.select {| Key | Key [: user] == 8}. First [: amount] # no methoder: Undefined method for zero, `]]: NilClass how can I return the amount if it finds the item , But 0 is nothing back then First of all, Instead you can use it because you want only the first match if you want the one-liner, then you can do something like this: (items.find {| key | key [: user ] == 8} || {: zodiac => if you kick around Rails or ActiveSupport You can use it and to_i (while remembering zero) To_i == 0 ) like this: items.find {| K | Key [: user] == 1} .try (: fetch, amount) .to_i Try just calls a met...

javascript - Parse: Grab photo during background job -

I am uploading images to parse it through iOS, similar to this tutorial and catch them in parse Wish cloud code background job is parsing success now, when I run this function, then no result is found. Any ideas? Parse.Cloud.job ("photoPing", function (request, status) {var query = new parse .Query ("UserPhoto"); query.each (function (userphoto) {Console .log (userphoto);}) then (function () {status.success ("Win");}, function (error) {status.error ("Womp");});}); My ACL controls were not set publicly, now all are good.

java - Im getting null pointer exception in my object array -

Therefore, I am creating an array of seats on an airplane, the property seat number , seat type , and traveler . First of all .. make my code seat object in a different class: public class seat {Private enter seat number; Private string passenger; Private string seat type; Public seat (int seat number, string seat type, string passenger) {ctnm = this; with number; SeatType = this.seatType; Passenger = this.passenger; } Public int receive () {return seat number; } Public string received passenger () {return travelers; } Public string getSeatType () {return seatType; } I have in my main class: import javax.swing. *; Import java.awt. *; Import java.awt.List; Import java.util. *; Public Class Airplane Reservation {public stationary seat} Seat list = new seat [12]; Public Zero Seats List (for (Int i = 0; I & lt; Ceelist.Langt; I ++) {Seatlist [I] = New seat (I, blank, blank);} Seat seat 1 = New seat (1, "First Class", "Collins"); seatList [0] = seat...

svg - Draw line with d3.js using separate, fixed x & y input arrays -

I have different x and y arrays and want to connect the dots using a line path. This is about the simplest possible example, but I do not mess much about writing the function. Here's my code: & lt ;! DOCTYPE html & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Body & gt; & Lt; Script src = "http://d3js.org/d3.v3.min.js"> & Lt; / Script & gt; & Lt; Script & gt; Var margin = {top: 20, right: 20, bottom: 20, left: 20}, width = 600 - margin. Left - margin. Right, height = 270 - margin.Top - margin.bottom; Var xdata = d3.range (20); Var ydata = [1, 4, 5, 9, 10, 14, 15, 15, 11, 10, 5, 5, 4, 8, 7, 5, 5, 5, 8, 10]; Var xscl = d3.scale.linear () .domain (d3.extent (xdata)). Ranges ([0, width]) var yscl = d3.scale.linear () .domain (d3.extent (ydata)). Range ([height, 0]) var slice = d3.svg.line () .x (function (d) {return xscl (xdata [d]);}) .y (function (d) {return yscl (ydata [ ("Width", width + margin.left...

What's the difference between getattr(self, '__a') and self.__a in python? -

I thought before I ran this code: class B ( Object:): DEF show (self): self .__a = "exam" print "b" dff_b (self): print "this_b" print itself .___ print a getattr (self, '__a') #expression class C (B): DEF SHOW (H): Print "C" #BISHO (HELD) SUPER (C, SELF) Show () Def call (self): print "call" self. Show () self.this_b () # print itself .__aC (). Call () It raises AttributeError: the 'C' object has a attribute '__a' with the getattr statement, but Why? The reason for this is. Private name mangling: When an identifier is found in class definition, then two or more than two underscores begin with characters and two or more Underscore does not end in, it is considered a private name for that class. Private names change for a long time before code is ready for them. Transformation involves the name of the class, the leading underscore is removed in front of the name and an underscore is inserte...

Coffeescript best way to var -

I was trying to find a good way to do var , and here's one. Is it intentionally in cs , because this is not a document? me =; FetchUser () Then ((_m) = & gt; me = _me fetchFriend ()) .then ((_ you) => me.friend (_you)). Then (done) .otherwise (= & gt; console.log ':' ') var me; me = fetch user () Is then compiled correctly (then the function (_this) {return function (_me) {return me} = (return) ();}}}} () ()). Then ((function (_this) {returns) Function (_you)} Returns me (_you);}}}}} (it)). Then (done). Otherwise ((function (_this) {return function () {return console.log (':(' Edit this: It is not correctly compiled. I would not expect me = FetchUser () Either, but I did this I did not see first I think this is just a rotation of parser. Common ways variables have been declared, they are defined with some default values ​​(eg. Null).

python - Adding array to dictionary TypeError: unhashable type: 'list' -

I am unable to add dictionary [3,5] dictionary = {}. I have to check on the solution mentioned above but still the error is coming (TypeError: unhashable type: 'list') links = [links [i: i + 2] i for category For the range (0, lane, 2)] I range (0, lane (link), 1): print links [i] if not in the links [i]: this is the Lindim Lindicht [link]. (Prob) I want to make dictionary of [3,5] price 0.03. You are already printing code It should be your attention that every element of the links list is also a list. A dictionary can not contain a list as a key, because dictionaries are based on a hash table and lists can not be washed. Although Tulips can be washed, and they are similar to those lists, so you can try changing the list to Tupal. In addition, the most straight-forward approach is to handle two cases separately, assuming that you want to capture every match and want to add it to the list. You can also use a defaultdict , which will automatically handle ...