Posts

Showing posts from February, 2014

autocomplete - How to Customize the View of AutoCompleteTextView in Android? -

I AutoCompleteView where users can search for other users. User is a custom object that contains the ID, name. The AutoCompleteView user is the controller by the adapter in the User Adapter suggestion to handle the view of the user object. How do I set an autocomplete view to search the user name? I mean, should work on the basis of auto-complete username. The You must use addTextChangedListener on your autocomplete text Because Afterwards, use a method provided to call 3 other functions which will contain your list which includes user names An example here:. recherche.addTextChangedListener (New TextWatcher () {@Override public void beforeTextChanged (charSequence charSequence Int I, I2 Integer, Integer i3) {} @Override public void onTextChanged (charSequence charSequence Int I integer I2, I3 integer) {if (charSequence.length () & gt; 1) Khojasucnaan (charsequence);} @ Ovrred public void (editable after editing text) {}}); For "search" method, you many...

list - How to speed up a search in a long document using python? -

I was wondering if it is possible to search in Vime using a python to speed up the search in a longer document . / P> I have a text document of 140,000 lines. I have a list with 115 different search patterns. I want to put all the rows with matches in a list (hit) I do this now: for the category (1, the row ("$") for the category I 0, Lane (Marcelle) -1) idx = match (get line, mysearch [ii]) if idx & gt; = 0 call add (hit, line) endif and end and "Remove the double linen: appell = filtered (hit), 'Index (Hit, V: Vel, V: Key + 1) == - 1') The problem is that this search takes more than 5 minutes. I How can I optimize the search in Python search? How about: pattern = join (mysearches, '\ |') = my list = systemlist ('grep -n' '.pattern.' '' Sh ('; Cut-d: -f1'); \ | (like OR ), using the grep to process your pattern, Grep should be very fast, with much more vim and possibly even Eith...

ios - remove unsafe: from NSURL and load rest of URL webview -

मेरे पास एक यूआरएल है, जैसे असुरक्षित: customscheme: // customResourceSpecifer । मैं इससे असुरक्षित उपसर्ग को निकालना चाहता हूं और शेष यूआरएल को लोड करना चाहता हूं, वर्तमान में मैं ऐसा कर रहा हूं, क्या कोई और तरीका है? - (BOOL) webview: (UIWebView *) webView चाहिएStartLoadWithRequest: (NSURLRequest *) अनुरोध नेविगेशन टाइप करें: (UIWebViewNavigationType) नेविगेशन टाइप करें {यदि ([request.URL है UNSafeURL]) {[self.webView loadRequest: [request.URL URLRemovingUnsafePrefix]]; वापसी नहीं; } हां लौटें; }

How to run python function in Unix server using Excel VBA? -

I want to automate the steps below using the Excel VBA / VB script. Hostname: example.ash.pwj.com Port: 22 UsrName: xxx PWD: yyyy File Protocol: SFTP To transfer a file from a local machine to 'testfile' to a directory, using Unix Server Winscp (a dragon script in the directory 'connector.py Step 2: Open Pulse Destination Host Name: example.ash.pwj.com Port: 22 Connection type: SSH Using login credentials. Step 3: Call the Python script in the directory. python connector.py testFile example2.ash.pwj.com 123 Example: I use Excel VBA / VBScript to transfer the WinSCP file to Putty and call the Python script. Here's my code:. Set = CreateObject ("WScript.Shell") sh.Run "pscp -pw yyyy C: \ Users \ abc \ testfile xxx@example.ash.pwj.com: / home / Test / dir ", 0, is true sh.Run" plink.exe -pw yyyy xxx @ example.ash.pwj.com dragon / home / test / dials / connector / testFile example 2.ash.pwj.com 514 " , 0, ...

sql server - SQL Highest Value With Group -

मुझे सबसे ज्यादा StockOnSite प्रति ProductID प्राप्त करने की आवश्यकता है (स्टॉक डिफाफेर्न्स की गणना) रिकॉर्ड और स्टॉकऑनसाइट के साथ एक कॉलम ऑलस्टॉक बनाने के लिए स्टॉकऑनसाइट को सम्मिलित करें मैं पूरी तरह से खो गया हूं? के रूप में मैं कर सकते हैं समूह नहीं के रूप में हम एक StockOnSite और StockOffsite यहां है SQLFiddle यह एक नकली पोस्ट, बाहरी का चयन के रूप में नहीं है समूहीकरण पेचीदा हो जाता है । धन्यवाद मेरा मानना ​​है कि यह वह क्वेरी है जिसे आप खोज रहे हैं । यह मूल्यांकन करता है StockDiff के रूप में आप का सुझाव दिया: StockOnSite - StockOffSite और फिर उच्चतम मूल्य हर SiteID का चयन करें SiteID, विवरण, StockOnSite, StockOffsite, AllStock, LastStockUpdateDateTime, से StockDiff (* का चयन करें, रैंक () ((चयन s.SiteID, s से रैंक के रूप में की SiteID आदेश द्वारा StockDiff DESC वाला भाग) से अधिक पूर्व .description, p.StockOnSite, p.StockOffsite, कास्ट + '/' + कास्ट (varchar (10) के रूप में p.StockOffSite) AllStock, p.LastStockUpdateDateTime, p.StockOnSite...

javascript - Bootstrap add tooltip to dropdown -

I am trying to add tooltips to bootstrap, tried all the solutions found on the internet - nothing helps Here's my dropdown (I'm also using string and JSTL tag): & lt; Div class = "btn-group" style = "margin-bottom: 5px; width: 100%;" & Gt; & Lt; An id = "tableNameButton" data-placement = "bottom" title = "text" class = "mine-tooltip mine-dropdown tableNameNumberBTN BTN-default BTN-block BTN-select" data-toggle = "dropdown" href = "# "& Gt; Select the table & lt; Span class = "caret" & gt; & Lt; / Span & gt; & Lt; / A & gt; & Lt; Form: Input class = "form-control" id = "tableNameFormId" path = "tagname" style = "visibility: hidden; display: none;" / & Gt; & Lt; Ul id = "tableName" class = "dropdown menu scroll-menus" & gt; & Lt; C: forEach item = "$ {databaseTa...

Reading JSON file with Liquidsoap -

I want to create many liquid sources with the same script but the name of the example station with some variables. I have seen that I can include config.liq, for example, but it would be nice if I can read some configuration parameters that are not related to the language, such as in JSON LiquidSap There is a of_json function, but it is not clear how I can read the JSON file instead of the JSON string. What can I do to create a configuration file that is not associated with the scripting language? Good question I do not have the exact code for you, but I actually shot the curl with HTTP I am able to read. (And then, I get the built-in function for HTTP requests, but they do not apply to your case which I do not think.) If you can not find any command to read a file, To dump just use with call at cat .

asp.net mvc publish with database -

Image
I want to publish one of my hosts to my host. The site was successfully published by the VS and FTP method but the matter is databases side. I have used the unit framework in this project. I have changed the connection string after publication and I have created tables in my online database. First of all, I want to know how to show a complete error message to my site as it shows when I'm debugging in local mode. And the other is that should I do anything more that I should do for my DB? After this I added this line to web.config: Now this error is: You section section of your web.config. Can disable custom errors in the web: & lt ;! - default - & gt; & Lt; CustomError Mode = "Remote Only" Default Redirect = "~ / Home / Error" /> & Lt ;! - disabled - & gt; & Lt; CustomErrors mode = "off" defaultRedirect = "~ / Home / Error" /> MSDN: CustomArray element can be defined at any level in t...

ignored files take up space in git repository -

I have some videos in the directory. Gitgnor The files were never shown in the changelog, yet they ended up in the .git / objects directory anyway. It takes ~ 550 to ~ 150 MB. How is this possible? I have not found " git ls-files " and " git diff HEAD ago Commit - name only " and files have not been found anywhere. An alternative solution (without explaining the root cause) will be cloned OP those people Confirms that .git / objects additional files are no longer present in the second clone. You can try the original repo: git fsck --full - unrecoverable --no-reflog

java - JSF SessionScoped Bean Fields become null primefaces -

I have my beans @SessionScoped code for menuController and extends one of my classes menuController and added If I set the value of the id and navigate to the other page, the id valid becomes empty import javax.faces.beans.ManagedBean; Import javax.faces.bean.SessionScoped; @ManagedBean (name = "menuController") applies the session-scanned public class MenuController basepage Serializable {/ ** * * / / Private string ID; Public Menu Controller () {} public string getId () {System.out.println ("Menu Controller ID =" + ID); Return id; } Public Zero Set ID (string id) {this.id = id; }} Here is the code of Bean that is inheriting the menu controller and setting its id value. This bean has been vacant value of the ID set to meet when the menu has been scanned @ session controller import javax.faces.bean.ManagedBean; Import javax.faces.bean.SessionScoped; @ManagedBean (name = "channelLeftPanel") @SessionScoped public square ChannelLeftPanel rippled ap...

javascript - New Date function not working in IE -

I'm displaying the datatents of my server using the new date () function in Jquery. My server data time is in PST format I am using the code below to show my server time: New date (Value Integrated Date). The format ("MM / DD / yyyy HH: mm") CompleteDate is a column with my table's dateTime datatype. The above jquery code works fine in Firefox and Chrome but it is not showing up. The correct time in IE is working on IE-11 version. Please suggest. thank you in advanced.

c# - How do we control, Text rendering in winform application -

Image
In the following picture we can see that the text is displayed / displayed separately. But the application is the same and they were just running on 2 different Windows 7 machines. Please understand the machine settings and correct changes required to correct Help me, so that both of them can be displayed evenly. ClearType is closed in the first version. The display options are controlled in the window.

c++ - Problems catching "Tap and hold" touch event on QPushButton in QT -

मेरे पास QPushButton है जहां मैंने दबाया गया है () सिग्नल और autoRepeat = true सेट करें। बटन क्लिक करते समय एक नंबर अपडेट करते हैं (माउस के साथ), और जब आप क्लिक करते हैं और इसे दोहराता है। यह एक माउस के साथ ठीक काम करता है एकल क्लिक चरण एक बार, क्लिक करें और इसे दोहराता रखें। साधारण टैप टच स्क्रीन का उपयोग करते हुए ठीक काम करता है, लेकिन यह "टैप और होल्ड" पर दोहराना नहीं करता। मैंने विंडोज 8 में "टैप करके सही क्लिक करें" सेटिंग को अक्षम करने की कोशिश की है, लेकिन ऐसा नहीं हुआ मदद। यह केवल हो रहा से सही क्लिक को रोकता है। अगर मैं QPushButton को टैप करता हूं और उंगली को बटन से दूर ले जाता है (जबकि अभी भी होल्डिंग), और फिर उंगली को QPushButton काम करता है, दबाया () ईवेंट में वापस ले जाएं AutoRepeating शुरू कर देंगे। MyPanel.ui: & lt; विजेट वर्ग = "क्यूपशबूटन" नाम = "अपबटन" & gt; & Lt; प्रॉपर्टी नाम = "टेक्स्ट" & gt; & LT; स्ट्रिंग / & gt; & Lt; / संपत्ति & gt; & Lt; प्रॉपर्टी नाम...

wpf - Winform display issue in citrix -

Image
I'm hosting Winform control in WPF using WindowsFormsHost and when this application The citrix is ​​launched in the atmosphere, as shown in the following image, the Winform UI is displayed in blue: There is nothing clear in the above image I'm already using the settings under WPF application but It does not fix the problem. System.Windows.Forms.Application.EnableVisualStyles () Any advice about how to fix this will be great. This issue changes from Windows7 to Windows Classic in Windows theme Winterform control back color set System.Drawing.SystemColors.ActiveCaption. This color turns into a dark blue color, as shown in the image above when the theme is turned into a classic classic, to fix it, I changed myself behind the color of the humble control.

android - How to deliver a message from an activity that called fragment to that fragment? -

मेरे पास ActivityA ActionBarActivity विस्तारित करता है जो FragmentB को शुरू होता है जो तत्काल आरंभ हो जाता है गतिविधि ए के बाद ( ActivityA.onCreate () डिफ़ॉल्ट के साथ एक पैरामीटर param ) के बाद। मेरे पास कई अन्य टुकड़ा है जो कि ActivityA द्वारा शुरू किया जा सकता है, और इसलिए यह डिज़ाइन। में ActivityA , I निम्नलिखित कोड द्वारा क्रिया बार पर खोज बटन से जुड़े SearchView कार्यान्वित किया है मैं उस बिंदु तक पहुंचने में सक्षम हूं जहां मुझे खोज टेक्स्ट मिलता है, लेकिन अब, मुझे ActivityA में खोज क्वेरी के आधार पर param में FragmentB को अपडेट करने की आवश्यकता है (या बस खोज क्वेरी को FragmentB पर भेजें और इसे एसिंक्रोनस खोज करें)। मैं पैरामीटर को FragmentB पर कैसे भेजूं जो मुझे पता चल रहा है? Ie, मैं param से ActivityA.handleIntent (intent intent) से FragmentB से कैसे पारित कर सकता हूँ? क्या यह अच्छी डिजाइन है पहली जगह में? क्या मुझे खोज कोड अवसंरचना को टुकड़ों में ले जाया जाना चाहिए? यदि हां, तो अन्य टुकड़े जो कि ActivityA संदर्भ के भीतर शुरू हो जाएंगे,...

python - Openerp full access for a group -

How to set full access to a group in my custom module in OpenErp? Now some users do not have access to everywhere because they are filtered by domain_ filter. You file a ir.model.access.csv , and all of them Give access to objects that you want for a specific user group.

vb.net - Regex to find words starting with a colon -

I'm preparing a text editor with vs. 2013 Express. I have to meet words that start with a colon (:). Currently I use a regex for it. But this is not right. This is my regex - ": \ w +" It finds the word, but the way I want it is not enough. My purpose is to find the words starting with a colon (the first letter of the word is a pre-test of the colon) but there are words at the beginning of only one line (not in the middle of a sentence) and this word should be excluded It is expected to start with two colon (:: Test) that you can help me .. Use ^ to match the beginning of a line New anchor. ^: (? !!) \ S + :(?!): This negative lookup makes this claim That : will be followed by any but : ^: \ w + matches this : and the following words are only at the start of a line.

Nested Slider addition -

I am trying to mimic the nested slider from the link below. The only way I was able to do this was, Copy the source code and touch the banner etc. Doubles Question: Is there a way to find source code for CSS and JS with this specific example? I'm trying to add another nested section .... right now in this example 3 ... and are unsuccessful ... I have anohter sliderh4_container here $ Jssor $ $ Each (["sliderh1_container", "sliderh2_container", "sliderh3_container", "sliderh4_container"], added function (container id) { but it seems slang in working ... and then in HTML Slider Container Added .... Any ideas .. Thank you in advance ... You can adjust the thumbnail size. For example, to change the thumbnail size, from 200 x 100 150 x 100, instead of & lt; div u = "slide" style = "cursor: move," & gt; & lt; div u = "prototype P "square = p style =" status: full; WIDT...

angularjs - Testing an attribute of isolated scope from a directive -

I have already tested Q & A related to directing, separate scopes that help me test a feature Found in the '@' property; But I find it hard to test such properties that use the '=' property (from my next coming direction): return {restrict: 'a', link: link, radius: {upcoming: '@', patient details: = '}}; In my testing for upcoming I use it (forward angle 1.2) by using it like the isolateScope () function I can: ALM = angular Element ('& lt; div forthcoming = "recall" patient details = "patient details" & gt; & lt; / div & gt;'); // directs the direction and links it to $ compilation (elm) (region); Scope $ digest (). Different scope = elm Istholtascope (); And in the testing I can do this: This ("attribute should be attached to separate 'incoming' ', work ( TB ('memorable';)); () (); But if I go to other properties in the same way then I get an u...

symfony - SF2 - Sonata: How to get parameter from parameter.yml in entity -

I used Sonata Admin Bundle. How can I add parameters either directly or through the service .... I need some cleaning work in Postremove, path, access data and more disclosures I need here . This I will not write on Hardy Entitiy, but picking parameters.yml from Timo entity class business logic There is not a place for As far as I know that you can not define the unit as a service All you need to do is make it as one that you define as a service and parameters .iml can pass the value from what you want to be resolved by This listener should listen on your postRemove event Your services.yml :. Services: SERVICE_NAME: Category: Acme \ Your \ ListenerClass Logic: [% your_parameter_from_yml%] Tags: - {name: doctrine.event_listener, event: postRemove} Your ListenerClass: Category ListenerClass {Public Function __construct ($ your_param_from_parameters) {$ this- & gt; Ultimate = $ your_param_from_parameters} / ** * @param LifecycleEventArgs $ args * / ...

python - How to modify this script to check for HTTP status (404, 200) -

I'm currently using the following script to load the list of URLs, for each list of error strings Check the source. If there is no error string in the source, then the URL is considered valid and written in a text file. How can I modify this script to check HTTP status instead? If a URL returns 404 then it will be ignored, if it returns 200, then the URL will be written in the text file. Any help will be very much appreciated. urlib2 import system error_string = ['invalid product number', 'specification is not available. Please contact customer service. '] Def check_link (url): if not url: return false f = urllib2.urlopen (url) html = f.read () result = if html: result = true html = html.lower () if in html: error_strings Results for the result of = false break return result if __name__ == '__main__': if lane (sys.argv) == 1: print 'usage:% s & lt; File_containing_urls & gt; % Sys.argv [0] and: Open = url ('valid_links.txt', ...

Error parsing XML: not well-formed - android application -

Hello, I can not see what I'm doing wrong here, maybe spelling error or something I've seen, but something Can not even see the wrong Hello, I can see what I am doing wrong here, maybe spelling error or something else I have seen but can not see anything wrong. & lt; Relative layout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http: //schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height Android: paddingBottom = "@ Dimen / activity_vertical_margin" Android: paddingLeft = "@ Dimen / activity_horizontal_margin" Android: paddingRight = "@ Dimen / activity_horizontal_margin" Android: paddingTop = "@ Dimen / activity_vertical_margin" tool: reference = "com .example.facebooklogin.FacebookLogin "Android: background =" @ drawable / faceb_background "& gt; & Lt; imageView android: id = "@ + id / img_login...

javascript - Select the content of input / textbox field on tap / click -

एक चयन योग्य टेक्स्टबॉक्स के लिए मेरा राज्य चुनौती: क्लिक / नल पर इसकी सामग्री का चयन कर सकते हैं 'किसी भी' प्रकार का एक क्रॉस ब्राउज़र टेक्स्टबॉक्स / इनपुट फ़ील्ड बनाना। एक समस्या जो कई समस्या: जब कोई स्पर्श डिवाइस का उपयोग करता है तो नल ईवेंट आग लगाता है जब माउस ईवेंट पर क्लिक करें Apple डिवाइसों पर टैप ईवेंट onclick या onfocus को आग नहीं करता है। यह एक सफ़ारी विशिष्ट समस्या नहीं है क्योंकि Google क्रोम के पास एप्पल डिवाइस पर एक ही समस्या है लेकिन एंड्रॉइड डिवाइस पर नहीं पाठ का चयन करने का मानक तरीका केवल इसका उपयोग करना है: $ ('इनपुट' )। फ़ोकस (फ़ंक्शन () {$ (यह)। चयन ();}); स्टैक अतिप्रवाह पर उल्लेखित एक अन्य चयनित कार्य है: $ ('input')। फ़ोकस (फ़ंक्शन () {this.select (); // कोई jquery आवरण})। माउसउप (फ़ंक्शन (ई) {e.preventDefault ();}); दोनों अच्छे तरीके से काम करते हैं लेकिन एप्पल उपकरणों पर काम नहीं करते हैं। मुझे मिल गया एकमात्र काम करने वाला समाधान इस के अनुसार एक चयन श्रेणी बनाना है। यह शुद्ध जावास्...

Adding data points on a plot in r -

Hi I have a simple plot of the year and the number of births in those years. I want to create a graph / row on which x is the number on the year and y is the number. My code is far below 'x' should be numeric: when i run it i get error error (x) in jitter. This plot is based on a dataframe DF. Any help would be greatly appreciated. #plot (df $ number), (df $ sex), xlab = "x", ylab = "y", type = "l", main = "my graph") plot ($ Years, df $ number) df x = df $ y y = df $ number #plot (x, y) par (march = c (3,3,2,1), mpg = c (2,0.7,0 ), Las = 1) plot (x, y, type = "n", xaxt = "n", yaxt = "n", las = 1, xlab = "year", ylab = "") Number =) axis (1, on = beautiful (x), label = TRUE) (2, = beautiful (y, n = 10) axis, las = 1) #grid () digits (jitter (x), y, col = "Blue", pch = 20) # dot (jitter (df $ number)) See class ( X) or class (df $ year) . Depending on the data, i...

How to compare two input variables with mysql stored values (PHP)? -

I'm basically wanted to make an HTML form in which the user puts two different input then this information in a MySQL table Compiled data is compared with. If both of the input variables match the two variables in the same row from the table, it gives a message, if it does not give another, how can I do it? This is my code so far: if (mysqli_connect_errno ()) { echo "failed to connect to MySQL:". Mysqli_connect_error (); } Escape Wheriabls For security // $ numero_cedula = mysqli_real_escape_string ($ to, $ _POST [ 'numero_cedula']); $ codigo = mysqli_real_escape_string ($ con, $ _POST ['codigo']); $ sql1 = "select Numero Cedula Numero Sedula = $ numero_cedula"; mysqli_query ($ conn, $ sql1); $ Sql2 = "Select from Codigo where the tester is codego = $ codigo"; Micli_kweri ($ why, $ Modify your query to use and Make some small arguments In WHERE return line check count if (my...

symfony - Symfony2 count how many route we have -

Do we believe how many routes are there on Symphon 2? I can get a list of available paths in production environment with this console command: $ app / console router: debug -e prod But I want to count it as programmers. There will be a way to use the router service if you are using it inside a controller You can get a countdown with them: $ routes = $ this- & gt; Receive ('router') - & gt; GetRouteCollection () - & gt; Count () But if you want to count on a different location, you should use the service container (which is what the administrator does for you). If you are new to the Symphony Service container or would like more information about this feature, see the documentation.

c++ - How can I call a member function via a stream insertion operator? -

Using GCC 4.8 with C ++ 11 is enabled, I have a class like this: class outstream {public: outstream & amp; Operator & lt; & Lt; (Const char * s); Outstream & amp; Operator & lt; & Lt; (Int n); Outstream & amp; Operator & lt; & Lt; (Unsigned int n); // ... Outstream & amp; Vformat (const char * fmt, __VALIST args); Outstream & amp; Format (const char * fmt, ...); }; When I use this class by calling operators directly, then it works as I expected: Outstream Out; Out.operator & lt; & Amp; Lt; (1). Format ("Formatted% 4X", 2). Assistant. & Lt; & Lt; ("3 \ n"); Output: 1 formatted 0002 3 Now, I want to get the same output but & lt; & Lt; By using streaming notation, maybe this way: Outstream Out; Outside & lt; & Lt; 1 & lt; & Lt; Format ("Formatted% 04X", 2) & lt; & Lt; "3 \ n"; Of course, this will not compile, because there was n...

osx - How to implement x:y named delegate methods? -

For this article, I want to create a WebView WebFrameLoadDelegate method in Delphi: - (zero) webview: (webview *) sender didFinishLoadForFrame: (webfram *) frame How should this method be announced in Delphi? This don does not work: Public Functionality didFinishLoadForm (webView: WebView; sender: webframe); Cdecl; Process webViewdidFinishLoadForm (webview: webview; sender: webframe); Cdecl; Setting the delegate class looks okay using webview.setFrameLoadDelegate (d.GetObjectID); Where D is the TMyWebViewDelegate (TOCObject) class, with the GetObjectiveClass override, an interface (NSObject) is returning, such as a toolbar representative here but my method is not called What is the pattern to declare such obj-c methods? It is best to use the correct names generally the methods and parameters (as responded by Rudy ) But sometimes it is not possible. Two functions may require a single name, but there are similar parameter types so that overload can not be us...

java - Javadoc not working in eclipse -

Image
I use Eclipse Juno, Java 8 update 20. My eclipse is not showing Jawadox Ive incorporating it into the net Tried every method for But it was of no avail. Nothing helped but I see that there is an empty Java tab. So if anyone has to do this work please tell me or please provide me a new JDK, eclipse, Jawadox, which you think will definitely work. Thankyou Default jovad space: In the shown can check the default Java Doc locale in Excel eclips -> Go to Preferences - & gt; Install the JRE and follow the steps listed in the image below. Local javaadak space : You can add paths to Local Java Dock Locations in Eclipse. Download from Java Doc To add an offline java feed, follow the steps outlined in the image below: - Hope this helps you.

ruby on rails 4 - How to couple activeresource object with activerecord 'same' object? -

I am thinking that an active resource is an efficient and elegant way to link hardware objects with an activerecord object . I am setting up a payment system for my application, it works with an API in which the user tables, wallet tables, ... I want to store all this information in my application database . For example: - When I create a wallet_object_api_side, I want to store it in wallet_object_my_database - when I update wallet_object_api_side, I want to update wallet_object_my_database wallet_object_api_side always wallet_object_my_database Should there be an excellent way to create an API object and save it in your database in the same request? Thank you. You can do this with a Rail Callback. But the big question is why are you trying to do this? It is dangerous to rely on remote data replication locally and vice versa. If API is the definitive source of data, then you should go to the API when you need the data. What if some changes in the API database; How ...

javascript - css center middle element in div for multiple screen sizes -

& lt; div वर्ग = "add_nav_header" & gt; & Lt; div class = "centerButtons" & gt; & Lt; एक क्लास = "बीटीएन लॉगआउट स्मॉल बीटीएन" डेटा-रोल = "बटन" & gt; & lt; / a & gt; & Lt; एक वर्ग = "बीटीएन खोज छोटाबीटीएन" डेटा-रोल = "बटन" & gt; & lt; / a & gt; & Lt; एक क्लास = "बीटीएन विज़िलिस्ट छोटाबटन" डेटा-रोल = "बटन" & gt; & lt; / a & gt; & Lt; / div & gt; & Lt; / div & gt; .centerbuttons {चौड़ाई: 50%; मार्जिन: 0 ऑटो; } .add_nav_header {display: inline-block; चौड़ाई: 100%; सीमा नीचे: 1px ठोस # सीसीसी; पैडिंग-नीचे: .5 एएम; } .smallBtn {float: right; मार्जिन: .3 ईएम; पैडिंग: .6म; फ़ॉन्ट आकार: .9em; } .btnLogout {float: right; } .btnViewList {float: left; } .btn खोज {बाएं: -33%; } यह मेरी एचटीएमएल और सीएसएस है और मैं मध्य बीटीएन खोज बटन को केंद्र में रखना चाहता हूं लेकिन मुझे मीडिया प्रश्नों के साथ हर स्क्रीन आकार के बाएं प्रतिशत को सेट...

java - twitter4j - Count the number of tweets within 24 hours, return an integer -

I am trying to retrieve an integer of a certain keyword's tweet within 24 hours. So say that the keyword is "traffic", I want to count the number of tweets in the last 24 days with the word "traffic", and want to store it as the number used to generate other things. Right now, I can provide a specific number using query.setCount and I can get an arbitrary number (1024) tweets in the last 24 hours, but there is no way to tell me that It has all tweets within 24 hours, I really have a number, I do not need actual text or other information about tweets. Besides, as new tweets arrive, you can update that number. How can I go about doing this? Even my getNewTweets method is: zero getNewTweets () {simple data formatting SDF = new SimpleDefform ("YMD"); Calendar Calendar = Calendar.getInstance (); Calendar.ed (calendar.HOUR_OF_DAY, -24); String tomorrow = sdf.format (calendar.getTime ()); Query query = new query ("traffic"); Query.setSi...

In angular-google-maps, how to show infoWindow via a mouseover event on marker? -

I am working on a project with angular-Google maps. I wanted to add a mouseover event for markers, so I looked up the tutorial in angular-Google-Maps example folders. However, I can not work on it here is the plunker link $ scope.markersEvents = {mouseover: function (gMarker, eventName, model) { model.show = true; $ Scope $ apply () .; } } Use this show = "' "Show" instead of Show Show, worked for me

Header & Footer Flipping in Jquery Mobile -

क्या किसी ने jQuery मोबाइल में यह व्यवहार अनुभव किया है? & lt; div data-role = "पृष्ठ" डेटा-थीम = "ए" आईडी = "मुख्य" वर्ग = "यूआई-उत्तरदायी" & gt; & Lt; div डेटा-भूमिका = "हैडर" डेटा-स्थिति = "निश्चित" & gt; & Lt; div class = "ui-grid-a" & gt; & Lt; div वर्ग = "ui-block-a" शैली = "चौड़ाई: 30%" & gt; & Lt; div id = "searchdiv" & gt; & Lt; इनपुट प्रकार = "खोज" नाम = "खोज" आईडी = "खोज" प्लेसहोल्डर = "सुचे ..." डेटा-साफ़- btn = "true" / & gt; & Lt; span id = "matches" & gt; & lt; / span & gt; & Lt; / div & gt; & Lt; / div & gt; & Lt; / div & gt; & Lt; / div & gt; & Lt; div डेटा-भूमिका = "सामग्री" आईडी = "कंटेंटब्लॉक" & gt; & Lt; / div & gt; & Lt;! - पृष्ठ सामग्री - & gt; & Lt; div डेट...

json - Unable to retrieve data through ng-repeat -

मेरा html ऐसा दिखता है मेरे ग्रुपचैप्टर्स जेसन [{"groupId": "1325519", "समूहनाम": "भाग 1: कॉन्टेक्स्ट सेट करना प्रबंधन "," अध्याय ": [{" नाम ":" भाग 1: \ n परिचय \ n "," id ":" EKHXAZ666861716 "}, {" नाम ":" 1: प्रबंधन का परिचय "," आईडी ": "QGRNTJ390585712"}, { "नाम": "2: वैश्विक व्यापार पर्यावरण", "id": "ZUBPWG817393950"}, { "नाम": "3: नैतिकता और कॉर्पोरेट सामाजिक जिम्मेदारी" "id": "ASDMHY855087184" }}}, {"GroupId": "1325528", "समूहनाम": "भाग 2: सामरिक परिप्रेक्ष्य", "अध्याय": [{"नाम": "भाग 2: \ n परिचय \ n", "आईडी": "EUPFYT208991652"}, {"नाम": "4: रणनीति का परिचय", "आईडी ":" DAUCDE724464546 "}, {" नाम ":" 5: व्यापार-स्तरी...

vim - Why does my <leader> command not work? -

64-bit Win7 लैपटॉप पर 32-बिट संस्करण gvim 7.3.46 का उपयोग करना। _vimrc फ़ाइल में अंतिम पंक्ति पढ़ती है: nmap & lt; नेता & gt; l: सेट सूची! & Lt; CR & gt; इस फ़ाइल को सहेजने के बाद, मैंने इसे कई फाइलों पर और \ l टॉगल किया गया सेट की गई सूची के रूप में अपेक्षित था मैंने तब से मेरी मशीन रिबूट कर ली है और अब जब मैं पूरी तरह से खाली फ़ाइल को संपादित करता हूं और \ l मुझे मिलता है E486: पैटर्न नहीं मिला: का चयन करें ऐसा लगता है कि जब मैं \ n लिखता हूं, तो मैं इसके बजाय / select निष्पादित कर रहा हूं। : मैपलीडर दिखाता है E121: अपरिभाषित चर: मैपलेडर : गूंज मैपलेडर दिखाता है ई 15: अमान्य अभिव्यक्ति: मैपलेडर क्या हुआ? मैं मैपलेडर कैसे फिर से काम कर सकता हूं?

.net - Exchange Mailbox Delegate Access for a security group via EWS or PowerShell -

Currently, I delegate support group went on to delegate access section mailbox through Outlook,, and permission levels set Want to I want to automate it, but there is no way that works for the group. The following PowerShell will add a group, but only set folder permissions that are not included in the group as a representative Ed MailboxFolderPermission -Identity "Mailbox: \ Calendar ". -User "group" -AccessRights Editor The following NAT address EWS user will add accounts in the same way, like I want to add a group. If I add a group to the list, then it will fail, yield the following error: "The representative does not map to any user in Active Directory." public function Setaditr (string as mailbox, listDelegates System.Collections.Generic.List (= false dim listDelUser as as a string)) Boolean Dim setEditorResult Boolean The new list (DelegateUser's) listDelegates each strDelUser string as the DelegateUser = in the slow delUser for ...

Java Method Call Array -

How can I pass an array from my main method into another method? I am getting an error with the parameters. Do I use the return value from the main? And since the returns value from the main is an array, then the parameters of the main call should be placed in brackets? Should there be a price between those brackets? public squares arraysAndmethods {public zero printRere (double [] arr) {int x = arraysAndMethods.main (double [i] arr); // For error with the parametres (int i = 0; i & lt; studgrade lihat; i ++) system. Out.print (studreds [i] + ""); } // printArray method public static double [] main (string array []) {// double array java.util.Scanner input = new java.util.Scanner (System.in); // Input Scanner System.out.println ("What is the class size?"); Int n = input.nextInt (); Double [] arr = new double [n]; // (NI = 0; i & lt; arr.length; i ++) {// Input Grade for each student} System.out declare and start the array for many elements. Println (...

javascript - How would you cycle through each image and check it for an error in a casperjs script? -

How will you cycle through each image on a given page and check to see if it is full Has it been or is it gone out? P> and .error () If the above works, can anybody show proper usage which will work in the casper script? code I used looked like the following: var call_to_page = this.evaluate (function () {var fail_amount = 0; var pass_amount = 0; var pass_img_src = []; var fail_img_src = []; var img_src = []; $ ( "img") each (function () {$ (this) .load (function () {pass_amount ++ ;. pass_img_src.push ($ (this ) .attr ( "Src"));}). error (function () {fail_amount ++; fail_img_src.push ($ (this) .attr ( "src"));}); img_src.push ($ (this ) .attr ("src"));}); return [img_src, fail_amount, fail_img_src, pass_amount, pass_img_src];}); Why does not anyone help why the code above works for me, it would be great that the page is coming properly and I am able to mess with DOM, not just . Load or Terror is thinking of images be...

html - Javascript Modal for Web Infographic -

I used simple JavaScript practice to teach college-level students how to make things interactive on the web in graphic design I am preparing. / P> I am also new to javascript, and I have written a simple script that shows you a model box when clicking a button. The problem is, I have to create a new function for every single button on my page. Is there a way to have a function? Below I have a code of up to now. I have also made one but the model is not popping up. It works on my computer. I have also uploaded my code. & lt ;; Doctype & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Style & gt; Body {margin: 0; Padding: 0; Background color: RGBA (220, 220, 220, 1); } #mainContent {width: 960px; Height: 680 pixels; Margin: 80px auto 0 auto; Background-image: url (home.png); Border: 1 px solid gray; Range radius: 8px; Background color: white; } # Button 1 {status: relative; Top: 250px; Left: 500 pounds; Width: 40px; } #club button {status: compl...

sql - Why do I see a incorrect syntax error -

I have the following SQL query that takes several XML nodes and displays in a table: select doctor name = XC.value ('(name) [1]', 'varchar (50)', gender = XC.value ('(gender) [1]', 'varchar (50)' ), LangSpain = XLang.value ('.', 'Varchar (20)'), InsAccepted = XIns.value [mydb] ('.', 'Varchar (50)'). [Dbo]. [Content] Cross Implemented Cast (XML as [CONTENT_HTML]). Xodes ('/ root /' physicians) as XT CROSS XC.nodes apply ('langAccept') as XT2 (XLANG) CROSS XC.nodes applied ('InsAccept') XT3 (XIns) I want to CAST content_html as XML because it is the ntext format. I get the following error Getting: Message 156, Level 15, State 1, Line 9 Wrong Syntax with Keyword 'AS' How do I 1) On the short term, you p> (Cast selection Make (CONTENT_HTML as XML) as content_xml from [mydb] [Dbo]. [Content] c) X cross x.content_xml.nodes as applicable ('/ root / physician...

java - To process more than 65536 rows xslx using POI -

text after "itemprop =" text "> I upload more 65536 lines xslx than file with 25 columns in a single sheet and write to the DB table Need for I use the OPCpacakage classes for both the XSSF reader event handler API and the upload and read. When a file is 65536 rows or less it works fine, but when it exceeds 65536 lines, it is corrupted with no exceptions and many rows in the table are filled with missing Using:. Is there a limit? "itemprop =" text "> What kind of workbook are you using to parse your file? I see you using poi OOXML schema, which provides a stream-oriented version of Poi Since 3.8-beta 3, the top of the Poi XSSF Built on low memory footprint SXSSF API provides. Expansion of an API compatible streaming of SXSSF XSSF when submitting a large spreadsheet is to be used, and the heap space is limited. In that case I try to suggest SXSSFWorkbook and try to see that some lines are still missing

mysql - Changing usernames in asp.net Membership -

OK, so I want an administrator for the option that I want to change someone's username in Gridview such as I Change his email, comment, etc. My codes are: Protected Zero UserAccounts_RowEditing (Object Sender, GridViewEditEventArgs e) {UserAccounts.EditIndex = e.NewEditIndex; BindUserAccounts (); } Secure Zero UserAccounts_RowUpdating (Object Sender, GridViewUpdateEventArgs e) {int index = UserAccounts.EditIndex; GridViewRow line = UserAccounts.Rows [e.RowIndex]; Username = User Account Ro [e. Roidind] .cell [1]. Text; Email = ((Textbox) Line Seals [2]. Control [0]). Text; Approved = ((checkbox) row Seals [3]. Control [0]). Comment = ((text box) row. Seals [6]. Control [0]). Text; Membership User User = Membership User (username); If (user! = Null) {bool edited = false; ActionStatus.Text = string.Format ("font size = 4> gt; & lt; u & gt; Edit {0} & lt; / u & gt; & lt; / b & Gt; & lt; / font & gt; ", user name); If (! User.Email.E...

iOS: In-App-Purchase fails for some users in production -

I recently released an iPad app in which there is a non-consumable "pro upgrade" - in-app purchase The style of It works for most users, and it works while testing, however, I get daily reports of IAP waste for some AAP customers. This is the worst kind of bug: For most people, it seems to work properly For some people, It works after rebooting the device or logging in from the app store. For some others, nothing seems and they can not buy. And I do not have any remote logging applied ... This is for all people who can not make purchases, usually an error That comes, which says that their Apple ID password is incorrect, after confirming the purchase. The app purchasing button only appears when the IAP product was successfully received from the Apple server. I'm not sure how it's going on I was initially thinking that it is on the side of the apple, but it tells the number of people reporting it to be something with my app. How is this the bes...

javascript - nodejs creating wafeform from mp3 in svg -

I'm doing a research for getting an MP3 file rendered in the form of waves I already have Some php libraries have been found, now I am looking for a similar solution in nodej. My results are up to now: (Trying to try to load the wave file in svg-format perhaps it is loading in nodes ... sure is not silent) Do you feel with the NodesJS-libraries to create waves in the SDG format? Not a direct node-related solution We use a leaks commandline tool to remove the wave (peaks) and find the beat. In the audio files it is a host that can run which is quite good in these tasks. Peaks are drawn as equal sets at intervals of 0 to 1. I have not been used for nodes, but it says that it can run external commands.

git merge - git rebase master based on timestamp -

How can I rebuilt a repost with a duplicate commodity based on the timestamp? SOME BACKGROUND: Dangerous repos as we move from a GIT remote to another GIT remote and adjusting the user name on the new GIT Remote Endpoint. The result is double to the "second" user, which is actually the same single stability timestamp - is there a way to automatically remove duplicates? , and is mentioned in: before Was saved in the temporary area, they are re-applied once again, in the present branch. Note that any HEAD which is HEAD .. (i.e., a patch has already accepted upstream with a separate commit, the message or timestamp will be skipped). Then a ribbase-i master , as the list of commitments should be accepted, should get the result of only one set, without duplicates.

python - google.appengine.api.yaml_errors.EventListenerYAMLError: mapping values are not allowed here -

after "text" itemprop = "text"> When the ami gae application starts receiving i have this strange error that does not really give information about what is wrong Trying for yaml_errors.EventListenerYAMLError (e) google.appengine.api.yaml_errors.EventListenerYAMLError Increased: \ Program Files \ Google \ Cloud SDK \ HelloWorld \ Application: Mapping values ​​are not allowed here in 'C'. Anyone know what's wrong My app.yaml looks like this: Application: Breakthrough-Stacker-729 Version: 1 Order: Python api_version: 1 Operators: - URL: /data/.* script: data.py - url: /.cript script: asklogin.py You have too many spaces that are very attractive about Python spacing [Thousands of Directive] Need and updating dragon 27 Bellow should work: Application: Breakthrough-Stacker-729 Version: 1 Order: python27 api_version: 1 threadsafe: false operators: - url: /data/.* script: data. Py - url: /.* script: asklogin.py

wpf - how to replace the content of the parent control from child user control in code behind -

I am writing something in the code behind auditInventoryViews: Scheduler to change the content of the content content: User control "control" DSViewContentControl "I tried with" This.content ", but it only changes the contents of the current user control and the other content still remains in the usercontrol. So the thing is how do I Can change the contents of original control from behind code Sample code for example & lt; UserControl & gt; ContentControl x: name = "DSViewContentControl" & gt; & lt; grid & gt; & Lt; Grid.RowDefinitions & gt; RowDefinition /> & lt; RowDefinition / & gt; & lt; /Grid.RowDefinitions> & lt; Grid.ColumnDefinitions & gt; & lt; column Definition Width = " * "& Gt; & lt; / ColumnDefinition & gt; & lt; column deflection width =" * "& gt; & lt; / ColumnDefinition & gt; & lt; /Grid.ColumnDefinitions> & lt ;!...

python - Pandas: apply different functions to different columns -

df.mean () का उपयोग करते समय मुझे एक परिणाम मिलता है, जहां प्रत्येक कॉलम का मतलब दिया जाता है अब हम कहते हैं कि मैं पहले स्तंभ का मतलब चाहता हूं, और दूसरे का योग क्या इसे करने का कोई तरीका है? मुझे डेटाफ्रेम को अलग करना और पुन: इकट्ठा करना नहीं है। pandas.groupby.agg () की तर्ज पर मेरा प्रारंभिक विचार था: df = pd.DataFrame (np.random.random (10,2)), स्तंभ = ['ए', 'बी']) df.apply ({'A': np.mean, 'B': Np.sum}, अक्ष = 0) ट्रैसबैक (सबसे हाल ही में कॉल अंतिम): फ़ाइल "& lt; ipython-input-81-265d3e797682" gt; लाइन 1, & lt; मॉड्यूल & gt; Df.apply ({'A': np.mean, 'B': np.sum}, axis = 0) फ़ाइल "C: \ Users \ Patrick \ Anaconda \ lib \ site-packages \ pandas \ core \ frame.py ", रेखा 3471, रिटर्न स्व: _apply_standard लागू करें (एफ, अक्ष, कम करें = कम) फ़ाइल" सी: \ उपयोगकर्ता \ पैट्रिक \ एनाकोंडा \ lib \ site-packages \ pandas \ core \ frame.py ", पंक्ति 3560, में _apply_standard परिणाम [i] = func (v) ...

php - sql_srv query using in AngularJS -

तो, यहां मेरे डेटाबेस में एक नियमित php क्वेरी है: $ sql = " का चयन करें LastName, छात्रों से प्रथम नाम "; $ परिणाम = sqlsrv_query ($ conn, $ sql); अंगुलियोज़ में क्वेरी के परिणाम का उपयोग करने में सक्षम होने के लिए मुझे क्या करना है? & lt; tr डेटा-एनजी-दोहराने = "एक्स में & lt;! - निर्धारित ऑब्जेक्ट - & gt;" & gt; & Lt; td & gt; {{x.LastName}} & lt; / td & gt; & Lt; td & gt; {{x.FirstName}} & lt; / td & gt; & Lt; / टीआर & gt; मेरा एक मित्र से सलाह लेने के बाद उत्तर मिला: सबसे पहले, मुझे क्वेरी के परिणाम सरणी में संग्रहीत करना पड़ा, जैसे: $ json = array (); करें {जबकि ($ पंक्ति = sqlsrv_fetch_array ($ परिणाम, SQLSRV_FETCH_ASSOC)) {$ json [] = $ पंक्ति; }} जबकि (sqlsrv_next_result ($ परिणाम)); तब, मुझे एक JSON के रूप में सरणी को एन्कोड करना पड़ा (इस प्रकार ऐरे का नाम): $ एन्कोडेड = json_encode ($ json, true); उसके बाद, एक नियंत्रक स्क्रिप्ट की आवश्यकता थी: & lt; स्क्रिप्ट ...

debugging - Reversing a list error -

I'm learning the drackt, and I want to write a program that reverses a list, I have been given below, and It is trailing numbers, but in some way they are listed as nesting or in some things. Define (reverse-list loan) (if empty (empty) empty (opposition (reverse-list (list 1 2 3 4)): > (list (list (list (list list 4) 3) 2) / Code> No one knows why the output is not coming in the form of only one list? Thanks for the help! one opposition two cells car and cdr . A cell can be displayed as (ab) where a and b can be anything. Optional representation for a couple. If b is either another pair or empty list, then you can only change b) with b without initial ( Type: (a.)); ==> (a) (a (b) ) ==> (ABC) (A (b (c () ())); ==> (ABC) Now for your code, imagine that you (1 2 3 4) (or (1. (2. 3. (4. ()))))) to be exact). We calculate your process properly: (reverse-list '(1 (2 (3 (4. ())))) ); ==> (If (empty (? ((2. (3 (4....

locking - Why not using a try with lock in java? -

I've read, and about try with resources locks, heads. But in reality, what I would like to do, will be try with lock , I mean without logic. This will release us from Verbose lock.lock (); Try {// throwing some syncing operation exceptions} in the end {// unlock even if the exception lock is thrown. Unlock (); } Look like this: ? Applies unlock lock; ... try (lock) // Call Lock permanently. Lock () {// Some synchronized actions throwing exceptions} // will eventually {lock.unlock ();} then this will not be TWR , But just cleaning some boilerplate? Do you have any technical reasons why why will not be a fair idea? EDIT: To explain the difference between what I proposed and a simple synchronize (lock) {} block, check this snippet: will result in IllegalMonitorStateException as a result, therefore lock () and unlock () methods It is not called within the synchronized block. If you had to deal with a simple matter, then the pattern of locking / ...

apache - Php-script create file not from user www-data -

मेरा नाम lebnik, और मेरे बारे में जानकारी: # id lebnik uid = 1000 ( लेबनिक) ग्रैड = 1000 (लेबनिक) समूह = 1000 (लेबनिक), 24 (सीडीआरएम), 25 (फ्लॉपी), 29 (ऑडियो), 30 (डुबकी), 44 (वीडियो), 46 (प्लगइव) उपयोगकर्ता के www डेटा से मेरे अपाचे चलाने की php-scripts, यह जांचें: root @ debian / etc / apache2 # grep -R "APACHE_RUN_USER ="। ./envvars:export एपीएचE_RUN_USER = www-data उपयोगकर्ता www डेटा के बारे में जानकारी: # आईडी www-data uid = 33 (www-data ) Gid = 33 (www-data) समूहों = 33 (www-data) मैं php-script file.php बनाएँ: & lt;? Php error_reporting (E_ALL); ini_set ( 'display_errors', 1); इको 'हैमी'; $ File = __FILE __। '.tmp'; File_put_contents ($ फ़ाइल, 'हाय'); गूंज file_get_contents ($ फ़ाइल)। "\ N"; $ Dirname = dirname (__ फ़ाइल__); गूंज `ls -la $ dirname`; ? & Gt; अगला, मैं अपाचे के साथ अपनी स्क्रिप्ट पर कॉल करने का प्रयास करता हूं: # curl http: //starsite.l/test/file.php www-data हाय कुल 16 डीड...

assembly - How to execute the CMU binary bomb in Ubuntu Linux? -

I try to do some X86 assembly and reverse engineering as trying to do the binary bomb of CMU as an independent project I am here. (This is not an auto-grade version tied to a category.) I downloaded from a bomb. From the laboratory's details of CMU: A "Binary Bomb" is a program which is provided to students as an object code file. After running, it prompts the user to type in 6 different stars. If none of these is incorrect, then the bomb "bursts," an error message printing and event logging on a grading server, students should "dissatisfy" their own unique bombs so that it can be determined that the 6 stars What should be. The laboratory teaches the students to understand the assembly language, and compels them to know how to use the debugger. It is very fun, a great laboratory in CMU Underground. This is one that you can try for yourself. The feature informing the grading server has been disabled, so feel free to blast the bomb with libe...