« first day (2310 days earlier)      last day (2635 days later) » 

11:00 PM
ok, no problem :P
so I back to js chat, maybe someone will be there too :P
 
hmmm... is there a way to "daemonize" aerys, so I can close my terminal and still have it running on my remote box?
hopefully something else than custom bash scripts :D
 
@FĂ©lixGagnon-Grenier nohup?
Or supervisord.
actually - forget the nohup. Just use supervisord
 
:) supervisord looks just like the thing, gratie
 
y u no just make service?
 
hmmm... wat u mean? like systemctl stuff?
 
11:12 PM
well what OS are you running? something with systemd?
 
freebsd
(was only flaming with systemctl)
 
/me knows nothing whatsoever about freebsd
 
well, this here seems to make sense about how to use a service
but as far as my understanding based on the three last minutes go, supervisord seems like a... service manager of kinds?
 
Basically for any given daemon I expect to be able to type service myapp start and have that do what it implies
Exactly what is required to make that work is heavily OS dependent
I believe init scripts are still considered a valid approach though, and they are certainly lowest common denominator
 
Anyone got advice on how to keep data consisten between PHP and jquery Data attribs. Eg how when you use the .data() method of jquery, it camel cases and removes hyphens...

So with that in mind, anyone got recommendations for keeping things consisten
 
11:17 PM
Use camel case without hyphens in your HTML then
or is there something I'm missing?
 
@DaveRandom I have a form that looks like this:

<select name='foo-bar'>
</select>
 
OK so something I would say is that I would never use a hyphen in a name, for anything anywhere
 
and on change of said select, i wanna take the name eg: foo-bar and use it to set an attrib on a dom ele. SO $(ele).data('foo-bar', val);
and of course that works.... But it becomes a nightmare to correlate that when passed back to php via ajax cuz it then camel cases the attribs
 
@DaveRandom you're gonna hurt @FélixGagnon-Grenier's feelings
 
Can't you just change the element name to fooBar?
 
11:20 PM
soo foo-bar becomes fooBar when passed back via ajax
 
or foo_bar
 
Wow, git is messing up on me rather weirdly
 
@PaulCrovella :-P
 
@DaveRandom would using camel case really be best case?
 
I make a change to a file, commit and the entire file changes to presumably a different commit with my modifications
 
11:21 PM
so wait a sec
 
@PaulCrovella hehe. Damn
I am happy my name is not GagnonGrenier
 
@Hybridwebdev well casing doesn't matter so much as not using hyphens
 
if im not mistaken, $(ele).data('foo-bar', val); would be the same as $(ele).data(fooBar, val)'
 
hyphens are not a valid character in an identifier in PHP or Javascript or any vaguely C-like language, I can't name a PHP variable $foo-bar
 
I believe you are mistaken
/useless-rant
 
user6061856
11:22 PM
And you want to convert foo-bar to fooBar in jquery?
 
well then, for consistency camel casing would not be option because you'd need to use "foo-bar" to trigger data changes but use fooBar for actual data
 
What do you mean "to trigger data changes"?
 
Wes
@DaveRandom class="welcome__to--css"
 
eg on <select name ='foo-bar'>

$(select).change(function(){$(some_ele).data(this.name, this.val);
 
fooBar is a valid name
 
11:25 PM
<select name='fooBar'>
problem solved
or <select name="foo_bar"> I suspect would also solve the problem
 
@DaveRandom but then is i use this.name (fooBar)

then in reality we'd be setting $(some_ele).data(fooBar, val)
 
user6061856
@Hybridwebdev Why not just keep it fooBar instead of changing it with jquey? Makes no sense.
 
@Hybridwebdev why does that matter?
 
because .data(fooBar, val) still isnt consistent because .data(foo-bar isnt the same as .data(fooBar)
 
Yes but if you never use foo-bar anywhere that doesn't matter
 
user6061856
11:27 PM
@Hybridwebdev That is overly confusing.
 
oh
doy, I get it now
 
:-P
 
<select name='fooBar'>
 
user6061856
yes
 
make sense
 
user6061856
11:28 PM
You are were making it overly complex.
 
right, although as I say I suspect that swapping the hyphen for an underscore would also work
(and potentially make it easier to find/replace in existing code)
 
@DaveRandom no because <select name='foo_bar'>

would result in $(ele).data(foo_bar)
because again, remember im using the select name as the attr
 
yes I think that would still work though
 
i'll check
 
the point is that you should use the same form everywhere in your code
it doesn't matter what that form is as long as you are consistent and it works everywhere
using hyphens in names is a good way to make it not work...
 
11:30 PM
$('body').append('<div class="foo"></div>');

$('.foo').data('foo_bar', 'test');

console.log($('.foo').data());
 
works for me
 
Objectfoo_bar: "test"proto: Object
nope
$('body').append('<div class="foo"></div>');

$('.foo').data('foo_bar', 'test');

console.log($('.foo').data('fooBar'));
results in undefined
 
yes it will
2 mins ago, by DaveRandom
the point is that you should use the same form everywhere in your code
Pick ONE
2 mins ago, by DaveRandom
it doesn't matter what that form is as long as you are consistent and it works everywhere
 
no, im merely stating that using the _ wont result in the same consistency. Seems to be consistent camelcase is the only way to go
 
Wes
<- has just realized he wrote tons of wrong code
 
11:33 PM
@Wes we all do :P
any dev that claims to only ever write good clean code is a liar
 
@Hybridwebdev why do you need it to work with more than one form?
 
user6061856
@Wes Yep, that's why I hate going through my old projects. Makes me want to pull out my hair.
 
under what circumstance do you need more than one form to work?
 
i suppose it's good to be reminded every so often why we don't typically entertain jquery questions here.
 
@DaveRandom I'm trying to construct a data model .... Im doing some tricky stuff with ajax and dynamic forms and what not, and need the data names to follow one consistent format
 
Wes
11:34 PM
jquery, get a room!
 
so that, eg on server side, i can access $_POST['fooBar'] or something along the lines
 
Wes
!!should i try to fix or start over again
 
You should try to fix.
 
user6061856
IDK why but the javascript room is not very active.
 
Wes
!!are you sure?
 
11:35 PM
js is never active :P
 
Wes
!!are you sure?
 
No.
 
5 messages moved to bin
 
Wes
@Jeeves eat a d*ck, jeev.
 
!!eat a dick
 
11:37 PM
!!is you is or is you ain't my baby
 
If I am trying to run a select query that would select 100 rows on a table with > 1 million records (would be relations table) via MySQL and PDO, would that take a long time?
 
is the database indexed?
 
It has an index key yes
You mean to ask if the table is indexed? as in, if it has columns "AIKey", "Relation1", "Relation2"?
 
11:47 PM
Yes it is set up as that
 
why not just create a test table and run the query
 
Good idea
 
and formulate optimization around results
 
I just didn't want to add > 1 million rows for right now haha
 
create a dummy table and insert data
IMO best tests are done with real world scenarios
but i'd venture a guess that unless your query is trash, or your sql db isnt optimized, then no running a 100 row query wont ever be overly slow
 
11:49 PM
depends on your query
depends on your hardware
depends on your context.. like. how long time is long time?
Its very ambiguous
 
@RonniSkansing agreed, thus my recommending testing with an actual unit test
 
depends on timing, how many are doing it at the same time, which other operations are running
thats not a unit test
 
@RonniSkansing if the db is cached, the same query run multiple times wont impact speed
 
unless NO_CACHE ?
 
@RonniSkansing and unless 1 million other things...thus....test
 
11:52 PM
Im just saying the question was formulated in way where alot of different answers (even conflicting) might be correct or incorrect depending how it is read
 
arent 99% of all SO questions ambiguous
 
heh. btw I think it's a great suggestion to just ask them to run the query
 
"How do I PHP?"
what's better...php or python
etc
 
Does the size of the table not matter for speed? @Hybridwebdev
 
@Alesana to a degree, thus why your question is so ambiguous. At a million rows, i'd personally think about restructuring or splitting your data tables
 
11:54 PM
It's relations though I don't know if it can be split
Relating countries to offers
 
@Hybridwebdev that's a silly suggestion.
 
@Danack explain why
 
I am going to run a test with 10,000 offers each with 250 countries... so 2.5 million rows. Let's first see how long it takes to add them :s
 
because you should design your data to be the simplest solution to the problem, and then use the correct technical to retrieve it, rather fucking around with different data designs.
 
@Danack yes. But in scenarios where scaling is required. I mean, splitting rows is no biggie, just use a left join
 
11:57 PM
@Alesana It really depends on what query you are running, as to whether it will be slow or not. I'd strongly suggest just designing the data storage correctly to begin with, waiting to see if it actually is a problem and then pumping any queries through either elasticSearch, Neo4j or other 'fast' search engines, depending on the exact cause of why it might be slow in SQL.
 
splitting tables i mean
1 think I could recommend is if you're querying something that's going to have 1 million rows, just keep the data your going to be querying against in a single column, and then use relational tables to store the other stuff that you can use a join or separate query to get the rest of the data
 
I don't understand your suggestion @Hybridwebdev, you're suggesting have make a table have a max of let's say 300,000 rows and then once it is full create a new relations table, then when querying for relations just query each relations table? I would think that would be even slower
 
@DaveRandom what OS are you using in Docker?
 

« first day (2310 days earlier)      last day (2635 days later) »