• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 18:14
CEST 00:14
KST 07:14
  • 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 Tall10HomeStory 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
Weekly Cups (June 30 - July 6): Classic Doubles2[BSL20] Non-Korean Championship 4x BSL + 4x China9Flash Announces Hiatus From ASL66Weekly Cups (June 23-29): Reynor in world title form?14FEL Cracov 2025 (July 27) - $8000 live event22
StarCraft 2
General
The GOAT ranking of GOAT rankings The SCII GOAT: A statistical Evaluation Weekly Cups (June 23-29): Reynor in world title form? Weekly Cups (June 30 - July 6): Classic Doubles Program: SC2 / XSplit / OBS Scene Switcher
Tourneys
RSL: Revival, a new crowdfunded tournament series FEL Cracov 2025 (July 27) - $8000 live event Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays Korean Starcraft League Week 77
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ ASL20 Preliminary Maps [ASL19] Finals Recap: Standing Tall SC uni coach streams logging into betting site Flash Announces Hiatus From ASL
Tourneys
[BSL20] Non-Korean Championship 4x BSL + 4x China [BSL20] Grand Finals - Sunday 20:00 CET CSL Xiamen International Invitational The Casual Games of the Week Thread
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread 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
Russo-Ukrainian War Thread US Politics Mega-thread Stop Killing Games - European Citizens Initiative Summer Games Done Quick 2024! Summer Games Done Quick 2025!
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion 2024 - 2025 Football Thread NBA General 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
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 640 users

The Big Programming Thread - Page 690

Forum Index > General Forum
Post a Reply
Prev 1 688 689 690 691 692 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.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
December 09 2015 16:33 GMT
#13781
hi guys,
I am going through a pdf of a lecture I missed and it's going on about defining equals methods

in the example it gives, it is showing how to do an equals method, taking a parameter of type "object", to see if that "object" equals the current object, which is of type "student"

here is what they write


public boolean equals(Object obj) {
if (obj == this)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Person other = (Person) obj;

return name.equals(other.name) && idNum.equals(other.idNum);
}



my question is, why do they do this line:

Person other = (Person) obj;



at this point, haven't they confirmed that the object is a person already?
tofucake
Profile Blog Joined October 2009
Hyrule19031 Posts
December 09 2015 16:35 GMT
#13782
Yes, but not that the object to check is the same person as the one being checked against, which is what the return line after is doing.
Liquipediaasante sana squash banana
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2015-12-09 16:49:06
December 09 2015 16:47 GMT
#13783
Well, you don't mean literally the same person object, right? because that's what this line does:

if (obj == this)
return true;


so my question is, if the object has aready been determined to be a person, then why do they cast that object to type person to check that it's fields are equal to the current object

couldn't they skip


Person other = (Person) obj;


and just at the end do


return name.equals(obj.name) && idNum.equals(obj.idNum);


or does java not let you do that because it can't recognize an object as being a person?
and if that's the case then can't they do


Person other = obj;


instead of


Person other = (Person) obj;



or is that not allowed
supereddie
Profile Joined March 2011
Netherlands151 Posts
December 09 2015 17:24 GMT
#13784
Stongly typed languages (like Java) cannot implicitly convert an object to a more specific object. In this case, Person is a more specific version of Object. If the object is not of class Person but another class, you probaly get an InvalidCastException (or whatever it is in Java) - that is why the check on Class is there.

It is possible to implicitly convert a Person to an Object however

Object myObject = person;
"Do not try to make difficult things possible, but make simple things simple." - David Platt on Software Design
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2015-12-09 19:26:35
December 09 2015 19:20 GMT
#13785
On December 10 2015 01:33 travis wrote:
hi guys,
I am going through a pdf of a lecture I missed and it's going on about defining equals methods

in the example it gives, it is showing how to do an equals method, taking a parameter of type "object", to see if that "object" equals the current object, which is of type "student"

here is what they write

Show nested quote +

public boolean equals(Object obj) {
if (obj == this)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Person other = (Person) obj;

return name.equals(other.name) && idNum.equals(other.idNum);
}



my question is, why do they do this line:

Person other = (Person) obj;



at this point, haven't they confirmed that the object is a person already?

The check if it's exactly the same Person object is this part, you got that right:
if (obj == this)


At the end, we know that obj is a Person, so now we know it's safe to cast it to Person. Which we need for the next line because we can't write this:
return name.equals(obj.name) && idNum.equals(obj.idNum);

While we as humans know that obj is a Person and thus know that it has these fields, the type of the obj reference still is Object. We can't access fields declared in Person on a variable of type Object because Java is a statically typed language. First we tell the compiler to treat the variable as a Person and then we tell it what to do with it.

In dynamically typed languages we can just write
return name.equals(obj.name) && idNum.equals(obj.idNum);

and it will compile just fine, but it will throw an exception during runtime. In statically typed languages we have to make sure that the fields and methods we access match the declared types of the variables at compile time.

On December 10 2015 02:24 supereddie wrote:
Stongly typed languages (like Java) cannot implicitly convert an object to a more specific object. In this case, Person is a more specific version of Object. If the object is not of class Person but another class, you probaly get an InvalidCastException (or whatever it is in Java) - that is why the check on Class is there.

It is possible to implicitly convert a Person to an Object however

Object myObject = person;

Implicit conversion is not relevant here because at no point in the last line we tell the compiler or runtime what type we want to convert it into. There could be a Person type and an Apple type both with the name and idNum fields and both would fit the needs of the last line. We can't convert to anything if it's not clear what we should convert to. We can access fields that are only known to be there at runtime, but that doesn't require conversion.
If you have a good reason to disagree with the above, please tell me. Thank you.
Manit0u
Profile Blog Joined August 2004
Poland17244 Posts
December 09 2015 20:09 GMT
#13786
On December 10 2015 01:01 BByte wrote:
You can also sometimes trick Excel by changing the file extension to txt -- assuming it's currently csv. Alternatively "Paste Special" or similar functionality may work. Excel should also handle large integers correctly.

What are you using to read the file in PHP? Both fgetcsv and str_getcsv should return an array of strings whether you have quotes around numbers or not.


I'm using fgetcsv. And I'm totally dumb (guess it happens after 7.5hrs of coding session). The problem was not with PHP or Notepad++ but with Excel/OpenOffice which was rounding the values. I thought it was the other way around but I've discovered it not to be so by sheer happenstance - I dumped one of the arrays which should be ['arr' [ 'arr2' [ 'val1', 'val2']]] according to the Excel data but turned out to be [ 'arr' [ 'arr2' ['val1'], 'arr3' ['val2']]]. This got me thinking and I've noticed that 2 numbers ending in 41 and 42 respectively were displayed in Excel as 40.

Seriously, fuck that bullshit
Time is precious. Waste it wisely.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
December 09 2015 22:25 GMT
#13787
On December 10 2015 05:09 Manit0u wrote:
Show nested quote +
On December 10 2015 01:01 BByte wrote:
You can also sometimes trick Excel by changing the file extension to txt -- assuming it's currently csv. Alternatively "Paste Special" or similar functionality may work. Excel should also handle large integers correctly.

What are you using to read the file in PHP? Both fgetcsv and str_getcsv should return an array of strings whether you have quotes around numbers or not.


I'm using fgetcsv. And I'm totally dumb (guess it happens after 7.5hrs of coding session). The problem was not with PHP or Notepad++ but with Excel/OpenOffice which was rounding the values. I thought it was the other way around but I've discovered it not to be so by sheer happenstance - I dumped one of the arrays which should be ['arr' [ 'arr2' [ 'val1', 'val2']]] according to the Excel data but turned out to be [ 'arr' [ 'arr2' ['val1'], 'arr3' ['val2']]]. This got me thinking and I've noticed that 2 numbers ending in 41 and 42 respectively were displayed in Excel as 40.

Seriously, fuck that bullshit

Excel is a pain in the ass. We end up using a lot of excel at work for various reasons and it's always annoying. I especially hate it when it changes things numbers with a decimal place or two into dates. And forgets what the original value was, so no amount of reformatting your cells will bring it back.

Always blame excel first. The odds are with you.
If you have a good reason to disagree with the above, please tell me. Thank you.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2015-12-10 04:58:30
December 10 2015 04:55 GMT
#13788
Had a pair programming interview with Square (squareup.com)

Did it in C++. Bad idea.

+ Show Spoiler +

/cygdrive/c/Users/Victor/Documents/GitHub/Interviews/problems/questions/src/states.cpp: In function ‘bool isValidScrambledTransition(std::string, std::set<std::basic_string<char> >, std::vector<std::vector<std::basic_string<char> > >, std::vector<std::basic_string<char> >)’:
/cygdrive/c/Users/Victor/Documents/GitHub/Interviews/problems/questions/src/states.cpp:66:107: error: no matching function for call to ‘find(std::vector<std::basic_string<char> >::iterator, std::vector<std::basic_string<char> >::iterator, std::string&)’
vector<string>::const_iterator current_state_iter = find(scrambled.begin(), scrambled.end(), start_state);
^
/cygdrive/c/Users/Victor/Documents/GitHub/Interviews/problems/questions/src/states.cpp:66:107: note: candidate is:
In file included from /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/bits/locale_facets.h:48:0,
from /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/bits/basic_ios.h:37,
from /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/ios:44,
from /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/ostream:38,
from /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/iostream:39,
from /cygdrive/c/Users/Victor/Documents/GitHub/Interviews/problems/questions/src/states.cpp:1:
/usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/bits/streambuf_iterator.h:369:5: note: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&)
find(istreambuf_iterator<_CharT> __first,
^
/usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed:
/cygdrive/c/Users/Victor/Documents/GitHub/Interviews/problems/questions/src/states.cpp:66:107: note: ‘__gnu_cxx::__normal_iterator<std::basic_string<char>*, std::vector<std::basic_string<char> > >’ is not derived from ‘std::istreambuf_iterator<_CharT>’
vector<string>::const_iterator current_state_iter = find(scrambled.begin(), scrambled.end(), start_state);
^
/cygdrive/c/Users/Victor/Documents/GitHub/Interviews/problems/questions/src/states.cpp:83:79: error: no matching function for call to ‘find(std::vector<std::basic_string<char> >::iterator, std::vector<std::basic_string<char> >::iterator, std::string&)’
if (find(potential_next_states.begin(), potential_next_states.end(), state) != potential_next_states.end()) {
^
/cygdrive/c/Users/Victor/Documents/GitHub/Interviews/problems/questions/src/states.cpp:83:79: note: candidate is:
In file included from /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/bits/locale_facets.h:48:0,
from /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/bits/basic_ios.h:37,
from /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/ios:44,
from /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/ostream:38,
from /usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/iostream:39,
from /cygdrive/c/Users/Victor/Documents/GitHub/Interviews/problems/questions/src/states.cpp:1:
/usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/bits/streambuf_iterator.h:369:5: note: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&)
find(istreambuf_iterator<_CharT> __first,
^
/usr/lib/gcc/i686-pc-cygwin/4.9.2/include/c++/bits/streambuf_iterator.h:369:5: note: template argument deduction/substitution failed:
/cygdrive/c/Users/Victor/Documents/GitHub/Interviews/problems/questions/src/states.cpp:83:79: note: ‘__gnu_cxx::__normal_iterator<std::basic_string<char>*, std::vector<std::basic_string<char> > >’ is not derived from ‘std::istreambuf_iterator<_CharT>’
if (find(potential_next_states.begin(), potential_next_states.end(), state) != potential_next_states.end()) {
^
CMakeFiles/states.dir/build.make:54: recipe for target 'CMakeFiles/states.dir/src/states.cpp.o' failed
make[2]: *** [CMakeFiles/states.dir/src/states.cpp.o] Error 1
CMakeFiles/Makefile2:165: recipe for target 'CMakeFiles/states.dir/all' failed
make[1]: *** [CMakeFiles/states.dir/all] Error 2
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2


couldn't compile code. that was the output. ran out of time.

the fix?

+ Show Spoiler +

#include <algorithm>


FUCK THAT

+ Show Spoiler +

I made it to the next round though.
There is no one like you in the universe.
Khalum
Profile Joined September 2010
Austria831 Posts
Last Edited: 2015-12-10 10:07:24
December 10 2015 08:42 GMT
#13789
Hm but the std::find you're using is defined in algorithm after all - why FUCK THAT?
Or are you complaining about #include in general?
Manit0u
Profile Blog Joined August 2004
Poland17244 Posts
December 10 2015 08:51 GMT
#13790
Can anyone reference some good resources for basic webapp pentesting?
Time is precious. Waste it wisely.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
December 10 2015 15:54 GMT
#13791
Random curiosity question - if you have two Java Linked Lists is there a more efficient way to append them together, abusing the fact that they are both Linked Lists? For example, pointing the last element in the 0th list to the 0th element in the 1st list? Note: This is not what .addAll() does.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
RoomOfMush
Profile Joined March 2015
1296 Posts
December 10 2015 16:10 GMT
#13792
On December 11 2015 00:54 WarSame wrote:
Random curiosity question - if you have two Java Linked Lists is there a more efficient way to append them together, abusing the fact that they are both Linked Lists? For example, pointing the last element in the 0th list to the 0th element in the 1st list? Note: This is not what .addAll() does.

There is not. But you shouldnt be using LinkedLists anyways. There is very little reason to use them over ArrayLists or ArrayDeques. And even if there is, you wouldnt be needing micro optimizations like this.
Cyx.
Profile Joined November 2010
Canada806 Posts
December 10 2015 16:12 GMT
#13793
On December 10 2015 17:42 Khalum wrote:
Hm but the std::find you're using is defined in algorithm after all - why FUCK THAT?
Or are you complaining about #include in general?

I was thinking he forgot to #include <algorithm> for a significant portion of the interview
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2015-12-10 20:11:52
December 10 2015 18:10 GMT
#13794
edit: got the help i needed!
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
December 10 2015 20:32 GMT
#13795
On December 11 2015 01:10 RoomOfMush wrote:
Show nested quote +
On December 11 2015 00:54 WarSame wrote:
Random curiosity question - if you have two Java Linked Lists is there a more efficient way to append them together, abusing the fact that they are both Linked Lists? For example, pointing the last element in the 0th list to the 0th element in the 1st list? Note: This is not what .addAll() does.

There is not. But you shouldnt be using LinkedLists anyways. There is very little reason to use them over ArrayLists or ArrayDeques. And even if there is, you wouldnt be needing micro optimizations like this.

You're right, I was just curious about it. Why is an ArrayList superior to a LinkedList, though?

Also, I'd like a bit of help optimizing some code. I'm trying to find the number of unique ways to make change for an int(i.e. 5 nickels and a penny is the same as a penny and 5 nickels, and only count for one way). My method of doing this is a recursive search. I want to use a HashSet for a memo table, but I'm making 4 new CoinCollection(has a number of pennies, nickels, dimes and quarters) each time, with the first taking the input CoinCollection and adding 1 penny, the second adding a nickel, the third a dime, the fourth a quarter. 4 new objects is a lot for a recursive function. However, I don't see how I can check if my current solution is in the HashSet without making these objects. It would save a lot of computation and stack space if I could avoid making them. Does anyone know how to get around making them? Is there something besides a HashSet I can use?

The source code is here. coinCollections is a global variable to avoid having to put it on the stack every call, but if you have a better way of dealing with that please let me know.

Can it be I stayed away too long? Did you miss these rhymes while I was gone?
tofucake
Profile Blog Joined October 2009
Hyrule19031 Posts
December 10 2015 22:14 GMT
#13796
I would suggest breaking it into smaller parts. Set an order for coins such that everything is set in stone: ie always QDNP or PNDQ or it doesn't even matter. With a set order you automatically see that 5 nickels and 1 penny is the same as 1 penny and 5 nickels and you can discard one result.
Liquipediaasante sana squash banana
Mindcrime
Profile Joined July 2004
United States6899 Posts
December 10 2015 23:31 GMT
#13797
Anyone know anything about .NET's SqlCommand.CommandTimeout property? According to the documentation, it is the amount of time that the program will wait before terminating an attempt to execute a command and then generate an error. However, it would seem that it sometimes stops a query but then doesn't generate any error at all.

There's an automated report that I'm responsible for that queries our database and then uses the results to build the contents of an email to send to a small group of people who need that data. The report runs at 7:30 in the morning and usually completes within about 1 minute. It's a pretty important report though, so it got the standard CommandTimeout = 10000 that our other important batches get. And today it didn't complete in 1 minute; instead, it finally sent out the email at 10:17 (read: 10000 seconds later), without ever throwing an exception, and the email's contents indicated that the query returned no results and that is not good because it definitely returned something when I ran it in SSMS. So what am I missing here?
That wasn't any act of God. That was an act of pure human fuckery.
hooktits
Profile Blog Joined February 2008
United States972 Posts
December 11 2015 01:42 GMT
#13798
ok guys i'm back with a question i hope this is not too vague, but long story short as possible ^_^
Ok so i'm making a site and it will require some admin type stuff but i don't wanna spend time programming a giagantic advanced admin system, its not needed. Althought i have never built an admin system i know how to if need be However again i am gunna be the only admin for a small site but must be its important to be a very secure site. So that being said i'm trying to avoid the whole separate admin login section and tons of admin pages (maybe a few)because i just don't need it too much. Alot of the stuff i could just go in to phpmyadmin but some i wanna have a basic way to define a special user being me and have my log in more secure.


So my thought process is use the regular login system but have some kind of conditional statement that determines that when i log on it will know its me and i want to encrypt my password stronger so i'm so lets say for the regular users there passwords are made using blowfish $2y$modifier of what ever something not to high so it doesn't take for ever to log in for them) then use a salt to create a password hash for them but when i log in it will recognize my user name and and then probably run same blowfish stuff but high modifier. there is a column to differentiate from regular user and admin and me being only admin.

So then using that plan to login in a slight more secure way (ill make a nice large password with lots of knicknacks and a higher modifer). So that would be how i login and then most of the stuff echoed out on the pages if it needed a some extra admin stuff i could have a condition that specifies that if this is the admin logged in etc then echo whatever on the page the normal stuff for users but with extra features" So does this plan sound bad or should i have separate pages for all my admin stuff?


So i'm sorry that was so vauge i didn't wanna make it too long with tons of unneeded code,i know how to code and i know you guys replying know how to way better then me but my question being would this be a secure way of making a login to admin system, Now keep in mind people would be able to enter my user name (they would know it) and potentials try to gain admin access but my pass will wayyy stronger and they won't know the information described in here?

and i guess other then that i feel pretty confident in my ability to protect against sql injection but again it would be quite important that no one gains access to this and i guess that would depend on how i code it and if i cleanse all data being placed into a data base as well as make sure there is coding that prevents a regular user from being on a page he shouldn't be, so if i did have 1 or 2 admin pages have conditions that check to see who the the user is and if they are not me then they get ushered away from the page the shouldn't be on.
I do that on all pages if a user has no need to be there the set conditions that user them away...


I feel get i'm gunna get shit for this post but i'm sorry i have taken the time to learn html css php javascript mysql etc but i'm a newb and i have started projects and never finished them but this one i HAVE to finish and i wanna get it right so if you see any red flags about what i stated above then let me know this sounds like a bad idea and why.. thanks again i love this thread and TL thank you seeya
Hooktits of Tits gaming @hooktits twit
Manit0u
Profile Blog Joined August 2004
Poland17244 Posts
Last Edited: 2015-12-11 02:29:07
December 11 2015 02:24 GMT
#13799
@hooktits:

First of all, making your admin password more encrypted than regular users won't help that much. Just using password_hash($password, PASSWORD_BCRYPT) should be sufficient in most cases (you can expand it to password_hash($password, PASSWORD_BCRYPT, [ 'cost' => 10 ]) if you think it'll help you much). You generally want all users using the same thing since admin will be saved along them. Where they differ is their permissions.

Website security isn't all about how secure your admin account is. It doesn't mean crap if you have the most secure hashing algorithm and some crazy 128-character length password if someone can go around it by tampering with other parts of your application (giving regular users admin access, breaking into your server and seeing the code etc.). There are pretty crazy things you can do with even pretty basic XSS attacks.

Second of all, unless you absolutely have to write this thing from scratch I'd suggest you don't reinvent the wheel and go with some reliable framework instead. This will give you access to more tools right off the bat and save you a lot of time. Frameworks such as Symfony or Laravel make developing PHP apps pretty enjoyable and you get all the basic security you want with them right off the bat (SQLI, CSRF, admin/user/anonymous user authentication etc. all built-in). On top of that they're built with modern approaches and best practices in mind.

The worst thing you could possibly do here is trying to do it yourself without much experience. You'll end up with a page that's in the 90's or early 2000's security-wise (SQL statements in the views and other bullshit like that). Also, don't ever use WordPress...

Also, try to tackle one thing at a time. Right now it seems like you have a very vague idea on how your project is going to work/look like. One day spent planning can save you a week of work. Focus on that first.
Time is precious. Waste it wisely.
Ropid
Profile Joined March 2009
Germany3557 Posts
Last Edited: 2015-12-11 02:55:42
December 11 2015 02:55 GMT
#13800
On December 11 2015 05:32 WarSame wrote:
You're right, I was just curious about it. Why is an ArrayList superior to a LinkedList, though? [...]


This feels like some dirty secret that's not mentioned when learning about data structures.

Here's a video of a presentation about linked lists vs. arrays from the guy that created C++:

+ Show Spoiler +
"My goal is to replace my soul with coffee and become immortal."
Prev 1 688 689 690 691 692 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 46m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 728
ProTech67
ROOTCatZ 56
Livibee 53
JuggernautJason32
UpATreeSC 1
StarCraft: Brood War
Artosis 240
Rock 24
MaD[AoV]14
Stormgate
Nathanias73
Dota 2
NeuroSwarm51
League of Legends
Grubby4548
Counter-Strike
Fnx 2254
taco 746
Stewie2K688
flusha402
sgares146
Super Smash Bros
PPMD146
Mew2King84
Heroes of the Storm
Liquid`Hasu569
Other Games
summit1g7854
tarik_tv2375
fl0m700
mouzStarbuck293
ZombieGrub59
Maynarde17
Organizations
Other Games
gamesdonequick49954
BasetradeTV29
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 22 non-featured ]
StarCraft 2
• kabyraGe 268
• musti20045 36
• davetesta33
• IndyKCrew
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• intothetv
• Kozan
StarCraft: Brood War
• 80smullet 31
• Eskiya23 20
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Stormgate
• mYiSmile10
Dota 2
• masondota2985
League of Legends
• Jankos2288
• TFBlade1022
Other Games
• imaqtpie1968
• Shiphtur533
• WagamamaTV222
Upcoming Events
Replay Cast
1h 46m
Sparkling Tuna Cup
11h 46m
WardiTV European League
17h 46m
MaNa vs sebesdes
Mixu vs Fjant
ByuN vs HeRoMaRinE
ShoWTimE vs goblin
Gerald vs Babymarine
Krystianer vs YoungYakov
PiGosaur Monday
1d 1h
The PondCast
1d 11h
WardiTV European League
1d 13h
Jumy vs NightPhoenix
Percival vs Nicoract
ArT vs HiGhDrA
MaxPax vs Harstem
Scarlett vs Shameless
SKillous vs uThermal
uThermal 2v2 Circuit
1d 17h
Replay Cast
2 days
RSL Revival
2 days
ByuN vs SHIN
Clem vs Reynor
Replay Cast
3 days
[ Show More ]
RSL Revival
3 days
Classic vs Cure
FEL
3 days
RSL Revival
4 days
FEL
4 days
FEL
4 days
CSO Cup
4 days
BSL20 Non-Korean Champi…
4 days
Bonyth vs QiaoGege
Dewalt vs Fengzi
Hawk vs Zhanhun
Sziky vs Mihu
Mihu vs QiaoGege
Zhanhun vs Sziky
Fengzi vs Hawk
Sparkling Tuna Cup
5 days
RSL Revival
5 days
FEL
5 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs Dewalt
QiaoGege vs Dewalt
Hawk vs Bonyth
Sziky vs Fengzi
Mihu vs Zhanhun
QiaoGege vs Zhanhun
Fengzi vs Mihu
Liquipedia Results

Completed

BSL Season 20
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
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

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
CSL Xiamen Invitational
2025 ACS Season 2
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.