0x00
Members-
Posts
120 -
Joined
-
Last visited
Everything posted by 0x00
-
What about getting help in forums? Should you give credit and royalties?
-
Ah, not so... What if you'd never heard of Einstein but worked through the maths involved and proved the same theory, would you have come up with it yourself, should you still be proud, nevertheless you wouldn't be the one recorded in history as the first. I can't remember what or who but I know of such a case, think it was in one of Simon Singhs crypto books, a young boy in India doing public key crypto with primes, even though it had already been established by RSA (Rivest, Shamir and Adleman), even though declassified British files later proved that the British had been using such a system many years before, similar to the story about who invented the first computer. Same with Marconi, the reputed developer of radio communications, whereas again, developed fist in Britain, but not patented! Some do it for the love, others for money, but that is the nature of Cathedrals and Bizarres (a book about opensource development).
-
I believe Apple patented the bounce at the end of a scroll, even though it was a basic falloff animation, but that's Apple for you, steal everyone else's tech then moan and claim for cash when they think they can, even though various games had used such events for years. http://www.theregister.co.uk/2013/11/21/samsung_cries_racism_then_asks_for_further_review_in_apple_patent_case/ You find some tutorials online where people go to silly lengths to make their code look unique, but at the cost of speed. Another way (not really with PHP) is to obfuscate compiled code in specific tell tale ways. When I say I don't copy code... well, maybe through the use of tutorials a longtime before, which I've hacked apart and rebuilt numerous times and eventually writing into own classes. Also tutorials rarely have error checking and such so it is so far removed from the original that its not. The thing you want to try to patent is the end product concept and also the brand. All said,there are a few encryption algorithms that are copyrighted, e.g. RC4 encryption (ref: http://arstechnica.com/security/2012/11/patent-suits-target-google-intel-hundreds-more-for-encrypting-web-traffic/) but there are variations on it that are supposedly not covered simply because they have a different name, personally I'd have thought that the patent would have run out by now (or even just after it was published)! Anyway it appears its flawed, https://en.wikipedia.org/wiki/RC4
-
Why are you selecting by role? You need to select by the current users name or id...
-
A) It uses the same memory as a TIMESTAMP variable and I've always used unixtime, also easily transferable to other formats on different platforms without parsing or formatting. Oh and my CMS allows for user defined output formats, so may as well only do once. B) Probably part of the regex used for BB code parsing?
-
BTW I store dates as int's
-
I told you it wouldn't, I just gave you the concept, Benanamen did though, except the last touch... so have a go and report back with code if it doesn't and someone will help. You won't learn if we just do it for you
-
You'd be better off doing it pre-storage, even inform the user that the dates are not valid. Storing dates as instructed??? By whom... actually who cares, in what format are they?
-
I guess to use an UPDATE using DAYOFWEEK https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_dayofweek .. UPDATE date=date+(1 day) .. WHERE DATEOFWEEK(date)=1 You'd need to combine two cases, one for Sat and another for Sun, and no +(1 day) isn't real, but would depend on how you're storing the date
-
Do you need a persistent connection? Most web servers weren't designed to handle persistent connections, they may even have a limited thread pool to work with (i.e. a max number of concurrent connections). Most realtime games use persistent tcp connections, and many games baulk out at 20 or so concurrent connections, yes there are ways to handle more, but, well... another story!
-
Show the code then
-
I don't use raw sockets much anymore because there are so many libraries which handle them for you. Setting up sockets is very fiddly and thats before handling all the possible signals, threads and security concerns. That's why we now use web servers for many things, it works out the box, but it may not be right for your circumstance, but there is probably a library, framework or program which will be. I'm not asking for your million pound idea, but what it does and its constraints would help, well not me but you.
-
Try: $sql = "SELECT role FROM users WHERE username = 'user'"; or if you have the current users id then you could: $sql = "SELECT role FROM users WHERE id = '".$id."'";
-
What are the column tables of the table?
-
All networks are based on sockets, e.g. Berkley Sockets, WinSock, etc... IMHO sockets are too low level for you (but then again I have no idea at what you're doing). Personally when web programming I've never had to use / manage them, I only go that low when using C or C++, etc... My main point is, if you're communicating with a web server then all the sockets are already managed for you and you just use functions like file_get_contents() or maybe cURL, etc. Apache and NGINX, setup pools of threads that manage sockets, they then pass the data to the PHP parser (sort of), which is technically the application (even though the server can be thought of as the application when considering the OSI layers.) Soooo... what are you wanting to do, then someone can suggest the ideal solution, e.g. maybe things like SOAP or REST for different types of API demands, etc...
-
You need to specify the current user, and not just by role... probably either by name, id, etc... depending on your table columns.
-
Does admin have the admin role, is it also the first entry to have such a role, if so that will be your first result. In cases like this I test for a single result otherwise display an error msg (in debug anyway, else log it). Here I'm guessing that multiple users can have the same role, however each user has a unique username, id, etc... The easiest way to debug this is to loop the results and print them all out... while ($row = $result->fetch_assoc()) { echo ... } Scratch all that, you're asking it for users with admin role! So that's what you're getting!?
-
In this case then server B would have to initiate the connections.
-
You probably need a WHERE clause else its returning all users roles and you are only checking the first rows result: $sql = "SELECT role FROM users WHERE name='user'";
-
Your questions are so open its hard to tell you anything without a million clauses... The router will need either port forwarding if its your own, else server B needs to be in the DMZ (basically same thing if I remember right). Is the router your home router or an actual internet gateway? The bit no-one has mentioned is that server B has a dynamically assigned IP, is that on the internal network, or is that the router itself or does that have a static IP? If so, then server B needs to start the communication to server A's static IP, or it needs to indicate somewhere what its IP is for server A to contact it. If this is all using web servers, then if a dynamically assigned IP client server (i.e. previously unknown) contacts the host server, then the following may be used to get it's details (note that some of these may be empty, spoofed or dangerous): $remote_addr=@$_SERVER['REMOTE_ADDR']; $remote_host=@$_SERVER['REMOTE_HOST']; if($remote_host==""){$remote_host = gethostbyaddr($remote_addr);} $refer=@$_SERVER['HTTP_REFERER'];
-
How can I get the data of individual pixels?
0x00 replied to greenace92's topic in Application Design
I use Tesseract for parsing receipts and OpenCV for other related things... -
Why manual array works with extract but auto download does not?
0x00 replied to tommytx's topic in PHP Coding Help
As Benanamen says, bad practice! So, you have a set of variables (an array or object say), what you are essentially doing is 1) redeclaring the same variables, e.g. doubling up memory usage and wasting CPU cycles, 2) magically declaring new variables which to the casual reader will look like they are appearing out of thin air undeclared, and all for what, to be slick... personally clarity and efficiency are more desirable attributes to me, especially when revising code 3yrs later... -
Why manual array works with extract but auto download does not?
0x00 replied to tommytx's topic in PHP Coding Help
How does this work? extract($siteurl[0]); The db returns an array of row objects, I think!? ** Never seen or used extract() and not sure how WP returns results... -
Just tried to save one and nothing saves... The filename given is "push". In Opera's Downloads section it listed the following as "from": https://cm.g.doubleclick.net/push?client=ca-pub-8794381281316343&srn=gdn and reports the filesize as 0B
-
Well, its all suddenly stopped!? The ones being displayed on the page were Cisco Ex something ads.