« first day (2353 days earlier)      last day (2595 days later) » 

9:52 AM
@ndugger wut, I thought you said target
 
haha
 
I don't even
 
it's funny to look at emails that I received when I was year 1 in college
I borrowed a book Introduction to functional programming using Haskell
and probably had no idea
about its content
just borrowed it because it sounds cool
 
10:22 AM
@ndugger I think the final solution comes at least as a close second.
 
starting with Angular 2, used a CLI to build a new project, how do I integrate bootstrap css files ?
  "styles": [
    "styles.css",
    "node_modules/bootstrap/dist/css/bootstrap.min.css",
    "node_modules/bootstrap/dist/css/bootstrap-theme.min.css"
  ],
But thats not compiling
ERROR in multi ./src/styles.css ./src/~/bootstrap/dist/css/bootstrap.min.css ./src/~/bootstrap/dist/css/bootstrap-theme.min.css
how can I stop it from looking inside the src folder ?
or should I install bootstrap inside src folder
 
10:54 AM
@towc am I not allowed to have personal projects?
 
no.
 
K
 
well, it looked too good for me to think that you did that by yourself :P
 
I've been working on it in my free time for a couple of months now
 
@Zirak Wow, that's a really neat word! How'd you come across that one?
 
10:58 AM
@JennaSloan That's not true, btw
if (!foo) is not equivalent to if (false == foo)
(eg. when foo is undefined)
 
user6845426
11:33 AM
Hi guys
 
11:46 AM
Hi
 
@MadaraUchiha you have been using ng2 for a while now, how would u structure ur project ? would u put front dependencies inside src ?
 
@FlyingGambit I have never used ng2 in production or otherwise.
And no, dependencies and packages should not be in src, generally.
 
user6845426
I have a form an ajax request which loads a php script to handle the data
 
You should bring them from npm and have your build process bundle them for your app
Or, alternatively, externally from CDN.
 
user6845426
$(function(){
            $('form').on('submit', function(e){
                e.preventDefault();

                $.ajax({
                    type: 'post',
                    url: 'ProjectUploader.php',
                    data: $('form').serialise(),
                    success: function() {
                        alert('Project successfully created.');
                    }
                });
            });
        });
 
user6845426
11:51 AM
How do I explicitly reference form fields?
 
What browser support do you need?
 
user6845426
me?
 
user6845426
Sorry I don't know what you mean xD (total beginner)
 
@dipper Do you need it to work in IE? Mobile Safari? Just Chrome? You don't care?
 
11:54 AM
@MadaraUchiha It is for a case investigation system and they don't want anything from CDN and I have seen that earlier in some online projects people use bower for frontend libs like bootstrap. I think thats not necessary and we can use npm instead
 
user6845426
Screw IE xD Ideally chrome/firefox
 
@FlyingGambit bower is dead, and has been for a couple of years now.
Don't use bower in new projects.
@dipper See about FormData and Fetch
Drop jQuery ASAP.
 
@MadaraUchiha I see, thats good, so now I have put boostrap lib in my node modules. I think I am heading the right way then
 
This chat reads like @MadaraUchiha is machinegun-firing advice right now
 
user6845426
Whats wrong with jQuery?
3
 
user6845426
11:55 AM
Out of curiosity
 
@dipper jQuery was written at a very dark time for the web
@OliverSalzburg Baking soda would get those tough stains right out.
 
user6845426
Oh I always loved JQuery xD
 
@dipper jQuery was written at a time where the DOM API (JavaScript interacting with the browser) was extremely inconsistent between browsers and even between different versions of the same browser (I'm looking at you, IE!)
jQuery provides a nice API that hides the DOM's ugliness
 
Now it has become the ugliness
 
11:57 AM
As for why dropping jQuery, if you don't need IE9 or so, the DOM isn't that ugly.
And jQuery isn't really worth it anymore.
 
user6845426
Ah, interesting
 
user6845426
I'm looking at Fetch now
 
> If you dance with the devil, the devil don't change. The devil changes you.
 
@OliverSalzburg If you pee on the system, the system gets wet. If the system pees on you, you drown.
2
 
11:59 AM
I didn't even know that quote was from 8mm TIL
Good that I got out of bed today!
 
12:35 PM
If you put a page in production, you can't be sure what browser customers will use. Hence jQuery.
 
1:32 PM
Only if you have to support legacy browsers
Modern ones have normalized pretty well
 
2:03 PM
Is there anyone available?
 
@AndroidGL Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
If your page is popular then of course there will be some traffic from 'legacy' browsers. And when it breaks the user will not know why. 'What, crappy page...' and move on. You just lost a customer.
Or at least have fall-back to a non-JS version for unsupported browsers. I guess you should have that anyway if you're serious about accessibility. I frequently use gmail HTML version when the connection is unreliable.
 
2:22 PM
but IE11+ is very common. We're talking about a few percent of people with potential issues, and those could be solved with a few more lines of code. jQuery stopped being useful back around IE9, which was many years ago.
 
According to some charts IE6,7,8 and 9 are still a sizeable chunk of traffic. Of course you can look at your own visitors charts, but if you have poor support, then those users just won't use your site.
 
A recent chart?
IE8 is up to 3%, but only with some types of user
Supporting browsers older than* IE9 is very costly. Many modern JS libraries and tools are not available. It's a poor business decision to handicap your development by supporting yesterday's browser that is barely used now and shrinking.
And this is being conservative. I, and others I know, all support only IE11+
 
Give a fall back to plain HTML or something. I hate it when I visit a page and it doesn't work. If your visitor is a grandma she doesn't give a shit about browser versions or development practices or whatnot.
 
Yeah, the small percentage of IE users have to make up quite a lot of people for them to become relevant
 
you should help your grandma keep her pc more up-to-date.
"fallback to plain html" means making a whole second site. That's not practical.
 
2:31 PM
That's what gmail does. It works fine and is practical.
 
Let's talk again when we have as many users as Gmail
 
google is a much larger software company that your average. Most sites are mad by one person, maybe a small team.
 
Yes, and it shows. When I visit sites that assume one browser it is really annoying. And I'm not a non-techie users. What will the non-techie's think? They'll just say 'hey this is crap' and move on.
 
If a user is on windows XP with IE8, I don't care what they think.
 
Techie users may want to disable javascript altogether. What then? gtfu?
 
2:34 PM
I don't want their virus infected pc talking to my site anyway. :)
 
Hi bothers
hi brothers
 
Um, yea. Disabling JAvascript is something you did in the 90's before proper browser security
 
a question
 
Now, all sites need it. It's unreasonable to use the web now without javascript.
 
the above query gives the result fine
But when i want to get the result in an application
like this
MessageBox.Show(""+database.CustomSelect("SELECT TRIM(TRAILING '0' FROM avg(nullif(q1, 0))) q1 FROM feedbackresult").Rows[0][0].ToString());
 
2:37 PM
I think it's unreasonable to offer a page without supporting standard HTML. If I visit your page and I can't read it using Lynx, it is broken.
 
it shows
i dont show the result
 
Of course you could write something like "Sorry for this page you need JavaScript!!" at least show that information.
 
waht is wrong?
 
@Brandin So you feel no new features or advancement can ever be done, since your ancient text-mode no JS browser won't supprot it. You can't hold the world hostage like that.
I also don't need to support MS-DOS or make sure programs fit on a floppy disk
 
No, it's about accessibility and reasonable support. Windows apps still have enough DOS support in order to say "This program requires Windows" and exit. It's a similar idea. There's no extra cost to include that boilerplate.
 
2:41 PM
If you use lynx, but don't realize that the reason 99% of modern websites won't work is that you don't have JS, then a message won't help.
The only people that don't have JS are those that went out of their way to disable it.
Should I play a sound in case they turned their monitor off? :)
It's been a decade since disabling JS made sense.
 
Well to each her own I guess. I love disabling JavaScript sometimes. And others I love keeping it on. Good sites degrade nicely without it (e.g. Google) and crappy sites just get broken. So I know which are crappy quite easily.
 
You know which can't afford double development.
I don't appreciate being called crappy since I don't have the resources of Google.
 
@Brandin That is idiotic. That's like deliberately turning your monitor to black and white just to see if a website is crappy because it has weird contrast or something
 
It's just what I call it. Others will have a different opinion, like if they get a JavaScript error or you've got a network timeout and it didn't work. They won't use the word crappy. They'll just say 'hey this shit's not working' and leave.
 
And bringing "I disable JS in the browser" to the JavaScript room makes you appear like a massive troll
 
2:49 PM
With that timeout analog, that's like calling it crappy after yanking out the network cable. :)
 
@Brandin "Good" websites like Google do it because it's worth it to them
Because the 0.01% of nojs traffic brings Google enough money to make it worthwhile
Also, Google's UI does not require JS in any way.
 
If I was running a website for right wing "live off the land" nuts, I would make it work without JS.
Also left wing "live off the land" hippies, to be fair.
 
For websites where exactly 3 visits per month are from nojs, it's not worth the money catering.
Just like I wouldn't cater to IE6 and Google would.
 
It's about accessibility. Analogy is a store with steps. Sure, it's "double development" to build a ramp, but if you don't do so, visitors in wheelchairs just won't come to your store. They won't complain, either. They just won't come.
 
And if your product is tech-based. Say.. some SaaS. Then just go all modern browsers only.
 
2:53 PM
Personally, I would want all visitors to be able to visit my store. If you want to say 'screw you' to such visitors that may be a valid business choice.
 
@Brandin Would you spend $100,000 renovating your storefront just so that 1 extra person could get in?
 
The only "ramp" that'll let someone in IE6 with no JS to run a modern HTML 5 is a new browser.
 
It's about what's economically feasible, if it's worth it, a company would. If it isn't, they wouldn't.
My previous company had 50 billion requests/mo, IE8, with all 0.02% usage was totally worth the traffic to maintain.
Hell, I'd write the IE8 support in Brainfuck for 0.02% of the profits my previous company makes 😀
 
But what if the user has brainfuck turned off? j/k :)
 
@Luggage By definition, no user has brainfuck turned off.
Ever.
 
2:57 PM
true
@Brandin I can agree that any site for the public should have a "your need x browser to use this site" message, when possible.
 
> if your site doesn't work in lynx, it's broken
Obvious troll
 
troll-ish in it's extremity, but he discussed and didn't try to anger anyone. I don't think it was a troll. If so, not a good one.
 
It's either a troll, or his opinion is terrible
 
I think his opinion is terrible. :)
 
3:03 PM
Isn't lynx a type of cat?
 
@xgqfrms Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
@JennaSloan Yes, it's like cat, but it displays links in blue
 
nice
 
Luggage - Can you help me here ? I want to create one big JS file and not two accroding to the entry point. But How can I do it ? they don't have any relation
entry: {
        "main": "./src\\main.ts",
        "polyfills": "./src\\polyfills.ts"
    }
The commonchunks plugin is not going to help me here IIUC
 
Then just list main only as the entry point and have main require('./polyfills')
 
3:13 PM
Only to put require('./polyfills') at the beginning of the main.ts ? Thanks a lot.
 
// alternative:
entry: {
    "main": [ "./src\\polyfills.ts", "./src\\main.ts" ]
}
Then you might not need require('./polyfills') (if it doesn't export anything you want)
 
@Royi Don't use require()
import './polyfills.ts'
 
* from ?
 
@Royi I was under the impression that polyfills doesn't export anything
 
I actually meant require() in the generic "whatever module loading system you prefer", but yes. I agree.
 
3:16 PM
It just augments the global functions?
@Luggage Well, you're using TypeScript, you use TypeScript's module system :P
 
I do, yes. I wsn't even thinking that when I answered. I was jsut thinking webpack only
 
@Royi What kind of polyfills are there in polyfills.ts?
TypeScript includes most of its own polyfills
 
I think shims etc. let me remove it and display the errors
 
And you can emit all the way back to es3 if you want
 
Yes, typescript complains about my import Promise from 'bluebird';, annoyingly
 
3:19 PM
When I do this ------> //import './polyfills.ts' I get main.bundle.js:1 Uncaught reflect-metadata shim is required when using class decorators
(ng2 with ts)
 
backs away slowly
 
guys a question...
 
@Royi Add import 'reflect-metadata'; before that.
 
what is wrong with this convertion?
 
3:20 PM
@HamreenAhmad IS this the same one from an hour ago?
 
SELECT CONVERT(DECIMAL(10,2),avg(nullif(q1, 0))) q1 FROM feedbackresult;
 
I didn't know ng2 had a dependency on that.
 
no bro
 
What's the error, Hamreen?
 
in what i want yes
but another way
 
3:21 PM
Madera & Luggage - Like you said , I imported the polyfills
And then you asked me what are those polyfills . So I removed them to see the erros it yields
 
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DECIMAL(10,2),avg(nullif(q1, 0))) q1 FROM feedbackresult LIMIT 0, 25' at line 1
 
@Royi Yes
 
I want to convert the result of the AVG
 
@HamreenAhmad Why?
 
And when I removed the polyfill - it showed me reflect-metadata shim is required when using class decorators . That's all
 
3:22 PM
because its too long 1.1234565......
 
@Royi Ah, OK, fair enough
@HamreenAhmad Too long for what?
 
:) Thanks
 
HamreenAhmad I think maybe you really want to format the result, not convert to another type.
 
@Royi So does it work with the polyfills imported?
 
import { Component } from '@angular/core';
import { NavMenuComponent } from './nav-menu/nav-menu.component';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
  directives: [NavMenuComponent]
})
export class AppComponent {
  title = 'app works!';
}
 
3:23 PM
Yes. ( if I remove it - it yields an error)
and Now I have one file - as I wanted. Thank you
 
Could anyone tell me whats wrong with the directives ?
 
@Royi Huzzah!
 
Hi, im trying to do an ajax call where is gets info every 10 seconds or so, ive written some code for it but im inexperienced, would someone be able to guide me if i show them the code?
 
@FlyingGambit Seems ok
 
The compiler spits out an error saying "Argument of type '{ selector: string; templateUrl: string; styleUrls: string[]; directives: typeof NavMenuComponent...' is not assignable to parameter of type 'Component'.
Object literal may only specify known properties, and 'directives' does not exist in type 'Component'.)"
I am scratching my head here
 
3:24 PM
@Luggage Format(Cast you mean?
can you write the order with the example i have shown?
 
@HamreenAhmad I'll ask again
Why do you want to convert it?
Why do you care if it's long?
 
You want FORMAT() to be passed the result of AVG. You do not need CAST.
If you are trying to format for reading, like I assume you are.
 
I'm assuming that you want to display the average somewhere
And that the number doesn't fit
Right?
 
@MadaraUchiha
for that its too long with in the table
 
@HamreenAhmad Right
 
3:26 PM
look at the last column
 
So you don't want to format the number as it comes out of the database
You want to format the number before you put it in the table
 
If you want a string then format(). If you want a number then round().
 
but round dont give exelent value of the AVG which i want
 
Or, yes, do it after you get the results from the databse can be best.
 
i know
 
3:28 PM
Like Madara said
 
But i want DBMS do this not the c#
i dont want make the App heavy
 
@HamreenAhmad No you do not.
 
It won't.
 
This is not the job for the RDBMs because you are still doing things with the number besides displaying it
 
Let the database worry about the data, you c# worry about how to shape and display it.
 
3:29 PM
Also, string/number formatting isn't what makes your app heavy.
Also, by the way
@HamreenAhmad This is the JavaScript room
 
I know bro but sql room is dead
 
C# room is here
 
i know
but its about sql
not c#
 
@HamreenAhmad And we're both telling you it's definitely about C#.
And not SQL.
You should not be doing this with SQL.
You format at the last possible moment, not right as it comes out from the Database.
Else you lose all of the precision, and you lose the ability to do any processing on your data.
 
there are a lot of libraries in c# land that just show you passing them the result of an sql query, setting some properies, then BAM a chart/table.
 
3:31 PM
Which is the entire point of pretty much any application.
@Luggage I can imagine.
 
So, while you are right that c# is the place for this, it may seem like a lot more work if he's not doing that, yet.
I am making some assumptions here.
!!afk Factorio
 
Could someone help me with this , I am new to angular 2 and kind of stuck with adding a new component to main component chat.stackoverflow.com/transcript/message/36314653#36314653
 
@FlyingGambit I think the error is pretty clear.
The type "Component" doesn't have a "directives" property.
Even though you tried to pass one.
 
yeah but the guy in the tutorial is using it and it works for him
 
@FlyingGambit Then the guy in the tutorial is either outdated, has a bug, or lying.
Most likely.
It's more likely than the compiler having a problem, anyway.
 
3:44 PM
then what is the correct way to add a component ?
should I be using providers instead
 
@FlyingGambit I'd go and look at the official documentation, rather than a tutorial someone wrote who knows how long ago.
Angular is pretty well documented.
 
got it , there aint any directive property angular.io/docs/ts/latest/api/core/index/…
 
Thanks for yours @Luggage @MadaraUchiha
 
Would someone be able to tell me why this isnt giving me anything in the console?

	<script>
	function ajaxcall(){
				$.ajax({url: "functions/ajaxtest.php",
					success: function(data) {
					console.log(data);
				}
				});
			}
	</script>

    <?php
        echo json_encode("hi");
    ?>
 
use the failure function too
 
3:50 PM
@RachelDockter you gotta call the function
 
iam not javascript expert But is the color of the text and the color of console not the same?
 
also check for network errors
 
4:12 PM
hello
 
@NeonEmmanuel Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
Hello Every one i need your help ! i am trying to create create a javascript code that and here is the ideal if any one could contribute to it.

its like a social media, when users enter the site the is_user_logged_is parameter is loaded - its a function that checks if users is logged in, (don't bother about this).

i created a code that when non-registered users enters the site they could scrool down to view item in the page, however when user scroll to 700px a big white box from beneath comes covering one third of the whole screen and on scrolling to say 1400px. it covers half of the whol
is the above good in webdevelopment as a whole ?
 
4:30 PM
If user is unregistered, normally it says right away. Why make me scroll down so far?
 
4:42 PM
would anyone know how to pass a multidimensional array from php to js using an ajax call? atm its just passing as a string
 
json
 
i did that i think @Mosho, i have this echo json_encode($responseArray);
 
that is not ajax
 
					<script>
					window.setInterval(function ajaxcall(){
								$.ajax({url: "functions/displayPostsDynamic.php",
									success: function(data)
									{
									console.log(data);
									}
								});
							}, 5000);
					</script>
this was the ajax bit
but the data doesnt come back as an array
 
what is the Content-Type header for the response?
you can see in the browser network dev tools
 
4:52 PM
1 sec not even a string is passing now, nothing is happening
@Mosho if the console is printing out this, is this an array or string:

[[{"post_id":117,"user_id":59,"post":"lol","date":"2017-03-26 18:36:21","votes_down":2,"votes_up":1},{"post_id":104,"user_id":46,"post":"hi from player8","date":"2017-03-23 22:19:10","votes_down":19,"votes_up":17}]]
 
that's an array
 
oh i guess i fixed it then, thanks mosho
nevermind, its a string, when i do console.log(data[0]); , it prints out "[" as thats the first character in the string and not the first item in the array
 
5:45 PM
@RachelDockter hammering the server for new posts every 5 seconds might not be all that good idea
though, it depends on how much users are you getting
 
@tereško do u think i should change to 20 seconds or something? my proffesor only said it had to update dymanicly
 
what's you use count?
 
what do you mean?
 
how many people do you get on that site at one time?
if it's under 100, then you will be just fine
 
well its not live but i have 20 example users and 20 example posts
ah ok should be ok then
 
5:48 PM
if you start seeing 1000 concurrent user, the box will probably fall over
 
apart from glyph-icons and font-awesome, are there anymore icon sets, that we can use ?
 
lmao
@tereško so in that 5 second timer it gets the array of posts, how would u go about displaying them with html?
because i cant just write the html in js
 
do you have any events attached to those posts?
and are you sending just the update or all of the posts taht you are gonna display?
 
erm it just sends an array with each of the posts information, so the id, time/date etc and displays them in divs and forms so if someone clicks on it, they will be transfer to that users page if u get what i mean
 
does that information contain all of the data or just he new data?
 
5:54 PM
all of the data, every post, so i would have to clear the existing ones everytime
 
then, tbh, it will be easier for you to just send a rendered chink of HTML
if you had it running on "updates only mode" or had some framework, then you would need the info in JSON format
 
so write the html and stuff in the php bit, and then encode it all? instead of encoding just the array?
 
but in this case, the "innerHTML" is a lot more pragmatic approach
you can encode it of you can just dump it in the response
 
oh i didnt realise that would work
so would i put all the html into a string and encode it?
 
why do you need to encode it?
are you working on something that uses utf-16/utf-32 ?
 
5:59 PM
i dont think so, but the ajax call is on a timer and calls the php file which gets the info and encodes it back
wait a second
 

« first day (2353 days earlier)      last day (2595 days later) »