• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 00:25
CET 06:25
KST 14:25
  • 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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)11Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns6[BSL21] Non-Korean Championship - Starts Jan 103SC2 All-Star Invitational: Jan 17-1822Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises3
StarCraft 2
General
Spontaneous hotkey change zerg Chinese SC2 server to reopen; live all-star event in Hangzhou Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns SC2 All-Star Invitational: Jan 17-18 Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises
Tourneys
$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) WardiTV Winter Cup WardiTV Mondays SC2 AI Tournament 2026 OSC Season 13 World Championship
Strategy
Simple Questions Simple Answers
Custom Maps
Map Editor closed ?
External Content
Mutation # 508 Violent Night Mutation # 507 Well Trained Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes
Brood War
General
I would like to say something about StarCraft Potential ASL qualifier breakthroughs? BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion StarCraft & BroodWar Campaign Speedrun Quest
Tourneys
[Megathread] Daily Proleagues [BSL21] Grand Finals - Sunday 21:00 CET [BSL21] Non-Korean Championship - Starts Jan 10 SLON Grand Finals – Season 2
Strategy
Game Theory for Starcraft Simple Questions, Simple Answers Current Meta [G] How to get started on ladder as a new Z player
Other Games
General Games
Awesome Games Done Quick 2026! Mechabellum Beyond All Reason Stormgate/Frost Giant Megathread General RTS Discussion Thread
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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Trading/Investing Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced
Blogs
My 2025 Magic: The Gathering…
DARKING
Physical Exercise (HIIT) Bef…
TrAiDoS
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2332 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
Poland17588 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
Hyrule19188 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
Poland17588 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
Poland17588 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
Poland17588 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
Poland17588 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
Next event in 3h 35m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft229
RuFF_SC2 183
Livibee 146
NeuroSwarm 140
FoxeR 34
StarCraft: Brood War
Shuttle 400
zelot 276
Snow 159
ZergMaN 76
Noble 22
Bale 20
Icarus 7
League of Legends
JimRising 821
Counter-Strike
summit1g10481
Super Smash Bros
hungrybox460
Other Games
ViBE110
Liquid`Ken16
Organizations
Other Games
gamesdonequick4783
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• Hupsaiya 80
• practicex 12
• Migwel
• sooper7s
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• RayReign 145
• Diggity5
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Scarra2074
• Rush1513
• Lourlo1070
• Stunt329
Upcoming Events
Replay Cast
3h 35m
Wardi Open
8h 35m
Monday Night Weeklies
11h 35m
WardiTV Invitational
1d 6h
WardiTV Invitational
2 days
The PondCast
3 days
OSC
3 days
OSC
4 days
All Star Teams
4 days
INnoVation vs soO
sOs vs Scarlett
uThermal 2v2 Circuit
5 days
[ Show More ]
All Star Teams
5 days
MMA vs DongRaeGu
Rogue vs Oliveira
Sparkling Tuna Cup
6 days
OSC
6 days
Liquipedia Results

Completed

Proleague 2026-01-11
Big Gabe Cup #3
NA Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL 21 Non-Korean Championship
CSL 2025 WINTER (S19)
OSC Championship Season 13
Underdog Cup #3
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025

Upcoming

Escore Tournament S1: W4
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Thunderfire SC2 All-star 2025
Nations Cup 2026
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
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.