• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:41
CEST 21:41
KST 04:41
  • 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
[ASL22] Ro4 Preview: Mirror Mirror2[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5[ASL22] Ro16 Preview: Rough Waters10
Community News
SC4ALL: II SC2 Complete Invited Player Lineup8StarCraft II 5.0.17 PTR Patch Notes (Sept 30, 2026)67Weekly Cups (Sept 21-27): herO and ByuN double2Weekly Cups (Sep 13-20): herO scores triple3BSL Season 2316
StarCraft 2
General
How do you feel about the mass reverts in the 5.0.17 PTR? SC4ALL: II SC2 Complete Invited Player Lineup StarCraft II 5.0.17 PTR Patch Notes (Sept 30, 2026) Back to SC2 after 14 years - Protoss CTRL groups? October World Ranking: herO stays #1, ByuN returns
Tourneys
Stellar Fest TWO the Moon (Dec 16-20) Sparkling Tuna Cup - Weekly Open Tournament 2026 GSTL Grand Finals Sea Duckling Open (Global, Bronze-Diamond) SC2 INu's Battles#21 [ 3-Days tournament ]
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[M] (2) Sweltering Sands [M] (2) Frigid Storage
External Content
Mutation # 546 Catch the Train The PondCast: SC2 News & Results Mutation # 545 And Drops and Rifts Mutation # 544 Double Trouble
Brood War
General
Fantasy returning? Sagi.gg Launcher Released BW General Discussion PLAYzone Challenge - open offline tour in Prague 20-year-old Valorant player starting StarCraft
Tourneys
[Megathread] Daily Proleagues [ASL22] Ro8 Day 4 2v2v2v2 Tournament [ASL22] Ro8 Day 3
Strategy
Cliff Jump Revisited (1 in a 1000 strategy) Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Warcraft III: The Frozen Throne Stormgate/Frost Giant Megathread Total Annihilation Zero
Dota 2
Dota 2 Champions League Season 3 Begins April 25! Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread Canadian Politics Mega-thread Artificial Intelligence Thread
Fan Clubs
Serral Fan Club
Media & Entertainment
Movie Discussion! [Manga] One Piece Diablo Animated Series on Netflix
Sports
Football (Soccer) Thread MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Escaping Into Video Games: G…
TrAiDoS
38 yo Retired SWE loo…
PurE)Rabbit-SF
Can Bots Beat Pros?? Starcr…
namkraft
[meme] I finally understa…
LUCKY_NOOB
Regacy Esports:Our Goa…
regacyesports
Customize Sidebar...

Website Feedback

Closed Threads



Active: 9201 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
Poland17845 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
Hyrule19259 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
Poland17845 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
Poland17845 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
Poland17845 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
Poland17845 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
BSL Open Qualifier
04:00
Jungsu & Hasu #2
ZZZero.O70
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
JuggernautJason181
BRAT_OK 73
StarCraft: Brood War
Britney 15596
Artosis 671
Mini 245
Dewaltoss 130
Mind 75
ZZZero.O 70
Hyun 39
NaDa 24
Bale 23
Dota 2
qojqva3086
420jenkins586
League of Legends
Doublelift1270
Heroes of the Storm
Grubby6422
Khaldor1281
Liquid`Hasu1022
MindelVK15
Other Games
summit1g5979
FrodaN2404
B2W.Neo811
byalli689
ToD187
Railgan45
Mew2King31
Organizations
Other Games
gamesdonequick1237
BasetradeTV229
Dota 2
PGL Dota 2 - Main Stream55
StarCraft 2
angryscii 39
[ Show 18 non-featured ]
StarCraft 2
• Adnapsc2 34
• StrangeGG 27
• Reevou 7
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• Azhi_Dahaki25
• 80smullet 23
• FirePhoenix7
• FT.aCt)Sony1
• niya90s 1
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Other Games
• imaqtpie930
• Shiphtur266
Upcoming Events
Replay Cast
3h 19m
Afreeca Starleague
14h 19m
Rush vs Light
WardiTV Weekly
15h 19m
Monday Night Weeklies
20h 19m
Replay Cast
1d 3h
Afreeca Starleague
1d 14h
Soma vs Soulkey
INu's Battles
1d 15h
SHIN vs Cure
ByuN vs Zoun
PiGosaur Cup
2 days
The PondCast
3 days
INu's Battles
3 days
[ Show More ]
Replay Cast
5 days
BSL: Ladder Tournament
5 days
Sparkling Tuna Cup
6 days
Patches Events
6 days
BSL Open Qualifier
6 days
BSL Open Qualifier
6 days
Liquipedia Results

Completed

CSL 2026 AUTUMN (S22)
Blizzard Classic Cup 2026
Calamity Invitational

Ongoing

ASL Season 22
Super Anchor Qualifying S3
Acropolis #5
Acropolis #5 - GSB
Copium Cup
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual

Upcoming

Acropolis #5 - GSC
BSL Season 23
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Custodian Cup
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
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.