Daily Archives

Articles indexed Wednesday June 2 2010

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

  • Best Practice for Uploading Many (2000+) Images to A Server

    - by bob
    Hello, I have a general question about this. When you have a gallery, sometimes people need to upload 1000's of images at once. Most likely, it would be done through a .zip file. What is the best way to go about uploading this sort of thing to a server. Many times, server have timeouts etc. that need to be accounted for. I am wondering what kinds of things should I be looking out for and what is the best way to handle a large amount of images being uploaded. I'm guessing that you would allow a user to upload a zip file (assuming the timeout does not effect you), and this zip file is uploaded to a specific directory, lets assume in this case a directory is created for each user in the system. You would then unzip the directory on the server and scan the user's folder for any directories containing .jpg or .png or .gif files (etc.) and then import them into a table accordingly. I'm guessing labeled by folder name. What kind of server side troubles could I run into? I'm aware that there may be many issues. Even general ideas would be could so I can then research further. Thanks! Also, I would be programming in Ruby on Rails but I think this question applies accross any language.

    Read the article

  • how to find hidden information

    - by user356029
    hye im newbie here.. im looking for a hidden information in a source code..in the page, the information is visible but when i try to find it in the source code, the information is not there..but behind the code it has [script type = "text/javascript].. i believe the information i need is in between the javascript..my question is, how to get the information between the javascript?..it has the innerHtml code between the javascript..any one can help?

    Read the article

  • AssemblyLoadException in postsharp, problem with arguments from referenced DLLs?

    - by RodH257
    I'm just starting out with postsharp/AOP. I want to make some instrumentation for C# to track the usage of some addins that I write for a peice of software. I am trying to use the OnMethodBoundaryAspect class to take note of the values of some of the parameters when the method is called. Those parameters are types which are referenced in an external DLL. When I add my attribute to the method, the project won't build, I get the following error Error 2 Unhandled exception (2.0.5.1204, 64 bit, CLR 2.0, Release): PostSharp.CodeModel.AssemblyLoadException: Error while loading the assembly "C:\Program Files\Autodesk\Revit Structure 2011\Program\RevitAPI.dll": Could not load file or assembly 'revitapi, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) The REvitAPI.dll is the file with the type in it. I've also tested just adding the attribute to the project but not applying it to any methods, this also causes the error. So it appears its not related to the method parameter types itself, but merely the existence of this DLL. Has anyone come across this issue before, or can anyone point me in the right direction of where to get some more info on this?

    Read the article

  • PHP Convert variable names to lowercase?

    - by VeeBee
    I have an api listener script which takes in get parameters. But I seem to be having issues when users tend to pass mixed case variable names on the parameters. For example: http://mylistenerurl.com?paramName1=Hello&paramname2=World I need my listener to be flixible in such a way that the variable names will be interpreted case-insensitively or rather still all in lower case like after I process the query string on some function, they are all returned as lower-cased variables: extract(someFunction($_GET)); process($paramname1, $paramname2); Can anybody shed some light on this? *much appreciated. thanks!

    Read the article

  • unable to access Bluetooth in emulator

    - by Abhijeet
    I want to run Bluetooth chat apps, but my emulator is unable to switch Bluetooth on . I am using Android 2.2 . The Bluetooth option is not being highlighted in the emulator . Please anyone tell me , how to activate Bluetooth on the emulator . Thanks in advance Abhijeet

    Read the article

  • How to pass ctor args in Activator.CreateInstance?

    - by thames
    I need a performance enhanced Activator.CreateInstance() and came across this article by Miron Abramson that uses a factory to create the instance in IL and then cache it. (I've included code below from Miron Abramson's site in case it somehow disappears). I'm new to IL Emit code and anything beyond Activator.CreateInstance() for instantiating a class and any help would be much appreciative. My problem is that I need to create an instance of an object that takes a ctor with a parameter. I see there is a way to pass in the Type of the parameter, but is there a way to pass in the value of the ctor parameter as well? If possible, I would like to use a method similar to CreateObjectFactory<T>(params object[] constructorParams) as some objects I want to instantiate may have more than 1 ctor param. // Source: http://mironabramson.com/blog/post/2008/08/Fast-version-of-the-ActivatorCreateInstance-method-using-IL.aspx public static class FastObjectFactory { private static readonly Hashtable creatorCache = Hashtable.Synchronized(new Hashtable()); private readonly static Type coType = typeof(CreateObject); public delegate object CreateObject(); /// /// Create an object that will used as a 'factory' to the specified type T /// public static CreateObject CreateObjectFactory() where T : class { Type t = typeof(T); FastObjectFactory.CreateObject c = creatorCache[t] as FastObjectFactory.CreateObject; if (c == null) { lock (creatorCache.SyncRoot) { c = creatorCache[t] as FastObjectFactory.CreateObject; if (c != null) { return c; } DynamicMethod dynMethod = new DynamicMethod("DM$OBJ_FACTORY_" + t.Name, typeof(object), null, t); ILGenerator ilGen = dynMethod.GetILGenerator(); ilGen.Emit(OpCodes.Newobj, t.GetConstructor(Type.EmptyTypes)); ilGen.Emit(OpCodes.Ret); c = (CreateObject)dynMethod.CreateDelegate(coType); creatorCache.Add(t, c); } } return c; } } Update to Miron's code from commentor on his post 2010-01-11 public static class FastObjectFactory2<T> where T : class, new() { public static Func<T> CreateObject { get; private set; } static FastObjectFactory2() { Type objType = typeof(T); var dynMethod = new DynamicMethod("DM$OBJ_FACTORY_" + objType.Name, objType, null, objType); ILGenerator ilGen = dynMethod.GetILGenerator(); ilGen.Emit(OpCodes.Newobj, objType.GetConstructor(Type.EmptyTypes)); ilGen.Emit(OpCodes.Ret); CreateObject = (Func<T>) dynMethod.CreateDelegate(typeof(Func<T>)); } }

    Read the article

  • why restoring database never finishes?

    - by LingAi
    Hi all, I have really wired problems here. I am using MS 2008 sql server at the moment. After I did a tail-log backup, the target database is automatically restoring and keeping on restoring. Does anyone know what's the problem? Thanks, Ling

    Read the article

  • Burn DVD mastered format DVD+R

    - by Zeus
    Using windows Vista, can I write DVD+R discs using mastered format? I've followed the instructions here But when I get to step 6, it gives an error "There was an error burning this disc. The disc might no longer be usable" There are no dollar signs in my files or extensions, and I have plenty of free space on my HD. I can successfully make a data disc using "live" format. Unfortunately my colleges home (XP) PC is unable to read it, despite the fact that it works on other XP machines at work... so I thought I'd try making a mastered one for greater compatibility. Any ideas?

    Read the article

  • the more DVDs at the same time , the slower the burning!

    - by sajad
    hi i'm using nero to burn multi DVDs at the same time. When i burn 1 DVD at one time it takes about 8 mins to finish. but when i try to burn 4 DVDs at the same time, it takes about 40 mins! why does it take too longe to burn multi DVDs at the same time? i don't have any problem with hardware because when i'm burning dvds , less than 20 % of my cpu & RAM are in use. thx in advance.

    Read the article

  • How to load JPG file into NSBitmapImageRep?

    - by Adam
    Objective-C / Cocoa: I need to load the image from a JPG file into a two dimensional array so that I can access each pixel. I am trying (unsuccessfully) to load the image into a NSBitmapImageRep. I have tried several variations on the following two lines of code: NSString *filePath = [NSString stringWithFormat: @"%@%@",@"/Users/adam/Documents/phoneimages/", [outLabel stringValue]]; //this coming from a window control NSImageRep *controlBitmap = [[NSImageRep alloc] imageRepWithContentsOfFile:filePath]; With the code shown, I get a runtime error: -[NSImageRep imageRepWithContentsOfFile:]: unrecognized selector sent to instance 0x100147070. I have tried replacing the second line of code with: NSImage *controlImage = [[NSImage alloc] initWithContentsOfFile:filePath]; NSBitmapImageRep *controlBitmap = [[NSBitmapImageRep alloc] initWithData:controlImage]; But this yields a compiler error 'incompatible type' saying that initWithData wants a NSData variable not an NSImage. I have also tried various other ways to get this done, but all are unsuccessful either due to compiler or runtime error. Can someone help me with this? I will eventually need to load some PNG files in the same way (so it would be nice to have a consistent technique for both). And if you know of an easier / simpler way to accomplish what I am trying to do (i.e., get the images into a two-dimensional array), rather than using NSBitmapImageRep, then please let me know! And by the way, I know the path is valid (confirmed with fileExistsAtPath) -- and the filename in outLabel is a file with .jpg extension. Thanks for any help!

    Read the article

  • RESTful idempotence

    - by DutrowLLC
    I'm designing a RESTful web service utilizing ROA(Resource oriented architecture). I'm trying to work out an efficient way to guarantee idempotence for PUT requests that create new resources in cases that the server designates the resource key. From my understanding, the traditional approach is to create a type of transaction resource such as /CREATE_PERSON. The the client-server interaction for creating a new person resource would be in two parts: Step 1: Get unique transaction id for creating the new PERSON resource::: **Client request:** GET /CREATE_PERSON **Server response:** 200 OK transaction-id:"as8yfasiob" Step 2: Create the new person resource in a request guaranteed to be unique by using the transaction id::: **Client request** PUT /CREATE_PERSON/{transaction_id} first_name="Big bubba" **Server response** 201 Created // (If the request is a duplicate, it would send this PersonKey="398u4nsdf" // same response without creating a new resource. It // would perhaps send an error response if the was used // on a transaction id non-duplicate request, but I have // control over the client, so I can guarantee that this // won't happen) The problem that I see with this approach is that it requires sending two requests to the server in order to do to single operation of creating a new PERSON resource. This creates a performance issues increasing the chance that the user will be waiting around for the client to complete their request. I've been trying to hash out ideas for eliminating the first step such as pre-sending transaction-id's with each request, but most of my ideas have other issues or involve sacrificing the statelessness of the application. Is there a way to do this?

    Read the article

  • Wrap text around a right-aligned icon?

    - by user246114
    Hi, Is it possible to make a small box (which will be a row element in a list for me) with an icon in the upper right corner, and text wrapped around it? Something like: ------------------------------------------------- | Some text here which may wrap around [icon] | | if it were to get too long, but then fit well | | around the icon in the upper right corner? | ------------------------------------------------- I was going to use this as a row in a list, and the user could click the icon in the upper-right to delete the row. I could use either a <div> or a <table>, I'm not sure which will be better?: <div> <p>The text</p> <img src="close.png" align="upper-right"> </div> Thanks

    Read the article

  • Is it possible to show the download progress of a flash file?

    - by Ólafur Waage
    I know how to setup a preloader and I have that working. But when I debug the flash application and simulate a download, it has a blank background until a few seconds have passed. I know it is "downloading" the swf file and I'm wondering if I can show a progress bar for that, or do I need to have the swf file as small as possible and pre load everything needed and have all assets as a separate file I fetch? I found something with ProgressEvent.PROGRESS but this only loads after the flash file is finished downloading.

    Read the article

  • Samples of Scala and Java code where Scala code looks simpler/has fewer lines?

    - by Roman
    I need some code samples (and I also really curious about them) of Scala and Java code which show that Scala code is more simple and concise then code written in Java (of course both samples should solve the same problem). If there is only Scala sample with comment like "this is abstract factory in Scala, in Java it will look much more cumbersome" then this is also acceptable. Thanks!

    Read the article

  • Detecting struckout text in a cell using JExcelApi

    - by Geo
    I need to detect whether the text within a cell is struck out or not. I'm using this: Cell cc = sheet.getCell("B1"); CellFormat format = cc.getCellFormat(); System.out.println(format.getFont().isStruckout()); but I remember I read somewhere that CellFormat is deprecated and CellFeatures should be used instead. How could one find out whether a text is struck out using CellFeatures?

    Read the article

  • Android rawQuery help

    - by dweebsonduty
    I was wondering how I could query my database of 1400 items and get only the DISTINCT types and row ids. Below is the actual sql that I want to run by my program crashes if I dont return ids. return mDb.rawQuery("SELECT DISTINCT Type from the_foods",null); Any ideas?

    Read the article

  • How to get stack trace of a running process from a Visual Studio add-in?

    - by Jack
    I am writing a Visual Studio add-in in C# and I need access to the currently running process' stack trace. I tried putting this code into my add-in but it returns the add-in's stack trace, not the process I am debugging. System.Diagnostics.StackTrace stacktrace = new System.Diagnostics.StackTrace(true); System.Diagnostics.StackFrame stackframe = stacktrace.GetFrame(0); Any help would be appreciated.

    Read the article

  • How to zoom in google map (J2ME)

    - by Nivek
    Hi all, I am trying to develop a J2ME application that could retrieve the google map by passing in the GPS coordinates. From http://wiki.forum.nokia.com/index.php/Google_Maps_API_in_Java_ME, it provides the Utility method for map scrolling. Basically it states that i need to include MicroFloat library in my project. Here's what i did (Not sure if i am doing it right) Create a project, build the code. Add the jar file into my current project lib. but i am still getting error from codes. Example double LToY(double y) { return Math.round( offset - radius * Double.longBitsToDouble(MicroDouble.log( Double.doubleToLongBits( (1 + Math.sin(Math.toRadians(y))) / (1 - Math.sin(Math.toRadians(y))) ) )) / 2); } Am i missing any import statment??? Btw i am using netbeans 6.5. Thanks for any guidance... Kevin

    Read the article

  • php email marketing open source

    - by Bharanikumar
    Hi, Anyone knows about some free open source php library or framework to implement following service independently. Email Marketing , Which include following service in that , send email , choose email template , Choose email template from local drive , text template , Account management like History email list , and more , Payment Integration , Thanks bharanikumar

    Read the article

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