« first day (1460 days earlier)      last day (3504 days later) » 

12:03 PM
I am trying to total a column in SQL and I know I can use Sum() to do this however, my column is a nvarchar so this is what I tried:

/****** Script for SelectTopNRows command from SSMS ******/
SELECT Cast(GrandTotal as decimal) From [DB].[dbo].[table]
go
Select Sum(GrandTotal) From [DB].[dbo].[table]
go

and the error I got was

(91 row(s) affected)
Msg 8117, Level 16, State 1, Line 1
Operand data type nvarchar(max) is invalid for sum operator.

Should this not have worked?
 
@Shaun You mean best
 
@Sippy lets go with that
 
@Skullomania Looks like it's invalid ..
What do you mean by total?
Number of rows?
 
trying to get the sum of a column
@Sippy total sum of a column
 
As in adding all the values of every row in that column?
Why would that work as varchar?
That's like trying to add two strings together and expecting an integer O_o
 
12:05 PM
because I converted it
look at the cast
 
Oh yeah
You're still trying to sum grandtotal though
 
after it is cast as a decimal
 
Well going by the error message it's obviously left that scope.
So you either need to cast within sum or sum within the scope of cast.
 
@Sippy i agree. I need to figure out how to sum it in the same scope
 
select sum(cast(columnname as int)) from TableName
Should work
 
12:08 PM
I think I know how....I will post back in a sec win or fail
 
Or as decimal, w/e
 
you beat me to it
 
:)
 
god I don't understand deserialization at all ._.
 
@Shaun Serialization turns a something into text. Deserialization turns text into a something. What's not to get ;-)
 
12:11 PM
@RoelvanUden I understand the concept, just not how it's supposed to pass this list of properties along ;p
 
@Shaun "Just do it." - Nike
 
@Shaun Uhm
It's not meant to be a complicated process
If it's complicated you're probably doing it wrong
Serializers do EVERYTHING for you
 
If you want JSON you give it an object and say GIVE ME JSON
If you want an object, you give it that JSON and say GIMME MY OBJECT BACK BITCH
And it just does it.
> Sponsored by JSON, your go-to lightweight data-interchange format!
 
With love, from JavaScript.
 
12:25 PM
hahaha
 
Once I conquer .NET MVC I will be learning node.js
I need to transcend from this legacy spaghetti code that has laid claim to my soul
 
Then you can go: "Unlearn all the design patterns that were forced on me!"
 
may they burn with the fury of a thousand suns
 
@Skullomania That was sarcasm from Roel btw.
I'd recommend learning ember if you just wanna learn a js framework.
It's quite mvc'ey as I've heard.
but nothing like node.
 
12:43 PM
@Sippy b-b-but it no works ;-;
 
I don't appear to be able to use this in a lambda defined in a field initializer. Does anyone know why?
 
@Shaun u doin it wrong
 
@Sippy i know ;-;
@Sippy no noes why
 
Well you can't fuck up getting json from a serializer
 
oh I can
 
12:46 PM
So you must be fucking up the deserializing bit
How?
You literally just do Json(object);
 
well my method is passing what I want it to
like I can load it in my javascript in a console log
 
??
 
however i'm trying to pass it to another wcf method
using deserialize
 
LIKE I JUST SAID
 
but it doesn't give it aa value D;
 
12:47 PM
YOU FUKIN UP THE LAST BIT
 
I KNOW
BUT I KNOW NO WHY
 
cus u noob
 
well ye
 
duh
 
will u ava look
tell me what am doing rong
 
12:48 PM
ehm
I can try
 
@KendallFrey A field initializer cannot reference the non-static field, method, or property
4
Q: Why C# lamba expression can't use instance properties and fields?

Raúl OtañoWhy C# lamba expression can't use instance properties and fields, when is used in a class scope? See this example: public class Point:INotifyPropertyChanged { public float X {get; set;} public float Y {get; set;} PropertyChangedEventHandler onPointsPropertyChanged = (_, e) => ...

 
@Sippy surely even using deserialization
I can never view my properties in a C# method
that gets populated usingj son
 
@Shaun You deserialize to an object
So .. yeah you can.
 
@Sippy I'm doing that but intellisense don't recognise any of the properties it's meant to have
I didn't even think visual studio was capable of that
 
....
Seeing properties of an object?
 
12:51 PM
YES I KNOW THE DESERIALIZATION IS WRONG
 
Are you high?
 
Seeing properties of an object that's populated from a database
at runtime
 
Again, are you high?
 
I am not
 
This is why you should learn to fukin debug
 
12:52 PM
so are you saying it can or
 
And stop pushing to test environment to test if your shit works lol
Yeah it can
in debug
That's how you can see it anyway, otherwise you can still access those properties.
 
but surely outside of debug it wouldn't compile
 
??
 
If it compiles in debug it compiles outside it.
 
12:53 PM
yisss
 
the fuck is that
 
how dafuq would it ever compile tho id on't understand
 
Man I don't understand what you don't get xD
 
surely I can't just do something like preferences.SELMAXFUTURE; when it only gets that value at runtime
D;
 
When you use a decerealoliser it basically creates an empty version of your object and populates its values using the json object you give it.
 
12:54 PM
@juanvan Thanks, bro
 
@Sippy BUT THE JSON OBJECT I'M GIVING IT ONLY GETS A VALUE AT RUNTIME AS WELL D;
 
@KendallFrey Gold: Have a total tag score of 1,000 on a minimum of 200 answers
 
how would it ever know .___________.
 
@Sippy yeah, now I can insta-close C# questions
 
@KendallFrey LOL gg
Get that on JS pls
1k rep isn't hard, 200 meaningful answers takes the tiiiime
@Shaun ?!!?!?!?!?1
 
12:56 PM
!!!!
 
Because if it populates at runtime, why wouldn't it be able to?
 
cause it's not running the code in visual studio D;
 
wot
So what?
The data is still there
Omg this chat restriction timer shit needs to diaf
 
right so if I have
preferences = JSON.parse(data.DataResponse); in my json method, that gets the list of properties
 
@Sippy no, not 1K rep, 1K upvotes
that's 10K rep
 
12:58 PM
and then I try use that preferences in a C# method, using deserialized
intellisense will find those properties?
which are populated from a web service
 
@KendallFrey Ah, that's a bit more difficult.
@Shaun Yeah if the object which YOU SHOULD BE DEFINING has those properties.
 
@Sippy b-but it's just a string to start off with, until runtime .__.
 
@Shaun A string containing multiple properties should be a fukin object
 
@Sippy i know....i was playing along in the geekdom
 
@Skullomania ah
 
1:01 PM
@Sippy oops I mena uh in the c# method
@Sippy if I've got this ajax method
 
@Shaun I'm just confused now. Explain exactly what you're trying to do.
 
and I want to deserialize the dataresponse in another method
I tried this
 
but im totally serious about the MVC and the Node.js thing...I think everyone should get back to java...if your serious about a career in the future
 
@Shaun im afraid to click on a link from pastie.org
lol
 
1:03 PM
hah
 
x ? true : false Ain't nobody got time for that
 
lol
 
probably should of put them in the same pastie
 
@Shaun that sounds physically impossible
x_x
 
Where are you passing in the prefs?
To the method?
 
1:09 PM
@Sippy I uh, thought that's what the deserialization did o.o
 
You're an idiot.
 
;_;
 
You need to use AJAX to pass the preferences into your code
So you need another ajax call in which the data is that prefs variable you just made
In your first ajax call.
I'm betting you've done this and are being rutard
 
If it's not clear, I am fucking useless at ajax
 
Cos you not that dumb
LOL WTF
I just got a job notification for a Flash/ActionScript developer
 
1:11 PM
lolwat
even I know actionscript
that wud be a s1k job
 
Like does that even still exist?
It'd be a horrible job lol
 
i'd love it
 
Flash and ActionScript are awful
 
cud actually do it
flash isg r8
oh
did you mean like this with teh ajax
that's where it passes teh prefs
or it's meant to
but as we have established, my ajax skills are non existent
 
omg
Why are you passing your data in the url
I didn't even see that
Remove the data:{} or use it
Lol
 
1:14 PM
that still doesn't fit my problem x]
fix*
 
So you want to serialize sR
Why not just serialize in C# and then pass back as json?
 
I do
I have*
public ServiceResponse GetAllPrefsForUser(string username)
{
JavaScriptSerializer jscript = new JavaScriptSerializer();
ServiceResponse sR = new ServiceResponse();
GMGeniusMobileServices.GeniusMobileServicesClient client = new GMGeniusMobileServices.GeniusMobileServicesClient();
sR.DataResponse = jscript.Serialize(client.GetAllPrefsForUser(username));
sR.Message = "Success";
return sR;

}
 
You're returning a serviceresponse object
Then serialising it and doing nothing with it
Why not just serialise it in C#
Then return the json, and do something with it
 
but that object is serialised, no? O.o
 
It's not json?
Again, unclear what you're trying to do.
I expect you're trying to do something with that sR object but currently you're just saying serialise it and do nothing
 
1:21 PM
that method serialises it, then passes it to the ajax method
 
Yeah
No
 
Question about linq2db ... will performance be affected in any way, considering that every SQL that linq2db generates executes as

exec sp_executesql N'SOME_SQL_HERE', someparametersHere ?
 
yeah o.o
 
that method doesn't serialize sR
 
I can return that serialised data
 
1:22 PM
It passes it back as an object.
Then in your success method you're serializing it.
 
hm
 
But your success method just serializes it
It doesn't DO anything with it.
 
so what needs to be changed?
 
Also I'm not sure you can do data.DataResponse
Dunno what that is.
I don't think data carries properties of your objects, it just is one.
 
oh yeah that works
I can return the preferences and they get the value
the preferences method works
 
1:24 PM
?
 
I can use the GetPreferences method in javascript, and use it like it has properties
but I don't want to return that from that method, I want the trainmovements method to return it with the trainmovements
 
Ok lol
I'm just confused
 
so am I :'3
 
Sounds like you get it now tho
Or not.
 
I'm confused with the interaction from the getPreferences json method TO my trainmovements method
and how it passes the already populated preferences
(well it doesn't currently but y'know)
 
1:26 PM
Well you wrote it niqqa
 
ye
it don't owrk tho
like most things I write
 
posted on October 15, 2014

I’m excited to announce today that Microsoft is partnering with Docker, Inc to enable great container-based development experiences on Linux, Windows Server and Microsoft Azure. Docker is an open platform that enables developers and administrators to build, ship, and run distributed applications. Consisting of Docker Engine, a lightweight runtime and packaging tool, and Docker Hub, a cloud ser

 
1:59 PM
in SQL Server, in a high data throughput environment, if a primary key gets created at the beginning of a transaction, but the transaction is later rolled back based on some other condition, is there a chance for a gap to occur? i.e. PK going from 100 to 105 (missing 101-104)
 
@Darek why would that matter?
 
just curious
 
Might be better off asking the sql nerds
 
> Camputer Professionals
lol
 
@Darek Yes, that can and will happen.
 
2:03 PM
@KendallFrey Where's that from?
 
From our offshore team's website
 
Thanks @RoelvanUden
 
2:21 PM
Hey guys
Can I get some help with wpf, I'm kinda a newbie there
I got this combobox on my page
 
@KendallFrey Lol, I saw a website for a firm in Northern Tadjikistan or something advertising for 2 new programmers for their camputing team
 
 <ComboBox x:Name="guestComboBox" SelectionChanged="GuestComboBox_SelectionChanged" Style="{DynamicResource guestDetailComboBoxStyle}" IsEditable="True" local:Watermark.Text="{x:Static properties:Resources.SelectFromList}" ItemsSource="{Binding Path=ReservationGuests,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"  IsReadOnly="True" HorizontalAlignment="Left" Margin="10,0,0,0" Width="400"  IsEnabled="{Binding ElementName=selectFromListRadioButton, Path=IsChecked }" Text="{Binding ComboText, UpdateSourceTrigger=PropertyChanged}">
 
@SamyS.Rathore That looks suspiciously like web forms.
 
wut?
 
it is not :)
 
2:24 PM
its xaml
 
its camputed xmal
 
xaml*
 
whats your question
 
Looks blergh.
 
lol
 
2:25 PM
Never used WPF :)
Now I don't want to! :D
 
"how do i change the item template of the selected item in the combo box"?
 
I want the text property of the combo to show some custom text, rather than selected items
I have implemented that bu binding it to a property in my viewmodel, and changing it on the checkbox command
 
@Sippy Probably the same one
 
Hey everyone.
 
3:05 PM
 
Why was that image starred? Its now starred, twice.
 
yay ...
@ton.yeung Are you okay, dude? :D
You can get soft close cabinets as well, no need to get crazy with ya kitchen :D
 
Uplighting on top of cabinets is the best thing ever, by the way.
I can dig it
 
I know how to hammer a nail
 
@KendallFrey I know how to get hammered
@ton.yeung Only if you plan to house narnia
 
3:17 PM
I also made a cabinet in school
It's soft close in the sense that the door doesn't fit the frame anymore
 
Lol
I made a PC case in school
Was badass
 
I made a PC virus in school
jk
 
I got banned for having a batch script that would shut people's computers down
Used to email it to n00bs
 
In school I was the dude that everyone asked to set up the projector
 
Be like MAN THIS GAME IS AWESOME
Lol
 
3:20 PM
I once made a program to batch send emails (to one person)
Yes, I used it
 
Nice
I ended up working for the guy who banned me like 2 years later lol
 
lol
I became friends with the guy I spammed
 
So let's say I have multiple concurrent requests coming in for data that is contained within files. Each request is for a particular set of "chunks" of a file (offsets + lengths), and requests for the same chunk will be often repeated. There is a cost for opening a file for reading and a cost for reading bytes from a chunk of file.
 
@Sippy Same thing happened to me. I pissed off the sysadmin with non-installation EXEs but ended up on the school board technical committee.
 
What I'd like to do is lock on something that represents a set of chunks, blocking if another thread is loading any of the same chunks. And after the lock is held, check if a prior thread already placed the chunks in a cache. Then this thread would open the file only if needed and only read the remainder chunks.
But I'm stuck on wondering if there's any clean way to "lock on a set"
 
3:24 PM
@MrDoom Hahaha
 
Use Pipeline from PEE @MikeAsdf
 
I could set up a ConcurrentDictionary to lazily instantiate a new Object() for each unique fileId, and just lock on that. But if there are two requests going after disjoint chunks they shouldn't block each other.
 
Just use Pipeline from Parallel Extensions Extras
 
searching "Pipeline from PEE" is bringing up fetish videos...
 
3:27 PM
@MikeAsdf Maybe use more specific search terms lol
 
@Darek pee pipeline? hee hee
 
@KendallFrey indeed
my joke of the year
I like to PEE
 
@Darek You may need better jokes.
 
I am not quitting my day job, @Sippy
 
Ah that's alright then :D
 
3:36 PM
So looking at the pee pipeline, it seems like a neat way of handling processing in a streaming way, but I'm not sure how it could help with my concurrent file access puzzle. blogs.msdn.com/b/pfxteam/archive/2010/04/14/9995613.aspx
 
So you basically want to place a lock on a part of file?
 
and by "file" I mean a cloud blob accessed via some API, yes
 
so
1. Chunk the file
2. Get a lock on a chunk in parallel
3. Place in cache
4. Don't process a chunk twice

?
Or are you trying to read/write with a help of a cache?
 
read on the fly with the help of a cache
 
3:47 PM
Interesting
But that seems oriented around having a single key for a request
In my case a request will be asking for a helter-skelter smattering of various chunks of a file
 
@MikeAsdf, not really, there is no limt to number of variables
and keys are unique based on method name, parameter names and actual values
Cache can be memory, AppFabric or BTree
Also, an "update method" can cause a "read method" cache to be invalidated
 
so if request 1 comes in and asks for chunks A, B, C, and then request 2 comes in and asks for chunks C,D,E, will request 2 be able to recycle the cached result C from request 1?
And when request 1 was reading the file, it got A+B+C in one go, and request 2 can read D+E from the file in one go?
 
When doing an Asp.Net application, is it really wise to create a single page that does all this cart / order content with nothing but Javascript?
 
I'd say have two methods, one accepts an IEnumerable of chunks to retrieve, which calls the cached method for each chunk in Parallel, i.e.

return list.AsParalell().Select(s=>GetChunkCached);
You could do the same without AOP, technically speaking
 
opening up the file a separate time for each chunk?
 
3:59 PM
you just need to put teh extra work for establishing a cache of your choice
you said it was a web BLOB
 
yeah there's another layer on top of it that I neglected to mention
 
:)
than your milage might vary
The file can be opened in READ SHARED mode right?
 
the blobs are conditionally stored compressed/uncompressed, where depending on the nature of the file, it might even be decompressed using local hdd as swap space all thanks to this wacky layer
 
Should not be an issue, you can decompress an the fly within the cached method serving always decompressed content while retrieving mixed
 
I've got a question, if I want to make sure this isn't here:

=, or ,,

In a large url, what would be the best way to remove the , from the =, and the extra , in ,,?
Well, the real culprit appears to be the , after the =.
 
4:28 PM
Do you create this url through concatenation? Or does it come pre-fucked?
my solution would depend on this.
However, no time to solve. Totally going home now. Cheerio! :D
 
@Squiggle It comes prefucked!
I more than likely need to do some validation, if the =, is present then split if not use content.
Obviously I could do:

string[] content = Regex.Split(postData, "&Cart=,", RegexOptions.Compiled);

That would split it, but if I go to use the array, I'll more than likely get an out of bounds. As this error only happens under particular conditions.
 
5:00 PM
@TomW that's tractor supply company according to google finance
 
Is it normal that SQL 2014 spends hours prepping the destination for a database restore? I don't recall 2008R2 doing that
No message displayed, yet the disk 100% in use
Aahhh, it is teh upgrade from 2008R2 to 2014 which takes place
 
So I'll do something like this:
    bool invalidURI = postData.Contains("&cart=,");
    if(invalidURI)
    {
        string[] urlFragment = Regex.Split(postData, "&cart=,");
        postData = urlFragment[0] + "&cart=" + urlFragment[1];
    }
 
5:18 PM
fuck, market is down like 3% today. People are idiots about ebola. They don't even understand what it is
 
@Pheonixblade9 Welcome to life good sir.
@Pheonixblade9 Remember, people are like an array. Too many idiots are out of bounds.
 
 
oil prices are down too.
 
5:42 PM
update to vs2013.3, has been stuck on "microsoft visual studio preparation" for awhile now... normal?
 
Have you seen vs2013? It's gotta prepare bro.
 
@Pheonixblade9 That song is incredibly dark.
 
and update finished, of course, right when i say something.
 
The whole nazi imagery and everything was really well done.
 
5:46 PM
hi
i need help with a c# application that has enterprise library
can somebody help me?
i get this error when running the app
"An error occurred creating the configuration section handler for loggingConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3"
.
Since it says version 4.0 needed, I'm copying the Microsoft.Practices.EnterpriseLibrary.Logging.dll from the Microsoft Enterprise Library 4.0 install folder to the bing/Debug folder of my application, but when I run the application, the 3.1 version of the Microsoft.Practices.EnterpriseLibrary.Logging.dll gets copied to the folder. So the 4.0 version gets overwritten by the 3.1, and I end up having the same error.
 
@pyram have you written a question on SO?
 
yes, since yesterday but no one has answered yet
i need to fix this please
 
@pyram what ton.yeung said
 
@ton.yeung this application is from work, it's already built and I'm just going to test it. On the bin folder I can see log4net.dll already...............seems the application is already using log4net.
 

« first day (1460 days earlier)      last day (3504 days later) »