« first day (1944 days earlier)      last day (2998 days later) » 

12:05 AM
@Greg You can do 1.0, but not 01, 01 is a string as @Codeman stated
int i =0;
i.ToString().PadLeft(4, '0') - okay, but doesn't cover all cases
i.ToString("0000"); - explicit form
i.ToString("D4"); - short form format specifier
193
Q: C# convert int to string with padding zeros?

PinuIn C# I have an integer value which need to be convereted to string but it needs to add zeros before: For Example: int i = 1; When I convert it to string it needs to become 0001 I need to know the syntax in C#.

@Greg You could write an Extension method to do:
i.ZeroPad(2);

but i.ToString("00)" is simple to
 
@RyanTernier I was hoping to avoid, but I just created a MVVM where the Id is a string so I could just simply do .PadLeft(2, '0');
 
haha
 
MVVM rocks!
+ Automapper
 
12:48 AM
I made a chrome extension for SO and published it :) But now it isn't showing up in search =/
Anyway, it is here: chrome.google.com/webstore/detail/stackcite/… It creates a link for citing answers
 
1:23 AM
Oculus user: "I can't afford this.😢" Oculus developer: "Our customers can't afford this.😰" Mark Zuckerberg: "How much does Australia cost.🤔"
 
 
2 hours later…
Hello champs
anyone here worked on asp.net web forms?
 
 
2 hours later…
5:56 AM
no
 
what are you doing on here still
never mind, I don't care :P I'm logging back off of my work pc
 
@RyanTernier:i just wanted to ask about file upload in asp.net web forms
 
6:24 AM
They're anoying in web forms :\ you can do it with a simple upload control, but there are better options out there with the javascript frameworks and libraries
 
@RyanTernier:but when user selects any image then i want to show it as a preview too and then when user clicks on save button that image name should be saved in database table name and image file should be saved in my local project folder
 
does any one use this with WEB API??
github.com/danialfarid/…
 
6:52 AM
@TravisJ cool. Some hardcore paint skills there too. :)
@NoughT link is missing.
 
Sorry for the late
:28690542
do you have any idea about this ??
ExceptionMessage: "No MediaTypeFormatter is available to read an object of type 'VMPlaceName' from content with media type 'multipart/form-data'."
ExceptionType: "System.Net.Http.UnsupportedMediaTypeException"
Message: "The request entity's media type 'multipart/form-data' is not supported for this resource."
This is happen when I am trying to upload a image with user data
 
What do you mean with user data?
I guess you get that exception in the controller action / method that handles the upload?
 
I upload a image with the user name
I have a form that have enter the user name and image select button

After user submit with his user name and image this error get in the chrome console
 
Can you show the method that handles the file upload?
 
Even my controller is not hit by the brack point
        [HttpPost]
        [Route("api/add-place-image-by-admin")]
        public async Task<IHttpActionResult> AddImageByUserPlace(VMPlaceName img)
        {
            if (!Request.Content.IsMimeMultipartContent("form-data"))
            {
                return BadRequest("Unsupported media type");
            }
            try
            {
                var provider = new CustomMultipartFormDataStreamProvider(workingFolder);

                await Request.Content.ReadAsMultipartAsync(provider);
 
7:05 AM
Hmm... How can it be that Internet Explorer ignores some cookies but not all? A customer has this issue
 
Could be rules set by the sysadmin?
through GPO?
 
And morning btw ;)
 
good morning :)
@NoughT: It doesnt understand what VMPlaceName is.
The parameter in your method.
 
    public class VMPlaceName{

        public string Name { get; set; }
    }
I am using angular image upload
 
yeah, I saw that from the link you posted.
 
7:08 AM
here is the link for it
https://github.com/danialfarid/ng-file-upload
I think this is course by the web api
 
@NoughT: You should do some reading, there's a lot of info on that specific exception. google.no/…
 
@scheien thank you bro
 
You're welcome.
@JakobMillah Does the same issue occur if the customer use Chrome/FF?
 
Nope, only IE @scheien. And only for 1 particular cookie, not all of them
She tried Firefox which worked
 
can anybody help me with this question
0
Q: Better or optimized way to filter customer records by 3 dropdown filters

LearningI have one page name as:CustomerList.aspx on which i am displaying list of customers. This is my table and class files too: public partial class Customer { public int CustomerID { get; set; } public string FullName { get; set; } public string EmailId { get; set; } ...

 
7:20 AM
@JakobMillah Check the security tab under internet options.
 
To set the security to medium?
Not like I have to help her with it. I just got curious P:
 
Thank you.
I done that with your help.
Thank you very much
 
#DagensGärning
 
lol ja
 
morning guys
 
7:35 AM
murgen!
 
Should it be DynamicResource or StaticResource? Style={DynamicResource {x:static systemcolors.controltextbrushkey}}
 
8:03 AM
that looks like a staticresource to me, but I'm no xaml/wpf guru
 
@Jamaxack It should just be {x:Static}, shouldn't it?
You're not accessing a resource, but a static member.
A resource is an object stored in the control's/window's/app's ResourceDictionary. No need to use the *Resource accessors for objects available through other means, such as static members.
However, do remember that typenames are case sensitive, so it really should be {x:Static SystemColors.ControlTextBrushKey}
 
8:23 AM
@AvnerShahar-Kashtan please check msdn.microsoft.com/en-us/library/…
@AvnerShahar-Kashtan I have a tone of style lines, for filtering purposes I'm converting to lower, thats why it is written in lower. Yes, you are correct, this is case sensitivity. Because of performance issues I'm trying to write StaticResource instead of DynamicResource. In this case I'll get rid of *Resources
but why in msdn it is DynamicResource?
 
@Jamaxack To allow it to auto-update if the user changes the value of the property (through Windows Display control panel) while the application is running. It will be re-evaluated whenever the XAML is parsed.
{x:Static} would be evaluated once.
 
@AvnerShahar-Kashtan Yes, I prefer to change the style when it is changed from Windows Display control panel
Then I'll use DynamicResource
 
good (ugt) morning
 
@ntohl Good morning. (ugt)?
 
yeah. universal greeting time
 
8:32 AM
@ntohl make sanse!
Yeah it's true, because it is lunch time here
 
it does. I heard it here first time, now I use it every occasion I join
 
UTC also works
 
@Jamaxack only for half the day, surely?
Buongiorno, ragazzi.
 
@Squiggle why half of day?
 
because yyyy-MM-ddT13:00:00.000Z is most definitely afternoon.
 
8:42 AM
ohh ya
 
Hmm. I have a function that returns an EF object of mine and returns an enum based on its age - less than 1 day old, 1-3 days, 3-7 days or older. So far, very simple. Now, I want it to run on an IQueryable of objects, in the DB, without pulling all results into memory. Any way to do that?
 
That's against the spirit of EF. You're asking to project over a calculated value, right?
 
Right now I just want to filter by a calculated value.
 
same problem
 
Hmm. I should just pre-calculate the start/end times in my code, and query by those, using BETWEEN.
Still ugly.
 
8:44 AM
I'd do the calculation in the Linq query, not in your EF entity.
aye
 
@Squiggle But that means I have to pull all values into memory, rather than bringing in only those that match the filter.
Which defeats the purpose.
 
or you could use a computed column in your database?
 
@Squiggle We're currently using Code First, meaning no smart SQL tricks for me.
 
Actually a computed column might make sense there
 
Hmm. Maybe it is possible.
That would make it all much simpler, yes.
Though it means adding DDL code to our DbContext initializations, which is ugly, but unavoidable.
If we're defining SQL code for table generation, we're not really getting the simpliciy of CodeFirst, are we?
 
8:48 AM
or you could query over a view instead?
 
Same issue - need to create the view through custom SQL code.
 
bleh. It's all rubbish.
I'd stick the logic in your Linq
 
Ugh. I'm already filtering by 6 other properties, which are simple enough. I can materialize the filtered list after them, then filter by the last one. Simplest to implement, more confusing for people reading the code.
 
Well maybe they should be smarter. Serves them right.
 
That way, at least, I won't have to pull all the irrelevant items from the DB. That will probably mean only 100-200 items, rather than the full set which can grow to be many hundreds of thousands over time.
 
8:53 AM
@AvnerShahar-Kashtan,@Squiggle Linq will get items based on where clause and then sets to memory or it will get all items to memory and then will execute where clause?
 
@Jamaxack EF* will translate the LINQ to a SQL statement and execute it at the database, only returning the filtered items.
 
@Jamaxack LINQ to Objects will load all items to memory to perform the filter. Or, at least, will load all items necessary to satisfy the filter (all of them for a Where clause, possibly fewer for a First clause)
LINQ to Entities (the EF provider) will attempt to translate the query to SQL.
However, since I have a query that cannot be translated to SQL, I have to materialize the results and then execute the query as LINQ to Objects.
 
make sanse, thanks
 
*sense
 
*scents
 
9:01 AM
science!
 
makes centipedes
like the doctor in the film...
 
Dr Zhivago?
Dr Strangelove?
 
EF is frustrating. All sorts of little things which would be trivial to do in normal linq/code, but I have to jump through hoops to do in the DB.
 
Any ORM is a compromise.
 
@AvnerShahar-Kashtan It's quite a miracle that it works at all, the way it does. Executing as SQL is a big deal
 
9:08 AM
Events.GroupBy(event => event.GroupId).SelectMany(group => group.Last()). This should bring all Events, with only the latest event in any group, right?
 
You can't be too upset that certain features are too difficult or too convoluted to implement faithfully?
 
Upset? No. Just frustrated.
 
WebAPI 2 - can you have multiple route attributes against the same action?
 
Select. Not SelectMany.
 
[HttpGet]
[Route("blah")]
[Route("blah/{parentId}")]
public IHttpActionResult List(int? parentId) {
   // etc
}
 
9:11 AM
@AvnerShahar-Kashtan after grouping it will return key and value, maybe you should get some think like group.Value.Last?
 
need to extend an existing resource without breaking the API
 
@AvnerShahar-Kashtan or after grouping ToList().Select(group=>group.last())
 
@Squiggle Dr Heiter
 
Dr Oetker
 
@Jamaxack No, an IGrouping extends IEnumerable. The object itself isthe value.
 
9:15 AM
@ntohl thankfully still never seen that film
 
@Squiggle me neither >D eww++
 
Some of our old batch data transfer processes reminded me of the human centipede
 
:D
 
D:
OK that's quite neat - variety.com/2016/digital/news/…
Bluetooth lightbulbs that integrate with a TV show that you're watching
so your entire room dims or changes colour to suit the ambiance of the scene
 
@Squiggle I think Philips have been putting that into TV frames for years.
Though extending it to the whole room is an interesting touch for immersion.
 
9:26 AM
aye
 
I should hook it into the CI build at work.
 
I'm guessing that this is going to be a proprietary technology, rather than having an open API on the bulb.
 
entire office turns red, with a spotlight over the desk of the person who broke the build
yeah
IoT is frustratingly proprietary
 
happens lol
 
9:28 AM
'appen, codebro
 
couple of years ago, i fixed an db prod bug by accessing prod db from my dev config. forgot to revert changes. added couple new patients with weird names then. people went mad
 
9:44 AM
I love problem solving.. I have to thank the fucked up school system in this country for making me pick this direction!
 
Hello guys
 
Hello boro
 
yo
 
@JakobMillah which country are you in ?
 
@codebrain Sweden
 
9:59 AM
you should see indian education system
 
I have created 1 web method in web service that is Service1.asmx which contains method like below:

[WebMethod]
public void DoTask(Paramters.......)
{
//Here first i will be fethcing lots of records consider 100 or 200 records and
//then saving in my database tables.
}

I will be calling this web service method from my vb application like below:

Dim obj As WebServicesSoapClient = New WebServicesSoapClient()
obj.DoTask(parameters......)

Here call to Dotask method happens successfully but the problem is in my web service method where
any solution please
 
@Learning You created teh client using AddServiceReference, right?
 
give the actual code
 
It should have the option of generating async versions of the web service methods.
 
does c# have anything like javascript's arguments object e.g. arguments[1] for the second parameter?
 
10:01 AM
@barlop Second parameter to what? The method?
 
@AvnerShahar-Kashtan:Yes you are right.my senior told me to create async method
 
yeah
 
!!help
 
No, it doesn't. Not without some trickery. Why do you need it?
 
@codebrain Information on interacting with me can be found at this page
 
10:02 AM
curiosity
 
!!listcommands
 
@codebrain help, afk, ban, convert, define, die, doge, eval, forget, google, hang, imdb, info, jquery, learn, listcommands, listen, live, mdn, meme, moustache, mustache, nudge, refresh, spec, stat, stats, summon, tell, unban, undo, unonebox, unsummon, urban, user, weather, welcome, wiki, xkcd, youtube, zalgo, !, !!, $.baby, (4337654<<1)+1, (y), /somecommand, 2020/07/23, 3, 666, :p, </pissing>, ?, ^, ^5, abesnacking, abhi, abhishekpornfreak, acronym, ah, ahah, algosmarts, aliens, am, angryticks
apocalypse, appreciated, archerneat, artisticpoop, artisticsilo, asd, asdf, asians, awesome, aww,
 
holy fuckin shit
 
wtf just happened ... did caprica just brain fart?
 
@AvnerShahar-Kashtan:Yes i have created client through add servcie reference
 
10:04 AM
xkcd (love that command)
 
nah , i wanted to find a command. nvmd not interested in searching the whole text
 
@Learning What version of Visual Studio? In VS2013, it should auto-generate Task-based async versions of your methods. Click the Advanced button to see hte details.
So it should have DoTaskAsync(), which returns a Task object immediately rather than waiting for it to complete.
 
!!whatsyourcompilerversion
 
@Wardy That didn't make much sense. Use the !!/help command to learn more.
 
haha
 
10:05 AM
You can then store your task as a class member and use myTask.ContinueWith()` to run your code when the task completes, while letting the method which launched the task return.
 
!!jicamajs
 
@codebrain ye heard it's rough and in order to get somewhere you need to study a lot...

But in Sweden, it's pretty much like: If you are really dedicated to become something, it's all up to your grades and how popular that education is in order to get in or not. Not how suited you are for the job. But I guess that's how it is in a lot of countries.
 
@AvnerShahar-Kashtan:Thank you so much for the reply.i am using vs2013
@AvnerShahar-Kashtan:I have search alot regarding this async but i dont know about this
 
@AvnerShahar-Kashtan hmmm come to think of it thats kinda cool but never thought to use tasks that way ... task composition
 
10:07 AM
@AvnerShahar-Kashtan:if i send you the code it is just of 4 to 6 lines could you please me please to convert it to of what you are saying
 
GetTask() { var task = Foo().ContinueWith(...) return task ; }
 
@Learning No. That's not learning.
 
@JakobMillah yeah it is. but Indian systems are rot. to get a kid into KGs you gotta pay about $5k donation
 
wait that may not return a Task ... might return Task<Task> lol
spose you could Unwrap it
 
@codebrain bribing?
 
10:08 AM
kinda yes
 
@JakobMillah surely that's not true
your success doesn't hang off how well setup the area is?
 
the whole system is rot if you gotta find decent school you need to shed shit load of money. the school provides everything. they just need cash.
 
It's not uncommon to pay tuition.
 
thats what i was thinking ... like whats wrong with that?
 
@AvnerShahar-Kashtan:Actually requirement is like this that in my vb application i will be fetching 400-500 records and so for each record i will be calling my web servcie method to save this each record
 
10:11 AM
Free education in sweden, but only a handful schools that are good enough tbh
 
@Wardy::Actually requirement is like this that in my vb application i will be fetching 400-500 records and so for each record i will be calling my web servcie method to save this each record
so how i would handle this
 
@Learning you lost me ... I think you just crossed me over in to a different conversation ... uh ... what ya stuck with?
@Learning this is the sort of thing I would use OData for ... that way I could use expand and get the 400 - 500 child rows as part of my main request for the parent rows
1 service call (unless i misunderstand what you're saying)
 
@Wardy:My senior told me that create dotask method async
so that timeout error in vb application doesnt comes
 
ok ... async Task DoTask() { ... }
so you're calling a web service 400 - 500 times in that task ?
or 400 - 500 times per parent row?
 
@Wardy:See i have 400-500 records save in my database table which i will ftech in vb applcation
 
10:18 AM
ok can't you do that in 1 service call ?
 
and for each records i will make a call to web service which will save this each records in another database table
 
var data = Service.GetAll();
hmm ah ok
use HttpClient
System.Net.HttpClient I believe ... wait what kind of service is it ?
 
@Wardy:I cant change code at vb side
Dim obj As WebServicesSoapClient = New WebServicesSoapClient()
obj.DoTask(parameters......)
 
ok now i'm really confused
 
This is my vb service
 
10:20 AM
are you trying to import data from a remote service ?
 
you want to see my web service
yes exatckly
 
@JakobMillah yeah, it's the same in Norway, but outside scandinavia I guess it's not that uncommon.
 
ok so service 1 has some data and you are in service 2 writing code to request data from service 1
is that it ?
 
yes exaclty write
 
both WCF and SOAP messaging ?
 
10:22 AM
.asmx and soap
 
and the problem is that service 1 is timing out requests or is it that whatever calls service 2 is timing out ?
 
service which is in vb is getting timeout
so do i need to create async method in vb or in .asmx?
 
ok so thats the call to your service thats timing out (service 2 in the example above)
 
first i am confused in that
 
client > service 2 > service 1
 
10:23 AM
yes right
 
and you are updating the code in service 2 right ?
 
that is what i am not getting
that whther i need to update code in servcie 2 or in service 1
 
so when client calls service 2 the service should return a task
that means it hasn't done anything yet but at some point in the future all those queries to service 1 will happen
 
service 1 would be calling service 2 for the number of records
 
@JakobMillah Free education in sweden?
 
10:24 AM
@Jamaxack Yes
 
like if i have 100 records then service 1 will call 100 times service 2
 
ok so
 
Free education apart from literature and you get 160 euro a month for studying
 
so which service 1 or service 2 to cretae async method
i am not getting that
 
client > service1.importdata() > service2.importRow(1)
                               > service2.importrow(2)
 
10:26 AM
yes right
 
like that
 
yes
 
so service1,importdata() needs to return a task
 
This customer shop I am working with now.... The developers decided that loading all products and all campaigns, which are either not even on the first page loaded, would be a good idea. So the login time is directly affected by how many products the page has... gah
 
that means clients call never times out
as it returns instantly
 
10:27 AM
@JakobMillah link plese?
 
guys please save me
 
@Learning make sense?
@ArthurMFB from what ?
 
My Visual studio just went crazy
 
Can't save ya from your self
 
@Jamaxack to the site? You can't access it. Requires login :)
 
10:28 AM
@ArthurMFB it does that ... do a rain dance
 
@Wardy:actually i am just confuse between the two
 
@Learning whats confusing?
 
@JakobMillah university site maybe
 
Like which method to create async
 
I'm almost finishing my project. Aciddentaly I made the size of a table grow a lot. When i pressed Ctrl + Z, it wen back to normal. But now my itens are gone.
 
10:29 AM
@Learning the method that the client calls
that method needs to made async
 
I mean, they are all out of the window, like, outsite it. I cant see then
 
@ArthurMFB like what, your WPF designer?
 
Imagine something like maximizing a window. And then the itens of this window remaining in the maximed position.
 
what is the type of window?
 
10:31 AM
what do you mean? Windows forms?
May i post a screenshot link here? So you guys get it?
 
ya it imgur.com
 
@Wardy:Can you tell me why that need to made async
?
 
@Learning when a method is not async the client has to sit and wait for it to do its job
 
here it is. imgur.com/NRph804
See if you guys get what I meant.
 
with async methods the method returns immediately but it returns a task
 
10:36 AM
The code is compiling, so they are still somewhere.
 
the task is like saying "here's a reference to stuff i'm going to do in the future"
by making the client call method on service 1 async the client can make the call and then forget about it
the server at that point will have not done anything
but the client can go off and do other things
if the method was not async the client would have to sit and wait for those 500 calls service 1 has to make on service 2
lets assume you have a timeout on a single request of up to 1 minute after 1 minute the client will fail if service 1's method is not async because of all the waiting for service 2 to come back
if service 1 returns a task there is no wait ... service 1 can then just worry about getting the job done when the client is gone
 
@Wardy:Thank you so much sir for your explainatin
 
Guys, I got desesperate so I didn't think well. I will change all the positions of the itens manually.
It's probably not the easiest way, but it will work. And btw, thanks for the attention.
 
need to add a scroll to the window
 
it didn't have a scroll before
But i see your point. Ty buddy
 
10:46 AM
Hi Guys
 
@Ggalla1779 sup
 
hi
 
Doing a lot of refactorings, moving classes around, separating into different folders, etc. Resharper has saved me hours so far. Just now noticed that I can apply a refactoring (like "Change namespace to match folder") to every class in the folder with one command. Awesome.
 
@AvnerShahar-Kashtan yeh ... resharper is great for that 1 off situation, day to day however it destroys VS performance ... when done with this task remove it so you can use VS (i would at least)
but there's no denying its great at this kind of thing
 
So, I bought a cheap tablet. It comes with Windows 10, and has a 16GB SSD. It has ~3GB free after Windows installation, which is fine. Then I try to update to the latest build, and it needs another 5GB free. I don't have that. What am I supposed to do now? >_<'
 

« first day (1944 days earlier)      last day (2998 days later) »