Daily Archives

Articles indexed Monday May 31 2010

Page 13/98 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • What can I use MySQL for?

    - by ilhan
    I know how to store data in MySQL. Shortly, I know the basics: design, storing strings, integers, date. Is there something else that could be done/achieve with MySQL? Like some kind of functions, temprory bla blas? I don't know. (I know PHP)

    Read the article

  • Configuration for log4j to log ERROR level to a DB table

    - by firnnauriel
    Using the default config of a fresh Grails project, how do i change it so that ONLY error level messages will go to 'Message' table? // log4j configuration log4j = { // Example of changing the log pattern for the default console // appender: // //appenders { // console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n') //} error 'org.codehaus.groovy.grails.web.servlet', // controllers 'org.codehaus.groovy.grails.web.pages', // GSP 'org.codehaus.groovy.grails.web.sitemesh', // layouts 'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping 'org.codehaus.groovy.grails.web.mapping', // URL mapping 'org.codehaus.groovy.grails.commons', // core / classloading 'org.codehaus.groovy.grails.plugins', // plugins 'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration 'org.springframework', 'org.hibernate', 'net.sf.ehcache.hibernate' warn 'org.mortbay.log' } Thanks for any leads on this.

    Read the article

  • Find all ways to insert zeroes into a bit pattern

    - by James
    I've been struggling to wrap my head around this for some reason. I have 15 bits that represent a number. The bits must match a pattern. The pattern is defined in the way the bits start out: they are in the most flush-right representation of that pattern. So say the pattern is 1 4 1. The bits will be: 000000010111101 So the general rule is, take each number in the pattern, create that many bits (1, 4 or 1 in this case) and then have at least one space separating them. So if it's 1 2 6 1 (it will be random): 001011011111101 Starting with the flush-right version, I want to generate every single possible number that meets that pattern. The # of bits will be stored in a variable. So for a simple case, assume it's 5 bits and the initial bit pattern is: 00101. I want to generate: 00101 01001 01010 10001 10010 10100 I'm trying to do this in Objective-C, but anything resembling C would be fine. I just can't seem to come up with a good recursive algorithm for this. It makes sense in the above example, but when I start getting into 12431 and having to keep track of everything it breaks down.

    Read the article

  • Iphone UIButton not working in nested UIViews

    - by Charles Peterson
    This is so damn simple im sure! Im missing something and im exhausted from trying to fix it. hopefully someone can help. The Button in CharacterView.m works but the button nested down in CharacterMale.m does not. I'm not using IB everything is done progmatically. What would cause one button to work and other not? ///////////////////////////////////////////////////////////////////////////////// CharacterController.m ///////////////////////////////////////////////////////////////////////////////// #import "CharacterController.h" #import "CharacterView.h" @implementation CharacterController - (id)init { NSLog(@"CharacterController init"); self = [ super init ]; if (self != nil) { } return self; } - (void)loadView { [ super loadView ]; characterView = [ [ CharacterView alloc ] init]; self.view = characterView; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)dealloc { [super dealloc]; } @end ///////////////////////////////////////////////////////////////////////////////// CharacterView.m ///////////////////////////////////////////////////////////////////////////////// #import "CharacterView.h" #import "CharacterMale.h" @implementation CharacterView - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { characterMale = [ [ CharacterMale alloc ] init]; [self addSubview: characterMale]; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0, 200, 200, 100); [button setImage:[UIImage imageNamed:@"btnCharSelect.png"] forState:UIControlStateNormal]; [button addTarget:self action:@selector(ApplyImage:) forControlEvents:UIControlEventTouchUpInside]; [ self addSubview: button ]; } return self; } - (void)drawRect:(CGRect)rect { } -(void)ApplyImage:(id)sender { NSLog(@"CharacterView button works"); } - (void)dealloc { [super dealloc]; } @end ///////////////////////////////////////////////////////////////////////////////// CharacterMale.m ///////////////////////////////////////////////////////////////////////////////// #import "CharacterMale.h" #import "CharacterController.h" @implementation CharacterMale - (id)init { self = [ super init]; if (self != nil) { UIImage *image = [UIImage imageNamed:@"charMale.png"]; imageView = [[ UIImageView alloc] initWithImage:image]; [image release]; [ self addSubview: imageView ]; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0, 0, 200, 100); [button setImage:[UIImage imageNamed:@"btnCharSelect.png"] forState:UIControlStateNormal]; [button addTarget:self action:@selector(ApplyImage:) forControlEvents:UIControlEventTouchUpInside]; [ self addSubview: button ]; } return self; } -(void)ApplyImage:(id)sender { NSLog(@"CharacterMal button works"); } - (void)dealloc { [super dealloc]; } @end

    Read the article

  • How has "Worse is Better" changed you?

    - by Vardhan Varma
    Background: The Rise of "Worse is Better" and Wikipedia's article I read it ages ago, and, when looking back now, it seems that it had an influence on the way I approach software development. Though I'm not sure if that was for better or worse. (-: Do you agree that worse is better? How has it changed the way you approach development? Does "worse" cost less in the long run? Do you often say or hear "this is not the right thing"?

    Read the article

  • Modular Inverse and BigInteger division

    - by dano82
    I've been working on the problem of calculating the modular inverse of an large integer i.e. a^-1 mod n. and have been using BigInteger's built in function modInverse to check my work. I've coded the algorithm as shown in The Handbook of Applied Cryptography by Menezes, et al. Unfortunately for me, I do not get the correct outcome for all integers. My thinking is that the line q = a.divide(b) is my problem as the divide function is not well documented (IMO)(my code suffers similarly). Does BigInteger.divide(val) round or truncate? My assumption is truncation since the docs say that it mimics int's behavior. Any other insights are appreciated. This is the code that I have been working with: private static BigInteger modInverse(BigInteger a, BigInteger b) throws ArithmeticException { //make sure a >= b if (a.compareTo(b) < 0) { BigInteger temp = a; a = b; b = temp; } //trivial case: b = 0 => a^-1 = 1 if (b.equals(BigInteger.ZERO)) { return BigInteger.ONE; } //all other cases BigInteger x2 = BigInteger.ONE; BigInteger x1 = BigInteger.ZERO; BigInteger y2 = BigInteger.ZERO; BigInteger y1 = BigInteger.ONE; BigInteger x, y, q, r; while (b.compareTo(BigInteger.ZERO) == 1) { q = a.divide(b); r = a.subtract(q.multiply(b)); x = x2.subtract(q.multiply(x1)); y = y2.subtract(q.multiply(y1)); a = b; b = r; x2 = x1; x1 = x; y2 = y1; y1 = y; } if (!a.equals(BigInteger.ONE)) throw new ArithmeticException("a and n are not coprime"); return x2; }

    Read the article

  • How to get the newest (last modified) directory [C#]

    - by Shaitan00
    Currently my application uses string[] subdirs = Directory.GetDirectories(path) to get the list of subdirectories, and now I want to extract the path to the latest (last modified) subdirectory in the list. What is the easiest way to accomplish this? (efficiency is not a major concern - but robustness is)

    Read the article

  • SVN repository browser issue

    - by williang
    Hi, I use TortoiseSVN on WindowsXP and ran into an issue inside repository browser today. Basically, I can browser/checkout fine at application level "https://domain/svn/app1". However, When I try to browse at the root level of the repository "https://domain/svn/", the following error msg displays: OPTIONS of 'https://domain/svn': 200 OK I try to access https://domain/svn in a web browser, I can see all the applications there. Thanks

    Read the article

  • Is there a difference between only <NSXMLParserDelegate>, only setDelegate method, or the use of bot

    - by gotye
    Hey, I noticed that when I do this : [myParser setDelegate:self]; it works :D (even if I didn't add the code in the header file ... you know, the <delegateStuff, delegateOtherStuff> in the interface declaration) When are you supposed to modify the header file to make your delegate work ? Is the setDelegate method enough to make it work ? Cheers for any help ;) Gauthier

    Read the article

  • iPhone OS 3.2 File Sharing Path

    - by OscarTheGrouch
    Currently I have this for my file path and file... NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"Shared\PartyPlanner.sqlite"]]; This allows me to share the file with iTunes, but instead of just having 'PartyPlanner.sqlite' in the 'applicationDocumentsDirectory\Shared' I have "SharedPartyPlanner.sqlite" in the 'applicationDocumentsDirectory' is there a cleaner or easier way to get to the shared folder inside of applicationDocumentsDirectory?

    Read the article

  • Operational Transformation library?

    - by gamers2000
    I'm looking for a library that would allow me to synchronize text in real-time between multiple users (ala Google Docs). I've stumbled upon Operational Transformation, which seems to fit my needs. Having said that, I understand the gist of OT, but not the math nor implementation of OT. Thus, I was wondering if there was a drag'n'drop Javascript library that would hook into a text area, generate the transforms, then allow me to apply those transformations onto another client? (I've gotten the Etherpad source, but I can't make head or tails out of it. If anyone could point out how to leverage on Etherpad's OT implementation, that'll be great too!)

    Read the article

  • How to register rss for a website?

    - by domainking
    I am not sure if I ask this question in the right place, because I am new to it. What I want to ask is, do I need to register/create RSS for my website? I have a website, lets say: [http://blog.domain.com] = its a 2.9.2 wordpress blog So, if I want to display the latest content in another subdomain, for example: [news.domain.com], how do I do that? I know a little bit of php and mysql.

    Read the article

  • NFS access from multiple networks

    - by Luke
    On my NFS server (Ubuntu) I have in /etc/exports the following: /share 192.168.89.1/24(rw,no_root_squash,async) However, I have a new machine which is not in 192.168.89.* IP range, it's in 192.168.92.* instead. How can I make this machine access my NFS server?

    Read the article

  • How to create StackedBarSeries with custom tooltip without losing standard colors

    - by Simon_Weaver
    I have a StackedBarSeries in Silverlight 4 charting (latest release). I have created a DataPointStyle called MyDataPointStyle for a custom tooltip. By itself this breaks the standard palette used for the different bars. I've applied a custom palette - as described in David Anson's blog to the chart. However when I have the DataPointStyle set for my SeriesDefinition objects it does not use this palette. I'm not sure what I'm missing - but David specifically says : ... it enables the use of DynamicResource (currently only supported by the WPF platform) to let users customize their DataPointStyle without inadvertently losing the default/custom Palette colors. (Note: A very popular request!) Unfortunately I'm inadvertently losing these colors - and I can't see why? <chartingToolkit:Chart.Palette> <dataviz:ResourceDictionaryCollection> <ResourceDictionary> <Style x:Key="DataPointStyle" TargetType="Control"> <Setter Property="Background" Value="Blue"/> </Style> </ResourceDictionary> <ResourceDictionary> <Style x:Key="DataPointStyle" TargetType="Control"> <Setter Property="Background" Value="Green"/> </Style> </ResourceDictionary> <ResourceDictionary> <Style x:Key="DataPointStyle" TargetType="Control"> <Setter Property="Background" Value="Red"/> </Style> </ResourceDictionary> </dataviz:ResourceDictionaryCollection> </chartingToolkit:Chart.Palette> <chartingToolkit:Chart.Series> <chartingToolkit:StackedBarSeries> <chartingToolkit:SeriesDefinition IndependentValueBinding="{Binding SKU}" DependentValueBinding="{Binding Qty}" DataPointStyle="{StaticResource MyDataPointStyle}" Title="Regular"/> <chartingToolkit:SeriesDefinition IndependentValueBinding="{Binding SKU}" DependentValueBinding="{Binding Qty}" DataPointStyle="{StaticResource MyDataPointStyle}" Title="FSP Orders"/> <chartingToolkit:StackedBarSeries.IndependentAxis> <chartingToolkit:CategoryAxis Title="SKU" Orientation="Y" FontStyle="Italic" AxisLabelStyle="{StaticResource LeftAxisStyle}"/> </chartingToolkit:StackedBarSeries.IndependentAxis> <chartingToolkit:StackedBarSeries.DependentAxis> <chartingToolkit:LinearAxis Orientation="X" ExtendRangeToOrigin="True" Minimum="0" ShowGridLines="True" /> </chartingToolkit:StackedBarSeries.DependentAxis> </chartingToolkit:StackedBarSeries > </chartingToolkit:Chart.Series> </chartingToolkit:Chart>

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >