• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 05:42
CEST 11:42
KST 18:42
  • 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
Team TLMC #5 - Finalists & Open Tournaments0[ASL20] Ro16 Preview Pt2: Turbulence10Classic Games #3: Rogue vs Serral at BlizzCon9[ASL20] Ro16 Preview Pt1: Ascent10Maestros of the Game: Week 1/Play-in Preview12
Community News
BSL 2025 Warsaw LAN + Legends Showmatch0Weekly Cups (Sept 8-14): herO & MaxPax split cups4WardiTV TL Team Map Contest #5 Tournaments1SC4ALL $6,000 Open LAN in Philadelphia8Weekly Cups (Sept 1-7): MaxPax rebounds & Clem saga continues29
StarCraft 2
General
#1: Maru - Greatest Players of All Time Weekly Cups (Sept 8-14): herO & MaxPax split cups Team Liquid Map Contest #21 - Presented by Monster Energy SpeCial on The Tasteless Podcast Team TLMC #5 - Finalists & Open Tournaments
Tourneys
Maestros of The Game—$20k event w/ live finals in Paris Sparkling Tuna Cup - Weekly Open Tournament SC4ALL $6,000 Open LAN in Philadelphia WardiTV TL Team Map Contest #5 Tournaments RSL: Revival, a new crowdfunded tournament series
Strategy
Custom Maps
External Content
Mutation # 491 Night Drive Mutation # 490 Masters of Midnight Mutation # 489 Bannable Offense Mutation # 488 What Goes Around
Brood War
General
Soulkey on ASL S20 ASL TICKET LIVE help! :D BW General Discussion NaDa's Body A cwal.gg Extension - Easily keep track of anyone
Tourneys
[ASL20] Ro16 Group D [ASL20] Ro16 Group C [Megathread] Daily Proleagues BSL 2025 Warsaw LAN + Legends Showmatch
Strategy
Simple Questions, Simple Answers Muta micro map competition Fighting Spirit mining rates [G] Mineral Boosting
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Borderlands 3 General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Canadian Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread UK Politics Mega-thread
Fan Clubs
The Happy Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023
World Cup 2022
Tech Support
Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread High temperatures on bridge(s)
TL Community
BarCraft in Tokyo Japan for ASL Season5 Final The Automated Ban List
Blogs
I <=> 9
KrillinFromwales
The Personality of a Spender…
TrAiDoS
A very expensive lesson on ma…
Garnet
hello world
radishsoup
Lemme tell you a thing o…
JoinTheRain
RTS Design in Hypercoven
a11
Evil Gacha Games and the…
ffswowsucks
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1577 users

The Big Programming Thread - Page 682

Forum Index > General Forum
Post a Reply
Prev 1 680 681 682 683 684 1031 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
Poland17341 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
Hyrule19087 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
Turkey779 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
Poland17341 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
Poland17341 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
Poland17341 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
Turkey779 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
Poland17341 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 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 18m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Rex 2
StarCraft: Brood War
Calm 5699
Bisu 731
Hyuk 162
HiyA 96
Hyun 96
sorry 86
ToSsGirL 84
Dewaltoss 82
Pusan 77
Light 74
[ Show more ]
Soma 60
actioN 56
Mini 49
ZerO 32
BeSt 30
Nal_rA 28
soO 27
Liquid`Ret 26
Sharp 24
Rush 19
Free 16
SilentControl 10
Dota 2
singsing1508
XcaliburYe237
boxi98170
League of Legends
JimRising 381
Counter-Strike
olofmeister1583
shoxiejesuss629
allub166
Other Games
XaKoH 143
NeuroSwarm75
Trikslyr15
Organizations
Other Games
gamesdonequick599
StarCraft: Brood War
lovetv 593
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 1
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos1421
• Stunt679
Other Games
• WagamamaTV81
Upcoming Events
RSL Revival
18m
Maru vs Reynor
Cure vs TriGGeR
Rex2
Map Test Tournament
1h 18m
The PondCast
3h 18m
RSL Revival
1d
Zoun vs Classic
Korean StarCraft League
1d 17h
BSL Open LAN 2025 - War…
1d 22h
RSL Revival
2 days
BSL Open LAN 2025 - War…
2 days
RSL Revival
3 days
Online Event
3 days
[ Show More ]
Wardi Open
4 days
Monday Night Weeklies
4 days
Sparkling Tuna Cup
5 days
LiuLi Cup
6 days
Liquipedia Results

Completed

Proleague 2025-09-10
Chzzk MurlocKing SC1 vs SC2 Cup #2
HCC Europe

Ongoing

BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
LASL Season 20
RSL Revival: Season 2
Maestros of the Game
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1

Upcoming

2025 Chongqing Offline CUP
BSL World Championship of Poland 2025
IPSL Winter 2025-26
BSL Season 21
SC4ALL: Brood War
BSL 21 Team A
Stellar Fest
SC4ALL: StarCraft II
EC S1
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
MESA Nomadic Masters Fall
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
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.