DonSegmond's Posts
Nairaland Forum › DonSegmond's Profile › DonSegmond's Posts
1 2 3 4 5 6 7 8 9 (of 9 pages)
Checkout my github link, we could collaborate in the future. http://github.com/segmond |
Tosinosu2011:I know this is for your homework, but I want to open your eyes that school might not be enough. I want you to know there is more out there, and that you can learn to do more and you should seize control of your life and constantly keep learning. Here is the solution in prolog.
When we solve, we get the truth. With 9 tires, there are 3 solutions. ?- solve(9, Car, Tricycle, Bicycle). Car = 0, Tricycle = 1, Bicycle = 3 ; Car = 0, Bicycle = 0, Tricycle = 3 ; Car = 1, Tricycle = 1, Bicycle = 1 ; Anyways, have fun with Java, but know there is more out there. |
ode, the world is aggressively working towards electric cars and alternate energy and people are still worried about future price of oil? |
seunthomas:Scaling a site shouldn't be after the fact, it really should happen during development. But been that this site is just a simple web forum, which is read heavy, the scaling solution is pretty standard. Cache like hell, consider a ram disk and load the entire DB in memory for all text content, all non text content should be hosted on an outside CDN. Having Nairaland handle a million users daily should be pretty trivial. Been that you are reading from HD instead of SSD, limit the amount of reads, since HD spinning is expensive, this comes down to sysadmin duties, checking DB/system configurations. I honestly don't believe any scaling solution right now should involve coding, it's all about having a knowledge scaling/sysadmins/dba ops experience. |
Use whatever you can afford. My main laptop is a used chromebook that I paid N15,000 for 2+ years ago. As some of you may know, a chromebook is very light, 2gb of ram, mine has a 16gb sd drive. I added an 8gb ram I had to bring it to 10gb ram, it still has only the 16gb drive, and I use a 64gb sd card I have when I need additional storage. I install crouton on it which lets me run chromeOS and linux in parallel. With this laptop, I do python, java, php, ruby, clojure, c/c++, c#, prolog, lisp programming. It's not a good machine for mobile programming, so if you really need to do android or ios then i won't advice it. Point is, it doesn't take much to write programs, like someone mentioned earlier, you are the one that is going to write the code, not the computer, so don't waste your hard earned money on the most expensive computers, just get the minimal best that you can and spend the rest of your money on classes, books and learning or saving it for other important things. |
Or just read php's PDO manual at http://php.net/manual/en/book.pdo.php |
Too expensive, come down to N13m |
Bevista:I feel for you bro, look at the abuse you are receiving for trying to edumacate on basic macro economics. lol, you get strength oh. |
You use a database driver to connect to the database. Every database has a host, a name, a username and password. Once you use that driver to connect, this is a psuedo example dbConnection = dbConnect("host", "dbname", "dbuser", "dbpassword" ) ; You will have your connection, then using that connection you can query the database. queryResults = dbConnection.query("SELECT first_name, last_name FROM mytable" ) ; rows = queryResults.fetchAll() ; foreach (rows as r) { print("Name " + r.first_name + " " + r.last_name + "\n" ) ; } then when you are done, you close the connection dbConnnection.close() ; This is how it works with pretty much every langauge, java, python, php, ruby, c You must find what database driver you are going to use and study it very well. Here is how to use Java and MySQL. http://zetcode.com/db/mysqljava/ If you are using MSQL, PostgresSQL or Oracle, it will be a bit different, but not much. Best of luck. |
Let n = 0. then the sequence is 0,3,1,4,2,5,3,6,4 looking at that sequence, we can see than for all odd sequences, it is 0,1,2,3,4 and for all even sequences it is 3,4,5,6 Given a starting number v at index n to find the pattern if n is odd, then the nth sequence is ((n - 1) / 2) + v if n is even, then it is ((n / 2) + 2) + v So given a sequence that begins with 4, to find the 7th sequence given that 7 is odd, ((n - 1) / 2) + v = ((7 - 1) / 2) + 4 = 6/2 + 4 = 3+4 = 7 If 6th sequence given that 6 is even ((n / 2) + 2) + v = (6/2) + 2 + 4 = 3 + 2 + 4 = 9 Given a sequence that begins with 17 to find the 12,345,678 - 12,345,680 numbers 12,345,678 sequence (12345678/2) + 2 + 17 = 6172858 12,345,679 sequence ((12345679 - 1 )/2) + 17 = 6172856 12,345,680 sequence (12345680/2) + 2 + 17 = 6172859 |
guru01:You are an idiot of the highest order. If you have nothing nice or helpful to say, then shut up your stupid foul mouth. |
Learn database table normalization. Learn how to write efficient SQL queries. Learn how to add appropriate indexes. I work with databases that have a hundred billion rows and that's how I do it. Learn the database you use, and how to performance tune and how appropriate parameters can effect the performance. Just these will get you far. The day you have a site with a hundred million users, hit me up and we can talk about sharding and SQL alternatives. |
ValentineMary:Sorry, I can't imagine a particle moving faster than light. Study physics to learn why speed of light has a limit. |
duvie92:You can still specialize and yet study many fields. You never know when something else in one area will apply. You are of course correct that folks will never be able to learn everything, but the most valuable is the person who knows a lot and yet has some specialization. |
Fulaman198:I started out with BSD, then SunOS, Linux, Solaris, HPUX, then the (Free BSDs, FreeBSD, OpenBSD, NetBSD) and now pretty much back to Linux with occasionally FreeBSD/OpenBSD here and there. For Linux distribution, I use Ubuntu for desktop, for servers, Debian, CentOS, Ubuntu. |
I'm willing to take in a few mentees to mentor. If you are serious about developing your programming chops and wish to step up your game. Let me know. I'm going to limit this to 3 mentees. I'll work with you for 3 months, 90 days. In those 90 days, I'll work with you to grow your programming skills. I will give you assignments, I will give you materials to read, I will review your code and I'll advise you in what to study. This is an unstructured mentoring approach based on your interested. So, you can write code in python, php, ruby, java, c#, c, whatever. I don't care. I unfortunately don't work with windows and never have. I'm strictly 100% Unix, but if you use windows, no problem. I'm not going to help you with problems such as windows, operating system, network configurations. I'm not going to help you write programs or do your homeworks. I'm going to advise you, I'm going to look at your code and tell you on what to focus on. Things I might cover, algorithms, data structures, object oriented programming, structured programming, design patterns, how to design programs, how to keep and simplify your programs, truing making MVC work for you, etc, other technologies, DB, Messaging Queues, Server configuration, security, etc I have 20+ years in the industry, been using Unix since 95, I've done Security, DB Admin, Unix Admin, Software Development in various forms. Send me an email (segmond at gmail DOT com), with a mini essay on your experience developing software and what you wish for your future within the software industry. |
good job, keep at it! |
cr80vity:do you know about php.net? 1) how to use implode, http://php.net/manual/en/function.implode.php 2) __construct is a constructor, if you don't know OOP, then I urge you to get a good book. A constructor is automatically called by the system every time an object is instantiated. I hope you know what an object and instantiation is. But if you don't, PHP classes & Objects are defined here. http://php.net/manual/en/language.oop5.php I will yet again urge you to work through a book. 3) $this is used to refer to the current object, within the object's methods. 4) getInstance is not built into php, but a way to get an instance of a class is to instantiate one, using the new keyword, this is common to most OOP languages. You will usually find a getInstance method used within a design pattern. |
This is terrible advice. Never do this. Sanitizing your own input will get you in trouble in some many ways. There are so many creative ways to inject malformed and evil input into a database for SQL injection. The best way to handle untrusted inputs is to delegate to the Database driver. Use prepared statements, with parameters With PHP, you can get the benefit of that using PDO. |
WP is very insecure, you must set it to auto update whenever they have a new patch/fix released. I wasted so much time helping others who had their WP hacked that I just gave up and will not work on it for any amount of money whatsoever. If you have a WP site, backup often, practice your recovery method often, patch often. When you get hacked, restore, patch and recover. Limit the amount of plugins, a lot of those plugins are poorly developed and have all sorts of issues too. Best of luck. |
dhtml18:My github link is posted. |
Having a github is good, but writing code is even better. So let's setup my people, write more code, the joy is in doing. I know you can't share everything, I use github to throw out ideas I'm toying with. I have bitbucket and stash for non public project. But everyday, I'm committing and pushing, I hope you guys are. |
The <<< syntax is a carry over from other unix languages. it allows one to have a string that spans multiple lines, in php it's called heredocs. _END is just an arbitary marker and could be anything. I usually use _EOF_ for strings or _SQL_ if it's a long sql statement. You can read more about it here. http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc |
sinequanon:if you knew anything about how prolog worked, you would know that it's not really compile as in native code. it's in the same class as lua and python with bytecode interpreter. you can bundle the bytecode and interpreter into one big binary blob but that doesn't make it compiled. unlike lua-jit and the jvm, the research on prolog is not deep and the most efficient environment was invented in the 1980's, the warren abstract machine. anyway, i'm done with this discussion. |
sinequanon:Prolog is an interpreted language, your lack of knowing this and not even looking into this shows how much of a troll you are. There are 4 solutions. Anyways, you win, you are the smartest and greatest. Later ?- solve_puzzle. [[1,1,1,1,1,1,1,0,1,1,1,0,0,0,1,0,1,0,1,1,1,1,1,1,1],[1,0,0,0,0,0,1,0,1,1,0,1,1,0,0,0,0,0,1,0,0,0,0,0,1],[1,0,1,1,1,0,1,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,1,0,1],[1,0,1,1,1,0,1,0,1,0,0,1,1,1,1,1,1,0,1,0,1,1,1,0,1],[1,0,1,1,1,0,1,0,0,1,1,1,1,1,0,1,1,0,1,0,1,1,1,0,1],[1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1],[1,1,1,1,1,1,1,0,1,0,1,0,1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1,0,1,1,1,1,0,1,0,1,1,1],[0,0,1,1,0,0,1,0,1,0,1,0,0,0,0,0,0,1,1,0,1,1,1,1,1],[0,0,0,1,1,1,0,1,1,0,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1],[1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,0,1,1,0,0,0,0,1,0],[0,1,1,0,1,0,0,1,1,0,0,1,1,0,0,1,1,1,0,0,0,0,0,1,0],[1,1,1,0,1,0,1,0,1,0,0,0,0,1,0,0,1,1,1,1,1,0,1,0,0],[0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,0,1,1,1,1,1],[1,1,1,1,1,1,1,0,1,0,0,0,1,1,0,0,1,0,1,0,1,0,1,1,1],[1,0,0,0,0,0,1,0,1,1,0,0,1,0,0,1,1,0,0,0,1,1,0,1,0],[1,0,1,1,1,0,1,0,0,0,1,1,1,1,0,0,1,1,1,1,1,0,0,1,0],[1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1],[1,0,1,1,1,0,1,0,1,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],[1,0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,0,1,0,1,0,1,1,0,0],[1,1,1,1,1,1,1,0,1,1,0,0,0,1,0,1,1,0,0,0,1,1,1,1,1]] true. |
Emperoo:5 for effort. 2 for interface. work on the interface, unless you built it for mobile in which case my apologies since I'm viewing from a laptop. |
Fulaman198:Sure, but at the very least equip them with basic requirements. Don't have people develop iOS apps, if you never gave them iOS training. If that's the case, then what's the point of going to school? I don't know much about Naija university, but any University in the western world, will give you at least basic training in a certain area before asking you to build a project in that area. What does amuse me with these project requests I see on here is, I wonder if the professors themselves can even build such projects. |
webmasteremma:what's the make and model? search for finger print scanner library that supports that model, like i mentioned before, you most likely will have to use C++ or Java. If you are lucky, you might come across a python library. I don't believe PHP is the way to go for this project. |
Fulaman198:Yes, there is a significant difference. C was created in the 70's for system programming. It was designed for writing Operating Systems and Systems Program, you know command line programs all text. It sufficed and did that job quite well, some might argue that it has changed/grown a bit, but I do wager the reverse that it hasn't changed that much since the ANSI standards was developed. It's simply a procedural language like pascal. Objective C was created for NeXT OS. It was modelled after small talk and is an Object oriented language built on top of C, so we can say that it is a superset of C. all valid C programs will compile in Objective C, but of course not all Objective C will compile with C. With this knowledge, if you wish to learn Objective C, then I urge you not to use a C tutorial but an Objective C tutorial. If you likewise have to learn C, you don't need to, an objective C tutorial will be more than enough. Objective C has objects, C doesn't. The closed thing C for grouping objects is structures and unions, and those cannot have their own methods, unless you place a pointer to a function inside of it. Once you build objects in ObjC, you invoke them with message passing. using the [] syntax which doesn't exist in C. By having objects, ObjC provides for extended classes, abstract classes, interface, multiple inheritance. Methods are defined different
P/S, I will urge you to learn swift instead. It will be a better investment of your time unless someone is going to be paying you to write ObjC code soon. Best of luck. |
webmasteremma:What device will you use to read the finger print? |
int) num {