Daily Archives

Articles indexed Sunday January 2 2011

Page 22/27 | < Previous Page | 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Looking for a Magnetic Card Reader with data storage

    - by Omar Sharif
    I am looking for a magnetic card reader with data storage of about 2 GB. This reader be placed in open under a shade, but would be exposed to temperatures from -5 C to 50 C. Job is to swipe customer loyalty cards issued to regular customers of a gas station. Each time they get gas filled, they will swipe their card, to mark their presence. Swiped data be stored in the reader. And on intervals be transferred to a PC lying in the office. The customer visits data be used to award some gifts or benefits to frequently visiting clients. Any ready-made solutions available ? Please advise. Omar

    Read the article

  • Can I Import an updated structure into a MySQL table without losing its current content?

    - by Udi Wertheimer
    We use MySQL tables to which we add new fields from time to time as our product evolves. I'm looking for a way to export the structure of the table from one copy of the db, to another, without erasing the contents of the table I'm importing to. For example say I have copies A and B of a table, and I add fields X,Y,Z to table A. Is there a way to copy the changed structure (fields X,Y,Z) to table B while keeping its content intact? I tried to use mysqldump, but it seems I can only copy the whole table with its content, overriding the old one, or I can use the "-d" flag to avoid copying data (dumping structure only), but this will create an empty table when imported, again overriding old data. Is there any way to do what I need with mysqldump, or some other tool?

    Read the article

  • Query results with no reverse

    - by gruber
    Hi, Ive got table: UserA, UserB, numberOfConnections I would like to write query which returns me only rows that has no reverse I mean or example : for data : 1 2 10 1 3 10 1 5 10 1 6 10 2 6 10 2 5 10 5 1 10 5 2 10 3 1 10 it should return 1 2 10 1 3 10 1 5 10 1 6 10 2 6 10 2 5 10 rows: 5 1 10 5 2 10 3 1 10 arent valid because there are already corresponding 1 5 10 2 5 10 3 1 10 thanks for help bye

    Read the article

  • registration 0.8 alpha activation problem

    - by craphunter
    Got the following error: Exception Type: TypeError at /accounts/account/activate/success/ Exception Value: activate() takes at least 2 non-keyword arguments (1 given) My view: def activate(request, backend, template_name='registration/activation_complete.html', success_url=None, extra_context=None, **kwargs): backend = get_backend(backend) account = backend.activate(request, **kwargs) if account: if success_url is None: to, args, kwargs = backend.post_activation_redirect(request, account) return redirect(to, *args, **kwargs) else: return redirect(success_url) if extra_context is None: extra_context = {} context = RequestContext(request) for key, value in extra_context.items(): context[key] = callable(value) and value() or value return render_to_response(template_name, kwargs, context_instance=context) My url: urlpatterns = patterns('', url(r'^activate/complete/$', direct_to_template, { 'template': 'registration/activation_complete.html' }, name='registration_activation_complete'), # Activation keys get matched by \w+ instead of the more specific # [a-fA-F0-9]{40} because a bad activation key should still get to the view; # that way it can return a sensible "invalid key" message instead of a # confusing 404. url(r'^activate/(?P<activation_key>\w+)/$', activate, { 'backend': 'registration.backends.default.DefaultBackend' }, name='registration_activate'), url(r'^register/$', register, { 'backend': 'registration.backends.default.DefaultBackend' }, name='registration_register'), url(r'^register/complete/$', direct_to_template, { 'template': 'registration/registration_complete.html' }, name='registration_complete'), url(r'^register/closed/$', direct_to_template, { 'template': 'registration/registration_closed.html' }, name='registration_disallowed'), (r'', include('registration.auth_urls')), url(r'^account/activate/(?P<activation_key>\w+)/$', 'registration.views.activate', {'success_url': 'account/activate/success/'}, name='registration_activate2'), url(r'^account/activate/success/$', direct_to_template, {'template': 'registration/activation_complete.html'}, name='registration_activation_complete'), ) What do I do wrong? Thanks!

    Read the article

  • What is the best way to lazy load doubleclick ads that use document.write?

    - by user560585
    Ads requested through via doubleclick often get served from an ad provider network that returns javascript that in turn performs document.write to place ads in the page. The use of document.write requires that the document be open, implying that the page hasn't reached document.complete. This gets in the way of deferring or lazy loading ad content. Putting such code at page bottom is helpful but doesn't do enough to lower all-important "page-loaded" time. Are "friendly iframes" the best we have? Is there any other alternative such as a clever way to override document.write?

    Read the article

  • PHP string manipulation, inside the string

    - by James
    I have string: ABCDEFGHIJK And I have two arrays of positions in that string that I want to insert different things to. Array ( [0] => 0 [1] => 5 ) Array ( [0] => 7 [1] => 9 ) Which if I decided to add the # character and the = character, it'd produce: #ABCDE=FG#HI=JK Is there any way I can do this without a complicated set of substr? Also, # and = need to be variables that can be of any length, not just one character.

    Read the article

  • What is the best way to parse python script file in C/C++ code

    - by alexpov
    I am embedding python in C/C++ program. What I am trying to do is to parse the python script file from the C/C++ program, break the file to "blocks" so that each "block" is an a valid command in python code. Each block I need to put into std::string. For example: #PythonScript.py import math print "Hello Python" i = 0; while (i < 10): print "i = " , i; i = i + 1; print "GoodBye Python" In this script are 5 different "blocks": the first one is "import math;" the second is "print "Hello Python;" the third is "i = 0;" and the fourth is while (i < 10):\n\tprint "i = " , i;\n\ti = i + 1; My knowledge in python is very basic and I am not familiar with the python code syntax. What is the best way to do this, is there any Python C/C++ API function that supports this? why i need it - for GUI purpose. My program , which is writen in C, uses python to make some calculations. I run from C code , using python C API , python script and what i need is a way to capture python's output in my program. I catch it and evrything is ok, the problem is when the script involves user input. What happens is that i capture python's output after the script is finished , therefore, when there is an input command in the script i get a black screen .... i need to get all the printings before the input command. The first solution i tried is to parss the script to valid commands and run each comand, one after the other , seperatly .... for this i need to pars the script and deside what is a command and what is not ... The question is : what is the best way to do this and if there is somthing that allready does ?

    Read the article

  • Is it possible to use the ScalaTest BDD syntax in a JUnit environment?

    - by ebruchez
    I would like to describe tests in BDD style e.g. with FlatSpec but keep JUnit as a test runner. The ScalaTest Quick Start does not seem to show any example of this: http://www.scalatest.org/getting_started_with_junit_4 I first tried naively to write tests within @Test methods, but that doesn't work and the assertion is never tested: @Test def foobarBDDStyle { "The first name control" must "be valid" in { assert(isValid("name·1")) } // etc. } Is there any way to achieve this? It would be even better if regular tests can be mixed and matched with BDD-style tests.

    Read the article

  • java swing, simulate JTable terminateEditOnFocusLost behaviour

    - by blow
    Hi all, i'm using putClientProperty("terminateEditOnFocusLost", Boolean); to make jtable end editing and clear current selected rows when it lose focus or when simply click over an other GUI component. This is very useful, but with "terminateEditOnFocusLost" there are some strange behaviours if it is used with editCellAt and changeSelection. There are also some undesiderable TableModelEvents fired for some fake table updates. So, im looking for an hack to simulate "terminateEditOnFocusLost without using it, is this possibile? Thanks all.

    Read the article

  • Entity Framework - Self Tracking Objects - how to reset client side?

    - by David
    I am using wcf with self tracking entity framework objects. On the client side i have bound an entity to an edit form (which has multiple textboxes and comboboxes). After the user hits Save, the entity is sent through wcf to the server wcf service which will attempt to save the entity. If there is a failure (say a network failure), I need to reset the current entity back to original values. How best can I do this client side? (I recognize with Self Tracking objects there is a property OriginalValues however that collection seems to have count=0) so not sure how to get the original values? Thanks-

    Read the article

  • Libraries for making a voice chat application

    - by Eric
    My development team is going to build a voice chat application. Our plan is to use a pre-made library just for this purpose, but we haven't found any good one after days of searching the internet, so I thought I would consider a question here! So the question is: What library / project do you recommend? We are deadly serious with this, so it needs to be a good working one. Preferable an open-source one as well. We have been looking at some XMPP libraries and projects, but none seems to be up-to-date, tested and well-documented.

    Read the article

  • What's the best NAME for "quick" Category you add to a file?

    - by Joe Blow
    So the other day I was sick of typing out repetetive addTarget:action:forControlEvents:s, and macros are only entertaining for so long, so I did this: @implementation UIControl (xx) -(void)addTarget:(id)target action:(SEL)action { [self addTarget:target action:action forControlEvents:UIControlEventTouchUpInside]; } @end *and simply added it at the top of the .m file in question. Works great of course, but notice the "xx".* What's the best thing to NAME a "quick" Category like this? Annoyingly, it appears you can not leave the xx blank - it would then become an "Extension" (which, incidentally, I don't understand at all). I was thinking maybe: a single underscore the name of the class again identically "quick" perhaps the name of the class in this file (as in "quick extra routines for UIControl in CherryBomb") - so it would be UIControl(CherryBomb), ie, remind you that these extra routines are handy for CherryBomb "x" your or your company's initials (use the same "quick" Category name everywhere) "ThisTextNeverUsedAnywhere" By the way, I've been assuming that Categories only happen in the files that see them (CherryBomb.m in the example) - they do not from then on apply app-wide. ie they only apply where you include the header file (UIControl+NattyStuff) or in the "quick" case only in the file to which one adds the text. (By the way ... it appears you do not actually need to include an interface for such a Category, i.e. you can omit... //you can actually get away without these lines... //#import <UIKit/UIControl.h> //@interface UIControl (x) //-(void)addTarget:(id)target action:(SEL)action; //@end ... that part and it works fine.) For people who love Categories, and who doesn't, what's the answer to this troubling question? What should you name a "quick" Category where the name is never going to be referenced again and is irrelevant? Is "_" a solution?

    Read the article

  • Centering contentplaceholders

    - by gh9
    I have a contentplaceholder which needs to be centered (as close to absolute as possible) to the center of the page. The issue I am having is when, the browser moves to different resolutions the centering is thrown off. I have tried using divs and tables. I have switched out the precent with em units, and still no workie. Any help would be greatly appreciated. My end goal is to have the contentplaceholder always be in the center of page regardless of the resolution of the monitor <div style="width:20%"/> <div style="width:60"> contentplaceholercode </div> <div style="width:20%"/> <table> <tr > <td style="width:20%"> </td> <td style="width:60> </td> <td style="width:20%"> </td> </tr> </table> code for master and code for content page <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Master.master.cs" Inherits="WorkRecordr.Master" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <script src="Assets/Scripts/Jqeury1.4.4.js" type="text/javascript"></script> <title></title> <style type="text/css"> body { background-color: #326598; } .outer { width: 100%; border: solid 1px gray; padding: 1px; } .inner { border: solid 1px gray; width: 70%; margin-left: auto; margin-right: auto; } </style> </head> <body> <div style="text-align: center"> <asp:ContentPlaceHolder ID="head" runat="server"> </asp:ContentPlaceHolder> </div> <form id="form1" runat="server"> <div class="outer"> <div class="inner"> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </div> </form> </body> </html> <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="WorkRecordr.test" MasterPageFile="~/Master.Master" %> <asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> aaaaaaaaa***aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa***aaaaaaaaaaaaaaaa </asp:Content>

    Read the article

  • How to use SOCI C++ Database library?

    - by NeDark
    I'm trying to implement soci in my program but I don't know how. I'm using C++ on linux, on a project on netbeans. I have followed the steps in http://soci.sourceforge.net/doc/structure.html to install it, and I tried to copy the files soci.h from /src/core and soci-mysql.h from /src/backends/mysql in my proyect but it gives compilation error (these files include other soci files, but it's illogical to copy all files into the directory...). I have read the guide several time but I don't understand what I'm doing wrong, the examples only include these files. Thanks. Edit: I have given more information in a comment below the answer. I don't know what steps I have to do to implement soci.

    Read the article

  • How and when to log account access login with PHP?

    - by Nazgulled
    I want to implement a basic login system in some PHP app where no cookies will be involved. I mean, the user closes the browser and the login expires, it will remain active during the browser session (or if the user explicitly logs out) otherwise. I want to log all this activity and I'm thinking that every time the user refreshes the page, opens a different link or logs out, I record that time as the last access made by that user, overwriting the previous access log. But my problem is when and how should I insert another record into the database instead of overwriting the last one? Should I just define a timeout and if the last access was made above that timeout, another log should be inserted into the database? Should the session expire too after that timeout? Or is there a better way? Ideally, I would like to log the "log out action" when the browser was closed, but I don't think there's a way to detect that is there? Suggestions?

    Read the article

  • Camera Stream in Flash Problem

    - by Peter
    Please help me fill the question marks. I want to get a feed from my camera and to pass it to the receive function. Also in flash builder(in design mode) how do I put elements so they can play a camera feed?? Because as it seems VideoDisplay just doesn't work public function receive(???:???):void{ //othercam is a graphic element(VideoDisplay) othercam.??? = ????; } private function send():void{ var mycam:Camera = Camera.getCamera(); //mycam2.attachCamera(mycam); //sendstr is a stream we send sendstr.attachCamera(mycam); //we pass mycam into receive sendstr.send("receive",mycam); }

    Read the article

  • filtering for multiple values on one column. All values must exist, else - return zero

    - by Andrew
    Hello All, I would like to filter one column in a table for couple values and show results only if all those values are there. If one or more is missing, then return zero results. example table +----+--------+----------+ | id | Fruit | Color | +----+--------+----------+ | 1 | apple | red | | 2 | mango | yellow | | 3 | banana | yellow | +----+--------+----------+ example "wrong" code: (this must return 3 rows) select Fruit FROM table WHERE Color = red AND Color = yellow but select Fruit FROM table WHERE Color = red AND Color = green must return 0 rows. (If i use select Fruit FROM table WHERE Color = red OR Color = green i get 1 row which is not what i need) I am using PHP with form where user checks different checkboxes that represent different values of the same column. So when he selects multiple checkboxes, all those values should be in the result set, otherwise no result should be given. Thank you, Andrew

    Read the article

  • C# / Entity Framework / Linq question regarding calling a method when a class is accessed...

    - by Daniel
    So this is probably really basic, but I'm fairly new to all this. I am using Entity Framework with POCO entities. I want to call a method when a class property is set. I am trying to build an advertisement platform. I have a Customer class, a Venue class and an Advertisement class. I have my indexes set up in such a way that I can call customer.venue. However, I want to be able to call Customer.Venue.CurrentAdvertisement and have it execute a method (if CurrentAdvertisement is null) and return the current advertisement. I know I can explicitly set it every time, but I want to be able to override my classes so that whenever the CurrentAdvertisement property is accessed via LINQ it runs that method to return an ad. In order to do this I need to pass the Venue class a variable (venue name).

    Read the article

  • Apress Books - 4 - Introducing Visual C# 2010 - Further comments

    - by TATWORTH
    Apress Books Introducing Visual C# 2010 - ISBN 978-1-4302-3171-4 Having read through parts 1 and 2 of this 4 -part book, I am very impressed by its practical approach to C#. I cannot improve on the by-line "Get started on your C# journey with an expert by your side leading by example" Adam Freeman teaches C# by precept and example. I suspect he drives a Volvo C30 as it comes up in many of the code examples!  Throughout the book there are numerous links back and forth so as to avoid overcomplicating the current topic. I have have no hesitation in recommending this book both to programmers starting out with C# and to the seasoned professional. It is a book that should be on every C# development team's book shelf. There are a few typographical errors in the book, one of which has already made it to the errata, however these are very minor and do not detract from the usefulness of this book.

    Read the article

  • apache2 Webdav using VirtualDocumentRoot

    - by picca
    I'm trying to get up dynamical WebDav on my virtual hosts <VirtualHost *:80> # http://www.example.com/test.txt -> /var/www/example.com/www/test.txt VirtualDocumentRoot /var/www/%-2.0.%-1.0/%-3+/ <Location /webdav> Dav On AuthType Basic AuthName "example.com" AuthUserFile /var/www/[PROBLEM-1]/passwd.dav Require valid-user </Location> </VirtualHost> Is there any way I can set dynamically PROBLEM-1 placeholder based on whatever comes with *HTTP_HOST*? More precisely part of it? Example: HTTP_HOST = www.example.com - PROBLEM-1 = example.com HTTP_HOST = example.com - PROBLEM-1 = example.com What I'm trying to do here is to load dav passwd file dynamically based on which domain is requested. It is something like "groups" if you wish. So that owner of domainA is not allowed to access files of domainB. So maybe there is some other solution based on AuthGroupFile directive?

    Read the article

  • failing to achive tunneling to fresh ubuntu 10.04 server

    - by user65297
    I've just set up a new 10.04 server and can't get the tunneling to work. local machine > ssh -L 9090:localhost:9090 [email protected] login success, but thereafter trying tunnel from local browser, http://127.0.0.1:9090 echo at server terminal: channel 3: open failed: connect failed: Connection refused auth.log sshd[24502]: error: connect_to localhost port 9090: failed. iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Trying 9090 at server (links http://xx.xxx.xx.xx:9090 works) sshd_config is identical to previous 8.04 server, working fine. What's going on? Thankful for any input. Regards, //t

    Read the article

  • Run init.d script in the context of the current user session.

    - by akellehe
    I'd like to run a script in init.d (on Fedora) in the context of the user session I'm logging in as. I have a script called keyboard_deadkeys I wrote to set some deadkeys on my keyboard. The script is very simple: #!/bin/bash /usr/bin/xmodmap /home/julie/keymappings I put it in the directory /etc/init.d so it will run at boot time. It is also in /etc/rc.d/init.d I changed the permissions to a+rwx for good measure. When I boot; the deadkeys aren't set in the user's session. When I then run the script manually; the keys are set. How can I rectify this?

    Read the article

  • Alternatives to Remote Storage Service under Windows Server 2008 R2

    - by ObligatoryMoniker
    I am working on setting up a new Windows Server 2008 R2 file server for our organization and felt like the functionality offered by the Remote Storage Service in previous versions of Windows would meet our needs for segmenting our data so that we can have different backup schedules for different tiers of data based on the frequency of that data being used and updated. What software exists that provide this same or similar functionality for Server 2008 R2?

    Read the article

  • New harddrives failing within weeks.

    - by Jason Kealey
    I've experienced 8 hard disk failures in 3 months and have tried many things to solve the issue permanently but I have failed. I would like to know if you have any advice for me. System was running Win XP on an Asus P5W-DH Deluxe. I have setup a RAID-1 array. I started out with 2 x 500 GB 7200RPM Western Digital drives. One died. I took it out to RMA it. On the same day, the router was fried. Assumed a power surge occurred; connected an older UPS to protect the system. Once I got my hands on an identical disk, I installed it. The RAID array was rebuilt. A few days later, the other one died. Assumed the rebuild caused it to fail. Took it out for RMA. Before the other one arrived, the remaining one died. I then discovered I could re-enable them using the Intel Matrix Storage Manager. I re-enabled both and the system seemed fine for a week, until both died again. I got two new 1.5 TB 7200RPM Seagate drives and re-installed Windows 7. Also replaced the UPS and power supply. They both died again. The voltage on the plug is stable between 120 and 122V as per the UPS. None of the other devices have had any problems (monitors, etc.). At this point, I see two options: a) electrical issue in the house that was, for some reason, not blocked by the UPS. b) something else inside the system causing surges? motherboard? onboard raid controller? Failures happen fairly quickly, between 2 and 14 days after I fix the previous issue. I just gotten a new computer (Core i7) to replace it. If it is stable, I can determine that b) was the problem. If it fries its hard drive again, I can determine that it is an electrical issue in the house. Do you have any other thoughts? Any tools I can run on the drives that failed to get more information about the original SMART event history?

    Read the article

  • Despeckle line art

    - by Dour High Arch
    We have a number of line-art charts unfortunately saved as JPEGs. They are now riddled with distracting compression artifacts or "speckles". Is there any way of removing these? I do not have the original files and it will be very difficult to recreate them. I am running Windows 7 and tried Paint.Net; none of the filters help. Posterize washed out all the colors and leaves the speckles. Blur makes text unreadable. Noise Reduction wrecks antialiasing of curved lines, and perversely enhances the speckles, making them look like checkerboards. Yes, I have Googled for software to do this; there are many programs that advertise despeckling but, after my experience with Paint.Net, do not want to experiment with applications that show no before and after images. The only example I have seen that does what I want is from a Photoshop tutorial. I have dozens of files and the tutorial requires considerable manual fine-tuning. I would prefer to automate or batch-process this task. Commercial apps are fine, but I do not want to spend over $600 and learning a complex program for a single task.

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27  | Next Page >