Search Results

Search found 1872 results on 75 pages for 'tom genoni'.

Page 44/75 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • Problem while looping on a NSDictionary

    - by Tom
    Hi! The end of my loop causes a EXC_BAD_ACCESS. Here's my dictionary (AppDelegate.data): 1 = ( 3, "Test 1", False, "" ); 2 = ( 4, "Test 2", False, "" ); And here is my loop: for (id theKey in AppDelegate.data) { if (theKey = nil) { NSLog(@"HOLY COW"); } else { NSLog(@"Key: %@ ?", theKey); } } It never says holy cow, and it says the right key but at the end it crashes... Do you have any idea why? It should only loop on 1 and two and then exit the loop... I know that there's always a "nil" object at the end that's why I did a condition with it but it doesn't look like it works at all.. Thanks!

    Read the article

  • Using FFmpeg or wrapper to get mp3 from mp4 in C#

    - by Tom Allen
    I'm trying to extract an mp3 from a flash compatible mp4 file and have so far found FFMpeg and a bunch of different wrappers that all claim to be able to do the job. Ideally, I'd like to not have to rely on shelling to the FFMpeg exe, but none of the wrappers I've tried seem to work.... Has anyone got any code or advice for how to go about this? Thanks!

    Read the article

  • Double script tags in Google Analytics tracking code

    - by Tom
    This is more a curiosity question than anything else... Google instructs to add the analytics tracking code as follows: <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try{ var pageTracker = _gat._getTracker("UA-xxxxxx-x"); pageTracker._trackPageview(); } catch(err) {} </script> I'm wondering some JS guru here could tell me why they're separating it into two script tags instead of sticking it all inside one. I know that the top part could be put in the header and the bottom part just before body tag to ensure the page loaded before it's tracked, but I'm wondering if there's something more to it. Anyone who'd know that would likely know how to separate the code into two tags anyway. I'm only asking as this is coming from the Goog and is being used by millions of sites... Thanks

    Read the article

  • Best computer-science universities in Europe?

    - by Tom
    I am in 11th grade and only one year left when I finish my school. I am sure I want to dedicate my life to programming. In my country the education's level is not so high as in Europe, so I want to emigrate and study not just for a diploma, but for knowledge too. So, what universities would you suggest me which has subject Computer-Science? I prefer web programming. Please do not delete this message though it is quite offtopic, but it's the best place for me to get suggestions from advanced programmers who have already finished their university. And I hope here comes also teenagers who can make the best decision choosing university. Thank you. Please read the whole my message before voting to close this thread, thanks.

    Read the article

  • How to scale rotated objects properly in Actionscript 3?

    - by Tom
    This is unfortunately a quite complex issue to explain, so please don't get discouraged by the wall of text - it's there for a reason. ;) I'm working on a transformation manager for flash, written with Actionscript 3. Users can place objects on the screen, for example a rectangle. This rectangle can then be selected and transformed: move, scale or rotate. Because flash by default rotates around the top left point of the object, and I want it to rotate around the center, I created a wrapper setup for each display object (eg. a rectangle). This is how the wrappers are setup: //the position wrapper makes sure that we do get the top left position when we access x and y var positionWrapper:Sprite = new Sprite(); positionWrapper.x = renderObject.x; positionWrapper.y = renderObject.y; //set the render objects location to center at the rotation wrappers top left renderObject.x = 0 - renderObject.width / 2; renderObject.y = 0 - renderObject.height / 2; //now create a rotation wrapper, at the center of the display object var rotationWrapper:Sprite = new Sprite(); rotationWrapper.x = renderObject.width / 2; rotationWrapper.y = renderObject.height / 2; //put the rotation wrapper inside the position wrapper and the render object inside the rotation wrapper positionWrapper.addChild(rotationWrapper); rotationWrapper.addChild(renderObject); Now, the x and y of the object can be accessed and set directly: mainWrapper.x or mainWrapper.y. The rotation can be set and accessed from the child of this main wrapper: mainWrapper.getChildAt(0).rotation. Finally, the width and height of the display object can be retreived and set by getting the child of the rotation wrapper and accessing the display object directly. An example on how I access them: //get wrappers and render object var positionWrapper:Sprite = currentSelection["render"]; var rotationWrapper:Sprite = positionWrapper.getChildAt(0) as Sprite; var renderObject:DisplayObject = rotationWrapper.getChildAt(0); This works perfectly for all initial transformations: moving, scaling and rotating. However, the problem arises when you first rotate an object (eg. 45 degrees) and then scale it. The scaled object is getting out of shape and doesn't scale as it should. This for example happens when you scale to the left. Scaling left is basically adding n width to the object and then reduce the x coord of the position wrapper by n too: renderObject.width -= diffX; positionWrapper.x += diffX; This works when the object is not rotated. However, when it is, the position wrapper won't be rotated as it is a parent of the rotation wrapper. This will make the position wrapper move left horizontally while the width of the object is increased diagonally. I hope this makes any sense, if not, please tell me and I'll try to elaborate more. Now, to the question: should I use a different kind of setup, system or structure? Should I maybe use matrixes, if so, how would you keep a static width/height after rotation? Or how do I fix my current wrapper system for scaling after rotation? Any help is appreciated.

    Read the article

  • How to merge/crosslink Javadoc?

    - by Tom Wheeler
    If you have the standard Javadoc for a few different projects, how can you process them to create a single unified set of documentation in which everything is cross-linked? Ideally, the result would be similar to the documentation for the various modules in the NetBeans Platform: http://bits.netbeans.org/dev/javadoc/index.html but I've looked at their build scripts and they're predicated on you building everything from source. I'm looking for something which could also handle linking in Javadoc for third-party libraries, so I'd imagine it would need to be a post-processing operation. I can't be the first person to ever want this. Any ideas?

    Read the article

  • Flex Import Class from a Module within a sub directory

    - by Tom
    I put some modules in a module folder. How do I import classes with the import statement when I'm in a sub folder? This won't work, not like classes which are in packages. modules/SomeModule.mxml <?xml version="1.0"?> <mx:Module> <mx:Script> <![CDATA[ import Fruit.Apple; ]]> </mx:Script> </mx:Module> Directory: . |-- Fruit |-- Apple.as |-- Modules |-- SomeModule.mxml `-- application.mxml

    Read the article

  • XNA Vector2 Rotation Question

    - by Tom Allen
    I'm messing about with some stuff in XNA and am trying to move an object around asteroids-style in that you press left and right to rotate and up/down to go forwards and backwards in the direction you are pointing. I've got the rotation of the sprite done, but i can't get the object to move in the direction you've pointed it, it always moves up and down on the x = 0 axis. I'm guessing this is straight forward but I just can't figure it out. My "ship" class has the following properties which are note worthy here: Vector2 Position float Rotation The "ship" class has an update method is where the input is handled and so far I've got the following: public void Update(GameTime gameTime) { KeyboardState keyboard = Keyboard.GetState(); GamePadState gamePad = GamePad.GetState(PlayerIndex.One); float x = Position.X; float y = Position.Y; if (keyboard.IsKeyDown(Keys.Left)) Rotation -= 0.1f; if (keyboard.IsKeyDown(Keys.Right)) Rotation += 0.1f; if (keyboard.IsKeyDown(Keys.Up)) y -= ??; if (keyboard.IsKeyDown(Keys.Down)) y += ??; this.Position = new Vector2(x, y); } Any help would be most appreciated!

    Read the article

  • Converting the value from string to integer in a nested dictionary

    - by tom smith
    I want to change the numbers in my dictionary to int values for use later in my program. So far I have import time import math x = 400 y = 300 def read_next_object(file): obj = {} for line in file: if not line.strip(): continue line = line.strip() key, val = line.split(": ") if key in obj and key == "Object": yield obj obj = {} obj[key] = val yield obj planets = {} with open( "smallsolar.txt", 'r') as f: for obj in read_next_object(f): planets[obj["Object"]] = obj print(planets) scale=250/int(max([planets[x]["Orbital Radius"] for x in planets if "Orbital Radius" in planets[x]])) print(scale) and the output is {'Sun': {'Object': 'Sun', 'Satellites': 'Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune,Ceres,Pluto,Haumea,Makemake,Eris', 'Orbital Radius': '0', 'RootObject': 'Sun', 'Radius': '20890260'}, 'Moon': {'Object': 'Moon', 'Orbital Radius': '18128500', 'Period': '27.321582', 'Radius': '1737000.10'}, 'Earth': {'Object': 'Earth', 'Satellites': 'Moon', 'Orbital Radius': '77098290', 'Period': '365.256363004', 'Radius': '6371000.0'}} 3.2426140709476178e-06 I want to be able to convert the numbers in the dict to ints for further use. Any help in greatly appreciated.

    Read the article

  • Detecting an online poker cheat

    - by Tom Gullen
    It recently emerged on a large poker site that some players were possibly able to see all opponents cards as they played through exploiting a security vulnerability that was discovered. A naïve cheater would win at an incredibly fast rate, and these cheats are caught very quickly usually, and if not caught quickly they are easy to detect through a quick scan through their hand histories. The more difficult problem occurs when the cheater exhibits intelligence, bluffing in spots they are bound to be called in, calling river bets with the worst hands, the basic premise is that they lose pots on purpose to disguise their ability to see other players cards, and they win at a reasonably realistic rate. Given: A data set of millions of verified and complete information hand histories Theoretical unlimited computer power Assume the game No Limit Hold'em, although suggestions on Omaha or limit poker may be beneficial How could we reasonably accurately classify these cheaters? The original 2+2 thread appeals for ideas, and I thought that the SO community might have some useful suggestions. It's an interesting problem also because it is current, and has real application in bettering the world if someone finds a creative solution, as there is a good chance genuine players will have funds refunded to them when identified cheaters are discovered.

    Read the article

  • Specifying schema for temporary tables

    - by Tom Hunter
    I'm used to seeing temporary tables created with just the hash/number symbol, like this: CREATE TABLE #Test ( [Id] INT ) However, I've recently come across stored procedure code that specifies the schema name when creating temporary tables, for example: CREATE TABLE [dbo].[#Test] ( [Id] INT ) Is there any reason why you would want to do this? If you're only specifying the user's default schema, does it make any difference? Does this refer to the [dbo] schema in the local database or the tempdb database?

    Read the article

  • Suggestions: Anti-Pattern counter-examples

    - by Tom W
    It doesn't seem that this exact question has been asked before, so I'll fire away: Most of us are familiar with the concept of an anti-pattern. However, avoiding implementation of anti-patterns can in principle swing too far the other way and cause problems itself. As an example, "Design by Committee" has a counter-example that I'd call "Design by Maverick" - wherein the design of an important feature is handed off to an individual to do what they think best, with the intention of reviewing their work later and deciding whether it should be finalised or go through another iteration. This takes much longer in practice as the rest of the team are occupied by other things, and can end up with a feature that's useful to nobody, particularly if the Maverick is not themselves an experienced end-user. Does anyone have any more examples of anti-pattern counter-examples?

    Read the article

  • Should I be regularly shrinking my DB or at least my log file?

    - by Tom
    My question is, should I be running one or both of the shrink command regularly, DBCC SHRINKDATABASE OR DBCC SHRINKFILE ============================= background Sql Server: Database is 200 gigs, logs are 150 gigs. running this command SELECT name ,size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int) / 128.0 AS AvailableSpaceInMB FROM sys.database_files;` produces this output.. MyDB: 159.812500 MB free MyDB_Log: 149476.390625 MB free So it seems there is some free space. We backup transaction logs every hour, diff backup 5 nights a week, full backup the other 2 nights of the week.

    Read the article

  • How do I guarante node order for an Xpath 'OR' query

    - by Tom Carter
    I have a snippet of XML that looks like <body> Some text.... <nodeA>....</nodeA> more text <someOtherNode> <nodeA>.......</nodeA> </someOtherNode> <nodeB>.......</nodeB> etc..... </body> I'm selecting all nodeA and NodeB nodes inside <body> using an XPATH query similar to "//nodeA|//nodeB" As I understand it, .NET supports XPATH 1.0 which does not guarantee node order. How can I guarantee selected nodes are returned in document order in my OR query : that's to say : nodeA, nodeA, nodeB

    Read the article

  • Dojo datagrid won't display inside another div

    - by Tom
    Hi, Trying to get a Dojo datagrid working - have duplicated the first example on the documentation page (http://docs.dojocampus.org/dojox/grid/DataGrid) & it works just fine. However, when I try to display the grid inside another div (i.e. putting 'gridContainer4' from the example inside any other div) nothing displays... Any help much appreciated - can't find anything about this anywhere online!

    Read the article

  • Memory Leak with Swing Drag and Drop

    - by tom
    I have a JFrame that accepts top-level drops of files. However after a drop has occurred, references to the frame are held indefinitely inside some Swing internal classes. I believe that disposing of the frame should release all of its resources, so what am I doing wrong? Example import java.awt.datatransfer.DataFlavor; import java.io.File; import java.util.List; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.TransferHandler; public class DnDLeakTester extends JFrame { public static void main(String[] args) { new DnDLeakTester(); //Prevent main from returning or the jvm will exit while (true) { try { Thread.sleep(10000); } catch (InterruptedException e) { } } } public DnDLeakTester() { super("I'm leaky"); add(new JLabel("Drop stuff here")); setTransferHandler(new TransferHandler() { @Override public boolean canImport(final TransferSupport support) { return (support.isDrop() && support .isDataFlavorSupported(DataFlavor.javaFileListFlavor)); } @Override public boolean importData(final TransferSupport support) { if (!canImport(support)) { return false; } try { final List<File> files = (List<File>) support.getTransferable().getTransferData(DataFlavor.javaFileListFlavor); for (final File f : files) { System.out.println(f.getName()); } } catch (Exception e) { e.printStackTrace(); } return true; } }); setDefaultCloseOperation(DISPOSE_ON_CLOSE); pack(); setVisible(true); } } To reproduce, run the code and drop some files on the frame. Close the frame so it's disposed of. To verify the leak I take a heap dump using JConsole and analyse it with the Eclipse Memory Analysis tool. It shows that sun.awt.AppContext is holding a reference to the frame through its hashmap. It looks like TransferSupport is at fault. What am I doing wrong? Should I be asking the DnD support code to clean itself up somehow? I'm running JDK 1.6 update 19.

    Read the article

  • virtual directory for php app

    - by Tom
    I created a virtual directory for my php app. Now I get the "Directory Listing Denied This Virtual Directory does not allow contents to be listed." Do I need to make some kind of dummy index.asp file that redirects (OR PREFERRED: just displays index.php) or how to solve this? I have restricted access to webserver, but index.php is set to be default

    Read the article

  • MySQL: Changing order of auto-incremented primary keys?

    - by Tom
    Hi, I have a table with a auto-incremented primary key: user_id. For a currently theoretical reason, I might need to change a user_id to be something else than it was when originally created through auto-incrementation. This means there's a possibility that the keys will not be in incremental order anymore: PK: 1 2 3 952 // changed key 4 5 6 7 I'm wondering whether this will cause problems, and whether MySQL reads something special to the incremental order of the keys, given that they should have come to existence in incremental order (which persists even when some rows are deleted). Assuming there are no associated foreignkey issues, or that these are under control, is there a problem with "messing with" the order of MySQL's autoincremented keys? Thank you.

    Read the article

  • Too much data for RSA block fail. What is PKCS#7?

    - by Tom Brito
    Talking about javax.crypto.Cipher; I was trying to encrypt data using Cipher.getInstance("RSA/None/NoPadding", "BC"); but I got the exception: ArrayIndexOutOfBoundsException: too much data for RSA block Looks like is something related to the "NoPadding", so, reading about padding, looks like CBC is the best approach to use here. I found at google something about "RSA/CBC/PKCS#7", what is this "PKCS#7"? And why its not listed on sun's standard algorithm names?

    Read the article

  • Java io ugly try-finally block

    - by Tom Brito
    Is there a not so ugly way of treat the close() exception to close both streams then: InputStream in = new FileInputStream(inputFileName); OutputStream out = new FileOutputStream(outputFileName); try { copy(in, out); } finally { try { in.close(); } catch (Exception e) { try { // event if in.close fails, need to close the out out.close(); } catch (Exception e2) {} throw e; // and throw the 'in' exception } out.close(); }

    Read the article

  • Set Java Application's virtual machine max memory without access to VM parameters because of custom

    - by Tom
    I'm using a Java application which allows you to import custom files. On import, these files are loaded into memory. The problem is that the files I want to import are very big, this causes an OutOfMemory exception. The crash log also informs me that the VM was started with the java parameter "-Xmx512m", I want to alter this to "-Xmx1024m" so that I got double the memory available. The problem is that this application is using it's own JRE folder and that there's a launcher written in C which is calling the jvm.dll file. In any way, java.exe or javaw.exe are never called and thus I cannot set these parameters myself (if I delete these executables it doesn't matter, can still run the application - this is not the case with the dll). So, my question is, can I set this VM parameter in an other way? I'm even willing to alter the JRE files if there is no other way.

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >