Search Results

Search found 3423 results on 137 pages for 'tom daniel'.

Page 105/137 | < Previous Page | 101 102 103 104 105 106 107 108 109 110 111 112  | Next Page >

  • How to encrypt a RSAKey using another RSAKey?

    - by Tom Brito
    I know its not the usual thing to do. But the specification I'm implementing is discribed this way, and I cannot run out. I was trying to encrypt the modulus and exponent of the private key, but the following test code raises an exception because the byte array is 1 byte larger then the maximum allowed by RSA block: 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; import javax.crypto.Cipher; import org.apache.commons.lang.ArrayUtils; 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(); System.out.println("Priv modulus len = " + privateKey.getModulus().bitLength()); System.out.println("Priv exponent len = " + privateKey.getPrivateExponent().bitLength()); System.out.println("Priv modulus toByteArray len = " + privateKey.getModulus().toByteArray().length); byte[] byteArray = privateKey.getModulus().toByteArray(); // the byte at index 0 have no value (in every generation it is always zero) byteArray = ArrayUtils.subarray(byteArray, 1, byteArray.length); System.out.println("byteArray size: " + byteArray.length); RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); Cipher cipher = Cipher.getInstance("RSA", "BC"); cipher.init(Cipher.ENCRYPT_MODE, publicKey); byte[] encryptedBytes = cipher.doFinal(byteArray); System.out.println("Success!"); } } (obs. its just a test, i would never encrypt the private key with its pair public key) The byte array is 128 bytes, the exactly maximum allowed by a RSA block, so why the exception? And how to fix it?

    Read the article

  • Simple cdd (custom debian distribution) problem

    - by Daniel G. R.
    Hi everyone, Im trying to make my own debian distribution but I have a problem. simple-cdd works fine but when I try to install my generated .iso, everything goes right since a message apears: " No installable kernel was found in the defined APT sources You may try to continue without a kernel. and manually install your kernel later. This is only recommended for experts, otheriwse you will likely end with a machine that dosent boot. COntinue Without installing a kernel? " And if y say yes, it continues... When is time to install grub it says: " Installation step failed An installation step failed. You can try to run the failing item again from the menu, or skip it and choose something else. The failing step is: Install the GRUB boot loader on a hard disk " HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Read the article

  • Is it possible to Load hbm.xml info at app startup instead of via an embedded resource?

    - by Daniel Auger
    All of the NHibernate examples I've see that use hbm files have the hbm.xml file set as an embedded resource with "do not copy" chosen in the file properties. This means that if a database column name were to change in production, the app would have to be recompiled with the changes in the hbm.xml file during build time. Is there any way to make NHibernate load the hbm.xml files from the file system at application startup instead of using an embedded version?

    Read the article

  • C# convert binary data to string?

    - by Tom
    Hi, just going through the registry retrieving values and binary is making my file outputer fall. I was wondering how could I convert Subkey.getValue(value[i]) into a String if the Value type is binary? Thank you in advance

    Read the article

  • How do you open a second WPF window without creating a new one.

    - by Daniel
    In the program I am trying to build, I have a menu button that opens a second window. The user puts information into the second window, presses the "Done" button, and the information is transfered into the main window. The problem I am having is opening the second window. I have both windows build in xaml files in Visual Studio but I can't find a way to show the second window. Using "Window window = new Window" does not fit my needs because 1) I already have the second window built and 2) I have tried this and I cannot figure out how to add children to the window; there is no window.children nor any grid to put the children into. Thank you in advance!

    Read the article

  • jQuery child of clicked element

    - by Tom
    Hi, I've got a list of links which have a click event attached to them, I need to get the ID from the child A link. So in the example below if I clicked the first list element I'd need google retuned. I've tried '$this a' but can't quite work out the syntax. jQuery: $("ul li").click(function(event){ $("input").val($(this).html()); } ); html: <ul> <li><a href="http://www.google.com" id="google">Google</a> </ul>

    Read the article

  • VB.NET SqlException Was Unhandled

    - by Daniel
    I am trying some SQL code but I get an error when I try this code. Main.database.ExecuteCommand("UPDATE Contacts SET first_name='" + c.first_name + _ "', middle='" + c.middle + _ "', last_name='" + c.last_name + _ "', age='" + c.age + _ "', mobile_phone='" + c.mobile_phone + _ "', home_phone='" + c.home_phone + _ "', work_phone='" + c.work_phone + _ "', home_street='" + c.home_street + _ "', home_city='" + c.home_city + _ "', home_state='" + c.home_state + _ "', home_zip='" + c.home_zip + _ "', work_street='" + c.work_street + _ "', work_city='" + c.work_city + _ "', work_state='" + c.work_state + _ "', work_zip='" + c.work_zip + _ "', home_www='" + c.home_www + _ "', work_www='" + c.work_www + _ "', home_email='" + c.home_email + _ "', work_email='" + c.work_email + _ "' WHERE first_name='" + c.first_name + _ "' AND last_name='" + c.last_name + "'") I get the following error Sql Exception was unhandled The data types text and varchar are incompatible in the equal to operator.

    Read the article

  • How do I fix the alpha value after calling GDI text functions?

    - by Daniel Stutzbach
    I have a application that uses the Aero glass effect, so each pixel has an alpha value in addition to red, green, and blue values. I have one custom-draw control that has a solid white background (alpha = 255). I would like to draw solid text on the control using the GDI text functions. However, these functions set the alpha value to an arbitrary value, causing the text to translucently show whatever window is beneath my application's. After calling rendering the text, I would like to go through all of the pixels in the control and set their alpha value back to 255. What's the best way to do that? I haven't had any luck with the BitBlt, GetPixel, and SetPixel functions. They appear to be oblivious to the alpha value. Here are other solutions that I have considered and rejected: Draw to a bitmap, then copy the bitmap to the device: With this approach, the text rendering does not make use of the characteristics of the monitor (e.g., ClearText). Use GDI+ for text rendering: This application originally used GDI+ for text rendering (before I started working on Aero support). I switched to GDI because of difficulties I encountered trying to accurately measure strings with GDI+. I'd rather not switch back. Set the Aero region to avoid the control in question: My application's window is actually a child window of a different application running in a different process. I don't have direct control over the Aero settings on the top-level window. The application is written in C# using Windows Forms, though I'm not above using Interop to call Win32 API functions.

    Read the article

  • Meshing different systems of keys together in XML Schema

    - by Tom W
    Hello SO, I'd like to ask people's thoughts on an XSD problem I've been pondering. The system I am trying to model is thus: I have a general type that represents some item in a hypothetical model. The type is abstract and will be inherited by all manner of different model objects, so the model is heterogeneous. Furthermore, some types exist only as children of other types. Objects are to be given an identifier, but the scope of uniqueness of this identifier varies. Some objects - we will call them P (for Parent) objects - must have a globally unique identifier. This is straightforward and can use the xs:key schema element. Other objects (we can call them C objects, for Child) are children of a P object and must have an identifier that is unique only in the scope of that parent. For example, object P1 has two children, object C1 and C2, and object P2 has one child, object C3. In this system, the identifiers given could be as follows: P1: 1 (1st P object globally) P2: 2 (2nd P object globally) C1: 1 (1st C object of P1) C2: 2 (2nd C object of P1) C3: 1 (1st C object of P2) I want the identity syntax of every model object to be identical if possible, therefore my first pass at implementing is to define a single type: <xs:complexType name="ModelElement"> <xs:attribute name="IDMode" type="IdentityMode"/> <xs:attribute name="Identifier" type="xs:string"/> </xs:complexType> where the IdentityMode is an enumerated value: <xs:simpleType name="IdentityMode"> <xs:restriction base="xs:string"> <xs:enumeration value="Identified"/> <xs:enumeration value="Indexed"/> <xs:enumeration value="None"/> </xs:restriction> </xs:simpleType> Here "Identified" signifies a global identifier, and "Indexed" indicates an identifier local only to the parent. My question is, how do I enforce these uniqueness conditions using unique, key or other schema elements based on the IdentityMode property of the given subtype of ModelElement?

    Read the article

  • Best workflow with Git & Github

    - by Tom Schlick
    Hey guys, im looking for some advice on how to properly structure the workflow for my team with git & github. we are recent svn converts and its kind of confusing on how we should best setup our day-to-day workflow. Here is a little background, im comfortable with command line and my team is pretty new to it but can follow use commands. We all are working on the same project with 3 environments (development, staging, and production). We are a mix of developers & designers so some use the Git GUI and some command line. Our setup in svn went something like this. We had a branch for development, staging and production. When people were confident with code they would commit and then merge it into the staging. The server would update itself and on a release day (weekly) we would do a diff and push the changes to the production server. Now i setup those branches and got the process with the server running but its the actual workflow that is confusing the hell out of me. It seems like overkill that every time someone makes a change on a file they would create a new branch, commit, merge, and delete that branch... from what i have read they would be able to do it on a specific commit (using the hash), do i have that right? is this an acceptable way to go about things with git? any advice would be greatly appreciated.

    Read the article

  • is it possible to use a python scrapper in a website?

    - by Tom
    I want to scrap a website and use that content in a website of my own. I am just wondering if that can be done with python 2.7, and if so how? If not, do I have to use JavaScript to scrap it? And do you have a good place to learn how to do that or good libraries for it. For those of you wondering, the website I am scrapping is legal, and they allow for this to be done. I have searched all over but apparently nobody tries to implement these scrappers that they write. I can write a web scrapper in python just fine. Say my scrapper scraps a name from a wikipedia page (John Doe for example), how can I use that name that I get in my website? Another update, I have found pjsrape and PhantomJS. I have only found one stack overflow post and the github examples with aren't very intuitive. If anybody has any experience or better ways to do it I would very much appreciate it

    Read the article

  • T4MVC and Ajax method with parameter

    - by Tom
    I am trying to apply T4MVC to my project. Say, I have an ajax search box, it calls Home/SearchQuery action which takes in a string q as parameter. How do I write that line in T4MVC? From Ajax.BeginForm("SearchQuery", "Home", .... To Ajax.BeginForm(MVC.Home.SearchQuery(???)... .cshtml file @using (Ajax.BeginForm("SearchQuery", "Home", /* <-----Convert to T4MVC Here */ new AjaxOptions { LoadingElementId = "loadingGif", OnSuccess = "parseResults", OnFailure = "searchFailed" })) { <input type="text" name="q" /> <input type="submit" value="Search" /> <img id="loadingGif" style="display:none" src="@Url.Content("~/content/images/loading.gif")" /> } <div id="searchResults" style="display: table"></div>

    Read the article

  • Cross-Domain + iFrame Question

    - by Tom
    Hi Guys, We are creating a "widget" for our site and wanted to ensure we have got this right. I realize this all relates to X-Browser permissions but little worried about how this works with like Cookies and permissions ?

    Read the article

  • Finding vars from dynamically created namespaces in clojure

    - by Tom Crayford
    The following test fails: (ns clojure_refactoring.rename-fn-test (:use clojure.test)) (deftest test-fn-location (in-ns 'refactoring-test-fn-rename) (clojure.core/refer-clojure) (defn a [b] (inc b)) (in-ns 'clojure_refactoring.rename-fn-test) (is (not= (find-var 'refactoring-test-fn-rename/a) nil)) (remove-ns 'refactoring-test-fn-rename)) That is, find-var (of a var I've just created, in a namespace I've just create) returns nil. This behaviour doesn't happen at the repl, where typing out the steps of the test works just fine. Am I doing something wrong, or is this just something that doesn't work in clojure right now?

    Read the article

  • Python - Removing duplicates from a string

    - by Daniel
    def remove_duplicates(strng): """ Returns a string which is the same as the argument except only the first occurrence of each letter is present. Upper and lower case letters are treated as different. Only duplicate letters are removed, other characters such as spaces or numbers are not changed. >>> remove_duplicates('apple') 'aple' >>> remove_duplicates('Mississippi') 'Misp' >>> remove_duplicates('The quick brown fox jumps over the lazy dog') 'The quick brown fx jmps v t lazy dg' >>> remove_duplicates('121 balloons 2 u') '121 balons 2 u' """ s = strng.split() return strng.replace(s[0],"") Writing a function to get rid of duplicate letters but so far have been playing around for an hour and can't get anything. Help would be appreciated, thanks.

    Read the article

  • How to find which existing .NET solutions contain a project?

    - by Daniel Daranas
    I am exploring a structure of folders with C# projects such as the following: Projects ProjectA ProjectB ProjectC ProjectD Scattered around in the same folders as the .csproj files, there are several solution (.sln) files. Is there a fast way to find all the solutions that contain ProjectD.vsproj? I can open them one by one and see what they contain, but I would like a feature such as "find all the solutions containing this project".

    Read the article

  • Howto get iframe linking to internal document source using javascript/jQuery?

    - by Tom
    Hi there, I have an iframe with id "appframe", the source is page.html and it's on the same server. I want to get the source of the page using jQuery. alert($("#appframe").contents().find("html").html()); returns <head></head><body></body> even though the document does not contain those tags, it only contains "Default page", so that is exactly what it should return. Any idea how to get the right source script of the whole document using jQuery? Eg. if the document would be "test" then that is exactly what it should return. Please note: I did ask this before a few weeks ago. Unfortunately, I got no solving answer. Because of my lower reputation (~85), I can not request a bounty... This doesn't make much sense to me. Anyway, it forced me to repost this question.

    Read the article

  • What is Java Message Service (JMS) for?

    - by Daniel
    I am currently evaluating JMS and I don't get what I could use it for. Currently, I believe this would be a Usecase: I want to create a SalesInvoice PDF and print it when an SalesOrder leaves the Warehouse, so during the Delivery transaction I could send a transactional print request which just begins when the SalesOrder transaction completes successfully. Now I found out most JMS products are standalone server. Why would a need a Standalone Server for Message Processing, vs. e.g. some simple inproc processing with Quartz scheduler? How does it interact with my application? Isn't it much too slow? What are Usecases you already implemented successfully?

    Read the article

  • What kind of work benifits from OpenCL

    - by Daniel
    Hey All First of all: I am well aware that OpenCL does not magically make everything faster I am well aware that OpenCL has limitations So now to my question, i am used to do different scientific calculations using programming. Some of the things i work with is pretty intense in regards to the complexity and number of calculations. SO i was wondering, maybe i could speed things up bu using OpenCL. So, what i would love to hear from you all is answers to some of the following [bonus for links]: *What kind of calculations/algorithms/general problems is suitable for OpenCL *What is the general guidelines for determining if some particular code would benefit by migration to OpenCL? Regards

    Read the article

  • Django: Site-Wide URL Prefix

    - by Tom
    I've built a Django site that will live at the root when it's live. Right now it's functioning perfectly at the IP address. For testing purposes, the client has pointed a proxy url at it, but the url has /folder/path in it, so none of the URL patterns match. I put (/folder/path)? into all the url patterns so they now respond, but all of the links are broken because I'm using the {% url %} tag and while the url patterns will match the optional path, they don't include it in that tag. Clearly I can just hard-code /folder/path into all of my urls (well, into all of the url includes) until testing is complete, but is there a better way to do this?

    Read the article

< Previous Page | 101 102 103 104 105 106 107 108 109 110 111 112  | Next Page >