« first day (2502 days earlier)      last day (2672 days later) » 
04:00 - 13:0013:00 - 23:00

13:21
@AvnerShahar-Kashtan I thought .Invoke tells the UI thread to invoke that method?
How to manipulate the UI thread as a reaction to a background event then, if I'm not using wpf+binding?
say, I want to update a progressbar
If I have an object that represents a chunk of SQL, is it bad design to override ToString to handle the translation into SQL? Or should I have an explicit ToSql method?
"object that represents a chunk of SQL" I'm not sure what you mean by that.
@MorganThrapp Better make an explicit ToSqlCmd method, unless your object is called "SqlCmd" or something
In this case, it's a field. So, the object has a field name, table that contains the field, possibly a function that should be called on the field, etc.
It's basically just a struct, there's currently no logic in the class itself.
private async Task<object> GetCache(string cacheKey, Type type)
{
    object cacheData = HttpContext.Current.Cache[cacheKey];
    if (cacheData == null)
    {
        switch (type.Name)
        {
            case ("Article"):
                cacheData = await _uow.Articles.AllIncluding(x => x.ArticleBody, x => x.ArticleHeadline).ToListAsync();
                break;
            case ("News"):
                cacheData = await _uow.News.All.ToListAsync();
                break;
                // ..
is there a danger, when keeping Articles in cache, that object references can break?
13:24
But I'm starting to need it in multiple places, so I'd like to move the translation from object to SQL onto the class itself, instead of having the user have to translate the field object themselves.
for example ArticleBody and ArticleHeadline
which are different objects
I got that error, when I didn't use Include
after, when I had it loaded to cache already
@Metallkiller It tells the UI thread to invoke the method, and waits for it to complete.
Meaning that your background thread is now waiting on the UI thread, which defeats the purpose.
oh boys. is it any html editor with spellcheck feature. i only found solutions with webbrowser and js inside...
winforms
@AvnerShahar-Kashtan That sucks. Can I somehow tell the UI thread to do something and then carry on with my other totally important background stuff?
@Metallkiller You can, using BeginInvoke.
13:33
Do I have to EndInvoke too? Because why and when should I do that?
But again, if your background thread has to call code on the UI thread, something might be wrong. Your main thread should start background workers, and those should raise events when they continue, but the background processes themselves shouldn't tie back into the UI.
Background processes are for calculations, fetching data, etc. When they complete, they should notify their caller, and the caller should update the UI.
They shouldn't update the UI themselves. That just leads to messy spaghetti code. Your UI should only be updated by the view/viewmodel.
So I have a program reading and processing some stuff for like 10 minutes. My mainthread starts that process in a background thread, on pressing a button.
How would I, iwthout binding params, get log messages to my UI? Should my main thread register an eventhandler before starting the background thread?
It should listen to events from the worker.
The worker should not care the listener happens to be a UI.
.NET 2.0 brought us the BackgroundWorker class, which wraps a background thread with some management helpers.
I hate linked servers -_-
13:39
Which doesn't help me understand @AvnerShahar-Kashtan...
Inside the BackgroundWorker, raise an event with your log message. Your UI/viewmodel/controller/whatever should register to the ProgressReport event.
@AvnerShahar-Kashtan I know about the bgw, used it actually. Still would like to know how to properly react to some event in the background, with my UI thread.
In WPF, you'll just use regular databinding, which is already Invoke-aware.
so if my view, in the constructor, registers an eventhandler, that the background thread will raise...wont my background thread execute that eventhandler?
In WinForms, you'll probably need to use Invoke there.
Remember that an instance isn't tied to a thread.
13:42
@AvnerShahar-Kashtan I know and prefer wpf+databinding, but I wanna understand the alternative.
@Metallkiller Yes, it will.
The not being tied to each other is the exact problem I don't get around. Need to switch threads somehow.
*without databinding or polling
And that's where it is appropriate to use Invoke.
You're in your View class. This is the exact component that should do it. That's what it's there for,
So if i wanted to build databinding myself...the notifypropertychanged eventhandler would prettymuch .BeginInvoke a UI change?
Something like that, yes.
Probably by wrapping BeginInvoke/EndInvoke with an awaitable Task.
13:45
right: When do I call EndInvoke? When my background thread thinks "the ui thread might be done now"?
And why do i have to do that anyway
I realize, that's a questions I should answer by reading msdn
Use TaskFactory.FromAsync to avoid icky begin/end.
You'll have to read up on the whole APM pattern (called the BeginX/EndX or IAsyncResult pattern).
You call EndX when the caller needs the results of the async operation. BeginX starts the process, and you call EndX when you need it to finish, kind of like Task.Result.
If the async process has finished, EndX returns immediately. If not, it blocks until it does.
Or, you can just wrap it up with TaskFactory.FromAsync, which gives you a Task, and you can do your usual Task stuff on it - await, wait for Result, etc.
So if I don't care about results, and just want my progressbar updated, I'll fire and forget BeginInvoke?
Nice
I think I get it pretty well now, thanks @AvnerShahar-Kashtan :)
You're welcome.
Tomorrow, we'll discuss .NET 2.0's EAP asynchronous programming model and its advantages and disadvantages over APM. I'll give out homework soon.
13:53
yay :D
♪Fun fancy lessons with AvnerShahar-Kashtan♫
You better be there, @Nerdintraining!
But now, it's home time.
Have a nice evening @AvnerShahar-Kashtan, and don't forget to drink!
13:56
Have a nice day off work.
Alcohol, that is
@Metallkiller not all of us live in bavaria.
probably none of us are :P
14:41
Does columns order in db matter in EF db first, I'm updating a table to match the entity?
I'm off, cya tomorrow!
anyone here has experience with antlr?
I am a total idiot and cannot find out (on google) what the difference is in my antlr code
@Wietlol Have you tried yahoo?
15:11
For whatever reason I cannot get a query to pull data from an access database to save my life. It works if I use SQL Server Import/Export wizard, but I cannot replicate it in a query
i tried these 3 situations
first I assumed the above
simply splitting stuff in separate expressions
@Wietlol i have no experience with antlr
aw
you know one of those suggestions some IDEs give "String literal in code, should be a constant variable." (except that a constant is not a variable)?
in antlr it then throws an error "You are not allowed to make constants nub!"
Is that the verbatim error?
you have to make super long expressions
15:14
Because that's hilarious
not really
oh lmfao
the actual text is in the pastebin in the comments
or i am a total idiot and dont know how antlr works
which i dont really find weird considering today was my first try :D
Jason Punyon on August 22, 2017

In a previous post, we used the Stack Overflow Trends tool to look at how technology usage in mobile development has changed over time. But we’ve often found that popular languages, platforms and technologies differ across cities and countries as well.

In this post we’ll explore where mobile development happens, and what these countries might have in common. We’ll look at Android and iOS, and pour one out for Windows Phone.

We geocode all of our traffic and know every question’s tags, so we can plot the percentage of traffic from each country that goes to questions with the Android tag. …

Not surprising it's hard to nail down where, it keeps moving.
15:16
What's the end goal?
Well it's what you're hoping to achieve but that's not important right now.
I knew africa and asia were ahead of technology compared to europeans and americans
Carmen Sandiego elusiveness
@Kramb was that question for me?
Yes
15:18
@Feeds actually a good articvle
end goal is learning ANTLR :D
haha I mean, what are you trying to accomplish at this point in time
current language i want to make is a simple calculation language
current assignment is defining the language in antlr
@Kramb language example:
var a = 12345;
var b = 54321;
var c = (a + b + 5) * 120;
return c;
language definition if you are interested
15:47
Stupid question...If I copy an access database, is the data still live?
ie: connected to the db I copied it from?
user7480455
16:01
Greetings all
user7480455
Hi Kramb yes...
Anyone here knowledgeable with DMARC?
user7480455
if you are using linked tables... the database will just relink to the server
It's not the linked table I need, it's the parent database
user7480455
just remember if you are using odbc you will need to make that odbc link on the other machine that you copy it to
16:03
I cannot configure my environment to allow my server into the folders where the original db resides
user7480455
if you copy all the data goes with it
But will it stay updated? If someone changes something in the original db, will it stay up-to-date in my copied version?
user7480455
just remember if you go to relink to it you will need to refresh the table links
user7480455
no
damn
haha
user7480455
16:04
unless they have linked to it
This whole thing has been an absolute nightmare
user7480455
I can image
user7480455
but is your mind stuck on access sucks
user7480455
it's just a database
user7480455
if you where to ,ove all of the data to sql it would work the same
16:06
No, it's stuck on I can't touch anything in access because they don't know I know the password haha
user7480455
lol
user7480455
gotcha
And I'm trying to create a linked table from SQL Server to the Access db so that I can run automatic updates to my sql tables
user7480455
did you lose any eye vision yesterday
user7480455
with the eclipse watching
16:07
haha no, I made a pinhole projector and watched it in my hand
user7480455
you can do that link
user7480455
from sql to access
Yea, but it's not working
lmfao
user7480455
is the table not updating?
I can't even create the linked server
user7480455
16:08
because of not having permission?
user7480455
or something else
I think it's a permissions issue
user7480455
did you create an odbc conn to sql?
no, I was trying to do it with the ole db driver
user7480455
from your application?
16:09
no through sql server
user7480455
ok lets do this in steps
user7480455
lets check something in a diagnostic fashion
user7480455
so That I can map this in my old grizzled brain...
haha okay
user7480455
you have data in an access db correct
16:11
yes
in an mdb
user7480455
or better yer please tell me what you are trying to do and all ofthe players..
user7480455
I have a pencil and a copy book ready to map this out
.mdb > [Table] is buried in folders with different permissions on Server A
SQL Server\Application Server is located on Server B
user7480455
ok
I need my SQL Server to create a linked server to the access table so that I can create a procedure that copies all of the rows from Access into my SQL table
user7480455
16:13
access on a file server and sql db on a sql server
yea
user7480455
got it ... done and dusted!
user7480455
if you have the proper permission this will be easy
user7480455
both sql and access talk well with each other
user7480455
but if you don't have the permission then there is trouble
user7480455
16:14
but lets try this
user7480455
on your computer.... lets link to the sql db
Hi All, I want to discuss about API load balancing. Any one available please?
user7480455
open odbc and make a link to you sql sever
user7480455
using the sql client
is this x86odbc?
or 64
user7480455
16:16
use 32
user7480455
because ou are connecting to an mdb... unless you are using a 64bit version of access
nah, it's 07
user7480455
ok try 64
ok, done
user7480455
ok so when you click test it works right
16:19
yea
user7480455
ok so you have permission to sql that is marked off check list
user7480455
so now open an empty access db
user7480455
a blank db or new db
done
user7480455
i am not sure if access 07 is 64 bit but this will tells us
16:21
i did both just in case
user7480455
click on the external data tab
user7480455
perfect
user7480455
under the import click on odbc database
user7480455
you will get two options
user7480455
use the link data source option
user7480455
16:23
you my have to select machine data source
yup. tables created
user7480455
ok
user7480455
so now you have a bridge database
user7480455
access to sql
user7480455
what you want to do is use a sp to update
user7480455
16:24
a set of access tables from sql right
yea I need all records from an access table
user7480455
ok i see your problem
user7480455
the best way to do this is
Hey, I gotta step to a meeting real quick. I'll holler when I return
user7480455
ok
16:28
Hi all, do you know if C# has something similar to setlocale in C++ ?
CurrentCulture is probably what you want.
I'm guessing at what SetLocale does in C++
Thanks guys, let me have a look at that.
16:47
Any SEO experts here? Or know where on the exchange I can ask about a new domain reg for a business on a site I am doing?
17:00
thank you @mikeTheLiar
17:45
!!afk noms
I DONT WANT TO HEAR IT
What do you hear?
18:31
Hi all, I'm new to ASP.NET, and I've inherited a mature code-base that needs some changes. Needless to say, it's quite a learning curve. One thing I've noticed is that when I build the Solution, it takes like 30-60 seconds most of the time, and that's hurting my iteration time. Is this normal/expected, and if not, can someone give me some pointers on what might be slowing it down?
@KyleHumfeld 1 minute isn't unusual for building a large project
Okay, thanks for the sanity-check! I guess I'll have to get used to a super-slow iteration
If it takes that long because the solution isn't separated into smaller projects, that might be a problem
Ideally you can make changes to one project and not have to rebuild the entire solution
Also, is there an easy way to write to IIS's error log? I've seen references to some commands that look like they'd do it, but none of them actually added anything to the error log file. It would make it much easier to figure out the path the engine is taking (i.e. what code it's actually running).
Ah, that's a good point and it might be a good idea for the future, but right now I'm a super-noob at this stuff, so that's well beyond where I'd feel comfortable going
my single project takes 10 seconds each time to get to the debugger running. Drives me crazy.
18:40
Yeesh
19:11
@BriOnH like a small/simple project?
19:27
Does anyone here have a go-to resource for how to set up IIS-to-SQL Server connections? There's a huge haystack of stuff I've found, but most of it is only marginally useful, assuming it's not 5+ years old.
For example, the ConnectionString in the existing Web.config file has attributes of Data Source and Initial Catalog, but when I try to set up a connection string in IIS, it fills in Server and Database... and then doesn't allow the connection due to the App Pool not having access to the db
(Integrated Security is set to true)
19:59
You need to access the SQL server to see what has authorization
Yeah, if the app pool doesn't have access to the db, that's something that you need to configure on the db, not IIS.
IIS usually uses 'IIS_User' to do it's bidding
20:15
I've set up a Login in SSMS that matches the App Pool's name, and tried to give it the right permissions
@gnivler yup :( simple asp.net core web/db app. Diagnostics and weblink turned off. control-w loads instantly. Use that a lot.
db_datareader, db_datawriter, and public
That's from the Login side, do I need to do anything from the Database side?
C# in a nutshell VS Heads up C#, I am not a developer, but I want to learn C# to use commercial software .NET API, like AutoCAD and others, so depth is not required, I tried microsoft c# guide but I am looking for a better resource. Ty.
The error I'm getting is ` System.Data.SqlClient.SqlException: Cannot open database "dbname" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\app_pool_name'.`
20:25
There's a difference between an instance login and a database user. You need both.
Okay, that sounds promising
So I've got my Login set up, named the same as my app pool
You should be able to map the instance login to a db user. That will automatically create the database user for you.
IIRC it's called "User Mapping" in the login properties
I do see User Mapping, and I've checked some of the checkboxes (db_datareader, db_datawriter) for the specific db I'm trying to read
But in the 'Users mapped to this login' section, the 'User' column is blank for every db
as is the Default Schema
When I look a the database properties -> Permissions, the App Pool login I created is not there (when I create a different login that didn't have a backslash, however, that did appear)
Oh, sorry, I just tried Modifying the User Mapping again, and when I check the box next to my db, it populates the User with the same value as my Login, and the Default Schema is 'dbo'
Interesting, I just checked every box in the lower section of the User Mapping section for my db, and now it seems to have been able to connect but is being denied the ability to run a SELECT query... but I think I know how to fix that at least
... but apparently not
 
2 hours later…
22:24
@BriOnH I was having a a long delay while symbols downloaded every time I started the debugger. it was really visible that it was happening though
04:00 - 13:0013:00 - 23:00

« first day (2502 days earlier)      last day (2672 days later) »