Search Results

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

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

  • Using images and css file for a generated HTML UIWebView

    - by Tom
    Hi! I'm generating an HTML file for an app, and in this HTML file there's a link to a stylesheet and one to an image. Here's what I tried so far: NSMutableString *toReturn = [NSMutableString stringWithCapacity:100]; NSString *cssPath = [[NSBundle mainBundle] pathForResource:@"etapes.css" ofType:nil]; [toReturn appendFormat:@"<html><head><title></title><link href=\"%@\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" /></head><body>", cssPath]; It generates the right full path to the right file, this is okay if I want to access it on my mac, but on the simulator or my iPhone it doesn't point to the right place at all... Do you have any idea of how could I make this? Thanks

    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

  • Exclude files only in "release" in VS2008 config

    - by Tom
    Hi Guys, I was wondering how to "Exclude" individual files in the "release" web.csproj config of my solution. I've seen other answers and they all feature "include" - but this is not what I am wanting to achieve. I only want to exclude around 10-15 files from a "release" package ? I don't want to manually edit the web.csproj file - so is there any way I can do this via web.config or ? How would I go about doing this ?

    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

  • 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

  • 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

  • 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

  • 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

  • 2-Version software: Best VCS approach?

    - by Tom R
    I suppose I'd better explain my situation: I'm in the process of developing some software, and I'm at the stage where I'd like to split my project into two branches which differ in features. It so happens that this application is an Android application which I will be deploying on the Market, which has the constraint that every app must have a unique package identifier (sensible, no?). My current approach has been to clone the git repo of my original project, but this causes issues with package names. I want the system to be robust enough so that a bugfix/new feature on one branch will merge into another branch, but only when I want it to. Does anyone have any suggestions?

    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

  • What techniques can be used to detect so called "black holes" (a spider trap) when creating a web crawler?

    - by Tom
    When creating a web crawler, you have to design somekind of system that gathers links and add them to a queue. Some, if not most, of these links will be dynamic, which appear to be different, but do not add any value as they are specifically created to fool crawlers. An example: We tell our crawler to crawl the domain evil.com by entering an initial lookup URL. Lets assume we let it crawl the front page initially, evil.com/index The returned HTML will contain several "unique" links: evil.com/somePageOne evil.com/somePageTwo evil.com/somePageThree The crawler will add these to the buffer of uncrawled URLs. When somePageOne is being crawled, the crawler receives more URLs: evil.com/someSubPageOne evil.com/someSubPageTwo These appear to be unique, and so they are. They are unique in the sense that the returned content is different from previous pages and that the URL is new to the crawler, however it appears that this is only because the developer has made a "loop trap" or "black hole". The crawler will add this new sub page, and the sub page will have another sub page, which will also be added. This process can go on infinitely. The content of each page is unique, but totally useless (it is randomly generated text, or text pulled from a random source). Our crawler will keep finding new pages, which we actually are not interested in. These loop traps are very difficult to find, and if your crawler does not have anything to prevent them in place, it will get stuck on a certain domain for infinity. My question is, what techniques can be used to detect so called black holes? One of the most common answers I have heard is the introduction of a limit on the amount of pages to be crawled. However, I cannot see how this can be a reliable technique when you do not know what kind of site is to be crawled. A legit site, like Wikipedia, can have hundreds of thousands of pages. Such limit could return a false positive for these kind of sites. Any feedback is appreciated. Thanks.

    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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • Problem to focus JTextField

    - by Tom Brito
    I have used the approach of the ComponentListener to call focus in JTextField within a dialog, but for this case is just not working, I don't know why. It shows the focus in the text field and fast change to the button. Run and see: import java.awt.Component; import java.awt.GridLayout; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JPasswordField; import javax.swing.JTextField; public class User { private String username = ""; private String password = ""; public User() { // default constructor } public User(String username, String password) { this.username = username; this.password = password; } /** Create a panel containing the componet and tha label. */ public JPanel createLabeledComponent(JLabel label, Component comp) { GridLayout layout = new GridLayout(2, 1); JPanel panel = new JPanel(layout); panel.add(label); panel.add(comp); label.setLabelFor(comp); return panel; } public void showEditDialog() { JLabel usernameLbl = new JLabel(username); final JTextField usernameField = new JTextField(); usernameField.setText(username); JPanel usernamePnl = createLabeledComponent(usernameLbl, usernameField); JLabel passwordLbl = new JLabel(password); JPasswordField passwordField = new JPasswordField(password); JPanel passwordPnl = createLabeledComponent(passwordLbl, passwordField); Object[] fields = { "User:", usernamePnl, "Password:", passwordPnl }; JOptionPane optionPane = new JOptionPane(fields, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, null); JDialog dialog = optionPane.createDialog("User Data"); dialog.addComponentListener(new ComponentListener() { public void componentShown(ComponentEvent e) { usernameField.requestFocusInWindow(); } public void componentResized(ComponentEvent e) {} public void componentMoved(ComponentEvent e) {} public void componentHidden(ComponentEvent e) {} }); dialog.setVisible(true); } public static void main(String[] args) { new User().showEditDialog(); } } Any idea how to solve this?

    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

  • Increasing your efficiency during programming

    - by Tom
    Yeah, yeah, I know, it is a little bit of offtopic, but let's try. So, I want to increase my efficiency during my programming as much as possible to programme as fast and sensibly as possiblle. What do you do before starting coding? Drink a lot of coffee, energy drinks? Do you listen to music during programming or you keep quite? Share your ideas.

    Read the article

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