Daily Archives

Articles indexed Saturday May 22 2010

Page 10/81 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Scrapy spider is not working

    - by Zeynel
    Since nothing so far is working I started a new project with python scrapy-ctl.py startproject Nu I followed the tutorial exactly, and created the folders, and a new spider from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.selector import HtmlXPathSelector from scrapy.item import Item from Nu.items import NuItem from urls import u class NuSpider(CrawlSpider): domain_name = "wcase" start_urls = ['http://www.whitecase.com/aabbas/'] names = hxs.select('//td[@class="altRow"][1]/a/@href').re('/.a\w+') u = names.pop() rules = (Rule(SgmlLinkExtractor(allow=(u, )), callback='parse_item'),) def parse(self, response): self.log('Hi, this is an item page! %s' % response.url) hxs = HtmlXPathSelector(response) item = Item() item['school'] = hxs.select('//td[@class="mainColumnTDa"]').re('(?<=(JD,\s))(.*?)(\d+)') return item SPIDER = NuSpider() and when I run C:\Python26\Scripts\Nu>python scrapy-ctl.py crawl wcase I get [Nu] ERROR: Could not find spider for domain: wcase The other spiders at least are recognized by Scrapy, this one is not. What am I doing wrong? Thanks for your help!

    Read the article

  • Secure database connection. DAL .net architecture best practice

    - by Andrew Florko
    We have several applications that are installed in several departments that interact with database via Intranet. Users tend to use weak passwords or store login/password written on a shits of paper where everybody can see them. I'm worried about login/password leakage & want to minimize consequences. Minimizing database-server attack surface by hiding database-server from Intranet access would be a great idea also. I'm thinking about intermediary data access service method-based security. It seems more flexible than table-based or connection-based database-server one. This approach also allows to hide database-server from public Intranet. What kind of .net technologies and best practices would you suggest? Thank in you in advance!

    Read the article

  • Scrapy Could not find spider Error

    - by Nacari
    I have been trying to get a simple spider to run with scrapy, but keep getting the error: Could not find spider for domain:stackexchange.com when I run the code with the expression scrapy-ctl.py crawl stackexchange.com. The spider is as follow: from scrapy.spider import BaseSpider from __future__ import absolute_import class StackExchangeSpider(BaseSpider): domain_name = "stackexchange.com" start_urls = [ "http://www.stackexchange.com/", ] def parse(self, response): filename = response.url.split("/")[-2] open(filename, 'wb').write(response.body) SPIDER = StackExchangeSpider()` Another person posted almost the exact same problem months ago but did not say how they fixed it, http://stackoverflow.com/questions/1806990/scrapy-spider-is-not-working I have been following the turtorial exactly at http://doc.scrapy.org/intro/tutorial.html, and cannot figure out why it is not working.

    Read the article

  • Save HTML to Pdf ABCPdf 4

    - by daisy
    Hello All, I'm using following code to save html to pdf file. But it fails to compile at if (!theDoc.Chainable(theID)). I do have using WebSupergoo.ABCpdf4; added at the begining of the code. Is this version issue? Is there any other method to save HTML string to pdf file in ABCPdf 4. Error Message is "'WebSupergoo.ABCpdf4.Doc' does not contain a definition for 'Chainable' and no extension method 'Chainable' accepting a first argument of type 'WebSupergoo.ABCpdf4.Doc' could be found (are you missing a using directive or an assembly reference?) Doc theDoc = new Doc(); theDoc.Rect.Inset(10, 50); theDoc.Page = theDoc.AddPage(); int theID; theID = theDoc.AddImageHtml(str); while (true) { if (!theDoc.Chainable(theID)) break; theDoc.Page = theDoc.AddPage(); theID = theDoc.AddImageToChain(theID); } for (int i = 1; i <= theDoc.PageCount; i++) { theDoc.PageNumber = i; theDoc.Flatten(); } theDoc.Save("path where u want 2 save" + ".pdf"); theDoc.Clear(); All the help is appreciated.

    Read the article

  • Need to keep focus in a wpf content panel

    - by Das
    Hi , I am switching content template of a ListViewItem at run mode to enable editting the item.For that i am showing a panel with Ok and Cancel options and i need the user to select any of those option before moving to anotheritem. Means i want that panel to behave like a modal dialog. Any suggestions ?. Advanced Thanks, Das

    Read the article

  • Calling an Excel Add-In method from C# application or vice versa

    - by Jude
    I have an Excel VBA add-in with a public method in a bas file. This method currently creates a VB6 COM object, which exists in a running VB6 exe/vbp. The VB6 app loads in data and then the Excel add-in method can call methods on the VB6 COM object to load the data into an existing Excel xls. This is all currently working. We have since converted our VB6 app to C#. My question is: What is the best/easiest way to mimic this behavior with the C#/.NET app? I'm thinking I may not be able to pull the data from the .NET app into Excel from the add-in method since the .Net app needs to be running with data loaded (so no using a stand-alone C# class library). Maybe we can, instead, push the data from .NET to Excel by accessing the VBA add-in method from the C# code? The following is the existing VBA method accessing the VB6 app: Public Sub UpdateInDataFromApp() Dim wkbInData As Workbook Dim oFPW As Object Dim nMaxCols As Integer Dim nMaxRows As Integer Dim j As Integer Dim sName As String Dim nCol As Integer Dim nRow As Integer Dim sheetCnt As Integer Dim nDepth As Integer Dim sPath As String Dim vData As Variant Dim SheetRange As Range Set wkbInData = wkbOpen("InData.xls") sPath = g_sPathXLSfiles & "\" 'Note: the following will bring up fpw app if not already running Set oFPW = CreateObject("FPW.CProfilesData") If oFPW Is Nothing Then MsgBox "Unable to reference " & sApp Else . . . sheetCnt = wkbInData.Sheets.Count 'get number of sheets in indata workbook For j = 2 To sheetCnt 'set counter to loop over all sheets except the first one which is not input data fields With wkbInData.Worksheets(j) Set SheetRange = .UsedRange End With With SheetRange nMaxRows = .Rows.Count 'get range of sheet(j) nMaxCols = .Columns.Count 'get range of sheet(j) Range(.Cells(2, 2), .Cells(nMaxRows, nMaxCols)).ClearContents 'Clears data from data range (51 Columns) Range(.Cells(2, 2), .Cells(nMaxRows, nMaxCols)).ClearComments End With With oFPW 'vb6 object For nRow = 2 To nMaxRows ' loop through rows sName = SheetRange.Cells(nRow, 1) 'Field name vData = .vntGetSymbol(sName, 0) 'Check if vb6 app identifies the name nDepth = .GetInputTableDepth(sName) 'Get number of data items for this field name from vb6 app nMaxCols = nDepth + 2 'nDepth=0, is single data item For nCol = 2 To nMaxCols 'loop over deep screen fields nDepth = nCol - 2 'current depth vData = .vntGetSymbol(sName, nDepth) 'Get Data from vb6 app If LenB(vData) > 0 And IsNumeric(vData) Then 'Check if data returned SheetRange.Cells(nRow, nCol) = vData 'Poke the data in Else SheetRange.Cells(nRow, nCol) = vData 'Poke a zero in End If Next 'nCol Next 'nRow End With Set SheetRange = Nothing Next 'j End If Set wkbInData = Nothing Set oFPW = Nothing Exit Sub . . . End Sub Any help would be appreciated.

    Read the article

  • Big datastructures in functional programming

    - by Denis Gorodetskiy
    I'm newbie in Functional Programming. I have a huge neural network with thousands of neurons and every connection between neurons has its weight. I have to update these weights very often, several thousand times per learning session. Is FP still applicable here? I mean in fp we can't modify variables and only able to return new variables not changing previous values. Does this mean I have to recreate whole network on every weight update?

    Read the article

  • few questions on packet sniffer/analyzer

    - by user37652
    I have few questions about packet sniffer. I'm using a zyxel p-600 series modem and a hub to distribute the internet connection. Can I use a packet sniffer here to determine if the user is downloading something? Can I determine if the user is downloading a file based on the modem alone.(The lights blink faster) Is there an application that I could use for the modem or the hub to limit or avoid direct downloads. Details: OS: Ubuntu 9.10 and Windows 7

    Read the article

  • How can I use MVC ideas without using classes?

    - by jpjp
    As of right now, I am still shaky on classes, so I don't want to use any classes for my site. I'm still practicing with classes. But how can I implement the MVC idea without classes? Would this work for a MVC? index.php (the view) index_controller.php index_model.php Is this right for what a MVC should be? View: show html, css, forms Controller: get $_POST from forms and any data from the user, get info from db Model: do all the functions, insert/delete in db, etc Basically separate the HTML/css for the view, all the data collecting for the controller, and the logic for the model. And just connect them all using require_once.

    Read the article

  • Insert A Line At The Beginning Of A File

    - by thebourneid
    I'm trying to insert/add a line 'COMMENT DUMMY' at the beginnig of a file as a first row if /PATTERN/ not found. I know how to do this with OPEN CLOSE function. Probably after reading the file it should look something like this: open F, ">", $fn or die "could not open file: $!"; ; print F "COMMENT DUMMY\n", @array; close F; But I have a need to implement this with the use of the Tie::File function and don't know how. use strict; use warnings; use Tie::File; my $fn = 'test.txt'; tie my @lines, 'Tie::File', $fn or die "could not tie file: $!"; untie @lines;

    Read the article

  • Execuitng script in threads

    - by Pedro Magalhaes
    Hi. I wanna make an app that executes remote scripts. I am going to design it like a Windows Service that listen on tcp/ip port. Every new request I will execute a python scripts. So I can handle any number of tcp/ip request at same time, so I will need to execute python script in separate threads. How can I do that? Is that simple? The script will share some objects, like Log files(text files) and other modules. In the log file example every script will write in the same file. So the app (windows service) will be responsible for do that. I need to make this objects thread safe, right?

    Read the article

  • Wrapping Multiple Elements (jQuery)

    - by Nimbuz
    I've this piece of HTML: div.content div.one content div.two content div.three content I want to add two divs on top and bottom and wrap one div around it so it becomes: div.top div.wrapper div.content div.one content div.two content div.three content div.bottom I'm aware of the several wrap selectors (innerWrap, wrapAll etc..) but I'm not sure how to wrap 2 divs. The following jQuery might work, but is there a better way to write it? $('content').wrap('<div class="wrapper"></div'); $('.wrapper').before('<div class="top"></div>'); $('.wrapper').after('<div class="bottom"></div>');

    Read the article

  • Why is url not registered?(Drupal 6.x)

    - by Andrew
    I'm using hook_menu to register new url so that accessing this url would return some data to ajax function. As title suggested, this url is not registered. How do I know that? I've tried typing this in address bar but, drupal, return main template only rather than the tests string that I created. I'm positive that my module is working for php issues error if I intentionally write wrong syntax. And, yes, I clear cache whenever I make changes. Here's the code - function test_menu() { $my_form['test'] = array( 'title' => 'Test address', 'page callback' => 'test', 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); return $my_form; } function test(){ $a= "testing"; return $a; }

    Read the article

  • Why does an authorized OAuth request token need to be exchanged for an access token?

    - by Joe Shaw
    I'm wondering what the reasons are for OAuth to require a round-trip to the data provider to exchange an authorized request token for an access token. My understanding of the OAuth workflow is: Requesting site (consumer) gets a request token from the data provider site (service provider). Requesting site asks the data provider site to authenticate the user, passing in a callback. Once the user has been authenticated and authorized the requesting site, the user is directed back to the requesting site (consumer) via the callback provided which passes back the now-authorized request token and a verification code. The requesting site exchanges the request token for an access token. The requesting site uses the access token to get data from the data provider site. Assuming I got that right, why couldn't the callback simply provide the access token to the requesting site directly in step 3, eliminating step 4? Why is the request to exchange the request token for the access token necessary? Does it exist solely for consumers that require users to enter the verification code manually, with the thought that it would be shorter and simpler than the access token itself?

    Read the article

  • C++ Why am I unable to use an enum declared globally outside of the class it was declared in?

    - by VGambit
    Right now, my project has two classes and a main. Since the two classes inherit from each other, they are both using forward declarations. In the first object, right underneath the #include statement, I initialize two enums, before the class definition. I can use both enums just fine inside that class. However, if I try to use those enums in the other class, which inherits from the first one, I get an error saying the enum has not been declared. If I try to redefine the enum in the second class, I get a redefinition error. I have even tried using a trick I just read about, and putting each enum in its own namespace; that didn't change anything.

    Read the article

  • application that could track amount of downloads

    - by user23950
    My ISP only limits me for downloading about 25gb a month. After exceeding the limit, my speed goes down by half for another month. And its really a pain. I'm real addicted on downloading stuff from the internet. My question is: Is there an application that can track the amount/size of downloads in a month. Is there a trick that I could use to fool the eyes of my ISP. If they say 25 Gb limit in a month. Does it include the webpages, manga streams, video & audio streams. Or just direct download and p2p.

    Read the article

  • Magento layout related basic Questions ?

    - by user197992
    Here is what I think about Magento (plz correct me if I am wrong ) 1)Each module has its own layout.xml stored in /interface/theme/layouts/ folder. 2)Magento loads all these layouts for current theme and creates a big xml file. Now what I am confused at . a)If magento loads /default/default/ (interface & theme) then why all the templates & layouts are inside base/default/ ?? b)what if I create my module name “page” inside my namespace “Jason” i.e Jason_Page , now what will happen to blocks in layout files which are named c)Since all the layouts are loaded and merged into one big xml file , then what happen to all those reference blocks which have same name attribute and are inside “Default” handle tag ? e.g d)what is Local.xml layout for and its use ?? e)wats the relation ship between a module name foo , and its layout name foo.xml ? What will happen to layout.xml if two modules with same name exist in diff namespace ? Thanks in advance .

    Read the article

  • Multiple generic types in one container

    - by Lirik
    I was looking at the answer of this question regarding multiple generic types in one container and I can't really get it to work: the properties of the Metadata class are not visible, since the abstract class doesn't have them. Here is a slightly modified version of the code in the original question: public abstract class Metadata { } public class Metadata<T> : Metadata { // ... some other meta data public T Function{ get; set; } } List<Metadata> metadataObjects; metadataObjects.Add(new Metadata<Func<double,double>>()); metadataObjects.Add(new Metadata<Func<int,double>>()); metadataObjects.Add(new Metadata<Func<double,int>>()); foreach( Metadata md in metadataObjects) { var tmp = md.Function; // <-- Error: does not contain a definition for Function } The exact error is: error CS1061: 'Metadata' does not contain a definition for 'Function' and no extension method 'Function' accepting a first argument of type 'Metadata' could be found (are you missing a using directive or an assembly reference?) I believe it's because the abstract class does not define the property Function, thus the whole effort is completely useless. Is there a way that we can get the properties?

    Read the article

  • Creating an Excel Template for different data size

    - by dassouki
    I created an excel template for a file i've done for a routine work calculation. The file takes data from the data logger and does some analysis on it and outputs one number regardless of the input size. The problem I'm having is i have to modify the sheet to suit the number of rows, as everyday the data logger outputs a different number of rows. there are about 15 sheets in the workbook and it's annoying to have to change everyone of them everyday. What i'd like to do input the data logger csv, and boom the result gets outputted. Is there a way through vba or not to ahieve

    Read the article

  • Mobiles : Windows Mobile chute, Android progresse fortement, 100.000 téléphones sous Android seraien

    Mise à jour du 21.05.2010 par Katleen Mobiles : Windows Mobile chute, Android progresse fortement, 100.000 téléphones sous Android seraient vendus chaque jour L'institut Gartner vient de publier les chiffres des ventes de téléphones portables de par le monde, pour le premier trimestre 2010. Les mastodontes du marché que sont Motorola et Sony Ericsson connaissent de mauvais résultats, alors que le canadien RIM (BlackBerry) récolte les fruits d'une croissance positive qui le place en quatrième position derrière les leaders Nokia, Samsung et LG. Du haut de sa première place, Nokia domine toujours largement le marché, même si l'entreprise a subit un léger recul. A sa suite, Samsung gagne e...

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >