Six days after sharing Microsoft's blowout earnings with Wall Street in July, Satya Nadella stops to listen to a few of the more than 23,500 employees taking part in a three-day hackathon the company is hosting at its headquarters in Redmond, Washington. One team shows him digital tattoos made of gold leaf that's embedded with … Continue reading This is not your father’s Microsoft
Author: Eric
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
class << self in Ruby
First, the class << foo syntax opens up foo's singleton class (eigenclass). This allows you to customize the behavior of methods called on that specific object. a = 'foo' class << a def inspect '"bar"' end end a.inspect # => "bar" a = 'foo' # new object, new singleton class a.inspect # => "foo" ow, … Continue reading class << self in Ruby
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
How to Use link_to helper in Rails
Having documentation at hand Using documentation locally is helpful, especially if you can integrate it into your editor. Personally I’m using the ri docs with Emacs and Vim but I guess all those other editors can be configured to access it. If not you can always use ri in your terminal of choice. Another favourite … Continue reading How to Use link_to helper in Rails