Posts

Showing posts from April, 2011

scala - getting number of values within reduceByKey RDD -

When it's called Bike Operation, it's getting a list of the values ​​of a particular key. My question is Is that Is that the list of values ​​received in sequential order? Is it possible to know how much value he gets? I'm trying to calculate the quartile before the list of values ​​of a key, is it possible to reduce bark? .1 No, it is against the whole situation of completely reducing the operation Going - that means taking advantage of co-operatives and commutitiates to parallel an operation in arbitrary tree of sub-operation. .2. You will need to define a new monoide by typing an integer monoide and whatever you have to do is assume that your operation is op . yourRdd.map (kv = & gt; (kv._1, (kv._2, 1)). ReduceByKey ((left, right) => (left ._1 op Right ._1, left._2 + right ._2)) You can get a RDD [(KiType, (ReducedValueType, Int))] where Int will be the number of values ​​received for each key. .3. You have to be more specific about...

javascript - How to make a globally accessible variable? -

How do I create globally accessible variables in nightwatch.js? I'm using a variable to store an optimized URL (depending on which store is loaded in our online product), but I need it to be accessible in many JavaScript functions. Despite the declaration of the function at the top of the file, it reset after each function is exhausted. ever since you asked your question and from whatever time you requested (originally From) could not be available. now it's. Developer's Guide provides two ways to create global variables accessible from any trial based on your requirements. See for good reading. Method 1: In fact, for global globals, define the object in the "globals_path" section of your Nightwatch.json file, or pass a file for all trials and all environments, that is "globals_path": "./lib/globals.js", You have to export the variable, however, brushing on the node is a good The idea is. Here is a basic globals.js file example:...

regex - Minus sign breaking equation extraction -

I am trying to create a regular expression that removes the numerical constant and operator from an equation. X_1 + 1234 * 5678 + 2 (where X_1 is not static, so it has been ignored) , I 1234 * 5678 + 2 . I have a regular expression that works for the above case, but it breaks when the first number is negative. Here's my current regular expression (spaces for clarity): \ b ((?::??? D +) (?: \ S * [\ * \ +] (?: -?) However, if the numeric constant is negative, then the zero mark is omitted. For example, with an input, X_2 * - 128 + 18 * 3, , 128 code>. > I believe the problem is the main word limit anchor, but without 2 to X_2 Edit: For the sake of simplicity, there is a "variable" which is not always a numeric. A "numerical constant" is a Positive or negative integer value. In my above expression, they match (?: -?? \ D +) .

Android - UI UX of a VERY BIG array for auto-completion -

After the I want some guidance on designing a replication UI (Saddle, stirrup and rein) and UX ( Holistic ride). (See here). I want users to choose their location by typing the first few letters. Suppose, all the states in all the places are in places, a place to consider a drill-down approach may be suggested for selecting a school of thought. For example, starting with a geography (USA, LA, EMEA, APAC, etc.), select a country from that geography Other suggestions will be to load all the capital cities in an array and feed it on the autocomplete view. Personally, I like the latter from the UX perspective. A person who wants to enter their place already knows what to choose . He does not need navigation. On the other hand, consider the process of filing your tax. A guided navigation, savings or discount around the nature of income can actually result in a satisfactory UX, because the user does not know in advance what tax code or discount code, etc. need to be selected. Co...

c++ - multithread race condition with use-counted shared pointer -

I have an old C ++ 98 code base that is in combination with use-count and pimpl design that can be up to 4 years Works fine - they are 8-way processors have become common and you see this in the Pimple code (this is actually a template in the original code): square fu {FooImpl * impl ; Public: Fu (): Implications (0) {} Foo & amp; Operator = (Const Foo & amp; Foo) {if (foo.impl) foo.impl- & gt; Adf (); If (impl & amp; amp; ;; removeRef ()); Impl = foo.impl; Return * This; } // etc} The problem is in a multiprocessor environment, function switching can occur between if (foo.impl) and foo.impl - & gt; AddRef () . The first idea to fix this can be: Foo & amp; Operator = (Const Foo & amp; Foo) {FooImpl * fooimpl = foo.impl; If (fooimpl) fooimpl- & gt; AddRef (); If (impl & amp; amp; ;; removeRef ()); Impl = fooimpl; Return * This; } but this problem does not resolve foo.impl still can be invalid when you call addRef () There is no ...

python - Create PyString from c character array without copying -

I have a large buffer of stars (basically 12GB) with a C app. I like the embedded Python interpreter without copying the wires to create a pistig object in C, is it possible? I do not think that the root cause of the Python string objects is possible in the PyObject structure In other words, the Python string object is PyObject_HEAD followed by the bytes of the string. To keep PyObject_HEAD information around the existing bytes, you must have a cell in memory.

unix - Using inverse grep to compare two .txt files -

I have two .txt files "test1.txt" and "test2.txt" and I inverse grep (UNIX) Test2 To find all the lines in .txt which do not include any row in test1.txt test1.txt contains only usernames, whereas test2.txt contains long strings of text I only I want a line in test2.txt that does not include the username found in test1.txt Will such a thing happen? grep -v test1.txt test2 .txt & gt; You should have at least one option (i.e. - f) your solution -f flag, look like sample session demo session $ # First file $ cat a.txt xxxx yyyy Kkkkkk zzzzzzzz $ # Other file $ cat b.txt does not have any name in the line This person is xxxx yyyy good is another line in which there is no name kkkkkk is a good name ? This name is asleep ... zzzzzzzz I can not find any other name, try the command now $ # -i is used only to ignore the case while searching for $ $, from the second file only There are rows in which there is no text for the first file lines $ Grep -v -i -f...

google app engine - Datastore - select nearby posts using given co-ordinates -

I use App Engine Datastore with JDO to store data about all users' posts with Latitude ; The longitude of the place from which they have been posted. With the current user's co-ordination, I want to get the adjacent post within the current X's X-km user. At first I tried to ask a question for a range of latitude; Longitude, but this is not possible because the datastore does not support inequality filters on many properties. According to RDBMS, it can be achieved only by calculating within the query. How can I do this query in JDO? Is the place a better way to store data, where can calculate distance and get it easily? 1 - High performance on large datasets is a good solution for geospatial detection. Below, you have to duplicate your search index data in GAE-Search. The best way to use this is to use the datastore key with the datastore in the form of DAC-ID in the GAE-Search index where you have one-to-one mapping with the datastore unit (and Use the s...

file - close() a variable in Python -

इस सवाल का पहले से ही एक उत्तर है: 3 जवाब मेरे पास निम्न कोड है: sys import argv स्क्रिप्ट से, फ़ाइल नाम = argv txt = open (filename) प्रिंट "यहां आपकी फाइल% r है:"% filename print txt.read () print "फ़ाइल नाम फिर से टाइप करें:" फ़ाइल_गेन = कच्चे_इनपुट ("& gt;") txt_again = open (file_again) print txt_again.read () और मेरी पुस्तक में से एक में यह कहते हैं, "क्या आपकी स्क्रिप्ट भी बंद करें () पर txt और txt_again वेरिएबल्स। फाइलों को बंद करना महत्वपूर्ण है जब आप उनके साथ कर लें। मैं चर को कैसे बंद कर सकता हूं? txt.close () फ़ाइल पार्सर को बंद कर देगा। हालांकि मैं इसके बजाय के साथ उपयोग का सुझाव देता हूं: खुले (फ़ाइलनाम) के साथ txt: print "यह आपकी फ़ाइल% r है:"% filename print txt.read () प्रिंट "फ़ाइल नाम फिर से टाइप करें:" file_again = raw_input ("& gt;") को खुले (file_again) के साथ txt_again प्रिंट txt_again.read () यह सुनिश्चित करता है कि फ़ाइल पार्सर ठीक से बंद हो गया औ...

javascript - I have form with same name -

I'm trying to use jQuery with the same name and defragment value in my HTML form, but then what When I submit the form my AJAX will not work and submit it to # . Why can anyone explain me? My HTML Form: & lt; Script src = "lib / jquery / jquery.1.9.0.min.js" & gt; & Lt; / Script & gt; & Lt; Form name = "form" action = "#" method = "POST" & gt; & Lt; Input name = "idnum" type = "hidden" value = "some size" 1 ​​& lt; Button type = "submit" & gt; BTN1 & lt; / Button & gt; & Lt; / Form & gt; & Lt; Form name = "form" action = "#" method = "POST" & gt; & Lt; Input name = "idnum" type = "hidden" value = "somevaluehere2" & gt; & Lt; Button type = "submit" & gt; BTN2 & lt; / Button & gt; & Lt; / Form & gt; This is my Ajax: $ (document) ....

mysql - Query execution is taking too long -

I currently have two tables in a database Called emails in both unread and non-spoken tables have a column called Email I want to compare these two tables and wherever in the email matches I want to update the columns in the email table, which is called e-mail_status_id2 ... the query I am using is UPDATE email E SET E.Email_status_id = 2 where e-mails (U.S. U.S. Select this option); I am currently using mysql There are 2704569 rows of emails in the e-mail table and 12102 rows of emails in the table without any breaks Text "itemprop =" text "> The first thing is that Reminders (email) : create index id_unsubscribed_email on allowed subscription (email); Or, better than that, declare it as the primary key , especially if it is the only column in the table. Then, MySQL sometimes performs a poor job of applying in There are several ways to write queries to use the index. is present is a specific method: Update email and set up e...

avfoundation - OSX How to tell when a user plugs/unplugs a headphone with a microphone built in -

I created an app that records the audio from the user - but I am having problems when a user plugs into a Headphone jack with headset that has a microphone, it kills my recording I think my app is still trying to hear built in the microphone, and when the new microphone is plugged into a computer, only that microphone By allowing input. I'm not even sure, but if I can make a listener who tells me that when the headphones have been plugged in, then I should be very helpful in figuring out where this problem is. Has anyone seen this problem before? You can only check AVCaptureDeviceInputSource, and when a headphone gets plugged in with a mic , Then this property is imic from iMic (internal from external). AVCaptureDevice stays in "built-in", but the key is that InputSource changes

python - Why can't I set my Django Model's USPhoneNumberField to null=True, blank=True? -

मेरा Django मॉडल: localflavor.us.forms से आयात करें USPhoneNumberField क्लास प्रोफाइल (मॉडल .model): सेलफोन = यूएसफोन फ़ोन नंबर (रिक्त = सच = रिक्त, सच =) जब मैं एक manage.py syncdb करता हूं: सेलफोन = यूएसफोन फ़ोन नंबर (नल = सच, रिक्त = सत्य) प्रकार त्रुटि: __इनित __ () को एक अप्रत्याशित कीवर्ड तर्क 'नल' मिला अगर यह जीत गया है तो मैं इस क्षेत्र को कैसे वैकल्पिक बना सकता हूं 'क्या मैं इसे नल के रूप में घोषित करूंगा = सच जैसे मैंने कई अन्य क्षेत्रों के लिए किया? यूएसफोन फ़ोन नंबर एक फ़ॉर्म प्रकार है, कोई मॉडल प्रकार नहीं उपयोग (आमतौर पर) है: वर्ग प्रोफ़ाइल (मॉडल Model): सेलफ़ोन = मॉडल.कारफिल्ड (max_length = 20, null = true, blank = true)) और forms.py वर्ग ProfileForm (Forms.Form): # और रूपों। मॉडलफ़ॉर्म सेलफोन = forms.USPhoneNu MberField (...) वर्ग localflavor.us.models.PhoneNumberField (* आर्ग्स, ** kwargs) एक चरखी है जो जांच करता है यह मान एक वैध यूएसए-स्टाइल फ़ोन नंबर है (प्रारूप XXX-XXX-XXXX में)।

Rails 4: devise custom routes -

I have to be an "account settings" page, which is for editing name and password, and a "edit profile" The page that is to update the profile picture and personal information is the default design path / user for user edits, but I want to make it '/ users /: id / account'. I also want to edit profile editing page to path '/ users /: id / edit_profile' after the instructions on wiki wiki, I was able to change signup and enter paths, but this is not work for others Does config / routes.rb devise_for: user ,: path = & gt; '',: Path_name = & gt; {: Sign_in = & gt; "Signin" ,: sign_up = & gt; "Signup",: Edit & gt; "Profile"} Resources: Users only: [index ,: show] Resources: Project root 'static_pages # home' match '/ help', for: 'static_pages # help', via: 'get' match '/ about ', To get', 'get' ' through the rake routes :' stati...

php - file_put_contents failed to open stream: no such file or directory (only locally) -

I have PHP scripts I've added to a cron job, though PHP script is not able to run locally . If I use it through a web browser, then it works 100% if I use it via terminal, then it reproduces the behavior below. Test: $ php5 /path/test.php Error: file_put_contents (folder / filename.txt): failed to open the stream: test.php on such a file or directory / path / line 11 Code: $ host = 'https://www.google.com/'; $ Ch = curl_init (); Curl_setopt ($ ch, CURLOPT_URL, host $); Curl_setopt ($ ch, CURLOPT_CONNECTTIMEOUT, 1); Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1); $ Result = curl_xac ($ CH); $ Position = curl_getinfo ($ CH, CURLINFO_HTTP_CODE); Curl_close ($ ch); File_put_contents ('folder / filename.txt', $ position); I do not believe the error is a problem because the error does not say anything but the folder is set to 777 and the php script is set to

Modifying Bluetooth Low Energy Beacon -

I was thinking that it is possible to modify the contents of a BLE beacon to include additional information if you If you insert an extra bit, then perhaps you can broadcast a bullion in one direction. Theoretically, if you modify your device to read additional information, it will work. Looking at the existing protocol, though it seems that this will be a lot of work, is there something like that already? For information, I am working on the Mobboard platform where you can modify your Bluetooth Beacon payload. Yes, you can do it with a new specification is a byte manufacturer reserve field You can also use it (tied to your manufacturer ID). The context implementation of the specifications available for Linux shows you how it works, and there is no reason that you can not apply it to the platform you are using.

javascript - Unpredictable results on Google Chrome -

Image
मेरे पास history नामक जावास्क्रिप्ट वस्तु है फ़ायरफ़ॉक्स पर मेरा आवेदन अच्छी तरह से काम करता है: जब मैं console.log (इतिहास) स्क्रीन निम्नलिखित हो रही है लेकिन क्रोम पर निम्नलिखित हो रही जब मैंने पहली बार इस स्क्रीन को देखा तो मैंने सोचा कि क्रोम कुछ अन्य विवरण जैसे लंबाई और राज्य को जोड़ना लेकिन वास्तव में, जब मैं क्रोम पर ऑब्जेक्ट (उदाहरण के नीचे) के माध्यम से पुनरावृत्त करता हूं तो यह पहले state प्रिंट करता है और शून्य के रूप में मान देता है $। प्रत्येक (इतिहास, फ़ंक्शन (हैश, फ़ाइलें) {... और रोचक हिस्सा है, समान कोड फ़ायरफ़ॉक्स पर एक जादू की तरह काम करता है । मैं क्या कर रहा हूँ गलत? आपको एक चर परिभाषित नहीं करना चाहिए इतिहास कहा जाता है, क्योंकि यह पहले से ही वेब एपीआई इंटरफ़ेस का हिस्सा है, जो ब्राउज़र सत्र के इतिहास को छेड़छाड़ करने के लिए एक इंटरफ़ेस प्रदान करता है (पृष्ठ टैब या फ़्रेम में विज़िट किए गए पृष्ठ वर्तमान पृष्ठ में लोड किया जाता है) - यह विंडो ऑब्जेक्ट के अंतर्गत निहित है, इसलिए यह वेबपेज में एक वैश्विक वैरिएबल है। आप इसे...

c# - FileUpload uploads 1 file multiple times -

When I try to upload multiple files, all the files are copied all of the one when I say That means copies means I have different file names, different file extensions, but the same picture in all the images. Example: I select four files, 2 PNG, 2 different sizes of JPG when I upload them, they come like this: 1.jpg - 256kb 2.jpg - 256kb 3.p ng - 256kb 4.png - 256 Kb I am doing this when it is happening. Response. Displays the light file as different size, but they are saved as a single file. foreach (HttpPostedFile file in FileUpload1.PostedFiles) {// Debugging only - I know the answer. Bad to use the feedback. Writite (file.FileName + "-" + file.ContentLength + "& lt; br & gt;"); // Normally to set a server, debug to FileUpload1.SaveAs C (Path.Combine ("C: \\ Uploaded"), file.FileName); } Output: 1.png - 270587 2.png - 261286 3.JPG - 1309586 4.JPG - 912675 So it knows that they are different files but it does a file...

java - SYSCS_BACKUP_DATABASE and EntityManager/ Backup with JPA -

How to use an EntityManager (also using JPA)? My recent code is not working properly StoredProcedureQuery query = em.createStoredProcedureQuery ( "SYSCS_UTIL.SYSCS_BACKUP_DATABASE") .; Query.registerStoredProcedureParameter (1, java.lang.String.class, parameterMODIN); Query.setParameter (1, "pathToDB backup"); Query.execute (); - 2.5.0.v20130507-3faac2b) The error I got the following exception [EclipseLink-4002] (Eclipse Persistence Services :. Org .eclipse.persistence.exceptions.DatabaseException internal exception: java.sql.SQLException: Exception can not be cast in 'java.lang.ClassCastException: java.nio.file.NoSuchFileException java.lang.RuntimeException is "evaluating an expression Was thrown. Error code: 20000Calls: call SYSCS_UTIL.SYSCS_BACKUP_DATABASE (?) Bind = & gt; I: Java.nio.file.NoSuchFileException can not be entered in java.lang. On Rentaim Akspesheshn 'was thrown while evaluating an expression org.apache.derby.client.a...

cocos2d iphone - Handle Button in CCNode from CCScene -

I am creating a game in cocos2d v3. In CCScene , I add a CCNode which contains all components of my HUD. In CCNode, CCButton s has been added. I want to be able to handle the touch of these buttons in my CCScene Is this possible? CcdAD header file (header class): / P> @property (nonatomic, retain) CCButton * Goldbutton; I have installed the basics of gold button in the implementation file of CCNode (Positioning, Phantom Frame, etc.). CCScene implementation file (placecen square): - (zero) setup {_header = [[header alloc] init]; [_header.goldbutton setTarget: Self Selector: @Sillector (Gold Button)]; } Inserts a little odd goal of the button inside the scene, but it works if I am thinking 'good practice' for this situation.

CSS inline-block grid -

I just started learning html and css. I'm trying to create a 3x3 grid with the inline block "method": This is the code so far: HTML: & Lt ;! Doctype html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Link href = "ex.css" rel = "stylesheet" type = "text / css" & gt; & Lt; Title & gt; Pre & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "r1" & gt; & Lt; / Div & gt; & Lt; Div id = "r2" & gt; & Lt; / Div & gt; & Lt; Div id = "r3" & gt; & Lt; / Div & gt; & Lt; Div id = "r4" & gt; & Lt; / Div & gt; & Lt; Div id = "r5" & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt; CSS: # r1 {background color: blue; Height: 300px; Width: 300px; Display: Inline-block; } # R2 {background-color: red; Height: ...

java - Youtube API UploadVideo sample not working -

I am creating a web application that will contain YouTube functions in uploading and viewing a video. I have created an account on Google Developer Console and I have successfully uploaded the client_secrets.json file to my project (I am using Java and Netbeans). I would like to use the YouTube API and I tried to run an example of "upload video" example [a standalone application, to check how it works, obviously, The path has changed which I would like to upload, as well as change the path of our own client_secrets.json file. When I run an example, the login page for Google is opened in the browser, so I must manually enter the credentials. I have not tried with the web app yet, but in that case the authentication should not be handled automatically (using the client_secrets.json file)? My application handles our users and their functions, so the only user to communicate with YouTube is an application. After selecting a Google Account, I get the error that says:...

security - How to phase out a password hashing algorithm in an existing web application? -

Many people are about password in web applications, but I am facing a different problem. I know that on which I am currently working, is not safely enough (just sha1 without salt or anything), but all this change it It is difficult to suddenly. I have to find a way to implement a new algorithm for all (± 50.000) users. I was thinking about some solutions, but none of them speaks right. 1) Adding a second column to the user table with a new password Every time when the user is authenticated, I store the password with my new hash and throw the old one. In this exercise this will mean that it will take years before sha1 steps. 1.1), but encourage users to log back into our system for a security update, but in reality it seems that accepting a (former) security vulnerability This is not for my management choice. 2) Re-authenticate all users and throw all passwords. It is very harsh, and there is also a pain for the users behind. How do you cope with this problem? Yo...

python - I need to sum numbers from a file -

I am reading numbers from a text file whose structure is two numbers per line I need to open this file, and Numbers must be added to the range of two My program is exactly the same as I want to leave it to leave negative categories. Since I need to add all the numbers, I've added +1 at the end of the maximum number for the range. However, this is where the maximum negative negative four is for example, it makes the range like -5 instead of 5 because it should be done how do I fix it? I'm thinking the best way to write results in the output file. Thank you def numberSum1 (): inFile = input ('Enter the name of the input file:') outFile = input ('Enter the output file name:') Open (Infile, R ' ) As file 1, open file as file2: openList = [] x = file1.readline () as file 1: n, m = x.split () (Outfile, 'w') Print (N, m) maximum (minimum, maximum) = maximum (n, m) maximum (maximum (n, m)) print (minimum (n, m)) in print (minimum) for print (max) Mini...

How to stop conflict between jQuery and jQuery Mobile files on responsive website? -

I am just creating a responsive website for accountability such as desktops, tablets and mobile phones. I have a horizontal menu using a list and for mobile I have been switched to only three lines menu icon when a menu is clicked on the overlay panel The problem is that when I If the required jQuery file for the mobile overlay panel was brought, the horizontal menu on the second screen size was stopped working. I tried to use jQuery to make a conditional statement, if the width of the screen was under 321, then the script for jQuery would be called using getScript at that point. But it does not seem to recognize this. Can anyone tell me how to fix this problem? I'm quite new on responsive and jquery mobile designs. Thanks In the header: & lt; Script src = "scripts / jquery-1.11.1.min .js" & gt; & Lt; / Script & gt; & Lt; Script src = "scripts / jquery.mobile-1.4.2.min.js" & gt; & Lt; / Script & gt; & Lt; Script ...

java - Find out the list of tests that are skipped -

I have a large project that has multiple tests left (either by MVN or using @nonymous annotation By) Something like this: mvn test - Show-skipped-tests You can see the Fixed Report Plugin: This displays the tests that were omitted.

ruby on rails - RoR: 'NameError Exception: uninitialized constant Address' when trying to access recently added data from a populated postgresql table -

मैंने रूबी स्क्रिप्ट बनाई है जो डेटा को PostgreSQL में सम्मिलित करता है डेटाबेस। डीबी मौजूद है और तालिकाओं को भी करते हैं। मेरे पास मेरे ऐप में एक पता मॉडल और एक कंपनी मॉडल है और ये दोनों एक के माध्यम से जुड़े हुए हैं -एक-एक संबंध ( address_id कंपनियां तालिका में संदर्भित) मैंने स्क्रिप्ट चलाया है और किसी भी समस्या के बिना पता तालिका पॉपुल किया है लेकिन जब स्क्रिप्ट प्राप्त हो जाती है, जहां मौजूदा हाल ही में सहेजे गए पते आईडी डेटाबेस से ( Address.pluck (id) ) पढ़ा जाता है, तो मुझे त्रुटि। पता रिकार्ड को डेटाबेस में सहेजा जाता है क्योंकि मुझे pgAdmin में देख सकते हैं लेकिन ऐसा लगता है कि स्क्रिप्ट नहीं पहचानती है कि मैं तालिका से पढ़ना चाहता हूं। मैं किसी भी मदद की सराहना करता हूं। यहां स्क्रिप्ट का एक अंश है जो प्रासंगिक है: की आवश्यकता होती है 'yaml' को 'saferandom' की आवश्यकता होती है 'active_record' की आवश्यकता होती है ' 'सीएसवी' की आवश्यकता है DB_YML = "./config/database.yml" RAILS_ENV = ENV ['RAILS_ENV...

c# - render unbundled assets for admin user role -

Is it possible for users to present unprotected scripts and styles unhandled and in the role of "Admin"? I searched and found how to disable bundling bundletable.acceptoptimism = ... and minification foreach (bundle bundle in bundle) {bundle. Transforms. Clear (); } in global.asax.cs Application_Start , but I think this argument must be per-user, not every instance of the application, so it should not only be running the application Upon launching. First of all, no style or script included in the bundle config will be loaded until it is on the script Call by calling.Renderer () or Styles.Renderer () Methods By default, these methods are called from _Layout.schtml page (View / Share). @ Scripts.Renderers ("~ / / bundle / jquery") @ @ styles.crt ("~ / content / css") @ scripts. Renderers ("~ / bundle / modern") @ scripts Render ("~ / bundle / bootstrap") Creating a separate layout page for the admin area and lo...

python - UndeclaredNamespace error with feedparser -

हैलो मुझे फीडपर्सर का उपयोग करते समय निम्नलिखित त्रुटि हो रही है: अघोषित नामस्थान बढ़ाएं, "' % s 'एक नाम स्थान "% givenprefix feedparser.UndeclaredNamespace साथ संबद्ध नहीं है:' मीडिया 'एक नाम स्थान से संबद्ध नहीं है मैं एक फ़ीड जो कारण है करने के लिए उसे संक्षिप्त में कामयाब रहे : मैं एक वेब स्क्रैपर लिख रहा हूं जो फ़ीडस्पर्सर और सुंदर सूप का उपयोग करता है ताकि मुझे विभिन्न आरएसएस फ़ीड से समाचार लेखों को परिमार्जन करने में रुचि हो, इस अजगर का उपयोग कर लिख त्रुटि संदेश यह है:। फ़ीड = feedparser.parse (in_feed) फ़ाइल "/usr/lib/python2.7/dist-packages /feedparser.py ", लाइन 4014, पार्स saxparser.parse (स्रोत) में फाइल" /usr/lib/python2.7/dist-packages/drv_libxml2.py ", लाइन 208, पार्स eltName में, eltQName, attributesNSImpl) फ़ाइल" /usr/lib/python2.7/dist-packages/feedparser.py ", पंक्ति 180 9, प्रारंभ में एलेमेंटएनस अघोषित बढ़ा नाम स्थान,% givenprefix feedparser.UndeclaredNamespace " '% s' एक ना...

mysql - How to get avg time taken by grouping a particular column using sql? -

I have a table like this for which I am getting the total number of a specific call_count Datacenter for Model_ID in PHX , slc and SJC data meta_date. machine_name hour_of_day sec_of_hour meta_date client_id MODEL_ID CALL_COUNT average median datacenter machine 13 168 2014-07-30 00:00:00 Test13N 65 100 38,6382 5 PHX machineâ 13 170 2014-07-30 00 : 00: 00 Test13N 65 200 34382 4 PHX machineB 13 168 2014-07-30 00:00:00 Test 13 N 65 200 33.62 3 SLC Machine B 13 170 2014-07-30 00:00:00 Test 13 N 65 300 32 60 2 SLC Machine C 13 168 2014-07-30 00:00:00 Test 13 N 65 400 31.20 6 SJC Machine C 13 170 2014-07-30 00:00:00 Test 13 N 65 500 39.82 8 SJC then with the following question - select client_id, model_id, sum (case when datacenter = 'PHX' then call_count END) phx, sum (case When datascent = 'SLC' So call_count END) SLC, sum (case when Datacenter = 'SJC' So CALL_COUNT end) Model B SJC where meta_date = CURDATE () - 1 group client_id, client_id, M...

ruby - making 'some_element'.present? in watir wait for less than 5 secs -

How can we create some alarms? Or some_element.lookable? Wait for less than 5 seconds? Because I think some_element.present? Only 30 minutes before the timing will wait for the default value. Thank you I believe that you are asking that timeout How to shorten the length of time before, set by 30 seconds by default, to see how to optimize that time. Accordingly A clear wait There are four built in those methods that you can use to make your waiting experience more enjoyable (and your code To remove those bad sleep statements) Watir :: Wait until {...}: To be the true object where you can wait for a block. Where_present.set: Where you can do something of the current object. Where you wait for something until the object is present. Where you just disappear for some time, the default timeout for all these methods is 30 seconds, but you can give an argument to increase any of these (or decrease) as needed. and - wait_until_present (timeout = nil) the object wait...

jquery - Automatically display a div once all radio button sets have answers -

I am stuck on this problem for a while that I have focused on it and coding other quiz style Ella- Buysfed Now, the logic goes, "Once a radio button is clicked in the radio button sets, the div shows" I have solved the problem by "to some degree", alias Listens when creating a button when a radio button is clicked in all the sets. But, it is not what I want to do. Help? Part of the code goes ... // Result Algorithm $ ('# submit'). Click (function () {var likes 1 = 0; var option 2 = 0 ; Var option3 = 0; var option 4 = 0; var option 5 = 0; var choice = 6; $ ('input [type = radio]'). ("Disabled"); // for all queries If required (($ ("input [name = 'qa4']: checked"). Length == "0") ($ ("input [name = 'Qa5']: check"). Length == "0") {alert (please "answer all questions");} else {// Answer the answer to answer (persian ($ ("input (name) case 1: preference 1 ++; Pause...

python - How can I create multiple histograms with pandas? -

मेरे पास तीन कॉलम के साथ एक सीएसवी फ़ाइल है: पूर्ण नाम, Test_A_Score, Test_B_Score 0_10 से Test_A_Score और Test_B_Score रेंज मेरा लक्ष्य Test_A_Score के प्रत्येक अद्वितीय मूल्य के लिए Test_B_Score के मूल्यों से हिस्टोग्राम बनाने के लिए है। test_scores.csv पूर्ण नाम Test_A_Score Test_B_Score जेक जॉनसन 5 8 हेलेन स्मिथ 9 6 । । जोनाथन पीयर्स 3 8 मेरा कोड अब तक है: आयात करें pandas as pd df = pd.read_csv ('test_scores.csv', delimiter = ', ', Na_values ​​= [' - ']) # लापता स्कोर से छुटकारा पाएं df = df [(df [' test_A_Score '] & gt; = 0) & amp; Score_range में स्कोर के लिए स्कोर (डीएफ ['टेस्ट_B सीकोर']> gt_range =] (11) डेटा = [] स्कोर: स्कोर = डीएफ [(डीएफ ['टेस्ट_एआईसीकोर'] == स्कोर]] ['टेस्ट_B सेंकोर'] डेटा .append (scores) df_hist = pd.DataFrame (डेटा, कॉलम = स्कोर_आरेन्ज) तो, मैंने सोचा कि मैं score_range के लिए परीक्षण बी स्कोर लेगा, एक नया डेटाफ्रेम बनाएं, डालें डेटा और निम्नलिखित के साथ कॉलम के हिस्टोग्र...

python - Box Plot Trellis -

Image
I have some data. Let's say it's weather data, for this example of rain and temperature for every month , I will generate randomly like this: def rand_weather (n): month = n% 12 + 1 temp_ind = np.random.randint (0,4) temp = ["freezing "," Winter "," moderate "," hot "," extreme "] [temp_ind] rain = np.random.normal (50 - 4 * temp_ind, 25) + np.random.randint (020) Return month , Rain, temporary data = [RAND_WEDER (N) in the range N (3000)] rain_record = pd.DataFrame (data, column = ["month", "rain", " Then the data looks like this: month precipitation temporary 0 1 78.364133 freezing 1 2 54.2 9 022 cold 2 3 81.341265 cold 3 4 98.980334 Hot ......... .. 12 1 66.378066 Medium 13 2 44.264323 Medium ... ... ... ... I have to make a chart. I can draw a trail chart of such tools: avgs = rain_record.groupby (['temp', ' Month ']) Meaning () Avgs.reset_index (inplac e = True) ...

c# - How to save filename only to the gridview but I need path while downloading the file -

In the end, how to download a file using the path but I was wondering how do I just file a file on grid view I can keep the full path to download. On debugging I came to see that I can not name the file only on file uploads. Since this is done in the download section If I name the file, the file name is taken to the downloading part and the file is not downloaded. Someone can help me Code Upload private zones Attachachment (DataGridViewCell dgvCell) {(OpenFileDialog fileDialog = New OpenFileDialog ()) {// set file dialog property file file.Dialog.CheckFileExists = true; FileDialog.CheckPathExists = True; FileDialog.Filter = "all files | *. *"; FileDialog.Title = "Choose a file"; FileDialog.Multiselect = True; If (fileDialog.ShowDialog () == System.Windows.Forms.DialogResult.OK) {string strfilename = fileDialog.FileName; CncInfoDataGridView.Rows [dgvCell.RowIndex] .cel [1] .Value = strfilename; }}} /// & lt; Summary & gt; /// Download attachmen...

objective c - Iphone uibutton click feel -

My problem is to click UIButton backgroundcolor and navigate the navigation controller on the next page Will happen. I do not need to use the NSTimer to show the button effect. I have to apply this application for all buttons. / Li> I can not wait to show this effect to my next view controller If I think you're right, you want your All buttons in the app immediately change the background color on a button click You can do this by using the UIButton of presence . In short, UIAppearance allows developers to easily keep scenes consistent, for more information about what it is and how to use it during your applications. . Here is an example: // IBAction clicks a button inside [[UIButton appearance] SetBackgroundColor: [UIColor redColor]];

sybase - SQL joining two tables with common row -

मेरे पास sybase में 2 टेबल हैं खाता_टेबल आईडी खाताकोड 1 ए 2 बी 3 सी एसोसिएट_टेबल आईडी अकाउंटकोड 1 ए 1 बी 1 सी 2 ए 2 बी 3 ए 3 सी मेरे पास यह एसक्यूएल क्वेरी है SELECT * account_table खाते से, associate_table assoc WHERE account.account_code = assoc.account_code यह क्वेरी 7 पंक्तियों को वापस कर देगी। मुझे क्या चाहिए associate_table से पंक्तियों को वापस करना है जो कि केवल 3 खातों में समान है: खाता आईडी account_code एएसओसीआई आईडी 1 ए 1 2 बी 1 3 सी 1 क्या कोई मुझे शामिल होने में मदद कर सकता है? चुनें बी.आई.डी. अकाउंट_आईडी, ए सीड, एक एडीओसीआईडी ​​एसोसिएट ए, अकाउंट बी WHERE a.code = b.code और a.id IN (SELECT a.id से एसोसिएट ए, खाता बी WHERE a.code = b .कोड ग्रुप द्वारा a.id हैगिंग गणना (*) = (चयन संख्या (*) खाते से)); नोट: यह क्वेरी केवल तभी काम करती है जब आपके खाता तालिका में आईडी और account_code कॉलम में अद्वितीय मान हैं। और यह भी, आपके associate_table में (आईडी, खाता, कोड) का अद्वितीय संयोजन होना चाहिए। यानी, सहयोगी तालिका में (1, ए) या किसी भी जो...

PHP: Change image in a div depending on what page is loaded? -

I'm terrible in answering these questions, but I hope what I'm trying to do, it's a good idea is. I have 7 pages and 7 images, pictures are all "waterfall_01.jpg", "waterfall_02.jpg", etc. 7. I have code so far away: & lt ;? Php $ cp = basename ($ _ server ['PHP_SELF']); $ Cf = dirname ($ _ server ['PHP_SELF']); ? & Gt; & Lt; Img src = "/ img / waterfall_0" php if ($ cp == "about.php" || $ cf == "/ about") {echo "1";}? & Gt; .jpg "/> How do I change this code to resize a different number between 7 and 7 different pages (some of which are below the folders in a folder dropdown menu is shown). Technically, I can actually write a very long line: & lt; Img src = "/ img / waterfall_0"? Php if ($ cp == "home.php") {echo "1";} ($ cp == "about.php" || $ cf == "/ About ") {echo" 2 ";} if ($ cp ==" ...

How to create html partials? -

When the webpage layout is repeated on the website, what do you use to avoid continuously repeating the code? (Tailored to the Rail HTML layout with its yield ) I think I can not make a Google request properly, there should be something bigger. I use the system bunch individually for this, although many different frameworks Generally they are called templateing systems, and they go through your HTML and answer the command to generate text.

Replace text in HTML within multiple tags using Jsoup in Java -

I'm reading an HTML file line by row using Java. Let's say I have an HTML line & lt; P & gt; Hi everyone. This is a & lt; Em> The dead end is there. & Lt; / Em> do not go! & Lt; / P & gt; I type the text in the row There is no dead end. & Lt; / Em> You can go! & Lt; / P & gt; will be given as input Change to : Do not go it's a dead end! Change to: This is not a dead end you can go! please As an alternative to MCL solution, here's a fully supported one: First of all, how is it that JSW sees your HTML: org.jsoup.nodes.TextNode: Hi everyone. This is an org.jsoup.nodes. Element: & lt; Em> Dead end & Lt; / Em> Org.jsoup.nodes.TextNode: Do not go! All three nodes & lt; P & gt; ... & lt; / P & gt; element has children. And here (very verbose) code: last string html = "& lt; p> Hi everyone, this is a & lt; em & gt; Dead end. & ...

arrays - Get count of true in bool[,] F# -

I have a bool in F # [,] and I want to count the presence of truth. How can I do this without getting into compulsory programming? This is my current solution, which is actually written in C # For unstable x = 0 cells in cells, if cell = true then x Here's a way: let x = cell | & Gt; Seq.cast | & Gt; Seq.filter ID | & Gt; Seq.length What does this false value filter out (see), and then guesses what is omitted after that

database design - Using Parse as BaaS to store multiple images in an efficient manner -

I am using paras to create an ecommerce application for iOS and Android. I have a product table (or class) that contains all product related information such as price, description etc. I am struggling to find the most effective way of storing images. Every product has about 10-15 images and I want a good UI on the customer. Create an array in the product table and archive multiple images (don '' Save images on some external servers and create an array of image URLs in the product table. > Save all the images in a new table. What could be the best solution in terms of speed and minimum API call. Please advise. Does anyone have an image Know about the hosting server in my case Thanks Let me know through each of your modes Let's highlight the pros and cons of each. Create additional 15 columns in the product table with the type of images to store. / Strong> If you have 3-4 images then it is quite possible and apparently good but in this case yo...

What is the best way to get access to text message inbox programmatically in android -

I searched on many sites and blogs for my query. I am confused about the fact that mobile inbox What is the best way to import a text message from my application? Some SMS managers recommend and say through some content providers. Looks like you want to use content resolver. / P> Short Description: Use to send SMS Use to read all existing SMS Use for new incoming SMS reading There is a good question which shows how to SMS from Inbox Recover.

cookies - Rails 4 multitencancy with subdomain login management -

Scenario: Multi-tenant rail app which uses subdomain and is planning Problem: I want the user to Must be able to log in to my domain. Com can then be forwarded as a logged-in user to its own subdomain at 1.mydomain.com address . Now they can only log in their own subdomain. I am a relative tracks novice and I can not find a simple solution (though it seems that there should be one). Ideally I want to share a cookie to mydomain.com and subdomain1.mydomain.com, but my skills are not to write custom middleware, obviously because it is a majority, so I can not share a session in all subdomains. For some days it is stranded on and curious if there is a simple solution (such as the config.session_store domain setting) that I'm not remember before seeing OAuth or other more complex solutions, any help would be appreciated! Edit: Of course I only found it after posting. . Config.session_store will try the domain: with the recommendation of all the filters first and if it does not ...

java - Secure plain text passwords in configuration -

In web applications, you must store the password used to connect to a database. It is mostly in plain text configuration Is done in the file. I am searching to make it more secure and have seen Jasypt (www.jasypt.org) which makes it possible to encrypt these passwords. But you still need the key to decrypt them, which only increases the problem, then I took this key into a system environment variable so that it is at least out of the application. But I still think that this really can not change a lot? How do other people solve this problem? Do not store production passwords in a config file within your source code. This is an admin de facto code for any person. The environment variable set on the production server is a good way to go one. You can recover the app from that price, and can vary for different environments (Dev, Test, Live). This allows the system to know the password for example (developers have access to them without needing to know them). Works very we...

javascript - HTML - Div to the bottom without absolute positioning -

Here it is. I added some CSS to position the tab to the right. I wanted to place those tabs in the lower right corner of the container. If I set the position of div to absolute, that tab will zero the content width which can be adjusted by setting margin-right in turn, but this dynamic will not be enough if the tab header The width is greater than the margin-accurately defined. Is there no alternative to pushing the tabs in the lower right corner of tab-container any help Would be greatly appreciated. Thanks in advance. When you can use modern CSS, you can use flexbox . Here's the demo: .tab-content {flex: 8 1 auto; } .nav {flex: 1 Auto; Order: 2; Align: Flex-end; } Here is the table of supported browsers: As you can see that IE10 is only partially supported and will need special attention: here There is a good article on Flexbox:

android - Download video from vimeo with out URL is geting? -

I need to download the Vimeo video in my app, which does not have any video ID. How do I get a Vimeo video URL? Or what other way to download videos in Android? Download capabilities are provided only to pro requesting members, their own videos, their own From the API app If you want this, you should be able to see the download link on every video in .

java - When I set a custom view on an actionbar... why back button and logo dissapear? -

मैं बस इस तरह से सेटिंग कर रहा हूं: getSupportActionBar ()। SetDisplayOptions (एक्शनबार DISPLAY_SHOW_CUSTOM); getSupportActionBar () setCustomView (R.layout.actionbar_create_route)। MTitle = (TextView) findViewById (R.id.ab_title); अगर मैं लोगो को सेट करता हूं और इसके बाद सक्षम करें: getSupportActionBar ()। SetDisplayShowHomeEnabled (सत्य); getSupportActionBar () setDisplayHomeAsUpEnabled (सही)। getSupportActionBar () setDisplayUseLogoEnabled (सही)। यह नए लेआउट को सही पर ले जाता है धन्यवाद

c# - NodaTime ZonedDateTime not considering clocks going forward -

From the nodes of John Skeet: While effectively adding "experienced" time - As we will wait twenty minutes, though, at that 1:00 a.m., in Europe / London time zone the clocks go beyond one hour - so we end up at 2:00 pm local time, and not At 1:05 p.m. you might have expected However, when I try this code, most of its applications are nodecoded Effectively copy and paste from documentation, then variable 01:05:00 , instead of 02:05:00 why this time Not accounting for the field? Datimejon London = DateTimeJonoproder. Tzdb ["Europe / London"]; LocalDateTime local = new local time (2012, 3, 27, 0, 45, 00); ZondDateTime = london.Atstrictly (local) before; ZonedDateTime = After the first + period. Contact minutes (20); Debug. WrightLine ("local = {0}", local); Debug Virusline ("before adding 20 minutes = {0}", first); Debug Virline ("20 minutes after adding = {0}", after that); Output: local = 03/27/2012 00:45:00 be...

asp.net mvc - MVC 5 Scaffolding with inheritance uses the wrong entity set -

With MVC 5 and EF 6.1, I am using a simple succession hierarchy, where students from class students are to meet. My database reference for both classes is an entity set (DBset property): public class databaseContax: DBCOntax {public DBset & lt; Person & gt; Person {receive; Set; } Public DbSet & lt; Students & gt; Student {Received; Set; }} Now when I say Scholldler to be the controller for the student, the subclass, it uses the organization of individuals, such as Student's student = DB persons. Search (ID); Where the compiler clearly complains that it can not convert any student to any student. Is there a way to ensure that Schollfolder uses the correct unit set (student in this case)? Note that removing the organization of individuals is not a good solution, because other administrators are needed. Why is not a foreign key to use a person who makes a relationship instead of heritage? This is the reason why you can db.students.find (personID) ...

asp.net - DNN Error - Default.aspx?tabid=482&error=An unexpected error has occurred&content=0 -

I have correctly installed DN77, I also have a child page on the dnndev.me site (testdemo ) Have been added. It worked perfectly, then I added a module and added the module for the childpage (dnndev.me/testdemo). I have installed the skins, it is also fully implemented [This was also found in the portal / default / skins folder] Next I have edited the module [ No big, added a label box with text] and DN error it appears in the address tab - Even general ddndev.me also looks like this, so I opened the portal / _default / logs file, I got the following error, 2014-08-01 13: 03: 57,333 [user-pc] [thread: 40] [FATAL] Dotnet Net. Framework PageBase - An error has occurred while loading the page. System.NullReferenceException: The object reference is not set to an instance of an object. On DotNetNuke.Framework.DefaultPage.OnInit (EventArgs e) at DotNetNuke.UI.Skins.Skin.GetSkin (PageBase page) System.Web.UI.Control.InitRecursive (control namingContainer) on System.Web.UI...

CRUD in AngularJS -

I am creating an Admin Panel which includes most CRUD operations in Angular JS. I have seen many examples of how to do it on the web. I have noticed that each example is a single page application that handles a type (for example, person, employee, etc.). My question is: If I am preparing the admin application, it will include a large number of CRUDs (one for each type of database used) Can I use a single page app for administrators? Panel website or should I make a separate single page application for each CRUD? What is the best practice for this? We have chosen to use an app for a multi-model admin GUI which is a ng-admin (See Angel-Source, see the code). It works very well, and is easy to deal with model relationships (one-to-many, many-to-one, many-to-many). By doing so with many apps, many applications have to be booted - maybe bad for webpages.

web services - Using a php file as webservice, but also as a normal include file -

We have written in webservice php . It's very simple, you implement the http request and webservice function in the same way with a certain "action" (post variable). This webservice is used by our application ( android and iOS ) We also have a user management system It has started in the form of creating / editing / deleting pages of users, but after that there is a lot to include more features than we have done through this php application Want to use some of the webservice functionality. How it was created webservice : included "config.php"; // for database connection // Some additional classes and functions are included for $ action = $ _POST ["action"]; Switch ($ verb) {case "login": {// do login stuff break; } Case "get_roster": {// break roster inventory content; }} This file does not work when inserting the file from another php file, so I will call it function Put it in does not execute imm...

python - multiprocessing Pool.map function issue -

मेरे पास एक फ़ंक्शन है, जो एक सूची और पथ लेता है: def My_function (items_list, निर्देशिका): समानांतर कंप्यूटिंग करने के लिए (उदाहरण के लिए 'a: c: \\ path') विशिष्ट फ़ाइल का उपयोग करके उदाहरण के लिए (वस्तुओं की सूची का विश्लेषण करने की परिणामस्वरूप संख्या) मैटलिप्रेंसिंग मॉड्यूल का उपयोग कर के रूप में अनुसरण करें: multiprocessing आयात से pool def test_func (objs): पूल = पूल (8) परिणाम = pool.map (my_function, objs) रिटर्न (परिणाम) यदि __name __ = = '__ मुख्य__': ऑब्जेक्ट्स = [([ए, बी], 'पाथ 1',), ([सी, डी], 'पाथ 2',), ...] परिणाम = टेस्ट _फंक्ट (ऑब्जेक्ट्स) लेकिन यह मुझे निम्न त्रुटि देता है: प्रकार त्रुटि: my_function () 1 अपेक्षित स्थितीय तर्क अनुपलब्ध है: 'निर्देशिका' मैंने ऑब्जेक्ट्स सूची स्वरूप को कई बार बदल दिया है लेकिन यह मुझे देता है एक ही त्रुटि क्या किसी को पता है कि समस्या क्या है? (Python33 का उपयोग करके विंडोज़ 7 पर) मल्टीप्रोसीसिंग.मैप अनपैक नहीं होगा आपके ट्यूपल में चर तो myfunction एक सूची और एक स्ट्रिंग के...

c++ - Error "'JNIEXPORT' does not name a type" while trying to compile for Android -

I am trying to compile the C ++ code with NDK to use on Android. However, I get this error when trying to compile: Error: 'JNI Airport' is not a type of name (file: JNIPI, Line: 9) Error: 'JNIXport' The name does not have a type (file: JNIApi.h, line: 10) JNIApi.h looks like this: #pragma once Extern "C" {JNIEXPORT ZERO JNICALL Java_com_manabreak_tremortest_TremorLauncher_initTremor (JNIEnv * jenv, Job topic obj); JNIEXPORT ZERO JNICLL JAVA_COM_ManBreak_TRITTET__TORREAZER LAUNCHER_SATFORMS (JNIAN * JNU, JOBCAD OBJE, JAJJEET SUFAL); } and the build process outputs it: start building 1.8.2014 11:14:17. 1 & gt; Project "E: \ Trammer \ Build \ Tremor. Vcxproj" on node 2 (create target) 1> ClCompile:. E: \ ADT \ NDK \ toolchains \ hand-linux-androideabi-4.8 \ prebuilt \ windows-x86_64 \ bin \ hand-linux-androideabi- G ++ exe JNIApi.cpp E: \ ADT \ NDK \ toolchains \ Hand-linux-androideabi-4.8 \ Pre-made \ windows-x86_64 \ bin \ ha...