I've made a cocoa mac application which needs to check if a serial number/license key is correct, i'm unsure what type of algorithms would be the best for this. Lets say i have this serial number: 4829-1234-4321-1234-4326-5232 or any set of 4 numbers. I was thinking about using an algorithm like if the first set of the license key is divisible by 5, second by 10, third by 24.... but i'm not sure if this is the best way to go about it. I would also need to generate the keys in PHP. Any help is appreciated
I am trying to redirect my page after successful login to a new url.. <?php include_once "fbmain.php"; $config['baseurl'] = "http://localhost:8080/index.php";; // login or logout url will be needed depending on current user state. if ($fbme) { $logoutUrl = $facebook->getLogoutUrl( array( 'next' => $config['baseurl'], ) ); } else { $loginUrl = $facebook->getLoginUrl( array( 'display' => 'popup', 'next' => $config['baseurl'] . '?loginsucc=1', 'cancel_url'=> $config['baseurl'] . '?cancel=1', 'req_perms' => 'email,user_birthday', ) ); } // if user click cancel in the popup window if (isset($_REQUE
I am using FFmpeg to convert a video to .mp4, ,ogg, .webm, so that it may be viewed in all HTML5 capable browsers using the video tag. The problem is that I manage to convert the video to the three required formats, but it does not display the video in the video tag, all I get is Internet Explorer 9: Red cross, Firefox: Grey cross, could it be a problem with the conversion or is it something to do with the way I am adding them to the source of the video tag. Here is what I have done: FFmpeg command line(s): ffmpeg -i test.mp4 test.mp4 ffmpeg -i test.mp4 test.ogg ffmpeg -i test.mp4 test.webm He
I am using FFMPEG to convert a video to .mp4, ,ogg, .webm so that it may be viewed in all HTML5 capable browsers using the video tag. The problem is that I manage to convert the video to the 3 required formats but it does not display the video in the video tag, all I get is IE9: red cross, Firefox: Grey cross, could it be a problem with the conversion or is it something to do with the way I am adding them to the source of the video tag. Here is what I have done: FFmpeg command line(s): ffmpeg -i test.mp4 test.mp4 ffmpeg -i test.mp4 test.ogg ffmpeg -i test.mp4 test.webm Here is the video tag: <
I have seen everyone doing it tho I don't get why. document.write('<script src="src"><\/script>'); I mean using the single ' you shouldn't need to escape chars?
I have Java swing application. I want to convert to web base application. What is easiest way? Is there any tool available, preferably open source code?
Hi I'm seeing a great number of different ways to implementat blockquote in html but it doesn't seem clear in its documentation how should I properly format a blockquote let's say of a famous quote and metion its author like: In victory, you deserve Champagne, in defeat, you need it. Napoleon Bonaparte What would the correct format of that be in HTML5? Should the author be inside or outside the blockquote tag? Should it be inside the cite attribute? (even knowing the documentation specifies an URI , not author)
can somebody please explains what is a high level class diagram. As far as I know class diagram shows the association between the classes but what about high level class diagram??
I have tried to find out the way I can put locks or disable the copy and paste on the PDF file after the conversion. I looked at the ConversionJobSettings properties but I couldn’t be able to accomplish this. Based on what I have read, the sharepoint2010 Word Automation services API provides very limited capability in manipulating the conversion logics but is there any way I can lock down the content so that it cannot be copied? Thank for your help
I have a problem with submitting form with AJAX, print the response string under the form and set the input to readonly. My code: $('#save').click( function(){ var form_data ={ name: $('#name').val(), ajax:'1' }; $.ajax({ url:"page.php", type: 'POST', data: form_data, success: function(data){ $('#form_message').html(data); } }); $('#name').toggleClass('bgcolored'); $('#save').addAttr('readonly'); $('#save').toggleClass("invisible"); return false; } If I delete the row $('#save').addAttr('readonly'); the script works: it send values, catch the response and print it into the div form_message and
Hi I have a survey page(survey.aspx) with question and answers. some of the answers have Radio buttons and check boxes. This page has a print button. When the user clicks on the print button another page(survey_print.aspx) opens up with the print content. I have all the content Radio buttons and check boxes in the print page. But how to show the checked Radio buttons and check boxes in the print page. This has to be done using Javascript or jquery. Any idea how this can be done. Thanks in advance
hope you can help me with a bit of a problem I've encountered. I'm writing a Facebook application where I'm making posts to user walls to update game score using the PHP SDK. What I'm trying to do is delete the old post before posting the new one, and that's no problem. Where the problem starts is if the user has manually deleted the old post beforehand. When that's the case, the user's FB session is dropped and all interaction with the API becomes impossible until the user has gone through FB.login again. The code I'm using is: try { $statusUpdate = $facebook->api('/'.$postID, 'delete'); } ca
What is the difference between the following 2 queries? mysql_query("UPDATE table SET name = '$name'"); mysql_query("UPDATE table SET name = '{$name}'");
How can I inspect an Object in an alert box? Normally alerting an Object just shows an opaque representation like [object Object]. For example: alert(document); // displays "[object HTMLDocument]" But I want to get the properties and methods of the object in the alert box. How can I achieve this functionality, if possible? Or are there any other suggestions? Particularly, I am seeking a solution for a production environment where console.log and Firebug are not available.
I was wondering, is it possible to integrate haskell's powerful type system into a language like C, and still be able to do efficent low level programming?
I have a long integer number, but it is stored not in decimal form, but as set of remainders. So, I have not the N number, but set of such remainders: r_1 = N % 2147483743 r_2 = N % 2147483713 r_3 = N % 2147483693 r_4 = N % 2147483659 r_5 = N % 2147483647 r_6 = N % 2147483629 I know, that N is less than multiplication of these primes, so chinese remainder theorem does work here ( http://en.wikipedia.org/wiki/Chinese_remainder_theorem ). How can I restore N in decimal, if I have this 6 remainders? The wonderful will be any program to do this (C/C+GMP/C++/perl/java/bc). For example, what minimal
Imagine I have the following string : set(SEXY_STRING "I love CMake") then I want to obtain SEXY_LIST from SEXY_STRING so I can do list(LENGTH SEXY_LIST len) and len is equal 3. I've found several macros on web, but I really want to know how to do it in "natural" way. This operation seems to be very basic and widely used.
I am reloading some cells in my table view. After the reload is done, I want to scroll so that they are visible. I am aware of the scrollToRowAtIndexPath:atScrollPosition: method. But I need to call it after the reload as done, as said reload will change row heights. Here are some related questions, but they don't quite answer my question. UITableView , Scroll to bottom on reload? How to Start UITableView on the Last Cell EDIT -- My reload does not insert or delete any rows. Rather, I am reloading one or more cells to reflect updated information.
Today I installed Valgrind on my Mac OS X 10.6 and tried to test it out. And it turned out to be weird memory leaks in the system. What I did was just create simple c file that get some heap memory and immediately free it. When I ran Valgrind it showed something like this Realfrees-MacBook-Pro:C Realfree$ valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./a.out ==2621== Memcheck, a memory error detector ==2621== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==2621== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info ==2621== Command: ./a.out ==262
Forenote: This is an extension of the thread started on /r/haskell Lets start with the facts: Android is one awesome Operating System Haskell is the best programming language on the planet Therefore, clearly, combining them would make Android development that much better. So essentially I would just like to know how I can write Haskell programs for the Android OS. My question is: How can I get a Haskell program to execute/run on the Android OS?
Is it possible in Linux (and/or on other Unix) 'shrink' file from beginning? I'd like to use it for persistent queue (no existing implementation suits my needs). From end of file I guess it's possible with truncate().
20110216_00 20110216_01 ... 20110216_23 20110217_00 .. and so on I have tried with date +'%Y%m%d_%H' but it never starts with 00-23 format but from 01-24 like format, hence I get hour part always incorrect. Can anybody suggest, how can I get above o/p
We have several Crystal Reports (version 8.5) that we run from VB6 and VB.Net. Most of these work just fine to export to PDF, but two reports (out of many) throw this error when exporting to PDF: Error detected by export DLL: (541) The error seems to be an unhandled error in Crystal, and we've tried changing every parameter we can think of with no luck. Any ideas? TIA.
I Have a vb6 application using crystal report 8.5 and sql server 2005.My issue is that when I print report i get Server has not yet been opened.Here is my code in vb.: Option Explicit Dim ctr As Integer Dim cn As New ADODB.Connection--Provider=SQLOLEDB.1;Password=password;Persist Security Info=True;User ID=user ID;Initial Catalog=database Name;Data Source=server Name Dim crApp As CRAXDRT.Application Dim crReport As CRAXDRT.Report Dim crtable As CRAXDRT.DatabaseTable Private Sub prin_Click() Dim rs As New ADODB.Recordset Set cn = New ADODB.Connection cn.ConnectionString = MDI1.txtado cn.Open Se
I have emacs split horizontally - on top I'm editing Perl code, the bottom is the shell. By default emacs makes the two windows equal in size, but I'd like the shell buffer smaller (maybe half the size?). I was wondering how I could do that.
In C# there's a null-coalescing operator (written as ??) that allows for easy (short) null checking during assignment: string s = null; var other = s ?? "some default value"; Is there a python equivalent? I know that I can do: s = None other = s if s else "some default value" But is there an even shorter way (where I don't need to repeat s)?