• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 01:30
CEST 07:30
KST 14:30
  • 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
Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
Weekly Cups (July 27-Aug 2): SHIN's big week0SC4ALL II: Brood War - $2500 - Dec 5-69SC4ALL II announced - $10,000 prize pool, Dec 5-64PIG STY FESTIVAL 8.0! (13 - 23 August)14Neeb returns to progaming; rejoins ONSYDE18
StarCraft 2
General
Balance hotfix patch 5.0.16b (July 16) Serral wins HomeStory Cup 29 StarCraft 2 at SC4ALL II Invite #4/8 - Percival Protoss AoE skill expression 5.0.16 patch for SC2 goes live (8 worker start)
Tourneys
RSL Revival: Season 6 - Qualifiers and Main Event Sparkling Tuna Cup - Weekly Open Tournament PIG STY FESTIVAL 8.0! (13 - 23 August) Tasteless Time Warp: SC Evo Showmatch (May 25) SC4ALL II announced - $10,000 prize pool, Dec 5-6
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
The PondCast: SC2 News & Results Mutation # 537 Hostile Territory Mutation # 536 Railroad Switch Mutation # 535 Assembly of Vengeance
Brood War
General
BW General Discussion Are you ready for ASL 22? NEW HYPE VIDEO [Personal Project Share] Terran Defense v0.60 ASL22 General Discussion Recent recommended BW games
Tourneys
KCM Race Survival 2026 Season 3 [Megathread] Daily Proleagues Escore Tournament - Season 3 SC4ALL II: Brood War - $2500 - Dec 5-6
Strategy
Any training maps people recommend? Odyssey Mineral Stack Saturation Fighting Spirit mining rates Simple Questions, Simple Answers
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Diablo 2 thread General RTS Discussion Thread ZeroSpace Early Access is Now Live!
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank TL Mafia Community Thread NeO.D_StephenKing vs This Guy From 1 Million Dance
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Iain M Banks Says He Has Cancer And Months To Live European Politico-economics QA Mega-thread The Games Industry And ATVI
Fan Clubs
The herO Fan Club! The Clem Fan Club INnoVation Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! Series you have seen recently... [Req][Books] Good Fantasy/SciFi books
Sports
NBA General Discussion Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Please support my new stand…
Peanutsc
What is a Gamer?
TrAiDoS
Hello guys!
LIN1s
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
Customize Sidebar...

Website Feedback

Closed Threads



Active: 6589 users

The Big Programming Thread - Page 682

Forum Index > General Forum
Post a Reply
Prev 1 680 681 682 683 684 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.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
November 26 2015 01:59 GMT
#13621
Well I have 2 friends that are working there, and they said that it's a pretty good company to work for, so I have a bit more faith than otherwise. Plus, I didn't do an internship(kids, do internships!) so my experience is limited, and I'm very low on cash. All of those raise my tolerance. But yeah, seeing those types of questions did not make me happy, especially when Java isn't my main language. Like who the fuck would know that answer offhand?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Animzor
Profile Joined March 2011
Sweden2154 Posts
November 26 2015 07:05 GMT
#13622
Quick question(C++):

is this:

char* name;


the same as this?

char *name;
Manit0u
Profile Blog Joined August 2004
Poland17822 Posts
Last Edited: 2015-11-26 07:40:01
November 26 2015 07:39 GMT
#13623
On November 26 2015 07:48 WarSame wrote:
For example, one question asked - in what version did Java release Enum. I know Enums are a fairly basic class so I assumed they were released in the initial version, 1.0. They were released in 5.0 - released in 2004.


Stuff like that always reminds me how not really modern the modern languages can be. When you think about it, lambda expressions and anonymous functions became the rage fairly recently and then you realize that Lisp had it all in the 60's...

On November 26 2015 16:05 Animzor wrote:
Quick question(C++):

is this:

Show nested quote +
char* name;


the same as this?

Show nested quote +
char *name;


Yes. You can even write it as "char * name". At least it used to be like that so you better get a second opinion here.
Time is precious. Waste it wisely.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
Last Edited: 2015-11-26 08:41:41
November 26 2015 08:31 GMT
#13624
On November 26 2015 16:05 Animzor wrote:
Quick question(C++):

is this:

Show nested quote +
char* name;


the same as this?

Show nested quote +
char *name;


It is the same. There are just different opinions on where the asterisk should go.

char* name; // name is a variable of the type pointer-to-char
char *name; // name is a pointer to data of type char
char * name; // I'm bad at making decisions


Some people prefer to think of it the first way while others think of it the second way. I think the more common and accepted way is "char *name", because it makes multiple declarations less ambiguous:

char *name1, name2; // name1 is a pointer to char, name2 is a char (not a pointer)
char *name1, *name2; // name1 and name2 are pointers to char


Side node: Avoid combining declarations, especially when pointers are involved. It doesn't improve performance or memory footprint, it just makes it harder to read the code.
tofucake
Profile Blog Joined October 2009
Hyrule19235 Posts
November 26 2015 13:31 GMT
#13625
yeah putting the asterisk with the variable is the way I prefer because there isn't a type of char-pointer. It's best to be as explicit as possible when declaring.
Liquipediaasante sana squash banana
solidbebe
Profile Blog Joined November 2010
Netherlands4921 Posts
November 26 2015 16:12 GMT
#13626
Meh I prefer it the other way around. I like to think of it as character-pointer called name .
That's the 2nd time in a week I've seen someone sig a quote from this GD and I have never witnessed a sig quote happen in my TL history ever before. -Najda
Gowerly
Profile Blog Joined July 2011
United Kingdom916 Posts
November 26 2015 16:16 GMT
#13627
I do the * on the type rather than the variable name.
But then that's because I never declare more than one variable on a line. I find it aids readability if things are separate.
I will reduce you to a series of numbers.
mantequilla
Profile Blog Joined June 2012
Turkey781 Posts
Last Edited: 2015-11-26 17:53:27
November 26 2015 17:48 GMT
#13628
N00B to javascript world here. Are these analogous?

npm install ~ mvn install
package.json ~ pom.xml
grunt ~ mvn compile
gulp ~ ???
bower ~ ???
Age of Mythology forever!
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
November 26 2015 20:39 GMT
#13629
On November 26 2015 22:31 tofucake wrote:
yeah putting the asterisk with the variable is the way I prefer because there isn't a type of char-pointer. It's best to be as explicit as possible when declaring.

I don't think that's right.

From the C++ standard:
9.3.2 The this pointer

In the body of a non-static (9.3) member function, the keyword this is a prvalue expression whose value is the address of the object for which the function is called. The type of this in a member function of a class X is X*. If the member function is declared const, the type of this is const X*, if the member function is declared volatile, the type of this is volatile X*, and if the member function is declared const volatile, the type of this is const volatile X*. [ Note: thus in a const member function, the object for which the function is called is accessed through a const access path. —end note ]

So it clearly says that "X*" is a type. Now obviously this excerpt talks about classes rather than chars, but I'd wager that the same thing applies for char* or any other pointer. At the very least usage suggests that pointers are types: when you typecast a pointer you include the asterisk.
If you have a good reason to disagree with the above, please tell me. Thank you.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
November 26 2015 21:31 GMT
#13630
You're pretty much all wrong. You should be using smart pointers in C++
There is no one like you in the universe.
Manit0u
Profile Blog Joined August 2004
Poland17822 Posts
Last Edited: 2015-11-26 23:16:33
November 26 2015 23:10 GMT
#13631
On November 27 2015 02:48 mantequilla wrote:
N00B to javascript world here. Are these analogous?

npm install ~ mvn install
package.json ~ pom.xml
grunt ~ mvn compile
gulp ~ ???
bower ~ ???


Please don't confuse JavaScript with Java. The tools you mentioned in theory serve the same purpose but they're totally different beast.

Also:

npm install -> this one is used to install node dependencies and run them in order (like getting bower and gulp and then running them)
bower install -> this thing grabs your javascript dependences according to the settings, if it finds conflicts (like 2 scripts requiring incompatible jQuery packages) it asks you to choose between available versions. I think it also does that for css but I'm not 100% sure (been a long time since I did any frontend work)
gulp -> merges, compiles, minifies and uglifies your assets provided by the other two

Usually in the project it's like that:

npm install (grab bower and gulp and execute the following commands - based on package.json) -> bower install (grab all the js and css requirements for your package - based on something) -> gulp (compile sass/less to css, compile javascripts, merge everything, do some magic, put asset images and scripts in the right folders etc. - based on gulpfile.js).

I believe that Grunt and Bower and/or Gulp are interchangeable.
Time is precious. Waste it wisely.
solidbebe
Profile Blog Joined November 2010
Netherlands4921 Posts
November 27 2015 00:15 GMT
#13632
HP is giving me headaches

Im trying to set up a win7/ubuntu dualboot (single drive) on my HP laptop, got both installed but I cant boot from ubuntu now. In the boot menu i can only select boot from drive which goes into win7. I cheched out all the bios settings but nothing apparent that might help.

Anyone got any ideas??
That's the 2nd time in a week I've seen someone sig a quote from this GD and I have never witnessed a sig quote happen in my TL history ever before. -Najda
Ropid
Profile Joined March 2009
Germany3557 Posts
Last Edited: 2015-11-27 01:09:22
November 27 2015 00:39 GMT
#13633
If this is a modern laptop with UEFI, there's a FAT32 partition with the boot loaders on it. You could move things around in there to fix it if your problem is that Windows has overwritten the Ubuntu boot loader.

The UEFI's boot menu can also be edited to add several boot loaders from that partition to it. That can be done through the "efibootmgr" tool.

I'll take a look at my stuff here locally and type up something more about what's going on and how to do work on it from within the environment you have when you boot the Ubuntu installation media and go to its desktop.
"My goal is to replace my soul with coffee and become immortal."
Manit0u
Profile Blog Joined August 2004
Poland17822 Posts
November 27 2015 01:06 GMT
#13634
Yeah, I remember that introducing UEFI caused problems with dual-booting. The very first thing you should try is installing the systems in the right order (that's Windows first and Linux second). It's because no matter what you do Windows will shove itself into MBR and screw up your setup. Another way around it is pretty oldschool (having a boot disk with you at all times) so I won't even suggest it
Time is precious. Waste it wisely.
Ropid
Profile Joined March 2009
Germany3557 Posts
Last Edited: 2015-11-27 01:27:13
November 27 2015 01:09 GMT
#13635
Check this out, I have Windows on a separate drive and I'm inspecting what's going on there from my Linux drive:

Here's the partitions of my first drive which is the one with Windows on it:

$ sudo parted /dev/sda print
Model: ATA Samsung SSD 840 (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 17.4kB 134MB 134MB msftres
2 135MB 450MB 315MB ntfs diag
3 450MB 555MB 105MB fat32 boot, esp
4 555MB 69.3GB 68.7GB ntfs msftdata
5 69.3GB 250GB 181GB ntfs msftdata


Partition number three is the EFI partition. Let's mount it and take a look at it:

$ mkdir temp

$ sudo mount /dev/sda3 temp

$ cd temp

$ tree .
.
└── EFI
├── Acronis
│ ├── asrm.efi
│ └── asrm.xml
├── Boot
│ └── bootx64.efi
└── Microsoft
└── Boot
├── BCD
├── BCD.LOG
├── BCD.LOG1
├── BCD.LOG2
├── bg-BG
│ ├── bootmgfw.efi.mui
│ └── bootmgr.efi.mui
├── bootmgfw.efi
├── bootmgr.efi
├── BOOTSTAT.DAT
├── boot.stl
├── cs-CZ
│ ├── bootmgfw.efi.mui
│ ├── bootmgr.efi.mui
│ └── memtest.efi.mui
├── da-DK
│ ├── bootmgfw.efi.mui
... a lot of files ...
44 directories, 126 files


That "EFI/Boot/bootx64.efi" file is the default boot loader. That's the file that gets loaded by the UEFI if you didn't configure anything special. For me here, it's a copy of a file in the Microsoft folder. See here:

$ diff -s EFI/Boot/bootx64.efi EFI/Microsoft/Boot/bootmgfw.efi 
Files EFI/Boot/bootx64.efi and EFI/Microsoft/Boot/bootmgfw.efi are identical


I assume Ubuntu uses the grub boot loader. You probably see it somewhere in its own folder on the drive. You should compare files with diff and see if the Ubuntu installation has overwritten the EFI/Boot/bootx64.efi file or if it's still the Microsoft file. I hope it's the Microsoft file and you can just copy the grub one over it and then things are working. It's not scary as you have the original in the Microsoft folder to copy back if needed.

There's a tool "efibootmgr" that can edit a list that's in the UEFI. That list has at first just that one entry for the default boot loader file, but you can add a bunch more to it. Those added entries should then show up in the boot menu of the UEFI. The "efibootmgr" tool is weird and I forgot how to use it. Also, I bet HP has issues in its UEFI and disregards what you would do with the efibootmgr tool. That's perhaps the reason that Ubuntu doesn't boot.

EDIT: The Archwiki has an article about one particular HP laptop:

https://wiki.archlinux.org/index.php/HP_EliteBook_840_G1

Even if UEFI, Arch Linux and (e.g.) GRUB are correctly configured and with the correct UEFI NVRAM variables set, the system will not boot from the HDD/SSD. The problem is that HP hard coded the paths for the OS boot manager in their UEFI boot manager to \EFI\Microsoft\Boot\bootmgfw.efi to boot Microsoft Windows, regardless of how the UEFI NVRAM variables are changed.


Great work by HP's programmers.

The article explains that this particular laptop has a BIOS update that introduced a setting named "customized boot" where you can enter the path+filename to an alternative boot loader.
"My goal is to replace my soul with coffee and become immortal."
Manit0u
Profile Blog Joined August 2004
Poland17822 Posts
November 27 2015 02:25 GMT
#13636
And what if you would swap your Linux boot with the Windows one but keep the name of the file same as Windowsy stuff?
Time is precious. Waste it wisely.
Ropid
Profile Joined March 2009
Germany3557 Posts
November 27 2015 07:37 GMT
#13637
Yeah, worst case you might have to overwrite the file in the "/EFI/Microsoft" folder. I hope that's not the case because then you would have to research how to still be able to boot Windows (perhaps reading up on manually editing the grub boot loader's config files so that it finds a renamed Microsoft file).

A thing I forgot is "SecureBoot". That has to be disabled for alternative boot loaders to work, though there was something about Ubuntu supposedly being able to work with it enabled.
"My goal is to replace my soul with coffee and become immortal."
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2015-11-27 08:33:09
November 27 2015 08:27 GMT
#13638
--- Nuked ---
mantequilla
Profile Blog Joined June 2012
Turkey781 Posts
November 27 2015 08:37 GMT
#13639
On November 27 2015 08:10 Manit0u wrote:
Show nested quote +
On November 27 2015 02:48 mantequilla wrote:
N00B to javascript world here. Are these analogous?

npm install ~ mvn install
package.json ~ pom.xml
grunt ~ mvn compile
gulp ~ ???
bower ~ ???


Please don't confuse JavaScript with Java. The tools you mentioned in theory serve the same purpose but they're totally different beast.

Also:

npm install -> this one is used to install node dependencies and run them in order (like getting bower and gulp and then running them)
bower install -> this thing grabs your javascript dependences according to the settings, if it finds conflicts (like 2 scripts requiring incompatible jQuery packages) it asks you to choose between available versions. I think it also does that for css but I'm not 100% sure (been a long time since I did any frontend work)
gulp -> merges, compiles, minifies and uglifies your assets provided by the other two

Usually in the project it's like that:

npm install (grab bower and gulp and execute the following commands - based on package.json) -> bower install (grab all the js and css requirements for your package - based on something) -> gulp (compile sass/less to css, compile javascripts, merge everything, do some magic, put asset images and scripts in the right folders etc. - based on gulpfile.js).

I believe that Grunt and Bower and/or Gulp are interchangeable.



Inserting required css and javascript files into HTML document's head is done by hand, or with one of these build tools?
Age of Mythology forever!
Manit0u
Profile Blog Joined August 2004
Poland17822 Posts
November 27 2015 09:27 GMT
#13640
On November 27 2015 17:37 mantequilla wrote:
Show nested quote +
On November 27 2015 08:10 Manit0u wrote:
On November 27 2015 02:48 mantequilla wrote:
N00B to javascript world here. Are these analogous?

npm install ~ mvn install
package.json ~ pom.xml
grunt ~ mvn compile
gulp ~ ???
bower ~ ???


Please don't confuse JavaScript with Java. The tools you mentioned in theory serve the same purpose but they're totally different beast.

Also:

npm install -> this one is used to install node dependencies and run them in order (like getting bower and gulp and then running them)
bower install -> this thing grabs your javascript dependences according to the settings, if it finds conflicts (like 2 scripts requiring incompatible jQuery packages) it asks you to choose between available versions. I think it also does that for css but I'm not 100% sure (been a long time since I did any frontend work)
gulp -> merges, compiles, minifies and uglifies your assets provided by the other two

Usually in the project it's like that:

npm install (grab bower and gulp and execute the following commands - based on package.json) -> bower install (grab all the js and css requirements for your package - based on something) -> gulp (compile sass/less to css, compile javascripts, merge everything, do some magic, put asset images and scripts in the right folders etc. - based on gulpfile.js).

I believe that Grunt and Bower and/or Gulp are interchangeable.



Inserting required css and javascript files into HTML document's head is done by hand, or with one of these build tools?


By hand. You do something like that:


<link href="/assets/css/compiled.css" rel="stylesheet" type="text/css">
<script src="/assets/js/compiled.js"></script>


Now, you don't really have those files. All you have are unprocessed stylesheets and javascripts in non-public folder:


private/
sass/
forms.sass
layout.sass
typography.sass
ui.sass
js/
custom.js
ui.js


Now, launching bower + gulp (via npm) will perform those steps:

1. Download jquery, angular, bootstrap, pace js and css (and whatever elese you need)
2. Compile your sass to css
3. Merge all css into a single file, minify and output it into /assets/css/compiled.css
4. Merge all js, minify, uglify and output it into /assets/js/compiled.js

This way you really link only a single file somewhere in your layout and don't have to worry about it since all the assets will be compiled into them. You just have to run npm install after deployment. During development you might need to run gulp manually each time your js/css changes unless you have an IDE in which you can set up file watchers to do it for you automatically in the background upon file save (jetbrains products have such a feature).
Time is precious. Waste it wisely.
Prev 1 680 681 682 683 684 1032 Next
Please log in or register to reply.
Live Events Refresh
Ladder Legends
20:00
Saturday Open #1
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft668
ProTech21
StarCraft: Brood War
Mind 103
NaDa 15
Dota 2
NeuroSwarm218
League of Legends
JimRising 603
Counter-Strike
summit1g8872
minikerr44
Super Smash Bros
Mew2King154
Other Games
RuFF_SC293
Organizations
Other Games
gamesdonequick775
[ Show 11 non-featured ]
StarCraft 2
• Berry_CruncH315
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota2118
League of Legends
• Lourlo1275
Upcoming Events
RSL Revival
3h 30m
OSC
7h 30m
OSC
18h 30m
WardiTV Weekly
1d 5h
The Patches Monday
1d 10h
Sparkling Tuna Cup
2 days
PiG Sty Festival
2 days
PiGosaur Cup
2 days
Replay Cast
3 days
Kung Fu Cup
3 days
[ Show More ]
Replay Cast
3 days
The PondCast
4 days
Replay Cast
4 days
CranKy Ducklings
6 days
Liquipedia Results

Completed

Escore Tournament S3: W6
CranK Gathers Season 4: BW vs SC2 Team League
Eternal Conflict S2 Finale

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
Acropolis #5
RSL Revival: Season 6
Esports World Cup 2026: LCQ
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2

Upcoming

Escore Tournament S3: W7
CSLAN 4
ASL Season 22
Escore Tournament S3: W8
Acropolis #5 - TRS
Blizzard Classic Cup 2026
Acropolis #5 - GSA
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
PiG Sty Festival 8.0
Big Dog Cup 2026 Div 1
Thunderpick World Champ.
ESL Pro League Season 24
Stake Ranked Episode 4
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
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 © 2026 TLnet. All Rights Reserved.