Daily Archives

Articles indexed Friday April 23 2010

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

  • Python: list and string matching

    - by pete
    Hi All, I have following: temp = "aaaab123xyz@+" lists = ["abc", "123.35", "xyz", "AND+"] for list in lists if re.match(list, temp, re.I): print "The %s is within %s." % (list,temp) The re.match is only match the beginning of the string, How to I match substring in between too.

    Read the article

  • Are free operator->* overloads evil?

    - by Potatoswatter
    I was perusing section 13.5 after refuting the notion that built-in operators do not participate in overload resolution, and noticed that there is no section on operator->*. It is just a generic binary operator. Its brethren, operator->, operator*, and operator[], are all required to be non-static member functions. This precludes definition of a free function overload to an operator commonly used to obtain a reference from an object. But the uncommon operator->* is left out. In particular, operator[] has many similarities. It is binary (they missed a golden opportunity to make it n-ary), and it accepts some kind of container on the left and some kind of locator on the right. Its special-rules section, 13.5.5, doesn't seem to have any actual effect except to outlaw free functions. (And that restriction even precludes support for commutativity!) So, for example, this is perfectly legal (in C++0x, remove obvious stuff to translate to C++03): #include <utility> #include <iostream> #include <type_traits> using namespace std; template< class F, class S > typename common_type< F,S >::type operator->*( pair<F,S> const &l, bool r ) { return r? l.second : l.first; } template< class T > T & operator->*( pair<T,T> &l, bool r ) { return r? l.second : l.first; } template< class T > T & operator->*( bool l, pair<T,T> &r ) { return l? r.second : r.first; } int main() { auto x = make_pair( 1, 2.3 ); cerr << x->*false << " " << x->*4 << endl; auto y = make_pair( 5, 6 ); y->*(0) = 7; y->*0->*y = 8; // evaluates to 7->*y = y.second cerr << y.first << " " << y.second << endl; } I can certainly imagine myself giving into temp[la]tation. For example, scaled indexes for vector: v->*matrix_width[2][5] = x; Did the standards committee forget to prevent this, was it considered too ugly to bother, or are there real-world use cases?

    Read the article

  • A game, any game.

    - by dapostolov
    Armed with a game idea from my past, it is my intention to code and release this game idea using the Microsoft XNA technology. The game? A 2D isometric-ish battlefield type game to allow 2 players to fling and dodge fireballs. I called this game Wizard Wars. I've axed most of the content from my old game design document to keep the game as simple as possible. So let's see how easy it is to make a video game! D.

    Read the article

  • ???????????? -Windows?-

    - by atsuko.nishihata
    Windows7/Windows Server 2008 R2???Oracle Database????????????Tips???????????????? 2010?4?28?(?) 11:00~12:00 Windows 7 / Windows Server 2008 R2 ?????? Oracle ! Oracle Direct ??????????????????????????????????????????????/???????????? ?Wondows7/Windows Server 2008 R2?? Oracle Database???????·???????? ?????? ????????! ????????Oracle Database 11g Release 2??Windows Server 2008 R2???Windows 7????? ??????????????????????? ?Oracle Database 11g Release 2??...2010?5?18????Microsoft Windows Server 2008 R2???Microsoft Windows 7?????????????·??????????????????????????????????????????????????? (??????????) ???OTN???????????????????????? ???????????????????????

    Read the article

  • how to dispose a incoming email and then send some words back using googe-app-engine..

    - by zjm1126
    from google.appengine.api import mail i read the doc: mail.send_mail(sender="[email protected]", to="Albert Johnson <[email protected]>", subject="Your account has been approved", body=""" Dear Albert: Your example.com account has been approved. You can now visit http://www.example.com/ and sign in using your Google Account to access new features. Please let us know if you have any questions. The example.com Team """) and i know hwo to send a email using gae ,but how to check a email incoming, and then do something thanks

    Read the article

  • How to load the rest of the data in mysql in php

    - by user225269
    I have trouble figuring out how do I load the rest of the data in html. Here is my code: <?php $con = mysql_connect("localhost","root","nitoryolai123$%^"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("school", $con); $result = mysql_query("SELECT * FROM student WHERE IDNO='$_GET['id']'"); ?> <?php while ( $row = mysql_fetch_array($result) ) { ?> <table class="a" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#D3D3D3"> <tr> <form name="formcheck" method="post" action="updateact.php" onsubmit="return formCheck(this);"> <td> <table border="0" cellpadding="3" cellspacing="1" bgcolor=""> <tr> <td colspan="16" height="25" style="background:#5C915C; color:white; border:white 1px solid; text-align: left"><strong><font size="2">Update Students</td> <tr> <td width="30" height="35"><font size="2">*I D Number:</td> <td width="30"><input name="idnum" onkeypress="return isNumberKey(event)" type="text" maxlength="5" id='numbers'/ value="<?php echo $_GET['id']; ?>"></td> </tr> <tr> <td width="30" height="35"><font size="2">*Year:</td> <td width="30"><input name="yr" onkeypress="return isNumberKey(event)" type="text" maxlength="5" id='numbers'/ value="<?php echo $row["YEAR"]; ?>"></td> this is the part where I am getting the error: mysql_select_db("school", $con); $result = mysql_query("SELECT * FROM student WHERE IDNO='$_GET['id']'"); ? What do you recommend that I could do so that I can also load the ID Numbers corresponding data into the other forms?

    Read the article

  • Adding multiple rss feeds to a script in SCALA InfoChannel Designer 5

    - by godleuf
    Okay, since it is impossible to talk to anyone on the phone or get support through Scala's "forum", I am going to take a shot and see if anyone out there is feeling my pain. I have a client that uses Scala's InfoChannel Designer and Content Manager. I have had to learn this software from scratch and I have to say it hasn't been easy. I think I am at a point where the overall design is set, but I need to implement a couple of things before I can make this happen. RSS feeds are my issue at this point. Multiple RSS feeds to be specific. I need a feed coming in for 3 areas of content: Wiki News (or equivalent), local weather and a stock ticker. I have learned how to setup a "crawl" using a script example available from Scala's file center and copying and pasting into my design. But from what I have learned first hand and through reading through other forums, you can not have a feed from 3 different sources or urls happening simultaneously. Doesn't seem like it would be an issue, but apparently it is. This small step has held up this project for far too long and I need to get it figured out. This doesn't even touch on my issue of feeding in streaming video as a background but I have gone over this in another question but with no luck thus far. If there is ANYONE out there who is in anything similar using this software, your feedback and/or suggestions would be greatly appreciated. Thanks you for allowing me to vent!

    Read the article

  • Git already up to date unless I reset

    - by Chris
    I have a cloned repo I use for the live site and I have it pull from a bare repo. For some reason every time I execute "git pull" I get the already up to date message. But it's not up to date and not updated. If I do a git reset --hard HEAD^ and then git pull again, the changes come in. What's the problem here and how do I fix it so that git pull will pull and merge changes in without needing a hard reset?

    Read the article

  • Anything new for WinForms in .NET 4.0

    - by Robert
    I could not find any information about new WinForm features, exept for this blog post: http://blog.codinglight.com/2009/05/future-of-winforms-whats-changed-in.html which states: 213 types were changed, and 9 types were added. 596 methods were changed, 50 were added, and 8 were removed. So whats in these changes, for joe developer?

    Read the article

  • Start Activity and clear activity history

    - by sandis
    So I have a huge maze of activities in my application. What I need to do, is that when the user logs in into the system, the activity history should be cleared. I cant just use finish() when I start a new activity, because I want the activities to have a history until the user logs in. I have experimentet with the different flags when starting an activity, but I have had no success. Any ideas? Cheers,

    Read the article

  • Using Castle DynamicProxy is it possible to change the invocation target on class proxy?

    - by Gareth D
    Hi Using Castle DynamicProxy v2, I'd like to change the target of an invocation for a class proxy. The new target is simply a different instance of the same type as the original target. The target types do not implement a common interface so I cannot use the IProxyTargetAccessor as detailed in Krzysztof's post on the subject - I cannot cast from a class proxy invocator to a IProxyTargetAccessor. Is there a way to do this?

    Read the article

  • How to call a function from another class file

    - by Guy Parker
    I am very familiar with writing VB based applications but am new to Xcode (and Objective C). I have gone through numerous tutorials on the web and understand the basics and how to interact with Interface Builder etc. However, I am really struggling with some basic concepts of the C language and would be grateful for any help you can offer. Heres my problem… I have a simple iphone app which has a view controller (FirstViewController) and a subview (SecondViewController) with associated header and class files. In the FirstViewController.m have a function defined @implementation FirstViewController (void) writeToServer:(const uint8_t ) buf { [oStream write:buf maxLength:strlen((char)buf)]; } It doesn't really matter what the function is. I want to use this function in my SecondViewController, so in SecondViewController.m I import FirstViewController.h import "SecondViewController.h" import "FirstViewController.h" @implementation SecondViewController -(IBAction) SetButton: (id) sender { NSString *s = [@"Fill:" stringByAppendingString: FillLevelValue.text]; NSString *strToSend = [s stringByAppendingString: @":"]; const uint8_t *str = (uint8_t *) [strToSend cStringUsingEncoding:NSASCIIStringEncoding]; FillLevelValue.text = strToSend; [FirstViewController writeToServer:str]; } This last line is where my problem is. XCode tells me that FirstViewController may not respond to writeToServer. And when I try to run the application it crashes when this function is called. I guess I don't fully understand how to share functions and more importantly, the relationship between classes. In an ideal world I would create a global class to place my functions in and call them as required. Any advice gratefully received.

    Read the article

  • Hive Based Registry in Flash

    - by Psychic
    To start with I'll say I've read the post here and I'm still having trouble. I'm trying to create a CE6 image with a hive-based registry that actually stores results through a reboot. I've ticked the hive settings in the catalog items. In common.reg, I've set the location of the hive ([HKEY_LOCAL_MACHINE\init\BootVars] "SystemHive") to "Hard Drive\Registry" (Note: the flash shows up as a device called "Hard Drive") In common.reg, I've set "Flags"=dword:3 in the same place to get the device manager loaded along with the storage manager I've verified that these settings are wrapped in "; HIVE BOOT SECTION" This is where it starts to fall over. It all compiles fine, but on the target system, when it boots, I get: A directory, called "Hard Disk" where a registry is put A device, name called "Hard Disk2" where the permanent flash is Any changes made to the registry are lost on a reboot What am I still missing? Why is the registry not being stored on the flash? Strangly, if I create a random file/directory in the registry directory, it is still there after a reboot, so even though this directory isn't on the other partition (where I tried to put it), it does appear to be permanent. If it is permanent, why don't registry settings save (ie Ethernet adapter IP addresses?) I'm not using any specific profiles, so I'm at a loss as to what the last step is to make this hive registry a permanent store.

    Read the article

  • Android horizontal scrolling showing Cursor data

    - by androidharry
    I have some text data in database which I have retrieved in a Cursor, and I am displaying it in a ListView. What I want to do now is that when you select click a particular row in the list its text content should be displayed in full screen and the user should be able to scroll horizontally (like scrolling between iPhone home screens) to view the contents of the Cursor.

    Read the article

  • Exchange 2010 and ESE Backup API

    - by Hannes de Jager
    Exchange 2010 does not support the ESE API for doing backups like it did in 2003 and 2007 according to MSDN. I Quote: "Exchange 2010 no longer supports the ESE streaming APIs for backup and restore of program files or data. Instead, Exchange 2010 supports only VSS-based backups." So my question is, if this is the case, why is the DLL (ESEBCLI2.DLL) still shipped with exchange 2010? I found it under C:\Program Files\Microsoft\Exchange Server\V14\Bin. Am I missing something here?

    Read the article

  • Warning generated by UIButton setting code

    - by Spider-Paddy
    I have a for loop setting the background images on buttons, basically the buttons are thumbnail previews of different items & can't be set statically, however the code gives an warning because it runs through all the UIViews but then calls setBackgroundImage which does not apply to all views. The warning is an irritation, I understand what it's complaining about, how can I get rid of it? (I don't want to turn off the warning, I want to fix the problem) // For loop to set button images for (UIView *subview in [self.view subviews]) // Loop through all subviews { // Look for the tagged buttons, only the 8 tagged buttons & within array bounds if((subview.tag >= 1) && (subview.tag <= 8) && (subview.tag < totalBundles)) { // Retrieve item in array at position matching button tag (array is 0 indexed) NSDictionary *bundlesDataItem = [bundlesDataSource objectAtIndex:(subview.tag - 1)]; // Set button background to thumbnail of current bundle NSString *picAddress = [NSString stringWithFormat:@"http://some.thing.com/data/images/%@/%@", [bundlesDataItem objectForKey:@"Nr"], [bundlesDataItem objectForKey:@"Thumb"]]; NSURL *picURL = [NSURL URLWithString:picAddress]; NSData *picData = [NSData dataWithContentsOfURL:picURL]; // Warning is generated here [subview setBackgroundImage:[UIImage imageWithData:picData] forState:UIControlStateNormal]; } }

    Read the article

  • web (html) gui building software

    - by Gaurav Sharma
    Hello everyone, I am in need of a software (preferablly free/open source) which facilitates fast and easy creation of html form and controls with proper styling. Similar to MachForms. This utility saves me a lot of time but there is one limitation of using it. The source code remains with the server only. Help me find a capable solution. Thanks

    Read the article

  • Implement "tail -f" in C++

    - by Hamming
    Hi! I want to create a small code in C++ with the same functionality as "tail-f": watch for new lines in a text file and show them in the standard output. The idea is to have a thread that monitors the file Is there an easy way to do it without opening and closing the file each time?

    Read the article

  • Debugging F# code and functional style

    - by Roger Alsing
    I'm new to funcctional programming and have some questions regarding coding style and debugging. I'm under the impression that one should avoid storing results from funcction calls in a temp variable and then return that variable e.g. let someFunc foo = let result = match foo with | x -> ... | y -> ... result And instead do it like this (I might be way off?): let someFunc foo = match foo with | x -> ... | y -> ... Which works fine from a functionallity perspective, but it makes it way harder to debug. I have no way to examine the result if the right hand side of - does some funky stuff. So how should I deal with this kind of scenarios?

    Read the article

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