« first day (311 days earlier)      last day (3699 days later) » 

3:00 AM
I sympathize with them in a way. I'm sure to them, they don't understand all of the parts that are involved and they think there's just some way to start coding. It's like if you ask someone who's never programmer before how long they think facebook took to make. They'll give some hilariously low answer. It's just a case of someone who knows so little that he has no idea how truly little he knows.

At the same time though, he's a lazy bastard who is obviously not trying, and for that, he's still obnoxious.
 
G'night!
 
Night
 
0
Q: Modularizing an else if statement

PlattStudent101Is there any way to take this chunk of an else if and make it its own method? I would need the values of valid and throwLine() to be done in the method containing this if else statement, but I'm around 45 lines in my method which is 15 more than I'm allowed to have for simplicity. else if(is...

 
3:19 AM
@rolfl You didn't mention any string matching algorithms?
In computer science, the Aho–Corasick string matching algorithm is a string searching algorithm invented by Alfred V. Aho and Margaret J. Corasick. It is a kind of dictionary-matching algorithm that locates elements of a finite set of strings (the "dictionary") within an input text. It matches all patterns simultaneously. The complexity of the algorithm is linear in the length of the patterns plus the length of the searched text plus the number of output matches. Note that because all matches are found, there can be a quadratic number of matches if every substring matches (e.g. dictionar...
 
Nope, searching 1 value does not need anything more complicated
He'll have his hands full with the byte-buffer anyway
 
@rolfl Hmm, good enough for me then. +1
 
3:32 AM
1
Q: Security: Scale and cache images

Dave JarvisSpecification A simple PHP script resizes images on-the-fly. The script is called by the web server's 404 handler to return a scaled version of the original. For example, if the original image is at: http://localhost/images/filename.jpg Then valid requests for scaled versions includes: http:...

 
It takes a surprisingly large amount of code to implement std::list >.<. I've got about 70% of it implemented, and it's sitting at almost 400 lines. Then again, the last 30% will just be thin wrappers around already existing methods....
 
@Corbin Yeah--a semi-unreasonable amount of near repetition to implement begin/end, rbegin/rend, cbegin/cend, crbegin/crend, etc.
 
Yeah. Not to mention all the boilerplate-esque code of operators, iterators' operators, etc. It's very little true code :(
 
@Corbin Yup. Such is the life of a library writer...
 
3:47 AM
Even on a linked list though, it's been a good refresher of a few of the things I had come across in the past with containers. like dealing with the whole list(size_type, value_type) and template<typename Iter> (Iter first, Iter last) being ambiguous if value_type is an integral type issue
I might just be weird, but I actually have a weird love of implementing containers.
 
@JerryCoffin Here is the regular expression library I was talking about before:
0
Q: A regular expression parsing library in C

syb0rgI've created a regular expression (regex) parsing library in C, and would like some feedback on it. Speed is really important to me, but any and all suggestions are acceptable. #include <ctype.h> static int regex_matchHere(const char *regex, char *s, int *len); static int regex_matchGroup(int ...

 
I don't think there's a standard container I haven't implemented at least 80% of at some point
 
@Corbin valarray? :)
 
@Yuushi Hahaha, touche. No, I have not implemented valarray. It would actually be pretty simple unless you got into the SIMD stuff (which is basically the point...)
 
I've never actually farted around with trying to write a deque
 
3:51 AM
1
Q: A regular expression parsing library in C

syb0rgI've created a regular expression (regex) parsing library in C, and would like some feedback on it. Speed is really important to me, but any and all suggestions are acceptable. #include <ctype.h> static int regex_matchHere(const char *regex, char *s, int *len); static int regex_matchGroup(int ...

 
Oooo I actually don't think I've done a deque either. I should do that next. It has a lot of rather interesting requirements.
 
@Corbin quit playing in the puddles.... make it thread-safe!
 
yeah, it'd actually be slightly tricky
 
Hrmm, yeah.
@rolfl Hah. As long as it can be inefficient, that's trivial :)
 
If you want to really get a boost, use the new Haswell TSX tools to implement an optimistic system using transactional memory
 
3:55 AM
>.<
 
Transactional Synchronization Extensions (TSX) is an extension to the x86 instruction set architecture that adds hardware transactional memory support, speeding up execution of multi-threaded software through lock elision. TSX was documented by Intel in February 2012, and debuted in June 2013 on Intel's microprocessors based on the Haswell microarchitecture. Haswell processors below 45xx as well as R-series and K-series (with unlocked multiplier) SKUs do not support TSX. There is also experimental support for TSX emulation in a QEMU fork, and via emulation available within the Intel Soft...
 
I uhhh... Would love to, but... uh...I uhhh... don't have access to a haswell CPU. Yeah....
:p
 
It's OK, the IBM Power8 architecture also has it ..... they will be released 'real soon now'. ;-0
 
lol
 
(I have one in the lab ... ;-) )
 
3:58 AM
ooo nifty
 
Available implementations: gcc 4.7+ for C++
No C? :(
 
:p
 
Yeah, except TM requires thinking about things completely differently, and it is a real head-scratcher to get it right.
Since people have, for the past few decades, been writing code to lock-and-work, it is counter-intuitive, and requires a different algorithm, to work-and-redo-if-failed.
You sort of have to redo things from the beginning to get it right and make it useful.
 
4:21 AM
0
Q: Auto change page title while bookmarking a page

annnHere is what I'm trying: Please review the code: function quicklyChangePageTitle() { var currentTitle = document.title; // remember original title document.title = "temp title"; // change to the temporary title setTimeout(function() { // revert back to original title document.title =...

 
5:17 AM
0
Q: Is it bad practice to pass a DTO into a static domain 'Create' method?

Sean AndersonI've got the following code: public static Playlist Create(PlaylistDto playlistDto, IUserManager userManager, IPlaylistManager playlistManager) { Playlist playlist = new Playlist { Id = playlistDto.Id, Items = PlaylistItem.Create(playlistDto.Items, playlistMan...

 
is anyone still here?
 
I am, but I'm about to go.
 
I'm hovering around
 
I am thinking about adding another post
I haven't changed the Decide Winner portion of the code though.
 
5:39 AM
I am here as well. But half asleep. And just lurking :p
 
0
Q: Can I use posted programs as inspiration?

DaimyoKirbyI often am stumped for ideas of what I want to try making next with my tiny Python vocabulary. Most things I think of are either too big or I'm not sure where to start, and so Code Review seems like a great place to browse for ideas of what to try next. Is there anything wrong with recreating pr...

 
6:07 AM
0
Q: Linked List implementation and manipulations in C

sc_rayWhile trying to learn some more C, I decided to implement a linked list and perform a few operations on it. The first thing I wanted to do was read from a csv of numbers (ex: 1,2,3,...) and store the numbers in a Linked List. Once I have the linked list, I want to reverse the linked list and t...

 
6:19 AM
0
Q: Python Greedy Algorithm - Jewel Thief

user3385538I am writing a greedy algorithm (Python 3.x.x) for a 'jewel heist'. Given a series of jewels and values, the program grabs the most valuable jewel that it can fit in it's bag without going over the bag weight limit. However, I have trouble finishing it. I just can't think of anything right now. T...

 
 
2 hours later…
7:49 AM
morning
 
8:04 AM
morning..
 
morning!
some meetings today, for once...
 
:o meetings?
 
8:23 AM
0
Q: Recursive Function, Highly performance Critical

Oxinaboxdef uniop_nested(func,o_list): def inner(i_list): ¦ if isinstance(i_list[0],np.ndarray): ¦ ¦ ¦return map(func, i_list) ¦ else: ¦ ¦ ¦return map(inner, i_list) return inner(o_list) def binop_nested(func, o1, o2): if not isinstance(o1,np.ndarray): ¦ r...

0
Q: Managing Contact Collections

Matt FitzmauriceI have a WPF/MVVM form that contains sections for managing Recipient Contacts, CC Contacts and BCC Contacts. Each of the three sections has buttons/ICommands for 'Add', 'Clear', 'Previous' and 'Next' that move through the collection of objects. I'm trying to work out how I can remove the repeat...

0
Q: PHP: PDO (mysql) connection and query class

cbe alexgooglin` for a pdo class that can be easy to customize i found this PHP: PDO (mysql) connection and query class, safety and logic and i found that class that Zak proposed class ApplicationResourcePool { static var $_dbHandle; // line 5 private static $_dbConfig = array( 'dsn' => '', ...

 
9:00 AM
0
Q: Is there cleaner way to do this on JavaScript?

nakkeruI created a very basic "image projector" that shows the current one and shows the next on clicking into the image. And yeah, it works, but I don't think that's a very elegant way to do it. Any advice please? Bear in mind I'm just starting my JavaScript classes and that's my third assignment, bu...

 
9:12 AM
0
Q: '100' is a magic number

janosMagic numbers are bad. I totally agree. But there's a magic number I find hard to fix: '100' is a magic number. Consider this code: public double getPercent(double rate) { return rate * 100; } public double getRate(double percent) { return percent / 100; } Sonar will raise 2 vio...

 
10:01 AM
0
Q: jQuery HTML5 data attribute text() swap on hover

jshjohnsonSo this is a very basic script really. If the screen width is larger than say a tablet, and a portfolio link is hovered over, it will fade out the original text and replace it with the text held in the 'data-portfolio' attribute. I'm fairly new to jQuery so any improvements will be welcomed. You...

 
10:18 AM
flup
 
11:10 AM
0
Q: Optimizing a cross join with 'where UTL_MATCH.EDIT_DISTANCE >='

AndreasI've written a query to compare the clients in our database with the people in a list that I've received. I've created a temporary table which has been filled with the names and the query below makes a cross-join with the two tables. That query works very slowly (two very large tables), so I was ...

 
11:34 AM
0
Q: Shorter way of my displayError() function

Kid DiamondIs there a way I can write this function with less code? jQuery function displayError(display, string, xhr) { var args = arguments; var $error = $("div#error"); var visible = $error.is(":visible"); if(args.length == 1 && typeof display === "boolean" && display == false) { ...

 
11:59 AM
0
Q: Performance optimization in function for datastructure mapping

some_coderi want to optimize a perlfunction wich is frequently used in my application. The function creates a special datastructure from the results of DBI::fetchall_arrayref which looks like: $columns = ['COLNAME_1','COLNAME_2','COLNAME_3'] $rows = [ ['row_1_col_1', 'row_1_col_2', 'row_1_col_2'], ...

 
12:44 PM
@StackExchange never posted my question in here!!!!?
1
Q: RPSLS is less messy now, but is it clean?

MalachiThis is a follow up to the following questions: RPSLS Game in C# Is my coding technique progressing in terms of C# loops? I haven't made my way to Deciding a Winner yet but that is next on my To-Do List, I would like the majority of Focus to go into what I have done with the rest of the code, ...

 
0
Q: Converting data when output std container via ostream_iterator

LoomI have a strongly typed enum and std::vector of this type. enum class Colors { red, green, blue }; std::vector v = { Colors::blue, Colors::red }; I trying to output v to standard output via std::copy. std::copy(v.begin(), v.end(), std::ostream_iterator<Colors>(std::cout, " "); Compilation ...

 
1:05 PM
hi mat
 
hello!
 
how are you mat?
 
good, good ;)
 
my name is sham, call me Sham
 
if you want Sham - you might want to edit your profile to reflect that :)
So your critters have a public void update(Iterable<Critter> critters) method right?
 
1:06 PM
oh is it?
i was just wondering, if this signature would help me
with list of Critters
 
When the Ocean class cycles through all critters and calls their update method, the ocean passes in the list of critters...
 
so a critter that's running its update method knows where every other critter is ;)
now I do C# so for me that would be done with LINQ, but in Java you'll have to iterate the list and put conditional logic to "find" nearby critters.
 
when you say list of critters, it is nothing but list representation of say 25x25 array of ocean, right?
if i had array representation of critters my code would have been simple as ...
private boolean checkNeigborForFish(int x, int y){
for(int i = x-1;i <= x+1; i++){
for(int j = y-1; j <= y+1; j++){
if(this.isFish(mod(i,this.height), mod(j,this.width))){
return true;

}
}
}
return false;
}
 
no, it's a List<Critter> that contains Critter instances (could be 20 Fish and 15 Shark instances, plus 200 Sponge critters and another 150 Shrimp)
 
1:13 PM
becasue location property is shifted from ocean to creature
 
no, location doesn't belong in Ocean...
 
yes, location property belong to creature, you are right
but finding neighbor is very difficult
i mean...
let me take first creature in list
how do i know , who are its 8 neighbors
 
you don't: all you need to know is whether there's a critter nearby - wherever that is.
 
The answer to my question could use some upvotes :)
5
Q: A regular expression parsing library in C

syb0rgI've created a regular expression (regex) parsing library in C, and would like some feedback on it. Speed is really important to me, but any and all suggestions are acceptable. #include <ctype.h> static int regex_matchHere(const char *regex, char *s, int *len); static int regex_matchGroup(int ...

 
1:16 PM
so if (critter.location.X == this.location.X +/- 1 && critter.location.Y == this.location.Y +/- 1) then critter is a neighbor of this ;)
 
You can also refer to locations such as (4, 0) or (-4, 3), which are
both the same as (0, 0) in a 4x3 ocean. (More generally, the coordinates in
an ixj ocean are taken modulo i for the x-coordinate, which is horizontal, and
modulo j for the y-coordinate, which is vertical.) Any pair of integers will
give you a valid position in the grid by "wrapping around" at the edges.
1) If a cell contains a shark, and any of its neighbors is a fish, then the
shark eats during the timestep, and it remains in the cell at the end of the
timestep. (We may have multiple sharks sharing the same fish. This is fine;
they all get enough to eat.)
any of its neighbor in the sense 8 neighbor
 
yes, but you don't need an array to compute that.
 
ok
so critter is queried creature
what is this?
'this' in this scenario?
 
this represents your current instance - the critter being updated...
like, this code is in your `Shark` class, which derives from `Critter`:

    @Override
        public void update(Iterable<Critter> critters)
        {
            // are we hunting a target already?
            if (_currentTarget != null)
            {
                // try to get closer.. and try to eat!
                return;
            }
            else
            {
                // is there a fish nearby?
                for(Critter critter : critters)
                {
                    // if there's a fish (viz not a shark) in sight, make it our target.
 
Please format that code :) -> Fixed format
 
1:23 PM
@skiwi I could have sworn I'd done that ;)
 
hehe :P no worries
 
So the logic that determines whether a shark can capture a given critter, should be coded in the bool canCapture(Critter critter) method
(not sure about bool - make that the primitive type, in C# that's what it is)
that method will return true if the specified critter is an instance of a Fish (or whatever else is edible for a Shark), and within 1 unit of distance from the shark's current location (this).
 
I hate it when I'm so desperate for an answer that I have to resort to using SO.
5
 
m not aware of generics so i will consider argument as doubly linked list(DLL) of critters that Ocean maintained. for each node of DLL, i need to call update method from ocean, something like creature.update(sea);
 
something like that, yeah - except the creature doesn't need to know everything about the sea, just what other creatures are in it.
 
1:30 PM
I have implemented solution in non-obj approach, this is my first attempt to give solution on OOP
 
Hi @GraceNote!
 
Hey
 
73 rep points until max for the day
Hi @GraceNote
 
@Malachi look at you!
 
0
Q: Concerned with Enums, JSON, and ASP.NET MVC

CielI am writing an application that uses ASP.NET MVC for its front end, and for the back end, it uses RavenDB to store data. This has so far worked out great, but I am hitting a huge wall with the use of enum in selecting things. The problem comes with front end interaction. I have many places wher...

 
1:31 PM
Hi @GraceNote
@Malachi You starred a "hi"?
 
But Mat to find 8 neighbors we are searching complete DLL
for(Critter critter : critters)
is that true?
 
@user3317808 yes! And that's much more efficient than scanning the entire ocean! And you can quickly "filter out" critters that aren't in X +/- 1 and Y +/- 1, and exit the loop as soon as you've found something to eat!
@syb0rg was actually a "Hey" ;)
 
but from ocean we would call update() method for each node in DLL right?
 
yep
that way you don't care about the EMPTY coordinates ;)
 
when u catch fish/shark/empty's update() method for each node, you will traverse complete list of critters in that update() method
ya i had one point regards to EMPTY
 
1:37 PM
You could, but you should filter to go through just those that are within range
gotta go, back in a couple minutes
 
ok
waiting for u ):
 
0
Q: Does this code follow common best practices?

nKandelFollowing code is used to find the usual_gp(General Practitioner) from gpCollection variable of type TreeMap<Long(Date), SummableMap<String(GPId), Integer(GPCount)>> and store result (usual GP) along with date on usualGPCollection Map. Does this code follow common best practices? Logic implemente...

 
1:50 PM
1
Q: How should I structure my Unit tests for minimal Asserts?

krillgarI always see comments about how a Unit Test should only be testing one piece of functionality. For the most part, I definitely agree with that assessment. However, I'm working on testing a method right now that has me pondering if being laxer on this ideal would be a better thing, so I'm curious ...

 
@syb0rg it is important that everyone knows that Community Managers do enjoy our company from time to time.
 
If you look at my 5 most recent questions, they look palindromic:
Almost*
 
@Mat'sMug @Jamal @All
38
Q: Let's go on a mission

DoorknobWe've been in beta for 1129 days. Don't you think it's time we get out? We seem to be in a similar situation as Code Review. We don't have enough users with sufficient reputation to gain privileges like voting to close and delete. Here's some quick analysis I did with the API (the percentages a...

^^^ copy-cats
 
@Mat'sMug say ocean looks like this SEESE
FEEFE
2x2 ocean
 
And so the race begins. For Code Review!!syb0rg 7 secs ago
3
 
2:08 PM
0
Q: Is this the good way to create a article in HTML5?

YanickIs this the good way to create a portfolio article in HTML5 or do you guys have any suggestions? Not sure about the section but I need it as overlay over the image. Is it better to use a DIV instead? <article class="three columns remove-all project"> <section class="project-information"> <

 
Are we there yet?
3
 
@GraceNote In your opinion, who is better: Code Review or Code Golf?
Be honest ;)
 
hehe
gotta work a little...
 
@Mat'sMug I hate when work gets in the way of chatting.
 
@JerryCoffin no worries, 2nd Monitor remains... on my 2nd monitor ;)
I hope user3317808 gets the "ah-HA!" moment I was hoping to trigger... am I a bad "teacher"?
 
2:18 PM
0
A: Let's go on a mission

rolflCodeGolf Site activity: The above chart shows me that you guys have had a huge surge in activity since December (maybe Grace is right about the code-trolling ) As part of the CodeReview crowd that is interested in graduation, I have been putting together a bunch of SEDE queries that are usefu...

 
@syb0rg you're not really expecting an answer to that, right?
 
@Mat'sMug Ehh, I hoped for the best.
 
0
Q: This code intends to highlight on the menu/navigation, the current location of the user.

user3393013New to JavaScript and Jquery, I'm looking for some help/guidance as to why the following code is not functioning properly. The code intends to highlight on the menu/navigation, the current location of the user. I have multiple navigation menus on my site for stylistic purposes. Each major div has...

 
@StackExchange off-topic?
new leader:
7
A: Code-Challenge #2

CorbinStandard-Compliant Container Implementation What? Pick a language of your choosing and a container of your choosing and implement it, fully conformant to the standard. For example, this could mean picking C++ and implementing std::unordered_map or std::vector, or perhaps Java's java.util.ArrayL...

 
2:23 PM
Hi all! :)
 
Hey @Morwenn
 
hey
 
Anything new?
 
I don't actually mind, I've never implemented a Stack<T>, ...actually I don't think I've even used one...
wait, no.. my deck of cards had a Stack<Card>
 
2:25 PM
It's really useful when you don't want to hear "use X library" while you know such a library exists and you're just looking for a review.
 
@Morwenn I don't think @SimonAndréForsberg meant the tag... ;)
 
@Mat'sMug Oh, I see.
 
I'm still not over the totalCowCount
 
Actually, when I read "typo", I was totally expecting something along the lines of totalRowCunt.
 
@syb0rg Apples and oranges.
4
 
2:41 PM
@GraceNote Mmmm...apple pie...
 
@Mat'sMug I actually don't like the tag either :)
 
Apples and Windows?
iAgree...
2
 
@GraceNote - are you aware of whether there is a forum/chat room that is regularly used for discussing the StackExchange DataExplorer ? I am not interested in asking for help on MSO, but if there was a site/chat room, etc... ?
@GraceNote - never mind... I created one.... ;-) chat.stackexchange.com/rooms/13526/…
 
3:06 PM
@rolfl I don't know of one otherwise dedicated to it, no, but you can poke in say the Tavern over on chat.meta
 
Thanks
 
3:31 PM
Morning @Jamal
 
Morning!
 
Yess!!! I knew I was right! Thansk @Pakman!
@NateC-K From Microsoft's Names of Type Members (4.5): "1. DO name collection properties with a plural phrase describing the items in the collection instead of using a singular phrase followed by "List" or "Collection." 2. DO name Boolean properties with an affirmative phrase (CanSeek instead of CantSeek). Optionally, you can also prefix Boolean properties with "Is," "Can," or "Has," but only where it adds value." — Pakman 13 mins ago
 
3:54 PM
Is there a way one can diagnose a threading deadlock in a test environment, that doesn't occur in a dev environment? Like, what tool can I use to hook into a running process and see where it's stalled? Is that even possible?
 
4:21 PM
@Mat'sMug if you were running Java ......
> This Stack Exchange site is temporarily offline, routine maintenance usually takes less than an hour. If this turns into an extended outage you can follow the status on the status blog.
 
@rolfl ........ ?
 
@Mat'sMug As I recall, you do mostly Windows, don' t you? I don't know of a commercially available tool, but the basic idea is certainly possible.
 
just downloaded ProcessMonitor, I'll see what I get...
 
4:59 PM
Dear diary, today I downvoted an Eric Lippert answer, and not just because I hold a grudge against C#.
9
 
Thsi company has found a goldmine: store.steampowered.com/search/…
 
@amon - that 'function' for RPSLS is relatively well known ;-) You just have to order the conditions right.
 
@rolfl Hmm. It's not in the Wikipedia article on rock-paper-scissors, so it obviously doesn't exist. Using such a formula is still a massive KISS violation
 
@rolfl When I was writing mine, I considered such a possibility. It seemed fairly obvious such a thing must exist, but after a few minutes, I decided it was sufficiently non-obvious that it could only reasonably qualify as obfuscation.
 
it's actually like a mathematical model of RPSLS... interesting... and hey, Eric Lippert agrees with me!!
I think I'll upovote that answer when I have ammo, be it just for posterity!
that said Eric Lippert is the newest 2K user on CR :)
 
5:15 PM
0
Q: Robust Retry Handling for Azure Message Queues & Multi Instance Worker Roles

Eoin CampbellI'm building a task processor worker role. Tasks are inserted into a simple DB Table (Guid, Json string, Status) and then the Guid is pushed onto an azure message queue. The worker role will then pop the message from queue, retrieve the JSON instructions from the DB & process that task. I'm tryi...

 
^ four new tags, two of them bad. Also off-topic (because of pseudocode).
 
wow wait a minute, the guy created a ??!! How about retagging with ?
3
 
@Mat'sMug How about creating an alias of for ?
 
I killed it, along with . I may now try to have them both blacklisted.
 
yep
 
5:21 PM
0
Q: WPF Single Instance

AeroClassicsIn WPF Single Instance Best Practices Evan Wondrasek posted a great answer and I have added it to my application. This appears to work really well with one small exception. When I implemented this I have lost my splash screen and i do not know why. Can anyone explain why my splash screen no long...

 
^^ So off-topic it hurts
 
The one before was still quite painful. :-) Anyway, I've contacted Tim to have both of those tags blacklisted.
 
what is idempotency?
 
> A function is said to be idempotent when it can be called multiple times without changing the result.
 
5:27 PM
thanks
 
A function is said to be impotent when calling it multiple times produces different results.
 
38 more points until I max out
 
guh star-capped..
 
@amon you hold a Grudge against C#?
 
5:33 PM
@Malachi sure: how dare it be better than Java? (for high-school me, dabbling in C# was eye-opening in contrast to Java: languages can be fun and productive without excessive boilerplate. Unfortunately, the MS <-> Mono incompatibilities and the lack of documentation were discouraging. Soon, I found Perl to be more interesting)
 
1
Q: Horizontal menu for 3 items

HC_My task was to create a menu that displays three items (A,B,C), and has two nav buttons <- and ->. So for example, a menu of (A, B, C, D, E) starts off showing A,B,C and can press -> twice to display C,D,E. My questions beyond general code review feedback are: How would you view the "programme...

 
@amon why the need for Mono? Visual Studio won't do?
 
@amon I have been trying to work with C# in MonoDev and it is fun
@Mat'sMug can't use Visual Studios on Linux
@Mat'sMug but you can use Mono on Windows, kind of like strep throat for windows only it's more fun to get
 
@Mat'sMug While VS Express was more fun that using MonoDev, I had no interest in learning a locked-in platform. So I tried both, but neither resonated with me
 
I love being locked-in. So much less trouble!
 
5:37 PM
I like being able to use my knowledge without having to pay someone to use something I already paid to learn how to do.
yeah I think that makes sense and is straight to the point
@SimonAndréForsberg trying to sell your question on my post!! how dare you!!! JK
 
he wants an Eric Lippert review too!
 
@Malachi Nope, just trying to make you think twice before using Eric's suggestion.
And also trying to make Eric think twice before suggesting it. :) Or at least point out the possible danger when suggesting it.
 
@SimonAndréForsberg I have a different idea, did you read my comment? multidimensional arrays or something similar
 
I'd gladly have him review my C# code. I don't think he'd like to review some Java code though.
Multidim arrays seems OK. But I like the mug's solution.
 
Mug. Capital M. ;)
 
5:41 PM
The name's Mug, Mat's Mug.
4
I want my code shaken, not stirred.
2
 
^^^^TS
 
Compile Another Day
This Code is Not Enough
Readability Never Dies
6
 
lol!!
 
@Malachi You can pretty much copy from my question (but at least consider the answers to it as well).
 
@JerryCoffin what question are you talking about?
 
5:48 PM
@Jamal ...and the classics like Dr. Go.
@Malachi RPSLS.
 
By the way, I'm redoing my Bejeweled program. I'll still have to figure out a better algorithm for the gem-matching, but I won't worry about that now.
 
@JerryCoffin that is C++ I don't know that stuff....lol JK I am not sure that I want to use a boolean 2 dimensional array, I will have to take a look at it later. if you turn it into C# you could post an answer on my Question...lol
 
Hello all
 
Hi @Ben! Welcome to The 2nd Monitor!
 
0
Q: Safety issues in PHP log-in system

PhpJuniorThis is a user login (some session wrapper I managed to put together after a lot of web searching). It's for a simple CMS I'm trying to build. It only needs one user and there is no need for multiple user log in at the same time. It works, the problem being I think it has safety issues. It wo...

 
5:54 PM
@Mat'sMug thanks :)
 
@Jamal Bejeweled!! I'm submitting that for !
 
@Malachi Yes--I wrote it as two separate arrays (one of Booleans, one of strings for the names), but it's open to argument that one array of structs holding both would make more sense. I suppose I could turn it into C# (and Java, etc.) but...
 
@Mat'sMug I may still take up Corbin's challenge, if it's accepted. If not, then I can continue with this. I'm just not sure when I'll have it in working condition.
 
@JerryCoffin i haven't thought about Structs in a while. maybe I should think about that too.
then I could make it so that I could add new items at the drop of a hat (a winter one even)
 
FWIW I find it a code smell to have two "parallel-index" arrays...
@Jamal nevermind, it's a bit too complex of a game...
(or is it?)
 
5:59 PM
I don't know for sure. Just because I'm struggling with it, doesn't mean it's too complex.
 
@BenVlodgi spending your ammunition wisely?
 
I think I should create my own struct for the Gestures. what do you guys think? ( I would like to see Stars but TS are also welcome)
 
@Mat'sMug hah, probably not, something I should do though
 
and I am out of stars
 
@Malachi What would you get out of a struct that you wouldn't get from an enum?
 
6:04 PM
@Mat'sMug Yes--the world needs more "match up three (or more) jewels games"--there are so few of them...
 
and enum is practically a struct that looks like this

struct Gestures
{
int index;
string value;
}
 
I suppose it is either that or an actual Gesture Object
@BenVlodgi my struct would have more properties
 
What would you get from a Gesture object, that you wouldm
get from a Gesture enum?
Why would it have more properties?
 
I could add interaction properties
 
it doesn't need more
 
6:06 PM
if it is object oriented. Gestures interact with each other, why wouldn't they need more properties than an index and a name?
 
using enums you can already write a 1 line piece of code that says who beats who
 
how about a rock smashing something
or a phaser vaporizing
or whatever
 
you don't need objects for that
 
I think that a struct or object (factory) would be perfect.
why?
 
enums are already all you need
have you actually looked at my entire implementation?
 
6:08 PM
if I wanted to expand the game a struct/Gesture Class would be what I need. especially if I want to add gestures from the game itself.
 
enums are ex[andable
you can add more things right now
like
keyboard
mouse
cup
and those would be playable items
 
joined late
what's all with bond's dialogue?
 
Yeah, next up: Rock-Paper-Scissors-Lizard-Spock-Batman-Spiderman-Wizard-Glock!!
Batman hangs Spock. You win!
@tintinmj I think I accidentally started it by merely insisting on "Mug" with a capital "M".
 
cough cought hmmm ... this is why I enjoy CR:
Beautiful, thanks for the help. I can't wait till coding that clearly and effectively comes more easily. I've read through it, and it all makes perfect sense. I have some practising to do. — Slimmons 44 mins ago
 
So "M" stands for "Mug"? No wonder M threatened to kill Bond (Daniel Craig) if he revealed her name.
 
6:33 PM
@Jamal You forgot about License to Code
2
 
Good one! I think I forgot a lot more, too.
 
@JerryCoffin Do you think the world needs more Linked List implementations then?
 
From Constructor With Love :P
2
 
@SimonAndréForsberg incoming..
 
You Only Code Twice <--- Violates DRY!
 
6:36 PM
You Only Create Once - Rise of Singleton
 
Singletons Are Forever <--- I surely hope not!
 
yuk
A View To Model
 
@Mat'sMug what's coming?
 
The Bug with the Golden Gun
For Your Scope Only
 
@SimonAndréForsberg nothing, I saw this as the latest active question, thought it had just been posted:
4
Q: Linked List implementation and manipulations in C

sc_rayWhile trying to learn some more C, I decided to implement a linked list and perform a few operations on it. The first thing I wanted to do was read from a .csv of numbers (ex: 1,2,3,...) and store the numbers in a Linked List. Once I have the linked list, I want to reverse the linked list and ...

 
6:38 PM
TS (Elliot) up in here
 
Ok, the linked lists are just getting ridiculous now. I feel like I can't post my std::list implementation :(. lol
 
@Mat'sMug with spiderman's web
 
Or make it a circular linked list. It looks like singly are the most common.
 
28 more Rep is all I need
 
Eh, std::list is a doubly linked list. I suppose that's a slight change up on a singly linked list.
 
6:39 PM
Or you could make it a card fighting game...
 
oh well, let's see what happens...
0
A: Code-Challenge #2

Mat's MugPuyo-Puyo (or Dr.Robotnik's Mean Bean Machine, or Kirby's Avalanche... just give it a fun name) The object of the game is to defeat the opponent in a battle by filling their grid up to the top with garbage. The Puyos are little creatures with eyes who, in most variations of the game, fall fr...

 
Oh no. A third challenger has appeared! down vote, down vote, down vote :D
 
I'd rather do Puyo-Puyo than a List/Map. And since I can't vote on my own answer, +1 to the Mug. (With capital M!)
 
@SimonAndréForsberg Seems to apply about equally well.
 
@Mat'sMug Theoretically, you could use Objective C with GNUstep instead of Cocoa.
 
6:43 PM
Yeah, I'm actually surprised the container thing has been as well received as it has been.
 
@Corbin Make life interesting: a linked list that can be traversed in both directions, but using only a single link field.
 
Wait... is that possible with decent performance?
Well, other than cheating of course and allocating contiguous nodes :)
 
@Corbin Sure--to the extent that a linked list ever has decent performance (which means "mostly no").
2
 
But you can hop from node to node in constant time like that?
(Which is still misleadingly terrible time of course. Woo cache misses!)
 
@Corbin One hint: exclusive-OR.
 
6:46 PM
Oooooo
that's clever. gross as can be. Like... super gross. But clever.
 
@Corbin I just knew you'd like it...
 
Yeah, I do secretly love it.
Though I also feel like I need to go shower now.
 
@Corbin Strangely, my wife was saying something about that to me just a minute or two ago...
 
The linked list thing was so nasty that it subconsciously somehow got to her.
 
@Corbin Maybe she's a mind-reader. My kids think so...
 
6:50 PM
Hah. Maybe so. I think kids think all mothers are mind readers though :p
 
@Mat'sMug my two votes are in. not sure I will be able to participate this time though.
23 more rep still until I max out for the day. I don't think I have ever maxed here yet have I?
@EricLippert got Mortarboard about an hour ago
and good answer 3 hours ago
 
@Malachi Looks like your highest score before today was 154.
 
@JerryCoffin yeah I am thinking this is a big day for me.
I should have posted that code as two questions....lol
3 more rep
 
@Malachi you're 19 votes away from a badge!
 
@Mat'sMug I just need more SQL questions that I can answer...lol
one more question upvote.......oh man!
 
6:56 PM
missing [badge:mortarboard] and a first rep-cap by 3 points would really suck.. I'm with you :)
 
how much time do I have left?
 

« first day (311 days earlier)      last day (3699 days later) »