Posts

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 (...