• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 08:27
CEST 14:27
KST 21:27
  • 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
[ASL19] Finals Recap: Standing Tall2HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Retirement From ASL18Weekly Cups (June 23-29): Reynor in world title form?12FEL Cracov 2025 (July 27) - $8000 live event16Esports World Cup 2025 - Final Player Roster14Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
The SCII GOAT: A statistical Evaluation What is Lactobacillus used for? Weekly Cups (June 23-29): Reynor in world title form? StarCraft Mass Recall: SC1 campaigns on SC2 thread How does the number of casters affect your enjoyment of esports?
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event HomeStory Cup 27 (June 27-29) WardiTV Mondays SOOPer7s Showmatches 2025 $200 Biweekly - StarCraft Evolution League #1
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
[ASL19] Finals Recap: Standing Tall Flash Announces Retirement From ASL ASL20 Preliminary Maps BW General Discussion BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[Megathread] Daily Proleagues [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET The Casual Games of the Week Thread [BSL20] ProLeague LB Final - Saturday 20:00 CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile What do you want from future RTS games? Beyond All Reason
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Trading/Investing Thread Stop Killing Games - European Citizens Initiative Russo-Ukrainian War Thread
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread Korean Music Discussion
Sports
2024 - 2025 Football Thread NBA General Discussion Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
Game Sound vs. Music: The Im…
TrAiDoS
StarCraft improvement
iopq
Heero Yuy & the Tax…
KrillinFromwales
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 682 users

The Big Programming Thread - Page 763

Forum Index > General Forum
Post a Reply
Prev 1 761 762 763 764 765 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.
Shaella
Profile Blog Joined January 2013
United States14827 Posts
September 12 2016 05:43 GMT
#15241
On September 12 2016 13:05 Birdie wrote:
I haven't done much with userscripts before but pretty sure they have easy access to the DOM, so you just need to find how posts are stored in the DOM and then find the element with the username you want to hide, then remove it. IDK if that's enough to go off or you need more specifics though.

E.g.

<tr id="post-8073303">
<td class="c_username">
<a href='http://s9.zetaboards.com/Ultimate3D_community/profile/44616/' class='member'>AZARKON THE GREAT</a><a name='post8073303'></a>
</td>

So you just navigate the DOM for anything with id = post-SOMETHING, then within its children, check class=member, check the text for the usernames you want to hide, and if so use whatever DOM manipulation userscripts have to hide/remove the whole post tr.

alright thats helpful.
don't tell me to provide a legend for those charts cause we already got shaella in this thread - eieio | Bulba is my waifu
Manit0u
Profile Blog Joined August 2004
Poland17242 Posts
Last Edited: 2016-09-13 09:07:21
September 13 2016 07:40 GMT
#15242
Have any of you used the new google cloud speech api or worked with media file conversions?

I'm getting some strange error from them that I don't really know how to approach:


Invalid FLAC header: incorrect FLAC marker


The recording is captured from the mic via JS and saved as a .wav file. It is then converted to .flac with sox, base64 encoded and sent to google api as per their docs. Googling this error isn't helpful...

Edit: file info before and after coversion

kkarski@debian:~ $ avprobe 009.wav
avprobe version 11.7-6:11.7-1~deb8u1, Copyright (c) 2007-2016 the Libav developers
built on Jun 12 2016 21:51:35 with gcc 4.9.2 (Debian 4.9.2-10)
Input #0, wav, from '009.wav':
Duration: 00:00:04.50, bitrate: 256 kb/s
Stream #0.0: Audio: pcm_s16le, 16000 Hz, 1 channels, s16, 256 kb/s
# avprobe output


kkarski@debian:~ $ avprobe 009.flac
avprobe version 11.7-6:11.7-1~deb8u1, Copyright (c) 2007-2016 the Libav developers
built on Jun 12 2016 21:51:35 with gcc 4.9.2 (Debian 4.9.2-10)
Input #0, flac, from '009.flac':
Metadata:
COMMENT : Processed by SoX
Duration: 00:00:04.50, bitrate: 99 kb/s
Stream #0.0: Audio: flac, 16000 Hz, mono, s16
# avprobe output


Edit2:
Nevermind. I checked some of the sample code on the google cloud platform and the docs are most likely outdated. Sending them .wav denoted as LINEAR16 encoding worked on first try...

Fucking hate such dumb things.
Time is precious. Waste it wisely.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2016-09-13 21:54:19
September 13 2016 21:53 GMT
#15243
let's saying im looping through an arraylist
checking for a certain result based on user input within it's elements

and when I am done, I want to change some of the indexes to something that I know *for sure* will not be what the user is searching for

is there a way to set indexes as "empty"? Is the only option to make those indexes null? meaning that I will have to account for that in my code? Or is there something easier than null.

Say, the indexes will have strings. Is there an option for a valueless string, or is null the best I can do?



(in java)


edit: epiphany. can I do "" ?
Acrofales
Profile Joined August 2010
Spain17967 Posts
September 13 2016 22:08 GMT
#15244
On September 14 2016 06:53 travis wrote:
let's saying im looping through an arraylist
checking for a certain result based on user input within it's elements

and when I am done, I want to change some of the indexes to something that I know *for sure* will not be what the user is searching for

is there a way to set indexes as "empty"? Is the only option to make those indexes null? meaning that I will have to account for that in my code? Or is there something easier than null.

Say, the indexes will have strings. Is there an option for a valueless string, or is null the best I can do?



(in java)


edit: epiphany. can I do "" ?


Indexes are integers, and thus cannot be set equal to "". You could clearly set it to -1 (a very usual way of initializing an int before looping through an array and setting it to something useful). You then test after the loop whether it is still -1, and treat this exceptional situation. You could also use the value directly, rather than the index. This can be initialized as null (or set to null when you find nonsense). Just remember that operations on null objects throws null pointer exceptions. And trying to find the -1th element in a list throws an array index out of bounds exception. So always remember to check your corner cases.

Oh, and null is pretty easy. It also has the advantage of failing immediately if you don't treat it properly, rather than letting your code Gail at some completely unrelated spot. Debugging this becomes: "why is this null", rather than "what the fuck happened?"
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2016-09-13 22:11:36
September 13 2016 22:10 GMT
#15245
sorry I didn't say what I mean accurately. I don't mean to change the index. I mean to change the value of the given index (the string) to something that the user wouldn't possibly be searching for.

I don't want to lose the index itself, or else I would just remove it from my arraylist.
Manit0u
Profile Blog Joined August 2004
Poland17242 Posts
Last Edited: 2016-09-13 22:28:44
September 13 2016 22:18 GMT
#15246
On September 14 2016 07:10 travis wrote:
sorry I didn't say what I mean accurately. I don't mean to change the index. I mean to change the value of the given index (the string) to something that the user wouldn't possibly be searching for.

I don't want to lose the index itself, or else I would just remove it from my arraylist.


You mean you want to change array value at a given index (not value of the index). Nothing simpler...


if (arrList.contains("search string")) {
arrList.set(arrList.indexOf("search string"), "won't find it again!");
}
/*
can just set it to null if you want to, but this might break things since both
contains and indexOf need an object of some sort as their argument
*/


My java is clunky. Someone please confirm...
Time is precious. Waste it wisely.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
September 13 2016 22:40 GMT
#15247
there will be multiple search terms, and I don't know what they are, so I can't set it to another string

I know I can set it to null, I was just wondering if there was a better option - is empty string a thing?
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-09-13 22:59:08
September 13 2016 22:56 GMT
#15248
--- Nuked ---
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2016-09-14 02:20:50
September 14 2016 02:15 GMT
#15249
Why can't you just remove the objects from the list if you know you don't need them?

On September 12 2016 13:25 WarSame wrote:
Show nested quote +
On September 12 2016 06:52 Blisse wrote:
Yeah, academic integrity policy is intentionally vague so that it's a lot easier on them when they provide proof. Generally it's fine as long as you're just talking about the solution and not given exact pseudo/code. All reasonable professors I've seen encourage discussion, just not discussion with code being written.

I've consulted TL for a bunch of things too.

Instead of giving the problem description, you should abstract it one step up. I know it's a bit harder to do since you're starting out, but asking, "how do you find the smallest range of numbers in a list that contains a given set of numbers?" gives essentially the same solutions, and as long as no one is writing out a program for you, it should be fine asking for help.

-----

Actually it's kind of annoying/interesting that a lot of programming questions essentially rely on tricks that you need to learn first before you can actually solve them. Using sets and dictionaries IMO don't come intuitively, but instead from me reading advice that they're generally how to best solve a problem, and then I base my thinking with that in mind. I think the extreme example is being asked to find a loop in a linked list. No way you can reason yourself to a solution.

I mean, I'm not particularly good, but couldn't you just put the pointer values of each node in a dict when visited, and if you come to a node already in the dict, then you've got a loop?


How would you approach the problem if you couldn't hash the objects because the list is huge?

+ Show Spoiler [hint] +
what if you used two pointers?
+ Show Spoiler [answer] +
what if one pointer moved faster than they other? how were you expected to get to this answer?
+ Show Spoiler +
Obviously I realized I fucked up the interview question :'(

http://www.programmerinterview.com/index.php/data-structures/how-to-find-if-a-linked-list-is-circular-or-has-a-cycle-or-it-ends/
There is no one like you in the universe.
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2016-09-14 02:47:41
September 14 2016 02:46 GMT
#15250
On September 14 2016 11:15 Blisse wrote:
Why can't you just remove the objects from the list if you know you don't need them?

Show nested quote +
On September 12 2016 13:25 WarSame wrote:
On September 12 2016 06:52 Blisse wrote:
Yeah, academic integrity policy is intentionally vague so that it's a lot easier on them when they provide proof. Generally it's fine as long as you're just talking about the solution and not given exact pseudo/code. All reasonable professors I've seen encourage discussion, just not discussion with code being written.

I've consulted TL for a bunch of things too.

Instead of giving the problem description, you should abstract it one step up. I know it's a bit harder to do since you're starting out, but asking, "how do you find the smallest range of numbers in a list that contains a given set of numbers?" gives essentially the same solutions, and as long as no one is writing out a program for you, it should be fine asking for help.

-----

Actually it's kind of annoying/interesting that a lot of programming questions essentially rely on tricks that you need to learn first before you can actually solve them. Using sets and dictionaries IMO don't come intuitively, but instead from me reading advice that they're generally how to best solve a problem, and then I base my thinking with that in mind. I think the extreme example is being asked to find a loop in a linked list. No way you can reason yourself to a solution.

I mean, I'm not particularly good, but couldn't you just put the pointer values of each node in a dict when visited, and if you come to a node already in the dict, then you've got a loop?


How would you approach the problem if you couldn't hash the objects because the list is huge?

+ Show Spoiler [hint] +
what if you used two pointers?
+ Show Spoiler [answer] +
what if one pointer moved faster than they other? how were you expected to get to this answer?
+ Show Spoiler +
Obviously I realized I fucked up the interview question :'(

http://www.programmerinterview.com/index.php/data-structures/how-to-find-if-a-linked-list-is-circular-or-has-a-cycle-or-it-ends/


That's pretty dirty. I'm interviewing people on Friday and gonna use that one thanks. I think it's a good demonstration that it is really easy to a solution, but thinking through for the best one requires a person to be on another level entirely.
I'll always be your shadow and veil your eyes from states of ain soph aur.
Aerisky
Profile Blog Joined May 2012
United States12129 Posts
September 14 2016 07:41 GMT
#15251
afaik it's not too obscure, so people might have heard of it. I think I remember seeing it in a small lab assignment in my lower data structures/algorithms class a couple years ago.
Jim while Johnny had had had had had had had; had had had had the better effect on the teacher.
Birdie
Profile Blog Joined August 2007
New Zealand4438 Posts
September 14 2016 08:32 GMT
#15252
Yeah I had an assignment on that in uni year two or so I think.
Red classic | A butterfly dreamed he was Zhuangzi | 4.5k, heading to 5k as support!
teamamerica
Profile Blog Joined July 2010
United States958 Posts
Last Edited: 2016-09-14 08:34:26
September 14 2016 08:33 GMT
#15253
I agree the list cycle one is somewhat of a known question...some variants are 1) determine first node of the cycle; 2) determine the length of a cycle. One fun question I heard lately was:
> There are N buildings with variable number of floors, and we want to build additional floors so that at least m buildings are of the same height. Minimize the cost of building the floors.

Best solution I could arrive at was NlogN (where N is number of buildings, m is the number of buildings you're trying to raise to same height).

Cloudflare DNS outage @ my location right now and 1/2 the internet down t_t (including programmerinterviewer somehow so excuse me if they mentioned both those subproblems on the site)

On September 14 2016 06:53 travis wrote:
let's saying im looping through an arraylist
checking for a certain result based on user input within it's elements

and when I am done, I want to change some of the indexes to something that I know *for sure* will not be what the user is searching for

is there a way to set indexes as "empty"? Is the only option to make those indexes null? meaning that I will have to account for that in my code? Or is there something easier than null.

Say, the indexes will have strings. Is there an option for a valueless string, or is null the best I can do?



(in java)


edit: epiphany. can I do "" ?


Imo it'd be helpful if you gave a little context about what problem you're trying to solve. For example sure you can use null (well in Java you can't use null if you're using a primitive typed array but w/e), but another approach might be maintain a set of the previously guessed indicies and check that per iteration. I can't think of a not artificial case where you'd want behavior like this...maybe you're trying to shuffle?

RIP GOMTV. RIP PROLEAGUE.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
September 14 2016 08:34 GMT
#15254
On September 14 2016 11:15 Blisse wrote:
Why can't you just remove the objects from the list if you know you don't need them?

Show nested quote +
On September 12 2016 13:25 WarSame wrote:
On September 12 2016 06:52 Blisse wrote:
Yeah, academic integrity policy is intentionally vague so that it's a lot easier on them when they provide proof. Generally it's fine as long as you're just talking about the solution and not given exact pseudo/code. All reasonable professors I've seen encourage discussion, just not discussion with code being written.

I've consulted TL for a bunch of things too.

Instead of giving the problem description, you should abstract it one step up. I know it's a bit harder to do since you're starting out, but asking, "how do you find the smallest range of numbers in a list that contains a given set of numbers?" gives essentially the same solutions, and as long as no one is writing out a program for you, it should be fine asking for help.

-----

Actually it's kind of annoying/interesting that a lot of programming questions essentially rely on tricks that you need to learn first before you can actually solve them. Using sets and dictionaries IMO don't come intuitively, but instead from me reading advice that they're generally how to best solve a problem, and then I base my thinking with that in mind. I think the extreme example is being asked to find a loop in a linked list. No way you can reason yourself to a solution.

I mean, I'm not particularly good, but couldn't you just put the pointer values of each node in a dict when visited, and if you come to a node already in the dict, then you've got a loop?


How would you approach the problem if you couldn't hash the objects because the list is huge?

+ Show Spoiler [hint] +
what if you used two pointers?
+ Show Spoiler [answer] +
what if one pointer moved faster than they other? how were you expected to get to this answer?
+ Show Spoiler +
Obviously I realized I fucked up the interview question :'(

http://www.programmerinterview.com/index.php/data-structures/how-to-find-if-a-linked-list-is-circular-or-has-a-cycle-or-it-ends/



Pointers are tiny, so even a list with a million entries will have pretty much insignificant memory impact compared to the list and data itself, so a simple dictionary solution would still be pretty easy and probably faster, too, since you can abort on the first duplicate node. With the tortoise and hare solution you have to cross the distance that the slower pointer completed already, which means in a completely circular list you pretty much have to check 1.5n elements. The slower pointer crosses half the distance in the time for one complete loop, so now the faster pointer has to move around again until it reaches the slower pointer which is half the loop ahead. You can increase the speed at which the faster pointer moves, but then you'll be slower for partial loops that the faster pointer will circle around multiple times before the slower even enters them.

In any case, the situation is completely academic since you should never have to check in code whether a list is circular or not. You should never actually interact with the nodes directly, only the data they contain, which means that you couldn't even be able to create any loops in a non-circular list if you wanted to. If you create your own linked list implementation then your code shouldn't allow for the possibility of a loop when you don't want one and making such a potentially expensive check at runtime inside a library is generally a bad idea.
Manit0u
Profile Blog Joined August 2004
Poland17242 Posts
September 14 2016 10:55 GMT
#15255
Wee! I went over 100 rep on SO. I don't know why but it feels awesome
Time is precious. Waste it wisely.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
September 14 2016 11:40 GMT
#15256
On September 14 2016 19:55 Manit0u wrote:
Wee! I went over 100 rep on SO. I don't know why but it feels awesome


My account has a bit more, but I have no idea how to access it now, because it was registered with openid years ago and that is no longer available to log in. I stopped actively using the site now anyways. The noise-to-signal ratio is constantly increasing on that site.
BluzMan
Profile Blog Joined April 2006
Russian Federation4235 Posts
Last Edited: 2016-09-14 12:13:51
September 14 2016 12:04 GMT
#15257
On September 14 2016 17:34 Morfildur wrote:
Show nested quote +
On September 14 2016 11:15 Blisse wrote:
Why can't you just remove the objects from the list if you know you don't need them?

On September 12 2016 13:25 WarSame wrote:
On September 12 2016 06:52 Blisse wrote:
Yeah, academic integrity policy is intentionally vague so that it's a lot easier on them when they provide proof. Generally it's fine as long as you're just talking about the solution and not given exact pseudo/code. All reasonable professors I've seen encourage discussion, just not discussion with code being written.

I've consulted TL for a bunch of things too.

Instead of giving the problem description, you should abstract it one step up. I know it's a bit harder to do since you're starting out, but asking, "how do you find the smallest range of numbers in a list that contains a given set of numbers?" gives essentially the same solutions, and as long as no one is writing out a program for you, it should be fine asking for help.

-----

Actually it's kind of annoying/interesting that a lot of programming questions essentially rely on tricks that you need to learn first before you can actually solve them. Using sets and dictionaries IMO don't come intuitively, but instead from me reading advice that they're generally how to best solve a problem, and then I base my thinking with that in mind. I think the extreme example is being asked to find a loop in a linked list. No way you can reason yourself to a solution.

I mean, I'm not particularly good, but couldn't you just put the pointer values of each node in a dict when visited, and if you come to a node already in the dict, then you've got a loop?


How would you approach the problem if you couldn't hash the objects because the list is huge?

+ Show Spoiler [hint] +
what if you used two pointers?
+ Show Spoiler [answer] +
what if one pointer moved faster than they other? how were you expected to get to this answer?
+ Show Spoiler +
Obviously I realized I fucked up the interview question :'(

http://www.programmerinterview.com/index.php/data-structures/how-to-find-if-a-linked-list-is-circular-or-has-a-cycle-or-it-ends/



Pointers are tiny, so even a list with a million entries will have pretty much insignificant memory impact compared to the list and data itself, so a simple dictionary solution would still be pretty easy and probably faster, too, since you can abort on the first duplicate node. With the tortoise and hare solution you have to cross the distance that the slower pointer completed already, which means in a completely circular list you pretty much have to check 1.5n elements. The slower pointer crosses half the distance in the time for one complete loop, so now the faster pointer has to move around again until it reaches the slower pointer which is half the loop ahead. You can increase the speed at which the faster pointer moves, but then you'll be slower for partial loops that the faster pointer will circle around multiple times before the slower even enters them.

In any case, the situation is completely academic since you should never have to check in code whether a list is circular or not. You should never actually interact with the nodes directly, only the data they contain, which means that you couldn't even be able to create any loops in a non-circular list if you wanted to. If you create your own linked list implementation then your code shouldn't allow for the possibility of a loop when you don't want one and making such a potentially expensive check at runtime inside a library is generally a bad idea.


On a typical 64-bit machine, for a list of integers, the "next" pointer is 2/3 of each node's size, so you will have a data structure that will be comparable in size to the list itself. Besides, typical implementations of the map data type have additional bookkeeping costs. For the worst case of the loop, in the "pointer hop" solution you're expected to make 3n pointer dereferences (n for the slow pointer and 2n for the fast), I believe. Using an unordered_set, that will turn into n hops for the scan, at least 2n for lookups and insertions (assuming bucket-based hash table with NO collisions at all) and 2n calculations of the hash function and n copies of the pointers. So that's { 3n operator*(ptr) } vs { 3n operator*(ptr) + 2n hash(ptr) + n copy(ptr) } which is already not in favor of the hash-based solution, and that is assuming everything is inlined, otherwise you will have function calls which will make the two non-comparable, really.
You want 20 good men, but you need a bad pussy.
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2016-09-14 12:43:29
September 14 2016 12:16 GMT
#15258
On September 14 2016 16:41 Aerisky wrote:
afaik it's not too obscure, so people might have heard of it. I think I remember seeing it in a small lab assignment in my lower data structures/algorithms class a couple years ago.


Our current interview question is FizzBuzz so I doubt its more known than that if nothing else. If anyone has better suggestions we're overhauling the process because it sucks.

The position/skill level that I interview for is the interns and new graduate devs.

On September 14 2016 17:34 Morfildur wrote:
In any case, the situation is completely academic since you should never have to check in code whether a list is circular or not. You should never actually interact with the nodes directly, only the data they contain, which means that you couldn't even be able to create any loops in a non-circular list if you wanted to. If you create your own linked list implementation then your code shouldn't allow for the possibility of a loop when you don't want one and making such a potentially expensive check at runtime inside a library is generally a bad idea.


While this is true; I wouldn't expect any of the people I'm hiring to write an algorithm anyway. It's mostly about listening to them think through a solution and it has enough right answers that I'd expect them to get one of them even if it isn't the optimal one. If said person can explain the limitations of their answer then I'll be happy with their solution.
I'll always be your shadow and veil your eyes from states of ain soph aur.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-09-14 13:14:56
September 14 2016 13:01 GMT
#15259
--- Nuked ---
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
September 14 2016 17:29 GMT
#15260
On September 14 2016 07:40 travis wrote:
there will be multiple search terms, and I don't know what they are, so I can't set it to another string

I know I can set it to null, I was just wondering if there was a better option - is empty string a thing?

Seems likhe that question still was not answered, or I missed it.
Yes, empty string is a thing. Perfectly normal. And certainly not something you should accept as a search term by the user.
If you have a good reason to disagree with the above, please tell me. Thank you.
Prev 1 761 762 763 764 765 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 3h 33m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Harstem 294
RotterdaM 244
ForJumy 21
StarCraft: Brood War
Rain 5857
Sea 5008
Larva 638
EffOrt 509
Mini 382
Pusan 341
BeSt 317
Stork 316
Zeus 261
Last 205
[ Show more ]
Mind 152
ZerO 138
Snow 128
Hyun 116
Rush 89
Light 74
hero 58
JYJ44
Aegong 43
Movie 29
Sharp 22
sSak 16
NaDa 15
Barracks 11
Noble 11
IntoTheRainbow 9
scan(afreeca) 9
SilentControl 7
Icarus 7
ajuk12(nOOB) 7
HiyA 6
Hm[arnc] 2
Britney 0
Stormgate
NightEnD13
Dota 2
Gorgc4210
qojqva1665
BananaSlamJamma537
XcaliburYe421
febbydoto6
League of Legends
singsing2123
Counter-Strike
x6flipin619
markeloff54
Super Smash Bros
Mew2King160
Westballz10
Heroes of the Storm
Khaldor178
Other Games
B2W.Neo740
DeMusliM501
Fuzer 474
hiko260
Pyrionflax252
XaKoH 248
crisheroes215
SortOf87
ArmadaUGS41
ZerO(Twitch)7
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• StrangeGG 40
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 3
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 1178
Upcoming Events
uThermal 2v2 Circuit
3h 33m
OSC
6h 33m
Replay Cast
11h 33m
The PondCast
21h 33m
RSL Revival
21h 33m
ByuN vs Classic
Clem vs Cham
WardiTV European League
1d 3h
Replay Cast
1d 11h
RSL Revival
1d 21h
herO vs SHIN
Reynor vs Cure
WardiTV European League
2 days
FEL
2 days
[ Show More ]
Korean StarCraft League
2 days
CranKy Ducklings
2 days
RSL Revival
2 days
FEL
3 days
Sparkling Tuna Cup
3 days
RSL Revival
3 days
FEL
3 days
BSL: ProLeague
4 days
Dewalt vs Bonyth
Replay Cast
5 days
Replay Cast
5 days
The PondCast
6 days
Liquipedia Results

Completed

Proleague 2025-06-28
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025
YaLLa Compass Qatar 2025

Upcoming

CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
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
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.