Daily Archives

Articles indexed Friday January 14 2011

Page 18/36 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • How to print source code lines in python logger

    - by anon
    Is there some relatively simple way to programmatically include source code lines to python logger report. For example... import logging def main(): something_is_not_right = True logging.basicConfig(level=logging.DEBUG, format=('%(filename)s: ' '%(levelname)s: ' '%(funcName)s(): ' '%(lineno)d:\t' '%(message)s') ) if something_is_not_right == True: logging.debug('some way to get previous line of source code here?') So that output would look like this. example.py: DEBUG: main(): 14: if something_is_not_right == True:

    Read the article

  • WCF DataContract GetCustomDataToExport

    - by JeffN825
    I'm trying to get the default behavior for a client referencing my WCF WSDL to set IsReference to true on the imported DataContracts. It looks like I should be able to use an IDataContractSurrogate with GetCustomDataToExport to accomplish this...which specifcally means adding the following to the generated ComplexType in the xsd associated with the WSDL: <xs:attribute ref="ser:Id" /> <xs:attribute ref="ser:Ref" /> There is, of course no usable documentation I can find from MS about how to use this method. The MSDN page says it should return an object...but does not indicate at all what type of object this should be....how useless... Before I go reflector'ing for this, does anyone out there know how to use this method? Thanks.

    Read the article

  • NSMutableDictionary confused over how to use keys with certain code ?

    - by Jules
    I'm getting data from a database and I need to add the string field value and the record id. However, I need this to work with some existing code... I'm replacing this (see code below) and getting data from my database. NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path]; self.allCategories = dict; [dict release]; But needs to work with these key and value search functions. - (void)resetSearch { NSMutableDictionary *allCategoriesCopy = [self.allCategories mutableDeepCopy]; self.Categories = allCategoriesCopy; [allCategoriesCopy release]; NSMutableArray *keyArray = [[NSMutableArray alloc] init]; [keyArray addObject:UITableViewIndexSearch]; [keyArray addObjectsFromArray:[[self.allCategories allKeys] sortedArrayUsingSelector:@selector(compare:)]]; self.keys = keyArray; [keyArray release]; } . - (void)handleSearchForTerm:(NSString *)searchTerm { NSMutableArray *sectionsToRemove = [[NSMutableArray alloc] init]; [self resetSearch]; for (NSString *key in self.keys) { NSMutableArray *array = [Categories valueForKey:key]; NSMutableArray *toRemove = [[NSMutableArray alloc] init]; for (NSString *name in array) { if ([name rangeOfString:searchTerm options:NSCaseInsensitiveSearch].location == NSNotFound) [toRemove addObject:name]; } if ([array count] == [toRemove count]) [sectionsToRemove addObject:key]; [array removeObjectsInArray:toRemove]; [toRemove release]; } [self.keys removeObjectsInArray:sectionsToRemove]; [sectionsToRemove release]; [table reloadData]; } Keep getting an error from this code... NSDictionary *arrayTmp= [[NSDictionary alloc] init]; ... loop records int cid = sqlite3_column_int(statementTMP, 0); NSString *category = [[NSString alloc] initWithUTF8String:(char *)sqlite3_column_text(statementTMP, 1)]; [arrayTmp setObject:category forKey:[NSString stringWithFormat:@"%i", cid]]; Error caused by line above * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString count]: unrecognized selector sent to instance 0x4d4c500' * Call stack at first throw * ... end loop self.allCategories = arrayTmp; [arrayTmp release];

    Read the article

  • Get smallest date for each element in access query

    - by skerit
    So I have a table containing different elements and dates. It basically looks like this: actieElement beginDatum 1 1/01/2010 1 1/01/2010 1 10/01/2010 2 1/02/2010 2 3/02/2010 What I now need is the smallest date for every actieElement. I've found a solution using a simple GROUP BY statement, but that way the query loses its scope and you can't change anything anymore. Without the GROUP BY statement I get multiple dates for every actieElement because certain dates are the same. I thought of something like this, but it also does not work as it would give the subquery more then 1 record: SELECT s1.actieElement, s1.begindatum FROM tblActieElementLink AS s1 WHERE (((s1.actieElement)=(SELECT TOP 1 (s2.actieElement) FROM tblActieElementLink s2 WHERE s1.actieElement = s2.actieElement ORDER BY s2.begindatum ASC)));

    Read the article

  • HPUX setacl leaves uid behind

    - by Woot4Moo
    I have a shell script that I execute after uninstalling a web application. The script is meant to clean up permissions that were needed during the execution of the application. find /opt/path -exec setacl -d user:myUser{} ';' After this executes and the acl is removed I am left with an acl that looks as follows user:101:--- /opt/path How can I properly call setacl to remove the user without leaving behind a uid?

    Read the article

  • How to column-ify an output from a certain program?

    - by mbaitoff
    I have a program that generates and outputs a sequence of simple sample math homework tasks, like: 1 + 1 = ... 3 + 3 = ... 2 + 5 = ... 3 + 7 = ... 4 + 2 = ... a sequence can be quite long, and I'd like to save space when this sequence is printed by converting it as follows: 1 + 1 = ... 3 + 7 = ... 3 + 3 = ... 4 + 2 = ... 2 + 5 = ... that is, wrapping the lines into the two or more columns. I was expecting the column linux utility to do the job using the -c N option witn N=2, however, it still outputs the lines in one column whatever the N is. How would I do the column-ifying of the sequence of lines?

    Read the article

  • Why does using the Asynchronous Programming Model in .Net not lead to StackOverflow exceptions?

    - by uriDium
    For example, we call BeginReceive and have the callback method that BeginReceive executes when it has completed. If that callback method once again calls BeginReceive in my mind it would be very similar to recursion. How is that this does not cause a stackoverflow exception. Example code from MSDN: private static void Receive(Socket client) { try { // Create the state object. StateObject state = new StateObject(); state.workSocket = client; // Begin receiving the data from the remote device. client.BeginReceive( state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReceiveCallback), state); } catch (Exception e) { Console.WriteLine(e.ToString()); } } private static void ReceiveCallback( IAsyncResult ar ) { try { // Retrieve the state object and the client socket // from the asynchronous state object. StateObject state = (StateObject) ar.AsyncState; Socket client = state.workSocket; // Read data from the remote device. int bytesRead = client.EndReceive(ar); if (bytesRead > 0) { // There might be more data, so store the data received so far. state.sb.Append(Encoding.ASCII.GetString(state.buffer,0,bytesRead)); // Get the rest of the data. client.BeginReceive(state.buffer,0,StateObject.BufferSize,0, new AsyncCallback(ReceiveCallback), state); } else { // All the data has arrived; put it in response. if (state.sb.Length > 1) { response = state.sb.ToString(); } // Signal that all bytes have been received. receiveDone.Set(); } } catch (Exception e) { Console.WriteLine(e.ToString()); } }

    Read the article

  • jquery dynamically added checkbox not working with change() function

    - by estern
    I dynamically load in a few li's that have a label and a checkbox in them to another visible ul. I set the checkboxes to be checked="checked" and i am trying to trigger an event to happen when i change these dynamically inserted checkboxes but nothing occurs. Here is the jquery: $(".otherProductCheckbox:checkbox").change( function(){ alert('test'); }); Here is the html for the dynamically added li's: <li class="otherProduct"><input type="checkbox" class="otherProductCheckbox radioCheck" checked="checked"/><label>Product Name</label></li> Any idea why i cant get the alert to happen when the checkbox changes its checked state?

    Read the article

  • CSS3PIE issues in IE6 and 8

    - by Gordon
    I'm using CSS3PIE to apply some rounded corners to elements in Internet Explorer that will get them by stylesheet in other browsers. I've run into some issues with it though. In IE8, I discovered that any element that had the PIE behaviour would behave strangely. The container would jump a few pixels to the right, but the content would stay in its original position, giving the appearance that the content had all shifted left relative to its container. This would be especially problematic on elements with no or small amounts of padding. I was able to hack my way around the problem in IE8 by using X-UA-Compatible, but I'd rather avoid this solution if at all possible. I don't have access to IE9 for testing but my understanding hacks like PIE aren't necessary and it would be wasteful to force a compatibility mode in a browser that doesn't need it. I have worse issues in IE6, with the PIE layout breaking down completely on a list that is set up to use display:inline; zoom:1; list items (to simulate inline-block, which works in IE8 and the other browsers). Here the borders of the list items get rendered in completely the wrong place. So ideally, I'd like to have PIE work properly in IE6, and in IE8 without having to resort to compatibility mode. As far as IE6 goes, a graceful fallback where PIE is just not applied will do. IE7 is the only browser where the page displays as intended. I can't provide an example page just at the moment unfortunately, I can add one later though. Follow up: Here are some screen grabs made with IE Tester. I'm hoping they will make things a little more clear for everybody. As you can see, IE7 is fine. However, in IE8, the containers are offset to the left relative to their content, and in IE6 the list elements (with the rounded 1 pixel border) are a complete mess! Full size versions for IE8, IE7 and IE6 are also available

    Read the article

  • Iphone calendar integrating problem

    - by Rkm
    I am integrating calendar to my application , after adding calendar i am getting error , please help me anyone where it is problem . "_OBJC_CLASS_$_KalViewController", referenced from: objc-class-ref-to-KalViewController in FertilityAppAppDelegate.o "_KalDataSourceChangedNotification", referenced from: _KalDataSourceChangedNotification$non_lazy_ptr in EventKitDataSource.o (maybe you meant: _KalDataSourceChangedNotification$non_lazy_ptr) "_OBJC_CLASS_$_EKEventViewController", referenced from: objc-class-ref-to-EKEventViewController in FertilityAppAppDelegate.o

    Read the article

  • NoSuchMessageException: No message found

    - by adisembiring
    Hi .... I try to learn Spring MVC 3.0 validation. but I got NoSuchMessageException: No message found under code 'name.required' for locale 'en_US' error message when form submted. I have create message.properties in src/message.properties and the content of that file is: name.required = User Name is required password.required = Password is required gender.required = Gender is required I have set ResourceBundleMessageSource in my app-servlet.xml <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource" p:basename="messages" /> My validator code is: @Component("registrationValidator") public class RegistrationValidator implements Validator { @Override public boolean supports(Class<?> clazz) { return RegistrationCommand.class.isAssignableFrom(clazz); } @Override public void validate(Object target, Errors errors) { RegistrationCommand registrationCommand = (RegistrationCommand) target; ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "name.required"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "password.required"); ValidationUtils.rejectIfEmpty(errors, "gender", "gender.required"); ValidationUtils.rejectIfEmpty(errors, "country", "country.required"); //ValidationUtils.rejectIfEmpty(errors, "community", "community.required"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "description", "description.required"); if (registrationCommand.getCommunity().length == 0) { errors.rejectValue("community", "community.required"); } } } and JSP Page is: <form:form commandName="registrationCommand"> <p class="name"> <label for="name">Name</label> <form:input path="name" /> <form:errors path="name" cssClass="error"></form:errors> </p> <p class="password"> <label for="password">Password</label> <form:password path="password" /> <form:errors path="password" cssClass="error"></form:errors> </p> <p class="gender"> <label>Gender</label> <form:radiobutton path="gender" value="M" label="M" /> <form:radiobutton path="gender" value="F" label="F" /> <form:errors path="gender" cssClass="error"></form:errors> </p> <p class="submit"> <input type="submit" value="Submit" /> </p> </form:form>

    Read the article

  • Acessing a struct member, using a pointer to a vector of structs. Error:base operand of '->' has non-pointer type

    - by Matt Munson
    #include <iostream> #include <vector> using namespace std; struct s_Astruct { vector <int> z; }; int main () { vector <s_Astruct> v_a; for(int q=0;q<10;q++) { v_a.push_back(s_Astruct()); for(int w =0;w<5;w++) v_a[q].z.push_back(8); } vector <s_Astruct> * p_v_a = & v_a; cout << p_v_a[0]->z[4]; //error: base operand of '->' has non-pointer type //'__gnu_debug_def::vector<s_Astruct, std::allocator<s_Astruct> >' } There seems to be some issue with this sort of operation that I don't understand. In the code that I'm working on I actually have things like p_class-vector[]-vector[]-int; and I'm getting a similar error.

    Read the article

  • PowerShell 2.0 and how to handle exceptions ?

    - by Primoz
    Why I get error message printed on the console when running these two simple samples ? I want that I get "Error testing :)" printed on the console insted of: Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) At line:3 char:15 + Get-WmiObject <<<< -ComputerName possibly.nonexisting.domain.com -Credential (Get-Credential) -Class Win32_logicaldisk + CategoryInfo : InvalidOperation: (:) [Get-WmiObject], COMException + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand or Attempted to divide by zero. At line:3 char:13 + $i = 1/ <<<< 0 + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : RuntimeException First example: try { $i = 1/0 Write-Host $i } catch [Exception] { Write-Host "Error testing :)" } Second example: try { Get-WmiObject -ComputerName possibly.nonexisting.domain.com -Credential (Get-Credential) -Class Win32_logicaldisk } catch [Exception] { Write-Host "Error testing :)" } Thank you very much!

    Read the article

  • Query SQL Server Database from native iOS Application

    - by mbm30075
    I am working on an in-house, iOS app that will need read-only access to a SQL Server with multiple databases. I know the stock answer here is "write some web services", but I'd like a solution that is self-contained. Is there any way to directly connect to a SQL Server database from an iOS application? I'm thinking something like a basic ODBC connection. I've seen a lot of users asking this question, but very few answers other than "write a web service." Is that really the only way?

    Read the article

  • Why configuring manual IP do not work for me in DHCP?

    - by user58859
    I have broadband connection in my laptop. It's getting the IP by protocol. configuration is : ip : 192.168.1.2 subnet : 255.255.255.0 gateway : 192.168.1.1 Now I am curious, In IPV4 properties when instead of choosing "Obtain an IP address automatically", I choose "Use the following IP address" and configure everything same, why it do not work? Do DHCP do not work when we configure the IP manually? (operating system : windows-7) EDIT : After configuring the ip manually, when I used ipconfig/all , it's showing dhcp enabled : NO. I am not doing it. Why it got disabled automatically? and how to enable it? DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes IPv4 Address. . . . . . . . . . . : 192.168.1.2(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1 NetBIOS over Tcpip. . . . . . . . : Enabled

    Read the article

  • How to remove the pause during JBoss 5.1.0 GA boot between ProfileServiceBootstrap and AnnotationCreator?

    - by rrc7cz
    I've managed to strip down my JBoss profile enough that it boots in 1.5 minutes. I started with the web profile and started pulling out stuff I didn't need. The bulk of my boot time can be seen here: ... 15:21:51,890 INFO [ProfileServiceBootstrap] Loading profile: ProfileKey@86d597[domain=default, server=default, name=np] 15:22:55,406 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent 15:22:55,578 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent ... Does anyone have any idea what JBoss is doing here for 1 minute? If so, is there any way to speed it up or skip it entirely? This is for developer instances, so boot time is quite important.

    Read the article

  • Is it possible to upload only files that have been updated into a server?

    - by kamikaze_pilot
    Hi guys, Suppose I have a server accessible via FTP and it hosts websites Suppose I want to edit the website locally so it wont affect the site live, and suppose I edit a whole bunch of files, and I don't want to deal with the hassle of keeping track of which files I've edited all the time... Once I finished editing I want to upload it to the server via FTP....is there some FTP software that automatically detects which files have been edited and have only those files uploaded and overwritten rather than having me manually choosing the files I've edited (and hence having to keep track of edited files) or have me upload the entire site which is a waste of time thanks in advance

    Read the article

  • Restoring a backup SQL Server 2005 where is the data stored?

    - by sc_ray
    I have two Sql Server database instances on two different machines across the network. Lets call these servers A and B. Due to some infrastructural issues, I had to make a complete backup of the database on server A and robocopy the A.bak over to a shared drive accessible by both A and B. What I want is to restore the database on B. My first issue is to restore the backup on server B but the backup location does not display my shared drive. My next issue is that server B's C: drive has barely any space left and there are some additional partitions that have more space and can house my backup file but I am not sure what happens to the data after I restore the database on B. Would the backup data fill up all the available space on C:? It will be great if somebody explain how the data is laid out after the restore database is initiated on a target database server? Thanks

    Read the article

  • outbound ftp on server 2008 r2 stalls

    - by Scott Kramer
    the built in command line ftp client in server 2008 does not support passive mode so I've used these commands to allow outbound ftp (it stalls without this) 1) Open port 21 on the firewall netsh advfirewall firewall add rule name="FTP (no SSL)" action=allow protocol=TCP dir=in localport=21 2) Activate firewall application filter for FTP (aka Stateful FTP) that will dynamically open ports for data connections netsh advfirewall set global StatefulFtp enable however in server 2008 r2, these commands seem to work, but it does not affect the outbound ftp, it stalls I do not want to use an alt client

    Read the article

  • How can I add config options for a specific hostname outside <VirtualHost>?

    - by Boldewyn
    I'm using Apache 2.2 and let it serve domains foo.example.com and bar.example.com with <VirtualHost> statements: <VirtualHost 127.0.0.1:80> ServerName foo.example.com </VirtualHost> <VirtualHost 127.0.0.1:80> ServerName bar.example.com </VirtualHost> My problem is, that I need to add configuration options, that are only targeted at foo.example.com, in a separate file (let's say, /etc/apache/sites-enabled/foo.conf). This file will be included, before the VirtualHost statement is issued, but it can't be embedded inside it. Can I (and if yes, how) target configuration settings to foo.example.com requests only, outside the VirtualHost container?

    Read the article

  • SQL Server Migration Assistant for Oracle problem

    - by Paul
    I've recently installed SSMA on my computer and after connecting to both the Oracle instance (which holds the database to be converted) and the SQL Server. I've mapped the needed schemas from oracle to mssql. The problem is that when i click on the report button for the assessment report there's an error popping up: Assesment Error : Nothing to Process The output window states: Starting conversion... Analyzing metadata... Conversion finished with 0 errors, 0 warnings, and 0 informational messages. There is nothing to process. Has anyone got experience with SSMA. I can't figure out what I am doing wrong. Thank you.

    Read the article

  • Possible causes for Domain server being unavailable?

    - by serversurfer
    One of our servers was compromised after a user with administrative privileges accidentally loaded a virus from a USB drive on a desktop connected to the domain. The two most obvious symptoms of this were: The server is no longer responding to login attempts The root directory of the drive containing user data has been filled with randomly named empty folders. (Initially it was around a million folders, I've been slowly deleting them.) I've run several virus scans from different vendors and am fairly confident the virus has been removed but the damage is done. I'm hoping the two symptoms are related and that once the directories are gone the server will start responding again. The drive is very slow to respond. I'm deleting about 20k folders at a time. Anymore than that and windows explorer becomes unresponsive. In the event that I finish cleaning up the HD and things don't return to normal what other things can I check?

    Read the article

  • correct file permissions for trac and git user to access gitolite server repos

    - by klemens
    hi, sounds like a stupid questions (to me), but i couldn't find any info. on my server i host some git repositories via gitolite, and have a trac for every repository. i have a user called git to push/pull from server (git clone git@server:repo). and trac is a apache vhost with mod_wsgi. this runs with the www-data user. so what riddles me (maybe because I have not much of a clue about file-permissions at all) is whats the best permissions setup (chown, chmod) for the git repositories (/home/git/repositories/...). www-data (or trac) needs to at least read permissions (i think). and git (or gitolite) needs obviously read/write permissions to push changesets. i tried a little bit around (i.e. adding www-data and/or git to the www-data/git group), but didn't got it right. at least one of the two don't work (git or trac). any suggestions are highly appreciated. regard, klemens

    Read the article

  • proxy server software for windows xp

    - by This is it
    Hi Is there a proxy software for Windows XP that can support HTTP, HTTPS, SMTP, IMAP, POP, FTP, etc. (the more the better)? We tried apache mod_proxy but FTP doesn't work through it (at least not all features). Maybe we don't need proxy server for following requirements (we are open for suggestions): - Centralized access point to internet for several users (proxy server?) - Users use Browser (firefox/IE - HTTP, HTTPS), Outlook (SMTP, POP, IMAP) - Logs to see where did users go on internet - Possiblity to connect to FTP server Windows xp, which is used as proxy server, is a virtual machine, and all other users/clients are virtual machines as well (Hyper-V)... Thanks for suggestions. Cheers

    Read the article

  • -ssadd is invalid when setting up Sessions on SQL Server 2005

    - by P.Brian.Mackey
    I have a dev and QA environment with SQL 2005 EE on dev and SQL 2000 on QA. On QA I run aspnet_regsql –ssadd –sstype t -E in command line and it works fine. I run the same command on dev and it returns "'-ssadd' is invalid". The working directory for both is C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727. I found some info on MSDN that said that SQL Express Edit. required a script to run before -ssadd will work, but this script didn't help me. I'm not sure where to go from here.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >