Increase typing speed? [closed] - typing

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
It has recently been brought to my attention that my typing skills leave much to be desired. I've been programming a few years in college now, and typing speed has never been very important. Classes do not focus on how much code you can output, but instead how to design and implement code.
Now that I have a job however, demands have changed slightly and I think it in my benefit to increase my typing skills, at least a little bit!
Do you have any suggestions for effective methods to increase typing skills?

I prefer typing games that encourage you to type faster for a reward (high score). Do a search for 'typing games' and have fun. I'm about 80 wpm atm (according to some games I peak near 90 but the longer words drag my average down).
Whatever you choose, you do need to keep doing it on a regular basis.

I went through this a few years into my consulting career...I downloaded a free typing tutor program and used it every day for a month:
10 minutes in the morning before starting work for the day
10 minutes during my lunch break
10 minutes at the end of the day before leaving work
I found that as my typing improved it was fun to fit in a few more 10-minute sessions each day as I felt like it.
Keep up with it for a month and you'll be amazed at how much better you are at typing!
Cheers

Download a touch typing trainer and train ;-) it's actual fun until the point where you reached your limit. See http://typingsoft.com/all_typing_tutors.htm for a list.

Related

Algorithm Best practice - Generate new apple position in snake? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 11 months ago.
Improve this question
Let's say we're programming a snake game.
The game has a 20x20 playing field. That means there is 400 individual cells.
In snake, a new apple has to generate on a random unoccupied field/cell.
There's two common ways to do this
Try to place the apple on a random cell, until you hit a free one
Create a list of all free cells, and randomly choose one to place the apple on
Most people on here would recommend the second approach, because of "better performance". And I thought the same. But after having had statistics in my computer science class, i'm not so sure anymore:
At the start of the game, by logic, the first approach would be faster, because it would very likely instantly find a free cell, whereas the second apprach has a big overhead of creating a list of free cells.
And a little performance test in JS confirms this:
At the end of the game - which isn't reached often - when there is only one free field left, the second approach would probably win in speed, because it would always find the field in 1 go. The first approach needs way more tries - using logarithm we can calulate how many.
50% of the time, it takes less than 276 tries. 90% of the time, it takes less than 919 tries. 99.999999% of the time, it takes less than 5519 tries. And so on. log with base 399/400 of (100-percentage). A few thousands tries more is nothing for a modern computer, so it should only be a little bit slower. This is confirmed by another performance test:
0%-4% slower on average ... negligible.
And most of the time, most cells are free, which means the first approach is way faster on average.
Ontop of that, in many languages, for example in C, the first appreach would be shorter in terms of code. There is no overhead for a second array.
This brings me to the conclusion, that randomly choosing a cell until you find a free one is the best practise and creating a list of empty cells is premate optimization, and it actually does the opposite (makes performance worse on average because of the added overhead).
Do you agree? Did I miss something?
What's the best practice in your opinion and why?

Getting first date of year...is this wrong and/or bad? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
So given that every time I look for the SQL query to return the first day of the year I get this..Stackoverflow great answer
SELECT
DATEADD(yy, DATEDIFF(yy,0,getdate()), 0) AS StartOfYear,
DATEADD(yy, DATEDIFF(yy,0,getdate()) + 1, -1) AS EndOfYear
Is there anything wrong with using the below?
SELECT CONVERT(DATE,CONVERT(CHAR(4), Year(Getdate())) + '0101')
Personally I find this one a little easier to immediately understand.
Thanks!
Depends what you mean by "wrong".
The other is probably faster because it keeps the dates in their native formats, which is actually numerical data in SQL Server, and SQL Server generally works faster with numbers than with strings. Plus there's the overhead of converting the date to a string and back.
But that performance difference is pretty minimal, so it depends on whether you'd rather have that extra bit of performance, or code that's easier to read and understand.
Nothing wrong at all, if you want to spend a few extra CPU cycles on processing strings.
I've seen great benefits from using a calendar table.
There are many examples on this, you can find one here.
Easier to understand??? Isn't that what comments are for?
In my opinion, the most important thing you do with a database is to make sure the data is accurate. The second most important thing is to make the code fast. As others have pointed out, the execution time difference is probably only a couple of computer cycles. The problem is... you could execute this on a table that has 100 million rows and suddenly those extra clock cycles takes several minutes.
I have no problem with people using "easy to understand" code when they don't know any better. In this case, you do know better. It would be a mistake to use the slower code. If you want to make it easy to understand, add comments to your code.

How does the popular application Shazam work [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Just out of curiosity because I've always wondered this. How does the application Shazam work? I know how to use it, I'm speaking in terms of programming. How does the application listen to any part of a song and then give you the results? Obviously it receives it's song information from a database, but there is NO way someone could enter every single song known to man in that database. Also, how does Shazam not constantly update all the time? New songs are constantly being released yet it was like Shazam already had the future songs programmed into it. This is just mind boggling to me, and I would just like to know how exactly this all works. I know this is not a help question, but could someone please clarify? Thanks!
Shazam only starts with Fourier transforms (which isn't surprising since pretty much all audio processing works this way).
You can read Avery Wang's original paper, if you like. He is the inventor of the Shazam algorithm. I happen to think that it is best explained as a nearest neighbor technique, which is why we included it as an example in Chapter 9 of "Data Mining Techniques, 3rd Edition".
You might be interested in what we have to say there (http://www.amazon.com/Data-Mining-Techniques-Relationship-Management/dp/0470650931/ref=pd_sim_b_5).
They don't say much on the link diciu posted.
The algorithm is based on Fourier's waves, which allows expressing a mathematical function as a linear sum of harmonic functions. This transform allows mapping between time to frequency which is exactly what you need in order to create voice recognition. I find it hard to believe that Shazaam has a patent over Fourier's transformation. But if you try to build a "2nd Shazaam" you'll probably fail since they already took over all the market...

Real world usage for artifical neural networks [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have written an artifical neural network (ANN) implementation for myself (it was fun). I am thinking now about where can I use it.
What are the key areas in the real world, where ANN is being used?
ANNs are an example of a "learning" system, one that "trains" on input data (in some domain) in order to effectively classify (unseen) data in that domain. They've been used for everything from character recognition to computer games and beyond.
If you're trying to find a domain, pick some topic or field that interests you, and see what kinds of classification problems exist there.
Most often for classifying noisy inputs into fixed categories, like handwritten letters into their equivalent character, spoken voice into phonemes, or noisy sensor readings into a set of fixed values. Usually, the set of categories is small (23 letters, couple of dozen phonemes, etc.)
Others will point out how all these things are better done with specialized algorithms....
I once wrote an ANN to predict the stock market. It succeeded with about 80% accuracy.
The cue here was to first get hold of a couple of million rows of real stock data. I used this data to train the network and prime it for real data. There were about 8-10 input variables and a single output value that would indicate the predicted value of the stock on the next day.
You could also check out the (ancient) ALVINN network where a car learnt to drive by itself by observing road data when a human driver was behind the wheel.
ANNs are also widely used in bioinformatics.

Software patents or Can I write a RSVP program for my mobile device? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I wanted to write a small Rapid Serial Visual Presentation (RSVP) program for my mobile device but I realized that there are some patent issues associated with that technique (exhibit 1 and exhibit 2).
Can I write such program and try to make money with it? Would it be legal to give such program for free?
You really need to consult an attorney for something like this.
the devil is in the details.
I'd suggest you write down what your program will do - in a more detailed way than "it does RSVP".
Print out the patents appropriate, go through the claims made in the paents and see if you are doing what they're claiming. I don't think they're claiming a patent on RSVP, just on certain ways of using it.
Make your own judgement call on whether it is worth continuing, if so, consult a lawyer that is an expert in that area of law before going further.
I have no money for an attorney.
No attorneys on stackoverflow.com?
;-)
IANAL, but: 3 Reality checks: 1) Raising a claim against you for patent infringement will cost a lot of money. 2) If you have no monoey for an attorney, then you are not worth suing now. So, the question is, will you make enough money from your idea to be worth suing in the future? 3) Suing is a last resort, you might be invited to a) license the technology to your (huge) user-base or b) make a 'reasonable' out of court settlement. 2 possible solutions: 1) cross your fingers and hope for the best, 2) limit your liability through a company.
Is it legal to give it away for free? not if you infringe their patents. Their 'claim' will be based on their lost sales, not your revenue.

Resources