• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 04:21
CEST 10:21
KST 17:21
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
Chinese SC2 server to reopen; live all-star event in Hangzhou4Weekly Cups (Oct 13-19): Clem Goes for Four0BSL Team A vs Koreans - Sat-Sun 16:00 CET6Weekly Cups (Oct 6-12): Four star herO85.0.15 Patch Balance Hotfix (2025-10-8)80
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou The New Patch Killed Mech! Team Liquid Map Contest #21 - Presented by Monster Energy herO joins T1 Weekly Cups (Oct 13-19): Clem Goes for Four
Tourneys
SC2's Safe House 2 - October 18 & 19 INu's Battles #13 - ByuN vs Zoun Tenacious Turtle Tussle Sparkling Tuna Cup - Weekly Open Tournament $1,200 WardiTV October (Oct 21st-31st)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers
Brood War
General
Is there anyway to get a private coach? OGN to release AI-upscaled StarLeague from Feb 24 BW caster Sayle BSL Season 21 BW General Discussion
Tourneys
[ASL20] Semifinal B [Megathread] Daily Proleagues SC4ALL $1,500 Open Bracket LAN Azhi's Colosseum - Anonymous Tournament
Strategy
[I] TvZ Strategies and Builds [I] TvP Strategies and Build Roaring Currents ASL final Current Meta
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread Dawn of War IV ZeroSpace Megathread
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread The Chess Thread Things Aren’t Peaceful in Palestine Men's Fashion Thread
Fan Clubs
The herO Fan Club!
Media & Entertainment
Series you have seen recently... Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
The Heroism of Pepe the Fro…
Peanutsc
Rocket League: Traits, Abili…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1423 users

The Big Programming Thread - Page 708

Forum Index > General Forum
Post a Reply
Prev 1 706 707 708 709 710 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.
NovemberstOrm
Profile Blog Joined September 2011
Canada16217 Posts
March 06 2016 08:22 GMT
#14141
On March 05 2016 21:41 Manit0u wrote:
Show nested quote +
On March 05 2016 16:14 NovemberstOrm wrote:
I'm creating an application in VB.net, I need to have a next record/prev record button, I'm using hashtables atm, any ideas?


Can't you just call next() and previous() on a collection?

Show nested quote +
On March 05 2016 20:54 tofucake wrote:
On March 05 2016 13:32 Manit0u wrote:
What do you mean by "text not written in Windows"? I've never had problems with assetic on either Linux or Windows.

Here are some things that might help you:
http://stackoverflow.com/questions/19219578/nginx-and-css-issue

Also: Why Chromium? T_T


.align-go {
transform: translateY(75%);
-webkit-transform: translateY(75%);
}

^ was written in Windows and works. Anything else I type in Arch goes to null.


sendfile off worked though, thanks


Really strange...

In the meantime, I've found another cool article/FAQ on Nginx:
https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/


Thanks I figured it out!
Moderatorlickypiddy
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
Last Edited: 2016-03-08 12:47:33
March 08 2016 12:45 GMT
#14142
So, I've just got out of a job interview. The test was harder than I thought, since it was a lot about the fundamentals and if you've been working with OOP and high level abstractions for the past 2 years you tend to forget some of the basics. Still, was nice to take it. Here's the PHP part for anyone interested (all of the questions were about the output):

1.

$t = ['one', 'two', 'three'];

echo $t[1][2];


2.

$a = 4;
$b = &$a;
$c = 5;
$a = $c;

echo $b;


3.

function abc() {
return func_get_arg(1);
}

echo abc('a', 'b', 'c');


4.

function f() { }

var_dump(f());


5.

$a = 0;
$b = [];

while (++$a <= 6)
$b[] = $a++;

echo implode($a, $b);


+ Show Spoiler +

The firs one is really evil. I completely forgot about this PHP quirk, where even if you supposedly try to call a multi-dimensinal array index, if element at next-to-last index is a string, it'll treat this string as a char array...
Time is precious. Waste it wisely.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
Last Edited: 2016-03-08 12:58:06
March 08 2016 12:57 GMT
#14143
On March 08 2016 21:45 Manit0u wrote:
So, I've just got out of a job interview. The test was harder than I thought, since it was a lot about the fundamentals and if you've been working with OOP and high level abstractions for the past 2 years you tend to forget some of the basics. Still, was nice to take it. Here's the PHP part for anyone interested (all of the questions were about the output):

+ Show Spoiler +

1.

$t = ['one', 'two', 'three'];

echo $t[1][2];


2.

$a = 4;
$b = &$a;
$c = 5;
$a = $c;

echo $b;


3.

function abc() {
return func_get_arg(1);
}

echo abc('a', 'b', 'c');


4.

function f() { }

var_dump(f());


5.

$a = 0;
$b = [];

while (++$a <= 6)
$b[] = $a++;

echo implode($a, $b);


+ Show Spoiler +

The firs one is really evil. I completely forgot about this PHP quirk, where even if you supposedly try to call a multi-dimensinal array index, if element at next-to-last index is a string, it'll treat this string as a char array...


I probably would have walked out. Those are terrible questions with no real world application. Well, #5 is sort of relevant since such algorithms can easily lead to bugs, but writing code like that is a sin anyways and if I ever see something like that in production, I will strangle the person responsible myself. I hate interview tests that ask for useless trivia instead of actually testing ability.
tofucake
Profile Blog Joined October 2009
Hyrule19144 Posts
March 08 2016 13:30 GMT
#14144
Yeah these are dumb questions :\
Liquipediaasante sana squash banana
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
Last Edited: 2016-03-08 14:41:51
March 08 2016 14:40 GMT
#14145
On March 08 2016 21:57 Morfildur wrote:
Show nested quote +
On March 08 2016 21:45 Manit0u wrote:
So, I've just got out of a job interview. The test was harder than I thought, since it was a lot about the fundamentals and if you've been working with OOP and high level abstractions for the past 2 years you tend to forget some of the basics. Still, was nice to take it. Here's the PHP part for anyone interested (all of the questions were about the output):

+ Show Spoiler +

1.

$t = ['one', 'two', 'three'];

echo $t[1][2];


2.

$a = 4;
$b = &$a;
$c = 5;
$a = $c;

echo $b;


3.

function abc() {
return func_get_arg(1);
}

echo abc('a', 'b', 'c');


4.

function f() { }

var_dump(f());


5.

$a = 0;
$b = [];

while (++$a <= 6)
$b[] = $a++;

echo implode($a, $b);


+ Show Spoiler +

The firs one is really evil. I completely forgot about this PHP quirk, where even if you supposedly try to call a multi-dimensinal array index, if element at next-to-last index is a string, it'll treat this string as a char array...


I probably would have walked out. Those are terrible questions with no real world application. Well, #5 is sort of relevant since such algorithms can easily lead to bugs, but writing code like that is a sin anyways and if I ever see something like that in production, I will strangle the person responsible myself. I hate interview tests that ask for useless trivia instead of actually testing ability.


I thought more of it as "do you know the basics" like how pointers work, what's the default return value of a function, what's the difference between pre- and post- increment etc.

Still, was expecting something completely different since in their offer they stated that 2+ years of experience is a requirement. Came in expecting questions about hydration strategies, event listeners, RESTful service implementations and such. Instead I got this, had to construct a db query with some joins and iterate over DOM elements with jQuery. All very basic stuff.
Time is precious. Waste it wisely.
Cynry
Profile Blog Joined August 2010
810 Posts
March 08 2016 15:45 GMT
#14146
What's roughly your skillset Manit0u ?
I'm seeing a lot of job offers (small missions mostly) going by these days, usually web apps, so if you're into that..
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
Last Edited: 2016-03-08 16:49:15
March 08 2016 16:41 GMT
#14147
On March 09 2016 00:45 Cynry wrote:
What's roughly your skillset Manit0u ?
I'm seeing a lot of job offers (small missions mostly) going by these days, usually web apps, so if you're into that..


I'm primarily a PHP developer. Used to do a bit of front-end work but for the past 1+ years I've been doing mostly back-end stuff (so it would be advanced PHP and intermediate JavaScript for the most part for me, I also know my way around CSS and HTML but have been a bit out of touch with those lately). If you need help with some smaller projects I believe I could help out, especially that I have a lot more leeway now that I've started my own one-man company and am mostly employed on a b2b basis

I did take part in a multitude of projects. From simple webpage portfolios, Magento- and Sylius-based e-commerce to various ERP solutions (this past year I've been dealing almost exclusively in DMS, QMS, SaaS and the like).
Time is precious. Waste it wisely.
Itsmedudeman
Profile Blog Joined March 2011
United States19229 Posts
March 09 2016 04:18 GMT
#14148
So let's see if I can word my question properly, but when I'm sending data to something like a jsp page from a servlet should I be flattening out that data? For example, I have an object in java that I want to send over but rather than having the jsp page fetch its details through getters should I instead lay it out in a simplified json/xml format?
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
March 09 2016 13:29 GMT
#14149
Aren't jsp pages parsed by jvm anyway? It doesn't matter what form your data takes there. It's just a matter of displaying it to the user. You should use json and xml as return data from your services to external resources (unless you somehow need them in that format in your view).
Time is precious. Waste it wisely.
Chocolate
Profile Blog Joined December 2010
United States2350 Posts
March 11 2016 08:24 GMT
#14150
The firs one is really evil. I completely forgot about this PHP quirk, where even if you supposedly try to call a multi-dimensinal array index, if element at next-to-last index is a string, it'll treat this string as a char array...


I don't use PHP but that seems like something the compiler should warn you about, shitty interview question though, why should you need to know all of PHP's weird quirks? That could be a career unto itself
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
March 11 2016 09:16 GMT
#14151
On March 11 2016 17:24 Chocolate wrote:
Show nested quote +
The firs one is really evil. I completely forgot about this PHP quirk, where even if you supposedly try to call a multi-dimensinal array index, if element at next-to-last index is a string, it'll treat this string as a char array...


I don't use PHP but that seems like something the compiler should warn you about, shitty interview question though, why should you need to know all of PHP's weird quirks? That could be a career unto itself


Usually such interview questions are the result of "clever" programmers that created a code base based on such quirks, and now they look for someone who understands their "clever" code.

Either way, PHP doesn't warn you about a lot of things, especially if you don't enable all the warning and strict flags, so it's easy for messy code to end up working by random chance. JavaScript might have a reputation as a terrible language - in my opinion unfounded -, but I much rather develop Node.js applications than PHP. PHP has too many quirks that just annoy me all the time.
iaretehnoob
Profile Joined June 2004
Sweden741 Posts
March 11 2016 13:18 GMT
#14152
I don't think "strings are character arrays" qualifies as a quirk.
tofucake
Profile Blog Joined October 2009
Hyrule19144 Posts
March 11 2016 13:44 GMT
#14153
On March 11 2016 18:16 Morfildur wrote:
Show nested quote +
On March 11 2016 17:24 Chocolate wrote:
The firs one is really evil. I completely forgot about this PHP quirk, where even if you supposedly try to call a multi-dimensinal array index, if element at next-to-last index is a string, it'll treat this string as a char array...


I don't use PHP but that seems like something the compiler should warn you about, shitty interview question though, why should you need to know all of PHP's weird quirks? That could be a career unto itself


Usually such interview questions are the result of "clever" programmers that created a code base based on such quirks, and now they look for someone who understands their "clever" code.

Either way, PHP doesn't warn you about a lot of things, especially if you don't enable all the warning and strict flags, so it's easy for messy code to end up working by random chance. JavaScript might have a reputation as a terrible language - in my opinion unfounded -, but I much rather develop Node.js applications than PHP. PHP has too many quirks that just annoy me all the time.

most of the quirks have been worked out of the language as of 7, and plenty of the remaining ones are going to be removed soon anyway.
Liquipediaasante sana squash banana
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
Last Edited: 2016-03-11 14:49:09
March 11 2016 14:28 GMT
#14154
On March 11 2016 22:18 iaretehnoob wrote:
I don't think "strings are character arrays" qualifies as a quirk.


Well, it's all because most of the basic PHP functionality depends on the underlying C stuff (in which strings are character arrays). It's also why some of the functions behave differently on different platforms (and some of them simply don't work at all on Windows for example).

Usually, when you see something like that:

$arr = ['one', 'two', 'three'];

echo $arr[1][2];


You'd expect it to throw an undefined index, while in fact it'll return 'o'.

It's dumb, but it's there and some people even use those quirks to save a couple of lines of code here and there. It's really bad practice in my opinion and borders on code obfuscation.

As for me, I'm always trying to use Python's philosophy of explicit > implicit (including trying to avoid pre- and post- incrementation). Even if I often have to write more code because of that I'm usually glad I did when I come back to it after a couple of months.

On March 11 2016 22:44 tofucake wrote:
most of the quirks have been worked out of the language as of 7, and plenty of the remaining ones are going to be removed soon anyway.


I think there'll still be plenty of wrong with PHP until Zend won't change their philosophy of "PHP is not for programmers" and finally decide to:
1. unify function names (2 vs to etc.)
2. reduce the number of built-in functions (there's too much, and plenty of useless stuff. I mean, just check this out)
3. enforce writing secure and stable apps (removing eval, getting rid of php config files etc.)
4. unify function argument sequence (they swap it around for seemingly very similar functions, I can never remember all the search function's needle and haystack arguments order).
Time is precious. Waste it wisely.
tofucake
Profile Blog Joined October 2009
Hyrule19144 Posts
March 11 2016 14:42 GMT
#14155
There's a bunch of RFCs now about unifying function arguments. One I'm especially happy about is to allow negative offsets in all the string functions.
Liquipediaasante sana squash banana
Cyx.
Profile Joined November 2010
Canada806 Posts
March 11 2016 16:13 GMT
#14156
On March 11 2016 23:28 Manit0u wrote:
Show nested quote +
On March 11 2016 22:18 iaretehnoob wrote:
I don't think "strings are character arrays" qualifies as a quirk.


Usually, when you see something like that:

$arr = ['one', 'two', 'three'];

echo $arr[1][2];


You'd expect it to throw an undefined index, while in fact it'll return 'o'.


I think what he's saying is that he *wouldn't* expect that to throw an undefined index, but instead to return the 3rd character of the 2nd string, which is what it does... I agree that treating strings as char arrays isn't weird at all, at least to me. (Not really trying to defend PHP here - just a comment )
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
March 11 2016 17:50 GMT
#14157
On March 12 2016 01:13 Cyx. wrote:
Show nested quote +
On March 11 2016 23:28 Manit0u wrote:
On March 11 2016 22:18 iaretehnoob wrote:
I don't think "strings are character arrays" qualifies as a quirk.


Usually, when you see something like that:

$arr = ['one', 'two', 'three'];

echo $arr[1][2];


You'd expect it to throw an undefined index, while in fact it'll return 'o'.


I think what he's saying is that he *wouldn't* expect that to throw an undefined index, but instead to return the 3rd character of the 2nd string, which is what it does... I agree that treating strings as char arrays isn't weird at all, at least to me. (Not really trying to defend PHP here - just a comment )


I'm not saying treating strings as char arrays is bad, but the fact that people do such things as in the example is preposterous in my eyes since it can lead to a metric ton of hard to find bugs.
Time is precious. Waste it wisely.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
March 11 2016 18:04 GMT
#14158
On March 12 2016 02:50 Manit0u wrote:
Show nested quote +
On March 12 2016 01:13 Cyx. wrote:
On March 11 2016 23:28 Manit0u wrote:
On March 11 2016 22:18 iaretehnoob wrote:
I don't think "strings are character arrays" qualifies as a quirk.


Usually, when you see something like that:

$arr = ['one', 'two', 'three'];

echo $arr[1][2];


You'd expect it to throw an undefined index, while in fact it'll return 'o'.


I think what he's saying is that he *wouldn't* expect that to throw an undefined index, but instead to return the 3rd character of the 2nd string, which is what it does... I agree that treating strings as char arrays isn't weird at all, at least to me. (Not really trying to defend PHP here - just a comment )


I'm not saying treating strings as char arrays is bad, but the fact that people do such things as in the example is preposterous in my eyes since it can lead to a metric ton of hard to find bugs.


Treating strings as string arrays is fun:

<?
$x = "abcd";
echo $x[0][0][0][0][0][0][0][0][0][0][0]; // a
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
March 11 2016 18:07 GMT
#14159
On March 12 2016 03:04 Morfildur wrote:
Show nested quote +
On March 12 2016 02:50 Manit0u wrote:
On March 12 2016 01:13 Cyx. wrote:
On March 11 2016 23:28 Manit0u wrote:
On March 11 2016 22:18 iaretehnoob wrote:
I don't think "strings are character arrays" qualifies as a quirk.


Usually, when you see something like that:

$arr = ['one', 'two', 'three'];

echo $arr[1][2];


You'd expect it to throw an undefined index, while in fact it'll return 'o'.


I think what he's saying is that he *wouldn't* expect that to throw an undefined index, but instead to return the 3rd character of the 2nd string, which is what it does... I agree that treating strings as char arrays isn't weird at all, at least to me. (Not really trying to defend PHP here - just a comment )


I'm not saying treating strings as char arrays is bad, but the fact that people do such things as in the example is preposterous in my eyes since it can lead to a metric ton of hard to find bugs.


Treating strings as string arrays is fun:

<?
$x = "abcd";
echo $x[0][0][0][0][0][0][0][0][0][0][0]; // a


What?! I don't even...
Time is precious. Waste it wisely.
madnessman
Profile Blog Joined May 2009
United States1581 Posts
March 11 2016 18:17 GMT
#14160
Has anybody had any success here writing an SC:BW AI which doesn't just execute a few hard coded strategies? I've finished my courses in AI and machine learning and I'm thinking about writing a BW AI to compete in the CIG AI competition this year. I found a few papers where researchers tried to implement more sophisticated methods but those bots didn't fare too well against the other competitive bots.
Prev 1 706 707 708 709 710 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 2h 39m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 64
OGKoka 58
StarCraft: Brood War
firebathero 809
sSak 605
Larva 298
PianO 232
Soma 113
Killer 74
Sharp 47
soO 40
HiyA 12
Bale 4
[ Show more ]
Britney 0
Dota 2
XaKoH 406
XcaliburYe130
ODPixel34
Counter-Strike
shoxiejesuss842
olofmeister628
Coldzera 363
allub221
Super Smash Bros
Mew2King97
Other Games
summit1g8820
C9.Mang0478
ceh9450
Tasteless218
Pyrionflax113
rGuardiaN28
Trikslyr21
Organizations
Other Games
gamesdonequick710
Counter-Strike
PGL420
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH187
• LUISG 12
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 2
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• HappyZerGling138
Upcoming Events
Wardi Open
2h 39m
Wardi Open
6h 9m
PiGosaur Monday
15h 39m
Replay Cast
1d 1h
Tenacious Turtle Tussle
1d 14h
The PondCast
2 days
OSC
2 days
WardiTV Invitational
3 days
Online Event
3 days
RSL Revival
3 days
[ Show More ]
RSL Revival
4 days
WardiTV Invitational
4 days
Afreeca Starleague
4 days
Snow vs Soma
Sparkling Tuna Cup
5 days
WardiTV Invitational
5 days
CrankTV Team League
5 days
RSL Revival
5 days
Wardi Open
6 days
CrankTV Team League
6 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
BSL 21 Non-Korean Championship
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
CranK Gathers Season 2: SC II Pro Teams
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
TLPD

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

Advertising | Privacy Policy | Terms Of Use | Contact Us

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