Daily Archives

Articles indexed Friday March 12 2010

Page 9/130 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • What is your solution to the FizzBuzz problem?

    - by saniul
    See here Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". Disclaimer: I do realize this is easy, and I understand the content of the Coding Horror post I just linked to

    Read the article

  • MIDP 2.0 version issues: $method is undefined for $type

    - by Kilnr
    Hi, I've written a MIDlet that does several "advanced" things: fetching images from the web, resizing them, saving them on the phone, displaying them. This all works perfectly in the Nokia S60 3rd Edition FP1 emulator. This device has MIDP 2.0 and CLDC 1.1 support (also JSR75, which I need in order to save files). It also works as it should on the Nokia E71 (physical device). I then tried to run the MIDlet on several other emulators. One of them, the DefaultCldcJtwiPhone2 from the Java ME SDK 3.0, also claims MIDP 2.0 and CLDC 1.1 support. It doesn't have JSR75, which explains why "FileConnection can not be resolved to a type". This does not, however, explain why List.deleteAll(), String.equalsIgnoreCase(String) and a few others are undefined. The actual errors that I get: The method ceil(double) is undefined for the type Math The method deleteAll() is undefined for the type List The method equalsIgnoreCase(String) is undefined for the type String The method getWidth() is undefined for the type Displayable When I look at the MIDP 2.0 (i.e. JSR118) API (http://java.sun.com/javame/reference/apis/jsr118/), I can clearly see all of these methods being present, with the "since" tag being either MIDP 2.0 or CLDC 1.1. My question: why doesn't an emulator with MIDP 2.0 support have access to all MIDP 2.0 methods? Or alternatively, what am I doing wrong?

    Read the article

  • WinForms data binding with a Save button?

    - by Mat
    How is data binding in C# WinForms supposed to work when you have a Save button? I don't want the data updated until I press Save! I have two forms (list and detail) backed by a BindingList<T> collection and my custom object from that collection, respectively. I can bind each form to the list or object appropriately. However, any changes made in the detail form are immediately reflected in the list form - I don't want to save the changes and update the details shown in the list until the Save button is pressed. Is data binding designed to support this? Is there a common pattern for doing so? Whichever way I look at it, binding doesn't seem to be able to support this scenario. I've considered the following: Pass a clone of the object to the detail form, but then I have to reconcile the changes on Save - changes may have been made to the copy in the list in the meantime. Implementing IEditableObject and calling EndEdit on save almost works as I can prevent the list being notified of the changes made until Save is pressed, but if something else causes a refresh the list is updated with the interim data. I'm currently left with dispensing with data binding in my detail view, and doing it all manually. Which is rather annoying.

    Read the article

  • How to access GMAIL for storage in custom CRM SQL Server DB?

    - by Optimal Solutions
    I have a client who wants his custom-written CRM to be able to access his sales people's emails so that, effectively, a history of email conversations between customer and salesperson is stored inside the CRM's database. The CRM is written in VB 2008 and the database is SQL Server 2008. The only email these people use, in the shop and on the road, is GMAIL. Each sales person has their own GMAIL address. Thats how they operate. If they're on the road and respond to a customer's email inquiry about a product, they would like that email conversation to be stored in a table in the database. I think thats the part I cant wrap my head around. How to get access to the email data (knowing the user id and password) and doing so from VB 2008

    Read the article

  • Can anyone explain UriMatcher (Android SDK)?

    - by mobibob
    I have been tasked with designing my web services client code to use the utility class UriMatcher in the Android SDK. Unfortunately, the example in the Dev Guide does not relate to anything in my mind. I know I am missing some fundamental points to the functionality and possibly about Uri itself. If you can tie it to some web APIs that are accessible with HTTP POST request, that would be ideal.

    Read the article

  • Using DockPanel Suite's XML saving with My.Settings

    - by Cyclone
    In vb.net, how can I use SaveAsXML and LoadFromXML (DockPanel Suite functions) with My.Settings? I know there is a way to save it to a stream, but I don't know enough about System.IO to do this. DockPanel Suite: http://sourceforge.net/projects/dockpanelsuite/ I would very much prefer to store configuration using My.Settings instead of as an XML file. Thanks for the help! EDIT: Since the only person to answer so far has since deleted their answer, I feel I should explain further: Those two methods can both accept a stream object, but I have not used System.IO enough to know how to properly initialize a stream, let alone get a string out of a stream. EDIT: Googling has gotten me nowhere. EDIT: Still waiting for this. I've tried everything...

    Read the article

  • How do you pass in a value to a subfunction in Matlab I am getting output errors?

    - by Ben Fossen
    Below is my code in Matlab I am having trouble with the line sum = (h/2) * (f(a) + f(b)) + h; Matlab says I have to many outputs when I try to call the f(x) function. Is my problem with the f(x) function function Trapezoid_Uniform(a,b,n) h = (b - a)/n; sum = (h/2) * (f(a) + f(b)) + h; for i = 1:n-1 x = a + i*h; sum = sum + f(x); end sum = sum*h; disp(sum); end function f(z) f = exp(z); end

    Read the article

  • IIS Browser caching not working

    - by Karthik
    Hi, I have enabled caching in IIS 6 for all our static images and CSS(by right clicking on those folders in IIS and enabled Content Expiration after 30 days under HTTP Headers). When I run Google PageSpeed, and look at the resources tab, the status of those images and css shows up as 200, but I was expecting a 304(not modified). When I checked Yahoo.com in Pagespeed, all its images have a 304 status. So my caching is not working? or is this how IIS content expiration works. Any help would be appreciated.

    Read the article

  • Writing a docx file to a BLOB using Java 1.4 inside Oracle 10g

    - by Jon Renaut
    I'm trying to generate a blank docx file using Java, add some text, then write it to a BLOB that I can return to our document processing engine (a custom mess of PL/SQL and Java). I have to use the 1.4 JVM inside Oracle 10g, so no Java 1.5 stuff. I don't have a problem writing the docx to a file on my local machine, but when I try to write to BLOB, I'm getting garbage. Am I doing something dumb? Any help is appreciated. Note in the code below, all the get[name]Xml() methods return an org.w3c.dom.Document. public void save(String fileName) throws Exception { ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(fileName)); addEntry(zos, getDocumentXml(), "word/document.xml"); addEntry(zos, getContentTypesXml(), "[Content_Types].xml"); addEntry(zos, getRelsXml(), "_rels/.rels"); zos.flush(); zos.close(); } public java.sql.BLOB save() throws Exception { java.sql.Connection conn = DbUtilities.openConnection(); BLOB outBlob = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION); outBlob.open(BLOB.MODE_READWRITE); ZipOutputStream zos = new ZipOutputStream(outBlob.setBinaryStream(0L)); addEntry(zos, getDocumentXml(), "word/document.xml"); addEntry(zos, getContentTypesXml(), "[Content_Types].xml"); addEntry(zos, getRelsXml(), "_rels/.rels"); zos.flush(); zos.close(); return outBlob; } private void addEntry(ZipOutputStream zos, Document doc, String fileName) throws Exception { Transformer t = TransformerFactory.newInstance().newTransformer(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); t.transform(new DOMSource(doc), new StreamResult(baos)); ZipEntry ze = new ZipEntry(fileName); byte[] data = baos.toByteArray(); ze.setSize(data.length); zos.putNextEntry(ze); zos.write(data); zos.flush(); zos.closeEntry(); }

    Read the article

  • Change present working directory of a calling shell from a ruby script

    - by Erik Kastman
    I'm writing a simple ruby sandbox command-line utility to copy and unzip directories from a remote filesystem to a local scratch directory in order to unzip them and let users edit the files. I'm using Dir.mktmpdir as the default scratch directory, which gives a really ugly path (for example: /var/folders/zz/zzzivhrRnAmviuee+++1vE+++yo/-Tmp-/d20100311-70034-abz5zj) I'd like the last action of the copy-and-unzip script to cd the calling shell into the new scratch directory so people can access it easily, but I can't figure out how to change the PWD of the calling shell. One possibility is to have the utility print out the new path to stdout and then run the script as part of a subshell (i.e. cd $(sandbox my_dir) ), but I want to print out progress on the copy-and-unzipping since it can take up to 10 minutes, so this won't work. Should I just have it go to a pre-determined, easy-to-find scratch directory? Does anyone have a better suggestion? Thanks in advance for your help. -Erik

    Read the article

  • Is Lucern.net good choice for website search of 1M item product database? (giving up on SQL Server

    - by Pete Alvin
    We currently have in production SQL Server 2005 and we use it's full text search for a eCommerce site search of a million product database. I've optimized it as much as possible (I think) and we're still seeing search times of five seconds. (We don't need site scrawl or PDF (etc.) document indexing features... JUST "Google" speed for site search.) I was going to buy dtSearch but now I realize I can just use Lucerne.net and save the $2,500 for two server license. I read on a post that Lucerne.Net is not good for website searches. Has anyone else used Lucerne.Net from ASP.Net? Does it take a lot of memory? Any problems? Any comments?

    Read the article

  • SQL SERVER – Checklist for Analyzing Slow-Running Queries

    - by pinaldave
    I am recently working on upgrading my class Microsoft SQL Server 2005/2008 Query Optimization and & Performance Tuning with additional details and more interesting examples. While working on slide deck I realized that I need to have one solid slide which talks about checklist for analyzing slow running queries. A quick search on my saved [...]

    Read the article

  • SQLAuthority Book Review – Professional SQL Server 2008 Internals and Troubleshooting

    - by pinaldave
    Professional SQL Server 2008 Internals and Troubleshooting by Christian Bolton, Justin Langford, Brent Ozar, James Rowland-Jones, Steven Wort Link to Amazon (Worldwide) Link to Flipkart (India) Brief Review: Having a book on internal and associating that with real life is “almost” an impossible task. The reason for using the word “almost” is because this book has accomplished this [...]

    Read the article

  • SQLAuthority News – SQL SERVER 2008 R2 Pricing

    - by pinaldave
    I was recently asked question about SQL Server 2008 pricing. I have bookmarked official site here which lists the pricing. Official site: What’s New in SQL Server 2008 R2 Editions Editions Per Processor PricingRetail Per Server Plus CAL PricingRetail Parallel Data Warehouse $57,498 Not offered via Server CAL Datacenter $57,498 Not offered via Server CAL Enterprise $28,749 $13,969 with 25 CALs Standard $7,499 $1,849 with 5 CALs However, I have [...]

    Read the article

  • SQL SERVER – Rollback TRUNCATE Command in Transaction

    - by pinaldave
    This is very common concept that truncate can not be rolled back. I always hear conversation between developer if truncate can be rolled back or not. If you use TRANSACTIONS in your code, TRUNCATE can be rolled back. If there is no transaction is used and TRUNCATE operation is committed, it can not be retrieved from [...]

    Read the article

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