|
Scaramouche posted:Any of you guys ever had to programmatically connect to Google drive and grab the content for use/insertion into a database? I've never done Google but, I've done Excel from Office 365 using basic Office libraries and one step even better... I programmatically pull data from an Access Web App that has a UI front end for data entry. It's basically as simple as a SQL connection to a free azure hosted database.
|
# ? Feb 23, 2015 23:21 |
|
|
# ? May 18, 2024 05:22 |
|
Ithaqua posted:VS2015 CTP 6 came out earlier today, along with the first CTP of TFS 2015, with all the awesome new build stuff. This makes me wonder why the hell they removed it in the first place.
|
# ? Feb 24, 2015 00:26 |
|
Scaramouche posted:Any of you guys ever had to programmatically connect to Google drive and grab the content for use/insertion into a database? We've got a marketplace that we're doing good sales on, but they have zero automation for sales reporting, order importing, etc. So the way our staff keep track of them is to update a Google Spreadsheet Doc. The idea being I'd connect to Drive, open this sheet, and grab new rows and put them in the database. The .NET libraries are loving awful because they're just maintained by one guy who constanlty keeps changing how the auth and stuff works so it ends up being easier to just mess with the REST stuff yourself. That's how I remember working with the Google Apps stuff.
|
# ? Feb 24, 2015 01:09 |
|
Ithaqua posted:VS2015 CTP 6 came out earlier today, along with the first CTP of TFS 2015, with all the awesome new build stuff. Xamarin is also an install option in the custom install now too. Making it just that little bit easier to go on and give it a try.
|
# ? Feb 24, 2015 01:29 |
|
RICHUNCLEPENNYBAGS posted:The .NET libraries are loving awful because they're just maintained by one guy who constanlty keeps changing how the auth and stuff works so it ends up being easier to just mess with the REST stuff yourself. That's how I remember working with the Google Apps stuff. I think I get what you mean; I did a similar thing with translate however instead of including a bunch of references and creating a bunch of classes I ended up curl'ing the URL I wanted and pushing it in, and then grabbing what I needed out of the resulting JSON. So it sounds like you're saying that's the case here too?
|
# ? Feb 24, 2015 01:37 |
|
Scaramouche posted:I think I get what you mean; I did a similar thing with translate however instead of including a bunch of references and creating a bunch of classes I ended up curl'ing the URL I wanted and pushing it in, and then grabbing what I needed out of the resulting JSON. So it sounds like you're saying that's the case here too? That's probably better unless the .NET libs have gotten much better in the past couple years.
|
# ? Feb 24, 2015 02:55 |
|
Inverness posted:It seems they re-added the object ID feature in the debugger. It was never removed. What we've done is regularize it and tell people about it! http://blogs.msdn.com/b/csharpfaq/archive/2015/02/23/edit-and-continue-and-make-object-id-improvements-in-ctp-6.aspx
|
# ? Feb 24, 2015 05:11 |
|
Ithaqua posted:VS2015 CTP 6 came out earlier today, along with the first CTP of TFS 2015, with all the awesome new build stuff. Forget TFS and awesome new build stuff. The real goods are //todo support in javascript.
|
# ? Feb 24, 2015 12:56 |
|
Does anyone have any recommendations on a report generating tool with a snazzy UI? I'm looking for something where you can define fields(like "products delivered over a given date range") for users, and they can click and drag those defined fields to generate spreadsheets, graphs, etc.
|
# ? Feb 24, 2015 16:57 |
|
Given the following C# code:
code:
|
# ? Feb 24, 2015 22:04 |
|
C# code:
EDIT: I should probably ask, what are you trying to do? This may not be the best way of going about things. Bognar fucked around with this message at 22:49 on Feb 24, 2015 |
# ? Feb 24, 2015 22:45 |
|
I have a reference application in C++ that uses a DLL for a USB device. It needs to integrate with a C# app I'm already building. I wanted to just import the DLL into C#, but I'm hitting errors I haven't seen before and hit my limits on google/SO. When I try to grab the DLLthrough Reference Manager, the error pops up as "A reference to "dll_name.dll" could not be added. Please make sure the file is accessible, and that it is a valid assembly or COM component." This led me to a SO answer suggesting TlbImp.exe, which gives me quote:Microsoft (R) .NET Framework Type Library to Assembly Converter 3.5.30729.1 This builds clean with C++ importing the same DLL, so I'm not suspecting anything about my local configuration missing files. The C++ version is using a .h file with everything matching this pattern: code:
|
# ? Feb 24, 2015 23:43 |
|
Bognar posted:EDIT: I should probably ask, what are you trying to do? This may not be the best way of going about things.
|
# ? Feb 25, 2015 00:08 |
|
How many methods are you calling on the DLL? The way I normally go about dealing with unmanaged code and things like this is to just use P/Invoke, which could be useful if you're not using that many methods. Here's a sample from my Cairo wrapper:C# code:
|
# ? Feb 25, 2015 00:10 |
|
JawnV6 posted:I have a reference application in C++ that uses a DLL for a USB device. It needs to integrate with a C# app I'm already building. I wanted to just import the DLL into C#, but I'm hitting errors I haven't seen before and hit my limits on google/SO. Those "References" are for other managed assemblies, not native code. Just P/Invoke into the .dll as Bognar said. (Make sure your import declarations use CallingConvention.StdCall instead of CallingConvention.Cdecl, though.)
|
# ? Feb 25, 2015 00:22 |
|
Bognar posted:How many methods are you calling on the DLL? The way I normally go about dealing with unmanaged code and things like this is to just use P/Invoke, which could be useful if you're not using that many methods. Here's a sample from my Cairo wrapper: Less than 20. All string based, there's a bunch of magic numbers that get shuffled around as ASCII strings. I'll give this a shot, thanks!
|
# ? Feb 25, 2015 00:23 |
|
JawnV6 posted:Less than 20. All string based, there's a bunch of magic numbers that get shuffled around as ASCII strings. I'll give this a shot, thanks! https://msdn.microsoft.com/en-us/magazine/cc164123.aspx This is a pretty good reference for P/Invoke. You may be interested in the sections titled "Marshaling Text" and "CharSet".
|
# ? Feb 25, 2015 00:30 |
|
Bognar posted:https://msdn.microsoft.com/en-us/magazine/cc164123.aspx Thanks, this has made me marginally more dangerous. I got over the StackImbalance errors and I'm seeing the same results for integer return type as the C++ program. Now I'm trying to get strings back out of this board and I'm having AccessViolations, time to read this Marshaling Text section in depth! Cheers! e: whatever a StringBuilder is it's working JawnV6 fucked around with this message at 02:21 on Feb 25, 2015 |
# ? Feb 25, 2015 02:09 |
GrumpyDoctor posted:This is really hard to diagnose without code. Yeah, sorry. It turns out the object in question is a bit notorious for this behavior. I tried cloning/freezing it, but that led to another set of problems. In the end, I went with the ghetto solution of creating another class which I load with everything I need from the Bitmap-derived object. Using this method, everything works as I expect it to, including accessing things in other threads using Dispatcher.Invoke(). I'm sure I'm the real problem, here, and I feel like my solution is not very elegant, but it works. Thanks to everyone who replied.
|
|
# ? Feb 25, 2015 02:40 |
|
In WinForms, if I've got a ListBox showing a list of entities, and I want to update this listbox with a fresh list I just pulled out of the database, what's the 'best practice' way of doing this? More specifically, I want to maintain the selection. If an item is selected in the list and is still in the list after the update, it should remain selected. It it's removed I guess the selection should jump back to the first in the list, or maybe the previous. Just changing the DataSource property to the new collection will reset the selected item as well. I'm guess I should be using a BindingSource or something like that? chippy fucked around with this message at 14:35 on Feb 25, 2015 |
# ? Feb 25, 2015 14:33 |
|
This might be a dumb question but what's the intended deployment scenario with ASP.NET 5.0 (previously vNext)? The documentation states that it can be self hosted or hosted in IIS. So that leaves me wondering if the intended Mac and Linux deployment scenario is really supposed to be the self hosting approach. I always thought this sort of thing was for development and debugging only (kind of like Flask self-hosting) and that production should go through Apache or NGinx or something.
|
# ? Feb 25, 2015 17:10 |
|
I've got a desktop application that runs through a loop in which each loop iteration creates a directory, uses it for some scratch work, and then deletes it. On some loop iterations the call to Directory.CreateDirectory fails with an UnauthorizedAccessException, but this makes no sense to me, because the directory name doesn't change, and nothing else uses it. (I know that nothing uses it because it's a temp directory.) What could be going on here?
|
# ? Feb 25, 2015 18:52 |
|
GrumpyDoctor posted:I've got a desktop application that runs through a loop in which each loop iteration creates a directory, uses it for some scratch work, and then deletes it. On some loop iterations the call to Directory.CreateDirectory fails with an UnauthorizedAccessException, but this makes no sense to me, because the directory name doesn't change, and nothing else uses it. (I know that nothing uses it because it's a temp directory.) What could be going on here? Can you post some code? Could be a logic error in the code. If it's a transient error you could use something like Polly to retry. EDIT: Anyone here use OzCode? I'm wondering if it's worth the cash
|
# ? Feb 25, 2015 19:04 |
|
GrumpyDoctor posted:I've got a desktop application that runs through a loop in which each loop iteration creates a directory, uses it for some scratch work, and then deletes it. On some loop iterations the call to Directory.CreateDirectory fails with an UnauthorizedAccessException, but this makes no sense to me, because the directory name doesn't change, and nothing else uses it. (I know that nothing uses it because it's a temp directory.) What could be going on here? Are you running a virus scan program? I've noticed that virus scans sometimes sweep new directories, preventing them from being deleted/recreated.
|
# ? Feb 25, 2015 19:28 |
|
gariig posted:Can you post some code? Could be a logic error in the code. If it's a transient error you could use something like Polly to retry. C# code:
Blasphemeral posted:Are you running a virus scan program? I've noticed that virus scans sometimes sweep new directories, preventing them from being deleted/recreated. I do have AV, so I guess this could be the problem. Maybe I should add a little wait beforehand?
|
# ? Feb 25, 2015 19:51 |
|
Try adding some nonce to the directory name (temp_1, temp_2, etc.)? At the very least would help isolate if it's because of the proximity of the delete/create and someone holding onto it.
|
# ? Feb 25, 2015 19:54 |
|
Ochowie posted:This might be a dumb question but what's the intended deployment scenario with ASP.NET 5.0 (previously vNext)? The documentation states that it can be self hosted or hosted in IIS. So that leaves me wondering if the intended Mac and Linux deployment scenario is really supposed to be the self hosting approach. I always thought this sort of thing was for development and debugging only (kind of like Flask self-hosting) and that production should go through Apache or NGinx or something. they're writing a libuv-based http server named Kestrel put it behind nginx and it's no worse than how people host a lot of random stuff
|
# ? Feb 25, 2015 21:23 |
|
JawnV6 posted:Try adding some nonce to the directory name (temp_1, temp_2, etc.)? At the very least would help isolate if it's because of the proximity of the delete/create and someone holding onto it. This didn't help. Neither did sleeping for a full second between directory deletion and creation, so I really have no idea what the gently caress.
|
# ? Feb 25, 2015 21:55 |
|
Ochowie posted:This might be a dumb question but what's the intended deployment scenario with ASP.NET 5.0 (previously vNext)? The documentation states that it can be self hosted or hosted in IIS. So that leaves me wondering if the intended Mac and Linux deployment scenario is really supposed to be the self hosting approach. I always thought this sort of thing was for development and debugging only (kind of like Flask self-hosting) and that production should go through Apache or NGinx or something. Is "self-hosted" a euphemism for "hosted on OWIN"?
|
# ? Feb 25, 2015 21:58 |
|
GrumpyDoctor posted:This didn't help. Neither did sleeping for a full second between directory deletion and creation, so I really have no idea what the gently caress. That still sounds like AV. I've had so much trouble with AV holding onto things. I don't think "a full second" is a very long time in the horrible world of AV file locking.
|
# ? Feb 25, 2015 22:02 |
|
ljw1004 posted:That still sounds like AV. But it wouldn't be holding the same thing? I'm worried that I'm speaking to a leaky abstraction, but Grumpy's saying that this sequence: code:
|
# ? Feb 25, 2015 22:41 |
|
Are you creating new directories for scratch data and then dumping them all within a second? That seems awfully awful.chippy posted:In WinForms, if I've got a ListBox showing a list of entities, and I want to update this listbox with a fresh list I just pulled out of the database, what's the 'best practice' way of doing this? From my horrible WinForms memory: You'll have to store a key or some way to lookup the object in the new datasource, find the index, and reset the selected index if you choose to change the datasource. - This is the fastest for large lists but the change in datasource may cause UI flickering or some other weird behavior if you hold object references. The alternative is to have a single datasource that you add or remove items by comparing your refreshed data with the existing data. Either way you go, if the list is small (say <1000 items), you wont see any performance problems. Although, I recommend keeping a single datasource and updating it yourself manually if it is only ever "read only" list. You can use the datasource methods to perform lookups and object comparisons. For example, with a single datasource, you can grab a reference to the selected object prior to refresh, see if it exists in the datasource when refreshed and if not, just set selected index to 0 (assuming there is always at least one item) and leave well enough alone. Its pretty simple too... [*]Clone your datasource as a new list of "To be deleted" and make an empty "to be added" list [*]Traverse the refresh list, compare items, and remove existing items from the "delete list" while also adding new items to the "to be added" list [*]Remove and add each list as a range from your datasource This has, for me, been the most effective and smooth way to do it and keep the UI responsive.
|
# ? Feb 25, 2015 23:26 |
|
JawnV6 posted:But it wouldn't be holding the same thing? I'm worried that I'm speaking to a leaky abstraction, but Grumpy's saying that this sequence: That's not even the sequence; it's just code:
crashdome posted:Are you creating new directories for scratch data and then dumping them all within a second? That seems awfully awful. No; the way each run works it that it verifies that its scratch directory is empty before beginning by just blowing it away and recreating it. But apparently recreating it causing me problems. It turns out that sleeping for a bit before recreating the scratch directory does actually solve the problem, so I'm willing to chalk this up to some weird filesystem nonsense even if it's not AV.
|
# ? Feb 26, 2015 02:50 |
|
GrumpyDoctor posted:No; the way each run works it that it verifies that its scratch directory is empty before beginning by just blowing it away and recreating it. But apparently recreating it causing me problems. I'd be very hesitant to rely on non-deterministic behavior. How do you know that the sleep call is long enough for any target machine? Or even that it's long enough for your machine all the time? I think the nonce is a much better way of going about it.
|
# ? Feb 26, 2015 03:10 |
|
RangerAce posted:Is "self-hosted" a euphemism for "hosted on OWIN"? I guess. They didn't call OWIN out by name but I guess that's what it would be. Gul Banana posted:they're writing a libuv-based http server named Kestrel Interesting. I'll dig around for that.
|
# ? Feb 26, 2015 03:25 |
|
GrumpyDoctor posted:That's not even the sequence; it's just
|
# ? Feb 26, 2015 03:26 |
|
Bognar posted:I'd be very hesitant to rely on non-deterministic behavior. How do you know that the sleep call is long enough for any target machine? Or even that it's long enough for your machine all the time? I think the nonce is a much better way of going about it. The target machine is my desktop, and it only needs to run once so I can get the outputs. C# happens to be the best "scripting language" for the job for unimportant reasons.
|
# ? Feb 26, 2015 03:38 |
|
Process Monitor should be able to show you what exactly keeps the directory locked. Maybe.
|
# ? Feb 26, 2015 08:41 |
|
crashdome posted:
Thanks for this. When I used the List as the datasource for the ListBox directly, it didn't seem to update the display of the listbox as I added and removed items. I ended up creating a BindingSource with the list as its datasource, and then using that as the datasource for the listbox. Once I did it that way, it kept up with any items added or removed, and also took care of maintaining the selection automatically.
|
# ? Feb 26, 2015 09:45 |
|
|
# ? May 18, 2024 05:22 |
|
Hi Guys, I have an web api controller that updates a transaction record. If the transaction type is changed I want to update all other transactions of the same type (based on the transaction description). How do i pass back the list of "other transaction updated in the back ground" in the HttpResponseMessage ? Im probably going about this completely wrong. I just started playing around with WebApi. My controller was created using the ApiControllerWithContextScaffolder. 2 code:
|
# ? Feb 26, 2015 15:44 |