Search Results

Search found 1878 results on 76 pages for 'tom kruse'.

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

  • 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

  • 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

  • virtualenv on Windows: not over-riding installed package

    - by Tom
    My current setup is Python 2.5/ Django 1.1.1 on Windows. I want to start using Django 1.2 on some projects, but can't use it for everything. Which is just the sort of thing I've got virtualenv for. However, I'm running into a problem I've never encountered and it's hard to Google for: installing Django 1.2 into a virtualenv has no effect for me. If I then activate the environment and do python import django django.VERSION I get "1.1.1 Final". Django is installed in the site-packages directory of my environment and the init file in the root shows that it is 1.2. But the environment falls back to 1.1.1, even if I create the environment with the --no-site-packages flag. What am I screwing up?

    Read the article

  • Sanitizing MySQL user parameters.

    - by Tom
    What are the dangerous characters that should be replaced in user input when the users' input will be inserted in a MySQL query? I know about quotes, double quotes, \r and \n. Are there others?(I don't have the option of using a smart connector that accepts parameters so I have to build the query myself and this will be implemented in multiple programming languages, including some obscure ones so solutions such as mysql_real_escape_string in PHP are not valid)

    Read the article

  • how to change string values in dictionary to int values

    - by tom smith
    I have a dictionary such as: {'Sun': {'Satellites': 'Mercury,Venus,Earth,Mars,Jupiter,Saturn,Uranus,Neptune,Ceres,Pluto,Haumea,Makemake,Eris', 'Orbital Radius': '0', 'Object': 'Sun', 'RootObject': 'Sun', 'Radius': '20890260'}, 'Earth': {'Period': '365.256363004', 'Satellites': 'Moon', 'Orbital Radius': '77098290', 'Radius': '63710.41000.0', 'Object': 'Earth'}, 'Moon': {'Period': '27.321582', 'Orbital Radius': '18128500', 'Radius': '1737000.10', 'Object': 'Moon'}} I am wondering how to change just the number values to ints instead of strings. 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)

    Read the article

  • UIButton only responds in a small area

    - by Tom Irving
    I'm trying to add a UIButton to a UIView, but am having some trouble with getting it to respond to touches. I have a method which returns UIButtons after I provide it with a tag: - (UIButton*)niceSizeButtonWithTag:(int)tag { UIButton * aButton = [UIButton buttonWithType:UIButtonTypeCustom]; [aButton setTag:tag]; [aButton addTarget:self action:@selector(buttonWasTapped:) forControlEvents:UIControlEventTouchUpInside]; CGRect newFrame = aButton.frame; newFrame.size.width = 44; newFrame.size.height = 44; [aButton setFrame:newFrame]; return aButton; } As you can see I'm creating a new button and increasing the size. I use this in the following way: UIButton * anotherButton = [self niceSizeButtonWithTag:1]; [anotherButton setImage:[UIImage imageNamed:@"image" withExtension:@"png"] forState:UIControlStateNormal]; [anotherButton setCenter:CGPointMake(middleOfView)]; [aView addSubview:anotherButton]; I create a lot of buttons like this, hence the reason for the method. The buttons are always created and added to the subview perfectly. I can see the image and they're in the correct position. The problem is that they only respond to touches in a tiny strip. In this attached image, The yellow shows the whole frame of the button, The red shows the area that will respond to touches. The grey shows a section of the view the button is added to. If anyone could shed some light on why this is happening, it would be really useful.

    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

  • Service Application too visible

    - by Tom
    Working on a service application in Delphi 5 that is intended to run on Windows XP - 7. Most of the application is coming together nicely, but I'm running into one issue. Part of this service application is a form that displays data occasionally (similar to the slider box Avast uses to let you know its updated). When the service shows the form, the form displays on the taskbar, but we don't want it to. Does anyone have any suggestions as to how to hide the form's button on the taksbar? None of the standard methods I've found for regular applications have worked so far. Thanks.

    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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • Load two instances of the same DLL in Delphi

    - by Tom
    Here's my problem: I would like to create two separate instances of the same DLL. The following doesn't work because Handle1 and Handle2 will get the same address Handle1 := LoadLibrary('mydll.dll'); Handle2 := LoadLibrary('mydll.dll'); The following works, but I have to make a copy of the DLL and rename it to something else (which seems a bit silly) Handle1 := LoadLibrary('mydll.dll'); Handle2 := LoadLibrary('mydll2.dll'); Is there a way to have only one DLL file, but load several instances of it?

    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

  • 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

  • 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

  • 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

  • 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

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