« first day (1221 days earlier)      last day (1872 days later) » 
00:00 - 21:0021:00 - 00:00

9:01 PM
Anyone got any good tutorials for stored procedures? Trying to turn a cold fusion loop with arrays into a stored procedure
why tutorial? Look for an example and adapt it
@JeroenVannevel fair point. Possibly because I don't know enough about actual SQL programming to know what I'd be looking for? I know basic SQL
create procedure dbo.SomeProcedure @someParam int, @someOtherParam int
    -- code here
Q: Simple calculator in Android Studio

JenniI have been learning Java for a few months now and have created a basic calculator application in Android Studio for a school project. Since this is my first attempt at programming, I am sure that my code is not as succint as it could be. Any suggestions on how I could improve my code would be ap...

Q: Connecting to proxies and skipping the bad ones

YoYoYo I'm AwesomeI wrote a little program that will connect to proxies, however it's extremely slow, I would like to speed it up, how can I do this faster? #!/usr/local/bin/env python import requests import getpass from requests import ConnectionError class SearchKB(object): def __init__(self, url, searc...

@Mat'sMug - That I can do. It's the -- code here part that I need to copypasta or learn.
Here is the CF code so so you can get an idea of what I mean:
9:13 PM
		<cfloop index="n" from="1" to="6">
			<cfquery name="call_comp" datasource="outbound">
				FROM queue
				WHERE queTimeZone = #n# AND queResult = 1
				AND voice=true
			<cfquery name="call_inc" datasource="outbound">
				FROM queue
				WHERE queTimeZone = #n# AND queResult != 1
				AND voice=true
			<cfquery name="call_done" datasource="outbound">
				FROM queue
				WHERE queTimeZone = #n# AND queDone = FALSE
				AND _voice=true
[fixed font]
lol, and this is why spaces win over tabs
Yeah, didn't get it until I edited. Weird.
This is the wrong place to ask, if you know your code works as expected. Code Review might be a better place. — IInspectable 44 secs ago
@Duga - That was my first thought, but code review I thought was for improving the code, not translating it.
as in "Here's my code but I'm too much of a dumbass in mysql to create a good SP"
9:16 PM
@JohnP Duga is our little chatbot, these are comments posted on Stack Overflow mentioning CR ;-)
@Mat'sMug Argh. You know, for a mod, I am woefully ignorant about the mechanisms of SO.
Q: Welcome to The 2nd Monitor!

PhrancisSo, you have found your way to the Code Review main chat room, The 2nd Monitor, perhaps for one of these reasons: You were invited or "pinged" by a site moderator or other user to discuss a post on the main Code Review site; You visited Code Review for the 1st or Nth time, and noticed the chat ...

it's more of a CR-specific thing
Yeah, I know a lot of sites have their own specific bots. Just don't know all the names. :)
I wish I could help you with that cfthing.. but it seems rather specific. I mean, one would have to know why these call_xxxx fquery calls are made, and what they do
9:23 PM
Duga has spilled over to Programmers and Software-Recs though
in her heart she knows she belongs on CR though
Q: Tells me what lessons I have tomorrow and emails the results, Python 3

Samuel TerrettI am quite new to python and programming in general. Just saying, i am reposting this question because i did post this question but it wasn't written very well so i am hoping this is better. Also, I'm new to asking questions so if i did something wrong please tell me how to improve my questionin...

9:40 PM
@skiwi :(
Doesn't sound good.
Q: I am trying to calculate X days in the future, minus weekends and holidays

Alexander CounteyI am trying to display 3 dates, 4, 10 and 12 business days in the future, formatted as "Monday, January 12th". I am able to get these three dates in the future but the code is not accounting for the weekends or the dates in the 'holiday date array' when calculating business days. The code show...

@CaptainObvious broken code
Question: is it okay to self answer my own CR if I found a bug in testing?
it's too big for a comment I think
I've done it before
alternatively if there's no other answer, you could edit the OP with the fixed-up code
there's an existing answer but it mostly focuses on code style, so I guess an answer's best
9:53 PM
actually the guideline would be "if it doesn't invalidate any existing answer"
but yeah a self-answer is perfectly fine
it's a really odd limitation in the connection pool that some people have blogged recently about
for those of you working with FTPWebRequest, HTTPWebRequest, or HTTPClient in C# or VB.NET, please read this
I did netstat and found out I had 500 open connections after running for a while, I only really need one; what made me look into this is, once every four million files or so, I'd get a "System Error" WebException, I think this is due to running out of connections
huh wtf
that just about sums up my thoughts on that
I feel like going back to BSD Sockets after this
ok, so where do you dispose the disposable?
and does that apply to SQL Server connection pooling as well?
I think it applies to almost all connection types
9:58 PM
okay you're freaking me out now
I looked in ndp, almost everything except Socket is effected
the static field just doesn't feel right, the "fix" just can't be right
there seems to be no easy way to force the framework to close the connection
I mean, fine, cache it.
my best recommendation at this time is to create a static WebClient, even if you don't need one, and spawn your requests off of that
this seems to be a jacked up abstraction
10:00 PM
@Mat'sMug the problem is that the thing you're proposing to cache is already cached
which makes the additional layer of abstraction ... problematic
"cache it" meaning, declare it outside the loop
reuse it
recycle it
declaring it outside the loop doesn't guarantee the loop won't be hit in a loop though
you're just trying to shove the problem around
at that point DI might've been better
but that doesn't play so well with when you actually need multiple sockets
Wow, I have so much to learn about functional programming.
It is literally a whole new way of thinking.
I'm trying to write a function to input values, and I'm feel I'm failing miserably.
10:05 PM
@Vogel612 so injecting some IHttpClient wrapper that lives InSingletonScope isn't a good fix?
@Mat'sMug it's an ugly fix
better than some private static readonly field IMO
because you're wrapping over a wrapper
at that point you're moving the instant dependency that's not even necessarily abstractable into your Dependency Graph
and IHttpClient is ugly because you thinly wrap over a wrapper
adding needless wrapping paper to your gift
okay, but then don't you ought to call .Dispose explicitly on the thing when the application shuts down?
@Mat'sMug theoretically, you should. But the HTTP socket spec isn't that friendly. After you called dispose on that socket, you're usually keeping the socket open for a "TIMEOUT" period to prevent unnecessary confusion on the other side of the connection
which means there still is a handle, which means: yes you should call dispose, but no you shouldn't instantly close the process after that (in theory)
at least that's how I understood the blogpost
10:11 PM
but the handle isn't managed code
after calling Close() / Dispose() the socket is still open
also note that KeepAlive false does NOT fix that
then it's the .Dispose implementation that's broken, not the client code
e.g., this answer is wrong stackoverflow.com/a/24050755/4975230
I'm using KeepAlive false and I still had 500 connections, I guarantee that I was never re-using ftpwebrequests, if you're interested you can see the code in my CR post
I was researching today what benefit there could be to making such a ... bizarre ... Dispose implementation
@jrh drop them a comment
that would make a good SO question IMO
10:17 PM
I might have found Microsoft's reasoning for the ConnectionPool, aluded to here msdn.microsoft.com/en-us/library/8xx3tyca%28v=vs.110%29.aspx
"In practice, most applications use only one or a few different configurations for connections. This means that during application execution, many identical connections will be repeatedly opened and closed. To minimize the cost of opening connections, ADO.NET uses an optimization technique called connection pooling."
so behind the scenes, Microsoft may be treating every client like a webserver, and saving us the time creating a new socket
but that falls apart from my experience for FTP -- it uses a different sending port every time, it looks like the ConnectionPool people didn't really talk to the FTP people
okay there's a constructor: HttpClient(HttpMessageHandler, bool) which specifies whether the internal handler should be disposed or reused when you call Dispose on the instance
10:30 PM
> Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
interesting how they can guarantee it for static members, but not for instance members. ...
I wonder why that makes a difference
Code review questions are on-topic on Code Review... — Notlikethat 52 secs ago
If you've already "solved" whatever it was you perceived the problem to be, code review questions are on-topic on Code Review... — Notlikethat 16 secs ago
Q: Add and remove Tiles during pan event for 4 directions

Neal DavisThis function accepts a String (either "right", "left","up", or "down") to do 4 similar but different things. I'd like a more elegant solution to this problem. I sense that there is one, but I can't think of it. Maybe by using a a few smaller functions? Maybe by using a dictionary? private ...

possible answer invalidation by Jamal on question by T145: codereview.stackexchange.com/posts/140647/revisions
10:55 PM
@Vogel612 Unfortunately it looks like HttpClient isn't part of the reference source
when I looked at the ConnectionPool side of FTPWebRequest / FTPWebResponse I saw some things that could make the disposing the handler statement vague enough to not mean "closing the socket"
Q: Binary Search Tree in C Possible Memory error?

AsaniaMy program goes through 61 ratings and correctly assigns them to the right ID and then crashes..It is the first of its value as far as the ID. I put a bunch of print statements in my code and it goes into the comparison loop and finds the matching ID. It stops because my int value in the struct "...

11:13 PM
Q: Form making multiple AJAX calls to determine behaviour

Jon LauridsenGiven a page that renders a list of contacts, and it contains a form to enter a contact's name + submit button. Then, when the user fills the form and clicks Submit there are 3 use cases that may occur: The contact can be added without any issues, so it's just appended to the end of the list. ...

Vogel if you have access to .NET reflector or similar I would recommend that you disassemble System.Net.Http.dll to make sure that bit is really causing the socket to close on dispose, for me the dll is in in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin , ILDASM is kind of inadequate for this task
I don't have anything like that
11:30 PM
@Hosch250 re: FP - agreed it feels very different from OOP and PP to try to think in terms of functions, and I'd wager some types of tasks just don't fit very well with FP
Well, I have a PR here, if anyone wants to take a look: github.com/CR-Community-Challenge/Battleships/pull/1
It looks like FP relies more on recursion than loops.
At least, F# doesn't yet have a way to break or return from a loop, although the break keyword is reserved for future versions.
@JeroenVannevel What about it?
> Vogel if you have access to .NET reflector or similar I would recommend that you disassemble System.Net.Http.dll
@Hosch250 I don't recall using loops that much at all, at least with Lisp, seems like it relies more of things like sets, vectors, etc.
11:37 PM
@Phrancis Yeah, and recursion.
I typically loop to get valid input, but this time it felt cleaner to recurse.
Of course, this way the user can always blow the stack :P
Stack overflows are fun :D
You know what, though? They'd have to enter invalid input about 10K times, or something, for the stack to blow on my system.
I'm not going to try it :P
Q: Circular buffer implementation using linked list

shijuzaI'm a beginner with C. The below is the implementation of circular buffer using linked list. Please review my code and suggest any improvements to make it efficient or to improve in coding style. #include<stdio.h> #include <stdlib.h> struct link_list { int item; struct link_list *next; ...

11:57 PM
@Hosch250 actually tail-recursion could allow you to not blow your stack while infintely recursing
00:00 - 21:0021:00 - 00:00

« first day (1221 days earlier)      last day (1872 days later) »