« first day (1961 days earlier)      last day (3004 days later) » 

1:53 AM
It's kind of weird that I can't display multiple values inside Telerik MVC Multiselect, following is the error:
A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies.Case_04F16DEC357A5E45FC064D61E4E1278B85F3780F74C3D22787476A73A29BCFF3'.
I've got this inside my ViewModel:
public IEnumerable<CaseType> CaseTypes { get; set; }
I've got this inside Controller:

var getcasetype = db.CaseType.Where(p => p.CaseId == cid).ToList();

var combocaseindex = new IndexCaseComboViewModel
{
CaseIndexViewModel = new CaseIndexViewModel()
{
...other properties...

CaseTypes = getcasetype
}
};
And this inside View:

@(Html.Kendo().MultiSelectFor(m => m.CaseTypes)
.Name(Html.IdFor(m => m.CaseTypes).ToString())
.Placeholder("Select Type")
.DataTextField("Definition")
.DataValueField("Code")
.BindTo((System.Collections.IEnumerable)ViewData["casetype"])
)
I even tried the same thing with @foreach Razor and I was able to get the correct values.
Example:

CaseId: 1D9FA7F6-21C9-E511-B071-A808D0D168D4
Saved Case Types for that CaseId:
-Standard
-Special Edition
I also tried "getcasetype" to be FirstOrDefault instead of ToList and that worked but it only showed one value which is normal. My intention is to show multiple selected values in Telerik MVC Multiselect.
 
2:45 AM
o/
 
How's your "day" been
 
well, at the beginning it was very good and I was happy with every single progress but from 19:00 everything just flipped :D
yours?
I've already mentioned my issue above.
It's almost 4am and still trying to fix that.
 
D:
My suggestion - get some sleep - I'm not the best person to be suggesting this as I stay up doing all nighters all the time and have to fix the mistakes I made in the morning, but cognitive function drops when you're sleep deprived. Generally, fresh eyes will help you see the problem, sometimes instantly
 
@Gabe you're right...
 
2:55 AM
@CodeMaster little bit of sleep bud, good for the brain and soul
I was supposed to be up at 8 working on my project but was still tired so I slept knowing that I'll be better for it when I wake up and start working
 
yup, I will go now. I hope I will find it tomorrow.
 
@amy - you there, got a queston
@CodeMaster - good stuff man :) Sleep well
 
@Gabe Thanks. Have a nice day
 
hi guys, LF 'bring to front PID 10672'
trying to bring to front a console window with the PID of '10672'
 
3:11 AM
@Adan Process handle = Process.GetProcessById(processID); SetForegroundWindow(handle);
 
@Gabe is 'setforegroundwindow' a method?
 
Ian
Good morning! (from GMT +8)
 
Yes it's a windows function
 
hmm what do i put so that it runs?
 
G'day mate
 
3:28 AM
@Adan - dotnetfiddle.net/nZ7RTL It won't work on the website, but if you bulid that code it'll work
change the Process[] handle = Process.GetProcessesByName("notepad"); with Process[] handle = Process.GetProcessesById(10672); and build
There are some issues with minimized windows and using that fuction with windows 8+ I think, but as long as the window isn't minimized and is just running hidden from view. it will pull it forward.
 
@Gabe works :D thanks!
 
No problem
 
System.Timers.Timer atimer = new System.Timers.Timer(10000);
how do i initiate atimer' ?
atimer.run;
//code
 
aTimer.Enabled = true;
 
hmm, ran it and program quickly finished, it didnt wait 5 secs like it old it to (5000)
 
3:35 AM
Post your sourcecode there
I'll have a look
 
msdn.microsoft.com/en-au/library/… research how to use timers :)
 
System.Timers.Timer aTimer = new System.Timers.Timer();
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
aTimer.Interval = 5000;
aTimer.Enabled = true;

Console.ReadKey();
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{ //specify code you want run after the timer
Console.WriteLine("Hello World!");
}
got it ;D thx
 
No problem
 
gaaaaaaaaaaabe
hi
 
3:47 AM
o/
 
lol
 
What's doin?
 
@Gabe nothing good
u?
 
Personal project
Kinda bored.
Refactoring some of the code atm - transitioning to state-strategy-observer
 
@Gabe Refactoring is boring you?
go refactor yourself!
 
3:52 AM
D:
It's alright
Just a lot of work before the code is usable again that's all
 
I have a delima... I just got back from a week long business trip. I dont have anything tasty in the fridge. Im not in the mood for pizza. Most other places are closed except for shitty fast food. I'm hungry. Debating frying an egg at like 11 :(
 
Got any ham or cheese at home?
 
cheese I think
no ham
that tends to end poorly for me
there is an ihop lol but... I don't want to go somewhere, besides ihop at almost midnight is kinda weird
 
Make a cheese omelette. Beat them eggs, put the cheese in with it, then fry it in butter
gg
 
hmmm
 
3:56 AM
Won't regret it
Just make sure you put a decent amount of cheese in there with some salt and pepper
 
haha no worries there. People say I oversalt things
 
If you got some paprika or something, throw a good splash of that in the egg mix too
 
I swear everyone else just undersalts
no paprika
 
You could put a splash of soy in there if you want to ditch the salt
Two eggs, a cup of cheese, splash of soy and some pepper, fry in butter = meal fit for a king
a fat king
but a king
 
I can eat the most fattening diet and I dont really gain much if any weight
thank a crazy high metabolism...kinda sucks tbh in some ways
 
3:59 AM
Same - high metabolism op
Bad for gaining muscle mass, good for losing fat %
 
doesnt make bulking up the easiest sometimes.
exactly
 
Just means you have to put more calories in your diet to give your muscles something to work with
 
and make yourself eat more than you would normally.
 
Pretty much
 
there are pills that supposedly lower metabolism but I hear bad things about them. Its funny I've tried plenty of pills of a different nature and didnt care but diet/muscle stuff I am leery of
 
4:02 AM
My diet isn't exactly amazing, but I'm too old to be thinking about the perfect body anymore. I'm happy just having an athletic look instead of bulk, then I can eat what I want, keep the weights lighter and just walk to and from work for my aerobic. Winning
Don't fuck with metabolism pills
Those things are bad
Just eat more
 
well... Im just trying to get into good shape. Some medical shit has put me way behind unfortunately
 
I know them feels man. Went through liver cancer and resection
 
yeah, thats what I think too
 
Don't worry though, take it slow. Pushing yourself to get results faster just ends up slowing you down
 
@Gabe yeah. I know some people probably think man he just doesnt work out or is lazy etc. No... there is a reason out of my control lol. It feels good though getting stronger and stronger.
@Gabe hmmm how so?
 
4:05 AM
If you over exercise you stop burning fat and start cannibalizing your muscles
So you get absolutely no benefit
Sure you still burn a bit of fat just by doing the exercise, but it's not worth what you lose to do it
Just take it slow, start slow, increase over time. Push the limits, but don't push to failure until you're already fit
 
maybe thats my problem
how do you know when you're pushing too hard?
 
If you're spending more than 2 hours in the gym more than 3-4 days a week, you're pushing too hard
 
well shit
 
Rotate muscle groups, make sure you swap each session, give yourself adequate time to recover. If you currently have a weight issue due to whatever reason, stick to light weights with a lot of aerobic exercises. Steppers and swimming are fat burners
 
yeah
 
4:09 AM
A lot of people forget about swimming man
Swimming is AMAZING and it's low impact
Perfect
esp for people with a weight problem
 
I know it is, just not for me.
not my thing that is
 
Also that's why stepper machines are good, it's low impact but the same as climbing steep steps.
Well if you're not into swimming, jump on a stepper, a cushioned treadmill and hit the crunches, light weight squats etc
Talk to the PT's at the gym
They'll get you on the right path
A lot of people say "oh but youtube tells you everything you need to know" true, but youtube can't spot you, check out your technique, give you the correct diet (mathematically) or have the experience a PT has with clients with similar issues. I don't care what anybody says, a good PT is worth their weight in gold.
 
@Gabe have never really talked to one. Kind of a loner when it comes to that sort of thing
perhaps that needs to change
 
I would bite the bullet and talk to one. They are there to help you get to where you want to be. Whether you just need motivation because you can't motivate yourself, give you a diet/exercise plan or just spot/technique check you. They're worth the money you'll spend. And once everything is in check and you got your shit on lockdown, just chill out with the PT sessions and check in with them once a month to check progress and adjust things as needed.
 
@Gabe sounds like having a therapist but for physical shit lol
:P
 
4:19 AM
:D
 
wow that was bad word choice
that could be taken many ways
 
I actually did a dual bach at college, my second one was psycH!!!!ology lol
 
haha
 
bbs, gotta run to the store before it closes
 
have fun with that
 
4:43 AM
anyone on?
 
maybe
 
Hey, you any good with Angular?
 
if by good you mean screwing it up, I'm your guy!
 
nice!
 
any time! lol
 
4:45 AM
I have a controller that gets data from a REST service, and is "supposed" to load it on the form
It works, only if I put an alert button after the WS call (after the $scope.Data is loaded)
 
buuut?
 
if I remove the Alert, it doesn't display, but with the alert, it displays
 
cant help you there, sorry
I'd just be googling... which i'm awesome at but...
 
@RyanTernier did you try manually digesting? and are you using the angular http call? not the jquery one
a lot of times, when you use jquery (not lite), angular doesn't properly get notified that data changes, so it doesn't do a digest, so the two way bindings don't get updated, or something like that
hope that helps
 
5:10 AM
@SteveG Thanks, that makes sense. Angular can't parse the JSON that is being returned (every other frameowrk can...)
 
np
wow really?
 
So yea, I think Angular is getting stuck because it's not getting notified. Is there a way to just tell it to "flusH"?
 
Thanks man!
Another question
 
anytime
 
5:15 AM
I'm setting my $scope.Events object.
My markup for the repeating works, but not the static content. antyhing special i'm missig?
 <h2>Results</h2>
            <ul>
                <li><span>Total Events:</span> <span> {{Events.total_items}}</span></li>
                <li><span>Page Size:</span><span>{{Events.page_size}}</span></li>
                <!-- DOESN"T WORK ABOVE-->
            </ul>
            <ul >
                <li ng-repeat="e in Events.event">
                    <a href="{{e.id}}" data-ga-label="Event Image"> <img ng-src="{{e.image.url}}" /></a>
                    <h2>{{e.title}}</h2>
                    <div><span>{{e.start_time}}</span></div>
 
i'm not sure, i'm not great at angular and nothing recent
well, that looks fine to me, are you sure they're on the scope?
I think theres a dev tool in ff or chrome that lets you browse your scopes in real time
i'd make sure they're on the scope, if they're not on the scope you might be setting them wrong, but this is assuming $scope.Events is your own custom thing, if it's some angular magic -- i have no idea, not a pro
 
will give it a look - cheers
 
 
2 hours later…
7:28 AM
Good morning.
*echoes*
*tumbleweed*
 
 
3 hours later…
10:17 AM
hey good afternoon..
 
Hi
 
how can we use razor view checkboxfor to pass bool value in the controller ?
 
if the propery is bool, model binder will handle it for you
assuming your view is strongly typed
stupid me, it has to be strongly tyed in order to use checkboxfor
 
10:43 AM
Today's task - refactor an ugly bit of code. Usually I enjoy refactorings. Today... ugh.
Four classes that do almost the same thing (ViewModels for similar views), but were developed separately, sometimes with copy-paste code-reuse that has drifted away over time.
*sigh*. I'll feel better once it's done.
 
sounds good :)
 
10:58 AM
There's some ugly logic there. By design. By spec. As requested. :(
"Display a list of properties and their values. But the properties come from several sources. And there might be duplicate keys. If there are, check the value. If the values are duplicates too, show only one entry. If the values are different, show both in the list".
Basically, use key+value as the key.
 
11:24 AM
HI
How can i use static html with placeolders for the data from database in mvc 4
I have a requirement in my project which is a newsletter tool
where i need to call different htmls for different newsletters so that i can have a variant of themes
all though data from database will be same for all the htmls
if someone can give me a little idea how to do that it will be very helpful
Avner do you have some suggestion?
 
if you only want to change the look of the page, why not only alter the css
i mean your html content remains same, am i right?
 
yeah
But how can i change CSS for different newsletter
In case of html
 
what is your model or viewmodel that will be passed to view?
 
Just have different CSS files for the different newletters, and just change the <link> to the stylesheet based on the variant.
 
^ yeap
 
11:34 AM
ok
Rusty
the viewmodel is the NewsLetter object
 
Ahan, so i am guessing you will have a property like "Name" or anything that is unique and based on it you want to apply a theme.
right?
lets cut the chase: put it in your head tag
if( Model.NewsLetterTheme == "UseSwitchInstead" )
<link href="~/Content/ThatTheme.css" rel="stylesheet" type="text/css" >
thats the basic idea
 
yeah i got it now
Thank yo
it is better idea
i will use it
just out of curiosity
Is there any way to call a html page from controller and use the variable vaues in it
value*
 
11:50 AM
yes, ofcourse. You can call different views from controller based on a conditon and pass anything to it, Check out the View() overloads in Controller Class in documentation.
 
Not Views
i.e not .cshtml files
plain html files
.html files
 
ahan functions do exists for that purpose
 
ok
 
i haven't had to use them honestly :)
 
can you please share me some link etc
where i can read about that
 
11:54 AM
17
Q: How to serve html file from another directory as ActionResult

Aran MulhollandI have a specialised case where I wish to serve a straight html file from a Controller Action. I want to serve it from a different folder other than the Views folder. The file is located in Solution\Html\index.htm And I want to serve it from a standard controller action. Could i use return Fi...

return File() to the rescue
 
Hmm. I wonder what will happen if I try to use Autofac to resolve a dependency to a service from a method in the base class of that service.
I really need to clean up our older service classes. :(
 
 
1 hour later…
1:08 PM
Refactoring over. Classes cleaned up. ~150 lines of code erased, and about 50 more moved to a new class and shared. Feeling good.
 
 
1 hour later…
2:13 PM
Well rip me - just hit the request limit per second on a remote server I can't reset and now I'm blocked for 24 hours lol.
 
Serves you right for... umm... requesting?
Sometimes when I'm in research mode and I'm shooting off google searches, usually several variations on a theme, I'll hit google's request limit and get blocked or throttled.
Manual searches! Not automated or by code.
 
Lol whats their request limit?
 
Think if you do more then 10 searches in 30seconds
 
@juanvan Possibly. I think I got 10 searches in less than 10 seconds. :)
 
ya that is Fast - lol
 
2:24 PM
And it does serve me right - I was running 25x15 async requests for json endpoints lol. Wanted to see if they would let me do it. Answer is a resounding no.
I can get it unlocked tomorrow morning from work tho
But still
 
that does suck you can't get to the control panel and unlock it
 
Well the server isn't from work, it's from a client. The process was taking to long on 5 tasks so i turned up the dial a bit too far. I'll call their IT dept tomorrow and get it sorted lol
 
2:46 PM
Hi @Gabe
Spamming services is usually a bad idea.
 
3:34 PM
Hi o/
 
4:09 PM
\o/ Heeeelp
 
4:41 PM
is anyone using Telerik MVC Multiselect?
 
 
1 hour later…
6:05 PM
@JohanLarsson: Did you get to the bottom of the equals(struct, struct) issue?
 
no, did not even search, just accepted it as a quirk
 
@JohanLarsson stackoverflow.com/a/5927853/1307748 this may shed some light.
 
what does " circular reference was detected while serializing an object of type" mean?
 
that you have:
class Parent
{
    public Child Child { get; set; }
}

class Child
{
    public Parent Parent { get; set; }
}
@scheien thanks
 
6:10 PM
I can't show multiple selected values from database in Multiselect. When I try with FirstOrDefault it works but with one value.
I've got this inside my ViewModel:
public List<string> CaseTypes { get; set; }
I even tried:
public List<CaseType> CaseTypes { get; set; }
 
@scheien Hans should become a chat reg imo
 
I get the same result.
 
@JohanLarsson hehe yep. Along with a few others.
 
@scheien one upvote is not enough for that level.
Should be a vote --force option that one could use once per year, that gives ten upvotes :)
 
You should suggest that on meta
hehe
Some of the answers, the more complicated ones, deserve a lot more credit.
 
6:18 PM
When I do:

@foreach (var item in Model.CaseTypes)
    {
     @item.CaseTypeDD.Code
    }
I get both values but I can't make it work in Telerik Multiselect
 
6:55 PM
@CodeMaster been doing that all day, and Finally am getting somewhere on this restore (I HOPE)
 
@juanvan :D
I've been doing this since yesterday...
How are you doing?
 
so dumb - SBS 2008 does nto have the drivers for a Dell perc h200 sas-raid controller by default had to use some dumb command line tool to unpack them, then burn them to a disk
and the old admin did no Documentation on this or the drivers in the software library
 
@juanvan oh man, I sometimes hear this from our IT manager.
 
Other then that - waiting on the baby to come - got 3 weeks left
 
Ohh, really?
 
6:57 PM
ya it hard in full stack IT world - code/hardware/networking hehe
 
@juanvan You had one just few months ago, right?
 
no no - found out it was a boy a few months ago
one more trouble maker in the world ;-)
 
that's right, because I remember I sent you a message.
 
if he is anything like me - hope he gets his moms' temperament
 
@juanvan at least for the baby you don't need to ask any question on SO :D
I sometimes think, most of the new born babies already know how to code/program :D
 
7:01 PM
ha well he will learn from a young age - only a few yrs younger then when I started working on computers
was 9-10 when I did my first computer build
 
at that age even before that I was playing piano and at the age of 8 I wrote my first song :D
but I ended up here :D
 
and we made it here - somethings come easier then others - if turning a wrench would make 6 figures I would do that rather be in a garage working and welding
 
you're correct.
can I ask you something, I don't know if you have time to answer.
I'm just getting crazy about this thing. I'm using Telerik MVC Multiselect.
 
have never used Telerik
have a Full pro version I won at a conference and never installed it
 
I know, but yesterday somebody told me my issue is not Telerik is more my ViewModel and Controller.
 
7:07 PM
is the model being passed up to correctly?
 
When I do this:
var getcasetype = await db.CaseType.FirstOrDefaultAsync(x => x.CaseId == cid);
I get one value which is normal and correct, and Multiselect shows it correctly.
But I need to select multiple values since the user will have multiple Case Types. this is where I can't make it work.
I tried this:
var getcasetypelist = db.CaseType.Where(p => p.CaseId == cid).ToList();
 
telerik.com/aspnet-mvc/multiselect what version are you using
 
Latest version, it's from 2 days ago.
I assume when I use ToList, I should use this:
public IEnumerable<CaseType> CaseTypes { get; set; }
the weird part is when I try:
@foreach (var item in Model.CaseTypes)
{
@item.Text
}
I get both values correctly.
When I do:

@(Html.Kendo().MultiSelectFor(m => m.CaseTypes)
.Placeholder("Select Type")
.DataTextField("Definition")
.DataValueField("Id")
.AutoClose(false)
.BindTo((System.Collections.IEnumerable)ViewData["casetype"])
)
Nothing happens
I even got this message:
circular reference was detected while serializing an object of type
 
does caseType have more then 1 property?
 
you mean property in terms of value per user?
or relationship?
 
7:14 PM
in property values
item.Text item.Name
.DataValueField("Id") should that be Name? I don't know kendo much
 
In my case:
ValueField is : Id
Text: Definition
I even tried to remove these two lines and yet I get that error
I bind it this way:
public void PopulateCaseType()
{
var casetype = db.CaseTypeDD
.Where(c => c.Deleted == false)
.OrderBy(c => c.OrderIndex)
.Select(c => new CaseTypeDDViewModel
{
Id = c.Id,
Definition = c.Definition
})
.ToList();

ViewData["casetype"] = casetype;
}
But this for the dropdown to show items, they have nothing to do with the selected items.
I'm starting to suspect that, since the outcome is string without any "," comma, that might be the problem?
I read somewhere, that it was saying I should use:
public List<string> ....
 
List is a higher level object then IEnum
List : IEnum
 
ok, right now I have this:
public List<CaseType> CaseTypes { get; set; }
@(Html.Kendo().MultiSelectFor(m => m.CaseTypes)
.Placeholder("Select Type")
.DataTextField("Definition")
.DataValueField("Id")
.AutoClose(false)
.BindTo((System.Collections.IEnumerable)ViewData["casetype"])
)
I get this:
A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies.Case_04F16DEC357A5E45FC064D61E4E1278B85F3780F74C3D22787476A73A29BCFF3'.
but @foreach is showing correctly:
@foreach (var item in Model.CaseTypes)
{
@item.CaseTypeDD.Code
}
I don't even understand what that error means
maybe the outcome should be something like this:
[3], [4] and etc.
Instead of:
34
 
well means that somewhere a property is referencing a property it was called from
 
Inside Controller? or ViewModel?
 
7:23 PM
102
Q: A circular reference was detected while serializing an object of type 'SubSonic.Schema .DatabaseColumn'.

JonI am trying to do a simple JSON return but I am having issues I have the following below. public JsonResult GetEventData() { var data = Event.Find(x => x.ID != 0); return Json(data); } I get a HTTP 500 with the exception as shown in the title of this question. I also tried var data = ...

where does the debugger error on that line?
 
@(Html.Kendo().MultiSelectFor(m => m.CaseTypes)
It throws here
 
brb see what you find out - maybe try to load a list with the values you think it should be retrieving and load it - then load it from the DB
 
@juanvan I'm trying now.
Thanks for your time.
@juanvan I've tried many ways, what's the correct way to do this?
I did this:

var model = from o in new PSPD_PS_UGA().CaseType
.Where(m => m.CaseId == cid)
select new CaseTypeViewModel
{
code = o.CaseTypeDD.Id,
def = o.CaseTypeDD.Definition
};
return PartialView(new CaseTypeViewModel()
{
CaseId = cid.ToString(),
CaseTypes = "I can't just write model"

});
@juanvan it's working now:
I did this:
var getcasetypelist = db.CaseType.Where(p => p.CaseId == cid).Select(m => m.CaseTypeDD.Id).ToList();

ViewModel:
public List<int> CaseTypes { get; set; }
 
 
1 hour later…
8:45 PM
Ugh. Workplace.SE is quite the clusterfuck these days
Just looking down the homepage and ~50% of questions are negative
Same proportion of OPs seem to be pants-on-head retarded
 
9:33 PM
what do you think i should call this table? it will hold like 7 or so columns, and they are describing either a professional license or certification
really dont want to name it LicenseOrCertification
or LicCerts even
(and btw, they arent separate entities - they just are considering these two things the same and collecting the same fields)
 

« first day (1961 days earlier)      last day (3004 days later) »