jasonl99
That said, I started playing around with the Marten framework and while it's really new, it's an amazingly good start. I absolutely love the way that models automatically create migrations. Using Sqlite as a default is good for probably 99% of uses cases, and absolutely good for learning the framework (Sqlite itself is amazingly powerful).
I've been wondering what new shiny toys I was going to play around with over vacation during the holidays, and I now have my answer :).
― George Bernard Shaw, Man and Superman
I've always used this as an excuse for what might be considered being weird (at least that's what my family tells me).
\dt cust*
will list all tables that start with "cust". It works with other commands as well (like \l).
Also, I like to split my terminal using tmux, and have a neovim editor in one pane, psql in the other. I just keep doing "\i file_name.sql" as I perfect the query.
I definitely agree wholeheartedly about pspg. They even have a FoxPro theme, which has a special place in my heart :).
I changed it to \setenv PAGER 'vd' and I just get a big chunk of text with no ability to navigate columns. How are you doing it with mysql?
I'm using clients for Mac, Android and linux (manjaro) and all work well. There are also clients for the other major platforms.
One of the things I really like about it is I can do a screenshot on both Mac & linux, saving to the clipboard rather than a file, and paste it directly into an editor and inkdrop handles everything, including creating a file and corresponding markup. And that all syncs too.
A side benefit of this is that F5 is mapped to refresh for a lot of apps (Firefox, for one) so I can hit capslock to refresh a page.
I use this as one part of a multi-pronged approach, dusting around areas they would need to cross to get into the house. It's super-cheap and lasts a long time.
It does need to stay relatively dry, though. When I've needed to repair drywall on occasion, I dust a bunch in the opening figuring it will basically last forever and not get wet.
I also use a bait with boric acid placed in various random areas. I also use a product that slowly emits a vapor in closed areas that basically neuters any roaches that get near it (for places like under the sink). Finally I used Home Defense spray around the outside.
I treat the condo once every three months, and it takes about 30 minutes. I've seen maybe two cockroaches in the past few years, and both were belly-up.
Within that article he describes "a 15-person startup company called Robotica has the stated mission of “Developing innovative Artificial Intelligence tools that allow humans to live more and work less.” It does not end well.
https://waitbutwhy.com/2015/01/artificial-intelligence-revol...
It is interesting that a timestamp without timezone is internally represented a timestamptz at UTC.
Postgres is also has some great functionality converting between timezones:
https://www.postgresql.org/docs/11/functions-datetime.html#F...
Here's a quick demo class that shows the technique. It's amazingly simple.
class Demo EXAMPLE = { "75%" => 0.75, "15%" => 0.15, "9%" => 0.09, "1%" => 0.01 }
def self.sample(choices = EXAMPLE)
choices.max_by { |_, weight| rand ** (1.0 / weight) }.first
end
def self.show(samples: 10000)
items = samples.times.map {sample}
items.each_with_object(Hash.new(0)) do |item, counts|
counts[item]+=1
end.sort_by(&:last).reverse.to_ h
end
end# Demo.show # => {"75%"=>7480, "15%"=>1525, "9%"=>901, "1%"=>94}
Edit: Sorry for the bad formatting. I added a gist:
https://gist.github.com/jasonl99/25d3c922d73f10a75fe228c2de3...
The cynic in me says that's exactly what's been done with humans. The school system in the United States was created, in large part, to train factory workers and be obedient citizens.
But within a couple minutes, I don't even notice, and I'm just letting my mind drift, sometimes to the extent that I've overshot my turnaround spot by more than a mile just from a lack paying attention
Having experienced this, I can't imagine now going back to the "old way" where I have random songs that differ every time, or different routes that require me to pay attention.
I've often thought the repetitive nature of the same route and the same music actually encourages the metal drift.
When I go to my orders I get "There's a problem displaying some of your orders right now. If you don't see the order you're looking for, try refreshing this page, or click "View order details" for that order."
It seems that Amazon is eating its own dog food.
At any time, "updates-applied" browser version of the current state of the object can be created with a call to the #content method.
So when a "updatable" occurrence occurs on the browser, you send an update method withe the changes. The changes are packaged up into messages that sent to each subscriber, where they modify the dom.
It's a bit of a reversal, probably, with how people use frameworks that dynamically change content. I make the assumption that the server's instance is the only keeper of object state. Changes made on clients either change object state or they don't; if they are not sure, they send an event back to the server which handles it.
A @WebObject can also have properties that are themselves WebObjects, and the current card game actually has three: ChatRoom, GameStats, and GameObserver.
This pushes the responsibility for rendering content directly where it belongs: on the object where the rendering occurred in the first place.
But it has the side benefit of keep object state, too. The CardGame doesn't have to worry about the state of the ChatRoom (though it can observer and send events to and from it).
The bottom line is that there are only two ways the browser rendering could be wrong: 1) Some packets were missed, or 2) The developer didn't send the correct events, or sent them in the wrong sequence.
The first case could be solved by creating a delivery confirmation layer over the objects.
The second case is probably a little more dicey. The more data contained in a single updatable chunk, the harder it is determine when state changed. That's helped tremendously by the idea of nesting WebObjects (A Room has CardGames which have Players and Games, which have Decks and Cards....each of which take care of updating themselves)
That said, lattice is completely event-driven. The #on_event and #emit_event methods act as entry and exit points. As long as I can have string come and go between the server and client, HTTP2 would be fine.
This seems like a pretty good article covering it
The framework as I've written takes state into account; in fact it was/is a design goal. There are three types of server objects currently - WebObject, StaticBuffer and DynamicBuffer. A WebObject stays instantiated on the server even when no users on viewing it (at some point it will be garbage collected).
At any time, rendering that object will produce the exact representation as seen by someone who has viewed it and been updated with websockets. In fact, the card game is a good example of this. Start a game, draw a few cards, start another game, and then go back to the first. It'll be in the same state you left it in, complete with the events that occurred while you were gone. This was one of the top goals.
DynamicObjects are just arrays of WebObjects in a configurable buffer - think of a list of sports scores, where each item handles its own update.
StaticObjects are an array of simple strings of html (think of tail to view a log file).
I have written the framework to use a single socket connection for all updateable objects on the page.
Show HN: WebSocket-first development
http://www.telegraph.co.uk/technology/0/permanently-delete-f...
edit: lol for being slow on the draw.
http://www.personal.kent.edu/~rmuhamma/Philosophy/RBwritings...
I've started doing something in the past year - when I go for a run, I pick one "small thing" to think about. It might be trouble I'm having with code (javascript Promises, anyone?), or something as unrelated as "why do we drive on the right side of the road in the U.S." I don't always intend to try to find an answer, I just want to get in the habit of just thinking without distraction.
In my case, the TIPM has failed -- completely -- twice. The first time, I lucked out -- it happend while I was in my condo's parking lot. The Jeep completely died -- engine shut off, power windows didn't work, lights, radio, everything dead. If this had happened on the freeway during the 40-mile freeway drive I was about to do..yikes.
The second time the part failed was overnight. I was awoken at 3 am by my Jeep with its reverse lights on, the horn intermittently beeping, and the headlights and windshield wipers coming on. I could not get it to stop until I disconnected the battery. In both cases the dealership replaced the TIPM. I asked specifically if the part number showed that they had "improved" the part -- but no. It's the same.
There's even been a lawsuit filed to get them to do something about it:
http://www.autosafety.org/cas-calls-nhtsa-investigation-chry...
Long story short -- if you are in the market for a Jeep, PLEASE make sure you are fully informed about the TIPM situation.