Search Results

Search found 1948 results on 78 pages for 'tom davies'.

Page 61/78 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • Why the generated key size is not constant?

    - by Tom Brito
    The following code prints randomly 634, 635, 636, each time I run it. Why its not constant? public static void main(String[] args) throws Exception { KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA", "BC"); keyPairGen.initialize(1024); RsaKeyPair keyPair = new RsaKeyPair(keyPairGen.generateKeyPair()); System.out.println(keyPair.getPrivate().getEncoded().length); }

    Read the article

  • How to embed a google map with a changeable area?

    - by Tom
    I haven't worded this very well But basically, I'd like to embed a map on my site - but the area it shows will change. I've tried doing this, but it never seems to work as it will focus on the wrong area - the old area, rather than the new area. Basically, I'd like a google map code that uses $place as a location. Thanks.

    Read the article

  • No such file to load, Model/Lib naming conflict?

    - by Tom
    I'm working on a Rails application. I have a Module called Animals. Inside this Module is a Class with the same name as one of my Models (Dog). show_animal action: def show_animal require 'Animals/Bear.rb' #Works require 'Animals/Dog.rb' #Fails end So the first require definitely works, the seconds fails. MissingSourceFile (no such file to load -- Animals/Dog.rb): I noticed that Dog.rb is the same file name as one of my models, is that what's causing this? I'm using Webrick.

    Read the article

  • Eclipse Type Hierarchy Question

    - by Tom Tresansky
    In Eclipse, the Java Method Override Indicator is the little upwards arrow next to a method in the Type Hierarchy view. A solid arrow means a method overrides an existing method lower in the hierarchy. What does the hollow arrow mean? Do annotations effect either arrow?

    Read the article

  • A data structure based on the R-Tree: creating new child nodes when a node is full, but what if I ha

    - by Tom
    I realize my title is not very clear, but I am having trouble thinking of a better one. If anyone wants to correct it, please do. I'm developing a data structure for my 2 dimensional game with an infinite universe. The data structure is based on a simple (!) node/leaf system, like the R-Tree. This is the basic concept: you set howmany childs you want a node (a container) to have maximum. If you want to add a leaf, but the node the leaf should be in is full, then it will create a new set of nodes within this node and move all current leafs to their new (more exact) node. This way, very populated areas will have a lot more subdivisions than a very big but rarely visited area. This works for normal objects. The only problem arises when I have more than maxChildsPerNode objects with the exact same X,Y location: because the node is full, it will create more exact subnodes, but the old leafs will all be put in the exact same node again because they have the exact same position -- resulting in an infinite loop of creating more nodes and more nodes. So, what should I do when I want to add more leafs than maxChildsPerNode with the exact same position to my tree? PS. if I failed to explain my problem, please tell me, so I can try to improve the explanation.

    Read the article

  • Trying to understand Java RSA key size

    - by Tom Brito
    The key generator was initilized with a size of 1024, so why the printed sizes are 635 and 162? import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; public class TEST { public static KeyPair generateKeyPair() throws NoSuchAlgorithmException, NoSuchProviderException { KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA", "BC"); keyPairGenerator.initialize(1024); return keyPairGenerator.generateKeyPair(); } public static void main(String[] args) throws Exception { KeyPair keyPair = generateKeyPair(); RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); System.out.println("Size = " + privateKey.getEncoded().length); System.out.println("Size = " + publicKey.getEncoded().length); } }

    Read the article

  • How to get the parameter names of an object's constructors (reflection)?

    - by Tom
    Say I somehow got an object reference from an other class: Object myObj = anObject; Now I can get the class of this object: Class objClass = myObj.getClass(); Now, I can get all constructors of this class: Constructor[] constructors = objClass.getConstructors(); Now, I can loop every constructor: if (constructors.length > 0) { for (int i = 0; i < constructors.length; i++) { System.out.println(constructors[i]); } } This is already giving me a good summary of the constructor, for example a constructor public Test(String paramName) is shown as public Test(java.lang.String) Instead of giving me the class type however, I want to get the name of the parameter.. in this case "paramName". How would I do that? I tried the following without success: if (constructors.length > 0) { for (int iCon = 0; iCon < constructors.length; iCon++) { Class[] params = constructors[iCon].getParameterTypes(); if (params.length > 0) { for (int iPar = 0; iPar < params.length; iPar++) { Field fields[] = params[iPar].getDeclaredFields(); for (int iFields = 0; iFields < fields.length; iFields++) { String fieldName = fields[i].getName(); System.out.println(fieldName); } } } } } Unfortunately, this is not giving me the expected result. Could anyone tell me how I should do this or what I am doing wrong? Thanks!

    Read the article

  • Zend_Soap with attachments (server)

    - by Tom
    i'm trying to build a SOAP service with Zend_Soap. Everything is working great but the client needs the ability to send attachments to the service (not base64 encoded strings, as this service will be called multiple times a day with various file sizes so processing all that in memory is not possible. So I'd like to handle a normal SOAP attachment (DIME/MIME) with the SOAP server in Zend Framework however I'm unable to find documentation about it. Can I access it with $_FILES[] or any other way? Is it even possible in Zend_Soap (as there's not that much info available). SOAP is a must - so thanks for the advice but it has to be SOAP, not REST.

    Read the article

  • How to set Main Inerface in xCode programatically

    - by Tom Tallak Solbu
    I am using Apples MultipleDetailViews http://developer.apple.com/library/ios/#samplecode/MultipleDetailViews/Introduction/Intro.html for template as a source for my iPad app. The template is using a splitviewController in the interface builder (MainWindow). In the iPhone/iPad Deployment info of the target, MainWindow is set as the "Main Interface". I want my app to also run on iPhone. This means I need to load a different xib when the app is run on an iPhone. I must then remove "MainWindow" from "Main Interface" because the app will crash when I load on an iPhone due to the splitViewController. The AppDeleagte of the template look like this: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootViewController = self.splitViewController; [self.window makeKeyAndVisible]; } If I remove "Main Window" from "Main Interface", how do I then need to change the APpDelegate, or maybe I need to change the MainWindow.xib to also work for iPhone?

    Read the article

  • Asp.net mvc html melper

    - by tom
    Hi there Ive got this function as a html helper which should write a javascript function onto the page, I then call this in the masterpage like this <%Html.RenderBaseUrlScript(); % My problem is that the script never seems to be written to the page, I search in the source and cannot see it anywhere, I have tried moving this around from the head to the body of the html masterpage, Im really confused as to why this is not workung, please help public static string RenderBaseUrlScript(this HtmlHelper helper) { return string.Format("<script type='text/javascript'> $.url=function(url){{return '{0}'+url;}}", GetBaseUri()); }

    Read the article

  • Easy HTTPS to PHP script

    - by Tom
    Hi, here is my scenario: I have a website with php, mySQL. I have a software application that has a login screen and sends usernames and passwords over the web by http: public String GetWebPageSource(String pURL) { try { byte[] vReceivedBytes = null; using (System.Net.WebClient vWebClient = new System.Net.WebClient()) { vReceivedBytes = vWebClient.DownloadData(pURL); } int vBomLen = 3; byte[] vStrippedBytes = new byte[vReceivedBytes.Length - vBomLen]; Array.Copy(vReceivedBytes, vBomLen, vStrippedBytes, 0, vReceivedBytes.Length - vBomLen); return System.Text.Encoding.UTF8.GetString(vStrippedBytes); } catch (Exception e) { Console.WriteLine(e.Message); return null; } } So to send a username and password I would write: GetWebPageSource("http://mywebsite.com/Login.php?username=stackoverflow&password=iscool") and the php file would spit out some text saying whether the password is accepted or denied. However this is NOT secure. So I want to make it secure... https. How easy is it to integrate https? How much will the code change? How much do I have to handle? What is transparent to me. Do I have to check if a cookie already exists and if not write the methods for authentication or is there librarys already provided that will do it for me?

    Read the article

  • XSLT; parse escaped text to a node-set and extract subelements

    - by Tom W
    Hello SO; I've been fighting with this problem all day and am just about at my wit's end. I have an XML file in which certain portions of data are stored as escaped text but are themselves well-formed XML. I want to convert the whole hierarchy in this text node to a node-set and extract the data therein. No combination of variables and functions I can think of works. The way I'd expect it to work would be: <xsl:variable name="a" select="InnerXML"> <xsl:for-each select="exsl:node-set($a)/*"> 'do something </xsl:for-each> The input element InnerXML contains text of the form <root><element a>text</element a><element b><element c/><element d>text</element d></element b></root> but that doesn't really matter. I just want to navigate the xml like a normal node-set. Where am I going wrong?

    Read the article

  • Find objects between two dates MongoDB

    - by Tom
    I've been playing around storing tweets inside mongodb, each object looks like this: { "_id" : ObjectId("4c02c58de500fe1be1000005"), "contributors" : null, "text" : "Hello world", "user" : { "following" : null, "followers_count" : 5, "utc_offset" : null, "location" : "", "profile_text_color" : "000000", "friends_count" : 11, "profile_link_color" : "0000ff", "verified" : false, "protected" : false, "url" : null, "contributors_enabled" : false, "created_at" : "Sun May 30 18:47:06 +0000 2010", "geo_enabled" : false, "profile_sidebar_border_color" : "87bc44", "statuses_count" : 13, "favourites_count" : 0, "description" : "", "notifications" : null, "profile_background_tile" : false, "lang" : "en", "id" : 149978111, "time_zone" : null, "profile_sidebar_fill_color" : "e0ff92" }, "geo" : null, "coordinates" : null, "in_reply_to_user_id" : 149183152, "place" : null, "created_at" : "Sun May 30 20:07:35 +0000 2010", "source" : "web", "in_reply_to_status_id" : { "floatApprox" : 15061797850 }, "truncated" : false, "favorited" : false, "id" : { "floatApprox" : 15061838001 } How would I write a query which checks the *created_at* and finds all objects between 18:47 and 19:00? Do I need to update my documents so the dates are stored in a specific format? Thanks

    Read the article

  • How to delete files with a Python script from a FTP server which are older than 7 days?

    - by Tom
    Hello I would like to write a Python script which allows me to delete files from a FTP Server after they have reached a certain age. I prepared the scipt below but it throws the error message: WindowsError: [Error 3] The system cannot find the path specified: '/test123/*.*' Do someone have an idea how to resolve this issue? Thank you in advance! import os, time from ftplib import FTP ftp = FTP('127.0.0.1') print "Automated FTP Maintainance" print 'Logging in.' ftp.login('admin', 'admin') # This is the directory that we want to go to directory = 'test123' print 'Changing to:' + directory ftp.cwd(directory) files = ftp.retrlines('LIST') print 'List of Files:' + files # ftp.remove('LIST') #------------------------------------------- now = time.time() for f in os.listdir(directory): if os.stat(f).st_mtime < now - 7 * 86400: if os.directory.isfile(f): os.remove(os.directory.join(directory, f)) #except: #exit ("Cannot delete files") #------------------------------------------- print 'Closing FTP connection' ftp.close()

    Read the article

  • Why is Java layout system so complicated to work with?

    - by Tom Brito
    Some points that make java swing layout system a nightmare: There's thousands of properties; Even if you learn all the properties, each layout manager ignores some properties; The only existing good RAD tool (NetBeans) does not work well; Layout managers behave different with components and containers inside it.

    Read the article

  • A UI over Windows Workflow

    - by Tom
    Hi there, Are there any build in UI capabilities when using Windows Workflow.. Lets say I have a workflow that takes an hour to run where different activities are happening all the time. While it's running I want to see what activity is currently active, what activities have already ran etc.. Do I have to code this UI myself or does WF have built in features that graphically show the status etc of the workflow?

    Read the article

  • Taking over someone else's code

    - by tom d
    I am taking over someone elses code. What are some good ways to learn what that programmer did as quickly as possible? I have been running it, stepping through it and looking at the callstack. What else can I do? Sorry I forgot to mention, but there is little documentation and I have been trying to fix simple problems. Thanks!

    Read the article

  • Any php code to make embed code of video ?

    - by Tom
    Hi, I Want a php code to turn a youtube/dailymotion/vimeo/metacafe... URL into an EMBEDABLE code so i can show it using echo , it is really hard to read the API of every website, so i'm wondering if there is a class or code to do this. Note: if there isn't anyone, then maybe a jQuery facebox alternative who supports more than youtube. Thanks

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >