Daily Archives

Articles indexed Thursday May 13 2010

Page 7/119 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • SQLite vs MySQL

    - by Teifion
    SQLite is a flat-file database and MySQL is a normal database. That's great but I'm not sure which is faster where or better for what? What are the pros and cons of each option?

    Read the article

  • Validate uniqueness within a recent set

    - by Matchu
    Is there a standard Rails 3 way of detecting uniqueness within a particular scope, or is this custom validation all I can do? class Post < ActiveRecord::Base # [named scope for recent posts] validates do |post| if Post.recent.where('url = ?', post.url).count > 0 errors[:url] = 'has already been posted recently - thanks anyway!' end end end (Haven't yet tried that exact code, so there may be errors, but you get the idea.)

    Read the article

  • Multiple Grails Applications create Ehcache conflicts

    - by Lloyd Meinholz
    I am running multiple Grails Applications on one of my servers. I am using Grails 1.2.2. I am using the default cache configuration in DataSource.groovy. When I try and run two Grails applications, they both seem to be using/writing to: /tmp/org.hibernate.cache.UpdateTimestampsCache.data When I look at how to customize Ehcache with an ehcache.xml file from this page: http://ehcache.org/documentation/grails.html I do not see any information about specifying the locations and/or names or temporary files. How do I avoid this issue when running multiple Grails applications on the same server (without turning off the cache)?

    Read the article

  • Is there a java library / package analogous to <stdio.h>?

    - by Roboprog
    I have been doing Java on and off for about 14 years, and almost nothing else the last 6 years or so. I really hate the java.io package -- its legion of subclasses and adapters. I do like exceptions, rather than having to always poll "errno" and the like, but I could surely live without declared exceptions. Is there anything that functions like the Unix/ANSI stdio.h routines in C? I know we will never be rid of java.io and its conventions until java itself is retired, as they have metastasized throughout the many frameworks that have accreted to java. That said, I would like something that works kind of like this (let's call it package javax.stdio): Have a main utility class, perhaps FileStar, that can read and write files (or pipes), either text or binary, either sequentially or random access, with constructors that mimic fopen() and popen(). This class should have a load of useful methods that do things like fread(), fwrite(), fgets(), fputs(), fseek(), and whatever else (fprintf()?). Methods that are incompatible with the open/construct mode simply throw up (just like some of the collections classes/methods do when restricted). Then, have a bunch of interfaces that suggest how you intend to use the stream once you have created it: Sequential, RandomAccess, ReadOnly, WriteOnly, Text, Binary, plus combinations of these that make sense. Perhaps even have methods to return the appropriate type-cast (interface), throwing up if you have asked for something incompatible. For extra flavor, skip the declared exceptions -- e.g. - javax.stdio.IOException extends RuntimeException. Is there an open source project like this floating around?

    Read the article

  • How to download data from internet with resume option..?

    - by jeeva
    Hi, i am downloading content from server to my app. i am using NSUrlConnection to that in response i am getting data and i am storing that. But if user quits the app while downloading when he launches app next time i have to resume that download from where it stop(download remaining part). how to support this ... is any idea on how to handle this .... Thanks in advance.

    Read the article

  • What are the best tools for modeling a pre-existing SQL database structure?

    - by Ejoso
    I have a MS SQL database that has been running strong for 10+ years. I'd like to diagram the database structure, without spending hours laying it all out in Visio or something similar... I've seen nice models diagrammed before, but I have no idea how they were created. From what I've seen - those models were created in advance of the database itself to assist in clarifying the relationships... but my database already exists! Anyone have any suggestions for tools that would work, or methods I could employ to tease out a nice clean document describing my database structure? Thanks in advance!

    Read the article

  • Ubuntu log in dialog hot key

    - by bguiz
    Hi, I am having trouble starting up Ubuntu (Karmic). Bascially I get to the bit where the log in dialog is supposed to appear, but it doesn't. Is there a hot key of some sort to force the login dialog to appear? Thanks! Full details here: http://ubuntuforums.org/showthread.php?p=9290145#post9290145

    Read the article

  • How to catch FTP errors? e.g., socket.error: [Errno 10060]

    - by Johnson
    I'm using the ftplib module to upload files: files = [ a.txt , b.txt , c.txt ] s = ftplib.FTP(ftp_server , ftp_user , ftp_pw) # Connect to FTP for i in range(len(files)): f = open(files[i], 'rb') stor = 'stor ' + files[i] s.storbinary(stor, f) f.close() # close file s.quit() # close ftp How do I catch the following error? socket.error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond And what other errors are common when using the FTP module that I should also catch? Thanks for any help or pointers.

    Read the article

  • Dynamically add items to Tkinter Canvas

    - by nick369
    I'm attempting to learn Tkinter with the goal of being able to create a 'real-time' scope to plot data. As a test, I'm trying to draw a polygon on the canvas every time the 'draw' button is pressed. The triangle position is randomized. I have two problems: There is a triangle on the canvas as soon as the program starts, why and how do I fix this? It doesn't draw any triangles when I press the button, at least none that I can see. CODE from Tkinter import * from random import randint class App: def __init__(self,master): #frame = Frame(master) #frame.pack(side = LEFT) self.plotspc = Canvas(master,height = 100, width = 200, bg = "white") self.plotspc.grid(row=0,column = 2, rowspan = 5) self.button = Button(master, text = "Quit", fg = "red", \ command = master.quit) self.button.grid(row=0,column=0) self.drawbutton = Button(master, text = "Draw", command = \ self.pt([50,50])) self.drawbutton.grid(row = 0, column = 1) def pt(self, coords): coords[0] = coords[0] + randint(-20,20) coords[1] = coords[1] + randint(-20,20) x = (0,5,10) y = (0,10,0) xp = [coords[0] + xv for xv in x] yp = [coords[1] + yv for yv in y] ptf = zip(xp,yp) self.plotspc.create_polygon(*ptf) if _name_ == "_main_": root = Tk() app = App(root) root.mainloop() The code is formatting strangely within the code tags, I have no idea how to fix this.

    Read the article

  • Check if cookie exists if not create it.

    - by Ozaki
    TLDR: Want to check if cookie exists, if it doesn't create it. Am using jquery1.4.2 and jquery cookie, I know this is probably very simple but I just cant get my head right at the moment. I want to: Check to see if a cookie with name of "query" exists If so nothing. If not create a cookie "query" with a value of 1. But only if it doesn't already exist. Thanks in advance

    Read the article

  • Explain this C++ operator definition

    - by David Johnstone
    I have the following operator defined in a C++ class called StringProxy: operator std::string&() { return m_string; } a) What is this and how does this work? I understand the idea of operator overloading, but they normally look like X operator+(double i). b) Given an instance of StringProxy, how can I use this operator to get the m_string?

    Read the article

  • Known "Z notation" applications ?

    - by Amadeus45
    I was just remembering back my university classes and was wondering to know if anyone out here even used the "Z notation" in a professional environment. I honestly must say that it was the single most boring class that I have ever attended in my life. Maybe because of the teacher, but at the time we really all thought it was a big waste of time. I might have been wrong, which is why I'd like to hear you about it. If you are using it or some derived language (Z++), I'd just like to know how is it useful for you. Just curious to know some commonly-known applications of Z or your application. For those who are not familiar : http://staff.washington.edu/jon/z/z-examples.html

    Read the article

  • Installing Android SDK

    - by VBeginner
    I'm relatively new to Java development and never installed an SDK before. I have Eclipse and downloaded the Android SDK. It says I have Android SDK tools installed. Not sure what I'm doing wrong. I also just downloaded NetBeans. Is NetBeans compatible with Android SDK? I'm so lost. Thanks.

    Read the article

  • mysql to get depth of record, count parent and ancestor records

    - by Nate
    Hey All, Say I have a post table containing the fields post_id and parent_post_id. I want to return every record in the post table with a count of the "depth" of the post. By depth, I mean, how many parent and ancestor records exist. Take this data for example... post_id parent_post_id ------- -------------- 1 null 2 1 3 1 4 2 5 4 The data represents this hierarchy... 1 |_ 2 | |_ 4 | |_ 5 |_ 3 The result of the query should be... post_id depth ------- ----- 1 0 2 1 3 1 4 2 5 3 Thanks in advance!

    Read the article

  • How to pass an enum to Html.RadioButtonFor to get a list of radio buttons in MVC 2 RC 2, C#

    - by Matt W
    Hi, I'm trying to render a radio button list in MVC 2 RC 2 (C#) using the following line: <%= Html.RadioButtonFor(model => Enum.GetNames(typeof(DataCarry.ProtocolEnum)), null) %> but it's just giving me the following exception at runtime: Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions. Is this possible and if so, how, please? Thanks, Matt.

    Read the article

  • Scrollable div on iPhone without using 2 fingers?

    - by Brad Parks
    Hi there; I've got a UIWebView embedded in my iPhone app, and I'd like to keep a locked header and footer DIV on the page at all times, with a scrollable center DIV. I know that I could do this using a header/footer that are UIView controls, but I want the header and footer to be HTML divs, as a pure HTML/JS/CSS solution will be easier to port to Android/PalmPre/AdobeAir, which is going to be on my todo list relatively soon. I can do this using techniques like the one mentioned here: http://defunc.com/blog/?p=94 But this requires that the user use 2 fingers to scroll the div, which is not satisfactory to me... Any suggestions on how to do this? Thanks, Brad

    Read the article

  • ASP.NET: CSS friendly calendar control

    - by pbz
    I'm using the built-in Calendar control. It works, but in a few places the way the HTML is rendered is broken or not CSS-friendly and unfortunately cannot be changed (it's hard coded). I was hoping they would fix this in .NET 4.0, but as far as I can tell the Calendar control hasn't been changed at all. Also, as far as I know, there's no CSS adapter for the Calendar control. So, I would need a control that would: Allow me to customize the content of each cell (like OnDayRender works) Allow me to assign CSS classes to any HTML it may render Not render anything automatically that cannot be turned off, except layout code No auto-postback or auto-JS code (I can handle these by hand using simple links or custom JS calls) Basically a simple calendar view control that would give me full rendering control. What would you recommend? Thanks!

    Read the article

  • Display the next frame of sprite GDI

    - by nXqd
    I've a sprite which contains a lot of images. I see the BitBlt only display the position and imageWidth and imageHeight. If I want to display a bitmap but only from Width[24] to Width[48] not from the beginning of that bitmap Thanks for reading this :)

    Read the article

  • Deploy RoR on Apache 1.3 without admin permissions

    - by blinry
    At work I have a SuSE 7.3 running Apache 1.3.20, which I don't have admin access to. I'd like to deploy Ruby on Rails with no or very little work for the admins. I need the service to keep running all the time, even if the server is rebooted, I need it to run faster than CGI-Speed and I'd like to have a simple domain without ports. What are my options?

    Read the article

  • My object becomes NSCFArray when running on iPhone

    - by cagreen
    I'm really scratching my head on this one: I have an object (MyObject) which I instantiate, and this object has an NSArray member variable. The following simple code working in the sim: MyObject *myObj = [[MyObject alloc] init]; NSArray *arr = [myObj myMemberArray]; When I hover over myObj in XCode the tooltip reads "MyObject". Good! But when I debug it on the device (OS 3.1.3) I get: "[NSCFArray myMemberArray]: unrecognized selector sent to instance ... " When I hover over myObj, sure enough it reads "NSCFArray". Can anyone give me some pointers on where to go next with this? Thanks.

    Read the article

  • asp.net - pdf printing status

    - by BhejaFry
    Hi folks, I need to print PDF's generated in an asp.net application using crystal reports. Upon printing, a database table gets updated with the status 'printed'. How do we handle situation where let's say, the printer runs out of paper? I know this is on client-side, so what's the right way to handle issues like this? TIA

    Read the article

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