Daily Archives

Articles indexed Thursday June 17 2010

Page 3/121 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Encryption Product Keys : Public and Private key encryption

    - by Aran Mulholland
    I need to generate and validate product keys and have been thinking about using a public/private key system. I generate our product keys based on a client name (which could be a variable length string) a 6 digit serial number. It would be good if the product key would be of a manageable length (16 characters or so) I need to encrypt them at the base and then distrubute the decryption/validation system. As our system is written in managed code (.NET) we dont want to distribute the encryption system, only the decryption. I need a public private key seems a good way to do this, encrypt with the one key that i keep and distribute the other key needed for decrpytion/verification. What is an appropriate mechanism to do this with the above requirements?

    Read the article

  • Hash 32bit int to 16bit int?

    - by dkamins
    What are some simple ways to hash a 32-bit integer (e.g. IP address, e.g. Unix time_t, etc.) down to a 16-bit integer? E.g. hash_32b_to_16b(0x12345678) might return 0xABCD. Let's start with this as a horrible but functional example solution: function hash_32b_to_16b(val32b) { return val32b % 0xffff; } Question is specifically about JavaScript, but feel free to add any language-neutral solutions, preferably without using library functions. Simple = good. Wacky+obfuscated = amusing.

    Read the article

  • Is it safe to validate a URL with a regexp?

    - by Vilx-
    In my web app I've got a form field where the user can enter an URL. I'm already doing some preliminary client-side validation and I was wondering if I could use a regexp to validate if the entered string is a valid URL. So, two questions: Is it safe to do this with a regexp? A URL is a complex beast, and just like you shouldn't use a regexp for parsing HTML, I'm worried that it might be unsuitable for a URL as well. If it can be done, what would be a good regexp for the task? (I know that Google turns up countless regexps, but I'm worried about their quality). My goal is to prevent a situation where the URL appears in the web page and is unusable by the browser.

    Read the article

  • Illegal characters in path exception[closed]

    - by Neir0
    Hi I trying to get page from this url: YandexMarket but WebClient and httpWebRequest throw exception Illegal characters in path. HttpUtility.UrlEncode doesnt work for this symbol "-". Firefox and other browser are correctly open the page. Here is my code: public string GetPage(string url) { var wReq = (HttpWebRequest)WebRequest.Create(url); return new StreamReader(wReq.GetResponse().GetResponseStream()).ReadToEnd(); } How i can get the page? Sorry guys. All ok.

    Read the article

  • How to find a random point in a quadrangle?

    - by Gregg Cleland
    Hi! I have to be able to set a random location for a waypoint for a flight sim. The maths challenge is straightforward: "To find a single random location within a quadrangle, where there's an equal chance of the point being at any location." Visually like this: http://screencast.com/t/NTUxMzJhZGQ An example ABCD quadrangle is: A:[21417.78 37105.97] B:[38197.32 24009.74] C:[1364.19 2455.54] D:[1227.77 37378.81] Thanks in advance for any help you can provide. :-)

    Read the article

  • How to prevent Spell checking code in MS Office?

    - by Aaron
    We use MS Office. Outlook for emails, Word for some documentation and I use OneNote a lot for my own note taking. What bugs me is when I drop some code or use key words or even camel case into these apps the spell checking picks them up and I have red squiggles everywhere. Ignore is pretty much useless, so either I have to turn off Spell Check altogether start adding these to the custom dictionary. What would be good is if I can use the Set Language function to mark a whole block of text to just not be spell checked. Has anyone found a nice solution to this or do you know of a blank dictionary is best to use? I found using "Mohawk" kind of does that... might just use that for now. Maybe create a macro to switch between them.

    Read the article

  • Multiple login locations for an online app.

    - by Goro
    Hello, I am working on a browser based application that will have many users. The catch is that every user should have their own customized login page, but the actual application is the same for everyone, and needs to be in a central location. What is the most secure way of doing this? Would it make more sense to have a copy of the application for each user, and keep the database centralized? The projected number of users is not very high, probably around 20-80. Thank you,

    Read the article

  • I need to get form data from multiple forms on one page using $_POST

    - by CDeanMartin
    My project is a menu that displays daily specials at a cafe. The Pointy Haired Boss(PHB) needs to add/remove items from the menu on a daily basis, so I stored all dishes with MySQL, and created a page which will load all menu items as buttons. When clicked, the button will UPDATE the item, turning it on or off. I need form data to detect which button was pressed, so my query knows which $menuItem to UPDATE. That is the purpose of the hidden fields. <html><head></head> <body> <html><head></head> <body> <?php include("getElement.php"); $keys = array_keys($_POST); echo $keys[0]; echo $keys[1]; //if(isset($_POST["menuItem"])){ //toggleItem($_POST["menuItem"]); //echo print_r(array_keys($_POST));} ?> <form name="b" action="scratchpad.php" method="post" > <input type="hidden" name="b" value="Cajun Gumbo"/> <input type="submit" style="color:blue" value="Cajun Gumbo" /> </form> <form name="a" action="scratchpad.php" method="post" > <input type="hidden" name="a" value="Guacomole Burger"/> <input type="submit" style="color:blue" value="Guacomole Burger" /> </form> </body> </html> Can I get $_POST to identify which button was pressed?

    Read the article

  • SSL + Jquery + Ajax

    - by chobo2
    Hi I starting too look at a bit of security into my site. My site I would consider a very low security risk as it has really no personal information from the user other than email. However the security risk will go up a bit as I am partnering with a company and the initial password for this companies users will be the same password they use essentially to get onto the network and every piece of software. So I have up my security( what is fine by me...I wanted to get around to this anyways). So one of my security concerns is this. A user logs in. form submit(non ajax is done). Password is hashed & Salted and compared to one in the database. Reject or let them proceed. So this uses no jquery or ajax but is just asp.net mvc and C#. Still if my understanding is right the password is sent in clear text. So if a use SSL and I would not need to worry about that is this correct? If that is true is that all I need? Second the user can change their password at anytime. This is done through ajax. So when the password is sent it is sent in clear text( and I can verify this by looking at firebug). So if I have SSL enabled on this page is that all I need or do I need to do more? So I am just kinda confused of what I need to make the password being sent to the server(both ajax and full post ways secure). I am not sure if I need to do more then SSL or if that is enough and if it is not enough what is the next layer of security?

    Read the article

  • Finding process count in Linux via command line

    - by Moev4
    I was looking for the best way to find the number of running processes with the same name via the command line in Linux. For example if I wanted to find the number of bash processes running and get "5". Currently I have a script that does a 'pidof ' and then does a count on the tokenized string. This works fine but I was wondering if there was a better way that can be done entirely via the command line. Thanks in advance for your help.

    Read the article

  • Android: Scrolling an Imageview

    - by luca
    I have an ImageView that is twice the height of a normale screen ( 960 dip). I would like to scroll it nicely up and down on the screen. The bottom of the screen should contain a bottom. I have tried various combinations of ScrollView and Imageviews without any success. I have also thinkered with the :isScrollContainer attribute without results. Anyone knows how to do this? Cheers, Luca

    Read the article

  • Is ther anyone familiar with Erica Sadun's APIKit(app private api scanner)?

    - by user262325
    Hello everyone I'm trying to use APIKit to scan my codes to detect if there is private API. apiscanner should run as ./apiscanner ~/Desktop/MyPath/myapp.app I used command 'cd' go to the directory where apiscanner is. But if I call ./apiscanner ~/Desktop/MyPath/MyApp.app on terminal it reports Last login: Sun Jun 13 07:22:07 on ttys002 unknown required load command 0x80000022 Trace/BPT trap logout Even if I copy the files apiscanner and doit to MyPath, then execute, I get the same problem. I think there is something wrong when I run apiscanner under Mac OS X. Welcome any comment Thanks

    Read the article

  • One table, need multiple values from different rows/tuples

    - by WmasterJ
    I have tables like: 'profile_values' userID | fid | value -------+---------+------- 1 | 3 | [email protected] 1 | 45 | 203-234-2345 3 | 3 | [email protected] 1 | 45 | 123-456-7890 And: 'users' userID | name -------+------- 1 | joe 2 | jane 3 | jake I want to join them and have one row with two of the values like: 'profile_values' userID | name | email | phone -------+-------+----------------+-------------- 1 | joe | [email protected] | 203-234-2345 2 | jane | [email protected] | 123-456-7890 I have solved it but it feels clumsy and I want to know if there is a better way to do it. Meaning solutions that are either more readable or faster(optimized) or simply best-practice. Current solution: multiple tables selected, many conditional statements: SELECT u.userID AS memberid, u.name AS first_name, pv1.value AS fname, pv2.value as lname FROM users AS u, profile_values AS pv1, profile_values AS pv2, WHERE u.userID = pv1.userID AND pv1.fid = 3 AND u.userID = pv2.userID AND pv2.fid = 45; Thanks for the help!

    Read the article

  • UIViewAnimationTransitionCurlUp in landscape mode transitioning right-to-left

    - by Thanos
    I have a view controller that is showing in portrait mode. When you touch the "menu" button, it calls the code below and it flips up to the MainMenu controller. So far, so good. - (void) menuButton: (id) sender { MainMenu_ViewController * viewController = [[MainMenu_ViewController alloc] initWithNibName:@"MainMenu_ViewController" bundle:nil]; self.menuView = viewController.view; self.menuView.frame = self.view.bounds; [viewController release]; [UIView beginAnimations:nil context: nil]; [UIView setAnimationDuration: 1.0]; [UIView setAnimationTransition: UIViewAnimationTransitionCurlUp forView: self.view cache: YES]; [self.view addSubview: self.menuView]; [UIView commitAnimations]; } However, when you do the same in landscape mode, instead of the animation flipping up (with respect to gravity, i.e. towards the long end of the iPhone) it flips towards the left (i.e. towards the short end of the iPhone). Is this a limitation of the animation, or am I missing something?

    Read the article

  • Importing owl files

    - by Mikae Combarado
    Hello, I have a problem with importing owl files using owl api in Java. I successfully can import 2 owl files. However, a problem occurs, when I try to import 3 or more owl files that are integrated to each other. E.g. Base.owl -- base ontology Electronics.owl -- electronics ontology which imports Base.owl Telephone.owl -- telephone ontology which imports Base.owl and Electronics.owl When, I just import Base.owl and run Electronics.owl, it works smoothly. The code is given below: File fileBase = new File("filepath/Base.owl"); File fileElectronic = new File("filePath/Electronic.owl"); SimpleIRIMapper iriMapper = new SimpleIRIMapper(IRI.create("url/Base.owl"), IRI.create(fileBase)); OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); manager.addIRIMapper(iriMapper); OWLOntology ont = manager.loadOntologyFromOntologyDocument(fileElectronic); However, when I want to load Telephone.owl, I just create an additional iriMapper and add it to the manager. The additional code is shown with ** : File fileBase = new File("filepath/Base.owl"); File fileElectronic = new File("filePath/Electronic.owl"); **File fileTelephone = new File("filePath/Telephone.owl");** SimpleIRIMapper iriMapper = new SimpleIRIMapper(IRI.create("url/Base.owl"), IRI.create(fileBase)); **SimpleIRIMapper iriMapper2 = new SimpleIRIMapper(IRI.create("url/Electronic.owl"), IRI.create(fileElectronic));** OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); manager.addIRIMapper(iriMapper); **manager.addIRIMapper(iriMapper2);** OWLOntology ont = manager.loadOntologyFromOntologyDocument(**fileTelephone**); The code shown above gives this error : Could not load import: Import(url/Electronic.owl>) Reason: Could not loaded imported ontology: <url/Base.owl> Cause: null It would be really appreciated, if someone gives me a hand... Thanks in advance...

    Read the article

  • Backup plan for linux webserver in small business?

    - by radman
    Hi, I am currently in the process of writing a backup plan for the webserver in use by my business. I am very new to this area and have a few ideas about how things should work but am unsure of what tools to use and what sort of restore process is appropriate. I'm looking for something relatively simplistic and it doesn't have to be 100% paranoid just enough to give me a reliable backup. Speed is not of the essence and there is not going to be a live fallback in place. The backup will be onto a single hdd that will be stored onsite (no option for offsite as yet). Backups will be taking place weekly. I am constrained by both time and money which is why I'm aiming for a good enough solution. Is taking an image of the webserver system drive periodically and using that as the backup appropriate? Should I be testing that the backups restore correctly every time that I perform one? This is a bit broad but what setup would you use if you were in my place, given the services I am running? Should I add additonal machines and split the services? Any advice is much appreciated! See below for server details Webserver Platform Linux Ubuntu server Running mail-server svn-server mediawiki wordpress apache-webserver Hardware single 500gb sata drive Architecture Single machine behind router (with firewall) accessible to the internet.

    Read the article

  • How can I run a macro in OpenOffice for each record?

    - by Georg
    I'm trying to insert a different picture for every created letter. I can only use text mail merge fields, images aren't really supported as far as I can see. Now I'm trying to add this functionality using a macro. Is there an event that is triggered each time before the page is frozen and the next record gets processed?

    Read the article

  • Precompile Lambda Expression Tree conversions as constants?

    - by Nathan
    It is fairly common to take an Expression tree, and convert it to some other form, such as a string representation (for example this question and this question, and I suspect Linq2Sql does something similar). In many cases, perhaps even most cases, the Expression tree conversion will always be the same, i.e. if I have a function public string GenerateSomeSql(Expression<Func<TResult, TProperty>> expression) then any call with the same argument will always return the same result for example: GenerateSomeSql(x => x.Age) //suppose this will always return "select Age from Person" GenerateSomeSql(x => x.Ssn) //suppose this will always return "select Ssn from Person" So, in essence, the function call with a particular argument is really just a constant, except time is wasted at runtime re-computing it continuously. Assuming, for the sake of argument, that the conversion was sufficiently complex to cause a noticeable performance hit, is there any way to pre-compile the function call into an actual constant?

    Read the article

  • Is there a method I can use across controllers and if so, how do I use it?

    - by Angela
    I have several controllers that take an instance of different classes each (Email, Call, Letter, etc) and they all have to go through this same substitution: @email.message.gsub!("{FirstName}", @contact.first_name) @email.message.gsub!("{Company}", @contact.company_name) @email.message.gsub!("{Colleagues}", @colleagues.to_sentence) @email.message.gsub!("{NextWeek}", (Date.today + 7.days).strftime("%A, %B %d")) @email.message.gsub!("{ContactTitle}", @contact.title ) So, for example, @call.message for Call, @letter.message for Letter, etcetera. This isn't very dry. I'd like to have something like def messagesub(asset) @asset.message.gsub.... end or something like that so I can just use messagesub method in each controller.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >