Posts

Showing posts from June, 2012

calculus - How to input a polynomial in standard algebraic notation and get its derivative? (Python) -

I have no problem with derivative computing..It's just that I do not know how to handle a whole polynomial standard algebraic signaling : P In Python, for computer algebra, there is a way to go. The derivative of a polynomial in sympection is straightforward: & gt; & Gt; & Gt; Import Simpi as SP & gt; & Gt; & Gt; X = sp.symbols ('x')> and gt; & Gt; Sp.diff (3 * x ** 4 + 8 * x ** 2 - 3 * x + 1) 12 * x ** 3 + 16 * x - 3

javascript - Passing data between controllers using service and confusion with using [ '$scope' , 'service' , function($scope, service){}] -

I am stuck with this problem of passing data from second angle to this problem before my code: Whenever I click on the template controller's diwi, it will trigger the template with the help of ng-click ... Now my objective was to send the selected data of the responsible controller to send the template ... Forums After reading here, I have been called 'Sales Service' Decided to create, so that I can transmit data between 2 controllers ... // defined service proApp.service ('selectionService', function () {var selected_template; addTemplate = Function (newObj) {selected_template = newObj;}; getTemplate = function () {selected select_template;};}); // Controller 1 ... where the template is selected ProApp.controller ('TemplateController', function ($ radius, selection service) {$ scope.templates = [{template_name: "Template 1", template_text: "We interrupt Apologies for "}, {template_name:" Template 2 ", template_text:...

Detect if Chrome Frame BHO is enabled -

I have the following code to see if CF BHO is enabled, but unfortunately it is not working " Automation server fails to create obz " var activexGoogleFrameBho = new ActiveXObject ('ChromeFrame.Bho'); If (activexGoogleFrameBho) {...} My user agents and page headers are as follows: Mozilla / 4.0 (compatible; msie 8.0; windows Nt 6.1; wow64; trident / 4.0; chromeframe / 32.0.1700.107; slcc2; .net clr 2.0.50727; .net4.0c; .net4.0e) & lt; Meta http-equiv = 'X-UA-Compatible' content = 'IE = Edge, Chrome = IE8' / & gt; Any ideas? Thank you, I'm not sure if you find the helpful object However, to see if the current page is loaded in chrome-frame, you can see that window.externalHost is present.

node.js - get a response from cassandra binary protocol using node streams -

While trying to know more about the streams and the cassandra, I thought I would try the binary protocol. var net = need ('net'); Var util = require (); Var Stream = Required ('Stream'); Separate session; Var = new buffer (4); Var body = New buffer ("{'CQL_VERSION': '3.0.0'}", 'UTF8'); Length.Lyought UINT 32BE (body length, 0); Session.written (header); Session.written (length); Session.write (body); SetTimeout (function () {session.end ();}, 5000);}); Session.on ('error', function (error) {console.log (err);}); Var client = new (stream.); Client._write = function (slice, _, next) {console.log ('receive feedback'); the upcoming(); }; Session.pipe (customer); The program runs for 5 seconds, the printing "connect" occurs almost instantly, but the writeable stream never receives content from the database. Any help would be appreciated! I am working with this and Cassandra is running, version 2.0.5 . ...

ios - iOS7: UILabel Text in Custom Cell does not appear without GCD -

Appears with a text block in a custom cell label Is this a better way to accomplish this? Custom CL H @interface custom cell: UITTEWewsCell property (nonatomatic, strong) UILBL * label; @protecti (nanatomic, strong) UIView * circle; @end Custom CLM @implementation Custom CL - (zero) layout attributes {[Super layouts_viewings]; Self.circle = [[UIView alloc] initWithFrame: CGRectMake (10, 10, 40.0f, 40.0F)]; [Self.circle setBackgroundColor: [UIColor brownColor]; Self.label = [[UILabel alloc] initWithFrame: CGRectMake (15, 20, 200.0f, 50.0f)]; Self.label.textcolor = [UIColor blackcolor]; [Self.contentView addSubview: self.label]; [Self.contentView addSubview: self.circle]; // I also tried myself [self-viewview: self.label]; } TableView.m - (UITableViewCell *) TableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {static NSString * customCellIdentifier = @ "CustomCell"; Customcell * cell = (customsell *) [TablesviewUQUrubleWebIden...

Java method stuck in endless loop while validating input -

In some way I'm getting some fun games here and I can not see why now this method It is believed that the input is either y or n and is not empty, I should note that this is for school, and 2 separate error output is necessary. When I enter an empty row, I get a blank line on the console. After that point, or after a time where I intentionally enter the wrong data, like X, the next time I enter a valid data such as y or n, then I continue to get bad data in the endless loop . What have I done? Get the Public Stable Boolean Policy (Scanner Scan) {Boolean Decision = False; System.out.println ("continue? Y / n:"); Letter userChoice = sc.next (); Boolean isValid = false; While (isValid == is incorrect) {if (userChoice.equalsIgnoreCase ("y")) {decision = true; IsValid = true; } And if (userChoice.equalsIgnoreCase ("n")) {decision = false; IsValid = true; } And if (userChoice.equals ("")) {System.out.println ("error! This entry is...

ruby on rails - Transfer log files from root to ephemeral memory in Amazon EC2 -

I have put my Ruby on Amazon App 2M1 large (64 bit) example on Rail App / Website. I am using Nginx and Thin server because the application and webserver resp. Now the website has gone live and it is producing many requests and so log in. I have placed the application on the root directory and the problem I am facing is that it has 7.5 GB space and it can end in a few days. I really want to take the log file for short-term memory / mount from the application so that it does not give any memory issues. Although I do not want to take the whole application in temporary memory as it is unstable and it can result in data loss. Can anyone tell me whether it is possible to move the log file from the application only to the fleeting memory? Please help me. First of all, place where you / mnt drive sudo mkdir / mnt / logs sudo chown Ubuntu / mnt / log / Pre- Now, remove the local log folder from your app (When your app and ngnet are low, of course) rm -r / my / app / l...

iOS Facebook SDK - getting user location -

By using FBLoginView , I can log in users and use a FBGraphUser object that holds data in the following structure: FBGraphUser | --- Username | --- email | --- ID & LT; FBGraphPlace & gt; Location | --- place_name | --- ID & lt; FBGraphLocation & gt; Location | --- city | --- street | --- Latitude / Longitude View Facebook for a better picture :) I have the correct place_name with the user's FBGraphPlace location but the FBGraph location is empty. I need access to this data, and this is where I've been stumped. I have ensured that the information of the user's location is publicly visible, and I sent the readPermissions of FBLoginView to @ "user_location" Is set to include. Do anyone know where I can make my mistake? Thanks! Editing - Solution: My Facebook address field was empty I forgot for the 'current city' address. Try to do this: id & lt; FBGraphUser & gt; Fb...

if statement - First and Last in SAS and R -

I am working on converting a SAS code to R, but I have to do IF first to replicate Used to be. & Amp; Final In the command. SAS command is - Data A; Set B; From the comp ID, date; If first date; Run; My understanding is that only the first date for CompID, ID and date combination is selected and the data is output A. Am i right I know about the duplicate command in the RR, but if I use the following code - A & lt; - B [! Duplicated (B $ date),] I get less overview than my SAS output. Am I missing something here? Thank you in advance. R can also be created in a duplicated data frame function): a & lt; - B [! To duplicate (duplicate) (BC, 'compedit', 'id', 'date')]],] . For previous action, look for the help page for duplicates and see me Looks like you'll find a type of from , but I always need to check its spelling. Build: "I get fewer comments than this. .. "I feel wrong, but I do not travel in ...

How to exchange data in Multi user Profile Android 4.2? -

As we know Android 4.2 supports a lot of potential. I am creating an app where I have to broadcast the message to all other profile users, but still I did not get any intention that other profiles send messages to the user. Help me about this candy Hope this can help you solve your ...

c# - How to convert WorkItemCollection to a List -

मैं WorkItemCollection को एक सूची & lt; WorkItem & gt; ताकि मैं इसे एक शब्दकोष में परिवर्तित कर सकता हूं यहां तक ​​कि कोड है: var testItemCollectionList = नई सूची & lt; WorkItem & gt; (); वर्कइटम कलेक्शन टेस्ट इटैम कलेक्शन; क्वेरी क्वेरी = नया क्वेरी (प्रोजेक्ट। स्टोअर, "वर्क आईटम्स से [शीर्षक] चुनें", परीक्षा। रिज़ल्ट। चयन करें (आइटम = & gt; आइटम.TargetId) .ToArray ()); Var कार = query.BeginQuery (); TestItemCollection = query.EndQuery (कार); TestItemCollectionList = ???; Var testItemMapQuery = testItemCollectionList.ToDictionary (w = & gt; डब्ल्यू, createItemFromQuery); testItemCollectionList = (वर्कआइटम एमआईटीम से testItemCollection mItem चुनें) .सूचीसूची );

mysql - why Python doesn't convert \n to newline when queried from Sqlite? -

I want to query with SQLite \ nAnd I hope the dragon will convert it to a new line but is not. And I too have \ nchanged \ n in the database but still can not be converted. For the row in the cursor cursor.exequote (Select the table from 'Select Test' ''): self.ui.textEdit.append (line [0]) # or print line [0] I also tried to do Unicode (line [0]) and not working. I am surprised that there is no easy solution for this in the web is not. Neither convert SQLites nor characters in Python wires ( \ Except for a Python string is written in the source code). If you manage them correctly, then Newlines works properly: & gt; & Gt; & Gt; Import sqlite3 & gt; & Gt; & Gt; Db = sqlite3.connect (': memory:')> gt; & Gt; & Gt; C = db.cursor ()> gt; & Gt; & Gt; C.execute ('Create table T (X)')> gt; & Gt; & Gt; C.execute ("Insert T values ​​('x \ ny')") & gt; & Gt; ...

PayPal Gateway Integration in ASP.Net C# -

I want to integrate PayPal gateway in my website. I need a return URL with the required parameters like other payment gateways, which Returns some parameters in which payment is successful and transaction ID etc. in web.config & lt; App settings and gt; & Lt; Add Key = "Token" value = "PW1BDVNqVPVanwduF_Tb2Ey91aT1Uhx1kL7HPc-7e8S-6AnUwSSHyasolSe" /> & Lt; Add key = "paypalemail" value = "@ gmail.com" /> & Lt; Add key = "PayPalSubmitUrl" value = "https://www.paypal.com/cgi-bin/webscr" /> & Lt; Add key = "FailedURL" value = "http://www.mrsoft.co.in/ProceedToPayment.aspx" /> & Lt; Add Key = "SuccessURL" value = "http://www.mrsoft.co.in/ProceedToPayment.aspx" /> & Lt; / AppSettings & gt; (String item, string, string, string phone, string email, string currency) {string redirecturl = "" ; // Redireable at the Pipel site +...

Jquery ui Autocomplete Combobox - changed not firing -

मुझे JQuery UI स्वत: पूर्ण कॉम्बोबॉक्स के साथ सहायता चाहिए। मैं "फेरबदल" घटना को कोई फर्क नहीं पड़ता कि वह क्या नहीं कर सकता मैंने इस विजेट को विभिन्न उदाहरणों से एक साथ खींचा है। वर्तमान कार्यरत उदाहरण के लिए मैं इसे "ALERT" मुझे उस चुनिंदा आईडी से बदलना चाहता हूं जो कि बदल गया था (मेरे पास साइट के निर्माण पर एक पृष्ठ पर इनमें से 4 विजेट हैं)। मुझे उदाहरण से कोई जेएस त्रुटियां नहीं मिली हैं, इसलिए मैं क्या गलत कर रहा हूं? अग्रिम में धन्यवाद (फ़ंक्शन ($) {$ .widget ("custom.combobox", {_create: फ़ंक्शन () {this.wrapper = $ ("& lt; span & gt;") AddClass ("custom-combobox") .inertAfter (this.element); this.element.hide (); this._createAutocomplete (); this._createShowAllButton ();}, _createAutocomplete: function () {var चयनित = this.element (": चयनित"), मूल्य = selected.val ()? Selected.text (): ""; this.input = $ ("& lt; इनपुट & gt;") .appendTo (this.wrapper) .val (मूल्य ) .attr (...

unity3d - Can I verify that a user has a legitimate copy of an android app for online features? -

I'm looking at creating a game for Android devices that the player logs in to their host on a host I host You can. I would like to connect to update the player's account with information from app games, like if it is possible to verify that the game was purchased, and if it was not, then the app is in the user's account Stop signing in? I have no problem with the fact that people do pirate games and do not make it unrelated, but I just want account profits for legitimate purchases. This game will be made in Unity 3D, but I suspect that specially matters. If this is possible, some links in the right direction in search of information will also be appreciated. I'm assuming that by legitimate copy you mean that it was installed from the Play Store . If so, you can use it: PackageManager pm = getPackageManager (); String Establishment = pm.getInstallerPackageName (getPackageName ()); The name of the package in 'installSource' would be if it was inst...

windows 8 - How to import a prepopulated SQLite DB in Document Folder in WinRT Tablet -

Image
I have a pre-population SQite DB in the documents folder of the WinRT tablet. If I have this permission, then I can run it in App Localfolder How can i import it To access the document library, you must upload an app to the company account. The personal account does not provide document accessibility. Then open Package.appxmanifest . Go to the Capabilities tab and check the Document Library . Go to the Announcements tab and enter any name in the File Type Association announcement Name field Add and add database extensions to supported file types, in my case I was using .sqlite . See the given screenshot below to read the entire story: I will use the code given below. Private async Task MoveOrcapDatabaseSync () {var LocalFolder = ApplicationData.Current. local folder; Var DbInDocument = KnownFolders.DocumentsLibrary.GetFileAsync ("db.sqlite") wait; // Moves the current file into the specified folder You will get the overloaded method ...

Android design practice - switch view -

I'm new to Android Dev, in fact, I'm a web developer and the question is similar to html + css classes. In my application I have a simple list view, with custom line view. For the line of different states I need to change the many hair elements of the rows of color, background color, visibility of many elements. For the course, I can do this in my CustomArrayAdapter's code. But it looks like a dirty move. How can I do this "beautiful"? What is the Android API, similar to the classes in HTML? public view GetView (Int conditions, Kantiwuwuwu, View Group parent) {// ... int Aitms_kod = Marsi.atiaitmskount (); String item_count_label = ""; If (0 more lie; item_code) {item_count_label = String.valueOf (items_count); } And {item_count_label = ""; } CountTextView.setText (item_count_label); Return line view; } & lt; TextView android: id = "@ + id / label" android: Layout_width = "Wrap_content" Android: Layout_h...

javascript - Embedding Third Party Content in HTML Website -

इस सवाल का पहले से ही एक उत्तर है: 2 जवाब मैं कुछ तीसरे पार्टी सामग्री जो एक एचटीएमएल पृष्ठ होगी, मेरे एचटीएमएल वेबसाइट के अंदर। मैं iframe दृष्टिकोण का उपयोग करने के बारे में सोचा था जिसमें मैं एक वेबसाइट के भीतर तीसरे पक्ष के html पृष्ठ को एक आइफ्रेम के रूप में एम्बेड करेगा। iframes का उपयोग करने के पीछे प्रेरणा यह थी कि मैं नहीं जानता कि वे किस पुस्तकालयों का उपयोग कर सकते हैं, या वे क्या लिख ​​सकते हैं। मैं चाहता हूं कि मेरा तर्क अलग से अलग हो। आइफ्रेम मेरी इच्छा पूरी करता है। लेकिन अब मुझे एक समस्या है, अगर मैं आईआरएफ के भीतर किसी भी नेविगेशन के लिए ब्राउजर बैक / अगली कार्यक्षमता चाहता हूं, तो मार्ग की वजह से इसे बनाए रखना बहुत मुश्किल होगा। साथ ही, आईआरएएम स्थिति को बनाए रखने के दौरान जब माता-पिता पृष्ठ ताज़ा होता है तो बहुत मुश्किल होगा। तो, क्या सभी के पहले आईफ्रेम दृष्टिकोण ठीक है? यदि ऐसा है, तो मैं ब्राउज़र बैक / अगला कैसे पूरा करूं? अच्छा, आप प्रबंधित कर सकते हैं इस तरह जावास्क्रिप्ट के साथ वापस / आगे बटन: iframe.contentWindow.history.back (); if...

javascript - Anchor link isnt working inside nested ui-li -

मैंने निम्न लिंक पर बेला बनाया है मैंने नेस्टेड बनाया है उल-ली । कोई भी समाधान = "पोस्ट-पाठ" आइटमप्रॉप = "टेक्स्ट"> कोशिश करें फ़ंक्शन jsddm_open (ईवेंट) {jsddm_canceltimer (); jsddm_close (); Var उपमेन्यू = $ (यह) .फंड ('उल'); अगर (सबमेनू लम्बाई) {ddmenuitem = submenu.css ('दृश्यता', 'दृश्यमान'); } Event.stopPropagation (); } डेमो: मुख्य समस्या है अगर (सबमेनू) { क्योंकि । Find () रिटर्न एक jQuery ऑब्जेक्ट जो हमेशा सच्चा होगा ताकि आपके हैंडलर हर बार क्लिक की डिफ़ॉल्ट कार्रवाई को रोकने से हर बार झूठी वापसी करे

Aligning tabs upward in jQuery mobile 1.4 -

I'm new to jQuery's mobile stuff and I'm using jQuery Mobile 1.4 for my mobile web app project I am What do I want to do is to have tab material on top of the nabbar so that I can keep the contents between the nabar / tab and headers and footer in the footer. & lt; Div data-role = "page" id = "northet" & gt; & Lt; Div data-role = "header" data-theme = "a" & gt; & Lt; A href = "# homepage" data-roll = "button" data-icon = "home" & gt; Home & lt; / A & gt; & Lt; H1 & gt; Northern route & lt; / H1> & Lt; / Div & gt; & Lt; Div data-role = "tab" data-condition = "fixed" & gt; & Lt; Div data-role = "navbar" id = "navbar" data-icon = "top" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "# answer list" data-icon = "bullets" class = "ui-btn...

printing - Printer function in PHP cannot print Chinese character (UTF-8) -

I use the printer function to print some data in the text file (.txt), which includes Chinese and English words They can display correctly in both webpages, while printing, the English word looks good but the Chinese word does not show the correct output. Any tips to overcome this? Please help me out my coding below. & lt ;? Php $ print = file_get_contents ("print.txt"); $ Printer = "XP-80"; // Printer name resonance print $; If ($ ph = printer_open ($ printer)) {printer_set_option ($ ph, PRINTER_MODE, "RAW"); Printer_write ($ pH, $ print); Print_close ($ pH); }? & Gt; There are some things that I can think of as a cause of problem: / P> The font you select is not compatible with UTF-8. There is also a note about printer_set_option () . Since 2009, it is not certain that it is still valid. After you comment, edit: with this example $ font = printer_create_font ("Aerial", 148, 76, PRINTER_FW_MEDIUM, wrong, fal...

html5 - CSS Responsive table not working -

Image
I am working on a responsive CSS for tables. I read a tutorial from this link (How to create a responsive table on CSS) It has worked on some sample page but in my HTML page I have some problems in the resize window and the table responds properly Here's my HTML code: & lt; Style & gt; / * Generic Styling, * / Table for Desktops / Laptops {Width: 100%; Degradation: collapse; } / * Zebra striping * / tr: nth-of-type (weird) {background: #eee; } Th {background: # 333; White color; font-weight: bold; } TD, th (padding: 6px; border: 1px solid # ccc; align text: left;} / * The maximum width is spoiled before this particular table. This query is smaller than 760px and specifically for any iPad Will also be effective on screen * / @ Media only screen and (max-width: 760 px), (min-device-width: 768px) and (max-device-width: 1024px) {/ * Force table to table like Not created * / table,, t, th, td, t R {display: block;} / * hide table headers (but not displayed: none;; for a...

javascript - html table cell match tr width (non static rows count) -

मेरे पास ऐसी html संरचना है: & lt; तालिका सीमा = 1 & gt; & LT; टीआर & gt; & LT; टीडी & gt; & Lt; / टीडी & gt; & Lt; / टीआर & gt; & LT; टीआर & gt; & LT; टीडी & gt; & Lt; / टीडी & gt; & LT; टीडी & gt; & Lt; / टीडी & gt; & Lt; / टीआर & gt; & LT; टीआर & gt; & LT; टीडी & gt; & Lt; / टीडी & gt; & LT; टीडी & gt; & Lt; / टीडी & gt; & LT; टीडी & gt; & Lt; / टीडी & gt; & Lt; / टीआर & gt; & LT; टीआर & gt; & LT; टीडी & gt; & Lt; / टीडी & gt; & Lt; / टीआर & gt; & Lt; / तालिका & gt; मैं कैसे कर सकता हूं, उदाहरण के तौर पर पहले टीआर टीडी 100% के लिए है, दूसरे ट्र दो टीडी के दोनों 50% हैं, लेकिन सभी 100% और इतने पर, मुझे इसे भरना होगा। टीडी चौड़ाई के लिए, और यदि एक से अधिक टीडी, यह करने के लिए कि वे इस चौड़ाई को बांटते हैं ... संभवत: जेएस के बिना ... अपडेट: नहीं! Colspan HTML का उपयोग बस क...

javascript - Filter results of dropdownlist per prior dropdownlist selection using jquery -

मैंने सफलतापूर्वक jquery स्क्रिप्ट TheSuperTramp यहां पोस्ट किया है: निकालने के लिए चुने गए किसी एक से कम मूल्य वाले किसी भी सूची आइटम हालांकि, मुझे पहले पुल डाउन मेनू में केवल वही मूल्य को निकालना होगा जो मैंने चुना था। मुझे विश्वास है कि निम्नलिखित jquery स्क्रिप्ट इसे पूरा करना चाहिए हालांकि यह नहीं है। धन्यवाद, केएस var drop2 = $ ("[id = ड्रॉपडाउन विकल्प चुनें]"); // प्रारंभिक विकल्पों का संग्रह $ ("[id = test] चुनें")। परिवर्तन (फ़ंक्शन () {var drop1selected = parseInt (this.value); // ड्रॉप 1 का चयनित मान $ ("चुनें [आईडी = ड्रॉपडाउन) ")। Html (drop2) // रीसेट ड्रॉपडाउन सूची .फंड ('विकल्प')। फ़िल्टर (फ़ंक्शन () {यदि (पार्सआईंट (this.value) == drop1 चयनित) {$ (this) .remove (); };});}); आप की वास्तव में यहाँ क्या आवश्यकता है, इसके बजाय: var drop2 = $ ("चुनें [आईडी = ड्रॉपडाउन] विकल्प"); // प्रारंभिक विकल्पों का संग्रह $ ("[id = test] चुनें")। परिवर्तन (फ़ंक्शन () {var drop1selected = parseInt (this.valu...

android - WebView - load links in external browser -

itemprop = "text"> I am loading content of a locally stored html file in a WebView This file also contains a link in my app, when clicking, load url in the same WebView . I want to load these links instead of in an external browser. I have taken a look at onPageStarted and shouldOverrideUrl loading , but they do not work I have tried the following: webAbout = ( WebView) findViewById (R.id.wvAbout); WebAbout.loadUrl (Const.defURL); WebAbout.setWebViewClient (New WebViewClient) {@Override Public Zero onPageStarted (for viewing WebView, string URL, bitmap favicon) {if (url.startsWith (Const.defURL)) {view.stopLoading (); // go Cheese} else {View.loadUrl (Const.defURL);}}}); I have also tried: webAbout = (WebView) findViewById (R.id.wvAbout); WebAbout.loadUrl (Const.defURL); WebAbout.setWebViewClient (New WebViewClient () {Public Boolean shouldOverrideUrlLoading (WebView to see, string URL) {if (url = Null & amp;! (Url.startsWith (Const.defURL)) {...

jquery - How to get button value by ajax -

I'm getting button values ​​by Ajax. I have 4 buttons with other values ​​ & lt; Button Type = "Button" value = "Today" onclick = postdata class = "btn BTN-Primary BTN-LG" & gt; Today & lt; / Button & gt; & Lt; Button type = "button" onclick = postdata value = "week" class = "btn btn-primary btn-lg" & gt; Week and lieutenant; / Button & gt; & Lt; Button Type = "Button" value = "month" onclick = postdata class = "btn BTN-Primary BTN-LG" & gt; Today & lt; / Button & gt; & Lt; Button Type = "Button" onclick = postdata value = "year" class = "BTN BTN-Primary BTN-LG" & gt; Week and lieutenant; / Button & gt; Function PostData (link) {$. Ajax ({url: link, type: "POST", data: {date: $ ('button'). Val ()}}}} onclick me always the value of the first button Can anyone tell me how to get the ...

Thread safety - reading mutable objects (java) -

I have a shared resource - a simple POJO that wraps a hashmap - which will start once on startup and then Only ever read, maybe together, by many threads (context is a web application) Do I need to synchronize access to the object (or alternatively using a concurrent hashp) or is it safe to read many simultaneous? Will synchronizing add important overhead? If you are certain that you can skip synchronization for access to that map read that all Writes yes-before everyone reads what it means. In practice, you have to make sure that hashmap pops up before any other threads that access it and its contents are not modified after it. The reason this solution will work is that threads. Start () calls apply a synchronization and therefore guarantees that all changes made before that call will appear After both old and new threads you should modify the object after that call, this guarantee will be lost and a synchronized access will be required.

java - FreeMarker: Expected a boolean, but this evaluated to a number -

मेरे पास एक ऐसा टेम्पलेट है जिसमें मैं करता हूं: & lt; #if result.numFound & gt; 10 & gt; (कुछ डेटा) & lt; / # if & gt; यह मुझे पार्स त्रुटि देता है: "#if" शर्त के लिए: एक बूलीयन की अपेक्षा की गई, लेकिन यह एक संख्या के लिए मूल्यांकन किया गया परिणाम। Numfound है पूर्णांक । मैंने पढ़ा है, शायद मुझे कुछ याद आ रहा है ... आपने पिछले कुछ याद किया दस्तावेजों में पंक्तियां:)। कैसे परीक्षण करें अगर x 1 से अधिक है? & Lt; #if x & gt; 1 & gt; गलत होगा, क्योंकि फ्रीमार्कर पहले & gt; टैग के अंत के रूप में इस प्रकार, या तो लिखें & lt; #if (x & gt; 1) & gt; या & lt; #if x & gt; 1 & gt ;.

Google plus SSO sign out functionality in android app -

I know how to work for SSO while using Google Plus in Android I have successfully used the same app I'm logging into the app. Now I need to log out the user so that he can re-enter with a new account with Google Plus. I need to do this in another activity. I tried to use the disconnect () method but did not get any success. Any help is appreciated on this. The related part is how you can sign out the user: if (mGoogleApiClient.isConnected ()) {Plus.AccountApi.clearDefaultAccount (mGoogleApiClient); MGoogleApiClient.disconnect (); MGoogleApiClient.connect (); }

excel - How to copy and move data in Spreadsheet using a Formula/Script -

I used this code in Excel when this data came EG If the word "greg" appears in cell A1, then data from B1 will go to F1 I need to know how to do this in the spreadsheet Appreciate the aid Cheers VBA version below private sub worksheet tag (target by way of range) 'to see Check whether any price is being changed in your predetermined range, do not know (target, range ("A1: A5000")) 'nothing' A check whether "Greg" is one of the words entered in a cell if InStr (goal, "Greg") & gt; If so, then enter that call from column B to the column F cells (target row, "F") = cell (target row, "b") cell (target row, "b"). If the clear contents end, then the end of the A1 has the text GREG , you FIND function: = FIND ("GREG", A 1). This will return the status of A1 within GREG . However, if the text was not found, it returns an error, so when the text is not found, y...

Django and Windows Server -

I have developed a diego app that I now need to deploy on a Windows server (which is hosted by various other web applications I can not even know about I) The application I have developed will only be used internally Please excuse a simple question - I'm totally new to Windows Server, but ... There are several articles about running Django under IIS, and for example reference FastCGI Do I really need to do this? On my personalized Windows machine I used to install Django only and my app uses it properly via port 8000. Do I just stop in a single production environment on a Windows server? What is actually achieved under IIS? Thank you! You should read the text on that archrix: Do not use this server in a production setting. It has not run through security audits or performance tests. (And this is how it is supposed to be. In the business of creating web frameworks, we are not web servers, so to improve this environment, Django's scope is capable of handling a p...

javascript - $(document).ready() & $(function(){} -

मेरे दो कार्य हैं: function func1 () {} और फ़ंक्शन func2 () {} इन दोनों कार्यों के लिए काम करने के लिए निम्नलिखित की आवश्यकता है $ (document) .ready (); $ (विंडो) .resize (); इसलिए मैंने इसे दोनों कार्यों के रूप में निम्नानुसार कार्यान्वित किया है: $ (दस्तावेज़) .ready (func1); $ (विंडो) .resize (func1); और $ (दस्तावेज़) .ready (func2); $ (विंडो) .resize (func2); समस्या? वहाँ दो है; 1) मेरे पास पहले से ही $ (फ़ंक्शन () { ऊपर दिए गए दो कार्यों को लपेटन है, लेकिन मुझे अभी भी ज़रूरत है $ (दस्तावेज़) .ready (); क्यों? दोनों एक ही बात नहीं है! 2) मैं शॉर्ट- कोड कट और केवल $ (दस्तावेज़) .ready (); "यदि आवश्यक हो" और $ (window)। Resize (); एक बार प्रकट करने के लिए और फिर फ़ंक्शन जोड़ें इसे करने के लिए, और कार्यों में इसे जोड़ने नहीं उलझन में? ठीक है ... इसलिए मैं मूल रूप से यह करना चाहता हूं: $ (दस्तावेज़) .ready (func1, func2); $ (विंडो) .resize (func1, func2); लेकिन यह काम नहीं किया, कोई विचार? मेरी स्क्रिप्ट: $ (फ़ं...

c - Converting characters to hexadecimal -

I'm trying to change a cipher (AES encryption) in hexadecimal values. I am using the following code (state Sifrtekst) for conversion: foreach (char * V, state) {printf ( "% 02X", * V); } For this cipher: '4 ayen w [â ?? ¢ úà ?? J $ one ?? ¶U6 I get this output: 2734FFFFFFA5575BFFFFFF99FFFFFFFAFFFFFFCB6A240BFFFFFFD318FFFFFFB65536 Who correct hex for this cipher is not. I tried other conversion methods, which all took for the same result. In Edit: foreach code: # foreach (item Put array) to \ (int = 1, \ count = 0, \ size = sizeof (array ) / Sizeof * (array); \ keep & count! = Size; \ keep =! Keep, Calculate ++) \ for (item = (array) + count; keep; keep =! Keep) It is not C, there is no foreach in C. It may be C ++, in that case the problem is that the printf () of the % x conversion specification is being reason-being expanded. There is a signed char type on the probability of your platform. Cast the value to Unsigned ...

java - Approach to JDBC connections in a Servlet/JSP application -

I have some existing Java code like many variations of DAO classes, for example Class Employee Dao {Public Employee Dow (connection connection)} // Prepare statements used for the methods given below. Public employee will get employee employment (long ID) {} public collection & lt; Employee & gt; GetEmployeesByDepartment (long department ID) {} ...} All DAO classes have been created with a JDBC connection. Prepare any statement needed by the organizer methods. It works fine in a threaded environment (eg batch processing) where the collar can make a connection and instantaneous doo objects with that connection can instantiate. I want to be able to use it in Java web application, but I'm not sure how to manage JDBC connections. Here are some suggestions: Each request creates a new JDBC connection and instantiates the necessary DAO objects. Both creation and Dao are clearly expensive from urgency Each request receives a connection from a JNDI datasource and...

html - Javascript: Clicking Link to Download pdf -

I am working on a JS program for which web pages should open www.mysite.com & amp; To download a PDF click on a link within that webpage to click, the link looks like this: & lt; One onclick = "download (); return back;" Href = "# number" "gt; click to download & lt; / a & gt; Generally, by clicking on the link manually, download PDFs The following function calls: function download () {document.forms [0] .action = path + "/xxW04_sv_0140Action.do"; Document.forms [0]. Target = "_self" "; Document.forms [0] .submit ();} The JavaScript code is simplified to open my code page and click on the" Click to Download "button Do this: & lt ; Script & gt; Var link name = "http://www.mysite.com"; Var windowname = "window_1" // opens a new window myWindow = window.open (Lincoln, WindowMenu, "width = 400, height = 600 "); // should download a link to download PDF myWind...

javascript - AngularJS - a way to timeout html input for a second and then call $watch -

For example: I am typing in the input text, which has a NG-model, and $ Watch is called instantaneously. Is there any way to call $ later, suppose that 2 seconds has passed with the last key pressed on input control? I wrote a simple instruction for such works: consider this code: .directive ('delayedModel', function () {return {scope: {model: '= delayedModel'}, link: function (scope, element, attrs) {element .val (scope.model) ; Scope $ watch ('model', function (newVal, oldVal) {if (newVal == oldVal) {element.val (scope.model);;}}) timeout; element .on ('KeyUp Paste Search ', Function () {clearTimeout}; timeout = setTimeout (function () {scope.model = element [0] .value; element.val (scope.model); scope $ apply ();}, attrs Delay || 500);});}};}); Usage: & lt; Input type = "text" delay-model = "search text" data-delay = "500" /> So the only thing that you need to change, you use the delay-model inst...

Find a pattern in given string of URLs in Lua -

In my Lea code, I get the URL as several strings. Example: ['http://www.abc.com/home/', 'http://www.abc.com/', https: //www.xyz.com/v/123443/css/ ', http://www.xyz.com/css/'] I want to receive URLs that Are the same: https: //Www.xyz.com/v/123443/css/ where v is the pre-defined string pattern and 123443 is a random version generated in the URL. Please help bring all the URLs that are liked in that pattern: "/ v / 12332323 /" str = "https://www.xyz.com/v/123443/css/" print (str: match ("Https?: // www%. [^ /] + (/ V /% d + /)% w +")) Output: / v / 123443 / This pattern matches the strings starting with http or https , and then : // , the website name starts with www , a / , pre-defined string v and "random" number followed by / and other stuff.

java - How to re-initialize beans in spring without application server restart -

I am programming service to get data from the database and provide them through the REST service. It uses Spring MVC. My database connection frame is in the property file from which data source is loaded as a bean during the reference in the spring. Now my problem is - I want to change the configuration files in properties (for example change database information), but I can not risk the restart of the application server that does not load very new configuration I again Can start spring reference or some special bean so newly defined properties are used? Text after "div class =" itemprop = "text"> If you want multiple data sources in spring and in order to dynamically determine the appropriate data source You need to be provided with this spring. You must implement your lookup key logic to define the data source in the source-source defined CurrentLookupKey () with it you run on the runtime Can map different beans for different data sources Are ther...

Agent Coloring With NetLogo -

I am trying to model bulletin colors on mobile bulletin boards with NetLogo. I am able to change my color while changing my colors but the color change is random and sometimes the bulletin colors are the same, touching my circle or close together, I want to have the bulletin near The given color has a unique color. Raduis.Here is a fraction of my code. Can anyone help me? Ask the bulletin for color-bulletin [Ask another bulletin -Radiose2 [Ask a bulletin [Set color color] One bulletin [Set color white] Ask a bulletin [color Yellow color] Set a bulletin [color blue] One way to do this : breed [bulletin bulletin] CA-Bulletin 1000 [saxsi random -xcor random-ycor] color-bulletins to create setup The bulletin asks [let's use-color [color] provide the available three-dimensional bulletin-available color filter [no member? ? [Color of a color]] [color of a color]] end assumes that you only want to use it and they can be used already, this situation You still get a ...

maven - Using a Windows mapped drive as an artifact/component repository -

I would not use a full component repository, such as the remote repository as Nexus / Kristifactori and Use in a \\ drive \ path \ to \ repository \ I'm not sure how to proceed I do I wagon plugin for it is required? Ideally, I have to leave the pom alone and only need to modify settings.xml . Is this possible? Just add the path to your settings. Xml to access a remote file system for your .m2 directory Instead of local repositories: & lt; Local Repository & gt; \\ drive \ path \ to \ repository \ & lt; / LocalRepository & gt; Of course, it will significantly slow down your build, and that others are sharing it, you are failing to conflicts during access construction works closely with many users Will know. Are you sure it will be appropriate when it takes less than an hour to set up the appropriate proxy / repository?

python - how we can use ajax() in views.py in django? -

I have a little code here. Could you please tell me what this code really does? please. Here in the AJAX call: $ .ajax ({url: "{% url} upload_document '%}", type: "POST", data : {Csrfmiddletoken: document.getElementsByName ('csrfmiddletoken') [0] Price, Title: document.getElementById ('title'). Value, // document: document: document.getElementById ('document'),}, datatype: "Jason", success: function (feedback) {if (feedback == "true") {// success} other {// attachment errors}}}); How AJAX works in the Django and how we can see the AJAX request. Here is the idea of ​​my thoughts def upload_document (requested): Print request. POTT print request FILES if request.is_ajax (): If request.method == 'POST': form = UploadForm (request.POST, request.FILES, user = request.user) if form.is_valid (): Form.save () return HTTPPCS (SimpleJason Dumps ('True'), Mime Type = 'App / Jason') Other:...

cakephp - Show Category Listing in Home Page via PagesController in Cake PHP -

पेजसींट्रोलर.php $ this-> loadModel ('श्रेणी'); $ श्रेणियां = $ इस- & gt; श्रेणी- & gt; खोजें ('सभी', सरणी ('सीमा' = & gt; 5, 'आदेश' = & gt; 'श्रेणी.id एएससी', 'फ़ील्ड' = & gt; सरणी (' ('श्रेणी.id') = ' // जनसंपर्क ($ श्रेणियों); यहां सभी श्रेणियों की लिस्टिंग $- इस- & gt; सेट (कॉम्पैक्ट ('श्रेणियां') दिखाती है); // $ इस- & gt; सेट ( 'श्रेणियों', $ श्रेणियों); केक PHP में PagesController के माध्यम से होम पेज में श्रेणी प्रविष्टि दिखाएँ लेकिन देखें फ़ाइल में त्रुटि के नीचे हो रही है (में देखें / पृष्ठ / home.ctp) & lt;? Php pr ($ श्रेणियां); ? & Gt; नोटिस (8): अपरिभाषित चर: श्रेणियां [एपीपी / देखें / पृष्ठ / होम.कंप्ट, रेखा 142] pagesController.php सार्वजनिक फ़ंक्शन डिस्प्ले () {$ Path = func_get_args (); $ Count = count ($ पथ); यदि (! $ Count) {वापसी $ इस- & gt; रीडायरेक्ट ('/'); } $ Page = $ subpage = $ title_for_layout = null; यदि (...

c# - Why must write O AS INT and can't write (INT)O -

I like to use the as operator in John Skeet's book with such a type Example found, which allows the zero value. using the system; Class A {static white printAUscient 32 (object o) {int? O; as nullable = int ;; Can not write // int? Nullable = (int?) O console Wrightite (nullable.HasValue? Nullable.Value.ToString (): "Zero"); } Fixed zero main () {PrintValueAsInt32 (5); PrintValueAsInt32 ("some string"); }} I can not understand why I can not write int? Nullable = (int?) O ? When I try to do this, I'm getting an exception. Because checking first cast Types are not variable for each other, then it only gives zero and avoids invalid cut exception . When you are passing a string in the second call in the second call, which is not variable for int, then try to use the clear artist Time Receiving an Exception

ruby on rails - Model with unknown number of an attribute -

Ruby on Rail 4 I want to make a model "test" which is anywhere from 2 There will be several tests for 200 questions each test questions will have different forms. I was thinking of making an attribute called "Question_s". I have to do a string which is a delimited question_a Or I can make the model with 200 question_ID properties. This will simplify and fasten the question_id (s). Is there any other way? Who likes? What if I have 1,000 questions? model / test_question.rb class test question & lt; ActiveRecord :: Base is_to: question is_to: test end model / question.rb class question & lt; ActiveRecord :: Base has_many: test termination db / migrate / initial_migration.rb class initial migration & lt; ActiveRecord :: Migration DF self.up create_table: test do | T | T.string: name end create_table: test_questions do | T | T.references: Table t.references: question end create_table: questions do | T | T.string: name end end ...

windows 7 - WinSCP script does not work when run from Task scheduler -

I am setting up a task scheduler to run a script that pulls another program from WinSCP, then the data Transmits the use of a report I script takes those CDR files which are required for the current day, pull them into the RMT program and creates a temporary file to keep that data until the old data gets transmitted When I run the script manually, .vbs , it's running fine. The problem occurs when I set the task scheduler to run the script, it indicates that this operation is being run but the files have not been transferred. The user account used has full administrator rights and settings > Ensure that you enable session logging using the / log command line parameter. And to inspect the log, to see what is wrong For details, see.

php - last class to every third widget -

I'm trying to add the last category to every third widget. But with this function, I can just add the "last" category to the previous widget. function widget_ last_classes ($ params) {global $ widget_num; $ This_id = $ params [0] ['id']; $ Arr_registered_widgets = wp_get_sidebars_widgets (); If (! $ Widget_num) {$ widget_num = array (); } If (! Isset ($ arr_registered_widgets [$ this_id]) || is_array ($ arr_registered_widgets [$ this_id])) Return $ $ params; } If (isset ($ widget_num [$ this_id])) {$ widget_num [$ this_id] ++; } And {$ widget_num [$ this_id] = 1; } $ Class = 'class =' ​​'; If $ $ _ ($ arr_registered_widgets [$ this_id])) $ {$ class = 'last' / ',' $ Square ', $ params [0] [' before_widget '], 1); return $ params;} Add_filter (' dynamic_sidebar_params', 'widget_last_classes'); change = if ($ widget_num [$ this_id] == count ($ arr_registered_widgets [$ this_id])) { With if (($ wi...

angularjs - Why do my angular behave different depending on the browser? -

My angle page which I have reduced for one, I show the same IMG (only one red rectangle) -To have tried different methods in the "IMG" page: The first image to specify the file location uses the XML-style parameter "ng: src". Uses another image "Ng -" - Prefix style The third image uses only the src attribute (which I thought might probably not work well Firefox is displayed in all three images. In Opera The page only shows two images. Chromium refuses to load the page too (it says, "Error: an invalid or invalid String was specified. "(This works if I remove XML-style img). Why is this happening? Because I believe that in XML My priority XML-style parameter will be to work in all browsers. Note that I do not care about Internet Explorer. Reset with my (broken) project: XHTML Speak reported that Chrome When you do not prepare XML properly, you return the error, which is correct when the following steps are not foll...

java - Set size/dimensions of ArrayList<ArrayList> -

समस्या मेरे पास ArrayList का ArrayList रों। मेरे पास यह सामान्य कोड है: ArrayList & LT; ArrayList & LT; स्ट्रिंग & gt; & gt; सूची = नए अर्रेलिस्ट & lt; ArrayList & lt; स्ट्रिंग & gt; & gt; (); (For int c = 0; r & lt; 4; r ++) {for (int c = 0; c & lt; 5; c ++) {list.get (r) .set (c, "अन्य सूची से एक तत्व") ; }} मैं पंक्तियों की संख्या के लिए आकार और कॉलम की संख्या के लिए 5 आकारों में मनमाने ढंग से आकार का 4 का उपयोग कर रहा हूं। हालांकि, यह सीधा त्रुटि के एक सूचक को फेंकता है, जाहिर है क्योंकि मुझे ArrayList & lt; ArrayList & lt; स्ट्रिंग & gt; & gt; के लिए कोई आयाम नहीं है I एक अर्रेइलिस्ट बना रहा है हालांकि, मुझे नहीं पता कि यह कैसे लागू करें: ArrayList & lt; ArrayList & lt; स्ट्रिंग & gt; & gt; सूची = नए अर्रेलिस्ट & lt; ArrayList & lt; स्ट्रिंग & gt; & gt; (); यह संकलन नहीं करेगा, लेकिन यह अनिवार्य रूप से मुझे क्या चाहिए: ArrayList & lt; Arra...

javascript - Windows store js app navigation control cause data binding problems -

// file.html & lt; div id = "RankingTemplate" डेटा जीत -control = "WinJS.Binding.Template" & gt; & LT; h2 & gt; & Lt; span class = "संख्या" डेटा-जीत- bind = "innerText: place" & gt; & lt; / span & gt; & LT; span id = "ratingControlDiv" डेटा-जीत-नियंत्रण = "WinJS.UI.Rating" डेटा-जीत-बाँध = "winControl.averageRating: रेटिंग" डेटा-जीत विकल्पों = "{maxRating: 5, विकलांग: सच} "& gt; & lt; / span & gt; & Lt; लेबल = "रेटिंग नियंत्रण डीवाईवी" डेटा-जीत-बाइंड = "इनर टेक्स्ट: वोट" & gt; & lt; / label & gt; & Lt; span class = "नाम" डेटा-जीत-बाइंड = "इनर टेक्स्ट: शीर्षक" & gt; & lt; / span & gt; & Lt; / h2 & gt; & Lt; / div & gt; & Lt; div id = "RankingList" डेटा-जीत-नियंत्रण = "WinJS.UI.ListView" डेटा-जीत विकल्पों = "{itemDataSource: sourceData.itemR...

database - Log plugin installs and delete plugins completely in Wordpress -

Simply put, a plug-in (or a way to install plug-ins with incoming database table entries )? I am currently trying to clean up my installation and plugins which are no longer required. I have to uninstall the plugin, but when viewing the database, many of these plugins still leave table entries in an event So that the user will re-install the plug-in at a later date. I tried tracing all of these table entries to your plug-in developer, or is there a better way? Going forward, is there a plugin that I can use to keep an eye on it so that I can prevent the database from being dirty? It is a good idea to have a way of dumping a plugin into all the options in wp_options. I use the WordPress Options table to be able to clean older plugin crept. The plugin has not been updated in a while, but it still works at 3.9. For standalone tables, any table, which is not the default WP, has been added by the plugin. In my experience, some plugins add large numbers of tables that can be ...

canvas - buggy iterative cropping function in javascript code -

I wanted to break a user loaded image into rectangular pieces and to show everyone on user input This snippet is written piece with a piece of distance between yourself and neighboring pieces. I think that every element is said to break and display that the function is the cause of the problem, but what part can not be understood. Function breaks () {// to add more, incomplete first = 0; Var piece _ x = (ell.width% mouse_xt); Var piece_y = (ell.height% mouse_yt); Var old_values ​​= New Array; Var counter_i = 0; Var counter_j = 0; (For _y = 0; _y & lt; = old_height; _y = _y + mouse_yt) for {old_values ​​[counter_i, for example, _x = 0; _x & lt; = old_width; _x = _x + mouse_xt} Counter_j] = {x: _x, Y y}; Counter_j + = 1; } Counter_j = 0; Counter_i + = 1} console.log (old_value); Var start_x = 0; Var start_y = 0; (For __x = 0; __x is left. Is there some light on this? Bug Everything works fine until the user press brakes, then the image disappears and whichever...

javascript - Google Chrome Extension Opening Url -

So I'm new to making extensions, so I want to start at a normal one. Well I thought it was not very difficult Was, but I can not open my extensions secretly and open new tab pages in general. POPUP page: & lt;! DOCTYPE HTML Public "- // W3C // DTD XHTML 1.0 Transcription // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; Link href = 'style.css' rel = 'stylesheet' type = 'text / css' & gt; & Lt; Script type = "text / javascript" src = "https://www.google.com/jsapi" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Function tab () {chrome.browserAction.onClicked.addListener (function () {chrome.tabs.create ({'url': "http://www.google.com"})}); } & Lt; / Script & gt; & Lt; Base target = "_ bl...