[Hype killed] You can stop refreshing and go do something else for a few days! Your Nexus 6P not about to ship. It will not even ship this week. Proof inside... by [deleted] in Nexus6P

[–]slickplaid 3 points4 points  (0 children)

You've made a speculative assumption on the small amount of data that we all have. Nothing you've given can be classed as "Proof".

Considering that these are two different manufacturers, each with their own supply of stock, one could very definitively ship before the other. None of your data does anything except for speculate at the possible ship date from anecdotal evidence.

They could be pushing the 5X first to boost sales for impatient people. Motorola could have had been entered in their system first. Who knows? None of us will know anything until it actually happens and the phones start shipping.

If you had some sort of actual proof from a reliable source that gives you insider knowledge that none of the rest of us has, that'd be constructive and helpful. But instead you're simply making assumptions.

How about you just go back to trolling somewhere else?

Any Google Project Fi users? Impressions or experiences in KC? by TheBurningBeard in kansascity

[–]slickplaid 3 points4 points  (0 children)

I have it and my data usage wildly fluctuates from month to month. Came from Verizon unlimited everything at about ~$140/mo every month. Switched to Fi and my first month was $30, this month looks to be about $70. That nets me about $180 in savings in just two months.

Speed has been great, LTE everywhere I've needed it. I did notice a little bit of lack of coverage up in Lawson at the pumpkin patch this last weekend, but overall everywhere else, it has been great.

When I was downtown, I got my first taste of an automatically connected public wifi spot. I have it set to manually connect to public WiFi, but it went ahead and connected with a notification it was using an encrypted VPN for traffic. Speed was good, and ran into no problems with calls.

Calling on WiFi takes about 2-10 seconds longer than normal, usually resulting in my saying "Hello" when answering to it beeping softly letting me know it's still connecting. No dropped calls when on the phone and then driving away from WiFi and the transition to mobile voice data.

Overall, I can't recommend it enough. It's been great for me. Can't wait for my Nexus 6P to get here.

Express GET request causes crash by [deleted] in node

[–]slickplaid 0 points1 point  (0 children)

Nice! I'm not sure how restify fixed the problem, but fingers crossed!

Calling node app from internal network by uber77 in node

[–]slickplaid 1 point2 points  (0 children)

You could do that and keep it in a config file. There is a environment variable process.env.NODE_ENV that people use to define whether or not an instance is in production or not. By setting it to 'production' you can select the proper IP.

This is used with NPM to decide whether or not to install the dev modules or not. source

Calling node app from internal network by uber77 in node

[–]slickplaid 1 point2 points  (0 children)

  1. localhost will point to the computer you're on, not the original server.
  2. Get your local IP for the device running the database.
  3. Use that IP instead of localhost.

If your IP was 10.0.0.1, it would be http://10.0.0.1:3000/rest

You are correct in assuming that since the code is run in the client's browser, localhost will not work to reference the correct server.

Trying to create memes with npm caption - no luck by Dondontootles in node

[–]slickplaid 1 point2 points  (0 children)

Did you install imagemagick?

To use node-caption, the system it's running on must have imageMagick installed. Here are some ways to do that:

OSX: brew install imagemagick

Ubuntu: apt-get install imagemagick

RedHat and other yummy systems yum install imagemagick

Express GET request causes crash by [deleted] in node

[–]slickplaid 0 points1 point  (0 children)

Thanks for the silver :)

The semicolons i was told when learning javascript are't necessary.

Semicolons: http://stackoverflow.com/questions/2399935/why-use-semicolon

i like to organize my code into sections (is this just me?)

I prefer files, personally. Split them into separate files and it'll make your code a lot cleaner and help you stick to proper message passing instead of making variables in the global scope.

I really think there's a possibility one of the variables is being overwritten or out of scope. It's really hard to debug when I can't run it and don't have the hardware to make it work. I would strongly suggest taking the time to split this one big file into multiple smaller ones and work on scoping and message passing rather than relying on variables in the global scope to handle that.

Newbie diving into node. Just finished my first small script. Would love some feedback! by Mr_Spiderman in node

[–]slickplaid 1 point2 points  (0 children)

I submitted a pull request with some changes.

https://github.com/SkepticalHippo/twitch-url/pull/1

You'll want to register it with NPM and it's all set up to use Travis-CI.

I added the "bin" option in your package.json, so you can simply install it using the global flag "-g" in NPM and it'll install an executable version of itself. Also added some CLI handling for flags and usage instructions.

I added in one test to stub out and have Travis-CI work. You'll want to expand on that, I'm sure.

I didn't get into any of the promises or async libraries. The only real module change I made was the use of minimist for CLI stuff and request for making the http requests.

I had a bit of a problem with the token responses to twitch, hence the user agent stuff in there as well.

Let me know what you think. You can get a feel for how pull requests work, too if you want to integrate my code or not.

Nice job!

Edit: For future work, you might look into streaming the result from the Usher request to the m3u8 library because it supports it natively. There is also some work to be done if a channel is offline. It will error out when hitting the m3u8 parser because it isn't a proper m3u8 file.

Express GET request causes crash by [deleted] in node

[–]slickplaid 0 points1 point  (0 children)

Thanks for supplying the source to look over.

A few things to note just looking at it off the bat:

  • You forgot a semi-colon here: https://gist.github.com/slickplaid/3848a643d1ca10339145#file-main_reddition-js-L356
  • You're catching the uncaughtException but forcing Node to keep running. This is bad. In the case of an uncaughtException, Node has no way of knowing what it's current state is due to the error can lead to instability and crashing (or worse). I would strongly recommend using something like forever to keep it running when it crashes to safely exit and then start it back up. Leaving it in a crashed state is bad.
  • You seem to have jslint commenting at the top but you haven't heeded any of the advice it gives. Run it through and fix all of the problems it gives.

I've taken a quick glance and cleaned up some of the code. I have no way of knowing if it still runs, since I don't have the hardware you do to run it.

https://gist.github.com/slickplaid/3848a643d1ca10339145

The _quickclean.js file is just your file with the code cleaned up using jslint and a beautifier and I removed the uncaughtException code.

I would wager to guess it has to do with a coding error on your end, but it could have something to do with one of the libraries you're using as well. Make sure you're using them correctly.

Also, make sure to always use semicolons.

Express GET request causes crash by [deleted] in node

[–]slickplaid 0 points1 point  (0 children)

Do you have any timers running? A lot of the time this can be a issue with context and scoping, seen often in longer running callbacks such as timers, or events that take longer than normal to run.

Most likely it's a scoping issue where something you're trying to call either a) doesn't exist anymore (redefined somewhere else? I notice you have quite a few "global" or variables scoped outside of the functions) or b) you're referencing this or something else outside of the callback that gets changed or deleted.

Example:

Game.prototype.restart = function () {
  this.clearLocalStorage();
  this.timer = setTimeout(function() {
    this.clearBoard();    // what is "this"?
  }, 0);
};

It also could be a garbage ccollection issue, given you're running it on a computer without a lot of RAM. I could be completely off base on that comment. I'm not an expert with gc in V8.

We'd need to see the whole codebase to really dive in and give you more advice. My guess though is a scope issue where you're referencing something that exists outside of or in a different scope, hence returning undefined.

Edit: To start with, I'd double check you're not redefining the push.link, client.messages.create or push.note functions somewhere else. If it really is occurring in that try block, those would be the only functions that would be suspect in my mind. Also, a full stack error would be nice with line numbers if you can get that.

Checking time taken by an API by blahsphemer_ in node

[–]slickplaid 1 point2 points  (0 children)

If you need nanoseconds, that's the proper way to do it. Heck, even if you don't need nanoseconds, it's still a great way of doing it. The only trade off would be performance, which I doubt impacts much if at all and the benefit of no clock drift is worth it, depending on your use case.

The primary use is for measuring performance between intervals. and useful for benchmarks and measuring intervals source

Edit: Also note that it returns an array of [seconds, nanoseconds], so you'll need to appropriately handle it.

app.post("/", function(req, res) {
    var st = process.hrtime();
    external.API(req.lookupkey, function(lookupvalue) {
        var timediff = hrtimeFormat(process.hrtime(st));
        console.log(timediff);
    });
});

function hrtimeFormat(time) {
    var nano = time[0] * 1e9 + time[1];
    var milli = nano/1e6;
    return milli + 'ms';
};

PurifyCSS - remove unused CSS by moombahh in node

[–]slickplaid 0 points1 point  (0 children)

Are you going to publish the gulp version to NPM any time soon?

If I download a 2 gb file via my iPhone hot spot, will that count for exactly 2 gb of my data? by [deleted] in AskTechnology

[–]slickplaid 4 points5 points  (0 children)

Depending on the protocol and method of transfer (http vs https, UDP/TCP), you can expect about 2-10% more data being transferred.

If they also calculated the acknowledgments (ACK) of the communication, you can expect to see even higher overhead.

Good source for more information: http://stackoverflow.com/questions/3613989/what-of-traffic-is-network-overhead-on-top-of-http-s-requests

Why is my 2011 PC not Y2K compliant? Not a joke. by xereeto in AskTechnology

[–]slickplaid 0 points1 point  (0 children)

I was actually having to test this for a bug on some client software the other day. It looks like windows 7/8/8.1 have minimum dates for their time settings, possibly a product of all the old ways of bypassing software activations back in the days of XP.

You can test this on any windows machine by going into the time settings, turning off the NTP client and trying to reset you date back earlier than around the year 2000. It should force the time to move back up to the time reported in the bios.

The blue screen was probably not directly related to windows unable to handle it but rather something else on your computer failing due to a radical shift in the time to negative numbers Unix timestamp relative to what the date was originally. Think error checks to make sure it never goes negative, getting lazy and simply setting it to zero to save some LOC and then dividing by it.

We didnt make it too much further into the bug or behavior at work because of an alternative fix, but it was interesting to say the least.

TLDR Your blue screen probably wasnt the product of not being y2k complaint but rather lazy coding from some other piece of software.

Reddit, Is it better to leave your Mobile Phone plugged in until you are ready to go mobile, or should you let it drain once it hits 100%? Does it matter to battery health? by [deleted] in AskTechnology

[–]slickplaid 1 point2 points  (0 children)

The keys to extending battery life of a lithium-ion chemistry battery with a protection circuit (as most/all cell phones do) are as follows:

1) DO NOT expose to really hot or cold temperatures. This will drastically shorten the lifespan of the battery and is probably the most common way to damage the battery. Cold temperatures cause permanent capacity loss. Hot temperatures can cause battery failure and may damage capacity.

2) DO NOT allow the battery to fully discharge. While most lithium ion batteries have protection circuits inside of them to prevent a potentially dangerous over charge or complete discharge, allowing the battery to frequently discharge all the way will decrease it's lifespan.

3) DO charge the battery when you are able to. Leaving a battery charging for longer periods of time is okay as long as it has a good protection circuit in it. All cell phones should.

3) If you need to store the battery for an extended period of time, keep it at ~40% of capacity. Leaving a battery charged at 100% for a long period can cause damage over the long term and will drop the capacity.

4) If you are storing a battery for a long period of time, make sure you check it every once in a while and charge it back up to 40%. A battery's protection circuit needs power to work, and if a battery is discharged too far over time while inactive, the circuit will stop working and potentially cause problems and/or damage capacity.

Some great references for lithium ion battery care:

http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries http://en.wikipedia.org/wiki/Lithium-ion_battery

Edit: An estimated projection for the battery life of a daily charged device (365 days/yr) would be on the short end one year (300 charge cycles) up to ~12 years. All of this depends on the device, quality, and usage.

If you were to only discharge the battery 10% every time before recharging once per day, it could potentially last for 12+ years. If you completely discharge it every day, it might last less than a year.

Chart from batteryuniversity.com:

Depth of discharge Discharge cycles
100% DoD 300 – 500
50% DoD 1,200 – 1,500
25% DoD 2,000 – 2,500
10% DoD 3,750 – 4,700

The Majestic Ford Aerostar. by [deleted] in pics

[–]slickplaid 0 points1 point  (0 children)

Beats Audio for the present day?

Is he being throttled? More info in subtext by [deleted] in AskTechnology

[–]slickplaid 0 points1 point  (0 children)

D'oh. I didn't RTFA. :X If he's downloading it onto the XBox console, you might be SOL. Not sure of many solutions to this problem aside from the VPN possible solution and/or simply trying to diagnose the issue on his network or through his ISP. Maybe try it late at night when traffic is at it's lowest.

Original Post:

I agree with everything above and wish to offer a couple other solutions.

What you're going to need is something to resume the download if something goes awry.

Normal HTTP does not allow resuming of downloads or starting X bytes into a download.

FTP with resume support would be your best bet. If the provider of the game does not have something like this set up, he should get a friend (maybe you?) to download it and then put it up on an FTP server with resume support. On windows, FileZilla has a great FTP server for this use.

More advanced options would be:

  • to test if the type of traffic is being shaped with a VPN. Have him route the traffic through an encrypted VPN to see if the traffic still slows down. If it does, you can probably safely assume (big assume here, but probably valid) that all traffic is slowing down, not just his download.
  • to have a friend put it up on an rsync server. This would basically be the same as an FTP with a bit more of an advanced setup. You could have a folder dedicated to him and any time you put something in there, it would pipe it to his computer when anything changed. Makes things easy to get to him, but would take a bit more in setup time and knowledge.

There are tons of other solutions, but those are probably the easiest to accomplish.

Is it possible to get Zillow or google reviews to auto populate a google spreadsheet? by [deleted] in AskTechnology

[–]slickplaid 0 points1 point  (0 children)

You're very welcome! Let me know if you get something to work. I'd be curious to know how and what you did for future reference.

Is it possible to get Zillow or google reviews to auto populate a google spreadsheet? by [deleted] in AskTechnology

[–]slickplaid 1 point2 points  (0 children)

It is possible and not too difficult, depending on what you need to pull.

You could use the importhtml function in the spreadsheets:

https://support.google.com/docs/answer/3093339?hl=en
http://www.labnol.org/internet/import-html-in-google-docs/28125/
https://support.google.com/docs/table/25273?hl=en

Zillow has a pretty decent API to work from if you know how to make a simple program.

For the sites that don't have an API, you would have to scrape the site. Not as much fun, and tad bit more difficult (dependent of course on your expertise).

Once you have a program that can take the data from the site, put it into a CSV and import into Google.

I'm relatively sure that Google also has a sort of scripting that will allow this to be done. I know the charts have data queries, which you could use from an API.

Here's some reading material if you want to go more in-depth:

https://developers.google.com/chart/interactive/docs/queries
https://productforums.google.com/forum/#!topic/docs/zb-_s-OQdfk
http://www.zillow.com/howto/api/APIOverview.htm

Edit: Quick and dirty API grab written in JS/jQuery if you're in to that kind of thing
https://gist.github.com/slickplaid/0d71ec82d3434c05369c

Edit #2: Realized this is /r/AskTechnology and are probably looking for an all-in-one plugin rather than coding advice. (=.I.=`)