« first day (2176 days earlier)      last day (2755 days later) » 
05:00 - 17:0017:00 - 23:00

5:50 AM
So does anyone know how on earth to create a simple hard URL to an action in MVC? I'm not using it in the context of a View though, I am generating a unique URL and storing it into the database... Trying to use this:

```
public IHttpActionResult Create(Url url)
{
UrlHelper helper = new UrlHelper();
if (!ModelState.IsValid)
{
BadRequest();
}
url.OurUrl = helper.Action("Go","Redirect", null, "http") + url.UrlId;
_context.Urls.Add(url);
_context.SaveChanges();


return Created(new Uri(Request.RequestUri + "/" + url.UrlId), Url);
I've tried all kinds of variations on the Action() method... Like just using Go and Redirect as arguments... And what you see there. But it keeps telling me that routeCollection cannot be null
I'm confused because routeCollection isn't even a parameter listed in the method.
 
 
1 hour later…
6:53 AM
hey guys, does someone know how to copy everything out of a multiline textbox that contains > 50k lines? Ctrl+A and copy only copies a part of it, not everything
 
good morning
@SteffenWinkler how did it get there?
who would possibly check an >50k line text in a textbox?
 
it's Friday!!
 
well...it's the output window of a import routine.
the problem is that from test imports I calculated about 200 to 300 lines of text. Which one could copy out and analyze
 
you have 50k lines in a textbox??
people wrote a novel in there? :P
 
nah one customer has a much larger amount of data (and much more errors in it) than everyone else @JackyNguyen
 
7:06 AM
hi guys, has anyone worked with RabbitMQ?
 
morn all
 
Friday!
@QuietNaN yes, but it's a while ago.
 
@scheien its usage logic is like this?
1. you should install rabbitmq on server machin
2. One app should create channel and queues (e.g UI sends commands to queue)
3. Second app should play Receiver role (e.g Receiver reads from queues and forwards to Application Service Layer)
UI => RabbitMQ Queue <=> Receiver => Application Service Layer
?
 
Teo
7:35 AM
hi guys! how are you?
Is there someone that could help me about MVC and views?
I'd like to show a timer (refreshed each second via JS) in a view that have to run always, even if you exit from this view. When you return to the view you can see the updated timer.
Which way would you use?
Do you think that store the current time when leave and calculate the difference when return is the best way?
Or can I create a dedicated process that do it?
Thank you
 
well...I found a bug in WPF Textbox
I've a line containing control characters (those funny box thingis). If I try to copy that one line (mark it with cursor and then rightclick and choose copy), it only copies the text until the very first control character
any idea if I should write an e-mail to somewhere/someone about that?
 
@Teo It's a countdown to some date?
 
@SteffenWinkler the WPF stuff hasn't been open-sourced AFAIK, so no github :(
 
@Squiggle ye I know, but there has to be some kind of bug reporting for .NET stuff in general
on second thought, it'd explain a lot if there isn't. Especially when it comes to WPF
 
Teo
@RoelvanUden Thank you for answer me. No, to the contrary, it's like a stopwatch
 
7:40 AM
connect.microsoft.com/VisualStudio looks like the place to go
 
ah neat, thank you @Squiggle
 
glhf
 
Teo
@RoelvanUden I start from zero. I work and do other stuff.... then I return and see the timer updated that run until I decide to stop it.
 
@Teo I still don't fully get the whole process. You want to start a stopwatch at some point, leave the page, and come back later to see the new stopwatch state?
 
Teo
@RoelvanUden Yes, like a "tomato timer"
 
7:45 AM
@Teomanshipahi use HTML5 storage to log the start timestamp, then just resume from there any time the page is loaded.
resume/recalculate
 
^ that
 
it's probably 5 lines of javascript. Hell, I'm writing a timer right now :)
 
@QuietNaN Something like that yes.
 
@scheien thanks
 
It's called a publish/subscriber pattern.
 
Teo
7:49 AM
@Squiggle Eheh! A trouble shared is a trouble halved! Thank you for the answers @RoelvanUden and @Squiggle.
So you tell to store the start timestamp and when the page is loaded I compare the stored timestamp with current time and calculate the difference to start again from the right seconds/minutes?
 
pretty much!
 
Yeah, that's it.
 
Teo
Thank you guys @Squiggle and @RoelvanUden! I was focused on the server side... I thought to processes, static variables, etc. But maybe in this case the client side is enough!
 
@Teomanshipahi yeah. HTML5 localStorage is really useful in scenarios like this!
 
Or sessionStorage if you don't need to persist over browser close.
 
7:56 AM
Isn't session storage tied to each tab?
 
Teo
@Squiggle @Squiggle, @RoelvanUden thank you. I think I will use the HTML5 localStorage. ;-)
 
Whoops, apparently you're right.
 
I made a thing.
doo de doo
it feels so dirty to be writing vanilla JS
Plunkr is clunky. Can other people see that link?
 
Teo
@Squiggle oh! Thank you @Squiggle! Very nice not so much wonder!! ;-)
@Squiggle I see it, and I have tested! It's very well @Squiggle, thank you so much!
 
yey
 
Teo
8:07 AM
soon as I repay
 
lol no need
 
Panini
2
 
8:30 AM
to the tune of "Volare"
 
oh, just as a heads up: The textbox contains ~190k lines
finished copying 'around' those ASCII/control characters
 
9:10 AM
-5
Q: Why does it not work? Help me

lifeng1893<body> <a href="javascript:" id="prev">prev</a> <a href="javascript:" id="next">next</a> </body> <script> $(function() { var $prev = $('#prev'), $next = $('#next'), count = -1; function prev() { $prev.click(function(){ count--; console.log(coun...

this ruin my day :3
 
that is a really poor question
I mean, badly described. The problem is with the English, not the subject.
totally valid to be put "on hold" though
it's a shame there's no leeway given to allow the user to correct/update their question before it gets downvoted to oblivion
 
War
9:25 AM
ouch
 
Yep, provides no value to the site, so it's trash
get rid of it, keep the place tidy
 
M J
Hi guys
 
o/
@TomW I agree
it's clear that many people post questions without having even read the 'Tour'
 
M J
9:52 AM
what tour
 
the tour that it prompts you to do as soon as you create an account
even the 'Ask A Question' page gives basic guidance on how to ask a question
 
@Nerdintraining Looking for jobs boro
 
> Provide details. Share your research.
o/ @JakobMillah :D
 
o/ :)
 
sushi for lunch today, methinks.
 
9:56 AM
olala!
 
gief
 
I get grandma food today
Grandmas spaghetti
I did nice dinner yesterday. Minced meat and potato gratin
 
> potato gratin

WANT
 
Very gut in belly!
 
10:00 AM
ooo
 
Simon's cat for everyone who doesn't know it.
 
recognizing it
 
M J
10:32 AM
it is like Frog :)
 
2
Q: Import emails and verify process

Sagar JainI have a system with a "import from XLS" option, xls contains lakhs or n number of emails, the user uploads the file, which is added to a Queue (Queue::push). My problem is that i have set a cron in the windows scheduler which verify the emails in the list, Queue takes a while to process the emai...

Please reply on this question
 
hours to make an import from xslt with email accounts?
How many emails are we talking?
Or the server == a toaster?
 
How on earth has that question been favourited five times
 
10:53 AM
The Indian company got their SO bots to boost their questions regarding spamming email accounts - Kappa
 
@Sherlock I have empathy for your problem
 
11:48 AM
SO community downvote speed is faster than indian company upvoter bots. kappa >D
 
@ntohl FEEL MY DOWNVOTE
 
hello guys
a question
is there any way to know which row in a datagridview is multiline
for example in this image
the second row is multiline
i mean how to know which row contains more than one line of text
any idea?
 
12:05 PM
does this text wrap around?
or does the value contain an actual new line?
 
it wraps
its not inserted by \n
 
 
That's tricky :) I'd just go by string length, but that's not a great approach if the font isn't fixed width
 
haha i thought about that
 
@Feeds I don't want to miss a thing!
 
12:07 PM
:P
 
that would be different
 
can't you make DataGridView scale to fit contents?
 
WPF?
 
WTF indeed
 
the problem is that i map that data gridview to graphics
not WTF
WPF
or how to know that that cell cannot fit its content?
 
12:09 PM
you can't always know that
unless you know the range of your inputs
 
means no solusion
:)
even if i ask in SO
i just want to know that a cell cannot fit its content
 
what would you do if it doesn't fit?
 
Need some recommendation guys, i have Order & OrderLine (Contains UniPrice property), what is better solution:
1. When i Place Order (ShoppingCart => Order/OrderLines) UnitPrice should be passed from ShoppingCart to OrderLines.
2. When i Place Order, OrderService should contain PricingService domain service which will get UnitPrice for each OrderLine (ShoppingCart will only Contain StockItemID & Quantity)
 
perhaps 2?
 
@Squiggle if it couldnt fit
i change the high of that row
when i draw the row in graphics
 
12:15 PM
@HamreenAhmad doesn't the gridview control allow you to do that automatically?
 
like the 3rd row in this image
 
you're drawing your grid manually?
 
yes
:)
 
ouch
¯\_(ツ)_/¯
 
i draw it according to the datagridview i have
thus i need to know when a cell cannot fit its content
:D
 
War
12:19 PM
wow people still do that?
 
do what?
i need it for receipt printing
 
M J
Fix the Column width and count the no of character's occupy in it. if Cell value Length is greater than cell character count.
 
not all the character's have the same size
thats the first thing i thought about :)
 
receipt printing? have you never heard of pdf?
 
M J
what will you actually have to do it with
explain it
 
12:27 PM
@RoelvanUden i want print it from the app directly
not export it to pdf
 
M J
@HamreenAhmad ???
 
@MJ you understood
as you answered
 
You do realize printing a PDF is a common thing, right? And that there hundreds of libraries that do that for you, right? And that generating a PDF is far easier than custom drawing, right? And that Chrome-derivates can print HTML as PDF, right? And that you can use a headless webkit to convert your HTML to PDF, right? That means you just need to throw in a HTML and print it for goddsake
 
know whether a cell can fit its content
@RoelvanUden if i cant do it i use that way
i dont use that way just because that wants more steps to print the receipt
and more hard for novice peoples to print it
 
calculating content size is much easier, than using already existing pdf exports which are close to native...
 
12:38 PM
maybe
but by getting the position of the first and last character
and subtracting them
thanks for all...
 
@HamreenAhmad Your software takes cares of these steps! YOU WRITE HTML AND PRINT.
THATS IT.
FOR GODS SAKE ARE YOU INTENTIONALLY CREATING TECHNICAL DEBT?!
/rage
 
I was joking. It was sarcasm >D
 
@RoelvanUden ok ok dont be angry i do what you say
 
12:54 PM
hey
I'm using some bootstrap to create panel of FAQ's. Problem is the Glyphicon font-family can't be found to create the dropdown arrow.
instead it renders the content number of the icon. Is there a way to use an existing asp font arrow?
may be a bit off topic for C#
 
@RoelvanUden It's Friday!
 
@BrianJ not really, did you put the font family in the folder?
 
1:16 PM
Gotta get down on Friday
 
or get her to go down
 
Ohhhhhhh
 
Am I missing something, or does calling a UDF from EF really require this? msdn.microsoft.com/en-us/library/dd456847(v=vs.110).aspx
 
M J
Friday :):):):)
 
War
@Alex only if you want to use it in a LINQ to entities query
you can just execute any arbritray sql with Database.Sql<T>("exec dbo.function(@p0, @p1)", args);
 
1:32 PM
@War That's what I wanted to do.
 
War
or something like that (that was purely from head ram so it might not be perfect)
@Alex I actually implemented that function so I could call it both in and out of linq queries
 
The challenge I ran into was calling a C# method from a Linq query, where it was running on the db (AsQuerable() vs. AsEnumerable())
 
War
@Alex here's what i did ...
[DbFunction("ShellContext", "GetPagePermissions")]
public IQueryable<PermissionSet> GetPagePermissions(int pageId, int userId)
{
    // codefirstfunctions.codeplex.com
    return Database.SqlQuery<PermissionSet>("select * from dbo.GetPagePermissions({0}, {1})", pageId, userId)
        .AsQueryable();
}
 
Nice
 
War
then i called it like this ...
public IQueryable<Objects.Dtos.Page> GetAllWithPermissions(bool includeInactive = false)
{
    return
        from page in base.GetAll(includeInactive)
        from permissions in Db.GetPagePermissions(page.Id, User.Id)
        where permissions.Read
        select new Objects.Dtos.Page {
            Id = page.Id,
            ParentId = page.ParentId,
            Name = page.Name,
            Path = page.Path,
            Layout = page.Layout,
            Content = page.Content,
            Script = page.Script,
 
1:34 PM
Challenge also is, I'm doing db first. Any changes later will whack my additions to the EDMX file
 
War
this was allowing me to do a cross apply permissions with pages on a hierarchy of pages
 
Looks good
 
War
I'm using code first though ... so not sure how you would do the same ... it can't be far off that though
@Alex the original question may interest you
8
Q: Hierarchical permissions in a table stored hierarchy

WarAssuming the following database structure (modifiable if need be) ... I am looking for a nice way to determine the "effective permissions" for a given user on a given page in a way that allows me to return a row containing the Page and the effective permissions. I am thinking that the ideal s...

 
Yeah, it's the same thing. But somehow I thought if you add your UDF to the EDMX through it's "Update model from database", it would make it available via context.udfMyFunction(...)
 
War
wtf ... microsoft have verified this is a legit problem and people are voting to close ...
0
Q: Clean Install VS Compile Performance Problems

WarProblem VS takes 25 seconds to compile even a brand new un-edited empty console app project What I have tried I noticed this performance problem recently, but i'm not sure exactly when it started, so to play it safe I have taken the following actions ... Disabled any redundant / not neede...

@Alex hmmm ... not sure with dbfirst
have you tried adding it to through the usual dialog options like when you add a sproc ?
 
1:38 PM
Next project will try code first and go with EF 7
 
War
code first rocks man :)
 
Yep
I think what you described is the way to access a UDF
 
Wait till you work in enterprise and you don't have control over your databases
 
Done that too. Usually, they give us the dev db access
 
is there such thing as a try catch try... finally like a nested try catch logic?
 
1:40 PM
For anyone interested, here's the official MS documentation of working with UDF from EF query: msdn.microsoft.com/en-us/library/dd456847(v=vs.110).aspx
 
@JoJo why would you nest try blocks?
 
thats what I am wondering
 
@juanvan ok used a css code for the grater than symbol which worked a treat :)
 
ya or that would work
 
try{
}
catch(exception e)
{
}
catch(MyException ex)
{
}
@s.m. Uh what?
 
1:42 PM
@ty
 
user47589
so much foolishness in c# chat. what it needs is a good dose of friendship
 
"...and in those days, the love of many shall wax cold.."
Is there a good way to test for a FormlessPage first before PageBase?

MasterRef.Functional_Area _funcArea = MasterRef.Functional_Area.None;
if (_setfuncArea != MasterRef.Functional_Area.None) {
_funcArea = _setfuncArea;
}
else {
_funcArea = ((PageBase)this.Page).FAID;
}
return _currentUser.HasPermission(Permission, _funcArea);
 
If I wanted to move js in a view to a separate file, do I need to place that in an anonmous function?
 
else if ((FormlessPage)this.Page ?
 
I have a lot of js in an razor view and it would be better to separate out to a file I think
 
1:55 PM
Hello
someone familiar about Dapper.NET in here?
 
Do anyone know why EF round a value up from e.g. 205.25 to 205.50? Inspecting the record shows the correct value: 205.25, but when EF materializes the record, that specific value is set to 205.50. Both the column and the property in the entity is set to decimal(18,2). Am I missing something?
 
Hi guys, has anyone worked with azure service bus?
 
yep
 
2:10 PM
@TomW service bus allows you to register handlers for messages right? like when servicebus receives message it forwards it to handler.
 
Erm
 
or i should have listener who just looks after service bus and when message appears there it handles it
 
I'm familiar with queues. Topics are similar I think, but I've never used them
in both cases you have to connect a client and read from them to receive messages
 
How can i simulate service bus, i want to achieve this:
UI sends Commands like PlaceOrder => CustomBus (it queues those messages and forwards them to Handlers one by one, i am registering handlers in application_start)
CustomBus can receive PlaceOrder commands from different threads
@TomW bump
 
Simulating a queue is not trivial
You can install Service Bus for Windows Server but it's an old version and uses a different version of the client library, they haven't updated it yet
but it is a real service bus, the same code that runs in Azure itself
or did, when it was that version
I think you can also get hold of service bus WCF bindings and host a local service that has the same contract, but I've never done that
Are you sure it's actually service bus you want
 
2:29 PM
@TomW I just want to queue received commands from UI in multiple threads and handle them in Application Service one by one
ServiceBus is overkill?
 
Yes, possibly not the right tool for the job here
 
What can you recommend?
 
For one it's persistent. You could have commands from a week ago sitting there to be read
If you had an outage or something
I'm not very familiar with other technologies, maybe RabbitMQ?
 
@TomW to clear up, lets say ServiceBus is right tool for Amazon Support Tickets module where 1 ticket can sit days, right?
 
hey again
 
2:34 PM
What is there difference between a Differential backup in SQL Server vs a Transaction log backup?
Like I understand that a differential is all the changes from the last Full backup, and a Transaction log backup is all the transactions from the last Full backup.

But why would you do a Full + Differential + Transaction? Why not just do Full + Diff OR Full + Transaction?
 
@QuietNaN well no I don't think I'd use it for that. But if you have two backend services communicating and when they send a message that message absolutely must not get lost and must be acted on, then a persistent queue is good
For handling user interaction on the web, 100% delivery might not be essential, "sorry there was an error" is acceptable to a user if it's a rare event. You can hace a simpler queueing model that isn't necessarily persistent
 
Okay reading more about the SQL Server backups it sounds like Transaction Log backups allow for Point-in-time recovery, where as differential does not.

So then it makes me curious as to why would you use Differential backups? Why not do something like Weekly Full + 15min Transaction Log backups? Is it because you'd have to include a TON of transaction log recoveries to get up until a certain point?
 
3:10 PM
I'm building a generic factory builder from t4 templates. It's going to be sweet
 
it states that it's 3 level
full -> differential -> transactional. The question is that why the mid layer?
 
@ntohl right
 
what happens with the queries, that are not in transaction?
 
like what?
 
update table set A = 'thing'
--versus
begin tran
  update table set A = 'thing'
commit tran
 
3:31 PM
I would have figured Transaction Logging would log any sort of CRUD
 
8
A: CHECKPOINT or COMMIT writes to disk?

Shanky When a transaction is commited (COMMIT), the transaction is written to the transaction log in RAM. A transaction is written to the transaction log before even changing the page or data as requested by query. This is called write ahead logging (WAL). If SQL Server crashes while a page is bein...

I have to read it through
interesting topic
later... It's friday
bye
 
@ntohl have a good weekend
 
4:04 PM
Hey guys
I'm creating a solution with two projects - 1st one is the plain old MVC, second one is a Class Library w/Entity Framework Database First. When I add a reference from the CL to MVC I have to copy over also the connection string to MVC's Web.config and add EF.dll to the MVC's references. Is there a way to avoid that? Like i.e. have the CL output everything in dynamic json and the MVC would just only need Json.dll w/o adding the connection string?
 
Hey Adrian
 
ADH
4:55 PM
Do you guys know how to use GitHub?
There is project up there that I would like to have on my computer.
I downloaded the GitHub installer for WIndows
 
Do you know how to use Git?
 
ADH
I want to get the code for: github.com/Sitecore/Habitat.git
 
There's also typically a zip that you can download
 
ADH
SHould I just download the Zip?
 
That's one way of doing it, yes
 
ADH
4:56 PM
I was hoping to learn a bit about GitHub in the process.
 
But if you're planning on contributing clone the project
 
ADH
So I need to clone it.
I click Clone
And then what?
It just says, no respositories
Where do I put the URL? github.com/Sitecore/Habitat.git
 
What client are you using locally?
 
ADH
It says GitHub
Little icon with a cats head or something
GitHub Desktop
 
I haven't used it, but do you see anything that says "Clone"?
 
ADH
4:59 PM
Yes
I click it, then it has a box for filter
 
Click it
 
ADH
A window comes up
 
05:00 - 17:0017:00 - 23:00

« first day (2176 days earlier)      last day (2755 days later) »