Search Results

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

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

  • django form creation on init

    - by John
    Hi, How can I add a field in the form init function? e.g. in the code below I want to add a profile field. class StaffForm(forms.ModelForm): def __init__(self, user, *args, **kwargs): if user.pk == 1: self.fields['profile'] = forms.CharField(max_length=200) super(StaffForm, self).__init__(*args, **kwargs) class Meta: model = Staff I know I can add it just below the class StaffForm.... line but I want this to be dynamic depending on what user is passed in so can't do it this way. Thanks

    Read the article

  • C++ DLL creation for C# project - No functions exported

    - by Yeti
    I am working on a project that requires some image processing. The front end of the program is C# (cause the guys thought it is a lot simpler to make the UI in it). However, as the image processing part needs a lot of CPU juice I am making this part in C++. The idea is to link it to the C# project and just call a function from a DLL to make the image processing part and allow to the C# environment to process the data afterwards. Now the only problem is that it seems I am not able to make the DLL. Simply put the compiler refuses to put any function into the DLL that I compile. Because the project requires some development time testing I have created two projects into a C++ solution. One is for the Dll and another console application. The console project holds all the files and I just include the corresponding header into my DLL project file. I thought the compiler should take out the functions that I marked as to be exported and make the DLL from them. Nevertheless this does not happens. Here it is how I defined the function in the header: extern "C" __declspec(dllexport) void _stdcall RobotData(BYTE* buf, int** pToNewBackgroundImage, int* pToBackgroundImage, bool InitFlag, ObjectInformation* robot1, ObjectInformation* robot2, ObjectInformation* robot3, ObjectInformation* robot4, ObjectInformation* puck); extern "C" __declspec(dllexport) CvPoint _stdcall RefPointFinder(IplImage* imgInput, CvRect &imgROI, CvScalar &refHSVColorLow, CvScalar &refHSVColorHi ); Followed by the implementation in the cpp file: extern "C" __declspec(dllexport) CvPoint _stdcall RefPointFinder(IplImage* imgInput, CvRect &imgROI,&refHSVColorLow, CvScalar &refHSVColorHi ) { \\... return cvPoint((int)( M10/M00) + imgROI.x, (int)( M01/M00 ) + imgROI.y) ;} extern "C" __declspec(dllexport) void _stdcall RobotData(BYTE* buf, int** pToNewBackgroundImage, int* pToBackgroundImage, bool InitFlag, ObjectInformation* robot1, ObjectInformation* robot2, ObjectInformation* robot3, ObjectInformation* robot4, ObjectInformation* puck) { \\ ...}; And my main file for the DLL project looks like: #ifdef _MANAGED #pragma managed(push, off) #endif /// <summary> Include files. </summary> #include "..\ImageProcessingDebug\ImageProcessingTest.h" #include "..\ImageProcessingDebug\ImageProcessing.h" BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { return TRUE; } #ifdef _MANAGED #pragma managed(pop) #endif Needless to say it does not work. A quick look with DLL export viewer 1.36 reveals that no function is inside the library. I don't get it. What I am doing wrong ? As side not I am using the C++ objects (and here it is the C++ DLL part) such as the vector. However, only for internal usage. These will not appear in the headers of either function as you can observe from the previous code snippets. Any ideas? Thx, Bernat

    Read the article

  • Define keys in temporary table creation

    - by imperium2335
    How do I define the keys for a temporary table that is being created from a SELECT statement? I have: CREATE temporary TABLE _temp_unique_parts_trading engine=memory AS (SELECT parts_trading.enquiryref, sellingcurrency, jobs.id AS jobID FROM parts_trading, jobs WHERE jobs.enquiryref = parts_trading.enquiryref GROUP BY parts_trading.enquiryref) But where do I define the keys?

    Read the article

  • Creation of website

    - by Neelu
    Dear Friends What all things we should keep in mind for creating website? What are the standards everyone follows? I want to know in & out of the websites. I want to create by my own. Please guide me some useful steps. Thanks in advance

    Read the article

  • php quick form creation

    - by Akshey
    Hi, I have been using php from some time and I have noticed that it takes a long time to create a form with validation using php. Are there any scripts or IDE wizards which can assist a programmer to create php forms quickly and also give the programmer flexibility to customize the form easily? I found some webservices which provide such services but they are mostly oriented towards non-programmers and the forms they generate are not easily customizable and do not support all kinds of functionalities. Infact, most of them are meant for generating contact forms. Regards, Akshey

    Read the article

  • L-Soft LISTSERV TCPGUI Interface for PHP Creation

    - by poolnoodl
    I'm trying to use LISTSERV's "API" in PHP. L-Soft calls this TCPGUI, and essentially, you can request data like over Telnet. To do this, I'm using PHP's TCP socket functions. I've seen this done in other languages but can't quite convert it to PHP. I can connect, I can change set ASCII or BINARY mode. But I can never quite craft the header packet the way I need to authenticate, so I'm thinking I'm messing up my conversion. C: http://www.lsoft.com/manuals/16.0/htmlhelp/advanced%20topics/TCPGUI.html#2334328 $origin = '[email protected]'; $pwd = 'password'; $host = "example.com"; $port = 2306; $email = "[email protected]"; $list = "mailinglist"; $command = "Query $list FOR $email"; $fp = stream_socket_client("tcp://$host:$port", $errno, $errstr, 30); $cmd = $command . " PW=" . $pwd; $len = strlen($cmd); $orglen = strlen($origin); $n = $len + $orglen + 1; $headerPacket[0] = "1"; $headerPacket[1] = "B"; $headerPacket[2] = "\r"; $headerPacket[3] = "\n"; $headerPacket[4] = ord($n / 256); $headerPacket[5] = ord($n + 255); $headerPacket[6] = ord($orglen); for ($i = 0; $i < $orglen; $i++) { $headerPacket[$i + 7] = ord($origin[$i]); } for ($i = 0; $i < $len; $i++) { $cmdPacket[$i] = ord($cmd[$i]); } fwrite($fp, implode($headerPacket)); while (!feof($fp)) { echo fgets($fp, 1024); } Any thoughts on where I'm going wrong? I'd much appreciate it if anyone could point me toward some code to do this, days of googling and searching here on SO has only lead me to examples in other languages. Of course, if you know C (or Java or Perl as linked below in my comment to bypass the spam filter), PHP, and socket programming fairly well, you could probably rewrite the whole of the code in an hour, maybe a few minutes. You'd have my eternal thanks for that.

    Read the article

  • Version control for subtitle creation

    - by user3635
    We make subtitles for a TV series and I plan to use a VCS for it. The structure of project directory is like this: series/ episode1/nameofepisode1.str episode2/nameofepisode2.str episode3/nameofepisode3.str ... Question: When I finish subtitle of an episode, I want to assign release tag for this episode (episode1_v1). I wanted to use git for this, but in git tag is assigned only to the whole repository. What to do, so that I can view every episode progress separately? Maybe there are some more suitable VCS for this?

    Read the article

  • Hooking entity creation in SQLAlchemy

    - by Dan Ellis
    I want to write a SessionExtension that fires a 'Foo-created' event or 'Bar-created' event every time a new Foo or new Bar is committed to the database. However, once inside the after_commit method, I don't know where to find which entities have been committed. Where do I get this information?

    Read the article

  • Android -- Object Creation/Memory Allocation vs. Performance

    - by borg17of20
    Hello all, This is probably an easy one. I have about 20 TextViews/ImageViews in my current project that I access like this: ((TextView)multiLayout.findViewById(R.id.GameBoard_Multi_Answer1_Text)).setText(""); //or ((ImageView)multiLayout.findViewById(R.id.GameBoard_Multi_Answer1_Right)).setVisibility(View.INVISIBLE); My question is this, am I better off, from a performance standpoint, just assigning these object variables? Further, am I losing some performance to the constant "search" process that goes on as a part of the findViewById(...) method? (i.e. Does findsViewById(...) use some sort of hashtable/hashmap for look-ups or does it implement an iterative search over the view hierarchy?) At present, my program never uses more than 2.5MB of RAM, so will assigning 20 or so more object variables drastically affect this? I don't think so, but I figured I'd ask. Thanks.

    Read the article

  • Generate encoding String according to creation order.

    - by Tony
    I need to generate encoding String for each item I inserted into the database. for example: x00001 for the first item x00002 for the sencond item x00003 for the third item The way I chose to do this is counting the rows. Before I insert the third item, I count against the database, I know there're already 2 rows, so the next encoding is ended with 3. But there is a problem. If I delete the second item, the forth item will not be the x00004,but x00003. I can add additional columns to table, to store the next encoding, I don't know if there's other better solutions ?

    Read the article

  • Dynamic form creation from XSD in ASP.NET

    - by CitadelCSAlum
    I know there is a lot of documentation on the internet as far as XSD to forms, but I have not been able to come across one that is straight forward enough for my situation. I am working with a WCF web service that is going to fetch and .xsd xml schema, and must return the HTML of a form based on the .xsd xml schema. Is there any third party tools that can help out with this, if so what are they? If not, do you have any suggestions,better methods,etc for how this can be done?

    Read the article

  • Java String object creation

    - by Ajay
    Hi, 1) What is difference in thers two statements: String s1 = "abc"; and String s1 = new String("abc") 2) as i am not using new in first statement, how string object will be created Thanks

    Read the article

  • JSP Component Creation

    - by jboyd
    When creating JSP pages one thing that I'd often like is the ability to do something like this: <jsp:include page="fancystoryrenderer.jsp" value="${aStoryObjectInMyModel}/> ... fancystoryrenderer.jsp <div id="fancymainbody"> ... ${theStory.title} ... </div> The main important characteristics of this is that I can reuse the same component on the same JSP page in different places without having to copy paste the component and give the story variables different names, notice that the story is called "theStory" in the JSP and not "aStoryObjectInMyModel", the linkage between our model has been broken by the view, which is a good thing in this case How do you do this?

    Read the article

  • PHP Object Creation and Memory Usage

    - by JohnO
    A basic dummy class: class foo { var $bar = 0; function foo() {} function boo() {} } echo memory_get_usage(); echo "\n"; $foo = new foo(); echo memory_get_usage(); echo "\n"; unset($foo); echo memory_get_usage(); echo "\n"; $foo = null; echo memory_get_usage(); echo "\n"; Outputs: $ php test.php 353672 353792 353792 353792 Now, I know that PHP docs say that memory won't be freed until it is needed (hitting the ceiling). However, I wrote this up as a small test, because I've got a much longer task, using a much bigger object, with many instances of that object. And the memory just climbs, eventually running out and stopping execution. Even though these large objects do take up memory, since I destroy them after I'm done with each one (serially), it should not run out of memory (unless a single object exhausts the entire space for memory, which is not the case). Thoughts?

    Read the article

  • ASP.net MVC View Creation

    - by nettguy
    I heard that ASP.net MVC does not maintain View State.So,here is my question I have an MVC -View which has forward and backward html button.When i click forward and again click backward ,how can i maintain html control state then?

    Read the article

  • .NET object creation and generations

    - by nimoraca
    Is there a way to tell the .NET to allocate a new object in generation 2 heap. I have a problem where I need to allocate approximately 200 MB of objects, do something with them, and throw them away. What happens here is that all the data gets copied two times (from gen0 to gen1 and then from gen1 to gen2).

    Read the article

  • Ruby on Rails: custom instance creation failing at redirect

    - by Jack
    I am at an absolute loss as to what I am doing wrong with the following code. I am trying to implement a messaging system within my application, but want it to be handle different types of messages. In this case, I want to create a "request" message of ':message_type = 1'. Instead of using forms as I usually have, I want to make this instance the moment the link is clicked. Here is how I have it set up in the show erb file for "user": <%=link_to "Send friend request", :action=>"request", :controller => "messages", :id => @user.id %> and in the controller: def request @message = Message.new(:sender_id => current_user.id,:user_id => params[:id],:message_type => 1) if @message.save flash[:notice] = 'Message was successfully created.' redirect_to message_path(@message) else redirect_to message_path(@message) end end This results in the following error message: undefined method `rewrite' for nil:NilClass with the trace looking like c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in `method_missing' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:634:in `url_for' (eval):16:in `message_path' app/controllers/messages_controller.rb:11:in `request' I have used map.resources :messages in the routes.rb file, and done the appropriate :has_many and :belongs_to associations in the models of user and message.

    Read the article

  • Declaration for object for which creation is wrapped in macro

    - by learner
    The following macro is defined in our code: #define MSGMacro(obj, arg) MyPaymentClass obj(arg) Where MSGMacro is used to creates the object of type MyPaymentClass using code like MSGMacro(Card, 1); MSGMacro(Cash, 2); ---- ---- //removed unwanted things to keep question cleaner. All the above code is in one cpp file, Now the problem is how we can expose these two objects of MyPaymentClass to other units in my project? i.e. I want to use Card and Cash in other CPP files. Please suggest how I can give the declaration for the same in some header file?

    Read the article

  • Creation of database in Oracle

    - by macha
    Hello, I am a newbie to Oracle, and I have used MySQL for most of the time. So now for testing scripts, I was just planning to create a database, but from the resources I have found on google, it doesn't look as simple it is maybe in mysql or in sqlserver. I just need to create a database, say "CREATE DATABASE TESTDB";. That is it, but of the resources I have found, it seems I need to create an instance identifier, decide an authentication method, create an initialization file etc. Do I really have to do all this or am I using the wrong resources. I just need to create a database and add a few tables into it, just to check my connection string etc. I need to check if I am able to connect to my web server.

    Read the article

  • Unwanted automated creation of new instances of an activity class

    - by Marko
    I have an activity (called Sender) with the most basic UI, only a button that sends a message when clicked. In the onClickListener I only call this method: private void sendSMS(String msg) { PendingIntent pi = PendingIntent.getActivity(this, 0, new Intent(this, Sender.class), 0); PendingIntent pi = PendingIntent.getActivity(this, 0, myIntent, 0); SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage("1477", null, msg, pi, null); } This works ok, the message is sent but every time a message is sent a new instance of Sender is started on top of the other. If I call sendSMS method three times, three new instances are started. I'm quite new to android so I need some help with this, I only want the same Sender to be on all the time

    Read the article

  • How does file creation work in Java

    - by Ankur
    I am trying to create a file using File newFile = new File("myFile"); However no file called "myFile" is created. This is within a Web application Project i.e. proper form to be pakaged as a WAR but I am calling it as part of a main method (just to see how this works). How can I make it so that a new file is created at a location relative to the current one i.e not have to put in an absolute path.

    Read the article

  • Can I control object creation using MEF?

    - by Akash
    I need to add some extension points to our existing code, and I've been looking at MEF as a possible solution. We have an IRandomNumberGenerator interface, with a default implementation (ConcreteRNG) that we would like to be swappable. This sounds like an ideal scenario for MEF, but I've been having problems with the way we instantiate the random number generators. Our current code looks like: public class Consumer { private List<IRandomNumberGenerator> generators; private List<double> seeds; public Consumer() { generators = new List<IRandomNumberGenerator>(); seeds = new List<double>(new[] {1.0, 2.0, 3.0}); foreach(var seed in seeds) { generators.Add(new ConcreteRNG(seed); } } } In other words, the consumer is responsible for instantiating the RNGs it needs, including providing the seed that each instance requires. What I'd like to do is to have the concrete RNG implementation discovered and instantiated by MEF (using the DirectoryCatalog). I'm not sure how to achieve this. I could expose a Generators property and mark it as an [Import], but how do I provide the required seeds? Is there some other approach I am missing?

    Read the article

  • Django: url and content creation results in 500 and no apache error log entry

    - by user1684082
    If i try to open a created url i get an 500 error. My procedure was: First python manage.py startapp black I added in project/settings.py under INSTALLED_APPS 'black', I added in project/urls.py url(r'^test/', include('black.urls')), Content of black/urls.py is: from django.conf.urls import patterns, url from black import views urlpatterns = patterns('', url(r'^$', views.index, name='index') ) And content of black/views.py: from django.http import HttpResponse def index(request): return HttpResponse("SHOW ME: BLACK") After all i synced the database. I can't see any error in apache-error-log and also not in my posted django files. What could cause this?

    Read the article

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