« first day (1411 days earlier)      last day (3538 days later) » 

12:00 AM
I wrote a BF minifier in REBEL
 
BF /minifier/?

*shudders*
 
It was for a code golf challenge
 
how the hell do you minify BF?
 
_/^_$/$</([^][<>.,+-]|\+-|-\+|<>|><)//((?<X>(<|>))+[+-]+(?!\2)(?<-X><|>)+(?(X)(?!)))([+-]+)/$3$1/.+/$>$&
Like that
 
Remove spaces, remove <> and +-, remove [-][...]
 
12:03 AM
11
Q: Minify Brainfuck

DoorknobYour challenge is to minify Brainfuck code, according to these rules: Remove anything that is not one of +-><[].,. For any group of consecutive + or - characters, if the amount of +s and -s is the same, remove them. Do the same as above, but with > and <. Remove sequences of the +->< character...

 
m59
Could someone verify whether this is throwing an error?
It's supposed to.... and does in IE, but it stopped throwing it in Chrome for no apparent reason.
 
@KendallFrey you should have done a BF minifier in BF
is BF interpreter in BF possible?
 
Yes
But BF is not a good golfing language
 
BF is Turing complete
 
@m59 no error, and I'm on chrome
 
m59
12:09 AM
sigh
I'm thinking jsbin is suppressing it somehow
@Mosho what did you do to the database? Sounds fun.
 
the concept is awesome: polygon.com/2014/8/26/6072141/…
you're a sperm cell trying to race other cells through the tests given by the tubes
 
12:38 AM
how is there not a 10h version of this yet?
 
@towc cuz she's not saying words :P
 
@KendallFrey just repeat it for 10h would be good
 
m59
Yeah, I tried it in plnkr and the error is there. Does anyone have any idea how jsbin could suppress a random error?
It's not that I need to know....it's just so strange.
 
12:56 AM
0
Q: Using .then causes the Error TypeError: undefined is not a function

user2625177I have a promise I want to be fulfilled once a .map function is finished so I put .then and resolve my promise. When doing this I run into the error TypeError: undefined is not a function and I am not sure why. Here is the function in java script (it is compiles coffee script so it looks messy) ...

 
1:51 AM
anybody know why you would use a CSS Flexbox? I guess if you needed blocks to be stacked horizontally instead of vertically (i.e. display:block)?
 
MLM
@taco Vertical and horizontal alignment is one reason
 
Because neither floating nor tables make sense for layouts
 
there are some awesome people in there who use flexbox regularly
 
It looks like IE lags behind yet again though
 
1:52 AM
but ofc :P
 
Thanks @Loktar
my curiousity is extinguished now though
 
@copy gah yeah I feel like people floating is going to be with us longer than tables were for layouts
 
Meh, making things work correctly with floats is really hard, unlike tables, which are just wrong
 
yeah thats true I guess
 
But I can't really judge that because I never made a complete layout
 
1:55 AM
just need some more flexbox awareness (and support)
 
2:16 AM
Got my HOTAS system!
 
m59
We don't want to hear about your hot ass.
Well, I can't speak for everyone.
 
@SomeKittensUx2666 nice!
 
m59
Actually, that's pretty sick. What are you using it for? @SomeKittensUx2666
 
Installing War Thunder now
 
m59
pshh, I'd use it for Battlefield 1942
No way, War Thunder actually reminds me quite a bit of it!
 
user2620028
2:20 AM
Battlefield 1942 was the only good battlefield game
 
@AaronSiciliano psh whatever
 
m59
Yeah + the desert combat mod. Those were the best.
 
1942 was kickass
but I also liked 2, and bfbc2
 
m59
I was a sick pilot.
No Fly Zone map, OH MY.
springing from a plane onto the the flag, then the plane catches up and picks you up and you fly away <-- that is friggin' awesome.
 
Scratch War Thunder I don't have time for 7 GB
 
m59
2:23 AM
oh yeah?
 
forgot I uninstalled it
 
m59
2:51 AM
3 messages moved to Trash
 
whats another name for the size of pixels?
for example I'm creating a static image (displays static like an old tv)
 
you can set the "static size"
@SomeKittensUx2666 looking for something to call an attrib
like size=2 means each one is 2x2
 
point?
 
bit it has a width/height for the image, so size seems wrong
hmm
pointsize maybe
dpi would work if I were actually following a dpi convention
maybe ill go with staticsize
 
2:58 AM
arg
Comcast needs to die
 
They do
Had an installer come out and tell me he can't put in a walljack. Well then why the fuck are you here?
 
also I completely forgot drivers
 
user2620028
Hahahahaha.... He can put in a walljack but not for free
 
I was going to pay
 
user2620028
I am actually in the process of putting one in at the moment!
 
3:01 AM
He just said he was there to "wall fish" the cable
I was like fuck no, go get a skill
 
user2620028
I called them and asked them if they would do it. And they said they could do it but not for free
 
user2620028
bahahahaha yeah right
 
yeah it's $40 here
 
user2620028
I was just on the phone with directv for 2+ hours
 
+ $20 for "setup"
 
3:02 AM
@SomeKittensUx2666 what do you think of how the stick looks?
there are SO MANY BUTTONS
 
+ the appt fee... something like $97 total
 
like under the screen on the throttle, those can be mapped, the rollers can also click in
also behind the throttle towards the top there is also another wheel, that can be clicked in too
 
user2620028
They told me they wanted to cancel the early termination fee and break the contract for me and so i was like cool and shipped the equipment back to them.... Just got a bill for $450
 
to the left of the hat on the throttle.. lol so insane how many buttons there are.
 
haha, good luck @AaronSiciliano
 
3:03 AM
@Loktar AAAAAAHHHHHH BUTTONS
 
I'm on a "no contract" plan, but I pay $222 for 3 rooms
 
user2620028
So i called them and after 2 hours of talking to them they finally said they could dig up the audio of the phone call if i email a certain person, OR they would re activate the service for me for free
 
and the third wasn't installed! It's been months!
 
haha
 
And they're making me pay $97... for the room that wasnt installed!
 
3:04 AM
uh oh
am I missing a switch?
the joystick isn't working
 
user2620028
So i said... hey i am moving out of the country.... dont you waive early termination fees if someone moves out of the country and you dont provide service there... And the manager goes... well yeah we do that... My response was... well reactivate my service and then cancel it for me again :D
 
anyhow, I don't wanna talk about them. We all know they suck. Google Fiber cant come soon enough
 
?
 
nice
 
what do you mean @SomeKittensUx2666
oh
did you plug it in from the throttle as well
 
3:06 AM
@Loktar I'm installing the drivers, and everything on the throttle works fine
yeah, checked plugs at both ends
 
there is the usb to the computer then the ps2 cable from the throttle to the stick
hmm weird
it should power up w/o the drivers..
 
some of the Joystick LEDs are on, including Power
 
user2620028
@taco are you kidding me.... $97 for a room that wasnt installed? I can tell them plenty of places that they could wire that cable....
 
user2620028
im sorry... "fish" that cable hahahaha
 
install the drivers and see if maybe some are set to off
you can turn them off individually, however all mine were on by default :?
 
3:07 AM
The first installer guy supposedly "broke a drill bit" on the first install (he was about to hit the 2 hour mark)
If I have a function before a node response.redirect('/') call, how do I make sure the function right before it gets executed? I know I need to nest functions, but I can't think of how to do this in my head
createPassportCookie(strategy, odata);
res.redirect('/gamers/home');
 
user2620028
I havent played with node yet :(
 
I have the createPassportCookie function outside off the app.get() route
 
user2620028
Its just normal javascript right
 
yeah
 
user2620028
just used in a different way
 
3:12 AM
I want to re-use that createPassportCookie code, so I'd rather not do it inline
 
user2620028
10
A: how to detect a function was called with javascript

Juan MendesTwo options: Static variables Here's how to create static (like in C) variables using self calling functions to store your static variables in a closure. var myFun = (function() { var called = false; return function() { if (!called) { console.log("I've been called"); called...

 
user2620028
Had to brb so it was the closest thread i could find :/
 
user2620028
Why do you have to find out if the function was executed?
 
user2620028
try catch?
 
hey m59 thank you for dealing with me, and i didn't know there was a chat room?
 
3:14 AM
@user2625177 Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@taco - you want to re-use that createPassPortCookie code, is it in a function in your main app file or a separate module?
 
oh snap we can ask questions here awesome!
 
app.js @tymeJV
 
@taco - you can always move it to a module, require the module where you need it and run the functions you want
 
Ah, good idea @tymeJV thanks
but how does that solve the problem where it executes before res.redirect()
 
3:16 AM
ok so how do you loop values into an array in javascript? I am using the map function but I my array always ends up with the value NaN
 
@taco - is it an async function?
 
yeah. when it redirects, the cookie may not be ready
 
pass in a callback, createPassportCooke(strat, odata, function() { res.redirect() })
createPassportCooke(strat, odata, callback) { //logic, if (callback) callback() }
 
                createPassportCookie(strategy, odata, function() {
                res.redirect('/gamers/home');
                });
That's what I have right now
 
yep, just add callback as a param to your createPassportCookie function and execute it at the end
still runs before the cookie is there?
 
3:19 AM
But I wasn't sure how that would look in createPassportCookie()
 
how that function look right now?
 
would I just return callback;?
function createPassportCookie(strategy, odata, callback) {
  var passportObj = {
        strategy: strategy,
        data: odata
  }
  res.cookie('passport', passportObj, { maxAge: 3600, httpOnly: false});

}
 
My Windows install is so messed up
 
alright, so, add the callback at the end, like so:
function createPassportCookie(strategy, odata, callback) {
var passportObj = {
strategy: strategy,
data: odata
}
res.cookie('passport', passportObj, { maxAge: 3600, httpOnly: false});
if (callback) callback()
}
 
ah ok thanks
 
3:21 AM
got to love passing functions as variables
:D
 
I do love that
 
is angular a framework of library or both?
 
framework
angularjs.org -> superheroic MVVM framework!
 
and jquery is a library correct?
 
yep
 
m59
3:28 AM
right
 
then why is it I can't use jquery with angular?
 
m59
You can, but you shouldn't.
 
that is a load question right there...
loaded*
3216
Q: How do I "think in AngularJS" if I have a jQuery background?

Mark RajcokHow do I “think in AngularJS” if I have a jQuery background? Suppose I'm familiar with developing client-side applications in jQuery, but now I'd like to start using AngularJS. Can you describe the paradigm shift that is necessary? Here are a few questions that might help you frame an answer: ...

 
@user2625177 you could use underscore underscorejs.org (if you're dealing with the array loop issue you mentioned before, I mean)
 
my bad but I always had the impression jquery > js so I don't get why build something off js instead jquery.
 
3:29 AM
it all depends what you're using jQuery for - Angular wants to use the data structure as the basis for the DOM
 
m59
@user2625177 regarding your previous question about map, it depends on what you're doing (have to be more specific), but perhaps you want push ?
149
A: Why use AngularJS instead of jQuery?

m59Data-Binding You go around making your webpage, and keep on putting {{data bindings}} whenever you feel you would have dynamic data. Angular will then provide you a $scope handler, which you can populate (statically or through calls to the web server). This is a good understanding of ...

;D
jQuery is nearly useless when you're already using Angular. Most things (maybe ALL things) you do with it will be at best inefficient.
 
Except for those pesky jQuery plugins...
 
m59
inneficient ^
 
even then, good CSS can save you from most jQuery methods
 
m59
And jQuery plugins are mostly utter garbage. Of course...people are writing garbage Angular, too haha
 
3:33 AM
ahhh I see..
also array push sounds like it might be what I'm looking for
 
in php
variable[n] = this + n
n++

usually is enough
 
damn 36 vs 667 lines of code
 
m59
;D
 
3:36 AM
but is it cross browser compatible though?
 
m59
Probably, but I don't support IE8
 
IE8... nightmares
 
m59
I only support Google Chrome latest nightly build
LOL
 
LOL
 
m59
I only support next week's Chromium build.
 
3:38 AM
LOL
 
firefox has been the bane of my existence this past week
 
ok so array push doesn't look like a solution here is what I got
n = 4
while n--
i=0
shops.map ->
totalRevenue[n] += shops[i][revenue]
i++
 
m59
I don't know what you're trying to do.
generalize the problem (x, y, z would be preferable to all this revenue business) and make a jsbin
 
I want Total revenue to be the sum of every value of shops revenue
 
3:44 AM
I was generalising XD
 
@user2625177:
 
m59
var res = 0;
shop.forEach(function(shop) {
  res+= shop.revenue;
}
 
for (var i = 0; i < shops.length; i++) { totalRevenue += ships[
yeah
 
m59
either way ^
 
total revenue needs to be an array though
 
m59
3:46 AM
same thing then?
 
an array of what?
just the values?
 
no an array of the different shops
 
rather than +=, just do a .push on a pre-determined variable
 
m59
var res = [];
shop.forEach(function(shop) {
  res.push(shop.revenue);
}
 
"n" shops
oh... push... AFTER
ok lets try that
wait wait...
but will it be res[0], res[1], res[2], when i push?
 
m59
3:48 AM
You gotta work on your communication. Maybe better to literally write out what your input is and what you want output.
yes
PHP is bad for you.
 
yeah everyone kept telling me that... but I didn't believe it
no I'm going through withdrawal
 
m59
heh
 
Ok for communication practice I will write it out.
 
m59
It gets better with time.
 
res = shops.map(function (shop) { return shop.revenue; });//?
 
3:52 AM
I have an "n" number of shops [in my example n was 4] each shop has a revenue amount for each quarter so shop one's revenue for the 3rd quarter is shop[1][3].

Now I need the the total revenue for EACH shop so that totalRevenue for shop 1 is totalRevenue[1] which is the sum of the revenue for each of shops 1's quarters so
shop[1][1]
shop[1][2]
shop[1][3] and so on.
 
m59
@phenomnomnominal yeah, that's the best :)
 
then reduce to sum
 
you need an inner loop then
shops.length, then shops[i].revenue.length
and sum the inner revenue, to each index
 
yes but I am summing the inner revenue wrong somehow
because i can't just do totalRevenue[n]
oh wait... push!
 
m59
shops = shops.map(function(shop) {
  var total = 0;
  shop.forEach(function(quarter) {
    total+= quarter;
  })
  return total;
});
 
4:03 AM
So I've checked all the connections, tried a different port, reinstalled the drivers and am out of ideas
 
m59
shops = shops.map(function(shop) {
  return shop.reduce(function(a, b) {
    return a+b;
  });
});
@phenomnomnominal's suggestion, I think ^
Yeah, reduce is really the nicest way, but not supported in IE8, of course.
 
Any thoughts? I can't open the casing
@Loktar ?
 
shit idk man :?
do you have a different PC?
do you have a ton of stuff hooked up via usb?
or is it hooked up via a passive hub or anything?
I tried on a passive hub initially and got a warning there wasn't enough power
so then I connected it directly
 
Tried it on USB 2.0 and 3.0
and there's a couple things via USB
rebooting
 
new web component
made a polymer one this time
 
4:20 AM
Hmm, upon reboot, the big screen is flickering
power might be an issue
 
yeah thats odd man
yea
it def shouldnt do that
is it a laptop?
 
though I have no idea how to give it more power
no, my desktop.
 
man thats really weird.. wth
try disconnecting all other usb's
just to test
 
I can't imaging you have anything drawing crazy amts of power though
 
4:21 AM
yeah
 
take it to work and try it, if it does the same thing there I would return it and get a new one
or try a diff pc at least
 
I'm on my MBP right now
but that's not the greatest comparison
 
yeah
damn man that sucks
 
I'm pissed for you wth.
well I need to get to bed
 
4:23 AM
night
 
m59
night!
 
Probably not enough power being supplied by the USB outlet.
@SomeKittensUx2666 the joystick comes with an external power adapter doesn't it? maybe its loose?
 
> Hsu: Using HTML5 enables the operating system to be very lean and it requires less memory consumption.
סּ_סּ
 
m59
What's that from?
 
4:31 AM
@taco No external power
 
Got this off SO: The USB 1.x and 2.0 specifications provide a 5 V supply on a single wire to power connected USB devices.

A unit load is defined as 100 mA in USB 2.0, and 150 mA in USB 3.0. A device may draw a maximum of 5 unit loads (500 mA) from a port in USB 2.0; 6 (900 mA) in USB 3.0.
So you've probably got either 500mA or 900 mA to work with
 
the flickering stopped
hmm
 
you'd want to check the power draw on the specs
probably best to get an external USB hub
 
this is crazy, no matter what I do I get undefined function
 
no luck with the manual
@taco Power shouldn't be an issue at all
 
m59
4:41 AM
@user2625177 details
 
ok
 
My best guess is that the cable is bad
but visual inspection looks good
 
shopSum = array
x=5
shopSum.push x
 
m59
@user2625177 also, have some self respect and name yourself :)
@user2625177 I don't know coffeescript, but I don't think that's what you think it is.
var shopSum = [];
var x = 5;
shopSum.push(x);
 
brackets?
 
m59
4:43 AM
It's an array..
 
yeah, that's like javascript 101
 
m59
Show me what your coffeescript compiled to (and you really shouldnt use cs until you know js well)
 
never use "new Array()"
 
!!s/until .*//
 
@SomeKittensUx2666 Show me what your coffeescript compiled to (and you really shouldnt use cs (source)
 
m59
4:45 AM
lol
 
T__T
what does Array even mean then
string?
 
An array is an array.... come on, man
Try RTFM
 
so then why did Array not work but []
 
m59
I forgot the word for it, but it's like the blueprint.
you would have to use new Array
 
-__-
 
m59
4:46 AM
Maybe you would understand it like this:
 
eloquentjavascript.net is a great resource. It has a test console as well, so you can practice
 
m59
class Foo {
  push: function() { }
}

var x = Foo;
 x.push //nope
see the problem?
 
you can even download it and practice offline
 
m59
but js isn't classical, so it's not quite like that.
 
I don't see the problem ( I only sorta get classes) why can't a variable be a class?
 
m59
4:48 AM
oh...then understanding prototypical inheritance really isn't about to happen haha
Just take our word for it :)
 
ok got it
[] is array and put new in front of new things
 
m59
new is usually not used lately
depends, I guess.
Object.create() ftw
 
ok This is the first time I am developing for the mobile web, and I am encountering a super silly thing. I made a simple form about 300px wide, and lumia at 480px, automatically makes the body larger in width and height, adds scrollbars and my form looks tiny. How can I solve this?
 
m59
Probably the meta tag
viewport
 
absolutely!!! thanks m59. ur awsm
 
m59
I'm a swan!? I thought I was a human :'(
 
xD
 
m59
@user2625177 your coffeescript compiled that to var shopSum = array
array is an undefined variable, then
so, you did: (nothing).push
 
thanks again @m59, it solved a scaling problem too :D
1 shot, two targets \o/
 
m59
4:57 AM
np
 
thanks m59
I was able to get it working with shopSum = []
can promises return arrays?
 
m59
promises return what you pass them
 

« first day (1411 days earlier)      last day (3538 days later) »