Search Results

Search found 110 results on 5 pages for 'jakub elias'.

Page 4/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Message sent to deallocated instance which has never been released

    - by Jakub
    Hello, I started dealing with NSOperations and (as usual with concurrency) I'm observing strange behaviour. In my class I've got an instance variable: NSMutableArray *postResultsArray; when one button in the UI is pressed I initialize the array: postResultsArray = [NSMutableArray array]; and setup the operations (together with dependencies). In the operations I create a custom object and try to add to the array: PostResult *result = [[PostResult alloc] initWithServiceName:@"Sth" andResult:someResult]; [self.postResultsArray addObject:result]; and while adding I get: -[CFArray retain]: message sent to deallocated instance 0x3b40c30 which is strange as I don't release the array anywhere in my code (I did, but when the problem started to appear I commented all the release operations to be sure that they are not the case). I also used to have @synchronized section like below: PostResult *result = [[PostResult alloc] initWithServiceName:@"Sth" andResult:someResult]; @synchronized (self.postResultsArray) { [self.postResultsArray addObject:result]; } but the problem was the same (however, the error was for the synchronized operation). Any ideas what I may be doing wrong?

    Read the article

  • OpenGL: Implementing transformation matrix stack

    - by Jakub M.
    In a newer OpenGL there is no matrix stack. I am working on a simple display engine, and I am going to implement the transformation stack. What is a common strategy here? Should I build a push/pop stack, and use it with a tree representing my model? I suppose this is the "old" approach, that was deprecated in the newer OpenGL versions. Maybe then it is not the best solution (it was removed for some reason)

    Read the article

  • How can I correctly calculate the direction for a moving object?

    - by Jakub Hampl
    I'm solving the following problem: I have an object and I know its position now and its position 300ms ago. I assume the object is moving. I have a point to which I want the object to get. What I need is to get the angle from my current object to the destination point in such a format that I know whether to turn left or right. The idea is to assume the current angle from the last known position and the current position. I'm trying to solve this in MATLAB. I've tried using several variations with atan2 but either I get the wrong angle in some situations (like when my object is going in circles) or I get the wrong angle in all situations. Examples of code that screws up: a = new - old; b = dest - new; alpha = atan2(a(2) - b(2), a(1) - b(1); where new is the current position (eg. x = 40; y = 60; new = [x y];), old is the 300ms old position and dest is the destination point. Edit Here's a picture to demonstrate the problem with a few examples: In the above image there are a few points plotted and annotated. The black line indicates our estimated current facing of the object. If the destination point is dest1 I would expect an angle of about 88°. If the destination point is dest2 I would expect an angle of about 110°. If the destination point is dest3 I would expect an angle of about -80°.

    Read the article

  • How can I "slide up" a view on android from the bottom of a screen?

    - by Jakub Arnold
    I'm trying to make a really simple slide up list view, which is displayed when a user clicks on a button at the bottom of the screen. Here's how it should look: And a complete implementation in HTML/JS http://jsbin.com/utAQOVA/1/edit I've tried to use RelativeLayout to position the list just below the button, and put that whole thing into a wrapper and then animate that up/down (same as in the JSBin above). The problem is that the bottom part which isn't visible in the beginning is somehow clipped, even if I slide it up. Evern if I initially show a portion of the list as the screenshow below shows, the bottom part gets clipped when it moves up and only the part that was initially visible is displayed. What would be a proper approach to do this kind of animation? Here's a relevant portion of the layout

    Read the article

  • jQuery mobile ajax login form authentication

    - by Jakub Zak
    I know i already asked simillar question, but now when I work with jQuery Mobile I can't figure it out. So I have this form: <div data-role="page" data-theme="a" id="login_page"> <div data-role="header" data-position="fixed"> <h1>****</h1> </div> <div data-role="content"> <form id="login_form" method="POST" data-ajax="false"> <label for="basic">Username:</label> <input type="text" name="name" id="username" value=""/> <label for="basic">Password:</label> <input type="password" name="password" id="password" value=""/> <input type="submit" value="Login" id="login" name="login"/> </form> </div> <div data-role="footer" data-position="fixed"> <div data-role="navbar"></div> </div> </div> And I need to submit Username and Password to php script, where php replies and send "success" or "failed". Here is php: <?php session_start(); $username = $_POST["name"]; $password = $_POST["password"]; include('mysql_connection.php'); mysql_select_db("jzperson_imesUsers", $con); $res1 = mysql_query("SELECT * FROM temp_login WHERE username='$username' AND password='$password'"); $count=mysql_num_rows($res1); if($count==1){ echo "success"; }else{ echo "failed"; } ?> And to do all this I want to use this script: $(document).ready(function() { $("form").submit(function(){ $.mobile.showPageLoadingMsg(); $.ajax({ url: "http://imes.jzpersonal.com/login_control.php", type: "POST", dataType: "jsonp", jsonp: "jsoncallback", data: $("form#login_form").serialize(), success: function( response ){ $.mobile.changePage( "http://imes.jzpersonal.com/user_panel.html"); } }); return false; }); }); But I can't make it work, I know I must have mistakes in there, I just can't find them, or better way to do it. Thank you in advance for any help.

    Read the article

  • How to join table to itself and select max values in SQL

    - by Jakub Konop
    I have a contracts table: contractId date price partId 1 20120121 10 1 2 20110130 9 1 3 20130101 15 2 4 20110101 20 2 The contract with greatest date being the active contract (don't blame me, I blame infor for creating xpps) I need to create query to see only active contracts (one contract per part, the contract with highest date). So the result of the query should be like this: contractId date price partId 1 20120121 10 1 3 20130101 15 2 I am out of ideas here, I tried self joining the table, I tried aggregation functions, but I can't figure it out. If anyone would have any idea, please share them with me..

    Read the article

  • Passing a enum value as a tag attribute in JSP

    - by Jakub
    I have a custom JSP tag which is using a parameter which is an enum. This approach is a consequence of using other classes which need this enumeration. The point is I have no clue how to assign an enum value in the EL: <mytaglib:mytag enumParam="${now what do I type here?}" /> The only workaround which I found so far was to make the enumParam an Integer and convert it to desired values: <mytaglib:mytag enumParam="3" /> I believe there must be a better way to do it. Please help.

    Read the article

  • What is the fastest XML parser in PHP?

    - by Jakub Lédl
    Hi, for a certain project, I need some way to parse XML and get data from it. So I wonder, which one of built-in parsers is the fastest? Also, it would be nice of the parser could accept a XML string as input - I have my own implementation of thread-safe working with files and I don't want some nasty non-thread-safe libraries to make my efforts useless.

    Read the article

  • Working with Form Array's in Coldfusion?

    - by Jakub
    I have no idea how to handle this in coldfusion 9, I have a form being submitted (POST) with element checkboxes, called items[]. When I do a <cfdump var="#form#" /> no-problem, I get all the items shown with the proper names like items[] eg: struct ITEMS[] 13,14 FIELDNAMES ITEMS[] however doing a <cfdump var="#form.items[]#" /> results in an error. How do I access the CF9 field values? Somehow loop through it? I cannot seem to do anything with the array to get the id's out of it? Thoughts, I'm kindof stumped and coldfusion isn't the easiest language to find examples / references on the net ;) Is there a correct way to deal with this? I need to get the ID's out of there so I can referenc what lines were checked in the form, so I can follow up with an action. Thanks!

    Read the article

  • PHP 5.3 and interface \ArrayAccess

    - by Jakub Lédl
    I'm now working on a project and I have one class that implements the ArrayAccess interface. Howewer, I'm getting an error that says that my implementation: must be compatible with that of ArrayAccess::offsetSet(). My implementation looks like this: public function offsetSet($offset, $value) { if (!is_string($offset)) { throw new \LogicException("..."); } $this->params[$offset] = $value; } So, to me it looks like my implementation is correct. Any idea what is wrong? Thanks very much! The class look like this: class HttpRequest implements \ArrayAccess { // tons of private variables, methods for working // with current http request etc. Really nothing that // could interfere with that interface. // ArrayAccess implementation public function offsetExists($offset) { return isset ($this->params[$offset]); } public function offsetGet($offset) { return isset ($this->params[$offset]) ? $this->params[$offset] : NULL; } public function offsetSet($offset, $value) { if (!is_string($offset)) { throw new \LogicException("You can only assing to params using specified key."); } $this->params[$offset] = $value; } public function offsetUnset($offset) { unset ($this->params[$offset]); } }

    Read the article

  • Use CSS selectors to collect HTML elements from a streaming parser (e.g. SAX stream)

    - by Jakub Narebski
    How to parse CSS (CSS3) selector and use it (in jQuery-like way) to collect HTML elements not from DOM (from tree structure), but from stream (e.g. SAX), i.e. using sequential access parser? Are there CSS selectors that need access to DOM (Wikipedia SAX page says that XPath selectors "need to be able to access any node at any time in the parsed XML tree")? I am most inetersted in implementing selector combinators, e.g. 'A B' descendant selector. I prefer solutions describing algorithm, or in Perl.

    Read the article

  • How to create an image from canvas data?

    - by Jakub Hampl
    In my application I am trying to save an arbitrary part of a rendered HTML canvas to an image file. In my Javascript I call ctx.getImageData(x, y, w, h) and pass the resulting object to my macruby code (though if you know a solution in objc I am also very interested). There I'm trying to create a NSBitmapImageRep object so that I can then save to an image format the user desires. This is my code so far (the function gets a WebScriptObject as it's argument): def setimagedata(d) w = d.valueForKey("width").to_i h = d.valueForKey("height").to_i data = Pointer.new(:char, d.valueForKey("data").valueForKey("length").to_i) d.valueForKey("data").valueForKey("length").to_i.times do |i| data[i] = d.valueForKey("data").webScriptValueAtIndex(i).to_i end puts "data complete" # get's called @exported_image = NSBitmapImageRep.alloc.initWithBitmapDataPlanes(data, pixelsWide: w, pixelsHigh:h, bitsPerSample: 32, samplesPerPixel: 4, hasAlpha: true, isPlanar: false, colorSpaceName: NSCalibratedRGBColorSpace, bitmapFormat: NSAlphaNonpremultipliedBitmapFormat, bytesPerRow: 0, bitsPerPixel: 0) puts "done" # doesn't get called end The code doesn't seem to get through the initWithBitmapDataPlanes function but gives no error. My question is: what am I doing wrong? Is this approach reasonable (if not, what would be better?).

    Read the article

  • Objective C memory leaking

    - by Jakub Lédl
    Hi everyone, I'm creating one Cocoa application for myself and I found a problem. I have two NSTextFields and they're connected to each other as nextKeyViews. When I run this app with memory leaks detection tool and tab through those 2 textboxes for a while, enter some text etc., I start to leak memory. It shows me that the AppKit library is responsible, the leaked objects are NSCFStrings and the responsible frames are [NSEvent charactersIgnoringModifiers] and [NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]. I know this is quite a brief and incomplete description, but does anyone have any ideas what could be the problem? Also, I don't use GC, so I release my instance variables in the controllers dealloc. What about the outlets? Since IBOutlet is just a mark for Interface Builder and doesn't actually mean anything, should I release them too?

    Read the article

  • Moving the table view and keep the toolbar visible?

    - by Jakub
    Hello, In my view I have a toolbar with a button at the top and a table view underneath, like in the following picture: An you can see there are text fields in the cells of the table view. The problem appears when I want to edit the tet fields which are in the bottom of the table view. As you can imagine the keyboard overlaps the text fields. Let say I want to edit the fields in the C section, the result is following: I tried different approaches for moving the table view, but I always end up with the toolbar being hidden. In one cae the toolbar was moving up with together with the table view, in the second case the table view overlaps the toolbar: All the ideas how to move the table view to make the cell being edited visible together with having the toolbar visible? How to move/resize the table view? Thanks!

    Read the article

  • Possible to create JSR 286 portlet using Coldfusion?

    - by Jakub
    I was just thinking this morning, since ColdFusion is essentially built on JAVA, is it possible to create JSR 286 portlets using coldfusion? A search revealed that it might be possible, but I cannot find any material on this? Reason I ask is because I would love to be able to create Liferay compatible portlets with ColdFusion, as I am not a JAVA dev. Thoughts? Does anyone have any tutorials or references on this subject? EDIT Is there anyways to get CF portlets without CF running in the container? I'm curious how this would work with having only one license of CF. Would I need another license to run under liferay (if I can even run in liferay?)

    Read the article

  • View is moved 3 pixels

    - by Jakub
    Hello, In my app I move the table view (in order to make the text fields visible when the keyboard appears). The view is looks following: This is the code I use for resizing the view and moving it up: static const NSUInteger navBarHeight = 44; CGRect appFrame = [[UIScreen mainScreen] applicationFrame]; tableView.frame = CGRectMake(0, navBarHeight, appFrame.size.width, appFrame.size.height-navBarHeight-216); //216 for the keyboard NSIndexPath *indPath = [self getIndexPathForTextField:textField]; //get the field the view should scroll to [tableView scrollToRowAtIndexPath:indPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES]; The problem is that when the view is moved up it also moves 3 pixels into right direction (it is hard to see the difference in the screenshot, but it is visible when the animation is on and I measured the difference with PixelStick tool). Here it is how it looks after the move: My analysis shows that scrolling the table does not influence the move to the right. Any ideas what is wrong in the code above that makes the view move to the right?

    Read the article

  • 2D Tile-based terrian generation

    - by a240
    As a summer project I decided it would be fun to make a flash game. Right now I'm going for something like the look of http://www.terraria.org/. It's been a lot of fun, but today I've hit a snag. I need a way to generate my worlds. I've read up Perlin Noise ( http://freespace.virgin.net/hugo.elias/models/m_perlin.htm ) as a possibility, but I my attempts have given me sporadic looking results. What are some techniques used to generate these 2D tile-based worlds? Ideally I would like to be able to generate mountains, plains, and caves.

    Read the article

  • Hidden Features of C#?

    - by Serhat Özgel
    This came to my mind after I learned the following from this question: where T : struct We, C# developers, all know the basics of C#. I mean declarations, conditionals, loops, operators, etc. Some of us even mastered the stuff like Generics, anonymous types, lambdas, linq, ... But what are the most hidden features or tricks of C# that even C# fans, addicts, experts barely know? Here are the revealed features so far: Keywords yield by Michael Stum var by Michael Stum using() statement by kokos readonly by kokos as by Mike Stone as / is by Ed Swangren as / is (improved) by Rocketpants default by deathofrats global:: by pzycoman using() blocks by AlexCuse volatile by Jakub Šturc extern alias by Jakub Šturc Attributes DefaultValueAttribute by Michael Stum ObsoleteAttribute by DannySmurf DebuggerDisplayAttribute by Stu DebuggerBrowsable and DebuggerStepThrough by bdukes ThreadStaticAttribute by marxidad FlagsAttribute by Martin Clarke ConditionalAttribute by AndrewBurns Syntax ?? operator by kokos number flaggings by Nick Berardi where T:new by Lars Mæhlum implicit generics by Keith one-parameter lambdas by Keith auto properties by Keith namespace aliases by Keith verbatim string literals with @ by Patrick enum values by lfoust @variablenames by marxidad event operators by marxidad format string brackets by Portman property accessor accessibility modifiers by xanadont ternary operator (?:) by JasonS checked and unchecked operators by Binoj Antony implicit and explicit operators by Flory Language Features Nullable types by Brad Barker Currying by Brian Leahy anonymous types by Keith __makeref __reftype __refvalue by Judah Himango object initializers by lomaxx format strings by David in Dakota Extension Methods by marxidad partial methods by Jon Erickson preprocessor directives by John Asbeck DEBUG pre-processor directive by Robert Durgin operator overloading by SefBkn type inferrence by chakrit boolean operators taken to next level by Rob Gough pass value-type variable as interface without boxing by Roman Boiko programmatically determine declared variable type by Roman Boiko Static Constructors by Chris Easier-on-the-eyes / condensed ORM-mapping using LINQ by roosteronacid Visual Studio Features select block of text in editor by Himadri snippets by DannySmurf Framework TransactionScope by KiwiBastard DependantTransaction by KiwiBastard Nullable<T> by IainMH Mutex by Diago System.IO.Path by ageektrapped WeakReference by Juan Manuel Methods and Properties String.IsNullOrEmpty() method by KiwiBastard List.ForEach() method by KiwiBastard BeginInvoke(), EndInvoke() methods by Will Dean Nullable<T>.HasValue and Nullable<T>.Value properties by Rismo GetValueOrDefault method by John Sheehan Tips & Tricks nice method for event handlers by Andreas H.R. Nilsson uppercase comparisons by John access anonymous types without reflection by dp a quick way to lazily instantiate collection properties by Will JavaScript-like anonymous inline-functions by roosteronacid Other netmodules by kokos LINQBridge by Duncan Smart Parallel Extensions by Joel Coehoorn

    Read the article

  • Windows 2003 - Isolate mailserver on webserver with VMware Server

    - by user43279
    Hi, I've a Virtual Private Server with Windows 2003 and root access. This server mainly acts as a web hosting machine (IIS, Apache). Additionally it is used as a mail server. Is it possible to isolate a mailserver (for example HMailServer) by using VMware Server on Windows 2003 in order to avoid potential viruses moving from the guest into the host system? Is this is a good direction to protect the web server from viruses? Kind regards, Jakub

    Read the article

  • Show jQModal window on page load

    - by Machi
    Hi there, I'm playing with jQModal plugin and trying to display its window right after the page is loaded. I used this code in $(document).ready(function(): $('#letak').jqm({ overlay: 70, autofire: true }); autofire setting should do the trick but unfortunately it doesn't work. Works perfectly fine when I click at trigger link. Example: http://bz.machi.cz/ Am I doing something wrong? Thanks a lot, Jakub

    Read the article

  • How do I set default host for url helpers in rails?

    - by ja.kub.cz
    I would like to do something like this config.default_host = 'www.subdomain.example.com' in some of my configuration files, so that object_url helpers produce link beginning with http://www.subdomain.example.com I have tried to search the docs but I did not find anytnig exept ActionMailer docs and http://api.rubyonrails.org/classes/Rails/Configuration.html which is not usefull for me, because I do not know in which pat to look. Is there a place which describes the whole structure of Rails::Initializer.config? Thanks for helping Jakub

    Read the article

  • Automated horizontal scrolling in jQuery

    - by Machi
    Hi there, I'm looking for a jQuery plugin which does scrolling the element (div) when I hover the arrow, it should look like this: http://img42.imageshack.us/img42/5716/scrollp.jpg and scroll automatically the content inside to the left/right only when user hovers arrows. Is there anything like this? Thanks a lot, Jakub

    Read the article

  • Transform coordinates from 3d to 2d without matrix or built in methods

    - by Thomas
    Not to long ago i started to create a small 3D engine in javascript to combine this with an html5 canvas. One of the issues I run into is how can you transform 3d to 2d coords. Since I cannot use matrices or built in transformation methods I need another way. I've tried implementing the next explanation + pseudo code: http://freespace.virgin.net/hugo.elias/routines/3d_to_2d.htm Unfortunately no luck there. I've replace all the input variables with data from my own camera and object classes. I have the following data: An object with a rotation, position vector and an array of 4 3d coords (its just a plane) a camera with a position and rotation vector the viewport - a square 600 x 600 surface. The example uses a zoom factor which I've set as 1 Most hits on google use either matrix calculations or don't implement camera rotation. Basic transformation should be like this: screen.x = x / z * zoom screen.y = y / z * zoom Can anyone point me in the right direction or explain to me howto achieve this? edit: Thanks for all your posts, I haven't been able to apply all this to my project yet but I hope to do this soon.

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >