Posts

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 -