Daily Archives

Articles indexed Wednesday March 17 2010

Page 32/128 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • Building an automatic web crawler

    - by Sakin
    I am building a web application crawler that's meant not only to find all the links or pages in a web application, but also perform all the allowed actions in the app (such as pushing buttons, filling forms, notice changes in the DOM even if they did not trigger a request etc.) Basically, this is a kind of "browser simulator". I find WebKit a good option to implement my crawler, since it has all the needed technology (Javascript engine, parsers, DOM manipulation, etc.) but it seems kind of an overkill being a fully featured browser. Is there any toolkit you know that can provide the above functionality?

    Read the article

  • Mixins, variadic templates, and CRTP in C++

    - by Eitan
    Here's the scenario: I'd like to have a host class that can have a variable number of mixins (not too hard with variadic templates--see for example http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.103.144). However, I'd also like the mixins to be parameterized by the host class, so that they can refer to its public types (using the CRTP idiom). The problem arises when trying to mix the too--the correct syntax is unclear to me. For example, the following code fails to compile with g++ 4.4.1: template <template<class> class... Mixins> class Host : public Mixins<Host<Mixins>>... { public: template <class... Args> Host(Args&&... args) : Mixins<Host>(std::forward<Args>(args))... {} }; template <class Host> struct Mix1 {}; template <class Host> struct Mix2 {}; typedef Host<Mix1, Mix2> TopHost; TopHost *th = new TopHost(Mix1<TopHost>(), Mix2<TopHost>()); With the error: tst.cpp: In constructor ‘Host<Mixins>::Host(Args&& ...) [with Args = Mix1<Host<Mix1, Mix2> >, Mix2<Host<Mix1, Mix2> >, Mixins = Mix1, Mix2]’: tst.cpp:33: instantiated from here tst.cpp:18: error: type ‘Mix1<Host<Mix1, Mix2> >’ is not a direct base of ‘Host<Mix1, Mix2>’ tst.cpp:18: error: type ‘Mix2<Host<Mix1, Mix2> >’ is not a direct base of ‘Host<Mix1, Mix2>’ Does anyone have successful experience mixing variadic templates with CRTP?

    Read the article

  • How can I prevent SerializeJSON from changing Yes/No/True/False strings to boolean?

    - by Dan Roberts
    I have a data struct being stored in JSON format, converted using the serializeJSON function. The problem I am running into is that strings that can be boolean in CF such as Yes,No,True,and False are converted into JSON as boolean values. Below is example code. Any ideas on how to prevent this? Code: <cfset test = {str='Yes'}> <cfset json = serializeJSON(test)> <cfset fromJSON = deserializeJSON(json)> <cfoutput> #test.str#<br> #json#<br> #fromJSON.str# </cfoutput> Result: Yes {"STR":true} YES

    Read the article

  • UnicodeDecodeError on attempt to save file through django default filebased backend

    - by Ivan Kuznetsov
    When i attempt to add a file with russian symbols in name to the model instance through default instance.file_field.save method, i get an UnicodeDecodeError (ascii decoding error, not in range (128) from the storage backend (stacktrace ended on os.exist). If i write this file through default python file open/write all goes right. All filenames in utf-8. I get this error only on testing Gentoo, on my Ubuntu workstation all works fine. class Article(models.Model): file = models.FileField(null=True, blank=True, max_length = 300, upload_to='articles_files/%Y/%m/%d/') Traceback: File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response 100. response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.6/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 24. return view_func(request, *args, **kwargs) File "/var/www/localhost/help/wiki/views.py" in edit_article 338. new_article.file.save(fp, fi, save=True) File "/usr/lib/python2.6/site-packages/django/db/models/fields/files.py" in save 92. self.name = self.storage.save(name, content) File "/usr/lib/python2.6/site-packages/django/core/files/storage.py" in save 47. name = self.get_available_name(name) File "/usr/lib/python2.6/site-packages/django/core/files/storage.py" in get_available_name 73. while self.exists(name): File "/usr/lib/python2.6/site-packages/django/core/files/storage.py" in exists 196. return os.path.exists(self.path(name)) File "/usr/lib/python2.6/genericpath.py" in exists 18. st = os.stat(path) Exception Type: UnicodeEncodeError at /edit/ Exception Value: ('ascii', u'/var/www/localhost/help/i/articles_files/2010/03/17/\u041f\u0440\u0438\u0432\u0435\u0442', 52, 58, 'ordinal not in range(128)')

    Read the article

  • Books and resources for Java Performance tuning - when working with databases, huge lists

    - by Arvind
    Hi All, I am relatively new to working on huge applications in Java. I am working on a Java web service which is pretty heavily used by various clients. The service basically queries the database (hibernate) and then works with a lot of Lists (there are adapters to convert list returned from DB to the interface which the service publishes) and I am seeing lot of issues with the service like high CPU usage or high heap space. While I can troubleshoot the performance issues using a profiler, I want to actually learn about what all I need to take care when I actually write code. Like what kind of List to use or things like using StringBuilder instead of String, etc... Is there any book or blogs which I can refer which will help me while I write new services? Also my application is multithreaded - each service call from a client is a new thread, and I want to know some best practices around that area as well. I did search the web but I found many tips which are not relevant in the latest Java 6 releases, so wanted to know what kind of resources would help a developer starting out now on Java for heavily used applications. Arvind

    Read the article

  • Does iBatis enforce a primary key on my table?

    - by Yousui
    Hi guys, I'm working on a legacy project. The database is poorly designed. I want to change the DB layer now. The first think go through my mind is hibernate, but I hibernate need a primary key on my table. In fact some of my table does not have primary key. So I did a google search and I find iBatis, it's sounds very good with it. But I don't know whether iBatis enforce a primary key on my table? Thanks.

    Read the article

  • Difference between name != null and null != name in java?

    - by GK
    I have seen people using the following conditions interchangeably. String name; //some code if(name != null) //or if(null != name) So is there any difference in this? or both are same? I am asking this here because, i heard that there is some difference in these, but don't know what. Thanks

    Read the article

  • Inserting Large volume of data in SQL Server 2005

    - by Manjoor
    We have a application (written in c#) to store live stock market price in the database (SQL Server 2005). It insert about 1 Million record in a single day. Now we are adding some more segment of market into it and the no of records would be double (2 Millions/day). Currently the average record insertion per second is about 50, maximum is 450 and minimum is 0. To check certain conditions i have used service broker (asynchronous trigger) on my price table. It is running fine at this time(about 35% CPU utilization). Now i am planning to create a in memory dataset of current stock price. we would like to do some simple calculations. I want to know different views of members on this. Please provide your way of dealing with such situation.

    Read the article

  • twitter's profile widget include in a separate javascript file

    - by raulricardo21
    Hi stackoverflowers, I'm just trying to put the custom twitter's profile widget on my page, but I like to put the code in a separate javascript's file. so, I don't know how to do that. I mean, I put this on head tag <script type="text/javascript" src="http://widgets.twimg.com/j/2/widget.js"></script> the create a div for the widget, an put the rest of the code in another javascript new TWTR.Widget(json_twitter_options).render().setUser('username').start(); But, how to "put" the result in that widget... I'm totally lost, thanks in advance.

    Read the article

  • ASP.NET file transfer from local machine to another machine

    - by Imcl
    I basically want to transfer a file from the client to the file storage server without actual login to the server so that the client cannot access the storage location on the server directly. I can do this only if i manually login to the storage server through windows login. I dont want to do that. This is a Web-Based Application. Using the link below, I wrote a code for my application. I am not able to get it right though, Please refer the link and help me ot with it... http://stackoverflow.com/questions/263518/c-uploading-files-to-file-server The following is my code:- protected void Button1_Click(object sender, EventArgs e) { filePath = FileUpload1.FileName; try { WebClient client = new WebClient(); NetworkCredential nc = new NetworkCredential(uName, password); Uri addy = new Uri("\\\\192.168.1.3\\upload\\"); client.Credentials = nc; byte[] arrReturn = client.UploadFile(addy, filePath); Console.WriteLine(arrReturn.ToString()); } catch (Exception ex) { Console.WriteLine(ex.Message); } } The following line doesn't execute... byte[] arrReturn = client.UploadFile(addy, filePath); This is the error I get: An exception occurred during a WebClient request

    Read the article

  • how to fix the column width of a listview in c# windows form?

    - by zoya
    i have a listview i need to fix the column width of the listview so that at run time user cannot drag the columnheaders and resize it.....what is the procedure?? i have searched all the properties but none of them help me out to solve this pbm.. this is possible in gridview but how will it be possible in listview....

    Read the article

  • UberCart statistics on products added.

    - by RD
    I want statistics on the products added to carts, but not checked out. I.e. if a user adds a product to his cart, but doesnt actual pay out, how can I see these products that were added? Or maybe even get notifications everytime a product is added?

    Read the article

  • Geocoding Chinese addresses using Google Maps API in Python?

    - by Jack Low
    I have looked into Geopy and googlemaps (http://py-googlemaps.sourceforge.net/) and they both do not work for Chinese addresses. My app is stored on the Google App Engine. What I want to do is to parse a file containing addresses of restaurants in Hong Kong, and then Geocode the addresses and store the Lat and Lng in the datastore. How do I do this?

    Read the article

  • Utilising cssText to set styles with JavaScript

    - by Rajat
    I was going through Nicholas Zakas presentation on JavaScript here : http://www.slideshare.net/nzakas/writing-efficient-javascript (slide number: 89/139) He recommends using cssText property whenever you are setting a bunch of styles through JavaScript. The best solution is obviously adding those styles to a class and then using JS to add the classname to an element.However, in many situations, We resort to just setting the properties directly within JS when the number of properties are low. It seems from his presentation that using cssText property would be more efficient in such scenarios.I tried to look up more on the property but couldn't find much information. Has anyone used the 'cssText' property ? It would be great to have some more technical info on how the property helps.

    Read the article

  • How to insert multiple check-box values inside database when one or more will be left unchecked?

    - by Sally
    I have a form that contains 5 check boxes. The user may select one or more of these check boxes. The user may select 2 and leave 3 unchecked or select 4 and leave one unchecked and so on, in that case how can I write the php/mysql code that will insert the form data into the database. With just one selection it's easy, I would do: $checkbox_value = $_POST['i_agree']; mysql_query("INSERT INTO terms (user, pass, conditions) VALUES ('$user','$pass','$checkbox_value')"); But how can I write this when there are multiple check box options and only one or more of them will be checked? I want to insert them all in one column called "tags" separated by commas.

    Read the article

  • How do I make Chrome's Omnibar behave more like the Firefox Awesome bar?

    - by Agnel Kurian
    One of my favorite features of the Firefox awesome bar is that I can simply type a substring of any URL or page title in my history and it finds all matches sorted by how frequently they were accessed. Example: I simply type "ask" when I want to ask something on stackoverflow.com., "inbox" goes to my GMail Inbox and so on because the substring matches any part of the URL or the page title. Chrome's Omnibar is quite frustrating in this area. I am not able to predict what it's gonna fetch and I seem to have no way to train the thing to do my bidding. I have turned unchecked the option that says: "Use a suggestion service to help complete searches and URLs typed..." but there has been no noticeable improvement. Any clues how I can make the Omnibar behave?

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >