Audio Content Analysis | Machine Listening and Music Information Retrieval:
'via Blog this'
Friday, December 18, 2015
Thursday, December 17, 2015
Tips To Make Learning Programming Easy
Link:
http://www.lifehack.org/339706/tips-make-learning-programming-easy?mid=20151217&ref=mail&uid=561525&feq=daily
Learning to code is challenging. It’s especially difficult if you try to learn programming on your own without the guidance of a university or a coding bootcamp. Both kinds of programs are extremely helpful because they provide a structured approach, but self-taught programmers have to figure it out on their own. Fortunately, anyone can learn programming for free and avoid the many traps and pitfalls if they follow the principles outlined below:
Commit to one programming language
When someone decides to learn how to code, the first thing they will naturally do is figure out what language they should learn. It’s a common mistake to pick a language only to ditch it for a new language a couple weeks later. I personally repeated this process four or five times before settling on a language that I was committed to. My reasons for switching varied from not being able to find good tutorials, to someone on the internet bashing my language of choice. Over a year passed before I had actually settled on something and stuck with it.
The reality is that it doesn’t matter what language you pick to learn in programming, as long as you learn it well enough to understand the overall principles of web development and software engineering, and that it can build what you’re trying to create. If you don’t take time to develop your skills and learn how all the pieces fit together in one language you’ll essentially start over every time you switch. Learning the language’s syntax is the easy part. The challenging part is learning how to engineer a product and understand the overall structure of a program. These are the skills that carryover from language to language.
You also want to move fast and make progress in order to stay motivated. If you keep switching languages you’ll never build an awesome product or reach any of your goals. I highly encourage you to experiment with new technologies, but before you do that you should build a solid foundation so you can make money and have a couple significant projects under your belt.
For your first programming language there’s only a few important qualities I recommend and they have nothing to do with whether they are “single-threaded” or “statically typed” or anything like that. The qualities I recommend finding in a language are maturity, potential use cases and current popularity. There are many good languages, but two stand out for people trying to learn programming.
Java
Java was released in 1995 and took the world by storm. It is and always has been extremely popular. Just take a look at any job board and you’ll see far more job openings in Java than any other language, second only to SQL (a database language). The number of jobs is important for job security, but it’s not the best metric to go by because this metric goes up and down. There are other important considerations that make Java a great choice.
This language is very mature. It’s been used by colleges for years as the standard language for teaching, and it has an almost infinite amount of tutorials and books to help you learn. With around 9 million Java developers you’ll have answers to almost every question imaginable. Java is boring because it’s not the “new kid” on the block, but for a first time programmer you want mature and boring. The endless supply of free tutorials, books and documentation ensure that you can learn programming.
Java is also extremely flexible, which is what really makes the language a great choice. You can build server-side applications, enterprise apps, fully functional web applications, and even mobile apps. This gives you a wide variety of programs to build, jobs to have, or markets to take your product all with this one language. No other language will give you this amount of freedom. People who want to learn programming often don’t know what language to pick, and because Java is so flexible it’s hard to go wrong.
PHP
Yes, I said it. PHP is a great language for first timers. If you didn’t know, PHP is loathed in the programming community. If you admit to being a PHP programmer you might as well admit you have leprosy. They say it’s a poorly designed language that is full of problems, but I still believe there are several incredible benefits to learning PHP.
First of all, PHP is incredibly popular. In 2013 there were over 240 million websites using PHP, and according to W3Techs over 80% of the sites whose server-side language they know uses PHP. This popularity ensures you’ll have an endless supply of free tutorials and books to learn with. It’s also a very flexible language and beginner friendly, making it easy to learn. PHP also has powerful frameworks, like Laravel, to speed up your web development. You cannot build mobile applications with PHP, but it has something else just as good–WordPress.
WordPress is an immensely powerful content management system written in PHP. It’s perfect for the typical small business owner and blogger all the way up to massive sites, like Fortune magazine and Time Inc. WordPress is completely customizable with the use of “plugins” which add features like E-commerce, photo galleries, and anything else you can imagine.
It’s estimated that over 20% of the entire web is using WordPress to run their site. Because many of these sites are small businesses and bloggers, it is perfect for a wide variety of jobs from freelancing to Fortune 500 companies and everything in between.
I’ve no doubt ruffled some feathers by recommending Java and PHP. There is a group of haters for every language. If you have a reason for choosing something else then do what you think is best, but PHP or Java will cover almost any first time developer needs, and they have an almost unlimited supply of jobs and developers. That’s why I recommend one of them as a first language. Whatever you do, pick something and stick with it. Check out other languages you can use to learn programming with thisinfographic.
I’ve no doubt ruffled some feathers by recommending Java and PHP. There is a group of haters for every language. If you have a reason for choosing something else then do what you think is best, but PHP or Java will cover almost any first time developer needs, and they have an almost unlimited supply of jobs and developers. That’s why I recommend one of them as a first language. Whatever you do, pick something and stick with it. Check out other languages you can use to learn programming with thisinfographic.
Break your learning into smaller goals
Now that you’ve chosen your language and made a commitment, you are ready to start learning. If you want to learn programming for free, then you’ll have to be tactful with your approach. The best way I’ve found is to break down the learning process into small parts and focus.
HTML/CSS
Just about every web language will utilize HTML/CSS, which is the “markup language”. I recommend spending at least a couple of days getting familiar with HTML and CSS. Find some beginner tutorials and read the documentation. A lot of this part will be learn as you go, so don’t be afraid to jump into the next step when you feel like you understand the main idea of HTML and CSS.
Language basics
Spend some time learning the basics of your language. Use a combination of tutorials and documentation to learn about things like booleans, strings, arrays, etc. You will also want to get familiar with functions and object oriented programming. Sites like CodeCademy.com are great for learning the basics of your language, but any free tutorial should help you get started. It’s one thing to learn the syntax, but the real challenge is applying these skills to real projects.
The best way to learn programming is to build simple projects with what you are learning. Build things like “Fizz Buzz”, tic-tac-toe, blackjack, or loan calculators. Search the internet for programming exercises and complete them. Some are math intensive, but you should be able to find all kinds of exercises. Don’t feel bad if it takes you a long time to complete exercises you find. They are meant to challenge and improve your thinking abilities. Try to add extra features to the project and build more complex apps each time. Once you feel comfortable, move onto the next stage where everything comes together.
Web framework
This is where you tie in the database to build a fully functioning application that can store data, like usernames and user data. All the building blocks of an application are wrapped together in a neat package called a “framework”. Just like with picking a language it’s important to stick with one framework at first so you can focus your efforts and successfully learn programming. I recommend the most widely used framework for each language because it likely has the most documentation and most tutorials. This will be the most challenging part because web frameworks can feel pretty complex at first. If you’re really struggling with this, try spending more time brushing up on Object Oriented Programming before trying again. Don’t give up!
If you break the framework down as much as you can and learn each part individually then you’ll soon be able to put it all together to build your idea. Just like with the basics you should be focusing on one thing at a time. You might do a lot of fumbling around trying to figure it out, but if you stay committed to one framework and keep trying the various tutorials and reading the documentation you’ll soon find yourself building simple apps, and eventually things you are truly proud of. Baby steps are the key to success when you try to learn programming. This is also a good time to do more programming challenges or exercises inside of a web framework. Start small and work your way up. Build the same tic-tac-toe, blackjack, and loan calculators inside the framework using its design philosophies.
While frameworks are important, I don’t recommend spending all your time using them. It’s important to learn how the language works on a deeper level by understanding what’s going on “under the hood”. Writing code without the help of a framework can give you a different perspective.
Using tutorials efficiently
Going through random tutorials on the internet isn’t the most efficient way to learn programming, and downloadable books range in quality from amazing to “Wow, this is really bad”, but with a little effort on your part you can learn programming for free almost as quickly as if you were to pay for a programming course. Here are some key points I wish I would have known when I started learning programming.
Read the documentation religiously. The better you learn to read the docs, the better programmer you will become. Documentation is not meant to be read like a regular book or article. You have to read slowly, stop often, and have a text editor open so you can try the examples out if it doesn’t make sense. Reading the docs is hard but it’s necessary if you want to learn programming. With every tutorial you go through make sure you’re looking up everything in the documentation that you don’t understand.
You will be guaranteed to run into problems when following along with tutorials. When you encounter problems it’s a good idea to embrace the tutorial as your own project. When you get errors, use Google to search them and fix the error. If the instructions aren’t specific enough, try a couple things you think will work. Do whatever it takes to figure the problem out and keep going with the tutorial. Do not mindlessly copy and paste code and throw it out at the slightest problem. If all else fails then go ahead and try another tutorial. There are plenty out there to use, just give it your best shot before you move on.
Learning to code does not have to be hard. If you make a commitment, break things down, and make a little progress each day then you’ll be building any and every type of program you can think of sooner than you think. The trick is to keep at it, keep learning, and never give up on your goals.
Wednesday, December 16, 2015
How Indian techies are freelancing for clients halfway across the world - Times of India
How Indian techies are freelancing for clients halfway across the world - Times of India: "MBAI|NEW DELHI: 27-year-old Suresh Krishna (name changed) has a 9-to-5 job as a coder with a mid-sized Indian IT firm in New Delhi. Once he gets home, Krishna logs on and starts coding again - this time for a private client overseas.
Across India, tens of thousands of coders on the rolls of marquee Indian IT service firms are moonlighting, after work and on weekends, for clients halfway across the world. There's also a new set of companies connecting these moonlighters with customers.
San Francisco-headquartered Appirio, backed by Sequoia, General Atlantic, Saleforce.com and Fidelity, wants to help enterprises 'crowdsource' talent for IT projects such as building mobile applications.
Appirio has over 900,000 coders on its platform and almost 200,000 of them are based in India, CEO Chris Barbin told ET. The company has added 50,000 coders from India so far this year.
"Not all of them are active. We have about 30,000-50,000 active coders in India. And most of them have jobs at Tata Consultancy Services, Infosys or Wipro and do this on evenings and weekends. A few people make a fulltime living freelancing, though," Barbin said. Appirio's clients read like a who's who of large companies - Starbucks, NYSE Euronext, Honeywell, AIG-Edison, Toyota and Facebook.
The Indian IT-BPM industry employed about 3.5 million people at end of FY15, according to the National Association of Software and Service Companies. Freelancer are paid by the hour, while the more experienced ones prefer to be paid per project.
"I used to freelance while I worked too. Then it becomes a question of budgeting time. I used to only work two hours a day on my freelancing because otherwise I would not have a life," said Praneeth Chinta, who quit his job at Informatica earlier this year to freelance fulltime.
Freelancer.com said India had the company's largest pool of freelancers in Asia and most assignments are IT projects. "Six of the top 10 projects awarded to Indian freelancers are IT projects... Many freelancers find that working together in a team is an effective strategy," Kyri Theos, regional director for Asia-Pacific at Freelancer.com, said in an email.
Since they can bid and get work through the Internet, freelancers come from all parts of the country, including small towns. "In terms of number of freelancers, India ranks as follows: Bengaluru, Hyderabad, New Delhi, Mumbai, and Chennai. However the fastest-growing cities are Surat, Rajkot, Indore, Jaipur and Ghaziabad," Theos added. The trend has been fuelled by IT companies increasingly setting up centres in tier-2 cities such as Indore and Jaipur.
While IT companies have policies to prevent moonlighting, catching them isn't easy. "This would be a fraction of the total employees. And most companies have strict policies against this kind of freelancing, but it's hard to catch if it is being done on the weekend or at home," an executive with an IT company said.
TCS said its employees sign the Tata Code of Conduct which prevents them from freelancing for competitors, but declined to give further details. HCL Technologies said employee contracts forbid freelancing. Wipro, Infosys and Cognizant declined to comment. Tech Mahindra did not respond to a request seeking comment.
Nasscom said that instead of preventing people from freelancing, companies would need to focus on confidentiality issues. "It is very important to tell the employees that you cannot go on to these open platforms and say you did a certain project for a certain client at work," said Sangeeta Gupta, senior vice president at Nasscom.
The million dollar question is: Will companies that crowdsource talent steal a march over Indian IT service firms? Few see the new model working for developing large in-house IT systems, still the bread-and-butter of Indian IT, but it can chip away at smaller projects.
While sales chiefs at IT firms say they see Appirio in a few deals, the company is not yet a threat in the kind of digital work that is expected to power the next phase of the industry's expansion. "A lot of the digital work requires a consultative approach. That cannot necessarily be provided through a crowdsourced model. It would work for the more IT-modernisation type projects," Sudhir Kulkarni, global head of sales and marketing at Persistent Systems, told ET.
For the freelancers, life isn't exactly a bed of roses. Occasional payment problems and underbidding from fellow moonlighters - some willing to work for as low as $5-8 an hour - crop up.
"I might consider moving to fulltime freelancing since you can choose the projects you want to work on and the money is good. But finding opportunities for a sustained period of time is a challenge," said an employee with a mid-sized IT firm who has been freelancing for two years."
'via Blog this'
Across India, tens of thousands of coders on the rolls of marquee Indian IT service firms are moonlighting, after work and on weekends, for clients halfway across the world. There's also a new set of companies connecting these moonlighters with customers.
San Francisco-headquartered Appirio, backed by Sequoia, General Atlantic, Saleforce.com and Fidelity, wants to help enterprises 'crowdsource' talent for IT projects such as building mobile applications.
Appirio has over 900,000 coders on its platform and almost 200,000 of them are based in India, CEO Chris Barbin told ET. The company has added 50,000 coders from India so far this year.
"Not all of them are active. We have about 30,000-50,000 active coders in India. And most of them have jobs at Tata Consultancy Services, Infosys or Wipro and do this on evenings and weekends. A few people make a fulltime living freelancing, though," Barbin said. Appirio's clients read like a who's who of large companies - Starbucks, NYSE Euronext, Honeywell, AIG-Edison, Toyota and Facebook.
The Indian IT-BPM industry employed about 3.5 million people at end of FY15, according to the National Association of Software and Service Companies. Freelancer are paid by the hour, while the more experienced ones prefer to be paid per project.
"I used to freelance while I worked too. Then it becomes a question of budgeting time. I used to only work two hours a day on my freelancing because otherwise I would not have a life," said Praneeth Chinta, who quit his job at Informatica earlier this year to freelance fulltime.
Freelancer.com said India had the company's largest pool of freelancers in Asia and most assignments are IT projects. "Six of the top 10 projects awarded to Indian freelancers are IT projects... Many freelancers find that working together in a team is an effective strategy," Kyri Theos, regional director for Asia-Pacific at Freelancer.com, said in an email.
Since they can bid and get work through the Internet, freelancers come from all parts of the country, including small towns. "In terms of number of freelancers, India ranks as follows: Bengaluru, Hyderabad, New Delhi, Mumbai, and Chennai. However the fastest-growing cities are Surat, Rajkot, Indore, Jaipur and Ghaziabad," Theos added. The trend has been fuelled by IT companies increasingly setting up centres in tier-2 cities such as Indore and Jaipur.
While IT companies have policies to prevent moonlighting, catching them isn't easy. "This would be a fraction of the total employees. And most companies have strict policies against this kind of freelancing, but it's hard to catch if it is being done on the weekend or at home," an executive with an IT company said.
TCS said its employees sign the Tata Code of Conduct which prevents them from freelancing for competitors, but declined to give further details. HCL Technologies said employee contracts forbid freelancing. Wipro, Infosys and Cognizant declined to comment. Tech Mahindra did not respond to a request seeking comment.
Nasscom said that instead of preventing people from freelancing, companies would need to focus on confidentiality issues. "It is very important to tell the employees that you cannot go on to these open platforms and say you did a certain project for a certain client at work," said Sangeeta Gupta, senior vice president at Nasscom.
The million dollar question is: Will companies that crowdsource talent steal a march over Indian IT service firms? Few see the new model working for developing large in-house IT systems, still the bread-and-butter of Indian IT, but it can chip away at smaller projects.
While sales chiefs at IT firms say they see Appirio in a few deals, the company is not yet a threat in the kind of digital work that is expected to power the next phase of the industry's expansion. "A lot of the digital work requires a consultative approach. That cannot necessarily be provided through a crowdsourced model. It would work for the more IT-modernisation type projects," Sudhir Kulkarni, global head of sales and marketing at Persistent Systems, told ET.
For the freelancers, life isn't exactly a bed of roses. Occasional payment problems and underbidding from fellow moonlighters - some willing to work for as low as $5-8 an hour - crop up.
"I might consider moving to fulltime freelancing since you can choose the projects you want to work on and the money is good. But finding opportunities for a sustained period of time is a challenge," said an employee with a mid-sized IT firm who has been freelancing for two years."
'via Blog this'
Account Details - Audible.com
Account Details - Audible.com:
How to cancel Audible
https://www.audible.com/account-details?serial=
'via Blog this'
How to cancel Audible
https://www.audible.com/account-details?serial=
'via Blog this'
[LeetCode]Summary Ranges
[LeetCode]Summary Ranges
题目描述:
Given a sorted integer array without duplicates, return the summary of its ranges.
For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"].
题目大意:
给定一组排好序且无重复的整数,返回整数范围的汇总。
例如给定数组 [0,1,2,4,5,7], 返回 ["0->2","4->5","7"]。
解题思路:
将逐一递增的整数序列化简为(起点->终点)即可。
Python代码:
class Solution:
# @param {integer[]} nums
# @return {string[]}
def summaryRanges(self, nums):
x, size = 0, len(nums)
ans = []
while x < size:
c, r = x, str(nums[x])
while x + 1 < size and nums[x + 1] - nums[x] == 1:
x += 1
if x > c:
r += "->" + str(nums[x])
ans.append(r)
x += 1
return ans
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
下面的Python代码短小精悍,摘自LeetCode Discuss
链接地址:https://leetcode.com/discuss/42199/6-lines-in-python
Solution 1
Just collect the ranges, then format and return them.
def summaryRanges(self, nums):
ranges = []
for n in nums:
if not ranges or n > ranges[-1][-1] + 1:
ranges += [],
ranges[-1][1:] = n,
return ['->'.join(map(str, r)) for r in ranges]
- 1
- 2
- 3
- 4
- 5
- 6
- 7
Solution 2
A variation of solution 1, holding the current range in an extra variable r to make things easier.
def summaryRanges(self, nums):
ranges, r = [], []
for n in nums:
if n-1 not in r:
r = []
ranges += r,
r[1:] = n,
return ['->'.join(map(str, r)) for r in ranges]
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
Solution 3
A tricky short version.
def summaryRanges(self, nums):
ranges = r = []
for n in nums:
if `n-1` not in r:
r = []
ranges += r,
r[1:] = `n`,
return map('->'.join, ranges)
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
本文链接:http://bookshadow.com/weblog/2015/06/26/leetcode-summary-ranges/
请尊重作者的劳动成果,转载请注明出处!书影博客保留对文章的所有权利。
请尊重作者的劳动成果,转载请注明出处!书影博客保留对文章的所有权利。
[LeetCode]Count Primes |
[LeetCode]Count Primes |
题目描述:
Description:
Count the number of prime numbers less than a non-negative number, n
Hint: The number n could be in the order of 100,000 to 5,000,000.
References:
How Many Primes Are There? (https://primes.utm.edu/howmany.html)
Sieve of Eratosthenes (http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes)
题目大意:
统计小于非负整数n的素数的个数
提示:n的范围是100,000到5,000,000
参考文献:
一共有多少个素数?(https://primes.utm.edu/howmany.html)
埃拉托斯特尼筛法 (http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes)
解题思路:
见埃拉托斯特尼筛法。
Python代码:
class Solution:
# @param {integer} n
# @return {integer}
def countPrimes(self, n):
isPrime = [True] * max(n, 2)
isPrime[0], isPrime[1] = False, False
x = 2
while x * x < n:
if isPrime[x]:
p = x * x
while p < n:
isPrime[p] = False
p += x
x += 1
return sum(isPrime)
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
起初Python的时间限制过于严格,采用Python解题对于测试样例5000000总是返回Time Limit Exceeded,后来管理员放宽了Python的时限。
Tuesday, December 15, 2015
[LeetCode python] Range Sum Query - Immutable
题目描述:
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.
Example:
Given nums = [-2, 0, 3, -5, 2, -1] sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumRange(0, 5) -> -3
Note:
- You may assume that the array does not change.
- There are many calls to sumRange function.
题目大意:
给定整数数组nums,计算下标i与j之间的元素和(i ≤ j),包含边界。
测试样例见题目描述。
注意:
- 你可以假设数组不会改变。
- sumRange函数会调用多次。
解题思路:
计算辅助数组sums:
sums[0] = 0 sums[i+1] = sums[i] + nums[i]
则sumRange(i, j) = sums[j+1] - sums[i]
Python代码:
class NumArray(object):
def __init__(self, nums):
"""
initialize your data structure here.
:type nums: List[int]
"""
size = len(nums)
self.sums = [0] * (size + 1)
for x in range(size):
self.sums[x + 1] = self.sums[x] + nums[x]
def sumRange(self, i, j):
"""
sum of elements nums[i..j], inclusive.
:type i: int
:type j: int
:rtype: int
"""
return self.sums[j + 1] - self.sums[i]
# Your NumArray object will be instantiated and called as such:
# numArray = NumArray(nums)
# numArray.sumRange(0, 1)
# numArray.sumRange(1, 2)
'via Blog this'
Subscribe to:
Posts (Atom)