Posts

Showing posts from April, 2011

ruby on rails - emacs init file with mac and other issues -

This is the most frustrating program Ive ever used, Ive installed it 4x, Ive created an .emacs rt one .emacs.da .emacs.d / init.el built an .init.el etc. None of them work, directories are safe and I can not keep them safe etc .. The list goes on. So basically I do not know how to get a very easy .emacs init file to work with the rail I and it has turned into an 8 + hour disturbance, resulting in useless files Has become a ton of. Any idea what the issue is? Igggled Read Mode etc. Ive ran under sudo. Sounds like a very simple task, so I'm not sure whether any idea is missing the magic thing? ive examined both the USR bin directory and made it there. Ive built the lspee directory within the app directory. The best boxes were buffer to preload, but really it should without buffer rating Thanks for the help, with a dispute with emacs lisp for 300 hours, a useful to code It would be good to have the program Editing: Yes my MX optimizes and fixes the load even though I can n...

scala - Are Iteratees safe for managing resources? -

Suppose I was reading from InputStream . How do I generally do this: val inputStream = ... try {doStuff (inputStream)} {end_stream.close ()} Whether or not DoStuff throws an exception, we will close InputStream . How do I do this with an internet address: wal inputstream ... anamorater.fromstream (inputstream) (iteratee foreac (dustf)) Will InputStream be closed (even if doStuff throws an exception?) A small test: val inputStream = new InputStream () {// 10, 9, ... 0 returns, 1 private var i = 10 def () = {i = math.max (0, i) - 1 i} Override def close () = println ("closed") // Looking for this} Animator.fromstream (inputstream) (Iteratee.foreach (a = & gt; 1/0)) Only full println view only: failure (java.lang.ArithmeticException: / by zero) The stream was never switched on 1/0 with 1/1 and you will see that the stream is closed. Of course, I can maintain the context of the original. In case of failure, turn it off and close ...

objective c - Convert OS X keycodes to key location? (irrespective of system keyboard language/layout) -

I have to find out where a pressed key on the Mac keyboard is physically, seeing the keycode gives me four more . But there is no space, which varies according to the language / keyboard layout. I wanted something like the row index for the key. I can see the keyboard layout language using this code: TISInputSourceRef source = TISCopyCurrentKeyboardInputSource (); NSLog (@ "Localized Name:% @", TISGetInputSourceProperty (Source, KatispropertyLocaledName)); From which I can map the location through the creation of keycode place dictionaries for each language, but it can be a lot to cover most keyboards. Shortcut? You are wrong about the key code. On OS X, the virtual key code corresponds to the key position. This not indicates which characters will be generated by the keyboard layout. For example, the key code is 0 kVK_ANSI_A . What does it mean not is a key that generates "A" character, it means that it is a condition that "A" key...

In Python, given a class, how can I find what module it came from? -

इस सवाल का पहले से ही एक उत्तर है: 4 जवाब इंटरैक्टिव शेल का उपयोग करते समय उदाहरण के लिए, स्पाइडर, सभी प्रकार के वर्ग वैश्विक नाम स्थान में हैं, इसलिए क्लास से आने वाले मॉड्यूल को इंटरैक्टिव तरीके से खोजने में सक्षम होना अच्छा होगा। जवाब को प्रश्न के उत्तर में से एक में दफन किया गया है: आप किसी भी ऑब्जेक्ट से पूछ सकते हैं जो इसे अपने __ मॉड्यूल __ संपत्ति। यह उपयोगी है, उदाहरण के लिए, यदि आप कमांड लाइन पर प्रयोग कर रहे हैं और बहुत सारी चीजों को आयात कर रहे हैं। उसी लाइनों के साथ, आप एक मॉड्यूल पूछ सकते हैं, कोड> __ फ़ाइल __ संपत्ति। पथ मुद्दों को डीबग करने में यह उपयोगी है।

strange ruby syntax for rails devise helper -

इस सवाल का पहले से ही एक उत्तर है: 2 जवाब मैंने निम्नलिखित कोड को देखा deviser_helper.rb। & Lt; & lt; -HTML ... HTML का मतलब यहां है: html = & lt; & lt; -HTML & lt; div id = "error_explanation" class = "alert" & gt; & LT; h2 & gt; # {वाक्य} & lt; / h2 & gt; & LT; ul & gt; # {संदेशों} & lt; / ul & gt; & Lt; / div & gt; एचटीएमएल रूबी में एम्बेडेड एचटीएमएल कोड लिखने का एक शानदार तरीका है। लेकिन यह क्यों काम करता है और यह कहां से आता है? यह सिर्फ एक है। आमतौर पर इसे एक या यहाँ दस्तावेज़ कहा जाता है लिंक किए गए प्रलेखों से: एक & lt; & lt; आप तार को समाप्त करने के लिए स्ट्रिंग या पहचानकर्ता को निर्दिष्ट कर सकते हैं, और टर्मिनेटर तक की वर्तमान रेखा के सभी रेखाएं स्ट्रिंग का मान हैं। - & lt; & lt; के बाद आप टर्मिनेटर इंडेंट कर सकते हैं, ताकि HTML अंत में उसके पहले रिक्त स्थान या टैब हो सकते हैं।

python - Django AWS Eslastic Beanktalk not deploying - Internal Server Error -

I am following this tutorial: I am at step 6. I already have my own ADS Elastic Beanstyle Python app and now I want to link it to my own Dyango application. This is my directory: ~ / document / myapp myapp manage.py options.txt .ebextensions .leasticbeanstalk .git .gitignore MyEp.config is inside my .ebextensions: container_commands: 01_syncdb: command: leader_only "--noinput django-admin.py syncdb": True option_settings: - Namespace: AWS: Elasticbeanstalk: container: python option_name: wsgipath value: myapp / wsgi.py - option_name: DJANGO_SETTINGS_MODULE value: myapp.settings - option_name: AWS_SECRET_KEY value: myUsersSecretKey - option_name: AWS_ACCESS_KEY_ID value: myUsersAcessKey inside ~ / documents / myapp / myapp is my settings_You, view.py etc I created the database in my settings: / P> database = {'default': {'ENGINE': 'django.db.backends.mysql', 'NAME': os.environ ['RDS_DB_NAME' ], 'USER...

ios - Auto focus text field in UIWebview -

I am loading the webview form in my iOS app and I want to autofocus a textfield on the form. I tried NSString * focus = [NSString stringWithFormat: @ "document.getElementsByName ('j_captcha') [0]. Focus ()"]; [Self.webView stringByEvaluatingJavaScriptFromString: Focus]; But it seems that there is no work to do. "J_captcha" is the name of the textfield. How can I get it? This did the trick for me NSString * evalStr = [NSString StringWithFormat: @ "setTimeout (function () {document.getElementsByName ('j_captcha') [0]. Focus ();}, 1000);"]; [WebView stringByEvaluatingJavaScriptFromString: evalStr]; This post got help -

javascript - localStorage item conflicting with other localStorage item -

I am having a problem adding the value to the local storage for other fields if I firstnon poplot I set the price for 2 , but I leave the field blank for Matinee NPS Slot (this should be kept whatever value it was given). After that I will update the changes FirstNumeracy is $ 2.00 as it should be, but Matine NPS Slot is $ NaN . Also, if I set a price for firstnon poplot and the value for the matinapop then there is no Noyen problem. I do not want it to be optional for any area, it is necessary for all areas without any problem. How do I stop it from happening? Function update processing function () {var beforeNoonFieldChange = document.getElementById ('beforeNoonNPSlot'). Values; Var Matinfeld Changer = document.getElementById ('Matinee NPS Slot'). value; LocalStorage.setItem ('Text', change non-field before); LocalStorage.setItem ('text1', Matinefield Challenge); } Load function () {var storedValue = localStorage.getItem (...

xcode - Format text field as user is typing -

I currently have two separate text fields in my app and I am trying to convert it to just one. Text fields are used for currency input (one pound, dollar, euro etc. and one for pence, centi etc.) and they work fine, but I need to add some functionality which will not be possible That I do not use a single field of text. Also, I think a text field is more user-friendly. Actually I would like a text field that formats the form in the form of currency for the user in real time, while they are writing. E.g. 1 format £ 1.00 or $ 1.00 or 1.00 € etc ... as 1000 format £ 1,000.00 or $ 1,000.00 or 1 000,00 € etc ... I did Has done some research and got some objective examples, but I do not understand how to do this in Swift (I have never programmed in Objective-C). Any help can be greatly appreciated because I find it very disappointing. You can use this code: funk currency String FormNumber (number: double) - & gt; String {form format = NSNumberFormer () formatter.numbe...

web services - Tesla's "REST" API, and honk_horn end-point -

प्राप्त / वाहन / {id} / command / honk_horn के रूप में इस पोस्ट में देखा गया: honk_horn संसाधन के लिए किस क्रिया का उपयोग किया जाना चाहिए, इसके बारे में एक बहस है उत्तर में शामिल हैं: प्राप्त करें, क्योंकि आप संसाधन राज्य को नहीं बदल रहे हैं पोस्ट और नहीं दबाएं क्योंकि दो बार हार्निंग नहीं idempotent क्योंकि दो बार हार्निंग को इडेमपोटेंट माना जा सकता है: एस शायद यहां समस्या की जड़ यह है कि honk_horn वास्तव में एक क्रिया है और संसाधन नहीं है, और इस प्रकार विशेष मामले में किसी को एपीआई के रूप में परिभाषित किया जाना चाहिए, जब शेष को शेष अंक जारी कर दिया जाए? शायद यहां समस्या की जड़ यह है कि honk_horn वास्तव में एक कार्यवाही है और एक संसाधन नहीं हाँ, मैं ऐसा कहूँगा, यह समस्या की मुख्यता है। एक संसाधन उन्मुख और हाइपरमीडिया आधारित दृष्टिकोण इस तरह दिख सकता है (मैसन के कार्यों का वर्णन करने के लिए): GET / vehicles / 12345 / horn = & gt; सींग की वापसी स्थिति (अपने आप में एक संसाधन) {वॉल्यूम: 5, संख्याऑफ़हॉक्स: 1025, @ प्रतिक्रियाएं: {"मान": {...

elasticsearch - Elastic Search Nested Object mapping and Query for search -

I am trying to use elastic detection and I am trying to query for nested objects. Originally my object is of the following format {"name": "some name", "field 2": [{"prop1": "val1" , "The following is the following for the mapping nested field:" val2 "}, {" prop1 ":" val3 "," prop2 "::" val4 "}}} { "Properties": {"field2": {"type": "nested"}}}} PUT / sometval / posts / _mapping {"posts" ex> Now say I can insert element for / field / post / 1 and / field / post / 2 etc. I have K value for field2.prop1 and give me a query f The one that was posted on the basis of the most match of field 2. The .prop1 is between the values ​​of what would be the proper question for it, besides I tried a simple filter, but this does not seem to work right. { "Match_all": {}}}, "filter": {"nested": rece...

ios - Fetching a NSString version of NSURL from Core Data -

I have a NSURL that I have a AVAsset . I then use AVAsset to remove the data from the media code NSURL until I started using the core data So it is working fine to give this code to nsr URL with a NSString to my entity must be converted to a specialty. Now that I am taking, I can see that I am able to retrieve the string version of ns URL and can convert it back to NSURL . However, when I create my AVAsset to NS URL , then I am unable to extract data. NSURL storage as NSString method: - (zero) saveRecording: (NSMutableDictionary *) recordPackage inManagedObjectContext: (NSManagedObjectContext *) Reference {Recording * Recording = [NSEntityDescription InsertNewObjectForEntityForName: @ "Recording" Managed Object Contains: Reference]; Recording. Audio URL = [[RecordPackage ObjectForcae: @ "Audience"] Absolute String]; } The method is fetching: - (NSMutableArray *) fetchWithContext: (NSManagedObjectContext *) Reference {NSFetchReques...

node.js - Catching Errors in JavaScript Promises with a First Level try ... catch -

Therefore, I want my first level cache that handles the error Promise = Requirement ('.framework / libraries / requires) bluebird.js'); Function promise () {var promise = new promise (work (solution, reject) {throw ('oh no!');}); Promise.catch (function (error) {throw (error);}); } Try {Promise (); } // I want to catch this error in the inclination (error) {console.log ('caught!', Error); } With the new you can get it Please note that at the time of writing It is not supported by all browsers, you probably have to read your code (or something similar). Because of the keyword "getonome", getSomeValue () // will return a promise from the call async function getSomeValue () {if (Some IsNotOk) {new error ('oh oh'); } And {return "ya!"; }} Async function () {try "//" will wait for the promise to resolve or reject if it rejects, then an error will be thrown, which you // regularly hold / hold block SomeValue = waiting...

java - mybatis - insert transaction -

सम्मिलित करने के लिए मेबाटिस मैपर कोड: & lt; insert id = "insert" parameterType = "शॉप" का उपयोग करें GeneratedKeys = "true" & gt; (# {Email}, # {pswd}, # {उपनाम}, # {मोबाइल}, # {शहर}, # {createDate} के लिए दुकान (ई-मेल, पीएसडब्ल्यूडी, उपनाम, मोबाइल, शहर, # {Status}) & lt; का चयन करें मुख्य कुंजी = "id" क्रम = "बाद में" परिणामस्वरूप = "लंबा" & gt; चुराने का चयन करें ('shop_id_seq') & lt; / select key & gt; & Lt; / डालने & gt; डेटाबेस postgresql 9.3 है। मेरा संदेह है: बिना किसी अंतर लेनदेन, जब मैं आईडी को क्रम से क्ररवल का चयन करें ('दुकान_आईडी_एसएक्') , क्या अन्य थ्रेड भी सम्मिलित कर रहे हैं, तो क्या गलत मान प्राप्त करना संभव है? मैंने सोचा था कि नहीं, क्योंकि currval () फ़ंक्शन संदर्भ में चलता है वर्तमान सत्र का, वैश्विक सत्र नहीं, लेकिन मैं यह सुनिश्चित नहीं हूं। के अनुसार, अनुक्रम फ़ंक्शन curvval : वर्तमान सत्र में इस अनुक्रम के लिए सबसे हाल ही में ...

javascript - How to show spaces from textarea -

Hello I am saving data in a text field on page 1 then showing in page 2 on a div. However if I write in the texture ABCD This shows it in the div (on page 2) ABCD How do I keep line breaks? CSS property to accept \ n as new lines Use div {white-space: pre; }

java - Strange Run Time Error -

The following code works fine but as soon as I start any integer input, it goes into the infinite loop. I need an integer value for testing. import java.io. *; Import java.util. *; Import java.text *; Import java.math. *; Import java.util.regex *; Class test class {public static zero master throws exception [scanner] {scanner stdin = new Scanner (System.in); // Here I just input into an AN / INT digit like intact T = stdin.nextInt (); Long calculation = 0; String str = stdin.nextLine (); Four [] c = str.toCharArray (); ('A': Case 'I': Case 'O': Case 'U' (at j = 0; j and lt; strength (); J ++) {switch (c [j]): calculation + +; Default: break;}} arrangement (calculation, str.length ());} public static zero system (long V, long en) {long total = fact (n); long time together = ((combination V)) * (Fact (N-1)) * 2); Long Answer = (Total - Together); If (Answer> 0) System.out.println (Answer); Else System.out.println ( "- 1");} Public stabl...

c++ - g++ openCV compile error on line that doesn't exist -

I am trying to compile and run the following program gcc test.cpp -o test . But I'm getting this error: in the test.cpp file included: 4: /usr/local/include/opencv/cvaux.hpp:49:10: Error: 'cvaux. The H file & lt; Angled & gt; Did not get involved with; "Quotation" is used instead of #include & lt; Cvaux.h & gt; ^ 1 error occurred. This line is not in the program though. What can I do to improve this? Program: Example of reading and writing example examples #include & lt; Opencv2 / opencv.hpp & gt; #include & lt; Opencv2 / highgui / highgui.hpp & gt; # Include & lt; Opencv / cvaux.hpp & gt; Int main (int argc, char ** argv) {IplImage * pInpImg = 0; // Load an image from the file - change it based on your image name pInpImg = cvLoadImage ("my_image.jpg", CV_LOAD_IMAGE_UNCHANGED); If (! PInpImg) {fprintf (stderr, "input image failed to load \ n"); Return -1; } // Write the image in a file with a...

haskell - Unpacking a Maybe on Lists describing Deltas (and is it a Good Idea in the First Place?) -

As a newcomer to Haskell, I have been reading top rated questions, new questions etc., and today it was one of the stack overflow: I thought, "OK, I will try Without seeing that answer. " For the beginning, I have written: Neighbors' faults [] = [] Neighbors [a] = [] Neighbors (x: y: xs) = abs (x - y): Neighbors (Y: xs) Then I can do at least neighbors [2,3,6,2,0,1,8,8] => 1 . But on which side did things work, but I did not care too much, so I thought maybe I would try to use it. I would need a way to customize the recursive rule to bear a "maybe" value, so I looked at Hogel and probably found from which seemed like I was Neighbors: [Neighbors] Neither neighbors [a] = bus [] Neighbors (x: y: xs) = bus (stomach (x - y): perhaps [] Neighbors (Y: xs)) but he did not give me a scope: maybe error is the main question Why would not this work be done? One more question is usually about Haskell's mind when looking at something like that. Is...

backbone.js - backbone el for tab in tabset? -

Whether the HTML element class (or ID) should be passed for the view, which is displayed on a tab in the tabet ? Some part of the code might explain a bit more: this.articleModel = new Article.Model1 (); This.articleView = New ArticleView.View ({Model: this.articleModel}); This.new_article = New Article.Model (); This.new_article.fetch (); This.editorView = New EditorView.EditorView ({el: $ ('tab2_area', model: this.new_article}); Option: [[Label: 'Tab 1', content: this.articleView.el}, {label: 'tab2', content: this tabset = new backbone.u. TabSet ({L: $ ('tab_details'), Option: this.editorView.el}}); and correlated HTML templates: & lt; Body & gt; & Lt; Div id = "medium" style = "float: right; width: 80%; height: 100%;" & Gt; & Lt; Div class = "tab_example" & gt; & Lt; Div class = "tab2_area" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div ...

ruby on rails - Nested attributes form error message customization -

Image
मेरे पास निम्न मॉडल है class OrgPerson & lt; ActiveRecord :: बेस has_and_belongs_to_many: TypRole has_and_belongs_to_many: OrgContact has_one: OrgCredential, dependent:: नष्ट कर रहा है belong_to: OrgCompany, foreign_key: "org_company_id" belong_to: TypPosition, foreign_key: "typ_position_id" मान्य: first_name, उपस्थिति: सही पुष्टि: last_name, उपस्थिति: सच स्वीकार करने के लिए स्वीकार करता है_अष्टित_एटी_गुणः Org क्रेडेंशियल एंड क्लास ऑर्गेक्रिडेन्शियल & lt; ActiveRecord :: belongs_to आधार: OrgPerson, foreign_key: "org_person_id" सत्यापन करती है: user_name, उपस्थिति: सच सत्यापन करती है: पासवर्ड, लंबाई: {न्यूनतम: 6} before_create: create_remember_token has_secure_password अंत और निम्न मजबूत पैरामीटर: डीईएफ़ person_params params.require (: org_person) .permit (: first_name,: last_name, org_credential_attributes: [: पासवर्ड: password_confirmation]) अंत और निम्नलिखित new.html.erb & lt;% = form_for (@person) do | f | & Gt%; &...

c# - Music spectrum visualization with better effects/graphics -

Image
I am making music player in C # / WPF. With the bass audio engine, I can create simple spectrum like this: But I am looking to create Is there any DirectX, OpenGL or other engine that can create similar effects that I can use in my application? It seems that WPF supports OpenGL, as you can see And even DirectX (though 9 seems to be) So, yes, you can choose your engine :)

python - Distributing an interactive matplotlib plot -

I have a python script which generates interactive maplotib plot with many sliders and radio buttons using metroplobalb widgets subdometer Does. I want to play other things with the resultant conspiracies without installing Python, SPP, MIDI, and Mapotlib. For the first time I tried to convert my dragon script to a single executable which I could deliver. It became a nightmare - I tried every package (Piointer, PY02, CX_Freeze) failed for one reason or another. The main issue I was with was to integrate various expert and maptalib libraries, and now I am very pessimistic about my interactive plot successfully "freezing". My next idea was to see if I could get some interactivity through the web browser. JS Animation initially seemed very promising (using the) an ipathon notebook with third party package, but it seems that the package only supports "apat" function matplotlib. What I want to do is not exactly fit for the bill, because I have several sliders, wh...

mysql - The max value in a column with php -

मेरे पास कॉलम "ऑर्डर" के साथ एक MySQL तालिका "MyTable" है आदेश - ---- 3 4 2 1 मुझे सर्वोच्च संख्या प्राप्त करना है। एसक्यूएल कथन MySql के अंदर अच्छी तरह से काम करता है: MyTable "से चुनें MAX (ऑर्डर)" ​​ लेकिन मुझे नहीं पता कि इसका उपयोग कैसे करें php और echo यह? कुछ ऐसा है: $ result = mysqli_query ($ con, "MyTable से चुनें MAX (ऑर्डर)"); mysqli_query ($ con, "MyTable से चुनें MAX (ऑर्डर)"); $ row = $ mysqli_fetch_array ($ result); गूंज $ पंक्ति [0];

how can i add binding.xml to Dynamically generated java sources (without xjc) -

मेरा कोड है: import com.sun.codemodel.JCodeModel; आयात कॉम.sun.tools.xjc.api.S2JJAXBModel; आयात com.sun.tools.xjc.api.SchemaCompiler; आयात com.sun.tools.xjc.api.XJC; सार्वजनिक वर्ग JAXCodeGen {सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग [] आर्ग्स) IOException फेंकता {स्ट्रिंग आउटपुट डायरेक्टरी = "डी: / src /"; // सेटअप स्कीमा संकलक SchemaCompiler sc = XJC.createSchemaCompiler (); sc.forcePackageName ( "com.xyz.schema"); // सेटअप सैक्स इनपुट स्रोत फ़ाइल स्कीमाफ़ाइल = नया फ़ाइल ("Item.xsd"); इनपुट स्रोत = नया इनपुट स्रोत (स्कीमाफ़ाइल.ओयूआरआई ()। ToString ()); // is.setSystemId (schemaFile.getAbsolutePath ()); // पार्स एंड amp; निर्माण sc.parseSchema (है); S2JJAXB मॉडल मॉडल = sc.bind (); JCodeModel jCodeModel = मॉडल.generateCode (रिक्त, शून्य); JCodeModel.build (नई फ़ाइल (आउटपुट डायरेक्टरी)); }} और मेरा प्रश्न है कि मैं कैसे कोड के माध्यम से बाध्यकारी.एक्सएमएल जोड़ सकता हूं ??? यह सब मुझे लगता है जैसे कि आप बस जावा प्रोग्राम से एक्सजे को खोलने की कोश...

c# - Get File Names from Web directory - from Services -

Can you please tell me what I bring to a web directory from the file name on the service level. I have wrapper services, I am trying to get the file name inside it. I found no solution If I understand correctly the question, since you too Not quite as easy as getting the FTP list: Using the system; Using System.IO; Using System.Net; Using System.Text; Namespace example. Sistmsknet {public class WebRequestGetExample {public static void Get object main () is used to communicate {// server FtpWebRequest request = (FtpWebRequest) WebRequest.Create ( "ftp://www.contoso.com/ "); request. Method = WebRequestMethods.Ftp.ListDirectoryDetails; // This example assumes that the FTP site uses anonymous logon. request. Credentials = new network credentials ( "anonymous", "Jane Doe." FtpWebResponse response = (FtpWebResponse) RequestkGetResponse (); stream reaction stream = response. Getresponsstrym (); Strymrider reader = new Strymreedr (responses); Console....

Rally 2.0RC3 - Retrieving last saved setting in RallyCombobox with custom values -

I am currently using a setting with a rally combo box. This setting looks fine in the screen, and the user's app is also selected back. But the settings screen does not load the lasting value in the RallyCombobox. It always shows the first item when the screen is opened (default behavior). Another similar question () I found at this point, but this last problem requires help. {RETIE COMMOBOX, NAME: 'selected column', Store config: {field: ['datindex', 'text'], data: [[text: GetSettingsFields: function: 'Display 1', Dataindex: 'id1'}, {text: 'display2', datindex: 'id2'}, {text: 'display3', datindex: 'id3'}), with multiple consensus: True, store type: 'Ext.data.store', fieldLabel: 'column:', displayfield: 'text', wellfilled: 'datindex'}]; }

Two functions working with getline on same fstream object c++ -

I have the following problem: I have these two functions for the first time reading a contact information from a TXT file, Symbols separated by the symbol '#' - txt file # 1 Name: AAA Phone: 08782634 Phone: 0245637 Date: 23.34 Phone: 324324324 # 2 Name: BBB Phone: 99 999 and it finds the length of each contact (the number of numbers between each '#'). The second call first calls one and the contact should be printed, but it prints the second contact, not the first. Is it possible that gateline somehow changes the stream from the first function, because the second function works when I first use a const int (hardcord capability)? int Contact :: FindNumberOfFields (std :: ifstream & in) {char * buffer = new char [1024]; Int cnt = 0; Int i = 0; Int pos = 0; While (in) {in.getline (buffer, 1024); If (strayer (buffer, '#')) {while (inline (buffer, 1024)) {if (! Strchr (buffer, '#') and strillan (buffer)) {cnt ++; } And {return cnt; }}}} In.c...

javascript - Node asynchronous route code -

I am using node with express 4.0. I can not find anything on the internet about embedding asynchronous code on the way. It is quite easy with the middleware: app '/ Some', function (rick, race, next) {doSomethingAsync (function (mistake, possibly sombeielsay) {// maybe checking some error Next ();});}); The problem with the routes is that there is no next callback, how does it show that when it comes to going to the next job? app.get ('/ something', function (rik, ridge) {res.render ('SomeTemplate'); // no next (), but it still works }); If I had to guess, then I would say that after the above work execution, the express moves for the next job but curiosity has launched the following code ... app.get ('/ something', function (rick, ris, next) {console.log (Next);}); ... and actually some next callback has been passed. So what's going on here? How does this work behind the scenes? And how can I enter asynchronous code there? ...

linux - mv command creates directories -

I am facing a very strange problem, for example, I have these directories "/ ten" and "/ a / Two / three / four "I have some files in these directories i when i execute the following command mv / ten / / one / two / three / four / five / six This returns output as mv: '/ ten /' to '/ one / two / three / four / five / six' can not be transferred: such a File or free Not the case that looks fine because this directory does not create But if I execute the following command mv / one / two / three / four / / one / Two / five / six Directories were created within five / six / one / two i.e. the MV command is successful. Can anyone please explain what is happening here? Edit: Further Overview .. Documents / one / two / three / four directories also exist / one / two / five are present MV / A / Two / three / four / / one / two / five / six / will be executed. The directory here will be made six, even if it is not present. It does n...

mysql - Hibernate not working Intellij driver not found -

I have a web application and I am working on hibernate. As soon as I call my webservice, which uses Hibernate, I am getting the error org.hibernate.service.classloading.spi.ClassLoadingException: The specified JDBC driver can not be loaded I have read some posts on SO, where the solution was to add the driver to the classpath. What I did for the first time, I've added the dependence to my pom.xml, but later it did not download any of the lbs, so I downloaded it manually from Maven. Now I "mysql-connector-java-5.1.31.jar" and other things in my labs but it did not have any effect. Later I copied Lib in my Tomcat / Libs folder, which had no effect. Why to load the driver and how can I fix it? My hibernate.cfg.xml: & lt ;? XML version = '1.0' encoding = 'UTF? -8 '& gt; & Lt ;! DOCTYPE Hibernate-Configuration PUBLIC "- // Hibernate / Hibernate Configuration DTD / / n" "http://www.hibernate.org/dtd/hibernate...

javascript - Get index of row in table using angularJS -

मुझे इस तालिका में प्रत्येक पंक्ति का सूचकांक, angularJS का उपयोग करना है & lt; table & gt ; & LT; tbody & gt; & Lt; tr ng-repeat = "कॉस्टोमर में ग्राहक" & gt; & LT; टीडी & gt; Cust.name & lt; / td & gt; & LT; टीडी & gt; Cust.phone & lt; / td & gt; & LT; टीडी & gt; Cust.address & lt; / td & gt; & Lt; / टीआर & gt; & Lt; / tbody & gt; मुझे एक ऐसा चर है जिसमें प्रत्येक पंक्ति का सूचक होता है, इसे प्रदर्शित करने के लिए नहीं चाहते हैं आप $ इंडेक्स का उपयोग कर सकते हैं & lt; tr ng-repeat = "costomers में cust" & gt; & LT; टीडी & gt; {{$ अनुक्रमणिका}} & lt; / td & gt; & Lt; / टीआर & gt;

java - Date locale in JasperReports -

I am writing a program in Java that uses JasperReports to generate reports is. One field in the report area is a date field. I send local variables like this: map parameter parameter = new hashmap (); ParametersMap.put (JRParameter.REPORT_LOCALE, myLocale2); This is working fine but the problem is that the time is also visible in the date field. I used the DATE () function in MySQL, but I still had time in my report. I just need to show the date (in the right place). If I define the pattern variable in the report that the date is shown in a specific format then the time will not appear, but this will cancel the locale setting and I do not want it, can anyone tell me to get rid of time information How to get it? You can try this: The ultimate Example: parametersMap.put ("date", new simple data format ("mmm dd yyyy", locale.frenas). Format (new date ()); Set this date in your report. Enjoy.

ruby - Rails elasticsearch aggregation -

Somehow I do not seem to get a response with my aggregates ... It uses curl As it works: HBZUMB01 $ curl -XPOST "http: // localhost: 9200 / content / _search" -d '{"size": 0, "ags": {"Sport_count": {"Value_count": {"field": "dwid"}}}} ' I get the answer: { "Total": "Total": 5, "Successful": 5, "Failed": 0}, "Hit": {"Total": 90, "max_score": 0.0, However, using code in Rail: query = '{"size": 0, "aggs" : {"Sport_count": {"value_count": {"field": "dwid"}}} '@response = Content.search (query) To_json and rendering it in the browser response_to do format | Presentation of the format.html: "# {@ response}" end I get an empty response: [] How can I print my aggregates here which I got with curls? I was also struggling with it, bu...

java - How to setup zxing library on Windows 8 machine? -

I have images of code that I want to decode. How can I use zxing so that I can specify the image position and get the decoded text back again, and if decoding fails (this is for some images, this is a project), then I have an error Meets. How can I setup zxing on my Windows machine? I downloaded the jar file, but I do not know where to start from, I understand that I have to make a code to read the image and provide it in the library reader method, but how to do a guide which will be very useful . This project contains a class called CommandLineRunner , from the command line You can also call on your source how it works and it is reused. There is nothing to install or set up. It is a library, usually you do not download the jar but declare it as a dependency in your Maven-based project. If you want to decode only one image, then use it

encryption - How to make Ubuntu's crypt(3) support Blowfish? -

According to the manual, the blufffish (denoted by the $ 2 $ $ prefix) is one of the supported cipher methods: > id | Method ───────────────────────────────────────────────── ──────── 1 MD5 2A | Blowfish (not in the main line; Linux distribution in some) 5 | SHA-256 (from glibc 2.7) 6. SHA-512 (from glibc 2.7) However part bluffish (not in the main line, added in some Linux distribution) is a misleading and scrotum document, so I There are some questions. First of all, if "mainline" glibc does not support bluffish, which glibc does it? Uses Ubuntu 14.04 glibc 2.19, packed in the libc6 / libc6-dev package. Assuming this is the "main line" glibb, the bofish is not supported. Apparently there is a patch that is called to add support to bluffs to bluffs. Why is it not enabled by default in Ubuntu? And last but at least, what is the easiest way to create a C-crypt () function in Ubuntu? First of all, if "mainline" glibbs does not support ...

jquery - Populating the hidden field in Javascript -

I'm using Knockback.js. I'm a newbie for this whole JavaScript and HTML. I'm trying to populate the hidden fields in the addFolder function, but it's always showing blank. This is the following JavaScript code (View MODEL). groupsView = LS.ViewModel.extend ({initialize: function (option) {if (optionsof options! = 'Undefined') {this.projectskey = Options.projectskey; this.folderkey = options .folderkey;} this.options = option; this._this = this; this.c = new group option (empty, option); this.c.fetch ({add: true}); this.groups = kb.collectionObservable (this .c);}, Fetch: function () {$ ('# loadingAnim') Show (); this.groups.collection (). Fetch ({update: true, add: true});}, addFolder: function (VM, Event) {event.preventDefault (); $ ("# plgGroupsGetContents") Val (vm.projectskey); $ ("# plgGroupsGetContents1"). Val (vm.folderkey)); Vm.c.addFolder (); $ ('# DialogEdfolders') Model ('hide');} }); And this i...

OSX Objective C BOOL/vars thread safe? -

Simple question ... What is a global BOOL thread safe for me to use for thread synchronization? Other data types are actually safe, e.g. Long long ..? Example: I have a task that runs - only once to run it together. & lt; Pre & gt; BOOL is isunning; Unsigned long-term progress; If (IsRunning) {dispatch_async (secondary task, ^ {{self-declarer}}}; - (zero) doWork {isRunning = TRUE; Have a long session = Running; } & Lt; / Pre & gt; For the nuclear type, the same rules apply equally to the normal C. So there is no guarantee of thread protection on any of them. OSAtomic, NSConditionLock , NSLocking Protocol, Serial Remote Queue, Personal Runlops, Use Memory Fence to Get Thread Security, Spin Lock, e.t.c. For the trivial code given, which I accept is probably for Exposure, you will provide the most complete handler block, which will be asynchronous block sending upon completion if it is a serial queue , Then just press the job for it. Consider a remitt...

Create SQL Server stored procedure with stock data -

I am trying to turn on some code, which is in a stored procedure with those standards from SQL Server What I can pass, but I'm not sure how to do this I need to have 4 variables of the letter stock symbols to be different so that I can pass through different symbols, to work as a cached procedure This code is also required for. GOOG is the place where I need the variable. ' - Announced RSS Feeds @ DoctorHandle INT; DECLARE @ xmlData XML; DECLARE @URL NVARCHAR (255); DECLARE @ fileNVARCHAR (255); DECLARE @ CMD NVHAR (255); DECLARE @sql NVARCHAR (255); DECLARE @tXML TABLE (Data XML); SET @URL = 'http://finance.yahoo.com/webservice/v1/symbols/GLUU/quote'; SET @file = 'c: \ temp \ quotes.xml'; - Downloading data @ CMD = 'C: \ windows \ system32 \ WindowsPowerShell \ v1.0 \ PowerHold (New Object System .Net WebClean). Download file ('' + + @URL + '', '+' file '' '') 'Accelerate Master Debian.xp_cassache @ c...

android - Listview items are recreated in wrong order -

I found a list view with some string items in it. I am trying to save the state of listview in shared options in the onStop () method of the piece: int i = 0; Hashset resultset = new hashset (resultdate.account ()); While (i & lt; resultAdapter.getCount ()) {resultsSet.add (resultAdapter.getItem (i)); I ++; } Editor.putStringSet ("RSLTS", resultset); Editor.commit (); In this way, I recreate the list view status after relaunching the apple: if (resultsSet! = Null) {for (string result : ResultsSet) {resultAdapter insert (result, 0); }} As you can see, Im place each new row on the first place (0) of all list entries. The problem is that the list overview is created in something odd, for example: List view before saving: 3 ... | 2 ... | 1 ... List view after reloading: 2 ... | 1 ... | 3 ... Find out why this is happening? Does anyone have any clue about this which is wrong? Hashesets usually do not apply with a defined order, so it is not guarant...

java - 'Reading an unknown amount of values'? Unsure what to do -

I need to create a program in Java that reads an unknown amount (integer), and when entered a negative value "Itemprop =" text "> Here is the code: scanner = new scanner (System.in); Int num = in.nextInt (); & lt ; Integer & gt; Lst = new ArrayList & lt; Integer & gt; (); while (num> = 0) {lst.add (num); Num = in.nextInt ();} Collections.sort (lst ); System.out.println ("Trimmed Input:" + lst); This takes input from the console. It takes input to a neg, not registered (as you have mentioned in your question) The result does not occur after the nagg. (As you have your question Is mentioned in the comment)

Local SQLite DB in FLex Mobile app -

I'm doing an app coding for Android and iOS devices using Flex. I have already created a SQLite DB and I want to access my data. I've seen some code looking with Google but I'm not able to run anything. I would be happy if you tell me where I have placed file.db in my project and if you share some simple code that allow me to connect to file.db and select some rows, my bad english and Thanks in advance for the thanks. The code will return an object from the data bellow to the database. package bd {public class SQLPadConnection extension Extended SQLStatement {protected var _DBFilePatch: String = "DB.sqlite"; Protected var _conn: SQLConnection = new SQLConnection (); Public function SQLPadConnection () {var folder: file = File.userDirectory.resolvePath ('com.app.directoryName'); If (! Folder.exists) {folder.createDirectory (); } _conn.open (folder .resolvePath (_DBFilePatch)); This sqlConnection = _conn; Super(); } Public function getSQLData (SQ...

javascript - How to remove element with empty attr on page load -

I am using an entry which depends on how to add jQuery's entry to an overlay, depending on which The image is clicked which works well. But if no image is inserted then I want to remove the containerImage img . This is the closest I got to click and remove empty tags, but I want to do it on page load. $ (document) .ready (function () {var $ container = $ ("# container image img"); $ container.click (function () {if ($ container.ttR ("Src") === "") {$ (this) .remove ();} else {console.log ("not empty");}}};}); Here the HTML in the IMG tag is, I'm calling the images to go into the empty source So the above example has only 2 images, I want to remove that box after leaving it with a 3 empty box and after filling the images. Here is the code to fill images, as well as title and description $ (document) .ready (function () {$ ('. BoxImage') Click (function () (var project = $ (this) .attr ('project'), desc...

Submit a XML request in PHP -

I am trying to get information from an API. I want to be able to get the "Location:" property from the API response and would like to capture it as a variable in PHP. Here is an erosion from API docs so that you can know what I'm talking about: Read the person's portrait address from the request of this example It shows how to read a description of the picture for a tree person. XML Request Receive / Forums / Trees / Individuals / KWWM-5R1 / Portrait Accept: Application / X-FS-V1 + Xml Authority: Carrier YOUR_ACCESS_TOKEN_HERE Feedback HTTP / 1.1 307 Temp Redirection Transfer-Encoding: Chunked Cash-Control: No-Transform, Sure-Modified , Max-age = 0 Content Type: Application / X-FS-V1 + Xml / Variation: Accept-Encoding / Variation: Sweep Accept-Language, Accept-Encoding, Expect Location: / Domain / Path / Per / Image X-Processing Time: 1 Content Location: / Platform / Tree / Individuals / PPPP-PPP / Portraits To capture the return and locat...

objective c - How to prevent division by zero when the denominator is a CGFloat? -

I have a number that is a CGFLOT and I want to divide it by a few numbers. How can I ensure that the separator is not equal to zero or NaN? The following example examines the separator before partition to ensure that it is not 0 or NaN CGFLot dividend = 5f; CGFloat divisor = 3.f; If (! (Adnan (divisor)) separator == 0.f)) {CGFloat quotient = dividend / separator; }

Python: looping over characters in a string when string is changing -

def substitutionEncrypt1 (पाठ, कुंजी): plaintext = text.lower () alphabet = "abcdefghijklmnopqrstuvwxyz" ch के लिए मेरे पाठ "त्वरित ब्राउन फॉक्स" है, मैं समझता हूँ कि यह क्यों नहीं करता है एक प्रतिस्थापन सिफर को ठीक से एन्क्रिप्ट नहीं किया जाता है, लेकिन अजगर पांचवें पंक्ति में त्रुटि कहां से कहता है "substring नहीं मिला"? क्या मैं सादे टेक्स्ट में अक्षरों के माध्यम से नहीं चल रहा हूं? आपको पुनरावृत्त नहीं करना चाहिए कुछ पर (यह एक सूची, या एक सेट, या एक शब्दकोश ... आपको यह विचार मिलता है) कि एक ही समय में संशोधित किया जा रहा है - और इसके अलावा, एक स्ट्रिंग अपरिवर्तनीय है, इसलिए वास्तविकता में आप प्रत्येक पुनरावृत्ति पर नए स्ट्रिंग्स का निर्माण कर रहे हैं। पायथन में प्रतिस्थापन सिफर को लागू करने के लिए, उपयोग करने से कुछ भी आसान नहीं है - और हम दोनों दिशाओं में अनुवाद का काम कर सकते हैं: आयात स्ट्रिंग वर्णमाला = 'abcdefghijklmnopqrstuvwxyz' subst = 'edbjvushlpknyxt foqiwacrzgm' तालिका = String.maketrans (वर्णमाला, ऑब्जेक्ट) ...

PHP - Fatal Error: Call to undefined method - but method exist -

Image
I am currently making a ticket handler system, however, when I try to call someone, a very surprising Receiving the error is my class The error is: Fatal error: Call the undefined methodTatics :: Submit Nautilica () /home/shortcut/public_html/MyDOMAIN/explore/account/tickets.php on line 68 in However, the method I am attempting to use is definitely defined in my class, and it is being printed in get_class_methods ... what do I do if I am hurt Here is the main code to call this method. need_once ('app / makeTickets.php'); $ Attics = New Make Ticket ($ Log In User); Print_r (get_class_methods ($ etickets)); $ Etickets- & gt; SubmitNewTicket (); Here's the actual square. & lt ;? Php class maketickets {public $ id; Public $ user; Public function __ conversion ($ user) {$ this- & gt; User = $ user; $ This- & gt; Id = $ user- & gt; User_id; } Public Function View Nautical (?) {? & Gt; & Lt; Div class = "card" & gt; ...

Compiling rust-bindgen on Ubuntu -

Does anyone manage to compile at Ubuntu 14.04? I do not know, for example, how to constantly construct and link to libclang.so . I use night and day. The following sets only executables, not macros. I think you have git and rustc setup correctly $ git clone https: // github. / Crabtw / rust-bindgen $ cd Rust-bindgen Create a Library: $ rustc lib.rs To connect with a previously created library, make wrapping executable: $ rustc -L Bindgen.rs Run executable in this case on the Xlib header: $ ./bindgen -l xlib -o Xlib.rs /usr/include/X11/Xlib.h In that case, libclang is incorrect setup, in that case, pre-load the correct library and Pass the right option to quarrel: $ LD_PRELOAD = / usr / lib / libclang.so./bindgen -i / usr / lib / Clang / 3.4.2 / include -l xlib -o xlib.rs /usr/include/X11/Xlib.h To install the correct version of the clang, you try to install can do.

python - Writing a custom router in Django Rest Framework -

I am reapplying my existing code-base to my API. I have a structure where the URL can have any part of "Lookup" (such as /api/{lookup1}/{lookup2}/.../{lookupN}) you can see it as a regular file path Can Think In Computer File System? At the moment I just instructs the request in the APIView that breaks the URL and searches on the basis of the request URL. However, now I read more about the DRF router and think I can use this system to work again using router. I am now studying the router, but in reality it did not understand that I requested the request "intercept" and then

Python igrap create manual graph -

igraph import from * g = graph (guided = true) #now create simple guided tomas - & gt; Dennis, Dennis - & gt; Swan, Swan - & gt; Tomas, Dennis - & gt; Burt GV ["Name"] = ["Tomas", "Dennis", "Swan", "Tomas", "Burt"] layout = G. Layout_community_command () gv ["Label"] = GVS ["Name"] layout = g Layout ("work_key") plot (G, layout = layout) Is it appropriate to label the connection. (Under-indented / guided lane) You can do something like: from Igraph import * g = graph (guided = true) g.add_vertices (5) g.add_edges ([(0,1), (1,2), (2,3), (1,4) ]) G.vs ["name"] = ["Tomas", "Dennis", "Hans", "Tomus_2", "Burt"] GV ["Label"] = GVS ["name"] #Now I count the number of edges and I give numbers as g.es ["name"] = range (g.ecount ()) G.es ["label"] = g.es ["nam...

ios - How to prevent scrollview in UITableView when user swipe gesture down two touches? -

I think that when user swip direction is down on UITWV, I do some stuff and not scrolling the table is. How can I do this? If you want your UISwipeGestureRecognizer UITableView's UIPanGestureRecognizer , you just need to set up and implement a representative of your swipe gesture - (BOOL) Gesture: Identifier: (UIGestureRecognizer *) The gesture must be recognized with synonymsistician : (UIGestureRecognizer *) otherGestureRecognizer then return yes . If you want to disrupt the tableview's pan gesture, you probably can not use the UISwipeGestureRecognizer to do this, since the user actually swiped a certain distance until it Not really. If you need it, then maybe you can use a UIPanGestureRecognizer for counterfeit behavior. I was able to get something similar: #pragma icon UIViewController lifecycle - (zero) viewDidoadload [[Super Viewedloadload]; UIPanGestureRecognizer * panner = [[UIPanGestureRecognizer alloc] initWithTarget: Auto Actions: @Selec...

Cannot get date from google sheet filled by google forms -

Purpose: To remove date and time from the sheet (created by filling Google Forms) and sending them to the body of the e-mail Automatically use script to set script editor code: sendEmails function () {var sheet = SpreadsheetApp.getActiveSheet (); Var startRow = 16; // var numRows = 1 first row of data to process; // Number of rows for processes (var j = startrow; j & lt; startRow + numrows; j ++) {var color = sheet.getrange (j, 10) .getBackground (); Get a range of ("# 00ff00" == color) {// cell A2: B3 var row = sheet.getSheetValues ​​(j, 1, 1, 14); // J row with 14 / NSE color names with stdents = row [0] [0] + "" + row [0] [1]; Var time = line [0] [6] + "at"; // + row [0] [7] + "at" + row [0] [8]; Var named = "Dear" + row [0] [9] + ","; Var email receipt = line [0] [13]; Var topic = "date and time" + line [0] [5] + "at" + row [0] [6]; Var msg = nameRecipient + sheet.getRange ("L11"). ...

python - How to change the color for Elpy autocomplete box and not display the private variables first -

Image
I am trying to run Amax 24.3.1 on Ubuntu 14.04 configured for Python development, I am using for completeness. Currently facing two problems, both of these screenshots can be seen in: . It is very difficult to work with color scheme and personal methods always appear first in the list. The relevant rows in my emacs init are: ;; Popups ('require popups) ;; Python-mode ('package is required) (add-list' package archives' ("alipi". "Http://jorgenschaefer.github.io/packages/")) (LP-enabled) ;; Fix a major compulsive bug in Eliphay (defining key -maximally-mode-map (kbD "cc") or define (defined-key global-map (kbid "cc o") 'iidit-mode ); ; Use JDI for auto integer (setc ali-rpc backend "jdi") (setac p-install-directory "~ / .emacs.d / python-mode.el-6.1.3") (add-to- List 'load-path py-install-directory' ('require Python-mode); Use IPython (setq-default py-shell-name "ip...

html - automatic photo slider with fade in and out animation- javascript only -

I have a 5 image slider that automatically changes in a loop in a few seconds. I have to quit animation before and after changing each image. This is my code: HTML: & lt; Div id = "slider" & gt; & Lt; Img id = "bigImage" src = "img / Traffic1.jpg" & gt; & Lt; / Div & gt; 4) {imageIndex = 0; }} Var imgTimer = setInterval (changeImageByTimer, 3000); I can not convert the html code to javascript only. I would like to use javascript only any suggestions? So, there is a JavaScript implementation that is as simple as that. You want to read on jQuery, and especially if you want to customize it a bit too much animation. This is working jsBin: In fact, its only important aspect is: bigImage.animate ({opacity: .1 }, Function () {$ (this) .attr ('src', image array [imageindex])}); So what's going on here, are you selecting the image, and animating its ambiguity once opacity has reached 1, the callback fu...

c# - Get value for Style from property of the instance to be styled -

I would like to create elements during the runtime and will add them to a style. Looking at the following Xaml, I would like to bind the value to the property center the actual values ​​of a style object (see main method). I tried different binding notes but without success (probably because I'm still new to xaml) I tried to change just the center on this example but the examples are frozen and it can not be changed. & lt; Window x: name = "window" x: class = "circularing manwindow" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http://schemas.microsoft .com / winfx / 2006 / xaml "title =" main window "height =" 350 "width =" 525 "& gt; & Lt; Window.Resources & gt; & Lt; Style x: Key = "AlertBubble" TargetType = "{x: type path}" & gt; & Lt; Setter Property = "Stroke Exposure" Value = "0" /> & L...