Search Results

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

Page 41/76 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Convert Existing Eclipse Project to Maven Project

    - by Tom G
    For a project at work, we're considering using the Maven plugin for Eclipse to automate our builds. Right now the procedure is far more complicated than it ought to be, and we're hoping that Maven will simplify things to a one-click build. My question is, is there a wizard or automatic importer for converting an existing Eclipse Java project to a Maven project, using the Maven plugin? Or should I create a new Maven project and manually copy over all source files, libs, etc.

    Read the article

  • What are the options for overriding Django's cascading delete behaviour?

    - by Tom
    Django models generally handle the ON DELETE CASCADE behaviour quite adequately (in a way that works on databases that don't support it natively.) However, I'm struggling to discover what is the best way to override this behaviour where it is not appropriate, in the following scenarios for example: ON DELETE RESTRICT (i.e. prevent deleting an object if it has child records) ON DELETE SET NULL (i.e. don't delete a child record, but set it's parent key to NULL instead to break the relationship) Update other related data when a record is deleted (e.g. deleting an uploaded image file) The following are the potential ways to achieve these that I am aware of: Override the model's delete() method. While this sort of works, it is sidestepped when the records are deleted via a QuerySet. Also, every model's delete() must be overridden to make sure Django's code is never called and super() can't be called as it may use a QuerySet to delete child objects. Use signals. This seems to be ideal as they are called when directly deleting the model or deleting via a QuerySet. However, there is no possibility to prevent a child object from being deleted so it is not usable to implement ON CASCADE RESTRICT or SET NULL. Use a database engine that handles this properly (what does Django do in this case?) Wait until Django supports it (and live with bugs until then...) It seems like the first option is the only viable one, but it's ugly, throws the baby out with the bath water, and risks missing something when a new model/relation is added. Am I missing something? Any recommendations?

    Read the article

  • Div Unique CSS Style Links

    - by Tom
    Hi, I want to create unique styles for my links in a single particular div (So for example I want all links bold and red in the main body, but in the sidebardiv I want them blue and italic) How do I go about it? I have: a:link{ color:#666666; } a:visited{ color:#003300; } a:hover{ color:#006600; } a:active{ color:#006600; } however if I put that in the sidebar div section it messes up my }'s

    Read the article

  • Is there a simpler way to convert a byte array to a 2-byte-size hexadecimal string?

    - by Tom Brito
    Is there a simpler way of implement this? Or a implemented method in JDK or other lib? /** * Convert a byte array to 2-byte-size hexadecimal String. */ public static String to2DigitsHex(byte[] bytes) { String hexData = ""; for (int i = 0; i < bytes.length; i++) { int intV = bytes[i] & 0xFF; // positive int String hexV = Integer.toHexString(intV); if (hexV.length() < 2) { hexV = "0" + hexV; } hexData += hexV; } return hexData; } public static void main(String[] args) { System.out.println(to2DigitsHex(new byte[] {8, 10, 12})); } the output is: "08 0A 0C" (without the spaces)

    Read the article

  • Use a "User Macro" in .vcproj RelativePath

    - by Tom Leys
    Inside .vcproj files There is a list of all source files in your project. How can we use a macro to specify the path to a source file? If we do this: <File RelativePath="$(Lib3rdParty)\Qt\qtwinmigrate-2.5-commercial\src\qmfcapp.cpp"> </File> The compiler cannot find the folder: qmfcapp.cpp c1xx : fatal error C1083: Cannot open source file: '.\$(lib3rdparty)\qt\qtwinmigrate- 2.5-commercial\src\qmfcapp.cpp': No such file or directory As you can see, our project compiles in several source files from QT. QT lives inside a folder of external libraries, and we don't want hardcode the path from our project to that folder (we have a very large solution)

    Read the article

  • How can I dismiss keyboard in iPhone OS 3.2 with text field in popover?

    - by Tom H
    I have several text fields in a custom uiviewcontroller subclass, which is displayed within a popover. The popover is displayed form a bar button. I want the keyboard to go down when the popover is dismissed (either by the user tapping the bar button again, or tapping outside the popover. From the view controller that displays the popover, when the popover is dismissed, in either of the 2 fashions, I call [optionsController dismissFirstResponder]; Optionscontroller is the uiviewcontroller subclass in the popover. Dismissfirstresponder is a method I defined: -(void)dsimissFirstResponder { [nameField resignFirstResponder]; [descriptionField resignFirstResponder]; [helpField resignFirstResponder]; } Those are three IBoutlets which I connected in the xib to the text fields. That doesn't work. Any help with this would be greatly appreciated.

    Read the article

  • Looking for detailed explanation of Hibernate UserType methods for mutable objects

    - by Tom
    I am creating a custom UserType class in Hibernate. The specific case is for an HL7v3 clinical document (I work in health IT). It is a mutable object and most of the documentation around the Hibernate UserType interface seems to center around immutable types. I want a better understanding of how and when the interface methods are used, specifically: assemble - why two parameters (one Serializable, one Object)? What is the use case for this method? disassemble - should I just implement this method to return a serializable form (e.g. String representation)? When and how is this method invoked? equals - is this for update? read? contention? dirty reads? What are the consequences of simply returning false in most cases? replace - I really don't understand where the three Object parameters come from, when this method is invoked, and what Hibernate expects to return, or how that return value is used. Any pointers would be appreciated. I've searched and read all I can find on the subject, but have not found much documentation at all explaining how these methods are used for mutable objects.

    Read the article

  • Exactly clone an object in javascript

    - by Tom
    Hi, I tried to exactly clone an object in javascript. I know the following solution using jquery: var newObject = jQuery.extend({}, oldObject); // Or var newObject = jQuery.extend(true, {}, oldObject); but the problem with that is, that the objects type gets lost: var MyClass = function(param1, param2) { alert(param1.a + param2.a); }; var myObj = new MyClass({a: 1},{a: 2}); var myObjClone = jQuery.extend(true, {}, myObj); alert(myObj instanceof MyClass); // => true alert(myObjClone instanceof MyClass); // => false Is there any solution to get true on the second alert?

    Read the article

  • jQuery hyperlinks - href value?

    - by Tom
    Hi, On my website I use jQuery to hook the events of elements, namely hyperlinks. As these hyperlinks only perform actions on the current page, and do not lead anywhere, I have been putting a href attribute of "#" in: <a href="#">My Link</a> However in some browsers this causes the page to scroll right to top which is obviously undesirable behaviour. I've tried using a blank href value, or not including one, but then the mouse does not change to the hand cursor upon hovering. What should I put in there?

    Read the article

  • Automatically capitalize first letter of first word in a new sentence in LaTeX

    - by Tom Hagen
    I know one of LaTeX's bragging points is that it doesn't have this Microsoftish behavior. Nevertheless, it's sometimes useful. LaTeX already adds an extra space after you type a (non-backslashed) period, so it should be possible to make it automatically capitalize the following letter as well. Is there an obvious way to write a macro that does this, or is there a LaTeX package that does it already?

    Read the article

  • Should an installer run automatically with a setup project

    - by Tom Brown
    I have a windows app (app.exe) build with visual studio 2008, for which I have created a custom installer class. When I run installutil.exe on app.exe, the custom installer is executed OK. I then added a setup & deployment project to create the windows installer file app.msi - this works fine but it does not run the custom installer. How is my custom installer class supposed to get linked to the setup MSI file?

    Read the article

  • Make is more OOPey - good structure?

    - by Tom
    Hi, I just want advice on whether I could improve structure around a particular class which handles all disk access functions The structure of my program is that I have a class called Disk which gets data from flatfiles and databases on a, you guessed it, hard disk drive. I have functions like LoadTextFileToStringList, WriteStringToTextFile, DeleteLineInTextFile etc which are kind of "generic methods" In the same class I also have some more specific methods such as GetXFromDisk where X might be a particular field in a database table/query. Should I separate out the generic methods from the specialised. Should I make another class which inherits the generic methods. At the moment my class is static as there is no need to have an internal state of the class. I'm not really OOPing am I? Thanks Thomas

    Read the article

  • EasyHook Windows Hooking problem/.dll injection

    - by Tom
    Ok can someone try and find the error with this code, it should produce all the registry keys every time something accesses them but i keep getting: System.MissingMethodException: The given method does not exist at EasyHook.LocalHook.GetProcAdress(String InModule, String InChannelName) An example code can be found here: http://www.codeproject.com/KB/DLL/EasyHook64.aspx I can get the CcreateFileW example to work! My code is here: public class Main : EasyHook.IEntryPoint { FileMon.FileMonInterface Interface; LocalHook LocalHook; Stack<String> Queue = new Stack<String>(); public Main(RemoteHooking.IContext InContext,String InChannelName) { // connect to host... Interface = RemoteHooking.IpcConnectClient<FileMon.FileMonInterface>(InChannelName); Interface.Ping(); } public void Run(RemoteHooking.IContext InContext,String InChannelName) { // install hook... try { LocalHook localHook = LocalHook.Create(LocalHook.GetProcAddress("Advapi32.dll", "RegOpenKeyExW"),new DMyRegOpenKeyExW(MyRegOpenKeyExW),this); localHook.ThreadACL.SetExclusiveACL(new int[] { }); } catch (Exception ExtInfo) { Interface.ReportException(ExtInfo); return; } Interface.IsInstalled(RemoteHooking.GetCurrentProcessId()); RemoteHooking.WakeUpProcess(); // wait for host process termination... try { while (true) { Thread.Sleep(500); // transmit newly monitored file accesses... if (Queue.Count > 0) { String[] Package = null; lock (Queue) { Package = Queue.ToArray(); Queue.Clear(); } Interface.OnCreateFile(RemoteHooking.GetCurrentProcessId(), Package); } else Interface.Ping(); } } catch { // Ping() will raise an exception if host is unreachable } } [DllImport("Advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)] static extern int RegOpenKeyExW(UIntPtr hKey,string subKey,int ulOptions,int samDesired,out UIntPtr hkResult); [UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Unicode, SetLastError = true)] delegate int DMyRegOpenKeyExW(UIntPtr hKey,string subKey,int ulOptions,int samDesired,out UIntPtr hkResult); int MyRegOpenKeyExW(UIntPtr hKey,string subKey,int ulOptions,int samDesired,out UIntPtr hkResult) { Console.WriteLine(string.Format("Accessing: {0}", subKey)); return RegOpenKeyExW(hKey, subKey, ulOptions, samDesired, out hkResult); } }

    Read the article

  • JPanel components paint-time problem

    - by Tom Brito
    I'm having a problem that when my frame is shown (after a login dialog) the buttons are not on correct position, then in some miliseconds they go to the right position (the center of the panel with border layout). When I make a SSCCE, it works correct, but when I run my whole code I have this fast-miliseconds delay to the buttons to go to the correct place. Unfortunately, I can't post the whole code, but the method that shows the frame is: public void login(JComponent userView) { centerPanel.removeAll(); centerPanel.add(userView); centerPanel.revalidate(); centerPanel.repaint(); frame.setVisible(true); } What would cause this delay to the panel layout? (I'm running everything in the EDT) -- update In my machine, this SSCCE shows the layout problem in 2 of 10 times I run it: import java.awt.BorderLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.SwingUtilities; public class TEST { public static void main(String[] args) throws Exception { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { System.out.println("Debug test..."); JPanel btnPnl = new JPanel(); btnPnl.add(new JButton("TEST")); JFrame f = new JFrame("TEST"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().setLayout(new BorderLayout()); f.getContentPane().add(btnPnl); f.pack(); f.setSize(800, 600); f.setVisible(true); System.out.println("End debug test!"); } }); } } The button first appers in the up-left, and then it goes to the center. Please, note that I'm understand, not just correct. Is it a java bug? --update OK, so the SSCCE don't show the problem with you that tried till now. Maybe it's my computer performance problem. But this don't answer the question, I still think Java Swing is creating new threads for make the layout behind the scenes.

    Read the article

  • Added buttons, webview, added outlets, but can't play with them in the code...

    - by Tom
    Hi! I made a toolbar with two buttons on it. I then created two outlets in my class controller. Then I hooked the the controller to the buttons and selected the outlets. Finally I rewritten the class files (that added: IBOutlet id next; IBOutlet id previous; to my .h file). So now, everything looks okay. But then I try somewhere in the code to change the state of one of my button like this: next.enabled = YES; I tried with self. too but unfortunately I receive this error message: error: request for member 'enabled' in something not a structure or union Do you have any idea of what's happening there? And yes I have: #import <UIKit/UIKit.h> :) Using: [next setEnabled:YES]; gives me no error but still doesn't work... And finally, for documenting purposes here's the whole method: - (void)viewDidLoad { [super viewDidLoad]; if (!self.currentLevel) { self.currentLevel = @"1"; } NSArray *etape = [self.etapes objectForKey:self.currentLevel]; if ([etape count] > 0) { self.navigationItem.title = [etape objectAtIndex:1]; if ([etape count] > 1) { [next setEnabled:YES]; } } else { self.navigationItem.title = @"Aucune étape"; } } When I do: NSLog(@"%@", [next class]); It returns (null) ... I guess it is supposed to be UIBarButtonItem... It seems that it is impossible to play with any outlets even if I don't receive any errors while playing with them...

    Read the article

  • NullPointerException when generating RSA keys with boucycastle

    - by Tom Brito
    public static void main(String[] args) throws Exception { RSAKeyPairGenerator rsaKeyPairGen = new RSAKeyPairGenerator(); AsymmetricCipherKeyPair keyPair = rsaKeyPairGen.generateKeyPair(); } the rsaKeyPairGen is not null, but the generateKeyPair() method is throwing NullPointerException. What may be wrong? Error message: java.lang.NullPointerException at org.bouncycastle.crypto.generators.RSAKeyPairGenerator.generateKeyPair(Unknown Source) at pkg.main(Main.java:154)

    Read the article

  • strategies for learning complex software packages

    - by Tom
    I am a fairly novice Java programmer and I am currently working on a project to extend a piece of software that has been developed over a few years. So it has pretty big code base and the previous developers knew it well, so extending it is not going to be easy without a thorough understanding of the structure and function. 1) I had begun by trying to tackle small parts of the system and document them with mindmap. (particularly I am trying to document the interactions with external systems) 2) I have the book "code complete", which I am working through. 3) I have pointed some tools like "tattletale" at the code to get some diagrams of dependency relationships. What other strategies should I employ, should I focus on one particular aspect?

    Read the article

  • Resolving type parameter values passed to ancester type using reflection

    - by Tom Tucker
    I've asked a similar question before, but this one is much more challenging. How do I find a value of a specific type parameter that is passed to an ancestor class or an interface implemented by one of its ancestor classes using reflection? I basically need to write a method that looks like this. // Return the value of the type parameter at the index passed to the parameterizedClass from the clazz. Object getParameterValue(Class<?> clazz, Class<?> parameterizedClass, int index) For the example below, getParameterValue(MyClass.class, Map.class, 1) would return String.class public class Foo<K, V> implements Map<K, V>{ } public class Bar<V> extends Foo<Integer, V> { } public class MyClass extends Bar<String> { } Thanks!

    Read the article

  • Palm webOS CSS Targeting Hack?

    - by Tom
    Although it is not good practice, I am looking for a CSS hack to target Palm webOS. The problem is that Safari 3+ is awesome, and I can do some things like gradient background animations on text, but only in Safari. Right now I use @media screen and (-webkit-min-device-pixel-ratio:0) {} and it works like a charm, no Opera, Firefox, or whatever, because if I set the background to the image as I do in Safari they will all be ruined. But Palm's browser is based on webkit, and it uses the rules inside, and Palm's browser doesn't support text backgrounds so all I get is the image moving, no text. I would prefer a CSS hack, but if need be a Javascript one will do.

    Read the article

  • Where is the visual studio 2010 setup and deployment project template

    - by Tom Brown
    In VS 2008, when I create a project I can add a setup project easily. File-Add-New Project... then in Project types: select Other Project Types-Setup and Deployment - and there are a whole load of installed templates - including Setup Project to create an MSI installer. But in VS 2010 - there are no templates in the Setup and Deployment - I'm using the Pro edition, not Express or beta: Is this the same for you - or do I have a duff installation of VS 2010? Otherwise how do I create an MSI installer for my projects?

    Read the article

  • PHP Fatal error, trying to request method inside model multiple times

    - by Tom
    The error message [23-Mar-2010 08:36:16] PHP Fatal error: Cannot redeclare humanize() (previously declared in /Users/tmclssns/Sites/nadar/nadar/trunk/webapp/application/filer/models/Filer/Aggregate.php:133) in /Users/tmclssns/Sites/nadar/nadar/trunk/webapp/application/filer/models/Filer/Aggregate.php on line 133 I have a "Filer" model which contains several methods to generate graphs. Each method in there related to generating graphs has the suffix "Graph" in the method name. As we have some performance issues, I try to render the graphs in advance (using cron) instead of rendering them on each request. The code below is what I came up with: public function generategraphsAction() { $this->_helper->viewRenderer->setNoRender(); $config = Zend_Registry::get('config'); $id = $this->_getParam('filerid'); $filer = new Filer($id); $filer_methods = get_class_methods($filer); foreach ($filer_methods as $filer_method) { if (preg_match('/^(.*)Graph$/i', $filer_method, $matches)) { $path = $config->imaging_caching_dir . "/$id/{$matches[1]}.png"; $filer->$matches[0]($path); } } // var_dump(get_class_methods($filer)); die; } The result from the var_dump(), when uncommented, is: array 0 => string '__construct' (length=11) 1 => string 'find_by_name' (length=12) 2 => string 'getPartner' (length=10) 3 => string 'getSlots' (length=8) 4 => string 'getGroups' (length=9) 5 => string 'grouplist' (length=9) 6 => string 'getAggregates' (length=13) 7 => string 'getVolumes' (length=10) 8 => string 'getAggregateVolumes' (length=19) 9 => string 'getShelves' (length=10) 10 => string 'getAutoSupportHistory' (length=21) 11 => string 'getAutoSupportMail' (length=18) 12 => string 'getOrphans' (length=10) 13 => string 'getAll' (length=6) 14 => string 'getDiskRevOverview' (length=18) 15 => string 'getDiskTypeOverview' (length=19) 16 => string 'getDiskTypeSizeFunctionOverview' (length=31) 17 => string 'getLicenses' (length=11) 18 => string 'removeGroup' (length=11) 19 => string 'addGroup' (length=8) 20 => string 'hasGroup' (length=8) 21 => string 'aggdefaultGraph' (length=15) 22 => string 'aggbarGraph' (length=11) 23 => string 'voldefaultGraph' (length=15) 24 => string 'volbarGraph' (length=11) 25 => string 'replicationGraph' (length=16) 26 => string 'getReplicationData' (length=18) 27 => string 'humanize' (length=8) 28 => string 'getFiler' (length=8) 29 => string 'getOptions' (length=10) 30 => string 'getCifsInfo' (length=11) 31 => string 'getCifsStats' (length=12) 32 => string '__get' (length=5) 33 => string 'tr' (length=2) 34 => string 'trs' (length=3) 35 => string 'fieldList' (length=9) The generategraphsAction() method finds the 'Graph' methods correctly: array 0 => string 'aggdefaultGraph' (length=15) 1 => string 'aggdefault' (length=10) array 0 => string 'aggbarGraph' (length=11) 1 => string 'aggbar' (length=6) array 0 => string 'voldefaultGraph' (length=15) 1 => string 'voldefault' (length=10) array 0 => string 'volbarGraph' (length=11) 1 => string 'volbar' (length=6) array 0 => string 'replicationGraph' (length=16) 1 => string 'replication' (length=11) However when the first graph is generated, it generates the above listed PHP fatal error. Anyone can come up with a solution to this? I tried to pass by reference or switch a few things around (like re declare the Filer model, $current_filer = new Filer($id); and unset() it again after the request, but resulted in the same error) without much success. The referenced method "humanize" isn't used for anything I'm doing at the moment, but belongs to the Model because it's used in several other places. Of course, removing the method is not really an option right now, and the model contains several other methods as well so I assume if I just move the humanize method around, it will generate an error on the next one. For reference, the humanize() method: public function humanize ($kbytes, $unit = null) { // KiloByte, Megabyte, GigaByte, TeraByte, PetaByte, ExaByte, ZettaByte, YottaByte $units = array('KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); if (null !== $units) { $i = array_search(substr($unit, -2), $units); if (! $i) { $i = floor((strlen($kbytes) - 1) / 3); } } else { $i = floor((strlen($kbytes) - 1) / 3); } $newSize = round($kbytes / pow(1024, $i), 2); return $newSize . $units[$i]; } Thanks in advance for the help offered.

    Read the article

  • Don't display dynamic query in result

    - by Tom Andrews
    Hi all, Is it possible to hide a dynamic query from the result sets provided from a Stored Procedure? I am using the @@rowcount of the dynamic query to set a variable that is used to determine whether another query runs or not. The other query is used by code that I cannot change - hence why I am changing the Stored Procedure. The dynamic query returns as the first result set from the Stored Procedure is now the result of the dynamic query which currently is "breaking" the calling code. Thanks in advance

    Read the article

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