Search Results

Search found 246 results on 10 pages for 'jakob dam jensen'.

Page 7/10 | < Previous Page | 3 4 5 6 7 8 9 10  | Next Page >

  • Chipmunk physics: Velocity question

    - by Johannes Jensen
    I'm making an iPhone game where the main actor is a ball that rolls depending on the device's accelerometer rotation. I haven't started on this part of the coding yet, but I was wondering if you guys had a nice way of solving this: I tried looking a little into chipmunk, and I noticed that bodies have the property v, which is a point containing x and y velocities. I was thinking it'd be a bad idea to just do like: playerBody->v = ccp(accelerometer.x * 5, playerBody->v.y); because it'd just roll up of walls and stuff, is there a better solution to do this?

    Read the article

  • Save downloaded content when in app purchase is complete

    - by jakob
    Hello experts! I have created an app which allows users to buy non-consumable content. The retrieving-ids-payment-process works like a charm. What i can't really figure out is how my content should be saved into the phone. The existing structure is that I have all my current content in Resources/packages/. For every package there is an matching entry in a package.plist. When the purchase is complete it is time to download the content from the server. What i retrieve from the server is a zip file with the new package that I have bought. My observer will call a method named provideContent: -(void) provideContent: (NSString*) productIdentifier { In here I will call my server and download the package } What i need from you guys is some sort of step by step walkthrough or tutorial of how, when the zip is retrieved(is zip allowed?), unpack this zip and add it to my current package structure. Thank you in advance

    Read the article

  • Found % character in a SQL query

    - by Jensen
    Hi, I've an SQL database and I would like to do a query who show all the datas containing the sign "%". Normally, to find a character (for example: "z") in a database I use a query like this : mysql_query("SELECT * FROM mytable WHERE tag LIKE '%z%'"); But here, I want to found the % character, but in SQL it's a joker so when I write: mysql_query("SELECT * FROM mytable WHERE tag LIKE '%%%'"); It show me all my datas. So how to found the % character in my SQL datas ? Thanks

    Read the article

  • Positioning element under another

    - by Cedar Jensen
    I am not an expert web-dev so please bear with me here. I would like to display a banner style header for a page with the top part taken up by an image that is 275x116 and then a horizontal menu bar (styled using ul items) appearing at 70% from the top of the banner. How would I set this up so that the banner appears underneath my navigation? Currently, a portion of the left side of my menu bar sits underneath the image but I'd like it to be the opposite so the menu bar is above the image, some thing like this: ============= <start of header> =========== -------- | img | | | | Horizontal menu | | -------- ============= <end of header> =========== My css: #header { background-color: green; border: 0; margin: 0; padding: 0; overflow: hidden; width: 100%; height: 120px; } #logo { background: green url(images/logo.png) no-repeat scroll 0 0; margin: 0px 0px; border: 1px solid white; left: 20px; top: 20px; width: 275px; height: 116px; position: absolute; z-index: -1000; } .container { border:1px solid grey; margin-left:auto; margin-right:auto; width:960px; } My Html: <body> <div id="header"> <div id="logo"> </div> <div class="container" id="primaryNavbar"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Books</a></li> <li><a href="#">Shows</a></li> <li><a href="#">Movies</a></li> </ul> <div class="clear">&nbsp;</div> </div> <!-- end of container --> </div> <!-- end of header --> </body> I thought that setting the position to "absolute" for the logo element and adding in a very low z-index would achieve this but that isn't the case here. Any suggestions?

    Read the article

  • Please critique this method

    - by Jakob
    Hi I've been looking around the net for some tab button close functionality, but all those solutions had some complicated eventhandler, and i wanted to try and keep it simple, but I might have broken good code ethics doing so, so please review this method and tell me what is wrong. public void AddCloseItem(string header, object content){ //Create tabitem with header and content StackPanel headerPanel = new StackPanel() { Orientation = Orientation.Horizontal, Height = 14}; headerPanel.Children.Add(new TextBlock() { Text = header }); Button closeBtn = new Button() { Content = new Image() { Source = new BitmapImage(new Uri("images/cross.png", UriKind.Relative)) }, Margin = new Thickness() { Left = 10 } }; headerPanel.Children.Add(closeBtn); TabItem newTabItem = new TabItem() { Header = headerPanel, Content = content }; //Add close button functionality closeBtn.Tag = newTabItem; closeBtn.Click += new RoutedEventHandler(closeBtn_Click); //Add item to list this.Add(newTabItem); } void closeBtn_Click(object sender, RoutedEventArgs e) { this.Remove((TabItem)((Button)sender).Tag); } So what I'm doing is storing the tabitem in the btn.Tag property, and then when the button is clicked i just remove the tabitem from my observablecollection, and the UI is updated appropriately. Am I using too much memory saving the tabitem to the Tag property?

    Read the article

  • "Downloading" a computed value form JavaScript

    - by Travis Jensen
    I'm hoping you can prove me wrong here (please, please, please! ;). I have a situation where I need to download encrypted data from a Server D (for "Data"). Server K (for "Key") has the encryption key. For security sake, I would really prefer that Server D never know the key that Server K knows. What I want is my client (e.g. your browser) to connect to Server D for the data and Server K for the key and doe the decryption locally so the unencrypted stuff never leaves your computer. I can do this fine for text areas in the dom by replacing the contents of the HTML. However, sometimes, I would like to do larger files that I stream to the file system. For instance, perhaps I want to encrypt a movie and decrypt it and stream the contents to the my video player. I am not a JavaScript guru by any stretch, especially when it comes to the edge cases of things like the security sandbox. For Small D, I can handle the decryption, but I don't know how to save the decrypted file. Large D seems problematic as memory runs out. Anybody have any ideas that don't involve native plugins? Thanks!

    Read the article

  • First time unit testing (in silverlight)

    - by Jakob
    Hi I've searched some other posts, but most of them assumed that people knew what they were doing in their unit testing, and frankly I don't. I see the idea behind unit testing, and I'm coding an silverlight application much in the blind right now, and I'd like to write some unit tests to kind of be sure I'm on the right path. I'd like to be able to use the SL4 vs 2010 silverlight unit test project template, to keep it simple and not use external tools. So what I need an answer for are questions like: what are the methods of unit testing? what are the differences between unit tests, and automated unit tests? How do I meaningfully unit test in silverlight? What should I be aware of while unit testing (in silverlight) ? Also should I implement some kind of IRepository pattern in my silverlight app to make unit testing easier?

    Read the article

  • datagrid doesn't refresh on changed data

    - by Jakob
    Hi. I have 2 datagrids with data that binds at loadtime in xaml. Then I have a button that inserts a row in the database, but rows aren't added to the datagrids when I press the button. I would like a fix that doesn't just add a gridrow, but actually refreshes the data and fetches the new row from the db. I'm using riaservices, so if that opens up to any tools that can help me, please let me know? thx in advance :D

    Read the article

  • Hook into Application_Start in a HttpModule

    - by Jakob Gade
    I’m implementing a simple HttpModule, where I want some code to run when the web application is started. But I’m surprised to find that the Application_Start event I would normally use from Global.asax is not available from a HttpModule. Is that correct, or am I missing something here? How do I hook into the Application_Start event from an HttpModule?

    Read the article

  • Find the % character in a LIKE query

    - by Jensen
    Hi, I've an SQL database and I would like to do a query who show all the datas containing the sign "%". Normally, to find a character (for example: "z") in a database I use a query like this : mysql_query("SELECT * FROM mytable WHERE tag LIKE '%z%'"); But here, I want to found the % character, but in SQL it's a joker so when I write: mysql_query("SELECT * FROM mytable WHERE tag LIKE '%%%'"); It show me all my datas. So how to found the % character in my SQL datas ? Thanks

    Read the article

  • JAX-WS: when input soap validation fails

    - by Jakob
    I have created a web service with JAX-WS. When the input SOAP message is not well formed or can not be validated, a soap fault is returned automatically to the caller. I dont want the caller to receive this standard SOAP message but i want to create an own custom SOAP fault. So if the call looks like this (note Envelope1, its not valid): hello a default return message is something like this: S:Client Couldn't create SOAP message due to exception: unexpected XML tag. expected: {http://schemas.xmlsoap.org/soap/envelope/}Envelope but found: {http://schemas.xmlsoap.org/soap/envelope/}Envelope1 I want the return message to be something like this: S:Client My own custom SOAP message! I have tried to get this to work the whole day, but i cant figure out how to do it. So if someone could help me I would be really glad!

    Read the article

  • passing in javascript values into iframe tag

    - by Cedar Jensen
    What's the best way to pass in the value held in a javascript variable into an iframe call on the same html page? I'm trying to improve my site's page response times by moving ad serving javascript code (the typical document.write('<script type="text/javascript" src="..") into a separate iframe. (Based on this posting) The request to the ad server typically require a seed variable declared once per site and incremented each time page is loaded by the client. What I want to do is pass in the seed variable into the document invoked by my iframe section. The seed variable is initialized in the 'head' tag of my main html document: <head> <script type="text/javascript"> <!-- custom_seed=1; //--> </script> </head> Later in the html document, I make the request through an iframe which returns the html necessary to invoke the ad server. <body> <!-- a bunch of html to display the page --> <iframe src="somepage.html" width="100%" height="100%"> <p>No support for iframe</p> </iframe> </body> The html returned in the 'somepage.html' has a script used to call the ad server and needs to use the earlier declared seed variable as a parameter: <script type="text/javascript"> document.write('<script type="text/javascript" src="http://ad.server.net/...seed='+ custom_seed +'?"></script>'); custom_seed++; </script> What's a good way to achieve this?

    Read the article

  • silverlight treeview not loading subitems

    - by Jakob
    I'm interested in finding out why this isn't working: I have a treeview with some hierarchicaldatatemplates looking like this: <UserControl.Resources> <sdk:HierarchicalDataTemplate x:Key="nodeEntry"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=Title}" /> </StackPanel> </sdk:HierarchicalDataTemplate> <sdk:HierarchicalDataTemplate x:Key="rootEntry" ItemsSource="{Binding Path=Nodes}" ItemTemplate="{StaticResource nodeEntry}"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=Name}" /> </StackPanel> </sdk:HierarchicalDataTemplate> </UserControl.Resources> <sdk:TreeView Height="250" HorizontalAlignment="Left" ItemTemplate="{StaticResource rootEntry}" ItemsSource="{Binding ElementName=subjectDomainDataSource, Path=Data}" Name="rootTreeView" VerticalAlignment="Top" Width="180"/> The data is passed to the treeview from a domainservice using this method: public IEnumerable<Subject> GetSubjectList(Guid userid) { DataLoadOptions loadopts = new DataLoadOptions(); loadopts.LoadWith<Root>(s => s.Nodes); this.DataContext.LoadOptions = loadopts; return this.DataContext.Roots; } why then are only the root nodes shown in the treeview as if it only loaded a flat list, and not a hierarchy where the root Loads the NodesCollection?

    Read the article

  • Get group key from bridge table

    - by Mads Jensen
    I'm developing an ETL process, and need a bridge table for a one-to-many relationship between a fact table and a dimension table (MySQL database). There is a limited number of combinations (some thousands), so I want to re-use group keys from the bridge table to to limit the size. Any group of dimensions belonging to a fact row will consist of a number of dimension keys (1 to around 15), assigned to a unique group key, as below: group_key | dimension_key ----------------------- 1 | 1 1 | 3 1 | 4 2 | 1 2 | 2 2 | 3 3 | 1 3 | 4 How do I go about retrieving the unique group key for the dimensions 1,3,4 (ie. 1).

    Read the article

  • How to convert from hex-encoded string to a "human readable" string?

    - by John Jensen
    I'm using the Net-SNMP bindings for python and I'm attempting to grab an ARP cache from a Brocade switch. Here's what my code looks like: #!/usr/bin/env python import netsnmp def get_arp(): oid = netsnmp.VarList(netsnmp.Varbind('ipNetToMediaPhysAddress')) res = netsnmp.snmpwalk(oid, Version=2, DestHost='10.0.1.243', Community='public') return res arp_table = get_arp() print arp_table The SNMP code itself is working fine. Output from snmpwalk looks like this: <snip> IP-MIB::ipNetToMediaPhysAddress.128.10.200.6.158 = STRING: 0:1b:ed:a3:ec:c1 IP-MIB::ipNetToMediaPhysAddress.129.10.200.6.162 = STRING: 0:1b:ed:a4:ac:c1 IP-MIB::ipNetToMediaPhysAddress.130.10.200.6.166 = STRING: 0:1b:ed:38:24:1 IP-MIB::ipNetToMediaPhysAddress.131.10.200.6.170 = STRING: 74:8e:f8:62:84:1 </snip> But my output from the python script yields a tuple of hex-encoded strings that looks like this: ('\x00$8C\x98\xc1', '\x00\x1b\xed;_A', '\x00\x1b\xed\xb4\x8f\x81', '\x00$86\x15\x81', '\x00$8C\x98\x81', '\x00\x1b\xed\x9f\xadA', ...etc) I've spent some time googling and came across the struct module and the .decode("hex") string method, but the .decode("hex") method doesn't seem to work: Python 2.7.3 (default, Apr 10 2013, 06:20:15) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> hexstring = '\x00$8C\x98\xc1' >>> newstring = hexstring.decode("hex") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode output = binascii.a2b_hex(input) TypeError: Non-hexadecimal digit found >>> And the documentation for struct is a bit over my head.

    Read the article

  • What's the topmost iframe in the same domain?

    - by Jakob Stoeck
    How can I get the topmost iframe which is in the same domain, i.e. iframe level 1 example.org iframe level 2 example.org iframe level 2 example.org iframe level 3 example.org <-- would give me iframe level 1 iframe level 1 other-example.org iframe level 2 example.org iframe level 2 example.org iframe level 3 example.org <-- would give me iframe level 2 iframe level 1 other-example.org iframe level 2 example.org iframe level 2 example.org <-- would give me iframe level 2 (this) I need it because I have a website which should work in an iframe of another domain and stand-alone. In this website there are scripts which depend on window.top which shouldn't be top but the topmost iframe in the same domain.

    Read the article

  • Predefining C Array

    - by Johannes Jensen
    In C, when defining an array I can do the following: int arr[] = {5, 2, 9, 8}; And thus I defined it and filled it up, but how do I define it in my .h file, and then fill it in my .c? Like do something like int arr[]; arr = {5, 2, 9, 8}; I'm pretty new to C, not sure how it would look any suggestions?

    Read the article

  • c++ Mixing printf with wprintf (or cout with wcout)

    - by Bo Jensen
    I know you should not mix printing with printf,cout and wprintf,wcout, but have a hard time finding a good answer why and if it is possible to get round it. The problem is I use a external library that prints with printf and my own uses wcout. If I do a simple example it works fine, but from my full application it simply does not print the printf statements. If this is really a limitation, then there would be many libraries out there which can not work together with wide printing applications. Any insight on this is more than welcome. Update : I boiled it down to : #include <stdio.h> #include <stdlib.h> #include <iostream> #include <readline/readline.h> #include <readline/history.h> int main() { char *buf; std::wcout << std::endl; /* ADDING THIS LINE MAKES PRINTF VANISH!!! */ rl_bind_key('\t',rl_abort);//disable auto-complete while((buf = readline("my-command : "))!=NULL) { if (strcmp(buf,"quit")==0) break; std::wcout<<buf<< std::endl; if (buf[0]!=0) add_history(buf); } free(buf); return 0; } So I guess it might be a flushing problem, but it still looks strange to me, I have to check up on it.

    Read the article

  • iframe for ad loading good or bad?

    - by Cedar Jensen
    According to Yahoo's "Best Practices for Speeding Up your Site", the pros for using iframes: Helps with slow third-party content like badges and ads Download scripts in parallel but the cons are: Costly even if blank Blocks page onload I want to use an iframe to load ads using the technique mentioned on this site: http://meanderingpassage.com/2007/08/15/keeping-javascript-widgets-from-controlling-your-blog/ Does using this technique mean that as soon as the html contents requested by the iframe are returned to the client, it will load the ad script, potentially blocking the rest of the page's rendering and downloading? Or will the iframe request get processed concurrently while rest of the document is downloaded and rendered?

    Read the article

  • Multi-threaded .NET application blocks during file I/O when protected by Themida

    - by Erik Jensen
    As the title says I have a .NET application that is the GUI which uses multiple threads to perform separate file I/O and notice that the threads occasionally block when the application is protected by Themida. One thread is devoted to reading from serial COM port and another thread is devoted to copying files. What I experience is occasionally when the file copy thread encounters a network delay, it will block the other thread that is reading from the serial port. In addition to slow network (which can be transient), I can cause the problem to happen more frequently by making a PathFileExists call to a bad path e.g. PathFileExists("\\\\BadPath\\file.txt"); The COM port reading function will block during the call to ReadFile. This only happens when the application is protected by Themida. I have tried under WinXP, Win7, and Server 2012. In a streamlined test project, if I replace the .NET application with a MFC unmanaged application and still utilize the same threads I see no issue even when protected with Themida. I have contacted Oreans support and here is their response: The way that a .NET application is protected is very different from a native application. To protect a .NET application, we need to hook most of the file access APIs in order to "cheat" the .NET Framework that the application is protected. I guess that those special hooks (on CreateFile, ReadFile...) are delaying a bit the execution in your application and the problem appears. We did a test making those hooks as light as possible (with minimum code on them) but the problem still appeared in your application. The rest of software protectors that we tried (like Enigma, Molebox...) also use a similar hooking approach as it's the only way to make the .NET packed file to work. If those hooks are not present, the .NET Framework will abort execution as it will see that the original file was tampered (due to all Microsoft checks on .NET files) Those hooks are not present in a native application, that's why it should be working fine on your native application. Oreans support tried other software protectors such as Enigma Protector, Engima VirtualBox, and Molebox and all exhibit the exact same problem. What I have found as a work around is to separate out the file copy logic (where the file exists call is being made) to be performed in a completely separate process. I have experimented with converting the thread functions from unmanaged C++ to VB.NET equivalents (PathFileExists - System.IO.File.Exists and CreateFile/ReadFile - System.IO.Ports.SerialPort.Open/Read) and still see the same serial port read blocked when the file check or copy call is delayed. I have also tried setting the ReadFile to work asynchronously but that had no effect. I believe I am dealing with some low-level windows layer that no matter the language it exhibits a block on a shared resource -- and only when the application is executing under a single .NET process protected by Themida which evidently installs some hooks to allow .NET execution. At this time converting the entire application away from .NET is not an option. Nor is separating out the file copy logic to a separate task. I am wondering if anyone else has more knowledge of how a file operation can block another thread reading from a system port. I have included here example applications that show the problem: https://db.tt/cNMYfEIg - VB.NET https://db.tt/Y2lnTqw7 - MFC They are Visual Studio 2010 solutions. When running the themida protected exe, you can see when the FileThread counter pauses (executing the File.Exists call) while the ReadThread counter also pauses. When running non-protected visual studio output exe, the ReadThread counter does not pause which is how we expect it to function. Thanks!

    Read the article

  • Placing an background image with padding in h2 tag

    - by Cedar Jensen
    I want to create a headline (h2) with an image at the right-most area of the bounding box. I have the layout almost right except I can't push the image a little bit to the right of the element's bounding box -- how would I tweak my css so it is displayed correctly? I'm trying to do something like this: [{someHeadLineText}{dynamic space }{image}{5px space}] where the [] indicate the total available width of my content. Html: <div class="primaryHeader"> <h2>News</h2> </div> Css: .primaryHeader h2 { background-color: green; /* the header looks like a box */ color: black; background: transparent url(../images/edit.png) no-repeat right center; border: 1px solid red; } I am placing the image to the right of my h2 element and centered vertically -- but how do I adjust the placement of the background image?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10  | Next Page >