« first day (878 days earlier)      last day (4075 days later) » 

7:00 PM
@Aneesh in that case you can use the function I listed above, create two divs for the messages and two divs for the modals. Assign IDs for each and use the function in the way I suggested above
 
@IvoWetzel Done and done: github.com/Zirak/SEN/commit/…
 
@Zirak Thumbs up!
after all, not everything that the crock made is gold..
 
@BenjaminGruenbaum used that script, but shows some errors in script
 
@Aneesh which?
 
Hey guys. If someone will help me in regular expression. string is "This is ==Title1== and ==Title2==" I want it like "This is <h1>Title1</h1> and <h1>Title2</h1>"
 
7:05 PM
@IvoWetzel I don't understand why browsers don't use encode/decode . stringify and parse are dumb names
 
@BenjaminGruenbaum <script type="text/javascript">
       function assignMessage("#button","#modal") {
                $('#button').click(function(e) { // Button which will activate our modal
                        $('#modal').reveal({ // The item which will be opened with reveal
                                animation: 'fade',                   // fade, fadeAndPop, none
                                animationspeed: 600,                       // how fast animtions are
                                closeonbackgroundclick: true,              // if you click background will modal close?
 
@Aneesh Please format your code (Control + K)
Also, you did not change the contents of the function body itself, this is not how javascript functions work
 
@BenjaminGruenbaum Not clear, I have no well knowledge in Javascript
 
It explains the concept of functions, do you know any other programming languages by the way?
 
hey guys
 
7:09 PM
@BenjaminGruenbaum PHP. Now using Yii
 
@Aneesh Did you create methods in PHP?
 
@BenjaminGruenbaum yes
 
Great! JavaScript functions are just like that
(well, much more powerful, but that's another story)
You give them attributes, and that's the value they use for the duration of the function execution (again, minor inaccuracy since in JS they're more powerful)
 
@Ben the naming of JSON functions are an error that crockford apologized about
 
@FlorianMargaine Hah! source?
In you code, you gave the function declaration contained "#button","#modal" , those should have been variables, try to spot the differences between the code you're using and the one I'm using
 
7:11 PM
The video talk in yahoo tech talks iirc, the one about ie9 not supporting strict mode
Can't remember more, sorry
 
I also strongly suggest you check out the video tutorials in introducion to programming in Khan Academy, they're about JavaScript and teach the basics
@FlorianMargaine How can you ping me without writing my full username btw?
 
@BenjaminGruenbaum Ok thanks
 
@Aneesh You're welcome, if you have any other questions about JS you're welcome to ask
-1
Q: Issues with some wordpress plugin, trying to help a friend

Dsadsadsa Sdasdasdamy friend runs this site http://www.hotasiababes.com/ and there is an issue with the CSS once the "load more" butten is clicked, i dislike the way the posts are orderd, using absolutte positions, but the posts after the CSS crash, and the ones before, look the same. Can anyone detect the issue?

LMFAO
 
Got an issue, following @BenjaminGruenbaum advice, I want to improve some code... the issue is to improve a search of div attribute. Can someone please take a look at it?
 
@cMinor fiddle?
 
7:14 PM
@BenjaminGruenbaum lol
 
"my friend runs this site hotasiababes.com and there is an issue with the CSS once the "load more" butten is clicked, i dislike the way the posts are orderd"
 
@cMinor cool, but why you show me this?
 
@cMinor Oh hi, now I remember your question :)
 
oh sorry, I red incorrectly, that is the jsfiddle for the issue I got to improve a search
 
7:16 PM
Yeah, caching your selectors is important, DOM access is one of the slowest things you do
Also, prefer === to ==, == does type coersion and can lead to a lot of errors
 
so I would do something like var firstcache = $("#card-container"); or something?
 
There are several things wrong with this line:
            img = $(this).find('img');
 
oh, that is not good :(
 
First, it declares a global variable, in JavaScript if you omit the var keyword, variables are declared in the global scope
Second, it calculates the selectors each time, you should find them only once instead of multiple times, it's not as big of a deal as the first problem since time-wise it is minor in modern browser standards
 
OK,
 
7:21 PM
Moreover your entire code can be modified to use NO JAVASCRIPT AT ALL
how awesome is that huh?
css supports a :hover selector
 
mmm, are you serious, I didnt think it could be done, but well I am not used to complex
code in css
 
Well, you can keep doing the image-switching part in JavaScript, that's probably simpler
The hovering part can be done completely in CSS which makes sense
            if ($(this).attr('data-direction') == 'right'){
				$(this).removeClass('flipping-right');
		}
		if ($(this).attr('data-direction') == 'left'){
				$(this).removeClass('flipping-left');
		}
		if ($(this).attr('data-direction') == 'top'){
				$(this).removeClass('flipping-top');
		}
		if ($(this).attr('data-direction') == 'bottom'){
				$(this).removeClass('flipping-bottom');
		}
All this code can be removed
 
uff, Ok I think i am following you
 
Instead of doing $(this).addClass('flipping-bottom'); and $(this).removeClass(flipping-bottom');
 
aha
 
7:24 PM
You can assign flipping-bottom class to the object in the first place
And change the flipping to a .flipping-bottom :hover selector
After you do that (removing 24 lines of code) we should extract the gallery ability to a method
So instead of having similar code 4 times you could code it once and use it 4 times
 
yeah, that makes sense
 
maybe a function like:
function gallery(element,images){
That accepts a selector, and a list of image sources, and creates a gallery for the element using those images
Now, we could have written this as a jQuery method, but actually, we don't need jQuery at all
You can write your code without using any jQuery which means loading 70 kilo bytes less and less bloat on your page
It also means we'll be able to use it in the future without breaking stuff over jQuery version updates etc
 
I spent most of my day building a power socket tied to a float switch to kill power to my skimmer if it starts to over flow.
I feel all engineer-y
 
That is good idea, to keep energy
 
or to keep my skimmer from flooding my livingroom with 40 US gals of salt water
fuck energy
 
7:32 PM
What's a skimmer?
 
well, yeah, consecuently you saved all
 
old receptacle: free
old fuse: free
old relay: free
float switch: 30 cents
wire: free
resistors: free
transistor: free
19v power supply: free (old laptop ps)
total cost: 30 cents and about 4 hours
@BenjaminGruenbaum protein skimmer
removes excess nutrients from the water.
in short: keeps my fish tanks water cleaner
 
Oh, I don't have one of those :P
 
salt or fresh water tank
 
Oh! for your aquarium
 
7:34 PM
lol yea
sorry, I thought I mentioned that
that top cup there, there are holes in the top of it for air.
 
"Image not found"
That looks huge
 
it's where all of the waste is deposited
it's a fair size. sits behind my tank
now the top has no 'overflow' protection unless you have a large enough bucket (and space) to drain it into. So most people just turn off the skimmer when it's getting full, remove the cup and clean it
 
@cMinor Something like:
    function gallery(element,images,time){
    	if(typeof time==="undefined") time=100;
        var index=0,len=images.length;
        for(var i=0;i<len;i++){//preload sources
        	(new Image()).src = images[i];
        }
        return function(){
        	setTimeout(function(){
 				element.src=images[(i++)%len];
        	},100);
        };
    }
 
however if you are not at home to monitor the skimmer, and something goes wrong if could potentially over flow and cause > 1/2 the tanks water to be pumped out and to the floor
 
I didn't try it out, but after that you just need to attach it to the hover event, or the mousedown, calling the result of that switches the image after 100 ms
@rlemon Ever happen to you?
 
7:38 PM
solution: cheap float and a relay to cut the power
 
that is to load the images right
 
while setting it up I had a few mishaps.
but nothing a towel couldn't clean up
 
:8226353 Usage would be something like:
 
that white stick is the float switch.
 
var loader = gallery(document.getElementById("yourElement"),YOUR_IMAGE_URLS_ARR)
 
7:39 PM
I've never seen em look like that
 
and then attach loader as a onMouseOver event
@rlemon Only time I've had to do much plumbing was when I built water cooling for my PC :P
 
I wanna try that mineral oil cooled pc
 
mineral oil?
 
non conductive
baby oil
 
Oh, afaik water isn't conductive either, just drinking water is
When I did water cooling I didn't use water, that's risky, I used purifier water or anti-freeze
 
7:41 PM
yea distilled water is not, but how 'pure' are you going to be able to keep it
mineral oil is non conductive and they claim it stays almost 100% clean
 
As pure as it gets :) My dad is a biologist, I just took some from his lab, it's cheap and he doesn't mind
 
@BenjaminGruenbaum keep it not get it
I imagine some oils from the boards and dust particles would eventually get into the water
 
Oh, well yeah, I changed it every once in a while even-though it did not leak, today I use air cooling, it's good enough.
 
yea the oil doesn't often need changing
but you cannot put HDD in oil (unless you are 100% sure it's air tight, which none are)
SSD should be fine
nothing with a read head or spinning discs would survive
 
Running a processor without cooling on top sounds really scary
 
7:44 PM
the fan and heat sinks are still there, they just push oil now instead of air
so it's actually much much better for CPU temps
 
Oh wow, I once thought about putting a computer in a cheap freezer, humidity was a problem though
 
@rlemon Is that where you keep your fish?
 
however if the oil exceeds like 75 deg C - bad things happen. The "Pugent" guys never did go into detail about what 'bad things'
 
I hear a coating of coral is good for your CPU...
 
@twiz nope, 46 gal euro tank, 33 gal standard tank, and a 10 gal standard tank.
I wanna get a 26 gal microcube
 
7:47 PM
Thats kind of an oxymoron... ha
 
^ these are micro cubes
not to be confused with the same named amplifiers
 
My fish need to feel the bass...
I don't have fish...
 
fish are awesome pets.
you get to look at them
they don't bug you
they don't beg
they make no noise
 
My dog is awesome, every time I come home he loves to see me :)
Even if I left for just a minute
 
yea my cats are like that.
but i'm like... shit thats why I got a girlfriend.
 
7:49 PM
cats are so independents
 
cats and expensive fish seems like a bad combination...
 
I hope you don't have sex with your cat
 
@rlemon grats
 
but dogs take too much attentions (i have one)
 
7:50 PM
@twiz in fact they are! my one cat likes the tanks (other doesn't seem to even notice them), so I made him a little chair and he sits in front of the tank watching the fish for hours on end.
 
Does anyone any video;s for jQuery tutorials
like nuggets
 
That's a sofa
 
apartment + no back yard + work 8am -> 5pm then hour commute === no dog for me :(
 
Last one
@Zirak Actually, that's a picture of a dog on a sofa
 
7:51 PM
I know I could pull it off, maybe pop home at lunch to walk him - but it would be cruel
 
That's not my dad, that's a cell phone, man, you think I'm stupid?
I work a lot and my wife works a lot, but we keep a perfectly happy dog, it's just a lot of work
Then again, it sounds like your fish are a lot of work
 
my gf doesn't drive - I would have to be home every ~3/4 hours to walk him during the work day.
ohh yea the fish are a LOT of work and expensive as shit.
 
@rlemon do you know any nuggets for jQuery
 
^ he was like $30
and he's only a half inch.
 
@BenjaminGruenbaum OOOOHHHH
 
7:53 PM
So I felt like making something crazy... traviswimer.com/video_editor
funky things happen though....
 
@Zirak This humor is FUN!
 
^ he was like $50 bucks
again, bout inch long - grows to 2 inches
 
How long do they live for?
 
What're their names?
 
few years
@Zirak haven't named them yet. but they are a blue clown goby (yes he is green but that is his name) - and the bottom is a sixline wrass
need to figure out names for them
I have two green spotted puffer fish named 'Tony', and 'Pooper'
a newt named Mr . T
my cats are Rocky and Bullwinkle
 
7:55 PM
Mr. T is an awesome name for a newt
 
!! s/awesome/mind blowing/
 
buncha guppies but they are feeder fish so I don't bother naming them
 
@Zirak Mr. T is an mind blowing name for a newt (source)
 
I know someone who had a giant tortoise named Mr T.
 
well it was Mr. T or 'Ned'
 
7:56 PM
@rlemon hahaha, nice
Rocky and his Friends, right?
 
WOW, Am Being Ignored !
 
I need another monitor :/
 
You're making it harder and harder
 
@Zirak well I usually just refer to them as "Moose and Squirrel"
 
Anyone here had any success with linux + 3 monitors on intel graphics card and amd graphics card?
 
8:00 PM
why is my tv-signal always screwing up when there's football on, and not on any other day where there are tv-shows that noone wants to freaking watch?
 
@BenjaminGruenbaum linux on two monitors, but never three.
and with a nvidia card no less!
 
@MuhammadRaja just google jQuery.... there is a ton of stuff out there to learn it.
 
The problem is getting them to run on two different graphics cards from two different vendors :(
 
however I have NEVER gotten my display drivers figured out on my rpi
 
@MuhammadRaja Not to mention, if you know javascript it should be really easy.
 
8:01 PM
@BenjaminGruenbaum ohh, yea you'll need to hack it to run a new x session for each card
 
@twiz I know there are, but I was looking for recommendations :D
 
unfortunately this is the only way afaik.
 
I don't want a new x-session for each card :/
I guess my best bet is to wait for the next ubuntu where they're dropping x
 
@twiz I had that discussion with rLemon like an year ago lol
 
I spent a while trying to do just that, two cards.
 
8:02 PM
@MuhammadRaja $(querySelector) - that is 90% of what you need to know about jQuery haha
 
@MuhammadRaja basically: look into how to write proper js. then apply that to jQuery
that + the official docs is all you need
 
should use getelementbyID @twiz not query selector
 
querySelector in that context is a variable containing your selector string
and qsa is to be used for complex selectors
 
single selectors, not so much
7 hours ago, by rlemon
The poop came back, the very next day. The poop came back, we though he was a gonner, but the poop came back. He just couldn't stay away. (he stinks).
 
8:04 PM
Loooool he does stinks
 
I have a drag/drop type thing using mousemove, and it leaves a 'trail'... anyone ever seen this before?
as in its like a graphics glitch ha
 
@twiz i have no idea, and dudes here are not so good as me on js
i'm sorry
 
@twiz chrome + linux correct?
 
@rlemon chrome + windows
 
8:06 PM
hrm, there were artifact issues with animations in Chrome on linux (but not Chromium surprisingly)
are you on Canary or stable?
 
stable
 
link?
 
Before you try to actually solve the underlying issue, did you try to uninstall and reinstall ?
 
uhh well you'll have to have a video file to see it. ha
 
8:07 PM
 
looooool
u my best chat friend dude!!!
 
@BenjaminGruenbaum you mean uninstall chrome?
 
Seriously, why I don't flag the shit is beyond me.
@twiz yes, and then re-install
 
but my extensions.... :-(
 
lol
It might be one of them
 
8:08 PM
shit....
you could be right haha
 
C:\Users\<Current User>\AppData\Local\Google\Chrome\User Data\Default
\Extensions\<Extension ID>\
^ backup your extensions
 
@rlemon not sure if chromium and chrome share animation - modules
 
Nice, did not realize it was that easy.
 
Does uninstalling in windoze remove everything?
In Linux it doesn't
 
@copy depends on the uninstaller ;)
 
8:09 PM
at least stuff that's done on the GPU is not shared between WebKit - browsers
 
cant say I've ever uninstalled it before
 
should remove program files but not dependencies
 
I mean configuration etc.
 
damn... wordpress create so much shitty code
 
but re-installing might nuke the configs
 
8:10 PM
man this game work has me working is SOO LAME
 
@Loktar I can make it rain boobs?
spice it up a bit
 
seriously, why does my tv hate me that much? ;_;
 
"You have hit the top level... here are some boobs"
 
hmm I'm just gonna try it on canary....
Well the animation works in Canary
 
@copy Usually not, users are prompted about it often in the final stages of uninstallation
In the windows store configurations are maintained
 
8:13 PM
Since I'm just dickin around making random stuff, I'm saying screw it...
 
CoffeeScript sucks
 
Hi, user1909612.
EPIC TIME TRAVEL
 
hello everyone
i am building an aspx based chat
but i have problem handling message receiving, anyone willing to help ?
 
@rlemon make it rain BOOBS!
 
Receiving on the client?
 
8:21 PM
the client is on my syte
 
@copy @ThiefMaster Can a python methdod override itself?
 
Duh. Now continue...
 
chat.aspx sends and receive messages using ChatService.asmx, soaphttp stuff
 
For example
def override_me():
   override_me = (lambda x: x)
   return 1
 
i made a winform application that makes use of the same web service, it works proper and i can even read what i write from the web, problem is it doesnt work the other way around
 
8:23 PM
I wouldn't know why not
But you have to write global override_me
And it works
 
No way without global variables?
 
@BenjaminGruenbaum: if you can get access the scope containing the function then yes
if the function is global, using global override_me and then assigning to it is the way to go
if it's in a class, assign to self.methodname - but don't just assign a plain function; you need to bind it to the instance in this case
 
has anyone ever worked with a RTOS before?
if you have and it was QNX4, my god I need your help :P
 
I'd like to cache the list if I already got it from memory
 
eh, why not use a memoization decorator?
 
8:26 PM
(that code is wrong btw)
@ThiefMaster how would that work?
 
Can I import it from somewhere or do I have to have that class class memoized(object) in my code?
 
yeah, you'd put it somewhere in your code
 
(python 2.7.3 by the way)
 
QNX4, ten machines (identical hardware) all plugged into the same testing station which applies power to them at the same time. Their power indicator lights all turn on in sync, however their hdd activity lights are not in sync for the first hdd read. Why is this? in some cases it's almost a full second behind other boards.
 
8:29 PM
It appears that it's built in in python 3.2 +
 
they all have the same CF cards, with the same image clone on them
in essence, they are all identical machines acting differently.
now I have noticed the lag on boot is random and sporadic, which leads me into thinking it's something with QNX itself. but then, wouldn't the first HDD indicator be in sync and the rest past that not be?.
 
def get_stopwords(filename):
    with open(filename) as stop_file:
        words = [stop_word.lower().strip() for stop_word in stop_file]
    get_stopwords = (lambda: words)
    return words
 
damn, I average 2K messages in the chat a week
:(
@StackOverflow, please stop keeping these metrics. They are depressing.
 
This doesn't work, I'd rather avoid a whole memoize decorator for doing this once
 
@BenjaminGruenbaum but that is really ugly. My first idea would be to make a class with one static variable
 
8:34 PM
@copy Why would I need a class for functionality?
 
Python doesn't have static variables (like PHP or C) and scope management isn't as good as JS
 
@jAndy how did you find out how many messages total I have sent?
nvm, found it
damn.
 
@copy (the concept of) static variables never made sense to me so that's OK :)
 
Yes, but that's what you want in this case, right?
 
How would you implement it
No, I'd like a function that changes after I got the initial result so I could avoid an additional IO call
I'd like it to override itself
 
8:36 PM
my god, I think I have the most activity in this room overall :/
 
That's worse than static variables
 
If the function call overhead matters, python or any other scripting languages is the wrong choice :)
 
It doesn't, the IO matters
I don't want to read the file again, I'd like to cache it, but I only need to do so once
In JavaScript it'd just return a closure on its former self
 
Yes, but you wouldn't overwrite the function in JS, would you? You would store the result in a variable in a scope
 
@ThiefMaster there should be a 'chat rep' system
 
8:37 PM
well, memoization is the cleanest way to do that
 
use your mod powers and make it so!
 
in python3 you could use nonlocal to write to the parent function's scope
 
In JS I could do

var me = function(){
    var heavyCalc=heavyCalculation();
    me = function(){ return heavyCalc; }
    return me();
}
Or something like that
 
> Agh! A downvote! DELETE! DELETE! EXTEEEERMINATE!
^ noobs
 
I'm not saying it's very pretty, I'm just wondering how it's possible in python
 
8:39 PM
yeah, nonlocal me would allow you the same thing in python (3)
 
Would you mind writing this function in python? (the me function, not the io one)
 
I've become aware of my activity on SO Chat JS room: 75.6k posts overall. There has to be some sort of prize or badge or something for this.
^ @ThiefMaster badge for 100K posts in a single room
make it so!
 
@rlemon suggest in Meta
 
@BenjaminGruenbaum I would do it like this in JS
var me = (function()
{
	var data;

	return function()
	{
		if(!data)
		{
			data = heavy();
		}

		// do something with data
		return data;

	};
})();
 
I wouldn't use !data to check if data is undefined, but I get your point, I guess I can do it like this in python
Probably a class is the best solution in the python case if I don't want to use the memoize decorator
It just seems less expressive in this scenerio
Since I end up using a class for what a function should be doing
How would you do it in python if you were not to use the memoize decorator?
 
8:44 PM
Uuuuuuuuuuuuuuuuuuuuuuuuuuuuuugh. http://t.co/xfYGvMJSof
lol this guy found the hipster king
Lord of the Hipsters we'll call him
also, if you guys are not following Curiosity Rover, you should. He is funny as hell.
I was sent to Mars to find evidence of past habitable environments. Achievement unlocked! [info & images] http://go.nasa.gov/12MeiIS
2
Cheevos
 
class StopWord:

	data = None

	@staticmethod
	def fetch():
		if StopWord.data is None:
			StopWord.data = something()
		return StopWord.data
Sorry for tabs. And I'm still not sure if it's the best method. Decorators are probably better
 
Javascript isn't a real language
 
@rlemon ha where did you find that?
 
Just to be clear, in python we don't have private variables because we're not four, right?
 
8:56 PM
Same as JS
 
Great :)
(correct design imo)
 
md0 : active raid6 sdi1[6] sdh1[7] sdf1[4] sdg1[3] sde1[5] sdd1[0] sdc1[1] sdb1[2]
      5860549888 blocks super 0.91 level 6, 64k chunk, algorithm 2 [8/8] [UUUUUUUU]
      [>....................]  reshape =  0.6% (9953248/1465137472) finish=1419.1min speed=17089K/sec
/me yawns
 
That's like a day :O
 
yeah.. growing from 6 disks to 8 disks (a 1.5T)
 
Why would you need 8 disks?
 
8:59 PM
because i didn't have any space left
 
He's writing a lot of code
 

« first day (878 days earlier)      last day (4075 days later) »