Search Results

Search found 3243 results on 130 pages for 'artwork creation'.

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

  • benefit of having a factory for object creation?

    - by ajsie
    I'm trying to understand the factory design pattern. I don't understand why it's good to have a middleman between the client and the product (object that the client wants). example with no factory: $mac = new Mac(); example with a factory: $appleStore = new AppleStore(); $mac = $appleStore->getProduct('mac'); How does the factory pattern decouple the client from the product? Could someone give an example of a future code change that will impact on example 1 negative, but positive in example 2 so I understand the importance of decoupling? Thanks.

    Read the article

  • PHP UTC Timestamp Creation

    - by Ajith
    I am using ubuntu(apache) for my php application.i need to create a timestamp for authenticated call of a webservice.In php i getting only 10 digit timestamp like 1273229733.But i need to create like 1273229613000 .How can i solve this problem.help me please.

    Read the article

  • Javascript plugin creation

    - by Aneesh
    I want to create a plugin called 'myPlugin'. Which method should I use and what is the difference between these two methods? Please tell me the advantages too. I am from designing background and not much programming knowledge. var myPlugin = { myId:"testId", create:function(){}, destroy:function(){} } OR function myPlugin() { this.myId = "testId"; this.create = function(){}; this.destroy = function(){}; }

    Read the article

  • Permission denied for folder creation using background_fu

    - by Anubhaw
    Hi All, I am calling a controller method to convert a video file. This process is called using background_fu job. When the function tries to create a new folder in rails root it gives error i.e. Permission denied. The function performs well if not called in background job process. Can any one point out what can be the trouble. Thanks in advance, Anubhaw

    Read the article

  • How to verify object creation in Django ?

    - by Martin
    So.. this never crossed my head before but now I just can't figure out how to do that !! I want to verify that the object I created was really created, and return True or False according to that : obj = object(name='plop') try: obj.save() return True except ???: return False Any idea ? Cheers, -M

    Read the article

  • Creation of AsyncTask taking too much time Android

    - by user2842342
    I am making a network call in an AsyncTask, but the problem i am facing is the amount of time it is taking to start the doInBackground method. Here is a part of my code: button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d("Temp:",System.currentTimeMillis()+""); new Move().execute(); /*some other logic } } And my AsyncTask is: private class Move extends AsyncTask<Void, Void, Void> { @Override protected Void doInBackground(Void... temp) { Log.d("start:",System.currentTimeMillis()+""); gson.fromJson(Web.Request.get(some_URL),Void.class); Log.d("end:",System.currentTimeMillis()+""); return null; } } These are the logs i got: 32658-998/com.example.game D/temp:? 1408923006159 32658-998/com.example.game D/start:? 1408923035163 32658-998/com.example.game D/end:? 1408923035199 So actually it took almost 29 secs to reach the first line in doInBackground method, where as it took just 36 ms to finish the network call. I tried it many times, the time taken is almost in the same order. Is it possible to start the AsyncTask immediately? Or is there any other way to solve this problem.(other than a running a simple thread?) Thank you :)

    Read the article

  • Time for creation of database on site

    - by slo2ols
    Hi. When and where would you create database to develop web site using ASP.NET MVC 2 and Entity Framework 4 (CreateDatabase method). I think about first run of web site and redirect on welcome page, when controller creates database from model. But I doubt about details: 1. Where? In HttpModule, but request of any image or css will check that database exist. In custom RouteHandler, but then anybody need to know that need to use this handler when to add route. In BaseController, but then code will look like SomeController(..., IDatabase database) : base(database). 2. When? Better create database on first run by any url or may be on deployment of site (additional tool which create ObjectContext and invoke CreateDatabase)? Thanks.

    Read the article

  • Singleton Creation preference

    - by cwieland
    You can create singletons in a variety of ways. I am wondering which is better between these. +(ServerConnection*)shared{ static dispatch_once_t pred=0; __strong static id _sharedObject = nil; dispatch_once(&pred, ^{ _sharedObject = [[self alloc] init]; // or some other init method }); return _sharedObject; } I could see that this compiles down to something very fast. I would think that checking the predicate would be another function call. The other is: +(ServerConnection*)shared{ static ServerConnection* connection=nil; if (connection==nil) { connection=[[ServerConnection alloc] init]; } return connection; } Are there any major differences between the two? I know these are probably similar enough to not worry about it. But Just wondering.

    Read the article

  • jquery plugin: creation

    - by user1542535
    The output am expecting is an unordered list which am creating with jquery...which takes in put from a json file (which works fine when i dont create it as a plugin). Am very new with the concept of building a plugin. i've tried to create one which doesnt output my unordered list json file structure { "Categories": [ { "cat_id":"1", "name":"Main Menu1", "sub_categories":[ { "cat_id":"10", "name":" Sub Menu11", "sub_level_one_link":"http:\/\/one.com" }, my js file //create plugin jQuery.fn.emrMenu= function (options) { myoptions = jQuery.extend ({ url: "error" }, options); if (myoptions.url=="error") { alert("Error:No data recieved"); return false; } $(this).html (myoptions.url); return this.each (function () { //alert(myoptions.url+this.id); $.getJSON(myoptions.url, function(data) { $.each(data.Categories, function(i, category) { alert("test1"); //get all sub menu items in list indexes var submenudata=''; $.each(category.sub_categories, function(i, sub_categories) { submenudata += "<li><a href='"+sub_categories.sub_level_one_link+"' <span>"+sub_categories.name+"</span></a></li>"; }); var menudata ="<li id='"+category.cat_id+"' class='has-sub '><a href='#'><span>"+category.name+"</span></a><ul>"+submenudata+"</ul></li>"; //stringify unordered list and bind to div var menu="<ul>"+menudata+"</ul>"; // $(menu).appendTo("#"this.id); }); }); //alert (this.id); }); } and am calling the plugin: <script> $(document).ready(function() { $('#menu_n').emrMenu ({ url: "menu_data.json"}); }); </script> I'am pretty confused at this point any help is greatly appreciated cheers!

    Read the article

  • Python Code Creation

    - by user3677715
    I've been trying to make a simple code where a = e, b = z, and so forth. This is what I have in python so far: done = False while not done: Letter = input("Letter:") if Letter == "a": print("e") if Letter == "e": print("a") if Letter == "b": print("z") if Letter == "z": print("b") if Letter == "c": print("x") if Letter == "x": print("c") if Letter == "d": print("w") if Letter == "w": print("d") if Letter == "f": print("v") if Letter == "v": print("f") input = input("Start over? Y/N :") if input == "N": done = True With this, I can put in only letters, not words. How can I string together multiple letters to create a word? Thanks

    Read the article

  • red-black tree - construction

    - by Chaitanya
    Recently, I have been going through search trees and I encountered red-black trees, the point confusing me is, In r-b tree, the root node should be black thats fine, now how will I decide whether the incoming node assumes red or black color. I have gone through the wiki article but have not found a solution for this. I might be wrong, but I would be happy if someone can guide me through the exact material. Thank you.

    Read the article

  • Dynamically creating controls in MFC (Collection question)

    - by ProgramWriter
    Hello all, I have some custom control inside of which i should create radiobuttons or checkboxes. The count of child controls is available only at runtime (it loads some file from which it gets this count). So i need to create variable number of controls. Which collection i should use for this purpose? Solution 1: simply use std::vector (or CArray) - not suitable because i want use MFC (CButton). Of course i can Attach() and later Detach() handle to window each time i need this window, but it will give big overhead. Solution 2: use std::vector or CArray or CList or... In this case i take care about making 'new' and appropriate 'delete' when control is unneeded. I am forgetful :) MFC handle map contains pointer to CButton and i can't use simple CArray, because it will move my objects each time when his size will grow. ... and the question is: Which collection i should use for containing variable count of MFC control classes?

    Read the article

  • Creating XML document in jQuery environment

    - by satts
    Have referred to JQuery docs where they mention this piece of code. var xmlDocument = [create xml document]; $.ajax({ url: "page.php", processData: false, data: xmlDocument, success: handleResponse }); but i am trying to make the same request in Adobe AIR environment its giving a parse error. Is there any specific way of creating an xml Document using jQuery.

    Read the article

  • Add new SVN "repo" in poorly constructed repo/project setup

    - by Dave Masselink
    Unfortunately, the answer to this question isn't quite as simple as it sounds... but I hope it can still be relatively simple. Please read all the way through before telling me that the answer is: "svnadmin create... duh" I'm working for a company that set up their SVN server in an odd way (at least in terms of what I'm used to). We've all been there, right? Rather than giving each project a separate repository... they have a folder on the server called "/var/www/svn/repos/" which is the actual SVN repo (has conf/, db/, README.txt, etc. in it). Then they distinguish their projects by adding top level folders into the ONE repository (ex: Project1, Project2, etc.) I don't like this setup and might one day get around to converting the setup to what I'm used to, where each project is its own repository (with separate logs, dbs, etc.) But my question is this: What is the best way to add a new empty project to the current setup? Is there anyway to add a new top level folder/project to the repo through use of svnadmin? It can/should just be an empty folder that I'll start building a new project in. I know that I could do this by checking out the whole singular repository and then adding a new top level folder into my local checkout, then re-committing. But I'd really prefer not to do this because someone has created folders/projects that are just GBs of log data... and I don't want to wait through the download of this just to add a single empty folder. Let me know if there is any more info you'd need to know. I do have root/sudo access on the server in question. Thanks in advance for your help! Dave

    Read the article

  • On-line business card creator with PDF proof

    - by Adam
    I'm doing some research, and looking to create a simple on-line business card creator. I need to give users the ability to pick a business card template and then update the text with their own information. Then I need to create a PDF proof for the user to sign off on, as well as create a hi-rez pdf for print. Can anyone point me in the right direction? I'm trying to find some resources on how to create the PDF Heres a quick example I found of what I'm trying to do. https://www.staplescopyandprint.ca/PrintOnline/InputFields.aspx?type=PersonalCard Any input at this point would be a big help thanks!

    Read the article

  • Does a lazy-programmer file auto-generator tags exist?

    - by Anthony Forloney
    I was wondering (if possible) if there was a program/tool/utility that when I create a new file and provide it with an extension that it creates the tags automatically? For example, a new file I create called index.php would have the appropriate tags auto-generated inside: <?php ?> I hope you get the idea. Does one, or could one, exist, preferably Windows based? Any information regarding this would be helpful.

    Read the article

  • Creating objects makes the VM faster?

    - by Sudhir Jonathan
    Look at this piece of code: MessageParser parser = new MessageParser(); for (int i = 0; i < 10000; i++) { parser.parse(plainMessage, user); } For some reason, it runs SLOWER (by about 100ms) than for (int i = 0; i < 10000; i++) { MessageParser parser = new MessageParser(); parser.parse(plainMessage, user); } Any ideas why? The tests were repeated a lot of times, so it wasn't just random. How could creating an object 10000 times be faster than creating it once?

    Read the article

  • Make object by it's name

    - by Ockonal
    Hello, is it possible to return exemplar of object using passed type name (string) in c++? I have some base abstract class Base and a few derivates. Example code: class Base { /* ... */ }; class Der1 : public Base { /* ... */ }; class Der2 : public Base { /* ... */ }; And I need function like: Base *objectByType(const std::string &name); Number of derivates classes are changeable and I don't want to make something like switching of name and returning by hands new object type. Is it possible in c++ to do that automatically anyway? p.s. usage should looks like: dynamic_cast<Der1>(objectByType("Der1")); I need pure c++ code (crossplatform). Using boost is permissible.

    Read the article

  • How do I add artwork to an iTunes track with obj-c AppleScript?

    - by demonslayer319
    aTrack is an ITReference* object, value is an NSImage* object, initialized via a URL to a jpeg. [[[[[aTrack artworks] data_] set] to:value] send]; I get the following message in GDB: 2010-03-09 16:59:42.860 Sandbox[2260:a0f] Can't pack object of class NSImage (unsupported type): <NSImage 0x10054a440 Size={0, 0} Reps=( I then tried the following code: NSData *imageData = [[NSData alloc] initWithData:[value TIFFRepresentation]]; [[[[[aTrack artworks] data_] set] to:imageData] send]; and get this message instead 2010-03-09 16:46:09.341 Sandbox[2193:a0f] Can't pack object of class NSConcreteData (unsupported type): <4d4d002a 00000000> In the AppleScript documentation, it says that the "data" property of the "artwork" item is a PICTPicture image. How do I convert an NSImage to a PICT? Am I using the AppleScript all wrong?

    Read the article

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