Quit these 4 bad habits to start actually achieving your goals

Finding a fulfilling career can sometimes feel impossible. More than half of U.S. workers don't feel engaged at their jobs according to a 2017 report by Gallup, and 16 percent of employees said they were even, "actively disengaged." But according to Bridgewater Associates founder Ray Dalio, the first step is clearly setting your goals. "Your … Continue reading Quit these 4 bad habits to start actually achieving your goals

Uber reports Q2 losses of $404 million, up 32 percent from Q1

While Uber isn’t required to disclose its financial results, Uber has done so for the past few quarters as it gears up to go public next year. In Q2 2018, Uber’s net revenue was up 8 percent quarter-over-quarter, at $2.7 billion. Year-over-year, that’s a 51 percent increase. Uber recorded gross bookings — the total taken … Continue reading Uber reports Q2 losses of $404 million, up 32 percent from Q1

Lesson on using platform API: Favstar says it will shut down June 19 as a result of Twitter’s API changes for data streams

As Twitter develops an ever-closer hold on how it manages services around its real-time news and social networking service, a pioneer in Twitter analytics is calling it quits. Favstar, an early leader in developing a way to track and review how your and other people’s Tweets were getting liked and retweeted by others on the … Continue reading Lesson on using platform API: Favstar says it will shut down June 19 as a result of Twitter’s API changes for data streams

How to rename all files in a folder using Python

let's assume the folder is user_data, relative to the current working directory (where the Python script is in). The code below was tested on Windows. import os for filename in os.listdir("./user_data"):     # print(filename)     cwd = os.path.dirname(os.path.abspath(__file__)) + '\\user_data\\'     if filename.split('.')[1] == 'jpg':         new_filename = filename.split('.')[0] + '_search' + '.jpg'         print(new_filename) … Continue reading How to rename all files in a folder using Python

Elon Musk confirms his bid to take Tesla private, backed by Saudi Arabia’s sovereign wealth fund

Yesterday I speculated that Elon Musk’s hints that he wanted to take Tesla private with Saudi Arabia’s sovereign wealth fund backing it might not be as far-fetched as people think. Today Musk has published a statement claiming that he has been talking to the Saudi Arabian sovereign wealth fund (known in the country as the … Continue reading Elon Musk confirms his bid to take Tesla private, backed by Saudi Arabia’s sovereign wealth fund

define_method in Ruby

define_method is a (private) method of the object Class. You are calling it from an instance. define_method(:my_method) do |foo, bar| # or even |*args| # do something end or, you could even use string interpolation in the method name, such as define_method("#{attribute}=") do |unencrypted_password| if unencrypted_password.nil? self.send("#{attribute}_digest=", nil) elsif !unencrypted_password.empty? instance_variable_set("@#{attribute}", unencrypted_password) cost = ActiveModel::SecurePassword.min_cost … Continue reading define_method in Ruby

new update about has_secure_password in Rails 5.2

has_secure_password takes an attribute For many years has_secure_password only allowed a default password attribute. But now you can stash whatever you want in there. Source code Allows configurable attribute name for #has_secure_password. This still defaults to an attribute named 'password', causing no breaking change. Also includes a convenience method #<strong><span style="color:#008000;">regenerate_XXX</span></strong> where +XXX+ is the name … Continue reading new update about has_secure_password in Rails 5.2