• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 13:15
CET 19:15
KST 03:15
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
TL.net Map Contest #21: Winners11Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12[ASL20] Ro4 Preview: Descent11
Community News
StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7[BSL21] RO32 Group Stage4Weekly Cups (Oct 26-Nov 2): Liquid, Clem, Solar win; LAN in Philly2Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win10
StarCraft 2
General
SC: Evo Complete - Ranked Ladder OPEN ALPHA Mech is the composition that needs teleportation t TL.net Map Contest #21: Winners StarCraft, SC2, HotS, WC3, Returning to Blizzcon! RotterdaM "Serral is the GOAT, and it's not close"
Tourneys
Constellation Cup - Main Event - Stellar Fest Sparkling Tuna Cup - Weekly Open Tournament $5,000+ WardiTV 2025 Championship Merivale 8 Open - LAN - Stellar Fest Sea Duckling Open (Global, Bronze-Diamond)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions BW General Discussion Where's CardinalAllin/Jukado the mapmaker?
Tourneys
[Megathread] Daily Proleagues [ASL20] Grand Finals [BSL21] RO32 Group A - Saturday 21:00 CET [BSL21] RO32 Group B - Sunday 21:00 CET
Strategy
PvZ map balance Current Meta How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Stormgate/Frost Giant Megathread Should offensive tower rushing be viable in RTS games? Nintendo Switch Thread Path of Exile Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread US Politics Mega-thread The Games Industry And ATVI
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Learning my new SC2 hotkey…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Our Last Hope in th…
KrillinFromwales
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1425 users

The Big Programming Thread - Page 284

Forum Index > General Forum
Post a Reply
Prev 1 282 283 284 285 286 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
tec27
Profile Blog Joined June 2004
United States3702 Posts
April 14 2013 19:49 GMT
#5661
Guys, w3schools is awful, period. Its full of bad information, outdated information, bad recommendations, and it takes really scummy approaches to making sure its hard to block in searches. Anyone who knows their stuff will tell you that its awful and you shouldn't use it.

I already linked a much better site, MDN. Please use it and stop recommending garbage content in this thread.
Can you jam with the console cowboys in cyberspace?
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
Last Edited: 2013-04-14 21:11:50
April 14 2013 21:11 GMT
#5662
On April 14 2013 19:43 Yoshi- wrote:
The aforementioned site is w3fools.com btw.

I'd say they are being quite anal about the issue. Sure, W3schools does contain a lot of misleading information, and even some downright errors, but some of the issues they bring up really don't matter to the people using the site: Complete newbies who are just trying to get into it. W3schools is good because the progression is very approachable, once you're done with their tutorials, you're ready for the more detailed and correct knowledge bases.

I mean, you could probably take any page trying to teach HTML and find issues with it, using an argument like "Lol, this is so misleading compared to the official W3 docs", but the point is that the user is looking for a tutorial, not the exact information which can be looked up when you know what you're looking for.

For example, w3fools.com whine about w3schools using "async: false" in a tutorial on jQuery ajax() usage. While I agree with their basic perspective that AJAX is MEANT to be asynchronous, I'd say it's quite valid to use it without async in a tutorial since it's easier to come up with non-asyncronous implementations for a newbie, and it's quite a lot easier to grasp for a beginner. Obviously, this should be clarified in the tutorial, which it isn't. My point though, is that you have to take a tutorial for what it is: A simplification made to make it easier for newbies. While factual errors have no place there, simplifications certainly do.
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
April 14 2013 22:03 GMT
#5663
On April 15 2013 06:11 Tobberoth wrote:
Show nested quote +
On April 14 2013 19:43 Yoshi- wrote:
The aforementioned site is w3fools.com btw.

I'd say they are being quite anal about the issue. Sure, W3schools does contain a lot of misleading information, and even some downright errors, but some of the issues they bring up really don't matter to the people using the site: Complete newbies who are just trying to get into it. W3schools is good because the progression is very approachable, once you're done with their tutorials, you're ready for the more detailed and correct knowledge bases.

I mean, you could probably take any page trying to teach HTML and find issues with it, using an argument like "Lol, this is so misleading compared to the official W3 docs", but the point is that the user is looking for a tutorial, not the exact information which can be looked up when you know what you're looking for.

For example, w3fools.com whine about w3schools using "async: false" in a tutorial on jQuery ajax() usage. While I agree with their basic perspective that AJAX is MEANT to be asynchronous, I'd say it's quite valid to use it without async in a tutorial since it's easier to come up with non-asyncronous implementations for a newbie, and it's quite a lot easier to grasp for a beginner. Obviously, this should be clarified in the tutorial, which it isn't. My point though, is that you have to take a tutorial for what it is: A simplification made to make it easier for newbies. While factual errors have no place there, simplifications certainly do.

The problem is that it isn't being advertised as a simplified tutorial.
Deleted User 183001
Profile Joined May 2011
2939 Posts
April 14 2013 22:45 GMT
#5664
On April 15 2013 04:49 tec27 wrote:
Guys, w3schools is awful, period. Its full of bad information, outdated information, bad recommendations, and it takes really scummy approaches to making sure its hard to block in searches. Anyone who knows their stuff will tell you that its awful and you shouldn't use it.

I already linked a much better site, MDN. Please use it and stop recommending garbage content in this thread.

+1 for MDN.

As a computer engineering/computer science student, I'd like to say a few things though for fellow CE/CS people interested into getting into front-end web dev for a living.

Front-end Web dev can be fun, but it's more of a thing you do for that. I'm about to graduate, and I can tell you that I cannot even fathom how people can do front-end web dev for a living. It's so simplistic and so dull, I'd get tired pretty quickly of doing HTML/CSS/JS on a full-time basis, and some people I know who work in that kinda thing say the same..

I actually rejected internship offers from a couple little-known web-based companies like Yahoo and Amazon because they wanted me to be a script kiddie. Last summer, I did a ton of back-end web dev, which is infinitely more enjoyable and productive than front-end, and yet it was still meh.
Being a CE guy, I'd like to actually get some experience working with hardware and embedded systems. So of the offers, I accepted the one from Qualcomm since that's what they offered me. I'll be working there this summer and starting graduate school next year.

Basically my point is, to CS/CE students, REALLY consider what you want to do in terms of software work. Yeah it may seem cool to be that guy who does the HTML stuff on Facebook's page because you use Facebook, but do you really want to do that 40 hours a week?

tec27
Profile Blog Joined June 2004
United States3702 Posts
April 15 2013 00:15 GMT
#5665
On April 15 2013 07:45 JudicatorHammurabi wrote:
Show nested quote +
On April 15 2013 04:49 tec27 wrote:
Guys, w3schools is awful, period. Its full of bad information, outdated information, bad recommendations, and it takes really scummy approaches to making sure its hard to block in searches. Anyone who knows their stuff will tell you that its awful and you shouldn't use it.

I already linked a much better site, MDN. Please use it and stop recommending garbage content in this thread.

+1 for MDN.

As a computer engineering/computer science student, I'd like to say a few things though for fellow CE/CS people interested into getting into front-end web dev for a living.

Front-end Web dev can be fun, but it's more of a thing you do for that. I'm about to graduate, and I can tell you that I cannot even fathom how people can do front-end web dev for a living. It's so simplistic and so dull, I'd get tired pretty quickly of doing HTML/CSS/JS on a full-time basis, and some people I know who work in that kinda thing say the same..

I actually rejected internship offers from a couple little-known web-based companies like Yahoo and Amazon because they wanted me to be a script kiddie. Last summer, I did a ton of back-end web dev, which is infinitely more enjoyable and productive than front-end, and yet it was still meh.
Being a CE guy, I'd like to actually get some experience working with hardware and embedded systems. So of the offers, I accepted the one from Qualcomm since that's what they offered me. I'll be working there this summer and starting graduate school next year.

Basically my point is, to CS/CE students, REALLY consider what you want to do in terms of software work. Yeah it may seem cool to be that guy who does the HTML stuff on Facebook's page because you use Facebook, but do you really want to do that 40 hours a week?


Before I reply, that's a complete misuse of the term 'script kiddie' and not at all what its actual meaning is. Unless of course they wanted you to copy and paste scripts from the web with no knowledge of how they work, but I doubt that's the case

I think a lot of companies don't have this sort of front-end/back-end dichotomy post-hiring. There are certainly people that are going to have more familiarity working on user-facing vs service-facing things, but there is still an expectation that you'll have an understanding of both (and honestly, I think at this point they have a lot of the same problems to solve).

Being a front-end developer is certainly not just writing some HTML and calling it a day. Modern web applications have a lot of complex code running in the browser, stuff like rendering dynamic content, querying remote APIs and maintaining local datastores. A lot of logic that used to be kept on the server is now being run on the client, and honestly I think its a very interesting space.

If embedded systems are your interest, then yeah, web apps are probably not going to be something you enjoy working on. But if you are interested in web stuff, I think the sort of front-end work that modern companies need done can be every interesting, and you're being incredibly disingenuous in your description of it.

Some interesting reads/talks from that space:
http://backstage.soundcloud.com/2012/06/building-the-next-soundcloud/



Can you jam with the console cowboys in cyberspace?
phar
Profile Joined August 2011
United States1080 Posts
April 15 2013 01:17 GMT
#5666
Also I hope you did accept an internship at a comparable company, because having an amazon or yahoo internship on your resume will be really good for you when you try to get an actual job. I would have killed for an amazon internship even if it was pure frontend while in undergrad, and I'd be willing to be a large sum that I had more backend emphasis.

Hope it works out regardless.
Who after all is today speaking about the destruction of the Armenians?
Deleted User 183001
Profile Joined May 2011
2939 Posts
Last Edited: 2013-04-15 06:21:50
April 15 2013 06:19 GMT
#5667
On April 15 2013 09:15 tec27 wrote:
Show nested quote +
On April 15 2013 07:45 JudicatorHammurabi wrote:
On April 15 2013 04:49 tec27 wrote:
Guys, w3schools is awful, period. Its full of bad information, outdated information, bad recommendations, and it takes really scummy approaches to making sure its hard to block in searches. Anyone who knows their stuff will tell you that its awful and you shouldn't use it.

I already linked a much better site, MDN. Please use it and stop recommending garbage content in this thread.

+1 for MDN.

As a computer engineering/computer science student, I'd like to say a few things though for fellow CE/CS people interested into getting into front-end web dev for a living.

Front-end Web dev can be fun, but it's more of a thing you do for that. I'm about to graduate, and I can tell you that I cannot even fathom how people can do front-end web dev for a living. It's so simplistic and so dull, I'd get tired pretty quickly of doing HTML/CSS/JS on a full-time basis, and some people I know who work in that kinda thing say the same..

I actually rejected internship offers from a couple little-known web-based companies like Yahoo and Amazon because they wanted me to be a script kiddie. Last summer, I did a ton of back-end web dev, which is infinitely more enjoyable and productive than front-end, and yet it was still meh.
Being a CE guy, I'd like to actually get some experience working with hardware and embedded systems. So of the offers, I accepted the one from Qualcomm since that's what they offered me. I'll be working there this summer and starting graduate school next year.

Basically my point is, to CS/CE students, REALLY consider what you want to do in terms of software work. Yeah it may seem cool to be that guy who does the HTML stuff on Facebook's page because you use Facebook, but do you really want to do that 40 hours a week?


Before I reply, that's a complete misuse of the term 'script kiddie' and not at all what its actual meaning is. Unless of course they wanted you to copy and paste scripts from the web with no knowledge of how they work, but I doubt that's the case

I think a lot of companies don't have this sort of front-end/back-end dichotomy post-hiring. There are certainly people that are going to have more familiarity working on user-facing vs service-facing things, but there is still an expectation that you'll have an understanding of both (and honestly, I think at this point they have a lot of the same problems to solve).

Being a front-end developer is certainly not just writing some HTML and calling it a day. Modern web applications have a lot of complex code running in the browser, stuff like rendering dynamic content, querying remote APIs and maintaining local datastores. A lot of logic that used to be kept on the server is now being run on the client, and honestly I think its a very interesting space.

If embedded systems are your interest, then yeah, web apps are probably not going to be something you enjoy working on. But if you are interested in web stuff, I think the sort of front-end work that modern companies need done can be every interesting, and you're being incredibly disingenuous in your description of it.

Some interesting reads/talks from that space:
http://backstage.soundcloud.com/2012/06/building-the-next-soundcloud/
http://www.youtube.com/watch?v=unEuPvA2wnM
http://www.youtube.com/watch?v=IDmFZbP2b0A
http://www.youtube.com/watch?v=qx40CRwwkS8


I completely agree with you. My last post ignored some specifics and details that made it pretty one-faceted and yes, disingenuous, I acknowledge that . I'll watch these vids now, but I guess maybe I've done and have been given the wrong kind of front end stuff. Raw HTML/CSS and JS. It's rather plain and dull. :S
Like back-end stuff is really cool to me (as far as web-dev goes), although many people would disagree with me, but I like making all the logic and database stuff happen. I agree that people are expected to know both sides, but I've talked to a few people in industry who do front-end, and it just feels to me I'd get bored pretty quickly. That's just me though. But I also know plenty of people who thought it was going to be the coolest thing ever, because the front-end stuff is what they see on all their favorite websites, and then they regret it :s. That happens too.


On April 15 2013 10:17 phar wrote:
Also I hope you did accept an internship at a comparable company, because having an amazon or yahoo internship on your resume will be really good for you when you try to get an actual job. I would have killed for an amazon internship even if it was pure frontend while in undergrad, and I'd be willing to be a large sum that I had more backend emphasis.

Hope it works out regardless.


Well, I don't know how Qualcomm weighs in, but they gave me work in my interest, and in addition, it gives me a great opportunity to do some future proofing in my hometown. It was basically an offer I couldn't refuse. Who knows, if I'm lucky, I could even get some sort of deal to go visit Qualcomm Korea for a week or two, or in other words, get to visit South Korea
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
April 15 2013 06:32 GMT
#5668
On April 15 2013 07:03 CecilSunkure wrote:
Show nested quote +
On April 15 2013 06:11 Tobberoth wrote:
On April 14 2013 19:43 Yoshi- wrote:
The aforementioned site is w3fools.com btw.

I'd say they are being quite anal about the issue. Sure, W3schools does contain a lot of misleading information, and even some downright errors, but some of the issues they bring up really don't matter to the people using the site: Complete newbies who are just trying to get into it. W3schools is good because the progression is very approachable, once you're done with their tutorials, you're ready for the more detailed and correct knowledge bases.

I mean, you could probably take any page trying to teach HTML and find issues with it, using an argument like "Lol, this is so misleading compared to the official W3 docs", but the point is that the user is looking for a tutorial, not the exact information which can be looked up when you know what you're looking for.

For example, w3fools.com whine about w3schools using "async: false" in a tutorial on jQuery ajax() usage. While I agree with their basic perspective that AJAX is MEANT to be asynchronous, I'd say it's quite valid to use it without async in a tutorial since it's easier to come up with non-asyncronous implementations for a newbie, and it's quite a lot easier to grasp for a beginner. Obviously, this should be clarified in the tutorial, which it isn't. My point though, is that you have to take a tutorial for what it is: A simplification made to make it easier for newbies. While factual errors have no place there, simplifications certainly do.

The problem is that it isn't being advertised as a simplified tutorial.

I'm with you there, however, that doesn't have to stop you from recommending it to newbies, since you can let them know that as part of the introduction. "Go through this HTML tutorial quickly to get up to speed. Keep in mind that the site is quite simplified, here's some more advanced links you can check out once you're done with the basics here". Depends on the person wanting to learn though, resources like MDN are probably still superior for most beginners, unless they are computer illiterate.
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2013-04-15 07:22:20
April 15 2013 07:21 GMT
#5669
I don't know shit about Qualcomm besides their pure EE stuff. #1 fabless chip designer out there, I looked at applying there for architecture, before I gave up and went into software. There was a guy in my CS class who went to do software for them though, he likes it ok enough I guess.
Who after all is today speaking about the destruction of the Armenians?
tec27
Profile Blog Joined June 2004
United States3702 Posts
Last Edited: 2013-04-15 07:24:45
April 15 2013 07:24 GMT
#5670
On April 15 2013 15:32 Tobberoth wrote:
Show nested quote +
On April 15 2013 07:03 CecilSunkure wrote:
On April 15 2013 06:11 Tobberoth wrote:
On April 14 2013 19:43 Yoshi- wrote:
The aforementioned site is w3fools.com btw.

I'd say they are being quite anal about the issue. Sure, W3schools does contain a lot of misleading information, and even some downright errors, but some of the issues they bring up really don't matter to the people using the site: Complete newbies who are just trying to get into it. W3schools is good because the progression is very approachable, once you're done with their tutorials, you're ready for the more detailed and correct knowledge bases.

I mean, you could probably take any page trying to teach HTML and find issues with it, using an argument like "Lol, this is so misleading compared to the official W3 docs", but the point is that the user is looking for a tutorial, not the exact information which can be looked up when you know what you're looking for.

For example, w3fools.com whine about w3schools using "async: false" in a tutorial on jQuery ajax() usage. While I agree with their basic perspective that AJAX is MEANT to be asynchronous, I'd say it's quite valid to use it without async in a tutorial since it's easier to come up with non-asyncronous implementations for a newbie, and it's quite a lot easier to grasp for a beginner. Obviously, this should be clarified in the tutorial, which it isn't. My point though, is that you have to take a tutorial for what it is: A simplification made to make it easier for newbies. While factual errors have no place there, simplifications certainly do.

The problem is that it isn't being advertised as a simplified tutorial.

I'm with you there, however, that doesn't have to stop you from recommending it to newbies, since you can let them know that as part of the introduction. "Go through this HTML tutorial quickly to get up to speed. Keep in mind that the site is quite simplified, here's some more advanced links you can check out once you're done with the basics here". Depends on the person wanting to learn though, resources like MDN are probably still superior for most beginners, unless they are computer illiterate.

I think that's a bad approach for beginners though. One of the defining characteristics of someone with more expertise in an area (especially within CS and programming knowledge) is knowing how to pick out good information and advice from bad. Someone starting from a clean slate won't be able to break down the material enough to do that, and thus they internalize bad information and it will take them a while to expel that (and they'll likely build some ideas on top of that bad information, making it even harder to get rid of down the road). I think we've all internalized bad information in our path to becoming better programmers, but I don't view it as a necessary or good thing, and don't think we should be willingly encouraging people to learn from bad material.

I'll agree that wiki-like docs are not that great to use for absolute beginners since they lack direction. I think following project-specific tutorials is almost more helpful in that regard though: it gives you a starting point, a goal, and something cool at the end! There has been some effort to give a more general starting point for things in the open source community though, e.g. http://jsforcats.com/
Can you jam with the console cowboys in cyberspace?
JonGalt
Profile Joined February 2013
Pootie too good!4331 Posts
April 15 2013 13:37 GMT
#5671
I am trying to create a website with multiple drop down text boxes.

I have no problem creating them and getting them to send the correct values. However, I have 2 drop down boxes that have the same data, and 16 drop down boxes that have the same data. Each drop down box holds a lot of choices. I want to create a javascript function that creates the drop down box, then I only have to do it one time and if the choices change it is a matter of altering the function and not all 16.

Is this possible?
LiquidLegends StaffWho is Jon Galt?
Craton
Profile Blog Joined December 2009
United States17264 Posts
April 16 2013 00:04 GMT
#5672
Sounds like you just want a data source.
twitch.tv/cratonz
JonGalt
Profile Joined February 2013
Pootie too good!4331 Posts
April 16 2013 09:00 GMT
#5673
On April 16 2013 09:04 Craton wrote:
Sounds like you just want a data source.


Thanks! Going to look it up now.
LiquidLegends StaffWho is Jon Galt?
misirlou
Profile Joined June 2010
Portugal3241 Posts
April 16 2013 10:46 GMT
#5674
On April 15 2013 22:37 JonGalt wrote:
I am trying to create a website with multiple drop down text boxes.

I have no problem creating them and getting them to send the correct values. However, I have 2 drop down boxes that have the same data, and 16 drop down boxes that have the same data. Each drop down box holds a lot of choices. I want to create a javascript function that creates the drop down box, then I only have to do it one time and if the choices change it is a matter of altering the function and not all 16.

Is this possible?


If you are using ASPX, its simply going to the code behind (aspx.cs) of the page, putting the drop values on an array and then data binding all of the drop downs.

Any other language (and even aspx) can be resolved the same way by JS, on page load, smt like

+ Show Spoiler +

//assuming its a HTML select with id dropdownX, not sure on the array initialization syntax now
function addSelectValues()
{
var i;
var j;
var values={"a","b","c"};
for (i=0;i<16;i++)
{
for (j=0;j<3;j++)
$("#dropdown"+i).innerhtml+="<option>"+values[j]+"</option>";
}
}

Yoshi-
Profile Joined October 2008
Germany10227 Posts
Last Edited: 2013-04-16 10:56:54
April 16 2013 10:55 GMT
#5675
You really shouldn't use jQuery if you are learning JS.
Especially when the use is absolute not needed

He should rather use the normal js Function

document.getElementById('dropdownf'+i).innerHTML+="<option>"+values[j]+"</option>";


But if possible you should solve that issue serverside.
JonGalt
Profile Joined February 2013
Pootie too good!4331 Posts
April 16 2013 14:02 GMT
#5676
Thanks for the help. I think that function is what I was looking for.

Data sources seem nice, but they are much more complicated than I need as my website is really very simple. Plus the infrastructure of my JS lines quite nicely with what is posted above by Yoshi ands misirlou.
LiquidLegends StaffWho is Jon Galt?
LukeNukeEm
Profile Joined February 2012
31 Posts
April 16 2013 20:09 GMT
#5677
Hi guys.
I have a problem with tuples and vectors in c++.
std::tuple<unsigned int, unsigned int, unsigned int> tuple;
std::get<0>(tuple);
this works fine.
std::tuple<unsigned int, unsigned int, unsigned int> tuple;
std::vector<std::tuple<unsigned int, unsigned int, unsigned int>> vector;
vector.push_back(tuple);
std::get<0>(vector[0]);
this does not.
Error	10	error C2784: 'const _Ty &std::get(const std::array<_Ty,_Size> &) throw()' : could not deduce template argument for 'const std::array<_Ty,_Size> &' from 'std::tuple<<unnamed-symbol>,_V0_t,_V1_t>'
this is the errormessage on the last line. i'm not really that experienced with templates to understand all of it - any help?
halvorg
Profile Blog Joined October 2010
Norway717 Posts
Last Edited: 2013-04-16 20:21:07
April 16 2013 20:17 GMT
#5678
On April 17 2013 05:09 LukeNukeEm wrote:
Hi guys.
I have a problem with tuples and vectors in c++.
std::tuple<unsigned int, unsigned int, unsigned int> tuple;
std::get<0>(tuple);
this works fine.
std::tuple<unsigned int, unsigned int, unsigned int> tuple;
std::vector<std::tuple<unsigned int, unsigned int, unsigned int>> vector;
vector.push_back(tuple);
std::get<0>(vector[0]);
this does not.
Error	10	error C2784: 'const _Ty &std::get(const std::array<_Ty,_Size> &) throw()' : could not deduce template argument for 'const std::array<_Ty,_Size> &' from 'std::tuple<<unnamed-symbol>,_V0_t,_V1_t>'
this is the errormessage on the last line. i'm not really that experienced with templates to understand all of it - any help?


Hey, I'm not all too strong in c++, but as far as I know you need to add a space between your last two >'s, the c++ compiler thinks you are using the '>>' operator.



I've been learning haskell as of late, it's quite fun and I really like how easy it is to reason about pure code. Now that I've gotten lost in monads etc. I'm losing that ease of reasoning, I don't esp. like all the "do" statements I see in haskell code. Right now my major problem is finding a project to do though, one can only learn so much by small project euler problems and tutorials.
scudst0rm
Profile Joined May 2010
Canada1149 Posts
April 16 2013 20:21 GMT
#5679
On April 17 2013 05:09 LukeNukeEm wrote:
Hi guys.
I have a problem with tuples and vectors in c++.
std::tuple<unsigned int, unsigned int, unsigned int> tuple;
std::get<0>(tuple);
this works fine.
std::tuple<unsigned int, unsigned int, unsigned int> tuple;
std::vector<std::tuple<unsigned int, unsigned int, unsigned int>> vector;
vector.push_back(tuple);
std::get<0>(vector[0]);
this does not.
Error	10	error C2784: 'const _Ty &std::get(const std::array<_Ty,_Size> &) throw()' : could not deduce template argument for 'const std::array<_Ty,_Size> &' from 'std::tuple<<unnamed-symbol>,_V0_t,_V1_t>'
this is the errormessage on the last line. i'm not really that experienced with templates to understand all of it - any help?


This compiles fine for me. What compiler and version are you using?
You're like a one ranger army comin' at me...
iaretehnoob
Profile Joined June 2004
Sweden741 Posts
April 16 2013 20:26 GMT
#5680
On April 17 2013 05:17 halvorg wrote:
Show nested quote +
On April 17 2013 05:09 LukeNukeEm wrote:
Hi guys.
I have a problem with tuples and vectors in c++.
std::tuple<unsigned int, unsigned int, unsigned int> tuple;
std::get<0>(tuple);
this works fine.
std::tuple<unsigned int, unsigned int, unsigned int> tuple;
std::vector<std::tuple<unsigned int, unsigned int, unsigned int>> vector;
vector.push_back(tuple);
std::get<0>(vector[0]);
this does not.
Error	10	error C2784: 'const _Ty &std::get(const std::array<_Ty,_Size> &) throw()' : could not deduce template argument for 'const std::array<_Ty,_Size> &' from 'std::tuple<<unnamed-symbol>,_V0_t,_V1_t>'
this is the errormessage on the last line. i'm not really that experienced with templates to understand all of it - any help?


Hey, I'm not all too strong in c++, but as far as I know you need to add a space between your last two >'s, the c++ compiler thinks you are using the '>>' operator.

Working fine in VS2012, FWIW. They fixed that operator >> ambiguity thing in C++11. See if it works with a typedef'd tuple type and/or with explicitly typecasting the result of the vector access.
Prev 1 282 283 284 285 286 1032 Next
Please log in or register to reply.
Live Events Refresh
Wardi Open
12:00
#60
WardiTV2250
IndyStarCraft 235
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
IndyStarCraft 235
UpATreeSC 81
StarCraft: Brood War
Rain 3549
Horang2 1587
Shuttle 779
firebathero 160
scan(afreeca) 52
sSak 37
Mong 30
Aegong 22
JulyZerg 17
ivOry 6
[ Show more ]
SilentControl 5
Dota 2
Gorgc5362
qojqva3452
420jenkins277
BananaSlamJamma171
XcaliburYe148
League of Legends
rGuardiaN20
Counter-Strike
fl0m572
byalli525
Other Games
FrodaN1033
Beastyqt715
ceh9575
KnowMe280
Lowko263
Sick262
Hui .186
Liquid`VortiX147
Mew2King100
ArmadaUGS88
QueenE50
Trikslyr46
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• kabyraGe 101
• Reevou 1
• IndyKCrew
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• Migwel
• intothetv
• Kozan
StarCraft: Brood War
• Michael_bg 8
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV218
League of Legends
• Nemesis3622
• TFBlade947
• imaqtpie259
Other Games
• Shiphtur284
Upcoming Events
Replay Cast
4h 45m
WardiTV Korean Royale
17h 45m
OSC
22h 45m
Replay Cast
1d 4h
Replay Cast
1d 14h
Kung Fu Cup
1d 17h
Classic vs Solar
herO vs Cure
Reynor vs GuMiho
ByuN vs ShoWTimE
Tenacious Turtle Tussle
2 days
The PondCast
2 days
RSL Revival
2 days
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
2 days
[ Show More ]
WardiTV Korean Royale
2 days
PiGosaur Monday
3 days
RSL Revival
3 days
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
3 days
CranKy Ducklings
4 days
RSL Revival
4 days
herO vs Gerald
ByuN vs SHIN
Kung Fu Cup
4 days
BSL 21
5 days
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
Sparkling Tuna Cup
5 days
RSL Revival
5 days
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
5 days
WardiTV Korean Royale
5 days
BSL 21
6 days
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
Wardi Open
6 days
Monday Night Weeklies
6 days
Liquipedia Results

Completed

Proleague 2025-11-07
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual

Upcoming

SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
META Madness #9
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.