Daily Archives

Articles indexed Wednesday January 5 2011

Page 2/35 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Fixing a multi-threaded pycurl crash.

    - by Rook
    If I run pycurl in a single thread everything works great. If I run pycurl in 2 threads python will access violate. The first thing I did was report the problem to pycurl, but the project died about 3 years ago so I'm not holding my breath. My (hackish) solution is to build a 2nd version of pycurl called "pycurl_thread" which will only be used by the 2nd thread. I downloaded the pycurl module from sourceforge and I made a total of 4 line changes. But python is still crashing. My guess is that even though this is a module with a different name (import pycurl_thread), its still sharing memory with the original module (import pycurl). How should I solve this problem? Changes in pycurl.c: initpycurl(void) to initpycurl_thread(void) and m = Py_InitModule3("pycurl", curl_methods, module_doc); to m = Py_InitModule3("pycurl_thread", curl_methods, module_doc); Changes in setup.py: PACKAGE = "pycurl" PY_PACKAGE = "curl" to PACKAGE = "pycurl_thread" PY_PACKAGE = "curl_thread" Here is the seg fault i'm getting. This is happening within the C function do_curl_perform(). *** longjmp causes uninitialized stack frame ***: python2.7 terminated ======= Backtrace: ========= /lib/libc.so.6(__fortify_fail+0x37)[0x7f209421b537] /lib/libc.so.6(+0xff4c9)[0x7f209421b4c9] /lib/libc.so.6(__longjmp_chk+0x33)[0x7f209421b433] /usr/lib/libcurl.so.4(+0xe3a5)[0x7f20931da3a5] /lib/libpthread.so.0(+0xfb40)[0x7f209532eb40] /lib/libc.so.6(__poll+0x53)[0x7f20941f6203] /usr/lib/libcurl.so.4(Curl_socket_ready+0x116)[0x7f2093208876] /usr/lib/libcurl.so.4(+0x2faec)[0x7f20931fbaec] /usr/local/lib/python2.7/dist-packages/pycurl.so(+0x892b)[0x7f209342c92b] python2.7(PyEval_EvalFrameEx+0x58a1)[0x4adf81] python2.7(PyEval_EvalCodeEx+0x891)[0x4af7c1] python2.7(PyEval_EvalFrameEx+0x538b)[0x4ada6b] python2.7(PyEval_EvalFrameEx+0x65f9)[0x4aecd9]

    Read the article

  • How to log off multiple MembershipUsers that are not the current user?

    - by Sgraffite
    I'm using the MembershipProvider that is part of the MVC2 default project. I'd like to be able to take a list of user names, and log the users off, and destroy their session if needed. The closest I can seem to come is this: foreach(string userName in UserNames) { MembershipProvider MembershipProvider = new MembershipProvider(); MembershipUser membershipUser = MembershipProvider.GetUser(userName, true); Session.Abandon(); FormsAuthentication.SignOut(); } I think I need to use a session and/or signout method related the user I want to log out, but I am unsure where those would be. What is the proper way to do this?

    Read the article

  • Getting error 400 / 404 - HttpUtility.UrlEncode not encoding full string?

    - by Justin808
    Why do the following URLs give me the IIS errors below: A) http://192.168.1.96/cms/View.aspx/Show/Small+test' A2) http://192.168.1.96/cms/View.aspx/Show/Small%20test' <-- this works, but is not the result from HttpUtility.UrlEncode() B) http://192.168.1.96/cms/View.aspx/Show/'%26$%23funky**!!~''+page Error for A: HTTP Error 404.11 - Not Found The request filtering module is configured to deny a request that contains a double escape sequence. Error for B: HTTP Error 400.0 - Bad Request ASP.NET detected invalid characters in the URL. The last part of the URL after /Show/ is the result after the text is being sent through HttpUtility.UrlEncode() so, according to Microsoft it is URL Encoded correctly. If I user HttpUtility.UrlPathEncode() rather than HttpUtility.UrlEncode() I get the A2 results. But B ends up looking like: http://192.168.1.96/TVCMS-CVJZ/cms/View.aspx/Show/'&$#funky**!!~''%20page which is still wrong. Does Microsoft know how to URL Encode at all? Is there a function someone has written up to do it the correct way?

    Read the article

  • how do I set margins in Prawn in ruby?

    - by Angela
    This is what I have so far, but I need to set margins: def send_fax 22 contact = Contact.find_by_id(self.contact_id) 23 24 pdf = Prawn::Document.new 25 pdf.font "Times-Roman" 26 pdf.move_down(20) 27 pdf.text "ATTN: #{contact.first_name} #{contact.last_name}", :size => 24, :style => :bold 28 pdf.text "RE: #{self.subject}" 29 pdf.move_down(20) 30 31 pdf.text "#{self.body}" 32 33 OutboundMailer.deliver_fax_email(contact, self, pdf) 34 35 end

    Read the article

  • Including additional DLL’s in an MSBuild script for Module Packaging

    - by Chris Hammond
    Late last year I created a blog post and video about a new version of the module development template that I released on Codeplex . This new template uses MSBuild scripts instead of NANT scripts to automate the packaging process for the modules built with the template. The MSBuild script works well out of the box, to package your module you simple change into RELEASE mode and then execute the build. If your project contains references to DLLs (in the website’s BIN folder) that you also need to package...(read more)

    Read the article

  • Displaying a Paged Grid of Data in ASP.NET MVC

    This article demonstrates how to display a paged grid of data in an ASP.NET MVC application and builds upon the work done in two earlier articles: Displaying a Grid of Data in ASP.NET MVC and Sorting a Grid of Data in ASP.NET MVC. Displaying a Grid of Data in ASP.NET MVC started with creating a new ASP.NET MVC application in Visual Studio, then added the Northwind database to the project and showed how to use Microsoft's Linq-to-SQL tool to access data from the database. The article then looked at creating a Controller and View for displaying a list of product information (the Model). Sorting a Grid of Data in ASP.NET MVC enhanced the application by adding a view-specific Model (ProductGridModel) that provided the View with the sorted collection of products to display along with sort-related information, such as the name of the database column the products were sorted by and whether the products were sorted in ascending or descending order. The Sorting a Grid of Data in ASP.NET MVC article also walked through creating a partial view to render the grid's header row so that each column header was a link that, when clicked, sorted the grid by that column. In this article we enhance the view-specific Model (ProductGridModel) to include paging-related information to include the current page being viewed, how many records to show per page, and how many total records are being paged through. Next, we create an action in the Controller that efficiently retrieves the appropriate subset of records to display and then complete the exercise by building a View that displays the subset of records and includes a paging interface that allows the user to step to the next or previous page, or to jump to a particular page number, we create and use a partial view that displays a numeric paging interface Like with its predecessors, this article offers step-by-step instructions and includes a complete, working demo available for download at the end of the article. Read on to learn more! Read More >

    Read the article

  • Network Printer Issue.

    - by goldenmean
    Hello, I have a Windows-7 Desktop at office. There is a network printer Dell MFP2335dn which is installed on this dekstop. The printer worked fine for me(I could print from my desktop), sometime back but recently i am not been able to print. When i give a print job, it stays in the queue for a long time, nothing gets printed. When i see the status of the printer in "Devices and Printers", it says - Offline. I removed the printer installed on my Desktop, and tried to install the drivers downloaded from Dell website: http://support.euro.dell.com/support/downloads/download.aspx?c=uk&l=en&s=gen&releaseid=R241894&formatcnt=0&libid=0&typeid=-1&dateid=-1&formatid=-1&source=-1&fileid=349205 But still the same problem. I don't know what to do more to resolve this. Any pointers about how to resolve this error and get printing done. thanks, -AD.

    Read the article

  • Mac OS X: All bootcamp options start Windows

    - by Brian Heylin
    I just installed the latest security update on Mac OS X (installed on 2-10-2010). On restart my Mac booted in Windows 7, which I had installed previously and was set not to boot by default. I tried to restart holding the alt key, and selected the Mac OS X partition, but still the Windows 7 partition boots. It does not matter what partition I choose, Windows 7 always boots. I took a look in the OS X partition and noticed that the admin home folder is empty, or at least Windows is not showing any files there. There is another user on OS X and I can see their files no problem. This has me stumped, has anyone any suggestions for a finding a solution?

    Read the article

  • Can we increase Torrent share ratio using Local Peer Discovery?

    - by Jagira
    I just want to know whether this is a flaw or not in Bittorrent system. Let us assume that I am member of a Private Torrent site which requires me to maintain a specific upload to download ratio. Will this work: I create a torrent of a large file say [ Fedora Linux ~ 4 GB ] and upload it to the tracker I download the same torrent using my ID and start it on another machine on LAN or a Virtual machine Both clients have Local Peer Discovery enabled, so they will find 'em [ not via DHT ] and start x'ferring data using LAN bandwidth at LAN speeds. Though both uploads and downloads will increase, my ratio will also increase If I reiterate the entire process 'n' times, the numerator in the "RATIO" i.e Upload will become so large that the effect of downloads on ratio will become less. I want to know whether this is legitimate???

    Read the article

  • How do private BitTorrent trackers monitor how much users upload/download?

    - by Jon-Eric
    From Wikipedia: Most private trackers monitor how much users upload or download, and in most situations, enforce a minimum upload-to-download ratio. How exactly can a tracker figure out how much data was uploaded and downloaded by each user? My understanding is that a BitTorrent tracker is merely a registry of users that are currently downloading/seeding and that peers, once connected, transfer data directly. So I wouldn't think that the tracker would know anything about the amount of data transferred, much less, where it came from.

    Read the article

  • Is there a free, lightweight iTunes replacement for Windows?

    - by elsni
    Related: Is there an alternative to iTunes? (for Windows or Mac) thats free? I'm looking for a free, lightweight iTunes replacement for my Windows XP Netbook. iTunes itself is slow and bloated. The software should be able to read the iTunes library, espeacially the ratings of the songs and the intelligent playlists. I don't need the sync to an iPod because I don't own one, I used iTunes only as a jukebox. I also don't need the store, the podcasts and all the other things iTunes provides. Does someone know a good alternative?

    Read the article

  • How do I know if I have KMS enabled?

    - by Attila Oláh
    How can I check if KMS is enabled in my kernel? I've compiled mine with KMS radeon modeset defaulting to 1, but I still suspect that it is not enabled. EDIT: aatiis@aiur ~ $ dmesg | grep drm [drm] Initialized drm 1.1.0 20060810 [drm] Initialized radeon 1.33.0 20080528 for 0000:01:05.0 on minor 0 [drm] Setting GART location based on new memory map [drm] Loading RS780 CP Microcode [drm] Resetting GPU [drm] writeback test succeeded in 1 usecs EDIT 2: aatiis@aiur ~ $ glxinfo | grep render IRQ's not enabled, falling back to busy waits: 2 0 direct rendering: Yes OpenGL renderer string: Mesa DRI R600 (RS780 9612) 20090101 TCL aatiis@aiur ~ $ sudo grep -i kms /var/log/Xorg.0.log [ 57.201] (II) [KMS] drm report modesetting isn't supported.

    Read the article

  • Enable multiple audio output on Windows 7

    - by patrick
    For Windows 7, 64 bit: I have a digital SPDIF output to my stereo, which controls speakers in other rooms. I also have a set of speakers connected to the regular audio jack at the computer. This allows me to send music to the kitchen while my child plays games on the computer. Works great. Except when I'm playing games and still want to listen to music. ;-D I know I can manually switch WMP to play through the speakers instead of SPDIF, but I was wondering if there's any way to enable simultaneous audio out in Windows 7? Virtual Audio Card is a non-starter because I'm running 64 bits and the VAC driver isn't signed.

    Read the article

  • Balancing dependency injection with public API design

    - by kolektiv
    I've been contemplating how to balance testable design using dependency injection with providing simple fixed public API. My dilemma is: people would want to do something like var server = new Server(){ ... } and not have to worry about creating the many dependencies and graph of dependencies that a Server(,,,,,,) may have. While developing, I don't worry too much, as I use an IoC/DI framework to handle all that (I'm not using the lifecycle management aspects of any container, which would complicate things further). Now, the dependencies are unlikely to be re-implemented. Componentisation in this case is almost purely for testability (and decent design!) rather than creating seams for extension, etc. People will 99.999% of the time wish to use a default configuration. So. I could hardcode the dependencies. Don't want to do that, we lose our testing! I could provide a default constructor with hard-coded dependencies and one which takes dependencies. That's... messy, and likely to be confusing, but viable. I could make the dependency receiving constructor internal and make my unit tests a friend assembly (assuming C#), which tidies the public API but leaves a nasty hidden trap lurking for maintenance. Having two constructors which are implicitly connected rather than explicitly would be bad design in general in my book. At the moment that's about the least evil I can think of. Opinions? Wisdom?

    Read the article

  • What would be a good topic for research on "edge of multiple processors / computers programming" topic?

    - by Kabumbus
    This is a subjective discussion so we can express our dreams and hopes here. A "topic" must be like a task with point to have as end result a software poduct. A "topic" must be mainly about "Software engineering", "Algorithm and data structure concepts" and perhaps "Design patterns". I mean let us try to look what is not already there? What can be developed in fiew month and give a breakthrue / start a new leap / show somethig not realized before in science of f multiple computers programming? What i see is already there: LAN / wire and other infrastractural programms for connecting on device level MPI/ Bit torrent/Jabber protocols / APIs / servers for messaging on top Boost and analogs on evry OS in most languages for multithreading there are lots of CUDA like on computer frameworks for fast calculating on computers GPUs What I personally do not see out there is a crossplatform framework for multiple processes interaction. Meaning one that would allow easy creation of multyple processes running in paralell inside one hoster app on one machine. In level not harder than needed for threads creation (so no seprate server apps - just one lib doing it all) Is there ny such lib and what can you propose for research topic?

    Read the article

  • How do you limit root partition disk access to allow drive to go into stanby mode?

    - by Casey
    When there are no users on my system, I would like the hard disk to spindown to low-power state. I realize that this might not be 100% achievable for a straight 24 hours, but it seems reasonable that the system could remain idle for a few hours at a time when it is not in use. My system is headless and running a limited number of services. The primary services are: exim4, mythtv-backend, nfs, samba, cups, apt-cacher-ng Assume that drives are already enabled to go into standby mode. Also, its not acceptable to increase the write-back timeout, since my system is not on a UPS.

    Read the article

  • HTML5 Game (Canvas) - UI Techniques?

    - by Jason L.
    Hi! I'm in the process of building a JavaScript / HTML5 game (using Canvas) for mobile (Android / iPhone/ WebOS) with PhoneGap. I'm currently trying to design out how the UI and playing board should be built and how they should interact but I'm not sure what the best solution is. Here's what I can think of - Build the UI right into the canvas using things like drawImage and fillText Build parts of the UI outside of the canvas using regular DOM objects and then float a div over the canvas when UI elements need to overlap the playing board canvas. Are there any other possible techniques I can use for building the game UI that I haven't thought of? Also, which of these would be considered the "standard" way (I know HTML5 games are not very popular so there probably isn't a "standard" way yet)? And finally, which way would YOU recommend / use? Many thanks in advance!

    Read the article

  • algorithm to find longest non-overlapping sequences

    - by msalvadores
    I am trying to find the best way to solve the following problem. By best way I mean less complex. As an input a list of tuples (start,length) such: [(0,5),(0,1),(1,9),(5,5),(5,7),(10,1)] Each element represets a sequence by its start and length, for example (5,7) is equivalent to the sequence (5,6,7,8,9,10,11) - a list of 7 elements starting with 5. One can assume that the tuples are sorted by the start element. The output should return a non-overlapping combination of tuples that represent the longest continuos sequences(s). This means that, a solution is a subset of ranges with no overlaps and no gaps and is the longest possible - there could be more than one though. For example for the given input the solution is: [(0,5),(5,7)] equivalent to (0,1,2,3,4,5,6,7,8,9,10,11) is it backtracking the best approach to solve this problem ? I'm interested in any different approaches that people could suggest. Also if anyone knows a formal reference of this problem or another one that is similar I'd like to get references. BTW - this is not homework. Edit Just to avoid some mistakes this is another example of expected behaviour for an input like [(0,1),(1,7),(3,20),(8,5)] the right answer is [(3,20)] equivalent to (3,4,5,..,22) with length 20. Some of the answers received would give [(0,1),(1,7),(8,5)] equivalent to (0,1,2,...,11,12) as right answer. But this last answer is not correct because is shorter than [(3,20)].

    Read the article

  • How to test Text Search accuracy and efficiency?

    - by DEN
    I have created a web application. One of the feature is text search which perform the boolean operator ( NOT, AND, OR) as well. However, I have no idea on calculating the search's accuracy and efficiency. For example: 1 . Probe identification system for a measurement instrument 2 . Pulse-based impedance measurement instrument 3 . Millimeter with filtered measurement mode when the user key in will return the result as below input :measurement instrument Result: 1,2 input : measurement OR instrument NOT milimeter Result: 1,2,3 so, i have no idea on what issue and what algorithm to calculate on the accuracy and efficiency of the text search.. anyone have any idea on that?

    Read the article

  • Embed Git Commit Log in Rails App?

    - by Andrew
    So, I have a 'development blog' in a rails app I'm working on right now. I'm using Git for version control and deployment (although right now I'm the only person working on it). Now, when I make changes in Git I put a pretty decent log entry about what I've done. I'd love to have the Git commit log automatically posted to the development blog -- or otherwise available for others to read within the deployed site. Is there an automated way to pull the Git Commit Log into a view in a rails app?

    Read the article

  • Contacts activity doesn't return data

    - by Mike
    In my app I simply open the list of activities and when a contact is clicked I attempt to retrieve the name of the contact selected and put it into a string. The app crashes in the onActivityResult() function. I do have the READ_CONTACTS permission set. /** * Opens the contacts activity */ public void openContacts() { Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI); startActivityForResult(intent, PICK_CONTACT); } @Override public void onActivityResult(int reqCode, int resultCode, Intent data) { super.onActivityResult(reqCode, resultCode, data); switch (reqCode) { case (PICK_CONTACT) : if (resultCode == Activity.RESULT_OK) { Uri contactData = data.getData(); Cursor c = managedQuery(contactData, null, null, null, null); //NullPointerException thrown here, line 102 if (c.moveToFirst()) { String name = c.getString(c.getColumnIndexOrThrow(People.NAME)); FRIEND_NAME = name; showConfirmDialog(name); } } break; } } The following logcat error logs are returned: Any help is appreciated. Thanks

    Read the article

  • How to give weight to full matches over partial matches (PostgreSQL)

    - by kagaku
    I've got a query that takes an input searches for the closet match in zipcode/region/city/metrocode in a location table containing a few tens of thousands of entries (should be nearly every city in the US). The query I'm using is: select metrocode, region, postalcode, region_full, city from dv_location where ( region ilike '%Chicago%' or postalcode ilike '%Chicago%' or city ilike '%Chicago%' or region_full ilike'%Chicago%' ) and metrocode is not null Odd thing is, the results set I'm getting back looks like this: metrocode;region;postalcode;region_full;city 862;CA;95712;California;Chicago Park 862;CA;95712;California;Chicago Park 602;IL;60611;Illinois;Chicago 602;IL;60610;Illinois;Chicago What am I doing wrong? My thinking is that Chicago would have greater weight than Chicago Park since Chicago is an exact match to the term (even though I'm asking for a wildcard match on the term).

    Read the article

  • Framework/tool for processing C++ unit tests with numerical output

    - by David Claridge
    Hi, I am working on a C++ application that uses computer vision techniques to identify various types of objects in a sequence of images. The (1000+) images have been hand-classified, so we have an XML file for each image containing a description of where the objects are actually located in the images. I would like to know if there is a testing framework that can understand/graph results from tests that are numeric, in this case some measure of the error in the program's classification of the images, rather than just pass/fail style unit tests. We would like to use something like CDash/CTest for running these automated tests, and viewing over time how improvements to the vision algorithms are causing the images to be more correctly classified. Does anyone know of a tool/framework that can do this?

    Read the article

  • How can I increment a Smarty variable?

    - by alex
    I am not usually a Smarty guy, so I'm a bit stuck. I want to echo the index of an array, but I want to increment it each time I echo it. This is what I have... <ul> {foreach from=$gallery key=index item=image} <li> <img src="{$image}" alt="" id="panel-{$index++}" /> </li> {/foreach} </ul> It doesn't work. Is the best way to do this to pre-process the array before handing it to Smarty? Is there a way I can do this using Smarty?

    Read the article

  • How do I add code automatically to a derived function in C++

    - by Ian
    I have code that's meant to manage operations on both a networked client and a server, since there is significant overlap between the two. However, there are a few functions here and there that are meant to be exclusively called by the client or server, and accidentally calling a client function on the server (or vice versa) is a significant source of bugs. To reduce these sorts of programming errors, I'm trying to tag functions so that they'll raise a ruckus if they're misused. My current solution is a simple macro at the start of each function that calls an assert if the client or server accesses members they shouldn't. However, this runs into problems when there are multiple derived instances of classes, in that I have to tag the implementation as client or server side in EVERY child class. What I'd like to be able to do is put a tag in the virtual member's signature in the base class, so that I only have to tag it once and not run into errors by forgetting to do it repeatedly. I've considered putting a check in a base class implementation and then referring to it with something like base::functionName, but that runs into the same issue as far as needing to manually add the function call to every implementation. Ideally, I'd be able to have parent versions of the function called automatically like default constructors do. Does anybody know how to achieve something like this in C++? Is there an alternate approach I should be considering? Thanks!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >