Posts

Showing posts from July, 2015

python - Django: Could not import settings -

मैंने यह कमांड चलाया: अजगर manage.py चालक 0.0.0.0:8000 < / code> त्रुटि प्राप्त करें: ट्रेसबैक (सबसे हाल ही में कॉल अंतिम): फ़ाइल "manage.py", पंक्ति 11, & lt; मॉड्यूल & gt; execute_from_command_line (sys.argv) फ़ाइल "/usr/lib/python2.6/site-packages/django/core/management/__init__.py", पंक्ति 399, execute_from_command_line उपयोगिता में। execute () फ़ाइल "/ usr / lib / python2 .6 / site-packages / django / core / management / __ init__.py ", पंक्ति 392, self.fetch_command (उप आदेश) निष्पादित। Run_from_argv (self.argv) फ़ाइल" /usr/lib/python2.6/site-packages /django/core/management/__init__.py ", पंक्ति 261, fetch_command आदेशों में = get_commands () फ़ाइल" /usr/lib/python2.6/site-packages/django/core/management/__init__.py ", पंक्ति 107 , में get_commands apps = settings.INSTALLED_APPS फ़ाइल "/usr/lib/python2.6/site-packages/django/conf/__init__.py", पंक्ति 54, में __getattr__ स्वयं। _सेटअप (नाम) फ़ाइ

ios - How to call UICollectionViewCell ImageView in IBAction Method? -

I am struggling with something that can be easy, but I can not get it! I have a button inside a UIImageView and UICollectionView inside the UICmlectionViewCell 0) {cell.imageFile.image = [UIImage imageWithData: data]; UITapGestureRecognizer * infoLook = [[UITapGestureRecognizer alloc] initWithTarget: Auto Actions: @Selector (HandsetTap :)]; InfoLook.numberOfTapsRequired = 1; [Cell.imageFile addGestureRecognizer: infoLook]; } And {{cell.progressView removeFromSuperview]; }} Progress block: ^ (integer percent donation) {float percentage = percentage dan * 0.02; [Cell. Progress progression set progress: percent]; If (percent dan == 100) {[cell.progressView removeFromSuperview]; }; [Cell. Activation indicator stop animation); }]; Return cell; } verb method: - (zero) handleTap: (UITapGestureRecognizer *) infoLook {if ([sender is selected]) {[sender setImage : [UIImage imageNamed: @ "Like.png"] forState: UIControlStateNormal]; [Sender set selected: no]; } And {[sender

python - An error occurred importing your passenger_wsgi.py on server -

I am getting an error "There was an error importing my passenger_real" on the dreamhost server Passenger_wsgi .pi file import system, OS InterP = '/ home / daimirer / books Harcrow IM / Itra / Bean / Python sys.path.append ('/ home / dramira / books .everycrave.me / flipbook /') If sys.executable! = INTERP: os.execl (INTERP, INTERP, * sys.argv) sys.path.append (os.getcwd ()) os.environ ['DJANGO_SETTINGS_MODULE'] = "Import settings" django.core.handlers.wsgi application = Django.core.handlers.wsgi.WSGIHandler () I get an exact error when compiling passenger _wsgi.py traceback (most recent Call final): File "travel_wasfi", line 7, & lt; Module & gt; Import django.core.handlers.wsgi ImportError: a module named django.core.handlers.wsgi I fix passenger_wsgi.py file for other websites by working on the same server Has compiled for. I do not know what problem I am experiencing here Please help me. Your passenger

c - What is (void)(p) doing here? -

इस सवाल का पहले से ही एक उत्तर है: < / P> 8 जवाब 2 जवाब मैं कोड की जांच कर रहा था और मुझे निम्नलिखित स्निपेट पर आया था: int check (char * a) {(शून्य) (ए); // यह लाइन क्या कर रही है ?? वापसी 0; } Int main (शून्य) {char * p; पी = (चार *) मॉलोक (आकारफ (चार)); (पी) की जांच; वापसी 0; } (शून्य) (ए); क्या कर रहा है? फ़ंक्शन में किसी फ़ंक्शन पैरामीटर का उपयोग नहीं किया गया है तो कुछ संकलक चेतावनी दे सकता है, (शून्य) एक ऐसी चेतावनियां चुप्पी कर सकता है। एक और यह प्राप्त करने के लिए आम तरीका है: int चेक (char * a) {a = a; वापसी 0; }

ruby on rails 3 - Refactoring in rails3 -

I have 4 verbs in my controller and I have to check some situations within each action. What is the best way to do this? For example, the condition to be checked for each action is below if param [[id] == $ boy.id @rec = $ boy.name elsif params [: id] == $ Girl id @rec = $ girl.name Other render: json = & gt; {"Error" = & gt; The person with "# {Params [: id]} does not exist"} and the end of the return You have two options here: Type a method that checks the conditions and returns the result to call it. before_filter But if you add more work to your controller, then you have to leave the first_filter for those tasks, which do not need to check the condition. Example: 1: DIF check if param [[id] == $ boy.id @rec = $ boy.name elsif params [: id ] == $ girl.id @rec = $ girl.name else @json = {"error" => The person with the <# parameter [: id]} does not exist "} Return @ Jason End & Def some_aunch results = check #

html - Adjusting the browser zoom size -

Now I have read a couple in response to this question, but I have not tried to do them with any luck. I have found that on the website I am developing, I have set my browser zoom in comparison to the size of the zoom zoom I want to adjust for those who still have the zoom size default. Being a curious person, I wonder if I can resize the browser for that window. If the user wants to zoom in or out after loading on the page, but I have to see if there was a way to keep a default zoom so that it looks like how it should be done. Some things I've tried This tried and did not really change anything on my browser. I have set it to check in the default format, and after changing all the numbers it has never made the difference. So I came in a different way to do this in CSS and nothing happens on this matter. @ - viewport {zoom: .5; } So now I am on SO I am not 100% positive even what I am doing is the right way to do it. I can track something completely, so the same

Where to put logic dealing with more than one models -

In a MVC framework like Rail, business logic is required in the overall consensus model. However, when it comes to logic as "all the problems solving user", I'm not sure which model class I should argue because it needs to first look at all the solutions submitted by all users, And the problem is to gather the ID from each solution, then the problem IDs all need problems. It looks more beautiful to put in the user model, so we can make some calls like user.getAllProblemsSolved (). However, user frequency needs us all the User ID In those places where a user instance is not easily available, we have to make one to call our getAllProblemsSolved method. What's more, because logic mainly deals with problem and solution models, it stinks feature jealousy to put in the user model. To avoid the feature jealousy , it seems equally well to put into problem or solution. Intuitively, I will make it like the problem in the Problem.getAllProblemsSolvedBy (userId) ,

java - remove conditional statements when dealing with inheritance -

I want to avoid conditions and apply some techniques to improve codes and make extensible easily when Working with heritage classes. We have in this example. Both MarketOrder and LimitOrder expand with the base class order. TradeServiceImpl with the Trade get GetUnitPrice method that will be 2 orders traded In this method, there are several conditions for selecting the right value for different types of orders. In addition, it is being converted into derivative classes. The problem with this method is that if I want to add 5 new orders, then I have to give 7 * 7 = 49 statement, in some of them, convert me into a derived class which I I can confuse that, which seems to be very easy to write a buggy code and gives me the smell I should redesign Can I get some ideas? // Domains Public Class Order {Private order type reward order type; // PUBLIC ORDER TYPES EONOM can buy or sell getOrderType () {return orderType; } Public Zero Set Order Type (Order Typ Order Order) {this

html5 - Javascript: Count number of screen -

We are developing a web application that will use 4 screens. What is the method to calculate the number of screens? this may help assuming the rectangular arrangement of the screen and all screens There is a single height and width. / / Total window width is divided by single screen width h_screens = Math.round (window.outerWidth / window.screen .availWidth); /// Total window height var v_creens = Math divided by single screen height (Window. Oat / window.screen.availHeight); var total_screens = h_screens * v_creens; ▆ ▆ ▆ ▆ 4 = 2 * 2;

php - how to store the value from html dropdwon list to use in the same page -

मेरे पास यह कोड है - & lt; form method = "post" action = " generate.php "& gt; & lt; नाम चुनें = "परीक्षा" आईडी = "टेस्ट" & gt; & Lt;? Php $ i = 0; foreach ($ testName $ नाम के रूप में) {? & gt; & Lt; विकल्प मान = "& lt;? Php echo $ name;? & Gt;" & gt; & lt;? Php गूंज $ टेस्टनाम [$ i];? & Gt; & lt; / विकल्प & gt; & Lt;? Php $ i ++; }? & Gt; & Lt; / चयन & gt; & Lt; इनपुट प्रकार = "सबमिट करें" name = "submit" value = "उत्पन्न" & gt; & Lt; / प्रपत्र & gt; मैं उपयोगकर्ता द्वारा चुने गए मान को उसी तरीके से कैसे संग्रहीत कर सकता हूँ जिसे मैं उसी php पृष्ठ में उपयोग कर सकता हूं? = "छिपा" & gt; और चयन तत्व पर एक onchange ईवेंट को कॉल करें। & lt; नाम चुनें = "test" id = "test" onchange = "परीक्षण ()" & gt; समान जेएस फ़ंक्शन लिखें, & lt; स्क्रिप्ट

performance - How is 6M TPS counted/measured in LMAX's disruptor pattern? -

What is the number of factors in the IO operation? Or is it just the number of transactions, can the architecture read and match with memory / writing? What hardware do they use during testing? It probably does not matter, but what OS used it? With LMAX, IO usually has transaction loop and elsewhere / P> As long as no one can answer that in order to actually run that benchmark, I can only assume that they have some kind of counter and any type of time measurement. But I do not think it was on a multi-socket configuration. In addition to this 6 M TPS hearing from 2011 or 2010, you should run your test with a dispenser. The benchmarks they wanted to run could not reflect either that you need to complete, and, unfortunately, this latency / throughput number will vary greatly for slight changes in the circumstances. Knowing the OS or hardware can cure your curiosity, but this number will not make more meaningful than your own evaluation.

How to use comparison operator in Javascript for two input values -

I want to compare two input values, just try it in javascript, but it is not working properly. I am using the following code function check_closing () {var opening = $ ('#include'). Val (); Var closing = $ ('# off'). Val (); If (opening and closing; off) {warning ('opening more than, please enter correct value'); $ ('#closure') val (''). }} If the initial value is input = 8541, the closing value such as = 8241, this job is okay, but if closing 954 it is not working please help. Thanks in advance. Convert a string before comparing the string: Check_design () {var opening = $ ('#include'). Val (); Var closing = $ ('# off'). Val (); If (persian (openings)> purse (end) {warnings ('opening is more than closed, please enter correct value'); $ ('#closure') val (''). }}

elisp - Emacs extension specific keybinding -

I am trying to write a keybinding to comment on the current line which does something like this for Ajithan. (fable 'comment (lambda (& amp; alternative AGG) "keyboard macro." (Interactive "p") (kmka-egg-ring-item (quotation ("^ a ^ [ How can I use the same key binding on multiple languages? Python and CPP? To identify the file type and accordingly execute the keybinding. What is anyway? Only a specific keypad for the keybind: (eval-after-load "python-mode" '(defined-key python-mode-map "\ Cx /"' comment))

php - Have a local codebase but remote database in WordPress -

In our team, I used to be the only developer, used to coding directly on our remote dev server, but we had more developers So we need to move the codebase on our local machines so that we do not face any file conflicts. However, although I want to use a local codebase, I do not want to use the local database, there is a problem synchronizing the database and honestly not really necessary so we have more than one Sticking on codebase, but a database. How can I run WordPress on my local machine while still using our remote server database? How can this be fixed in the MAMP? I'm new to server / port / database installation, so this is not my strong suit problem which I do not know how the URL turns out to be around. For example, our WP sites have url formats: site1.portal.dev site2.portal.dev When I write these URLs, then I should be Codebase , but Database is known as our remote dev server. Update the configuration to point to the remote database. Unle

javascript - Paper.js canvas change function triggered by button -

I am trying to update my canvas which uses paper.js via a button click. Button Do not know about my change POS () function? & lt; div class = "myCanvas" & gt; & Lt; Canvas ID = "canvas" width = "600" height = "600" & gt; & Lt; / Canvas & gt; & Lt; / Div & gt; & Lt; Button id = "some_button" onClick = 'changePos ();' & Gt; Change Status & lt; / Button & gt; The first script in the following script is paper.js and the second script starts the "O" text on my canvas. This is where the changePos () function is located that my brain The button should be called in when it is clicked. & lt; Script src = "/ paperjs / paper.js" type = "text / javascript" & gt; & Lt; / Script & gt; & Lt; Script type = "text / papercript" canvas = "canvas" & gt; Var text = new point text ({point: visual center, justification: &

javascript - Form Based login in angular js -

I'm new to Angular JS and went through their tutorials and I felt it for I have a backend prepared to prepare my project, where the rest of each point is required to be certified. This will give 401 responses, when the user will not be authenticated for every request. And this is opening a default login pop from the browser. And I want to open login.html instead of that default browser pop-up. Is there any way to do this, I looked here and here, but how could I not understand how to use them. So please have compassion for explaining it. Thanks Can you expand a bit more about your problem? How did the browser popup come from it came from server side? Or do you implement popup on the scene other than login.html?

java - Reading a file of txt to be fed into an array -

Here a user enters the list of 1 and 0 .... then an input will be 10001010. But I have to read this from a text file ... In my text file input.txt there are also 10001010 ... the coverDataArray array is required to feed the same string from a file to the console. I tried the data stream though, it throws an exception to me ' ... ..... try {System.out.println ("Enter binary bits" ); Data1 = in.next (); For (int i = 0; i & lt; data1.length (); i ++) {covertDataArray [i] = byte Parsbyte (data 1.substring (i, i + 1)); } ' You can pass an file object instead For the System.in scanner constructor it is shown below: string filename = "input.txt"; File file = new file (filename); Scanner scanner = new scanner (file); String s = ""; While (scanner.hasNextLine ()) {s = scanner.nextLine (); // your code. You can use scanner.next () to read words by word instead of nextLine ()} .

android - How to include a string resource in XML format accessible in every *.cs file? -

As my title says, how can I include a resource string in XML format that I can access with my ID Can i It is auto generated in id dot2 but I do not get any education in Google. Create a new file string with this content. XMM: & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Resources & gt; & Lt; String name = "first name" & gt; Mr. Fifth & lt; / String & gt; & Lt; / Resources & gt; Add this to your project and set the build action property to 'Values ​​Resource'. If you open RCS (inside the Properties folder), you will see that the following code is generated: // --------- --------------------------------------------------- ------------------- // This file is automatically generated by dot42 --------------------- ---------------------- ---------------------------- ------- Namespace dot42Application2 {By using the system; Public sealed class r {public sealed class strings {public

android - Custom Adapter with Base adapter list items repeating -

टेक्स्टव्यू गतिशील रूप से बनाने के दौरान कस्टम एडाप्टर । मूल रूप से उपहारों की विभिन्न संख्या के साथ अलग-अलग गेम हैं उदाहरण के लिए एक खेल 3gifts के लिए वहाँ हो सकता है इसलिए इस कारण से मैं TextView गतिशील रूप से बना रहा हूँ लेकिन समस्या यह है कि आइटम हर स्क्रॉल के लिए दोहरा रहे हैं पृष्ठ को लोड करते समय स्वयं काम नहीं कर रहा है? क्या कोई भी मुझे सुझाव दे सकता है कि कैसे हल करना सार्वजनिक दृश्य getView (अंतिम पूर्णांक स्थिति, कन्वर्टव्यू देखें, ViewGroup पैरेंट) {देखें दृश्य = कन्वर्टव्यू; देखेंहोल्डर धारक; If (convertView == रिक्त) {दृश्य = ((गतिविधि) संदर्भ) .getLayoutInflater ()। फुलाया (आर। लेट ..single_redeem_gift, अभिभावक, झूठी); धारक = नया देखेंहोल्डर (); holder.expiresDate = (TextView) view.findViewById (R.id.expires_date); धारक। एक्सपेरस टाइम = (पाठदृश्य) दृश्य.फ़िन्डाव्यूबीआईआईडी (आर.आईड.एक्सपीयर_टाइम); धारक। राइट-कंटेनर = (रैखिक लेआउट) view.findViewById (R.id.right_container); धारक। ब्रैंड इमेज = (छवि दृश्य) देखें। फ़िन्दव्यूबीआईआईडी (आर.आईड.लिस्ट_इंजेज); view.setT

css - circular bullets are not displaying in html page -

Image
I am writing an un-ordered list in an HTML page. I have used the CSS class to get the bullet for the "li" tag. But bullets are not showing, horizontal lines are coming instead. I am writing html page in ColdFusion (.cfm) pages. My HTML page: & lt ;! DOCTYPE HTML & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Resource optimization & lt; / Title & gt; & Lt; Meta name = "resource-type" CONTENT = "document" & gt; & Lt; Meta name = "description" content = "DEPT: resource optimization: index" & gt; & Lt; Meta name = "main word" content = "department, index, DEPT, resource, management, reply, generation, report, report, OATI, on, line, tagging, daily, gas, total, energy, marketing, Schedule, schedules, pricing, path, optimization "& gt; & Lt; Meta name = "author" CONTENT = "intranet conscription crew for Sierra Pacific reso

How to pass a method pointer to a struct (in C/C++)? -

I have a C + + class in which there is a pointer that represents something like this class's C interface. Actually everything works well in addition to one thing: I can not cross the method indicator in this structure in the Macloss constructor. The example implementation looks like the following: Pure purifier code typingf int ci_function (ci_struct *); Typedef struct CI_MyClass // C MyClass's interface {CI_AFunction * func; } CI_MyClass; // C ++ Code Class MyClass {Private: CI_Afunction * _func; CI_MyClass * ptrCI_MyClass; Public: MyClass (): _func (** What to do to point it to MyFunc? **) {ptrCI_MyClass = New CI_MyClass; PtrCI_MyClass-> Function = _func; } Int'l MyFunk (CI_Start * str) {// Some Return 0; } CI_MyClass * GetCInterface () {return ptrCI_MyClass; }}; // More or less usage looks like this: CI_ptr-> Fank (CI_strust vs. PTR); // In a separate file How to solve it? I'm not sure that such an approach is also possible, although solving this meth

java - Android : how to send array as parameter in wsdl request -

I want to send a data php web service from the Android application, the web service receives this argument: < Pre> type name description string session ID session ID array client customer data to create aer customer customer interval I use the ksoap2 library, in this code I session Pass ID but I do not know the parameter wsdl request env = new sabu Oscillation Anaph (Sophonffe. Over 11); Env.dotNet = false; Env.xsd = Soap Certification Envelope.XSD; Env.enc = Soap Certification Envelope.NCC; SOAP object request = new SOAP object (NAMESPACE, "createCustomer"); Request.addProperty ("sessionId", "1234567890"); env.setOutputSoapObject (requested); AndroidHttpTransport = New HTTP TransportS (URL); androidHttpTransport.debug = True; // (new martial hashtable ()). Register (NV); AndroidHttpTransport.call ("", NV); Results = env.getResponse (); Log D. ("Result", result. To string ()); I found this php example to use a web serv

vb.net - encoding issue in Perl -

Image
मेरा उपकरण IO informations: एक ???? मैं VB.net से फ़ाइल नाम paraText.txt के रूप में उत्पादन पाठ फ़ाइल (.txt) बना रहा हूँ एक ???? paraText.txt पर्ल के लिए इनपुट फाइल होगी paraText.txt सामग्री: गेराड इनरहेल्ब डेर कल्चरहॉरिस्टिज़न बैन्डलुंग एनमैल्ट मर क्ल्टिविंग डर जैइट डच डैन मॉन्शेन अंड डेसेन जैइटब्यूस्ससेसेन एनेन ज़ेंट्रेलन प्लाट्स एं। Unter dem Stichwort der Zeitkultur strebt die kulturhistorische Forschung nach der anthropologischen Erkenntnissuche, Bewusstsein der Mensch von seiner Zeit hat, में आपका स्वागत है! आप के बारे में क्या है डेबी विर्ड सिन्फेलिल, दास सिच जेड कल्लत निक्ट ज़ूलेटज़ट डच इहरेन उमगंग मिट डर जेट एंड डेयरी ग्लिडेरंग प्रॉजेक्ट: मैन अनर्सस्केडेट ज्यूर ¼क्क्लेइजेन्डे एंड बेवॉर्स्टेन्डे, टीइल्स विलक ¼ आरलिच, टीआईएसई डच गेसेल्स्काफ्तालिस बज़व। न्यूटर्जेजेबिन ईिनफ्लोआईसीएसईईएन्टीटिएन एंड नोच ज़ू एवरर्टएंड एरेविग्नस। ईनान ग्रोए? टीली डायरेयर ईराइजिस्कील्चर बिल्डैट एक ???? डेर â ???? Komplex des Festlichen। समस्या: एक ???? जब VB.net से आउटपुट tx

In a hogan-express node.js express application, How can I use different template than global template in particular routes? -

OK, so I am new to expressing, templating, and back-ends. I am searching all day to answer this question so that there is no benefit. So, I thought I would ask it here. How can you use a different template for special routes except for a global template , in the app? I would still like to partially use so that you can keep this in mind if you are referring me to try a different structure or something (not sure how common is partly ...) code Here is the code I have seen from Dogs for Hogan-Express (It has been replaced with a coffee script. Regular Javascript.) var Express = Expected ('Express'); var app = express (); Start the example code from // Docs // I like my app JS / Server .js file ap. Use code ('visual engine', 'html'); App.set ('layout', 'layout'); // As I explained above, global template app.set ('partial', {foo: 'foo'}); App.enable ('view cache'); App.engine ('html', Required ('Hogan-E

Android ListPopupWindow's method isShowing() does not work -

मैंने अपना कस्टम स्पिनर को TextView का विस्तार करके और ListPopupWindow । मैं मूल स्पिनर की निम्नलिखित कार्यक्षमता का अनुकरण करना चाहता हूं: जब स्पिनर को ड्रॉप डाउन सूची पर क्लिक किया जाता है, दूसरी बार स्पिनर को क्लिक किया जाता है ड्रॉप डाउन सूची को खारिज कर दिया जाता है। लेकिन मुझे कुछ परेशानी हो रही है, ListPopupWindow.is दिखा रहा है () हमेशा झूठे वापस आ रहा है (मैंने इसे डिबग किया है): पब्लिक क्लास कस्टमस्पिनर टेक्स्टव्यू विस्तारित करता है ... ... निजी लिस्टपोपअपने ड्रॉप डाउन पॉपअप; ... सार्वजनिक CustomSpinner (संदर्भ संदर्भ, AttributeSet attrs) {सुपर (संदर्भ, attrs); ... dropDownPopup = नया सूचीपॉपपॉइंट (संदर्भ, एटर्स); dropDownPopup.setAnchorView (this); dropDownPopup.setWidth (WindowManager.LayoutParams.WRAP_CONTENT); DropDownPopup.setOnItemClickListener (नई OnItemClickListener () {@Override सार्वजनिक शून्य पर आईटेमक्लिक (एडाप्टरव्यू & lt;? & Gt; माता पिता, दृश्य देखें, पूर्णांक स्थिति, लंबी आईडी) {dropDownPopup.dismiss (); ...}}); This.setOnClickListener

perl listen to a port number to check status -

I have a daemon, for which, I have to check the status and see whether it is up or down or not. So far, I'm using a expected script in the port in Telnet and see if it's alive I want to write it again in Perl, to check it. Any sign of modules or features which I can use greatly appreciates. will be a good place to start. There can be better solutions, but this is what I am using.

javascript - AngularJS + AngularFire = How to edit entry -

मेरा $ scope है: $ scope.current_account_key - मेरे अपडेट मोडल से कुंजी $ scope.current_account जिसका नाम है: $ scope.current_account.name , और एक विवरण $ scope.current_account.description (खाता मेरी प्रविष्टि है) मैं इन मानों के साथ फायरबेज में एक एंट्री को अपडेट करना चाहता हूं। फायरबेज ट्री: खातों -JL7e0Obv18-Ls6TTkk8 विवरण का नाम आप कर सकते हैं var ref = new firebase (fbUrl + '/ accounts') ); Var खाते = $ फायरबसे (रेफरी); Var बच्चे = खातों। $ बच्चे (कुंजी); // किसी भी मूल्य को बच्चे को सेट करें और // child.name = 'बदल दिया गया नाम' सहेजें; । बच्चे $ बचाने के (); कुंजी); $ Scope.account = $ firebase (रेफरी); // किसी भी मान को खाते में सेट करें और // अकाउंट सहेजें। नाम = 'बदला नाम'; । $ Scope.account $ बचाने के ();

python - Django - A bit lost with forms -

I am working in Django forms. Where do I place the code (forms.py/ or models.py?) About the form and what code I put in my template I searched about docs but it does not understand, I'm new to the Django Thank you. I appreciate that someone can give me a complete example of a simple form to understand this stuff. Thank you. from You must make the Django import forms by contact form form (forms. Forms your form class in forms.py example : subject = forms.CharField (Max_length = 100) message = forms. In order to render the form in your template, you must add the reference to your Views.py should look something like this. Submit from Django.shortcuts import to django.http.httpResponseRedirect def (request): If request.method == 'POST': # If the form is submitted ... # Contact form Previous section form = Configure form (request. POST) was defined in # form form.is_valid (): # Process data in all validation passes pass # form.cleaned_data # ... Back HTTPP

java - JSF dataTable logic: I am retrieving multiple rows of the same entity from the db; however i want to show only one -

I am retrieving the table of data from my DB that looks: ! [1]: As you can see that I have same EmpName, EmpID repeating the designation because that is because it There are many tasks allocated. To see that the more rendering is displayed only once, the amplified, the name, the designation are printed and the lines of the remaining special staff are sometimes printed as DB. My datatable looks like this: & lt; H: DataTable value = "# {employeeWiseReportBean.empWiseList}" var = "u" rhythm = 'true' styleClass = "infoTable" headerClass = "DataTable Header" rowClasses = "dataTableRow" & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; Employee ID & lt; / F: Aspect & gt; # {U.empID} & lt; / H: column & gt; & Lt; H: column & gt; & Lt; F: Aspect Name = "Header" & gt; First name & lt; / F: Aspect & gt; # {U.fullName} &

android - How to get total video & image size from external SD card -

I am trying to calculate the total memory size (video and image) from an external SD card. For example, a method is mediastore.audio.media.gate contactUrifpath (string path) . From where I can get the URI and calculate size audio files. Passing .. Private long mill media (Uri Yuri) {Log. ("URI", "Yuri +"); String [] project = {MediaStore.MediaColumns.SIZE}; Cursor cursor = ((activity) reference) .Get content resolver (). Query (Yuri, Prose, Blank, Blank, Blank); Long size = DirectoryMediaSize.getMediaSize (cursor); Cursor.close (); Return size; } There is no such way as MediaStore.Video.Media.getContentUriForPath () . So how can I calculate the size for (in the video & image) ??? itemprop = "text"> Try the following code: - URI selected IMAGEURI = data.getData (); File image file = new file (getRealPathFromURI (selected imageURI)); Long check = ((imageFile.length () / 1024); If (Check & lt; 5000) {// less than 5 MB} else {//

hadoop - Output of reducer sent to HDFS where as map output is stored in data node local disk? -

I'm a bit confused about HDFS storage and data node storage. Below are my doubts The map function will be saved in the output data node Local disk and reducer output will be sent to HDFS. As we all know that data blocks are stored in data nodes, there is no other disk space available for HDFS in the data node in the local disk ?? What is the physical storage location of the reducer output file (Part-NNNN-R-00001)? Will it be stored in the name node hard disk? So I believe that the data node is part of HDFF, I believe that the data node local disk is also part of HDFS is. Related Suresh You know the difference between virtual concept and actual storage needed . HDFS (Hedop Distributed File System) only specifies how data will be stored in date data. When you say that a file is placed in HDFS, it means that it will actually be considered as an HDFS file, but will actually be stored in Detanode's disk. Look at the details, how it works: HDFS as a

spring - Domain and service methods for banking transaction -

I am trying to learn the Spring Framework and many examples of using domain and service objects (domain-powered design) Am trying But I'm not really able to understand how to reach them. For example, I am trying to model a simple banking application that has clients, accounts and transactions. I have in the draft format given below: Domain objects: Customer ID Username Password Account: ID Customer ID Balance Transaction: ID Account ID Transaction Amount Transaction Type Type Service Objects: Account Service: (Account) Create an account for debit (account, amount, date, comment) credits (account, amount, date, comment) Transfer (acc, from ACC, amount, comment) Eyed (client income)? Customer Service: FindCustomerByName () FindAccount Customer Customer (Customer ID)? Does customer service or account service get a method, customer to customer ID? Which domains / service objects should represent debit / credit transactions? Are debit (and) credit () methods defined in t

Multiple fadeIn/fadeOut effects in one audio file with ffmpeg -

I have a problem adding several feed effects to an audio file i when I try to use an order like this I: ffmpeg -y -i /home/user/video/test/sound.mp3 -af "afade = t = in: ss = 0: d = 3, afade = t = St = 7: d = 3, afade = t = in: cents = 10: d = 3, afade = t = out: cents = 17: d = 3, afade = t = in: st = 20: d = Then, my output audio file feedin and Feedout Not all the next applied effects are applied once Is there any possible way to implement many fade effects to the audio file are not? Also, what is the difference between the ss and st parameters in this command? Take a look here: quantity = 'if (lieutenant (T, 10), 1, Max (1- (T-10) / 5,0): 'Eval = frame Full command: ffmpeg -i movie.wav -filter volume = 'if (lieutenant (t, 10), 1, max (1- (t-10) / 5,0):' eval = frame revised-movie. Code>

actionscript 3 - How to have a placeholder text and remove it when the first letter is inputted? -

I'm reading on textevent to use it, but I'm also not sure how to be a holder. What is placeholder text? Another dynamic text field? For example, on the Facebook app, it says email or phone on it, when I type a letter, "email or phone" disappears, but if I remove my input, the place holder will appear again it happens! Somewhere I would appreciate to start, thank you! I failed to link well, but I think "mask text input" Finding useful Flex components can be found.

html - Regex string with three wildcards, replace with second and third only -

मेरे पास मेरे कोड में एकाधिक & lt; li & gt; है, उनमें से 3,000 से अधिक (डॉन ' & lt; li & gt; नाम, नौकरी, कंपनी & lt; / li & gt; या & lt; li & gt; नौकरी, कंपनी & lt; / li & gt; मुझे उन लोगों को खोजना होगा जिनमें एक नाम है (अर्थात् दो कॉमाओं वाले , , केवल एक के विरोध में), और नामों को हटा दें। मैं सब्लाइम टेक्स्ट के रेगेक्स को ढूंढने की उम्मीद कर रहा था + सुविधा को बदलता है। अब, मैं निम्नलिखित रेगेक्स का उपयोग करके दो कॉमाओं को चुन सकता हूं: & lt; li & gt ; *। *। *, * * लेकिन अब मैं इसे कैसे बस दूसरी और तीसरे । * पहला? इसे ढूंढें: & lt; li & gt; (। *) *,, (। *) & lt; / li & gt; इसके साथ बदलें: & lt; li & gt; \ 1, \ 2 & lt; / li & gt; या & lt; li & gt; $ 1, $ 2 & lt; / li & gt; जो कुछ भी आपके संपादक का समर्थन करता है

Python Latin Characters and Unicode -

I have a tree structure in which keywords can contain some Latin characters. I have a function that grows through all the leaves of trees and adds each keyword to a list under certain conditions. Here I have the code to add these keywords to the list: Print "Add:" + Self. Keyword leaf_list.append (self.keyword) print leaf_list If the keyword is the keyword università © , then my output is: Adding: code: università © ['universit \ xc3 \ xa9'] It appears that the print function correctly shows Latin, but when I add it to the list, It gets decoded. How can I change it? I need to be able to print the list with standard Latin characters, not their decoded versions. You do not have Unicode objects, but byte string with UTF-8 encoded text. To print such byte strings on your terminal may work if your terminal is configured to handle UTF-8 text. When a list is converted into a string, then the contents of the list representation ; The result of r

wordpress - How integration of webservice with android app for all th content and pages -

I have to implement the web service for the existing site with the Android app. I do not have any idea about the process. Please help me if anyone has more idea about it. I hope there is a link below that will help you solve your problem. Have been given from.

Convert day of the year to datetime in php -

मेरे पास मूल्य है $ days = 166.0444; जो वर्ष का दिन है मैं इस वैल्यू को अपने डेटटाइम में कैसे परिवर्तित कर सकता हूं, जो 2013-06-15 01: 04: ss होना चाहिए? निश्चित रूप से महीने में महीने की संख्या घटाने के लिए, महीने के साथ आगे बढ़ सकते हैं, और कुछ और रास्ता भी है, लेकिन क्या कोई अन्य तरीका है? संपादित करें: वर्ष हमेशा चालू वर्ष होगा धन्यवाद, हर कोई, मैंने ऐसा किया है: $ dayOfYear = (int) $ परिणाम; $ Temp = ($ परिणाम - $ दिनअगर वर्ष) * 24; $ घंटे = (int) $ temp; $ Temp = ($ temp - $ घंटे) * 60; $ मिनट = (int) $ temp; $ Temp = ($ temp - $ मिनट) * 60; $ सेकंड = (इंट) $ अस्थायी; $ Date = नया दिनांकटाइम (); $ Date- & gt; जोड़ें (नया दिनांक इन्तरवर्ल्ड ('पी'। $ DayOfYear 'डी')); $ Date- & gt; जोड़ें (नया दिनांक अंतर ('पीटी'। $ घंटे। 'एच')); $ Date- & gt; जोड़ें (नया दिनांक अंतराल ('पीटी'। $ मिनट। 'एम')); $ Date- & gt; जोड़ें (नया दिनांक अंतर ('पीटी'। $ सेकंड। 'एस')); आप इसे या इसी प्रक

Print Mapbox/Leaflet Map -

I want to print a mapbox map, on which there is a custom pin on Chrome or Safari, there is no problem, Because I can only use the window.print command. I have problems with Firefox and IE when trying to print: Pin shown in wrong position Pin fully I also tried: Html2Canvas: He was not working, I think because the tiles have been fixed to you Let's take the canvas back, it only shows the "back" normal gray / white grid of the map static map box ap E: I need pins were numbered than 9 and Mapboks API provides only pins from 0 to 9. Do you have a good idea to solve this problem? What is the chance to use the static MapBox API with custom pins? This CSS was snippet: .leaflet-container img {Max-width: none! Important; }

php - Contact form doesnt work -

I have written the code for the contact form and I do not know why it does not work. Everything has been set up with the form but I did not receive the email. I did not get any errors or anything. It is html code : gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt; div class = "form-field call-sm-6" & gt; & Lt; Label = "email" & gt; Email & lt; / Labels & gt; & Lt; Span & gt; & Lt; Input type = "email" name = "email" id = "email" /> gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt; Div class = "form-field call-sm-6" & gt; & Lt; Label & gt; * What is 2 + 2? (Anti Spam) & lt; / Labels & gt; & Lt; Span & gt; & Lt; Input name = "human" placeholder = "write here" & gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt; Div class = "form-field col-sm-12" & gt; & Lt; Label

Sonatype nexus - what does published mean -

Previous> --- publication --- | Status: Not published. Message: Unable to find search or remote content in progress (see discovery status) I am able to browse the remote, but I am unable to browse the index. What exactly is the word "published"? Is this repo not available for my Maven customers? They & lt; MirrorOf> * and receive all the artifacts from the Nexus. It's a brain dead question I've seen here, and in the sonate book, online sonytepe documentation, and scraped Google, it's no use. This message means that the remote routing of the proxy does not publish information, and it is either remote The HTML directory was not able to crawl the list, or is still in the process of doing so. Here's a look at how the routing feature works in Nexus: About the search index, not all sites publish them They are completely optional, lack of a search index will not affect the artifact download via proxy. To see whethe

git - Xcode Source Control Options Still Gray after Checking Out -

I have created a project in Cocos-2D-X, and I have set up a repository on the bitbook. Then I clicked "check out", and I chose the set up repository, and set up a local folder on my computer. All right But "committed", "push", "pull", and other options are still gray. Does anyone know why? Xcode version control has always left something to be desired, here's someone who works on it Has been:

how to authenticate user and password using ruby on rails -

How to authenticate user names and passwords using ruby ​​on Rail If my authentication is correct then I need to visit some other page sample code of login.html.erb : Hello, : Valid = & gt; Correct | f |% & gt; & Lt; TR & gt; & Lt; Td> & Lt; B & gt; Student registration no & lt; Sup> * & Lt; / Sup> & Lt; / B & gt; & Lt; / Td> & Lt; Td> & Lt;% = text_field: user ,: name, placeholder = & gt; "Reg.No"% & gt; & Lt;% = @ user.errors.on (: name)% & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; P & gt; Password & lt; / P & gt; & Lt; / TD & gt; & Lt; Td> & Lt;% = text_field: User ,: Password: Placeholder = & gt; "Password"%> & Lt;% = @ user.errors.on (: password)% & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> & Lt;

Russian language in html file -

I have a simple page which is ?????????? , this is the Russian language and I want to show it because it is & Lt; Title & gt; Untitled document & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; Тыуиппюлкйчг & lt; / Body & gt; & Lt; / Html & gt; Be sure to: configure your editor Whatever method you use to keep the file on the server with UTF-8 and , the encoding does not match the file and Your server will not send a content-type HTTP response header (for example, use FTP binary mode and not text mode) Which is Against the declaration of Tavej level (and override) documents UTF-8.

c++ how should the makefile look -

Suppose I have these C ++ files, how should I write a basic messaging (using G ++) for them? a CPH ah, BCPP BH, CCPP CH, IPHHH: When BH is included in AH, CH contains BH and main H include CH? Thank you very much How to compile a file? Say you have test.cpp and test.h is, compile it and link: g ++ to - C test.cg ++ - o Test Test. O The easiest Mekfail : test: test.o # mess test depends on test.o G ++ Is -o test test. O test. O: Test CPP test.h # Memo test.o depends on test.cpp and test.h g ++ -c test.cpp # if you want to clean? Add the bottom line also clean: RM test test. O If your app depends on a number of files, test: test1.o test2.o test3.o #means your app test1. o depending on test2.o and test3.og ++ -o test test1.o test2.o test3.o test1.o: test1.cpp test1.hg ++ -c test1.cpp test2.o: test2.cpp Test2.hg ++ -c test2.cpp ...

c++ - Bad optimization of std::fabs()? -

Recently I was working with an application that had the code: < Code> (Auto X = 0; x and lt; width - 1 - left; ++ x) {// store / reset points temp = hPoint = 0; (Int channel = 0; channel & lt; audioData.size (channel; ++) {if (peakmode) / * window size * fir rms * / {for (int z = 0; z std :: fabs (hPoint)) hPoint = temp; }} .. some other code} ... some more code} This is inside a graphical render loop, which is up to 192kHz in many channels with buffers 50-100 times / second Is called. There are so many statistics that run through most inner loops, and profiling showed that it was a hotspot. It happened to me that someone could float an integer and erase the sign bit, and put it back on something like this seen using only temporary: if (const float & amp; nbsp; (* ((* integer *) and temporary) & amp; ~ 0x80000000)> (const float & amp;; (* (* * *) and H point) & amp; ~ 0x80000000)) hPoint = temp; It reduced the render time by 12x, while sti

Window phone - How to redirect to page xaml form web browser control? -

I have two page xaml in which there is web browser control to display HTML string. For example, page1. Xaml: Webbrover control (web browser will display html string in control) page2.xaml: Webbrover control The question is: when the user is in page 1.xaml Clicks on a tag hyperlink and redirects to page 2.xaml You just type javascript function You can use your native C # by that you call the basic function from the web browser Can and can redirect the page. In this way, please create an HTML file inside the HTML, use the Javascript function, which calls the original function or indicates it from there.

PushbackInputStream - why exists -

Why is this good thing to push the byte back in the stream? When I process the stream, I can ignore the byte or I can modify it, if I want to do this: try (InputStream = new FileInputStream ( "Test.txt")) {int aByte; Four c; While ((abyte = is.read ())! = -1) {c = (char) aByte; If (C == 'H') {c = 'X'; } System.out.print (c); } I examined Jawadox, but I still can not understand why and in some cases why should I return data in the stream. Pardon. To push forward, push has to be pushed back with the option and some conditions are true or false. If the lie wants to move on to you as if you did not move forward, then you have to be told to push the stream in order to proceed. Otherwise you can change the moving part and continue from there. [View] [or] [or] book: "Complete reference part 2 by Herbert Slidd". Pushback interstream is used when you parser data from inputstream, sometimes you have to read some bytes that are going to co

c# - Custom Attribute for the route -

I want to create a custom attribute, for the parameters in my path I can not use the "parameterbugging attribute" Before "do something", I want to verify the parameter myVar how to do this? Get the public IHttpActionResult ([myAttribute] int myVAR) {// Something} Thanks You can write an action filter that will inspect value. [VerifyMyVar] Public IHttpActionResult Get (Int myVar) {// TODO} Public Class VerifyMyVar: HttpActionFilterAttribute {...} If you are more specific If you want verification, you can inspect MethodInfo from the filter, and do something special with [MyAttribute] code inside.

javascript - Is there a way to trigger scroll event with HtmlUnit or is it not possible at all? -

I am currently learning HtmlUnit to scour the websites. I have tried several ways, which I want to face with a dynamic page (for example, I am using Pinterest's website). Trigger scrolling in a real browser (I'll show them below). Before proceeding, I would like to mention that I have the following configuration already defined: webclient.setJavaScriptEnabled (true); Webclient.setAjaxController (new opt-in syncExpress controller ()); Let's say I want to get all my followers on Pinterest. I navigate to that page and now for the first time when you are only 24, I want to scroll down, the event that turns Ajax call on the server and retrieves the next set of followers. 1) Simplified javascript or jQuery code to scroll through windows. ScriptResult sr = Followers page ExecuteJavaScript ("window.scrollBy (0,1000)"); // jquery // scriptResult sr = A version in the follower Page. ExecuteJavaScript ("$ (window) .scrollTop (0,1000);"); // Also tr

ios - Objective C - Image to full screen -

Image
I want to keep the full screen image but my result is: first screen: here full screen (this the image screen landscape (rotated)) I want I will come across all screens in full screen My function: - (zero) imgToFullScreen {if {[UIVie W animateWithDuration (IsFullScreen!): 0.5 Delay: 0 options: 0 Animations: ^ {// Save the last frame prevFrame = imagen.frame; // [fantasy set frame: [[UIScreen main screen] border]]; [Fantasy set frame: CGRactam (0,0,320,415)]; UIImage * portraitImage = [[UIImage alloc] initWithCGImage: imagen.image.CGImage]; UIImage * LandscapeImage = [[UIImage alloc] initWithCGImage: portraitImage.CGImage scale: 1.0 Orientation: UIImageOrientationRight]; Imagen.image = Landscape Image; Tabbar.hidden = Yes; Logo.hidden = Yes; Self.navigationController.navigationBarHidden = Yes; } Closing: ^ (BOOL End) {isFullScreen = true; }]; Return; } And {{UIView animated dislocation: 0.5 delays: 0 options: 0 animation: ^ {[imagery setframe: backyard]; NSDT * data =

Javascript global variable updates when it shouldn't -

उस कोड में: window.g_b_editEnable = false; Window.g_a_PreEditData = 'हैलो'; फ़ंक्शन EditRow (EditButton) {if (! Window.g_b_editEnable) {window.g_b_editEnable = true; Var a_i_Pos = a_o_table.fnGetPosition (EditButton.parentNode); एडाटा = a_o_table.fnGetData (a_i_Pos [0]); console.log (window.g_a_PreEditData); Window.g_a_PreEditData = a डेटा; console.log (window.g_a_PreEditData); एडाटा [0] = '& lt; बटन प्रकार = सबमिट नाम = सहेजें & gt; सहेजें & lt; / बटन & gt; बटन पर क्लिक करें = ResetTableFields (यह) नाम = रीसेट & gt; रीसेट करें & lt; / button & gt;'; के लिए (गणना = 1; गिनती & lt; aData.length; count ++) {aData [count] = '& lt; इनपुट प्रकार = टेक्स्ट मान =' + एडाटा [गणना] + '& gt; & lt; / input & gt;'; } A_o_table.fnUpdate (aData, a_i_Pos [0], अपरिभाषित, गलत, गलत); console.log (window.g_a_PreEditData); } और {वापसी 1; }} मैं एक मान को स्टोर करने के लिए एक वैश्विक चर (window.g_a_PreEditData) का उपयोग