Posts

Showing posts from July, 2010

python - Scrapy - Load a yaml file with a relative path inside the spider -

I am trying to implement my scrapy crawlers , but the problem is that my Pass yaml file is that I am trying to load from inside the , it works when the spider is loaded from the shell: scrapy crawl & lt; spider-name & gt; . But when the spider is deployed under scrapyd , the path of the yaml file should be complete . The relative path for code> has been posted on on scrapyd : scrapyd-deploy default -p & Lt; project-name & gt; Curl http://127.0.0.1:6800/schedule.json -d project = & lt; Project-name & gt; -D spider = & lt; Spider-name & gt; and the yaml file is loaded as: open ('../categories.yaml', 'r') F: Pass The relative path is relative to the current working directory (the directory that started with your script). If you want to load a file from a path relative to the current script location, then you can try the following: root_dir = os.path.abspath (os.path.dirname (__ file__) ) y

mysql - repeat result multipple times in my sql -

I have no id and no fields, what exactly do I want, the result will not be filed any time , If there is no field 2, then raw should be repeated twice as a result. This is my sample table structure id no 1 3 2 2 3 1 Now I need to get results like I 1 3 1 3 1 3 2 2 2 2 3 1 I tried to write mysql query to get the above results, but any help in failing You need a table of numbers to accomplish this. For just three values, it's easy: choose t.id, choose t.no to t join (t 1no n select as union and select all union all 3) n ; = N.no;

c# - Query Related to Sql -

This query gives me an error "string" myCOnnection "how to solve it" after unclosed quatation marks. Company_Master (C_Name, M_Name, L_No, Tax_No, PO_No, location, state, country, telephone, fax_home, email_id, website, currency_name, company_logo, apt, apf) values ​​('+ text box 1 in the text '),' "+ text box 2. text +" ',' '+ text box 3. Text + "',' '+ text box 4. text +"', "" + text box 5. text + "','" + text box 6. text + "','" + text box 7. text + "',' '+ Text box 8 Text + "',' '+ text box 9. text +"', '"+ text box 10. text +"', '"+ text box 11 text" + ",'" + text box 12. text + "',' + 'Text box 13. Text + "','" + picture box 1. Picture + "','" + DateTime Picture 1 Price + "','" + DateTime Pict

c# - input numbers, first one deciding how many there will be -

I have to insert some numbers from the console input into an array, where the first number decides how many (the number is * 2). The number has a maximum of 2 digits. My code is still not working anyway till now. int volume = Convert.ToInt32 (console. Read ()); int [] arr = new int [100]; Int count = 0; While (counting> lie; volume * 2) {string line = Console.ReadLine (); Line = row + ''; For (int i = 0; i = '0') & amp; amp; (c & lt; = '9')) {char d = row [i + 1]; If ((D> = '0') & amp; amp; (D & lt; = '9')) {arr [count] = c * 10 + d; I ++; } And {arr [count] = c; } Calculate ++; }} There are some errors that allow your program to work correctly Can not give. Do not use // console. Read, but wait to see the end of input from your user string user input console. Readline (); // Convert any number by using Int32.TryParse to actually write a number / / nothing to your user / and there will be no such exception t

java - How to equally split a JSplitPane? -

Image
Then I am using Java and swing and a JSplitPane equally divided on each side . I found JSplitPane , although the window is full size and the other is smaller package com. Horizoner Backup; Import javax.swing. *; Import java.awt. *; Import java.awt.event. *; Import java.io * *; Public Class Men {Private JMUR Menu Menu; Private JMMenu File menu, Edit menu, Help menu; Private Zeppel left the panel, right panel; Private pocket open button; Public main () {Jpinal main card = new zpinal (new border layout (8, 8)); Menubar = new jmur (); FileMenu = new jmnu ("file"); Editmenu = new jmnu ("edit"); helpMenu = new JMU ("help"); menuBar.add (FileMenu); menuBar.add (editMenu); MenuBar.add (helpMenu); MainCard.add (menubar); leftPanel = new zpn (); rightPanel = new zpn (); JSplitPane splitPane = New JSplitPane (JSplitPane.HORIZONTAL_SPLIT, leftPanel, rightPanel); GeFrame window = new Jeffram ("pseudo-code text editor"); window.setJMenuBar (Menubar);

javascript - How to generate 4 digits alphanumeric code in meteor? -

How to specify Generate alphanumeric code with 4 digits with recurrence? You ask 4 points, but also say 'alphanumeric'. Either way: generated function 4DigitNonRepeatingNumericCode () {ret = ""; While (ret.length & lt; 4) {var pickanumberBetween0 and 9 = ("+++ Math.random ()). CharAt (2); if (ret.indexOf (" + + pickanumberBetween0 and 9) == -1) Rate + = Picanambar Between 0 and 9;} Return Return;} This is not a meteorite-specific, it can be used in any JavaScript app. For Alphanumeric we have a Will take the shortcut and Meteor.Collection.ObjectID : generated function of the meteor 4CharacterNonRepeatingAlphanumericCode () {ret = ""; while (ret.length> 4) { var pickACharacter = ("new meteorite" compilation. objectIDID () .hexString ()). (0); if (ret.indexOf ("+ pickacharacter) == -1) Rate + = Pakacrocessor; } Return return; }

excel vba - How can I paste the value from one sheet to another using macro/vba? -

In sheet 1, I have various items that I need to populate with the given ID in the sheet. Example below: Sheet1: column1 column2 -------------- - No data bag for boots data jacket no data sheet 2: column 1 ---- --- I want to search for advice from a specialist if possible, or if I call "Sheet1 Column 2" - KL-123 BC-223 AK-477 AB-987 In "Sheet 2 column 1", I can get a macro to fill below the values. Sheet 1 multiplies on the basis of number of items in "Sheet 2". Sheet 1 Column 1 Column 2 ---------- -------- Shoe KL -123 KL-123 jacket KL-123 Shoe BC-223 bag BC 223 jacket BC-223 Shoe AK-477 bag AK-477 jacket AK 477 Shoe AB-987 bag AB-987 jacket AB-987 Try it out: option clear 'option base 1 is not really necessary My assumptions are correct sub-testing () dim sh1 worksheet, dim myIDs dim as sh2 worksheet ItmRng as range Dim I as Long Set sh1 = Thisworkbook.Sheets ("Sheet1") set sh2 = Thisworkbook.Sheets (&

google app engine - upload image to folder using python -

I want to browse the image; Upload it to folder using python I have tried various solutions posted on the forum, but none of them works in my case. Please guide me to who needs to be corrected. Thanks for your quick help. I'm getting the error Attribute Enter attribute: is_key #! / Usr / bin / nv python import CGI, OS import CGITB; cgitb.enable () import cgi import datetime import webapp2 import cgi, os import cgitb; google.appengine.ext Import NDB to google.appengine.api import user guestbook_key = ndb.Key ('Guestbook', 'default_guestbook') class greeting (ndb.model): author = ndb.UserProperty () content = ndb.TextProperty ( ) Date = ndb.DateTimeProperty (auto_now_add = true) class home page (webapp2.RequestHandler): def find (auto): self.response.out.write ('& lt; html & gt; & lt; body & gt;' Congratulations = ndb.gql ('Select "from' Greeting '' Where is the Asselar: 1 '' According to the DESC limit o

java - What does validate do in eclipse? -

If you click on the correct project, and click Validate, it will pop up something and then several errors Show due to the reason What does it accept and how to get rid of these errors? Excerpt from Docs: workspace contains validators for errors Check your fixed files in your Enterprise Application Module projects. By default, TaskBank automatically verifies your files automatically after any build you create. You can also start a manual verification process without building On the Workspace Preferences window, you can enable or disable the validator to use on your projects. In addition, you can enable or disable the Vititrate for each enterprise application module project individually on the properties page of that project. Each verifier can apply some types of files, some project nature, and some project aspects. When a verifier applies to a project aspect or nature, the workspace uses only that project on that project, which is of that aspect or nature. Similarly, most leg

php - sending a file to slimframework from nodejs server -

I want to send a file to my other API on another server from my server but for some reason it can not be found The data I have sent .. Using the rest of the API php slim framework: $ app-> Use the post ('/ api / upload', function () ($ app)) {$ logs = '/ home / logs'; // error_log (print_r ($ _ files, 1), 3, $ log. '/export16.log') {$ data = file_get_contents ('php: // input'); // EMPTY !!!! Error_log (print_r (calculate ($ data), 1), 3, $ log. '/export16.log')}} hold (exception $ e) {error_log (print_r ($ data, 1), 3, $ log. ' /export16err.log ');}}); Nodes using the request module: fs.createReadStream ('myfile.zip') .pipe (request.post (UPLOAD_URL, function (error , Reaction, body) {//console.log(response); if (! Error and response.statusCode == 200) {//console.log(repons);}})); Also attempted with this code: Use the form-data module explained in documents var r = request.post (UPLOAD_URL, function Altern

version control - Restore deleted workspace in TFS to retrieve pending edits -

I edited on my local machine, which had its own workspace, I was given a new machine and I got my new machine Has set up a new workspace. By mistake I had removed my old workstation, while pending edits associated with it were still present. Has lost all my pending edits now, is there any way to recover all my lost pending edits? Please note that I still have access to my old machine. If I am able to retrieve all my lost pending edits then I can bring those files to my new machine and check-in those changes. You should be able to do the following: The same source To achieve the changes, use "Get Specific Version" on your new machine (set the last change you received) to set it as a local workspace, in this way Visual Studio will automatically get the form of "check out" Will locate files transferred in Zip all files from your old machine Remove all files Wait to consolidate the local workspace (Visual Studio to detect it Give some time to see whic

starling framework - Actionscript 3 Injecting string to an existing variable/constant -

Very simple question is that I can not find the answer: private call LEFT_HOUSE_2_X : Number = 445; Private Connection LEFT_HOUSE_2_Y: Number = 145; Private connection LEFT_HOUSE_2_WIDTH: number = 45; Private Connection LEFT_HOUSE_2_HEIGHT: Number = 35; If I am using an Iterator, then how can I use the above continuously: eg. var i: uint = 2; LEFT_HOUSE_ {i} _X? It has to be done with a variable too. Using the square bracket You can read a const or variable with the variable name this ["LEFT_HOUSE_" + I + "_X"]

java - Read text file line by line in jsp -

I have a text file and I would like to read it line by line and display them separately, for example, text The first line of the file is 'Andy' and the second line is 'male', I want to show it in html: Name: andy Gender: Male So far I can only get all the information, but I was unable to divide them. Can anyone help me solve it? & lt;% string path = "few text / hotel 1.txt"; File file object = new file (path); Four data [] = new four [(int) fileObject.length ()]; FileReader filereader = new FileReader (path); Int charsread = filereader.read (data); Out.println (new string (data, 0, charset)); Filereader.close (); & Gt%; You can use BufferedReader and read line per line BufferedReader br = new BufferedReader (new FileReader (path)); String Line 1 = Faucet, Line 2 = Faucet; Line1 = br.readLine (); If (line1! = Zero) {line2 = br.readLine (); }

ios - Table View Cell Text Color with Multicolored Background -

Image
I want to use a certain image as the background view of my table view. The problem is that the image has many colors, so I should be able to change the text color because the table view is scrolled, but I'm not sure how to know about this problem with this option I have the problem Looking at the table view, the text will be several different colors and it is not very attractive. What other options do I have? Here is the image that I want to use as a background scene. < Div class = "post-text" itemprop = "text"> I think you can use the image filter to make it gray scale image, saffia or monochrome image. This is for reference

angularjs - loading array values in custom order using ng-repeat -

Loading the array initial value / first value at the end of the array; Using the Ng-repeat and orderby filters; In your script.js file, create a sort function. $ scope.sort = function (value) {var index = $ scope.myvar.indexOf (value); If (index === 0) {return $ scope.myvar.length; } Return Index; } In your index.html file, change your NG-double attribute to look like this: & lt; li ng-repeat = "v in myVar | orderBy: type: false" & gt; {{V}} & lt; / li & gt; Some things to note, it assumes that you want the natural order of the array, except that you want the first element to go to the end. If you want a different order, then you have to change the sorting function. See for more details. In addition, in an index of the organs, the indexOf function is not supported in all browsers (IE if I am not mistaken. If it does not already exist, you will need to create it yourself See for help. Click to see a working leaking version.

rvm - I need to start over with a fresh, ground zero, install of Rails. How do I do that? -

Run Mac OS X Mavericks, I have raised my rail installation completely, on the point that I am doing all this I'm wrong, it's wrong. I am working on the book and am trying to establish a testing environment so that I can start learning really ... nevertheless, I am still messing up that I really want to flush it completely and start should do. I've re-established the railroad, and now the default hackt free is empty I am unable to figure out how to restore it with default gems (uninstall and restoring railways did not do this for me) Done At this point I am far away from a rabbit hole, I am unable to orient myself, so I think that I just need to get up and start with zero refresh. How would I go about resetting my environment that I can do this? I think I need to uninstall Rail, RVM, etc.? First, make sure you are running Mac OS X Mavericks (10.9). Start by uninstalling Ruby, for example: Delete $ rvm ruby-2.1.1 More info RVM is on the page on the site. Caref

ios - NSPredicate crash when I use a NSArray -

+ ----------- + + --------- - + | -परदा- | | -ऊटोबस- | + ----------- + + ----------- + | नंबरे | | सर्किओ | + ------------- + + ------------- + | रिश्ते | | रिश्ते | + ------------- + + ------------- + | द्वारा पारादा | & lt; -------- & gt; | परदा | + ----------- + + ----------- + मैं कुछ डेटा को कोर डेटा का उपयोग करके setupFetchedResultsController , समस्या यह है कि अंदर, NSPredicate में, जब मैं NSArray का उपयोग कर फ़िल्टर करना चाहता हूं, तो यह क्रैश हो जाता है। यह कोड है: NSArray * myArray2 = [NSArray arrayWithObjects: @ "1", @ "2", @ "3", शून्य]; NSString * predstring = [NSString stringWithFormat: @ "द्वारा पाराडैकाइटो IN% @", myArray2]; request.predicate = [NSPredicate predicateWithFormat: predstring]; ... और परिणाम ये हैं: *** बिना अपवाद अपवाद के कारण एप्लिकेशन को समाप्त करना 'NSInvalidArgumentException', कारण: 'पार्स करने में असमर्थ वास्तव में, अगर मैं सभी कोडों को मिटा देता हूं तो myArray2 को छो

Jquery Droppable -

निम्नलिखित मेरा jquery कोड है मैं gallery-folder jquery ऑब्जेक्ट द्वारा गुणों को निकाल सकते हैं लेकिन droppable isn पर काम नहीं कर रहा है $ (फ़ंक्शन () {jQuery (दस्तावेज़) .फंड ('# am- कंटेनर')। ('आईएमजी') ढूंढें। खींचें ({revert: true} ;) (गैलरी-फोल्डर)। ("ड्रॉप: फ़ंक्शन" (घटना, यूआई) {var draggableSrc = ui.draggable.attr ("src"); var gallery_id = $ (यह) .फंड ('ली')। एट्रि ("आईडी");}}};}); निम्नलिखित मेरा HTML है & lt; div id = "gallery-folder" class = "gallery-folder ui-droppable" & gt; & lt; div वर्ग = "गैलरी-फ़ोल्डर-आंतरिक" & gt; & lt; a href = "gallery_view.php? id = 22 और गैलरी_नाव = कपड़े 123" & gt; & lt; img width = "68" height = "48" src = "चित्र / आइकन-2. png" & gt; & Lt; / a & gt; & Lt; / div & gt; & Lt; / div & gt; यह बेला है मैंने अपना बेला देखा यह ठीक काम कर रहा है आप संभव

regex - Select all spaces except those in a group -

अगर मेरे पास निम्न पाठ है: यह एक नमूना वाक्य है जिसमें Regex texting के लिए "उन में रिक्त स्थान के साथ उद्धरण" यहां "एक अन्य" बोली दी गई है। मैं पाठ में हर जगह का चयन करना चाहूंगा उन उद्धरणों में से। मेरे पास एक रेगेक्स समूह है ( ("[\ w ^ \ s] *") ) उद्धरणों से मिलान करते हुए, लेकिन मैं यह नहीं समझ सकता कि रीजेक्स को सब कुछ कबूल करने के लिए IGNORE। पाठ कहते हैं कि ^ ("[\ w ^ \ s] *") अमान्य है, और मैं नहीं जानता कि मैं क्या कर सकता हूं। मैंने भी कोशिश की है (?: "[\ w ^ \ s] *") लेकिन वह भी काम नहीं करता है। आप इस regex का उपयोग कर सकते हैं: (? = (?: (?: [^ "] *") {2}) * [^ "] * $) + मान लें कि कोई बचने अपवाद नहीं है।

SQL Server : Trace Database activity or logins on fully qualified table query -

I am trying to audit our security for our SQL server. I am trying to run a trace on a database to logon users and access the database. However, if the query is run from a different database then no logon event is generated. Example: I am trying to trace logon for [Database2] I used [Database1]; but Database2 . Our environment is SQL Server 2008 R2 Standard Edition Any suggestions would be appreciated. That's because database users do not enter SQL Server security called "Login" in SQL Server There are organizations that are used to enter the instance of SQL Server. These logins are either Windows login from Active Directory or SQL Server login, which you can define and specify username and password. Databases are defined at the "user" database level, users do not enter anywhere, they do not even have the password. The idea is that the SQL Server "login" is mapped to the specific database "user", when a specific Connects

android - String content from dialog popup feeding into EditText field -

I'm trying to make a feature that lets the user enters a name in a popup dialog box, enter The name given is automatically fed through an edit text field on the next page, such as requesting a title name, followed by the title of the next page. The dialog popup part is working, but I want to get the value stored in the 'm_Text' string variable which is in the edit text field. Someone please help me !!! Here is the code for the page on which the dialog box is called .... package com.evicapture.loadsave; // import com.example.camerademo.R; Import android App Import android.app.AlertDialog; Import android.content.DialogInterface; Import android.content.Intent; Importroid.os.Bundle; Import android.text.InputType; Import android.view.View; Import android.widget.Button; Import android.widget.EditText; Public class introMenu activity {public static string m_Text = "" extends; Override public null at @reate (bundle saved instenestate) {// TODO auto generated meth

Custom search in Quick2Cart Joomla -

I need a custom search filter for Quick2Cart Joomla, nothing could be found online about this If you can not find any, you probably have to write your own search plugin for it if you have a programming experience It should not be particularly difficult. You can get started here:

splitting an RGB image to R,G,B channels - python -

I am working on image processing, I want to know whether this code splits colorful image into different channels Will not or I do not mean because when I tried to give me an image which is reading me, then give me blue, green, red values, and mean value too. When I try to add it to the list, and try to print it, then the list only contains zero. This is my code: b, g, r = cv2.split (re_img1) ttl = re_img1.size b = sum (b) / ttl g = sum (G) / ttl r = yoga (r) / ttl b_man 1.append (b) g_map 1.apend (g) r_man1 .append (r) re_img1 < / code> is a resized image (i.e. 256x256). The image can be anything and I am using the same code in 2 different functions, and I am facing a single problem. Any suggestions are welcome! thank you in advanced! If I understand you well then you try to calculate the mean of each RGB channel Are there. There are 2 problems with your code: ttl should be split down from 3 because otherwise it is the number of pixels X channels (ex: 25

css - Label autowidth makes the td wider -

I have a label inside the table TD, the problem is that when the label width is greater than the TD width then the label increases In only one line, TD is not allowed to make as much as possible and to view all the text. What I want is that when the label width is greater than its container, the labels make the second line. css .pdata {font-size: 10px; } And lieutenant; Table valis = "top" cellspacing = "0" cellpadding = "0" range = "0" height = "150" & gt; & Lt; Tbody & gt; & Lt; Tr valign = "top" & gt; & Lt; td class = "profile-company-text" & gt; & Lt; Label class = "pdata" & gt; Label class = "bold" style = "width: 140px; display: inline-block" & gt; Email: & lt; / Labels & gt; & Lt; Label data-bind = "text: email" & gt; & Lt; / Labels & gt; & Lt; Br> & Lt; / Labels & gt; & Lt; / Span

java - Using setMaxLines on a TextView shows lines but not text in lines -

Image
I have an app that takes menus from the server and parses it on textuals and buttons; Names are available for some time, so I want to present 3 first lines of name (if it's many), then the problem is that when I set the maximum of 3, I see 3 lines but only the first line The text is the same, the odd thing is that when I set the Settlements to 3 To goods, I can see three lines and text, but there are 3 lines in my name only one line long. Code: Private Zero createItemView (item items) {/ * Create a layout panel for all views / View / Relative LayoutPanel = New Relative Layout (this); / * Create visual for item name * / text view item name = new text view (this); itemName.setTextColor (.getResources () getColor (android.R.color.white)); itemName.setTextSize (itemToAdd.getNameSize ()); itemName.setSingleLine (wrong); itemName.setWidth (300); itemName.setMaxLines (3); itemName.setText (itemToAdd.getName ()); / * Add button view / TextView addButton = new text view (this); add

Drag n Drop: How to detect element which into dropped - jquery, threedupmedia -

I'm using the jquery Drag'n'Drop plugin from threedupmedia, I already drag-n-drop in a drop zone I've managed now I now have a lot of drop zones and I have to find out how the element was removed in the drop zone. But I do not know anything about how to do it. You can see the usage case and simplified mark-up jQuery (function ($) $ $ ('.dnd-btn') .drag ("Start Drag ("end", function (ev, dd) {if (! $ (This) .hasClass ('dropped')) {$ (this). CSS ({top : Dd.originalY, left: dd.originalX}; else {$ (this) .removeClass ('dropped');}}) .drag (function (ev, dd) {$ (this) .css ({top: dd.offsetY, left: dd.offsetX}}}, {relative: true, drop: '.dnd-drop'}) $ ('.dnd-drop (function (avi, dd) {console.log (ev) ); // Show it again on the faded element and the original position: $ (dd.drag) .addClass ('dropped'). FadeOut ('slow', function () {$ (dd.drag). CSS ({ top: dd .originalY, left: dd.originalX}). $ ('.

c# - Error: Not all code paths return a value -

इस सवाल का पहले से ही एक उत्तर है: < / p> 7 जवाब ऐसा क्यों होता है? यहां बिन फाइल से शब्दकोश पढ़ने के लिए मेरा कोड है सार्वजनिक स्थिर ऑब्जेक्ट LoadObject () {try (if file.Exists ("D: //my.bin")) {FileStream stream = File.OpenRead ( "डी: //my.bin"); BinaryFormatter formatter = नया BinaryFormatter (); शब्दकोश & lt; int, प्रश्न & gt; deserializedObject = (शब्दकोश & lt; int, प्रश्न & gt;) formatter.Deserialize (स्ट्रीम); stream.Close (); deserializedObject वापसी; }} पकड़ {}} आपकी विधि किसी वस्तु प्रकार को वापस करने के लिए मान ली जाती है < कोड> ऑब्जेक्ट , लेकिन आप केवल try ब्लॉक में लौट रहे हैं और वह भी if स्टेटमेंट के अंदर से है इसलिए यदि आपकी स्थिति विफल हो जाती है, तो आपका तरीका कुछ भी वापस नहीं करेगा। इसके अलावा अगर कोशिश ब्लॉक में एक अपवाद है, तो वस्तु वापस करने से पहले, आपकी विधि कुछ भी वापस करने में विफल हो जाएगी। यही कारण है कि आपको त्रुटि मिल रही है आप यह तय कर सकते हैं कि null से बाहर try / catch ब्लॉक।

ember.js - Ember, the right way of creating interface for saving records with hasmany relationships -

मेरे पास ये मॉडल हैं: Gmcontrolpanel.Offer = DS.Model.extend ({ नाम: DS.attr ('string'), दिनांक: DS.attr ('string'), अवधि: DS.attr ('संख्या'), उत्पाद: DS.hasMany ('उत्पाद', {async: true}), }); Gmcontrolpanel.Product = DS.Model.extend ({name: DS.attr ('string'), विवरण: DS.attr ('string'), ऑफ़र: DS.belongsTo ('प्रस्ताव'), विविधताएं: DS.hasMany ( 'विविधता', {async: true})}); Gmcontrolpanel.Variation = DS.Model.extend ({विवरण: DS.attr ('string'), मात्रा: DS.attr ('number'), मूल्य: DS.attr ('string'), उत्पाद: DS.belongsTo ( 'उत्पाद')}); मैं एक ऑफ़र बनाने / संपादित करने के लिए पुन: उपयोग करने योग्य इंटरफ़ेस बनाने की कोशिश कर रहा हूं; मैंने एक उत्पाद डालने और एक भिन्नता डालने के लिए दो अलग-अलग दृश्य बना लिए हैं; उत्पाद दृश्य में उत्पादों को जोड़ने या निकालने के लिए + और एक-बटन है, और भिन्नता दृश्य के लिए समान है; मार्ग के लिए मॉडल है: मॉडल: फ़ंक्शन () {return.get ('store')।

html - Javascript: Toggle visibilty of a div -

I am trying to make a div visible / invisible using javascript. I have a function that should change the visibility to 'None', if it appears in the div and the 'view' if the div is none though it does not seem to work, please help is the code. & lt; Script & gt; Function toggleTools () {var element = document.getElementById ('divTools'); If (element.style.visibility == 'visible') {element.style.visibility = 'hidden'; } And {element.style.visibility = 'visible'; }} & lt; / Script & gt; I tried your code and worked for it please find the code below Set the visibility for the element otherwise it is not working in the beginning. & lt; Script & gt; Function toggleTools () {var element = document.getElementById ('divTools'); If (element.style.visibility == 'visible') {element.style.visibility = 'hidden'; } And {element.style.visibility = 'visible'; }} & lt; / Script &a

how to maintain android package name for same code deployed on two different app engine instances -

There are two app engine examples that run the same code for our testing and production server. We are using the Endpoint API. The Android app that connects to both servers uses the same client code generated by the Google app engine tool. Based on our need, we will be able to use builder.setRootUrl (someUrl) on our test project; We have set the package name and sha 1 key to generate an Android client, but we have to do this on the production server due to the same package name. Are unable to. The error by saying that the package name should be unique. The problem now is how we maintain the code to connect to the app engine. In the worst case, there will be two separate projects with different package names. Any other solution? is the plugin for the Android client id (package_name, sha1_key_hash), whether you have the same key 1 key Use? If you can try using a different keystore? (You can generate one from Android Studio-> Build-> Signed APK-> New). Or can yo

ios - Rank different countries in Game Center Leaderboard? -

I was thinking that it would be possible to rank things other than a different player in the sports center, like a country Will be installed so that a player gets the score, it adds the player's country score and if the game center is sent to it, will it be possible? Game Center views do not offer filtering beyond what you see Standard interfaces ( Time scope and all friends versus all players). Therefore, to get this behavior, you can build your custom Game Center Leaderboard interface, manually download scores from GKLeaderboard , and hide the country's information in the hidden context Will need to be archived and retrieved. Score parameter. However ... this would be extremely impractical, because you have to download a lot of scores to ensure that you also capture most of the countries where players have scored the scores. As such, you should actually look at your own leaderboard server, which tracks the data you're interested in, and can organize it in a

python - Codecademy supermarket "subtract" error -

I have started programming in Python on codecademy, and I have a problem: The following changes For your compute_bill function: When you loop through each item of food, then only add the price of the item when the item's stock is more than zero. If the item is in stock and you add value to the total, then deduct one of the item's stock calculation. " My code reads: Shopping_list = [" banana "," orange "," apple "] stock = {" banana ": 6 "Apple": 0, "orange": 32, "pear": 15} prices = {"banana": 4, "apple": 2, "orange": 1.5, "pear": 3} def compute_bill ): Total for each = 0 in the food: if the stock [every]> gt: total + = value [every] stock [every] - = 1 total food return = ["banana", "orange", "apple"] compute_bill (food) I have this error Oh, try again. Stock does not look right at all! Make sure that do not

c# - The name does not exist in the current context inline -

I have a problem where I am inline a foreach on my default.aspx and I'm getting ??? ? Does not exist in the current context ???? There is an error for the collection list lst that I created behind in my code. IA is not sure what is missing, I can see the control with my code so that I know that page_load is firing. Should I look first in my designer? If not being produced correctly, then I am not 100% positive. I added a test verbal and added that was added. I have compiled my project in debug and runtime Namespace matches is set to true Put! Page Iso Postback I can loop through mysteries and add a literal values ​​and see the values ​​I can come by. Thank you for any help. & lt;% @ page title = "home page" language = "c #" masterpagefile = "~ / masterpages / website.master" codebahind = "default.aspx.cs" inherited = "Admin. Default" autoAvntware = "true" & gt%; & Lt; Asp: Content ID = &quo

python - ZIP Format Repeating character -

This is a theoretical question that it can be completed in any language but I am currently using Python. I want to archive a zip archive which must be expanded to a large amount of repetitive data. Is it possible to create a zip file that will extend to an expected number of characters? For example, if I zip file which will expand on foo.txt and the data will be in the aaaaaaa , then how difficult it will be to change it, as a result foo Txt Will there be one or more 10 characters in ? Can it be completed in Python without any external libraries? Specifically, look at the implementation of. I believe that you can immediately modify the code there to generate such a file. That's what you are seeing.

How to use local.xml to insert a block in Magento 1.8? -

How do I use loca.xml to insert the block? I have a constant block ( footer block inside my page.xml , but before Forrest_Link , type = "core / template" name = "bottom.footer" as template = "bottom.pletter" = " Page / html / footer-bottom.phtml "& gt; block type =" page / switch "name =" store_switcher "as =" store_switcher "template =" page / switch / stores.phtml "/> ; & lt; block type = "page / template_links" as name = "footer_links" = "footer_link" Template = "Page / Templates / Links.file" /> This is my local.xml , block type = "cm / block" name = "cms_footer_links" => before "footer_links" & gt; & lt;! - The contents of this block are taken from its database by block_id You can manage it in Admin CMS - & gt; Static Block - & gt; & lt; Action Method = "SetblockCode&

javascript - Show initial value of bootstrap slider in a span -

I use it and I have a problem. I want to show the value of the slider in the span next to the bar. At the moment, I change it only when the slider does not but when the window loads with its initial value for the first time. Here's my code: & lt; Div class = "form-group" & gt; & Lt; span style = "float: left;" & Gt; Age & lt; / Span & gt; & Lt; span style = "float: right;" & Gt; & Lt; span id = "ageval" & gt; & Lt; / Span & gt; & Lt; / Span & gt; & Lt; Data-slider-max = "55" data-slider-step = "1" data -slider - value = "{{age}}" value = "{{age}}" /> & Lt; / Div & gt; $ ('# Age'). Slider ({tooltip: 'hide'}) $ ('# age'). ('Slide', Function (Slieve) {$ ("#inum"). Text (slideEvt.value);}); use slider.value $ ("#will"). Html ($ ("# age") .slider (). Value);

scala - Stackable traits for mocking shared state -

I have some components that have mixed symptoms, which include system logic (caching, service etc.). And the tests need to fool this argument. It is very easy ... But I need to test the bundles of components with the same cache and I can not share some global cache. Therefore, my solution is: Code: The attribute component class provides components with cache with MyComponent1 services {...} class cache with MyComponent2 services Provides components with {...} attribute cache {private val _cache = ... def query (...) = ...} in test API: Specialty CacheMock Cache Map (Private [Package] Override Def Query (...) = _cache.get (...)} Case Class Config (Cash Make: Cache) on var _cache = null // ) Specialty TestAPI {val componentCreator: = & gt; List [Component] DEF Test (Configuration: config) = {val instance = front of the contractor creator examples {Case Mash: CacheMock => mocked._cache = config.cache mock case _ = & gt;} Example:} In tests: Test API in cl

generics - java: how do I stop people from clearing my arraylist When I use a getter method? -

मैंने कक्षा A में मेरी arraylist घोषित किया है: निजी ArrayList & lt; स्ट्रिंग & gt; उपयोगकर्ता = नया अर्रेलिस्ट & lt; स्ट्रिंग & gt; (); मैंने अपनी कक्षा को एक ही वर्ग (कक्षा ए) में बनाया है: सार्वजनिक ऐरे लिस्ट & lt; स्ट्रिंग & gt; getUser () {वापसी उपयोगकर्ता; } फिर मेरे द्वितीय श्रेणी (कक्षा बी) में मैं निम्नलिखित करने में सक्षम हूं: एक यूडी = नया ए (); UD.getUser () स्पष्ट ()।; UD.getErrmsg () स्पष्ट ()।; मैं अपनी पहली कक्षा (कक्षा ए) में सरली सूची को साफ करने से कैसे मेरी दूसरी कक्षा को रोकूं? इस का एक तरीका संग्रह वर्ग में आप उपयोग कर सकते हैं: return Collections.unmodifiableList (उपयोगकर्ता); जिन तरीकों के लिए आपको आवश्यकता हो सकती है, इनमें से एक के नक्शे और इसके आगे भी शामिल हैं। बस पर एक लूप लें।

android - how to edit items saved in a list app inventor -

So I have just started using App Inventor and have created an app to keep data in a list continuously. I have also removed the data from the list before using the blocks before and after using it. What I am struggling is to find out how the items can be edited in the list, for example they load notes, it is saved as a cheese, all data for it What has been brought, what I want to be able to do, when the note is saved repeatedly, by clicking on the Edit list picker, the note is loaded, then the values ​​stored in the catalog picture are already replaced. Thank you thanks div class = "post-text" itemprop = " text "> I am getting late in answering but try here: This tutorial will go through the whole process in mysql DB for things like PHP and app Using the inventor, the section must be answered by updating the selected items using the List Picture, in particular, using the List Picture.

javascript - Divide elements width depending on amount of elements -

Image
"Divide the width of elements based on the amount of elements" as the title "I need a progress bar where I I can add element and the progress bar divided by me is based on the elements. It is now fixed value (33%, 33% and 34%) and I want to know how many elements they use I Like I have 4 elements in my list, I divide it evenly with 4 Want to Is there any easy way to do this? Probably using CSS? I have no problem with javascript, but im just saying that this is something i have missed :) Edit: I created 3 div and gave them all different classes & lt; Section class = "progress-part-list" & gt; & Lt; div class = "progress-part-left" & gt; & Lt; / Div & gt; & Lt; Div class = "progress-part-right" & gt; & Lt; / Div & gt; & Lt; Div class = "progress-part-middle" & gt; & Lt; / Div & gt; & Lt; / Section & gt; This is in my CSS with its fixed values: . Prog

javascript - Why does this ciphertext always start with the same characters? -

I started off with cryptogues and I have seen something weird: the ciphertex always starts with the same string of letters. Here's the code to encrypt (I know the monastery is not revolutionary cryptically secure, it was very quick and dirty). function controller ($ scope) {$ scope.Text = ""; $ Scope.CipherText = ""; $ Scope.Key = Math.random (). toString (); $ Scope.Encrypt = function ($ event) {$ scope.CipherText = CryptoJS.AES.encrypt ($ scope.Text, $ scope.Key) .toString (); }} With HTML: & lt; Div ng-controller = "controller" & gt; & Lt; Div & gt; Your key is: "{{key}}". & Lt; / Div & gt; & Lt; Div & gt; & Lt; textarea ng-change = "encrypt ()" ng-model = "text" max length = "140" & gt; {{Text}} & lt; / Textarea & gt; & Lt; Br / & gt; 140 & lt; Span & gt; {{Text.length}} & lt; / Span & gt; & Lt; / Div & gt; & Lt; Div

c++ - connect() breaks the socket when the connection is refused -

I was fighting an error in my program where I got the signal SIGPIPE when I tried To send () after connect () . The error occurred only when connect () was detected at least once "Connection refused". Here's the old buggy code: getaddrinfo ("127.0.0.1", "1443", and hint, and res); s = socket (res-> gt; ai_family, res-> ai_socktype, res-> ai_protocol); While (Connect (S, RAC-> AI_ADDR, RAC-> AI_ADDRRL)> == -1) {printf ("Error: Connection refused"); Sleep (2); } sprintf (msg, "test"); msg_len = strlen (msg); Send (s, msg, msg_len, 0); The way I decide it looks strange to me, and I do not understand why this works. Here is the fixed code: int connect_works = -1; Whereas (connect_work == -1) {getaddrinfo ("127.0.0.1", "1443", and hint, and;); S = socket (res-> gt; ai_family, res-> ai_socktype, res-> ai_protocol); Connect_work = connect (s, rac-> AI_ADDR, RAC-> AIID

osx - NSView -drawRect and mouse hover performance -

I have a custom NSV that pulls a graph (with -drawRect ). It also tracks the position of the mouse (with -mousemoved and so on) and the cursor draws coordinates relative to position / latitude. The graph is large and (potentially) slow is drawn, and the mouse does not depend on the situation. The mouse-over effect is small, and is always fast to attract. I do not have to overturn anything when the mouse runs a few pixels, because it looks sluggish. I'm sure I can double my own personal graphics reference (size, if a 2x display), draw that chart data at a time, and then click - Draw Alternatively, I can divide my NSView subclass into two classes, and only have a chart data and a bus overlay, and keep them at the top of each other ( Though they Do not share a small portion of the data, so it seems odd). Is there a built-in method to make it easy, or is there another idiotic way to handle it? Take a look at these NSWindow methods: Take a look at these NSWindow method

Rails Drag And Drop For Create/Edit Associations -

I have tried to find an answer for this, but I think there really is nothing visible. I am using Rail 4 and I have an exercise model and a regular model which is through silk through exercise. Users have a list of routine and a list of exercises attached to them. It aims to include organizations that exercise to prepare a list of exercises that are regularly involved in organizing them to drag and drop them from the list of exercises. Therefore it will include two lists, a list of exercises of a user and the other is a list of exercises related to the current routine. I want to make it so that they can either edit it or either pull it from the list for initial construction. Can I drag and drop to work between lists? I confuse how to update the database with the change. Do the tracks realize that the user removed one thing from the list and should delete that record? Should every organization in the list be tried every time because of an error? I am also in the form of part of

encryption - Openssl "data greater than mod len" -

"What is more data from modem lane" error message? I have encountered this while attempting to decrypt the data using php's openssl_private_decrypt, how is this known about resolving the issue? Unsatisfactory RSA keys can only encrypt / decrypt data on a limited length.

How to update index of a document by its "id" in Solr? -

मैं कैसे update या re-index का solr अनुक्रमणिका सोलर में मौजूदा दस्तावेज़ का उपयोग करके इसकी " आईडी "? मैं सोलर 4.0 का उपयोग कर रहा हूं। मैंने शोध किया लेकिन मुझे एक निश्चित जवाब कहीं भी नहीं मिला। लुसेन केवल एक ऐप संलग्न है Solr में अद्यतन वाक्यविन्यास अनिवार्यतः अनुवाद और डालने में अनुवाद करेगा। इसलिए हम अपने सभी क्षेत्रों के साथ पूर्ण दस्तावेज़ को अपडेट करने के लिए ध्यान देते हैं। Solr 4 और इसके बाद के संस्करण के साथ, आपके पास परमाणु अद्यतन का विकल्प है ताकि आप केवल कुछ फ़ील्ड को अपडेट कर सकें। इस मामले में एक बाधा है कि सभी एसएलआर स्कीमा फ़ील्ड "संग्रहीत" होनी चाहिए। तो आंतरिक solr मिल जाता है और फिर फ़ील्ड को पुनर्प्राप्त दस्तावेज़ में मर्ज करें और फिर डालें। नीचे दिए गए प्रलेखन लिंक: - सूचकांक भी का उपयोग करके अपडेट किया जा सकता है - यह सिर्फ ग्राहक को दस्तावेज़ में पुनर्प्राप्त करने और फिर अपडेट करने के लिए नेटवर्क पर बचाता है।

c# - Facebook multi account -

I want to write a simple win-form tool for managing various social accounts. I have a user problem Many Facebook accounts, when I try to log in as another user, I have to redirect the page to the webbrowser. I tried to use the InternetSetOption and the INTERNET_SUPPRESS_COOKIE_PERSIST flag, but it seems that it does not help. How can I solve this problem? Login Code var lParameters = New Dictionary & lt; String, Object & gt; (); lParameters ["client_id"] = APPID; LParameters ["redirect_uri"] = "https://www.facebook.com/connect/login_success.html"; lParameters ["response_type"] = "token"; LParameters ["display"] = "popup"; LParameters ["scope"] = "user_about_me"; Uri Leuree = M.Bookbook Client.Getlogin URL (LPRMATR); Main.webBrowser.Navigate (Luri); Added: Maybe I'm doing something wrong with InternetSetOption? Sorry for the newbie question. I really like it in this reply,

c# - OutOfMemoryException with gcAllowVeryLargeObjects -

I am using a binary certifiers in which very large things have been detected. I have a 8Gb RAM supported by 12GG swap and I hope that if out of serialization, we are getting an out-of-my-camera expression (it is possible that the graph can be closer to 2 GB or more). However, when I use the GCLVallerject, it is not better than that, I still get the same exception and I am definitely working on things which in memory (at least swap With) Can I have the same feature set to get it, but can it result? There is nothing special about my serialization code: public static byte [] serialize (this object o) {var ms = new memorystream (); var bf = new BinaryFormatter (); bf.Serialize (MS, O); Ms.osition = 0; Return to MS. ToArray (); } The item I am serial involves arrays of objects including ones themselves, etc. But the whole graph is not "big" (the result of this indexing data The source, which is already in the shape of approximately 1 GB). This is not due to GC fr

c# - Entity Framework 6.1 and Member Hiding using New Keyword -

I have a group that implements an interface called ICreatableEntity is the definition: Public Interface ICTTableInti {int CreatedById {get; Set; } Created by Employee {Received; Set; } Date Created Date Time {Receive; Set; }} A specific unit, employee , requires a little change because the first record can not be the creator and thus I need to clear the column is . So, I just tried to hide the inherited member using the new keyword: the public new int? Built-in BIID {Received; Set; } And all this works, the compiler likes it and all, but when the model is being generated by EF, it crashes with an error The item is already present in the metadata collection . I'm guessing, EF probably first adds my override, then earns the base to add property, even though I'm trying to hide it, and when it crashes. Update: I have tried to drop it and changed it to Fluent API configuration in alternate, which also compiles properly, but again crashing again It happens whe

javascript - .bind() .live() not working in Safari or Chrome, but works in Firefox -

I am very new to this, can someone point me in the right direction? The way I want my website to work mostly in Firefox, but now I'm trying to test it in Safari or Chrome, it does not work. I am sure that there will be many problems later, but the first issue is that I am working with it, my main NAV button is not working. Click handler and mouseleave and mousecenter are not working function onLoad () {var $ list = $ ('# mainNavList' ); Is there anything wrong with this code or is it a problem somewhere else? ShowMainMenu (); Specify the menu showing the // menu. Crawling Element ('#new Newville'); specifyScrollingElement ('# lowerNav'); $ list.find ('link inactive'). Live ('click', on the menuman menu); $ ('. AlbumLink'). Original (). Bine ('mousecenter', function () {$ (this) .css ({'background-color': '#fff'})}} $ $ ('albumlink'). Binding ('mouseover', function) ( If ($ (this)

c# - No connection string could be found in the config file. But it is there -

I have spent a good part of the day to decide on this. There is only one solution found in every post I get on this problem. Put the connection string in the config file for the start project. I have two projects for an EDMX and for my website, my connection string is in both of my files, and I still get the error. I have to add all the config files Attempted to include something I have tried to put a connection string in all the configuration files in my solution, the Conflict section of the Confidential Framework for the Confidential Framework Adding or adding to the form, and using Nugs to uninstall and reinstall EF 5. I inherited this solution, so I do not have much information about how this was made, besides this database was the first. Connection String & lt; Add name = "StoreContext" connectionString = "metadata = res: //*/Store.csdl | res: //*/Store.ssdl | res: //*/Store.msl; provider = System.Data.SqlClient; provider Connection String = &

javascript - How to implement Google Analytics and save daily statistics of a webpage in a database -

How do I know a SQL query from PHP to implement Google Analytics and save daily webpage statistics? Thank you for your reply. There are many issues that you will need to get it to work far away. This is not as simple as adding a file to your site. You must first search your site using JavaScript using your site that Google provides. Next you will need to either use a PHP API from Google servers, or you can also try a solution I personally prefer to use the OAuth method for ease of use. I am the ones who can do the heavy lifting work. After the data you need, you have to add it to the database. You can do this for a request or in PHP with AJAX. Both methods are good. SQL itself is up to you if you are using any type of CMS, instead of writing your own, try to use your database methods. If you are writing one from scratch, I suggest that this usually takes care of many security vulnerabilities with SQL and it is well documented. Sub-in-all, many parts are running in this pr

javascript - problems creating Tiny URL -

I am trying to get tinyURL to use code bellow, is not working for any reason: Can someone please help me appreciate it This is a solution for someone in need of it. Thanks people for your help $ (document) .ready (function () {$ .getJSON ("http://query.yahooapis.com/v1/public/yql?" + "q = Select% 20 * 20% 20 20% to 20 %% 20 place% 20 URL% 3D% 22" + EncoderIconConnant ('http://tinyurl.com/api-create.php?url=http:/ /google.com ') + "% 22and format = html' and callback =?", Function (data) {$ ('# output'). Text ($ trim ($ (data results [0] ). Text ());}); }) I check errors. In most browsers you will see them in the browser's error console, you can press F12 to show the console.

java - Removing elements from ArrayList in ascending order -

I am trying to extract the elements in ArrayList in ascending order. I am down to descending order, but it can not understand it on the other side. I have tried: for (int r = 0; r But it only shows the elements and elements elements made from zero. So far I have: public class test {public static zero main (string) [] args) {Array list & lt; String & gt; s = new arreelist & lt; & Gt; (4); S.add ('a'); S.add ("b"); S.add ('c'); S.add ('d'); Removes elements in descending order for // (int r = s.size () - 1; r> = 0; r -) {System.out.println (s); S.remove (r); } System.out.println (s.size ()); }} Any ideas? You can try this array list & lt; String & gt; s = new ArrayList & lt; String & gt; (4); S.add ('a'); S.add ("b"); S.add ('c'); S.add ('d'); // Reverse the array list. Source (S, Collection. Raerserver ()); Iterator & LT; String & gt; I = s.iterator

Speed up Python MongoDB query -

I am new to mongodibi I am trying to read data from several collections. I want to do some statistics on GHTorrent, so I am trying to print .csv with the data that I am interested in. The problem is that my query is now running for some 30 minutes and I'm sure my search is less effective than it is, I'm not sure how to improve it. First of all, I close_issues = ghdb.issues.find ({"state": "off"}, # query criteria {# projection "id": 1 1, "number": 1,} , "created_at": 1, "closed": 1, "comments": 1, "repo": 1, p> Then, after opening a file and typing in the headlines, I do to issue in closed numbers: countMentioned = ghdb.issue_events.find ("problem": issue ['Number'], "repo": issue ['repo'], "owner": issue ['owner'], "incident": "outlined"}). Calculation (); = "Ghdb.i ['number'], "repo":

Python GTK3 inheritance -

How can I get GTK + 3 class in Python? I am trying to create a legacy class of Gtk.Application and what I have found is a segfault. I have tried a lot of things, but with this I got a segfault: class program (Gtk.Application): def __init __ (self): super () .__ init __ (self) ... PRG = Program.new ("APP_ID", flags) "post-text" itemprop = "text"> If I try my code snippet, I actually get: traceback (most recent call final): In the file "pyclass.py", line 12, & lt; Module & gt; PRG = Program.new ("APP_ID", 0) Writing Error: Application Maker can not be used to create examples of a subclass program Which is expected, since you call Python Using the code for gtk_application_new () should try the Program.new () python manufacturer form. class program (Gtk.Application): def __init __ (self): Gtk.Application .__ init __ (auto, APPLICATION_ID = "org.example.Foo", flags = Gio.ApplicationFlags .FLAGS