« first day (1432 days earlier)      last day (3519 days later) » 
00:00 - 15:0015:00 - 00:00

12:51 AM
Why do I need an object reference to change a buttons content when I'm using the xamls code behind?
 
1:08 AM
@Tokencodingnewbie a reference to what?
 
Error 1 An object reference is required for the non-static field, method, or property 'TicTacToeWPF.MainWindow.Button1
 
Are you in a static method, and if so, why?
 
Oh yeah I did make it static.
 
probably not necessary
 
Hrm, well when the heck do I want to use static? and I'm assuming all the fields have to be static to be used too.
Because memory stuff.
 
1:12 AM
static is for methods that don't belong with a specific instance
your event handlers shouldn't be static, because the events are fired from a certain instance
 
it wasn't an event handler.
 
oh, ok, it was a guess
 
public void computerAction()
        {
            while(!isPlayerTurn)
            {
                computerGuess = rand.Next(0, 8);
                if(isX[computerGuess] == true)
                {

                }
                else
                {
                    isX[computerGuess] = false;
                    determineButton(computerGuess);
                    isPlayerTurn = true;
                }
            }
        }
    }
I did this.
but then I was like...well how the hell is it going to know which button to make with a "O"
 
eww "== true"
 
So I made the determineButton method
 
1:15 AM
and empty if block
 
lol ew? is that not right?
I...I don't know D:
 
it's redundant
x == true is the same as x
except when x is nullable
 
Oh gotcha.
and the blank if ?
 
You should put everything in the if, and drop the else
if (x) { } else { y } is the same as if (!x) { y }
 
 public void computerAction()
        {
            while(!isPlayerTurn)
            {
                computerGuess = rand.Next(0, 8);
                if(!isX[computerGuess])
                {
                    isX[computerGuess] = false;
                    determineButton(computerGuess);
                    isPlayerTurn = true;
                }
            }
        }
Better looking now!
Doesn't work quite properly, but hey it's a start.
 
1:18 AM
isX[computerGuess] = false;
this also looks redundant
I suspect rand.Next(0, 8) is also a bug
 
Can it not go to zero?
 
Read the documentation :)
 
RTFM lul
I also think I see a huge flaw in my program
 
@Tokencodingnewbie yes indeed lol
 
isX is an array of bool
 
 
5 hours later…
6:19 AM
Morning all!
 
6:29 AM
morning
 
7:13 AM
Yo.
 
7:32 AM
yoyo
 
7:47 AM
anyone here who can tell me what format datatype.url should accept in mvc?I have tried pasting link urls there but it gives invalid url error and cant find a question where they have posted with a sample url
 
8:15 AM
@Gotalove What is DataType.url?
 
the data annotation datatype.url in mvc data annotations @RoelvanUden
 
Hi there cuties.
 
8:30 AM
mornin chums :3
 
@Gotalove I have no idea what you are talking about. And I'm quite familiar with C# and MVC. Perhaps you want to be a little more specific.
 
G'morning.
 
@RoelvanUden sorry it dint come out clear
let me paste what I mean
[DataType(DataType.Url)]
public string serverurl{ get; set; }
morning @Sippy
 
@Shaun Whatever you tell me, I will not visit the Chum Bucket!
 
@Gotalove Don't you mean string to be Uri?
 
8:35 AM
@PolymorphicPotato WE HAVE KRABBY PATTIES
RAVIOLI RAVIOLI WE HAVE THE FORMULONI
 
Yum, ravioli.
 
@RoelvanUden my thought was that the above accepts a url like http://chat.stackoverflow.com/rooms/7/c is this what it does?
with the http;//
infront
@RoelvanUden yes to your question
 
8:49 AM
fk
 
Sam
How to remove garbage value from string?
I want result= 813824
 
uhm
 
erm
 
regex for numbers!
 
Sam
I have tried
string printableValue = Regex.Replace(result, @"[^\w\.@-]", "", RegexOptions.ECMAScript);
but it gives reult=813824PHPH
 
9:00 AM
string printableValue = Regex.Replace(result, @"[^\d]", "", RegexOptions.ECMAScript);
 
It's regex, noob!
 
I KNOW
that's my attempt
at the problem
I've used regex like twice :'3
 
Regex.Match(@"^([0-9]+)") match group 1
 
Can anyone see a reason why this would return 500 internal server error without ever actually running the AJAX?
 
JS client-side can't return 500, your server can.
 
9:04 AM
cri
 
reservations.Leg = dr["TRIP_START"].ToString();

if I want to use two oracle tables instead of TRIP_START, I also need TRIP_END combined into one string
WAT DO
 
Do you spot anything @RoelvanUden? I been staring at it since yesterday
 
@Sippy Move resolveDialog up to start with
 
@RoelvanUden yerp.
 
look at this guy always telling me to use pastebin then he uses something called pastie
 
9:07 AM
Same thing nerd
@RoelvanUden It's passing id undefined
 
AM I NOT GOOD ENOUGH FOR PASTIE
 
But I can't figure out why, cos the same code works in another application
So unless I've named something wrong ..
 
the good old passing undefined value error
that brings back nightmares
from 2 days ago
 
$(".dialog-confirm").data('idparam') is different from your other data call
 
One is assignment
"Yes": function () { deleteRequest($('.ardialog-deleteform').data('idparam')); }
That's what it looks like in the other application as well.
 
9:12 AM
I dunno w/o debugging it.
 
Aight ty anyways
 
Probably JS scope changed
 
Maybe
So confused
 
guys can we use previousPage object with hyperlink?
in asp.net
 
9:35 AM
when I add two oracle references into my solution, it breaks the whole project
is there something wrong with my references or is it possible that adding them clashes with something in the project
 
10:02 AM
plz
 
plz
Can't make this piece of shit work.
 
knowdatfeel
Y U NO GET DATA FROM DATABASE
 
Short answer: You're doing it wrong.
 
:'3
 
10:36 AM
Simple example
Can't get the value out of that blasted a tag
 
@Sippy anchors don't have value IIRC
 
@TomW Can I use a data param?
 
dunno, never used them
but looking in the DOM for value in an a tag I don't think will work, it won't parse it
 
Right.
 
11:00 AM
@Sippy .resolveDialog doesn't exist.
@Sippy this.value does not refer to the anchor
Anchors can have undefined tags though; but data-value is preferred.
 
I just changed it to ID
Can't be bothered fucking round with it
And .resolveDialog was meant to say .dialog-confirm :3
got confused.
 
And you can't access an attribute with a property accessor
 
Nooo
I've run myself in rings a lil bit with this one haha
 
There you go.
To recap: Properties in JS are not tied to the HTMLElement attributes. They are different things entirely. Scopes change, it's a prototype based language and each function has its own scope (keep a reference around or bind). jQuery is a tool that hides too much, start embracing normal JS.
 
@RoelvanUden I was only using it cos it was meant to make things easier * cries *
I should read up on js.
Is it easier to keep your head in raw JS when you're using angular?
Boss wants me to play with that next.
 
11:15 AM
@Sippy Absolutely. JS is fundamentally a simple language, and you should not associate the DOM to being the equivalent of JS. Tooling can help you guard against common pitfalls and improve your code and productivity; look at JSHint and JSCS. Angular is a bit of an impressive beast, it does a lot of 'magic' if you don't know how JS ticks; so learn it first.
For example:
var el = document.createElement('div');
for (var key in el) {
  console.log(key);
}
What could possibly be wrong with that? @Sippy :-P
 
Can you see anything wrong this @RoelvanUden or @Sippy?

http://pastie.org/9561551 I'm just not getting anything from the database D;
 
> OracleConnection
There's your problem right there.
;)
 
Is that actually a problem or is that some kind of oracle is shit joke :p
 
The latter
Not that I've ever used it but you know, low-hanging fruit
 
@RoelvanUden No idea what key does lol
 
11:34 AM
@Sippy It's just the name of the property.
@Sippy But prototype inheritence can really screw you over in that little bit.
 
11:46 AM
I thought getting stuff from the db would be easy
I was wrong ;_;
 
@RoelvanUden Urgh. ASP.NET MVC, when I reload this partial view, the <a> tags aren't affected by JS anymore T_T
Any clue?
It's cos I'm loading the JS on doc ready which isn't called when you reload a partial view using ajax
I assume.
 
@Shaun you haven't given us enough information to help
 
@TomW Oh uh sorry, what else?
 
what part is wrong?
 
@Sippy If you want to do it lazy, just put in a script tag in the partial at the bottom, with a call to the ready func for that bit
 
11:50 AM
It's just passing nothing to my js
 
@RoelvanUden Ah nvm, just called the lazy js again
 
that's a lot of code. Find out which part of the code isn't doing what you expect, then ask about that
 
I should make sure you know that I'm not a lazy asshole coder but this app is a real throwaway
The guy who asked for it on spec came to me yesterday and said "Well in 6 months this app is gonna be redundant anyway"
So seeing as it's shit already I cba to rebuild it :P
Just hack till it works
 
@TomW I've tried debugging and tracing but there's just no indication at all where it's going wrong D;
 
Are any rows returned?
 
11:52 AM
all that's returned is [ ]
I'm guessing that means null
 
From the query
 
Oh, the query works in oracle developer yeah
 
DataResponse is what...a string?
 
an object
 
and you're expecting an ajax call to return an array of values?
 
11:56 AM
correct
I did have static datic there that worked but I've tried replacing it with data from the database and it's returning null so I don't think the problem is in the service
just somewhere in that method
 
(I'm assuming this is a web api method) How does the serializer know that ServiceResponse is an array?
 
WCF method yeah
 
oh, WCF, right
 
reservations is a class that has an array
Reservations even
 
But you've just turned it into a string
 
12:00 PM
it's an arrray of strings :p
 
So why should the WCF serializer interpret that as an array, and not a string?
I would expect that just returning reservationsList would get serialized to a json array
assuming the serialization settings are correct, I haven't used json serialization with WCF
 
so get rid of jscript.Serialize?
 
yeah, the framework already does serialization
 
bad request :p
jscript.Serialize worked with the previous data I had, which works in the same way
it just wasn't retrieved from a database first
 
Sounds like cargo-culting. Don't do what worked before, do what makes sense
 
12:07 PM
I don't get it.
Project debugs fine, all the files are in the right places
Publish, copy to server
No dialogs.
Click the link and nothing happens. No errors in console, nothing T_T
 
12:49 PM
@RoelvanUden Wtf, I just realised what's causing that. In source, the links are still using value="1209"
Not using id="1209"
The source code which I'm publishing says id="1209"
Could that be a caching issue?!
 
html source?
 
Yeah!
How weird is that xD
 
nah sounds like a publish fail
perhaps you pushed it into production instead of staging or smth :p
 
Can you do a full publish?
Fuuuck knows
I am just publishing to a folder
 
sure, you can tell it to delete all prior to publish
 
12:50 PM
I delete everything from the folders then publish and copy over to server
k now the jquery works and the ajax doesn't.
this is so fun.
@Shaun we can be failbuddies
:DDDDDDDDDDDDDDDD
 
inspect environment differences, e.g. different .net, permissions, etc.
because .net can be so much fun like that!
 
Mmmmmmmmmmmmmmmmmmmm
Fuuuuuun
 
@Sippy 8D
 
1:06 PM
You know it's serious when the glasses come off.
 
didn't imagine you with glasses
 
They're new
 
christ I'm never gonna fix this @_@
might have to ask a question on so D;
 
1:47 PM
In this authors BasicChatHub example asp.net/signalr/overview/signalr-20/hubs-api/… (scroll down for the second class which is the chat hub) he does " string name = Context.User.Identity.Name;" in every single method. Why not make this some type of classwide var?
 
@VictorioBerra Because Context may change?
 
Is the hub class only instantiated one time?
 
If I recall correctly, yes, there should be just one hub for one room.
And again, if I recall correctly, all messages over it are single threaded thus guaranteeing the context as well.
 
2:03 PM
@RoelvanUden Can you gimme some direction with how I should debug this AJAX error? It works fine in debug(VS) on local AND on live database and I caaaannot figure out what's wrong when it's published :/
 
@Sippy Put in some logging + mailing :P
 
I'm sure I could fix it if I could find some info haha, but the only info I have atm is 500 - Internal Server Error
 
Well, mailing is optional. At least catch all errors and log them.
 
Aight aight
$.ajax({
	url: '/SiteTills/TransactionsOnHold/Resolve',
	type: 'POST',
	data: "&id=" + id,
	success: function (response) {
		if (response) {
			$("#partialtable").html(response);
			$(".resolveTransactionLink").each(function () {
				$(this).on("click", function () {
					resolveDialog.data('idparam', this.id).dialog("open");
				})
			});
			resolveDialog.dialog("close");
		} else {
			alert(response);
		}
	},
	error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); }
 
It's not going to be your JS. I guarantee it. It's the server/server configuration.
 
2:05 PM
Ohhhhhhhhhhhhh
Well
 
(For example, a different virtual mapping would be catastrophic)
Logging!
 
I can do /SiteTills/TransactionsOnHold/Resolve/1209 and it'll work.
And for that reason I don't know what to log xD
 
Everything.
 
You don't mean logging in code.
Well I'm uploading to a dev server so the logs are probably all enabled
 
2:06 PM
I has elmah
 
Well... Check it~ :|
 
Where would I find em?
The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Resolve(Int32)' in 'EH.SASS.TillStatus.Web.Controllers.TransactionsOnHoldController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters
I THINK
That's the issue
But like
hm hold on.
I configued elmah oddly and it's asking me for login details so just looking at it in the database xD
 
Lmao! Well, at least you have your error.
Still though, your JS looks wrong again.
(I didn't look before)
 
Yeaaah
 
Does that work in dev? :/
 
2:11 PM
Yeah it works fine.
 
I hate asp.net routing
 
I think you mean ASP.NET MVC @TomW
 
'optional' does not seem to do what the name implies it does
yes, I suppose I do
 
Optional is really quite optional, though. But other routes can interfere.
What's going wrong @TomW?
 
Well I was commenting on Sippy's issue
 
2:18 PM
@Sippy make sure your that particular expected route is defined first in the routing table.
 
@TomW My issue is likely to be that I'm an idiot. :)
We'll see.
 
I would expect that if a parameter is optional, not supplying it would cause a null to be passed to the action method
 
That's what happens. Well, not null per see, but default(T)
 
That seems not to work a lot of the time. I don't understand it so I stick things in until it works
 
This may be a dumb question, but can I put this:

                <td id="podSignature">
                  <xsl:if test="SignaturePath != 0">
                    <img style="width: 160px; height: 60px;">
                      <xsl:attribute name="src">
                        <xsl:value-of select="SignaturePath" />
                      </xsl:attribute>
                    </img>
                  </xsl:if>
                </td>
If statement on the outside of the td so it only displays assuming it test true?
 
2:30 PM
@RoelvanUden Can't get elmah UI to fucking work now, I love that tool .. completely forgot I even had it lol
Either way, "Server cannot set status after HTTP headers have been sent."
Seen that before?
 
Anyone? Is that asking for trouble.
 
@Greg Sorry bro don't even know what that is :(
 
@Sippy It is an xslt.
I'm feeding the data into an xslt but if a condition exist it will display.
 
Lol that's not very nice T_T
 
4 messages moved to Trash can
@Sippy I taught her that command, and a couple other ones.
 
2:41 PM
Ooo
As in taught, taught?
As in AI taught?
Or as in coded?
 
As in, used her learn command.
 
Ah right
 
@Sippy Your sarcastic remark had to be met with stern reprisal. What is it your working on?
 
@Greg It wasn't sarcasm haha
I just have no idea what xslt is :(
I'm working on trying to figure out why the fuck this ajax call works in dev but not on production
 
It is an XML Template.
@Sippy Look no further, then the word ajax.
 
2:45 PM
Lolol
 
Hey all. You know that LINQ syntax that makes it look more like SQL? i.e. from x in y where z .... does that have a name?
 
@MattThrower Yes, linq.
 
@RoelvanUden so there's no specific terms for writing it with the brackets in ... Collection.Where(x => x.ID == 1) .. and without .... from Collection Where x.ID == 1 ...?
 
@MattThrower They're both linq. One is using a lambda expression.
 
@MattThrower query syntax and lambda syntax
@MattThrower both are linq
 
2:51 PM
Hello all, anybody here use T4?
 
@RoelvanUden I'm glad I don't write apps like this anymore .. this is just hellish lol
 
Sure @Nathvi
@Sippy Yeah
 
I hate my noobier self.
 
@RoelvanUden, do you know if you can use excel as a data source?
or i guess, have you?
 
@RoelvanUden Thanks
 
2:59 PM
Hello everyone.
I've a small question.
Can anyone explain this method signature: MyFunction<String, T>(string name, T value)
 
00:00 - 15:0015:00 - 00:00

« first day (1432 days earlier)      last day (3519 days later) »