« first day (1005 days earlier)      last day (3013 days later) » 

12:00 AM
RELOAD! There are 1759 unanswered questions (94.3273% answered)
 
we ought to go group hunting sometime for zombies
make it a community challenge or something
 
Where have I heard that before?
 
something a bit smaller than The Mission
 
Zak
@Quill Maybe The Side Quest?
 
@rolfl Where have I seen that monkey before?
5
 
12:03 AM
@SimonForsberg does Duga handle releases in the daily summary?
 
@Vogel612 Nope. It's been posted as a feature request but not implemented.
 
how's the new language ing, @rolfl?
 
@SimonForsberg - this monkey is in charge of impelementing a complete devops solution for a team of 100 people using a new language, and a completely different delivery architecture.
6
 
Zak
'night @all
 
@rolfl Awesome!
 
12:04 AM
@Jamal - I need to get a hold of you next week. You in Austin? Want a beer?
 
later @zak
 
@rolfl sounds fun.
on a related note...
 
More stress than I realized ....
 
can somebody please explain to me wtf devops is?
I've heard that and it feels like a buzzword from marketing to me
 
hehehe. It's a buzzword for doing things differently.
 
12:05 AM
DevOps (a clipped compound of "development" and "operations") is a culture, movement or practice that emphasizes the collaboration and communication of both software developers and other information-technology (IT) professionals while automating the process of software delivery and infrastructure changes. It aims at establishing a culture and environment where building, testing, and releasing software, can happen rapidly, frequently, and more reliably. == Overview == In traditional, functionally separated organizations there is rarely cross-departmental integration of these functions wit...
 
@Vogel612 - in many situations software is (still) developed with a release cycle (think of "windows", or "chrome". When you "ship" software to "customers", you tend to work to release cycles.
On the other hand, a lot more focus is moving in to cloud computing, where the system just has to exist... and you can't uninstall, and replace it.
Devops is the catch-all term for having a release system in place that does on-the-fly upgrades to the target system in a way that avoids any downtime.
Your software is a "service", not a "release".
 
At my job, the devops team is in charge of Configuration Management and Test Environment Management.
 
0
Q: Generic singleton array with archiving and insertion functions

sunnyI find that I often have to maintain a singleton primarily to hold an array that is sometimes persisted between user sessions, that should have only one class of items, and that sometimes needs to be ordered. I got tired of writing the same boilerplate over and over so came up with this. I'd welc...

0
Q: pygame, could you check my code and give me some hints and tips

MichaelI made some games in pygame, but I am still new to making games. At this moment I made this game, and everything works, but I just want your opinion, tips and hints about my way of coding a game (especially the collisions, whether there is a better way to program collisions and the second thing w...

 
@SimonForsberg Docker and Docker?
So they're basically specialized sysadmins with software development knowledge?
 
@Vogel612 Oh, I wish.
We're going in that direction but not quite there yet.
@CaptainObvious Oh, it's the duplicated duplication of duplicates!
 
12:13 AM
I wonder how worn out their Ctrl, C and V keys are
 
Q2 is problem Y. Problem X is how to write a generic-based printf that works. I only know that because I followed the link to code review. If you want the answer to X, you need to actually ask X here on SO. — user3386109 40 secs ago
@AlexMills - Yeah, that was my original point in my comments. What wrong with using the array? It's about as simple as one could get. What do you want to change? Your code using the array can likely be streamlined. If your code is working, then that's a job for a post in codereview.stackexchange.com. — jfriend00 59 secs ago
 
12:38 AM
@iH8 I understand your frustration, which is exactly why I'm proposing a standard off-topic reason for code review requests, so that the obvious way is also the proper way to close a question. — 200_success 28 secs ago
 
Hello
 
@Quill Probably about as worn-out as my F5 key :)
 
I've heard you make the joke before, but I never actually understand why you make it
also it's command+r on a mac
 
Let me refresh your memory .....?
 
@Quill F5 is "Execute query" in SSMS
 
12:41 AM
windoze
2
"Excuse me miss, are you sitting on an F5 key? 'Coz that booty is refreshing."
3
 
LOL
 
hai @jamal
 
@rolfl Yes, I'm still in Austin. I can get something else, though. I don't drink.
 
Two people entering the room within 5 seconds? Interesting.
 
hi
 
12:43 AM
@TheCoffeeCup the pure power of timezones
 
Just did a scan-by-a-flashlight reflectivity test on my keyboard. Seems the space bar has two worn spots, the home-row is polished, and the backspace is depressingly shiny.
 
I finally figured out how to forward delete on OS X.
 
@Jamal - you have my mail, send me an updated resume - I will pass it around.
 
@nhgrif like ctrl+shift+arrow?
 
@rolfl Okay
 
12:45 AM
No. Like fn + delete
 
@rolfl Shiny backspace means you write bad code first then write better code ;)
 
Niters
 
my wasd keys don't have letters anymore on my home keyboard
night @vogel
 
Real programmers have shiny Esc keys. =)
2
 
possible answer invalidation by Lucas Siqueira on question by Lucas Siqueira: codereview.stackexchange.com/posts/118687/revisions
 
1:02 AM
0
Q: Making a conditionally visible page-up button

LegatoI wanted to make a button that goes to the top of the page but only appears when you're not at the top. There are probably libraries that already do this, but I wanted to make it myself and after some tinkering the following is what I came up with. There is an occasional annoyance from quickly s...

 
@TheCoffeeCup This looks like the kind of question for you:
3
Q: Dr Nim Java Code

Dragon4c3_https://www.youtube.com/watch?v=9KABcmczPdg This video should explain how the game works, but in simple form it's a Game where you enter a number between 1 and 3, This number is than removed from 12, in doing so the computer will then pick a number between 1-3 based on what number you have picked...

 
possible answer invalidation by Community on question by Michael: codereview.stackexchange.com/posts/118703/revisions
 
@Duga It's OK; I approved it.
@Duga That edit looks OK too.
 
@Phrancis I confess that I have been writing documents, spreadsheets, and e-mails more than I have been writing code.
Code has fewer typos.
 
1:24 AM
0
Q: Program that asks user for value of x, then sets y based on number

Isaac Brekke PROBLEM: Suppose x and y are variables of type double. Write a program that asks the user for the value of x, where x can be a negative or positive number. Set y to x if x is positive (not negative) and 0 otherwise. The part where I get confused is how do you set y equal to x without definin...

 
1:34 AM
does it have to pass a code review - suitable for production code? — Lance Feb 17 '14 at 19:37
 
@SimonForsberg Are you Swedish?Me too:null;
 
> Undefined behavior is the most exciting kind of behavior!
 
@AmaniKilumanga ooh, you're that N1 I saw on here a little while ago. Hello
 
@AmaniKilumanga Hey there, BTW thanks for the accept :)
 
> Amani Kilumanga
Junior Programmer/SE in Japan.

Graduated from a Japanese university, majoring robotics.
Tokyo, Japan
Member for 8 months
15 profile views
Last seen 8 mins ago
Japan != Sweden
 
1:46 AM
live != from
> I came to Japan in 2008
 
Monking
 
Monking!
 
0
Q: TSQL Stored Procedure to Insert or Modify User Data

ADHI inherited an application that uses some stored procedures and would like to get the groups opinion on the code. Below is a sample of one of the stored procedures used to insert or modify user data. The SQL Server version is Microsoft SQL Server 2014 - 12.0.4100.1 (X64). USE [MyDataBase] GO /**...

 
@CaptainObvious Code looks OK to me, doesn't appear they have written it but that they maintain it
This is a bit weird though...
    ELSE
        RAISERROR('Required parameters are not provided or Required parameters are passed as NULL',13,1)
    COMMIT TRANSACTION
    select null
END TRY
The select null part...
 
1:56 AM
Yeah. It does nothing. Doesn't hurt or anything, just pointless
Maybe previous dev thought they had to do this to deallocate something
 
@SimonForsberg Tro mig jag är svensk. Har inte bott där sen 2008 iofs.
@Quill N1?
 
JLPT N1
 
@Phrancis Thank you for the answer!
@Quill ah yes. I took it before it was called N1, I believe.
 
@CaptainObvious that title describes about 25% of all Stored Procedures, doesn't it?
 
2:03 AM
btw, I want to accept your answer on my question too, I just need to apply and test the suggestions you gave me
 
@Malachi It sure describes a lot of them! Considering there are only 4 types of operations you can (generally) do on data sets, this covers about 50%
I have to say that is most likely better than MERGE
 
0
Q: MSSQL query to look for duplicate record

PopThis query took 6 seconds to complete. How can I optimize it? Total records in table is 166803. SELECT ltrim(rtrim(CAST(cageID as nvarchar(max))))+ltrim(rtrim(CAST(trayNo as nvarchar(max)))) as _unique,* from lf_transit_cage where ltrim(rtrim(CAST(cageID as nvarchar(max))))+ltrim(rtrim(CAST(tra...

0
Q: Dynamic graph in C++11 with shortest path algorithm

user11881I've been designing a dynamic graph to improve my understanding of C++11. The dynamic aspect means it could represent the hyperlink structure of internet, with node deletion corresponding to removing dead links. I'd be grateful for a review of coding style/design patterns/optimization. The main...

 
2:27 AM
> There are few things which hinder improvement and bug fixes more than half-arsed error logs. Log everything and let the developers sort it out.
Is this^ true? (my writing)
 
yes. there's only so many tears that can be shed for missing logs
 
I had the feeling that was the case...
 
@200_success Thanks for you answer! It may seem trivial, but this noob finds your solution clever and appreciates it.
 
caught out by another panama problem. turned into a three hour fix.
protip: check your database input lengths
 
@Quill great tip fr
 
2:42 AM
You're welcome. I just tweaked the answer a bit.
 
@Phrancis that actually hurts
 
2:53 AM
i think, your question is downvoted because you have no problem (exceptions, wrong result). you just need a code review — Backs 10 secs ago
 
3:11 AM
-8
Q: Donald Trump vs The INTERNET

10 RepliesHe can't build a wall, but that was all part of the plan. Donald Trump may have lost the Republican primary, but this time he seeks a bigger challenge: THE INTERNET. Your Task Create a program that that modifies a webpage by replacing all instances of "Clinton" with "loser", all instances of "D...

lol
 
3:21 AM
@Quill lol
 
3:41 AM
0
Q: Missing Numbers Between Two Lists

Jae BradleyPurpose I came across this relatively simple question on HackerRank regarding finding missing values across two Lists. I took a fairly straight-forward approach, but is there a "better" / "slicker" way of implementing a solution? Task Strategy Iterate throughList with complete data. If Int...

 
@Quill lmao
 
possible answer invalidation by Lucas Siqueira on question by Lucas Siqueira: codereview.stackexchange.com/posts/118687/revisions
 
@Quill Very opinion. Many JavaScript. Wow. Such off-topic... :)
 
I'm voting to close this question as off-topic because it belongs on codereview.stackexchange.comRob 21 secs ago
@Phrancis It is neither unclear or broad. Belongs on another site most definitely is a valid close reason, and it is available for certain sites. This question belongs on another site in the Stack Exchange network. CodeReview was removed from this list due to the huge influx of bad migrations. But it is still very much valid, and if it is not closed by other users, then a mod-flag will have it migrated. — Rob 36 secs ago
@Rob sometime scopes overlap, but if it's not off-topic on Stack Overflow, even if it may be better suited for Code Review, it's not off-topic on Stack Overflow. — Quill 32 secs ago
 
4:06 AM
@Rob sometime scopes overlap, but if it's on-topic on Stack Overflow, even if it may be better suited for Code Review, it doesn't deserve/need closure — Quill 50 secs ago
 
0
Q: Read stdin like a dictator

catRags. Introduction All too often I find myself wanting to allow only a certain list of characters to be written to stdin, and only recently did I actually bother to implement it. In Python, of all languages! Essentially, this module provides a few APIs that allow a very tailored approach to ...

 
Thanks @Quill well said
 
4:27 AM
@CaptainObvious wot
 
@oshun i never wrote a function in R. I did try it though and I posted my result here . I am not sure if that's what you meant. yet, i cant get 8 figures/file. — BioProgram 1 min ago
 
0
Q: Express.js production deployment

jayrueI am running an Ubuntu EC2 where I am using Nginx to proxy all port 80 requests to the socket that my Node.js app is listening on. To start my app, I am using PM2. When I wrote the server for my app, I included Node.js cluster module to fork and cluster as needed. Now that it is deployment time,...

1
Q: Convert A for loop in R to apply function

BioProgramMy goal is to iterate over a datamatrix, calculate mean, standard error of the mean, and then have a bar plot representing the 2 groups of my data matrix in R. My code below works as a for loop. However, my initial goal was to output each 8 plots in one .png file. To that end, I posted the questi...

 
@Quill Hey man . How are you doing :)
 
I'm doing alright, besides chasing a confusing bug
How've you been?
 
4:45 AM
0
Q: Rotating an array left or right

Alex NelsonI'm trying to rotate an int array either left, or right, and I ran into some problems trying to rotate higher numbers. I know what is wrong, but I can't figure out a way to fix my code. Thanks for the help. public void makeRight(int x) { int[] anArray = {0, 1, 2, 3, 4, 5}; int[] newWrite = new i...

 
5:00 AM
possible answer invalidation by Busturdust on question by Busturdust: codereview.stackexchange.com/posts/118678/revisions
 
5:10 AM
I searched my .bash_history for the line with the highest ratio of special characters to regular alphanumeric characters, and the winner was: cat out.txt | grep -o "\\\[[(].*\\\[\])][^)\]]*$" ... I have no memory of this and no idea what I was trying to do, but I sure hope it worked.
4
 
5:36 AM
Monking
 
I'm voting to close this question as off-topic because it is asking for a code review — TylerH 1 min ago
 
0
Q: Large table updates using AJAX in Internet Explorer 11 (Cont'd)

BusturdustPrevious topic: Large table updates using AJAX in Internet Explorer 11 For the functions included here, I have taken the advice of the previous answer and incorporated it in the restructure, but am still experiencing huge latency of about 2 seconds per computer record. I am lead to believe that...

 
6:20 AM
0
Q: Sort strings using selection sort without changing original values

TK-421I've created a function that sorts strings using selection sort, but I want to know if I can do this without changing the original strings. For example, if I try to sort an array string[4] = {"two","One","four","Three"}, it prints One, Two, Three, Four, but I want it to print {One, two, Three, f...

 
6:36 AM
 
6:48 AM
0
Q: Custom Exceptions based off the Visual Studio snippet

JeroenI'm creating my own application exception types so I could catch them higher in the call stack and take specific action. I'm looking to get feedback on the latest exception I've written for two reasons: I'm using the Exception snippet from Visual Studio 2013, and am wondering if it is any good ...

 
There is dedicated Code Review forum. You may get more responses there. — 4e6 1 min ago
 
> forum
 
 
7:11 AM
CodeReview.SE or Security.SE might be better places to ask questions like this. — Barmar 11 secs ago
 
0
Q: Sorting an object array

TK-421I've created a class called Box that is pretty much what it sounds like. I want to sort these box objects, and I have created a function to do so. void boxSort(Box array[], int size) { Box temp; bool swap; do { swap = false; for(int count=0; count<(size-1); count++)...

0
Q: Any vulnerabilities in user input to Web Server running apache and PHP

JennThere is understandably a lot of emphasis on sanitizing user input handed off to PHP on a Web Server and numerous opinions on doing it. Can U please confirm there is no security problems with the following PHP code which may compromise the server through an exploit: if($_SERVER['QUERY_STRING'] ...

 
0
A: insert exists records in many-to-many , hibernate

chillworldWhen I have an many to many relationship, never link them in the classes like this : class Student { private Collection<Act> acts; } class Act { private Collection<Student> students; } The reason behind this is because I don't want to load more then needed. What do I mean with this : ...

 
7:40 AM
Following is the solution I have come up with but I think performance can be improved - This should be posted on Code Review if it works fine. — Wiktor Stribiżew 11 secs ago
I'm voting to close this question as off-topic because belongs to CRLPs 22 secs ago
@LPs Code review questions are not off-topic on SO. Sure you'll probably get a better reply on code review, but that doesn't make the question off-topic here. This has been discussed plenty on meta. Don't go inventing your own off-topic reasons, please. stackoverflow.com/help/on-topicLundin 37 secs ago
@Vizllx if you already have a working solution and want to optimize it, Code Review is the site for you. If you are only interested in the algorithm and don't want to actually use it implemented Programmers is more suited. Any way you turn it, your question is off topic for this site. — Gerald Schneider 24 secs ago
 
7:58 AM
0
Q: substring erase with certain pattern

sarthak/*Problem statement: For following input string: "VISITOR_INFO1_LIVE=USv90B-7CzI; LOGIN_INFO=e486e37a395be3f0e3b3237d090a6829c1oAAAB7IjQiOiAiREVMRUdBVEVEIiwgIjciOiAwLCAiMSI6IDEsICIzIjogMjAxMTk0MTMwNiwgIjgiOiA2MDgwMTg0NTEzNjQsICIxMCI6IDIzOTYyMTEyODczNH0=; PREF=f5=30;HSID=AHuJQBOVR0lQoRt_3; APISID...

0
Q: iOS app for a school project

nommisI have a school project that is lasting a good part of the year (from october to april), and for this project I'm developping an iOS app in objective-c. At the end of the year some professors will look at my app and give me a grade. I'd like to get feedback about my code, a this is my first iOS a...

 
8:19 AM
Ok, sorry. I'm deleting the post, I don't have my personnal computer with the source code with me, and I have to go back to work. I'll repost later. Sorry again! — nommis 52 secs ago
 
8:32 AM
@CaptainObvious UWYA
 
@AmaniKilumanga Okay, I believe you :)
 
hello
 
hi
those stickers came in the mail, and my laptop looks crazy
 
@Quill Pics or didn't happen.
 
0
Q: PHP Instant Message API Low Performance issue

Azad ChouhanI have written the API for instant php message. This API is used in an android chat app. But this API is sending and receiving the message little bit late. I am not sure where I am going wrong. Here is the code which I wrote Code for Send Message public function send_msg($date,$time,$ip,$send_u...

0
Q: Javascript startsWith prototype

corsiKaI'm a Java guy in a JavaScript world, and I'm used to certain things about Java Strings that just aren't there for in JavaScript. Some of this I can accept, for example Strings are freaking everywhere for some reason. Now I realize this could be simply implemented with return this.indexOf(needl...

 
8:44 AM
According to meta.codereview.stackexchange.com/questions/5777/… the proper close reason is "Too broad". In this case also "Unclear what you are asking" applies, as I can't see any question here. — Tadeusz Kopec 32 secs ago
 
 
@Quill lol
PHP sticker why
 
because elephant
 
PHP is the elephant in the room 8)
 
ElePHPant
 
8:51 AM
@Quill It looks better with than without the stickers.
You got a duplicate though.
 
I know, coding horror was just too cool
lol 20€ for that: elephpant.com
 
@Quill No Code Review sticker?
 
There are CR stickers..? @SimonForsberg
 
@DanPantry They're part of the swag.
 
8:54 AM
:(
 
don't worry, I'm sure we'll do CR events or something.
 
CR events?
 
idk, sites can do events and stuff and give away swag prizes
 
CRCon
 
 
9:00 AM
Naruto answer; accepted non-selfie answer with 0 score: Graph radius in Java
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: TabLayout inside fragment fetch data from web
 
I love you guys
3
 
0
Q: Project Euler problem 12

Mayur KulkarniThe statement is as follows : The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven tr...

 
9:30 AM
CSS: Screw around with random properties until it works.
 
that might make a good blog post
css scopes, that is
 
9:43 AM
Well, I'm mad
I bought my new PC from eBuyer last night at 10:18pm, which is before their cutoff time of 11pm. When you order before 10:18pm, you can pay £15 for next day delivery, which I did.
I've just been informed that I won't receive my order until Thursday because payment was only taken this morning at 6am, despite the fact I paid £15 to have it delivered today.
Oh, and I won't get a refund for the next day delivery charge because "technically" it's still being delivered next-day.
Despite the fact that my invoice and order both confirm the delivery of being for the 3rd. :S
 
1
Q: LifeSaver: Hides and manipulates windows

AneesAhmed777This is my first post. I think I'm an Intermediate. This is a small program I wrote to hide/show different windows on my Windows PC. This is named LifeSaver because it did save my life several times, whenever someone stormed into my room unexpectedly. It does have some cool uses and some naughty...

 
@CaptainObvious that's a very large preamble.
 
@Override
            public void _dont_implement_Matcher___instead_extend_BaseMatcher_() {

            }
dangit, they're onto me!
 
@Pimgd wat
 
writing test code, validating arguments, need to check if was called with EITHER a OR b
so just went new anonymous class
IDE generates methods for you
you see this method in there
You go O_o
 
9:51 AM
lol here. mine boss just asked : Hey I have strange behavior on mine application. Nothing happens when I doubleclick on a listboxitem except when I have selected it
1 min later I found this code :
if (selectedItems.isEmpty()) {
log.debug("not opening service: nothing selected");
return;
}
 
@chillworld lol
 
@DanPantry I'm not involved in the project so no code of me ;)
 
I'm voting to close this question as off-topic because it does not contain a problem description and is better suited for codereview.stackexchange.comCobra_Fast 33 secs ago
 
My colleague has just informed me the direct English translation of Racoon from Norwegian is "washing bear"
I'm not sure what to do with this information
 
Buy a Norwegian racoon and give it your laundry to clean
duh
 
Zak
10:14 AM
@DanPantry If you paid with a credit card, get them to claim it back. If you didn't pay with a credit card, get one, for precisely this purpose
 
Obviously, cancel the order
Well maybe not obviously, but things like that turn me into a difficult customer really quick
 
@Zak I have a credit card, however the credit limit is below how much the purchase costs
 
Optimisation questions aren't really suited to Stack Overflow. Perhaps CodeReview BUT check their guidelines first. — Paulie_D 16 secs ago
 
(The credit limit on the card is super low, £250, until March when I can get it extended).
I don't want to cancel the order particularly because my PC is bricked so I DO need that PC.
 
If you have it on paper and it's not honored, how is it not a breach of contract
This sort of stuff
find facebook page
and post
Might get you a really quick resolution
 
10:21 AM
Their POV is that they are technically correct.
 
Well does it say 2016-02-03 on your invoice
 
Because payment was received at 6am this morning - despite order and such being ordered before the cutoff period and paying extra for delivery on the wednesday
Yep.
 
Well then, if it's 2016-02-04T00:00:01
and it's not here yet
wut happen?
 
& no idea
 
you get to complain, ofc
if it says "delivered by 3rd feb" and you sit at home all day but don't get it
(I'm just saying, people could do this, PC is pretty big, can't exactly stuff it through the mail slot or hide it somewhere)
then what are you paying extra for
 
10:25 AM
It's actually meant to be delivered to work
 
0
Q: nagios plugin webdav check

anarchistI have written a small plugin for nagios to check a WebDAV server. It is supposed to connect using a username and password and upload & delete a test file This is my code: #!/bin/bash #Exit codes STATE_OK=0 STATE_WARNING=1 STATE_CRITICAL=2 STATE_UNKNOWN=3 FILENAME=/tmp/test_monitor FILE=test_m...

0
Q: fetching data from Nested json using jquery and displaying in table

Sandeep BiradarMy Json data is var resp= { "ERROR": [], "DATA": [{ "CustomerID": "234", "BranchID": "1", "LocationID": "26", "FirstName": "Lakshmi " }, { "CustomerID": "235", "BranchID": "1", "LocationID": "6", "FirstName": "Arora...

 
But I get your point
I'm going to rain hell on them at lunchtime and see if I can't get it delivered today
 
still recommend posting on facebook if they say no
keywords "theft, disappointed, not going to buy from here again"
or twitter
 
I won't have access to Facebook until the working day ends, so
 
post from home because gotta get vengeance?
it's still your money
15 pounds is worth 10 minutes of typing me thinks
or worth a try
 
10:31 AM
oh, it is, but complaining on Facebook after working hours won't solve the problem that I don't have my PC: p
 
10:41 AM
@DanPantry paypal and some other payment sources have to validate stuff
 
list { a b b c e }.removeAll(list {a a b c d}) = obviously { e }
bleh
I wanted {b e}
okay this crap is going on CR, it's just bad
 
Monking
 
hi
 
For measurements of what you can do: discussion of scalability. — greybeard 25 secs ago
 
11:08 AM
wow I have a strange issue
try with resources is not catching all declared exceptions :s
 
Are you catching all declared exceptions?
 
wait he is catching it but rethrowing it
DataSource ds = mock(DataSource.class);
catalogMaxFieldLengthService.setDataSource(ds);
when(ds.getConnection()).thenThrow(HibernateException.class);
assertEquals(200,catalogMaxFieldLengthService.findMaxLengthForEntityPropertyString(new Country(),"capital"));
when(ds.getConnection()).thenThrow(SQLException.class);
assertEquals(200,catalogMaxFieldLengthService.findMaxLengthForEntityPropertyString(new Country(),"capital"));
this is test code
because I don't want to mock the connection and so on I do it like this
try (Connection conn = dataSource.getConnection(); ResultSet result = conn.createStatement()
.executeQuery(queryString);) {
while (result.next()) {
logger.debug("result:"
+ result.getInt("CHARACTER_MAXIMUM_LENGTH"));
return result.getInt("CHARACTER_MAXIMUM_LENGTH");
}
} catch (HibernateException | SQLException e) {
logger.error(e.toString());
}
return DEFAULT_LENGHT;
the logger is printed for hibernate exception
but test fails because I get the hibernateException
but as I was looking at it => Hibernateexception can't be thrown by any class
so if I remove that and test only on SQLException => test pass
 
Remove failing tests until all tests pass :)
 
Ctrl+K @chillworld, format the code
 
@skiwi yes and no => hibernate exception never thrown so to stupid to catch
 
11:13 AM
help how do I stop reviewing my code in my question
 
@Pimgd alt + F4
but it's the same code, other exception and that works
so I'm now curious why did that happened
if any smart guy knows, you can tell me ;)
 
here you look at mine I'll look at yours
0
Q: Making a diff of values in a multi-valued key-value store

PimgdSo I've got this key value store with a legacy object, PersoonInstellingenObject, which has a key and a value and a id. The ID is never exposed, we use the key instead, but multiple values with the key can exist. The personalSettingsService does all the database stuff via layers upon layers upon ...

Also that came out wrong but you know what I mean
 
yo can a @mod unfreeze the js room (it had a room change): chat.stackexchange.com/rooms/25699/web-development
 
0
Q: Making a diff of values in a multi-valued key-value store

PimgdSo I've got this key value store with a legacy object, PersoonInstellingenObject, which has a key and a value and a id. The ID is never exposed, we use the key instead, but multiple values with the key can exist. The personalSettingsService does all the database stuff via layers upon layers upon ...

 
@chillworld ... if you can't get hibernateException why are you catching it
 
11:32 AM
0
Q: Is my unity3D code clean?

AlanThis is a unity3D script I wrote for my game to control a character. I don't consider myself a highly-skilled coder, so I come here to ask for suggestions. Is my code clean enough? How can I improve my coding style and pattern? Thanks! using UnityEngine; using System.Collections; public enum ...

 
@CaptainObvious fixed indentation but there's also a \n\r problem with new lines I think
 
10
Q: How do I multiply each element in a list by a number?

DJ insiders with DJ bigdawgI have a list: my_list = [1, 2, 3, 4, 5] How can I multiply each element in my_list by 5? The output should be: [5, 10, 15, 20, 25]

Does that really deserve that many upvotes?
Found it on the hot list :/
 
it happens from time to time
 
11:51 AM
@Pimgd because it was in the code (not written by me) but I removed it now
 
0
Q: functional coffee dispenser

RacheetInspired by this question: OO coffee dispenser I decided to rewrite this code in scheme, as I'm working through SICP right now. Any feedback welcome. #lang racket ;assume cup, is-empty?, refill and drink are operations understood by the environment (define (coffee cup) (if (is-empty? ...

 
Long shot, but anyone here using Spotify right now?
It's just cycling through the numbers playing them all for pretty much zero second, restarting it didn't fix, it's weird
 
hmm, it's a lightweight app
try reinstalling it
or sign out first, maybe
 
Zak
@skiwi I get that occasionally, usually when I'm trying to sync with my PC and phone.
Closing the respective apps and restarting usually fixes it.
 
Problem is that I don't remember what playlist it is :P (Probably some radio station provided by them)
Maybe Spotify leaves some processes behind despite closing it
 
11:58 AM
@skiwi take a screenshot to remember it
yeah, try clearing %appdata% related files
 
Else restarting my PC, but I dislike do that for a program ;)
 
12:13 PM
o/
@Quill Just open a new room
 
Greetings, Programs.
 
meh @dan
 
12:36 PM
If the code works, codereview.stackexchange.com/help/on-topic is a better place to ask — Alex K. 53 secs ago
 
blehhhh
I am typing a review to my own answer but it talks about things people couldn't possibly know
 
:/ my dad's Windows 10 install is literally falling apart
First Calculator doesn't work, then start menu didn't work anymore, then windows store has disappeared, now the Edge browser won't even start anymore
 
@Pimgd Reviewing questions is not enough anymore, you have to review answers?
 
... help I am confused
clearly
0
A: Making a diff of values in a multi-valued key-value store

PimgdWhen I post a question, obviously I can't leave it alone and I google a lot afterwards. Can't say much about your use of Lists and such, but what you've got there is not very RESTful. When all I want to do is delete a single value from a large multi-valued key, then why do I need to send the ent...

It ought to be meta on some level
cuz it's - too fast to have been reviewed by someone else, mostly
and pulling context from places other askers can't
 
12:52 PM
Loop over the numbers and build your selectors with it? More suited for code review stack exchange, no? — Dave Newton 1 min ago
 
and we're changing the spec based on the logic that we can, whereas the question says "I have to"
Had two different people written question and answer there'd be all sorts of "how'd you know this" or "you're making assumptions"
 
0
Q: Better writing this code since it's almost the same

advapiI've got a Service that load data from a DB and it performs almost the same operation Please consider this private async Task GetProvenances() { try { var result = await commonRepository.GetProvenances(); if (result != null) { ...

0
Q: C#, Calculate template page numbers correct, is % needed or not?

MagnetizeI have the working function below, which sets the text to a label displaying currect active "products" and current active pages. The label displays "X products, Y pages/page" depending on the amount of products active in the template. Products is the same as rows really, the client wants to call ...

0
Q: PHP Instant Message API Low Performance issue

akash chouhanI have written the API for instant php message. This API is used in an android chat app. But this API is sending and receiving the message little bit late. I am not sure where I am going wrong. Here is the code which I wrote Code for Send Message public function send_msg($date,$time,$ip,$send_u...

 

« first day (1005 days earlier)      last day (3013 days later) »