Click here to Skip to main content
15,031,208 members

Comments by Garth J Lancaster (Top 200 by date)

Garth J Lancaster 15-Jun-21 7:46am View
Can you use a circular queue to hold updates, then combine 'n' updates into a larger buffer, then write that ?
Garth J Lancaster 3-Apr-21 20:36pm View
as realJSOP said ... look, you COULD write LINQ/XML, but then you're still stuck with getting the three different types of result from the result of that - which could be just as painful .. if you really need the LINQ having looked at deserialisation, you would be better off with three queries, assuming the shipping order has only one orderperson, shipto & then the multiple items can be a collection on their own
Garth J Lancaster 19-Jan-21 0:58am View
That appears to be a curly one ! I don't have a joystick, so can't test for you, and searching for a useable project you can use a test/starter is seeming hard at the moment - there's this I found that may be of some use. Note the response from Valdemar there, sometimes dealing with hardware it's useful to try a simple console mode program to see if you can 'talk' to the hardware before going on to Winforms stuff

One thing, you say 'comes up with errors' .. we can't see your screen, so, that's not really helpful for us - maybe you could see what the 'highest level' error or 'most important' error appears to be and post that (edit your question)

[edit] this might also help as a 'starter' [/edit]
Garth J Lancaster 9-Jan-21 20:41pm View
yup - as per the official MS doc :-)
Garth J Lancaster 9-Jan-21 19:46pm View
Can you dump/list permissions on the service account at a customer where it does work, then compare against a customer where it doesnt ? (you'd need pretty understanding customer I guess)
Garth J Lancaster 30-Sep-20 1:17am View
Some questions
1) You use "is different then the day before" and "at 11 am on Tuesday the value is 50, if the value is 60 on Wednesday" but don't really clarify the basis for comparison .. are you saying that at 11:00am Wednesday, you wish to check the price 11:00am Tuesday, or, 'end-of-day Tuesday' .. what happens if Tuesday doesn't have a record for 11:00am ?
2) are the time-stamps per day unique - eg for Tuesday there will only be one or none of (time part) 12:34:41 ?
Garth J Lancaster 22-Sep-20 4:16am View
Why don't you write unit tests in Java (I'm sure it possible) .. if you get into that habit then you're setting yourself up well for a professional future ... ideally you would have done it as you added every 'feature'/'function
Garth J Lancaster 6-Sep-20 6:52am View
sorry, without seeing the code all I can do is shrug - I can't set up a test from here either .. maybe someone else will understand from your description
Garth J Lancaster 6-Sep-20 6:36am View
"but it won't work correctly.' not really helpful - why don't you use Improve question and add the SelectionIndexChanged event handler code you have, try to describe as clearly as possible why it doesn't work, and we'll see what we can do/suggest .. don't fret too much about the 'bad English' bit, we are quite tolerant unless the meaning is obscured, then we can always ask you
Garth J Lancaster 5-Sep-20 8:46am View
Please use Improve question and change the tag on this question - it is NOT C#
Garth J Lancaster 5-Sep-20 8:42am View
You might like to use Improve question to indicate where this issue occurs - bold it, use a comment ...

(how are we expected to trawl through a code dump looking for your issue ?)
Garth J Lancaster 31-Aug-20 6:48am View
see if this runs it
Garth J Lancaster 31-Aug-20 3:30am View
ahh, is that so (GJL narrows eyes to slits, drips venom from fangs ... )
Garth J Lancaster 28-Aug-20 8:22am View
+5 :)
Garth J Lancaster 28-Aug-20 7:15am View
I guess you can say 'automatically assigned' - in the sense you rarely/shouldnt have to worry about the details - of course, under the covers, it's a little more complex
1) when the JVM start's up, it requests a 'block' of memory from the operating system (the size of which can be modified/optimised)
2) any requests to 'new' for example are served from this block by the JVM
.... so unless you run out of memory, you usually don;t care too much, it just 'happens'
Garth J Lancaster 28-Aug-20 4:17am View
It might be handy to provide more information on the 'size' of "there are millions of records." - use Improve question

At a quick guess, a lot of time could be wasted writing to the file on disk - I would be looking at
1) making the acquire xml 'data' (I'm not going to use 'file' as a term here) async
2) hold the data in maybe an XMLDocument in-memory

This may mean getting smaller sets of XML ie 'batching' rather than one big blob, if it is at all possible, but that's the principle, reduce the 'file' IO, make it async
Garth J Lancaster 28-Aug-20 0:11am View
pssst - next time please use Improve question to add new/more information, not submit as a solution ..

I'm not sure your usage of the 'extend' word is correct though .. you're not extending anything
Garth J Lancaster 27-Aug-20 23:39pm View
I'm sure you meant "Este é um fórum em inglês. Por favor, escreva em inglês ;)" :)
Garth J Lancaster 27-Aug-20 5:56am View
ouch .. anything would be more fun than IBM 360 on punch cards. You've done well !
Garth J Lancaster 27-Aug-20 5:43am View
I'm sure the feckless PFY's would go 'What the heck is that' .. along with a whole host of others 8086/8088 ...
Garth J Lancaster 25-Aug-20 3:50am View
In addition to everyone else's comments "As you can see this method is not good if multiple users connected at the same time decide to run the same query." .. that's precisely what a database is supposed to do - allow multiple users to access data .. if they are running the same query, then let the database deal with the caching etc.

I'm not sure what your issue with that is, except as OriginalGriff points out below as a solution / fix to your select code.

If your problem is that all users must use the same parameters for the query, that's a completely separate issue - you might need to use a control-table or such to store the parameters for a run, but how you update it/specify a duration in which a set of parameters is valid/the set to use will get 'interesting'
Garth J Lancaster 25-Aug-20 3:46am View
You haven't send 'to what end' you wish to combine the two vectors - what will you do with the result / what is it to be used for ?

The way you indicate above almost seems like you need a hash -> count of occurrences
Garth J Lancaster 25-Aug-20 2:04am View
I often joke with OriginalGriff that there must be an invisible camera watching me post, because it's scary how much we post at the same time - ditto you Sandeep :)
Garth J Lancaster 24-Aug-20 4:34am View
yup - laziness - same as C# 'var' (ducks and runs for cover)
Garth J Lancaster 24-Aug-20 3:48am View
"Me? I'd go with the latter" ...yup I used to work with a DBA who would fail code reviews for 'un-necessary CASTing'
Garth J Lancaster 23-Aug-20 22:00pm View
iirc, this problem usually occurs, because you have a database table field defined as for example nvarchar(30) eg your txtCharName, but you have a c++ string that is larger than 30 characters - let's say 35 just as an example. So you're getting an error that "Loremipsumdolorsitamet,consectetur" is going to be truncated leaving '...consect' on the end but missing the full 'consectetur'

Does that make sense ?

You're using an 'odd' ie different database layer than I'm used to, so, suggestions for fixing I can only give rough thoughts .. make sure your update parameter sizes match the table field sizes for binary/blobs & string (nvarchar) types .. and/or increase the nvarchar types
Garth J Lancaster 22-Aug-20 23:21pm View
I took a quick look at the Stripe API - I saw 'Webhooks' but I'm not sure that will give you what you want. Could you automagically run a report at say 'midnight' each day and use that information to update your database, I'm not sure whether that's invoice data per customer or ? .. if the report data is available, it would be pretty easy to set up a service app to update your database
Garth J Lancaster 18-Aug-20 6:53am View
"I would like to know is this a good way i have it setup?" .. well, I would say no - you still want to decouple the trade receive from the processing (so you don't want to block your socket) .. it still depends on numbers and speed (of received trades) - I'd be looking at adding the received trade to (maybe) a shared datatable/data structure, maybe firing off an event to say data has arrived, but then processing that data in a second (and safe) thread - one could use an observable collection here as well ... do you also need robustness ? what happens if you 'drop' a trade ?
Garth J Lancaster 17-Aug-20 2:38am View
ok, well the 2nd link from Sandeep shows you how to achieve the same without a) converting Java -> C# or b) using an external/non C# Framework library
Garth J Lancaster 15-Aug-20 2:57am View
"Is there alternative for configuration manager?" : yes - you can store config data all sorts of ways - using the configuration manager is better than re-inventing the wheel

"I have tried system configuration but couldn't debug" - ok - but since you haven't posted any code, how do you expect us to help - how about using Improve question to show us your code/what the issue is and we *might* be able to help
Garth J Lancaster 14-Aug-20 4:02am View
I think that's a typo/cut&paste error Stefan - I left it as it was for the OP .. good call on the '/' at the end of the path though, I hope the OP sees it
Garth J Lancaster 14-Aug-20 3:31am View
so what is the return code from the
tls_config_set_ca_path(cfg, "/usr/local/etc/mycerts/CA-certificates")
call, as in
int tcscp = tls_config_set_ca_path(cfg, "/usr/local/etc/mycerts/CA-certificates")
? my guess would be -1 ...
Garth J Lancaster 14-Aug-20 2:38am View
can you use Use Improve question to update your question with your init code ? What is the return code from the tls_config_set_ca_path function ?
Garth J Lancaster 14-Aug-20 2:15am View
What database data-type is dgDob in the User table ?
Garth J Lancaster 13-Aug-20 6:03am View
First of all, you need to write a question such that we can help you - WTF is line 84 ?? no point posting a blob of code expecting that we can figure out where line 84 is - use Improve question and comment the line and/or use bold tags <b> and </b> around it
Garth J Lancaster 13-Aug-20 6:00am View
Its like the aircraft maintenance log
Problem : Something broken
Repair : Something fixed
Garth J Lancaster 13-Aug-20 5:56am View
it would be really handy if you used Improve question and added the actual error message you receive
Garth J Lancaster 12-Aug-20 23:39pm View
It would be nice to see some details of the HTML string ... I see 2 possibilities
1) you clean up the HTML string before your existing routine - so code mostly as it is now, with an extra call to clean up (ie remove the empty rows) .. that could involve parsing the HTML and then deleting the empty rows and returning a string to use as you do now
2) OR re-writing/extending .ParseXHtml() to do this ... although not quite the same, there's some thoughts on this here
Garth J Lancaster 12-Aug-20 7:02am View
I do like that you simplified the two generated 'Addresses' ie BillingAddress and ShippingAddress - I keep forgetting to do this ...
Garth J Lancaster 11-Aug-20 23:19pm View
Well, if it were me, I would be looking at the locale & keyboard/language settings - eg English/US .. I don't know what Linux comes as standard on a Raspberry Pi3, but I would suggest looking at the 'man' pages and/or net for keyboard issues for your Linux variant

is the inability to access shift 1 ... etc a problem just in nano, or does it fail in the ssh/terminal window as well ? obviously if it works in ssh/terminal, it's a nano problem, if it doesn't work in ssh/terminal, it's a general issue ..
Garth J Lancaster 11-Aug-20 9:01am View
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you. And if you hand in work that we produce, you are a liar and a fool - your tutor can also see this site !!!!

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
Garth J Lancaster 11-Aug-20 6:51am View
The question ? - homework, pleeeassse, send codez :)
Garth J Lancaster 11-Aug-20 6:44am View
Not quite sure what "Values ​​added to the list before closing the program are removed, while those that were added earlier and read from the database are not deleted." means. I see you have
.. does this show the item2's you intend to delete - maybe use Improve question and add a bit more detail
Garth J Lancaster 11-Aug-20 6:06am View
+5 - nice find (link) Luc
Garth J Lancaster 11-Aug-20 4:37am View
You don't provide a lot of information .. what else is in this table ?, what are you going to use this information for ??

if you have a product table then sure, it might have a quantity, but does it also make sense to have new and old quantities ? ..

Maybe you need to think about an audit or transaction log, such that, if a PO uses x items, a timestamped audit/log entry is created for each item, showing the new and old quantity - you can then use this for analysis

If you can provide more schema info, better solutions may be forthcoming - Use Improve question to update your question.
Garth J Lancaster 10-Aug-20 23:31pm View
That sort of response, to myself and OG (the other solution), is about as useful as tits on a boar - OG's solution in particular does work depending on the relationship between the forms - parent-child etc .. maybe you should update your question with your coding as per OG's notes - use Improve question
Garth J Lancaster 10-Aug-20 23:07pm View
The device might have an API or such - unfortunately, except for 'scangear' we know little about it. You could use Improve question to add the model etc, but usually the manufacturer and their support site supply drivers and manuals and possibly examples detailing how to interface to such
Garth J Lancaster 10-Aug-20 5:21am View
Please stop reposting the same question - people have tried to help you on your previous attempt(s) - respond to them there please
Garth J Lancaster 10-Aug-20 4:00am View
so what is your problem ? you'll need to write code to
1) accept numbers from the console (maybe read as a comma delimited string ?)
2) split the string by the comma and store the numbers in an appropriate data-structure
3) iterate the data structure to find the minimum number
when you break a problem into smaller segments, it becomes easier to get help
Garth J Lancaster 10-Aug-20 3:23am View
I don't think you've shown us the relevant parts from which we can help you - for example, what runs after you click the link 'to get to' gameInfo.php ... you'd be correct in assuming that somewhere along the line, the id of the game/link you've clicked on, must be passed into/obtained by gameInfo, so it can then get the further details from the JSON and display those ... but without the relevant guts, we're more blind than you ... Use Improve question to update your question.
Garth J Lancaster 10-Aug-20 2:53am View
"can anyone please help me ?" - maybe .. but you haven't provided a lot of information, for example, "but it was failed" - was there an error message ?

You should probably Use Improve question to update your question and provide as much information as possible, given we cant read your screen or mind
Garth J Lancaster 10-Aug-20 2:22am View
This article here may also help in general terms
Garth J Lancaster 10-Aug-20 2:20am View
It's *really* hard to find information out there ... it looks like you would do something like this
JET_INSTANCE instance;
JetCreateInstance(&instance, "instance"));

JetSetSystemParameter (&instance,
and that means your line
err = ::JetInit(0);
err = ::JetInit(&instance);

These are the references I found
Garth J Lancaster 6-Aug-20 2:13am View
I hope the missing 't' is just a typographical error in the second of these two lines (ie 'filer' should be 'filter')

``` filter = new string[] { "email", "SERGIOBERTOG@GMAIL.COM" };
var result =, "customer.list", filer);```
Garth J Lancaster 6-Aug-20 2:04am View
meh - give yourself a break - sometimes we're so stressed/tired/etc etc we fail to see what's under our noses
Garth J Lancaster 6-Aug-20 0:04am View
"(I'm new to programming, so don't come after me)." .. ok, we were all new to programming once. What I will say, is that you should probably use Improve question to provide some code detail of what you've got - preferably the smallest amount of code that illustrates the issue - otherwise it may be too hard to give you specific help.
Garth J Lancaster 5-Aug-20 23:31pm View
the second link I included in the response was to the particular join wav files together example - they only had 2 files, trivial to use 3...n
Garth J Lancaster 5-Aug-20 5:36am View
iirc Umbraco IS .Net Core, there's also Piranha, Orchard
Garth J Lancaster 5-Aug-20 5:24am View
No sure exactly where you mean the error is coming from - can you perhaps use Improve question and add a comment in bold to show where the error occurs .. maybe also you could show us some of the Json or a mocked up version just so people can see what you're deserialising
Garth J Lancaster 5-Aug-20 5:17am View
I updated my solution to include "If you can analyse the dependencies, you may then be able to go to your build process and add the missing component(s) to the build - it is something we cant do for you unfortunately" .. you MUST first identify the dependencies/missing part that the third dll/assembly needs (also, make sure it has the same build settings as the other components)
Garth J Lancaster 4-Aug-20 22:27pm View
Does it only happen if @"autografo1.wav" is on the end or ANY file on the end ?
Garth J Lancaster 4-Aug-20 7:13am View
Not sure what you need from us - please use Improve question to say what you need.
Garth J Lancaster 4-Aug-20 5:32am View
I think you need to check OriginalGriff's reply carefully - especially "That may be as simple as "does the file exist?" or you may have to be cleverer than that and check the file content to see if there is a header line (or indeed any data at all)." - you've been tweaking true to false and back again now - so it's obvious that on it's own is not going to work - hence why I would have written a temporary file and merged it - that way extra header lines could be removed, if you didnt implement smarter logic as suggested
Garth J Lancaster 3-Aug-20 23:51pm View
Its not immediately obvious where locationmasterhistory is .. your code seems to show you loading from database table tblCompBranchHistory to a data-table to excel.

The obvious answer, in general, is, use the unique ID's from the data-table for tblCompBranchHistory, and build a paramaterised query to
update locationmasterhistory set export = "yes" where ID in [list]
but I'm not 100% sure of your schema

btw, I suggest updating by 'ID', because in as little info as you've shown, doing an unrestricted update of locationmasterhistory could be dangerous
Garth J Lancaster 3-Aug-20 8:36am View
There's not enough requirements really to give you a decent answer eg:
- how many tables ?
- how often does a 'regional' update get sent to the server ?
- how many rows at a time per table will get sent to update ?
- you say the server has a public ip address, great, but how are you going to (potentially) route that to a 'service' to update the master database ?
- what happens if a 'set of data' isnt updated due to some error - is there a backup protocol required ?
- what IS the data - does it need to be secured in addition to securing the communications protocol ?
There are these a a lot more an architect would start asking to start sketching a solution
Garth J Lancaster 3-Aug-20 5:34am View
"it should only affect the ComboBox on the gray row" .. ok, but you wrote the code didn't you ? unfortunately, since you haven't shown us the code for the relevant click event/handler, there's not much we can do to help .. how about using Improve solution so we can see the code and outline potential issues ?
Garth J Lancaster 3-Aug-20 4:13am View
I'm not sure it's possible like that. What control do you have over the SQL statement selecting data from the data source ? (I'm thinking if you use SQL Server you can use OFFSET & FETCH to paginate the data)
Garth J Lancaster 30-Jul-20 8:54am View
done, OP has posted anyway
Garth J Lancaster 30-Jul-20 7:14am View
"i try to use pivot option but could't successes" - what does that mean ? since you don't post code how do you expect us to help - non-posted code is a) vapourware, b) B/S (I'll let you figure that one out) .. please provide more info so we can help you better
Garth J Lancaster 30-Jul-20 6:54am View
That's a bit odd .. try adding Hide   Copy CodeHide   Copy Code
si.WorkingDirectory = @"D:\appFolder";
ie Hide   Copy CodeHide   Copy Code
si.WindowStyle = ProcessWindowStyle.Normal;si.WorkingDirectory = @"D:\appFolder";
si.Verb = "runas";             // UAC elevation required.

It would also be good to check the python code that made the exe to double-check it's using thr fully qualified path etc to the config file
Garth J Lancaster 30-Jul-20 4:32am View
good - you can still use tools like Selocity to give you the element to use from a Winform app or whatever - you're using a Winform app to drive Selenium, that's the critical part here

Glad you figured it out anyway
Garth J Lancaster 30-Jul-20 3:46am View
will this work ? you ask - test it, find out, experiment - Information Technology IS a science - formulate a hypothesis (write some code), test it, modify it and try again
Garth J Lancaster 30-Jul-20 3:28am View
c'mon - you've been through iterations of this before - if you have a checkbox column in the datagridview, then, while you're looping through the datagridview rows, if the cherckbox column .Selected = True then write that row, but build that row from the other columns not including the checkbox column
Garth J Lancaster 30-Jul-20 2:04am View
you haven't shown the full procedure, so I don't know about the cursor construct - it's a bit like trying to work blindfolded
Garth J Lancaster 29-Jul-20 8:49am View
I keep thinking 'deep copy' / clone but I'm not sure if it is as simple as backup = ObservableCollection.Clone()
Garth J Lancaster 29-Jul-20 7:35am View
Not sure what you're asking .. are you saying
it SHOULD delete files like ABCD20200720.jrn but
it SHOULD NOT delete files like 20200720.jrn ??

I note nowhere do you check the file for a prefix of 4 characters before the date
Garth J Lancaster 29-Jul-20 7:30am View
I'm sure you'd have added logging to the program
and be trapping any exceptions
and be checking the Windows Event Logs
and have fully qualified the paths to your excel file

since you don't show any code its going to be hard to help
Garth J Lancaster 29-Jul-20 7:06am View
other thing I can think of is this
,@path + CONVERT(varchar(100),[BLOBS]) AS Path
FROM [cell].[dbo].[blobs]
Garth J Lancaster 29-Jul-20 6:53am View
what is the definition/data-type of the BLOBS column ?
Garth J Lancaster 29-Jul-20 4:48am View
ok .. if you have a text file (no BOM), with the character て , how is that represented in the text file - eg using a hex display tool or such ?
Garth J Lancaster 28-Jul-20 6:41am View
sorry, take off the , True or change it to , False - I misread the Microsoft documentation -
Garth J Lancaster 27-Jul-20 22:53pm View
of course you CAN overwrite a file - eg, looking at your code
Dim tw As IO.TextWriter = New IO.StreamWriter("C:\Test1.CSV")
if you did this
Dim tw As IO.TextWriter = New IO.StreamWriter("C:\Test1.CSV", True )
it would overwrite the file .. the issue is about 'safety' in my mind ..
Garth J Lancaster 27-Jul-20 9:19am View
What have you tried?
Where are you stuck?
What help do you need?

If you want code written for you, please go to RentACoder or some other site - ie pay for code - else, use the "IImprove question" widget to edit your question and provide better information - for example, what you can code in, what sort of SMTP server, what code you have and where/why it fails
Garth J Lancaster 27-Jul-20 5:48am View
well, we can't see your screen and figure out 'from where' you got matrix.solve or such - as Sandeep's solution (1) guesses, it could be the JAMA library.

The answer to the first part of your question could be 'you need to look at your import statements, or the Maven or Gradle build files' .. the answer to why is doesn't work in Eclipse is likely that the required library isnt imported or available, so maybe identifying which Java matrix library and how it's being used will give you the clue for the Eclipse issue
Garth J Lancaster 27-Jul-20 3:07am View
So what is the problem exactly ? please use Improve question to say what the actual issue is
Garth J Lancaster 27-Jul-20 2:52am View
Well, I'm not sure why the static constructor init doesnt work
public static GV()
  connectionstrings = new List<connectionstringinfo>();
Garth J Lancaster 24-Jul-20 7:05am View
This is probably better posted here where the site admins will see it

Garth J Lancaster 23-Jul-20 22:06pm View
Catch-22 - you probably can't show us the code, yet we can't really help you unless we see the code. Maybe the party ?EWay to which you're sending the request has more information on setting up the SSL/TLS connection correctly, the use of (their) certificate or such
Garth J Lancaster 23-Jul-20 6:22am View
I think VARCHAR(MAX) is a MS SQL Server declaration - try
as a replacement
Garth J Lancaster 22-Jul-20 23:08pm View
sure - what I've got there will save all of lets say the first datagridview dgv to a file. Let's assume that dgv has the first column as a checkbox that if ticked you want to transfer that row to a second datagridview dgv2 - then roughly, build a new datatable dtt with the rows for datagrid2/dgv2, loop through the selected rows of datagrid 1, add those rows to the 'transfer datatable, then set that datatable as the source for the second datagridview dgv2, ...
DataTable dtt = new DataTable();
// ... and so on   
foreach (DataGridViewRow item in dgv.Rows)
  if ((bool)item.Cells[0].Value == true)     
    bool isSelected = Convert.ToBoolean(row.Cells["Col1"].Value);        
    if (isSelected)        
      dtt.Rows.Add(row.Cells[1].Value, row.Cells[2].Value, ... );        
dgv2.DataSource = dtt;
Garth J Lancaster 22-Jul-20 4:31am View
well done Maciej :-)
Garth J Lancaster 22-Jul-20 3:46am View
You don't say what is 'wrong' with your code / what it is doing (or not), or even if it compiles - might be an idea to use Improve question and update it ..
Garth J Lancaster 22-Jul-20 0:59am View
hmmm, not sure what he's looking for, maybe for you to write your own 'toupper()' .. assuming ASCII, if you have
char ch;
you effectively have an 'uppercase' version of ch
Garth J Lancaster 22-Jul-20 0:40am View
ouch - you're correct .. I think you'd have to define your own arc() function that uses putpixel or such in that case
Garth J Lancaster 22-Jul-20 0:31am View
then, be aware that the behaviour of toupper is defined as "If the argument passed is other than a lowercase alphabet, it returns the same character passed to the function" .. in reality, Ive never seen the need to 'uppercase' or shift '[' to '{' for example, so maybe anything I've suggested is too advanced for your class and your teacher or lecturer or ?? only means for you to use the standard toupper()
Garth J Lancaster 21-Jul-20 9:40am View
Garth J Lancaster 21-Jul-20 2:12am View
Did you mean to post this as a question to the author of an article ? as it stands here it doesnt make sense as a 'standalone' question - furthermore, without any other details, eg whether your PDF is an image (requiring an OCR approach) or a 'normal' PDF requiring maybe iText, it will be difficult for anyone to help
Garth J Lancaster 21-Jul-20 2:09am View
You might like to highlight the line where you get this error - use Improve question
Garth J Lancaster 20-Jul-20 22:47pm View
What do you mean by 'three way handshake' ? it might be a good idea to use Improve question to add a description to your question.

There are good notes here referring to this from the rfc that outline 'standard' handshaking
Garth J Lancaster 20-Jul-20 18:53pm View
what is the exact code you have now ? (that didnt work)
Garth J Lancaster 20-Jul-20 1:14am View
Maybe you should use Improve question to add the relevant code, the error text itself, and what 'type' of database you're using - I'd have to guess at MS SQL Server

As it stands, the only information I can offer, assuming you're using SQL server, is that the transaction log records all database modifications and transactions, but will fill up if it is not managed. This transaction log can be used to repair a 'corrupt' database. Where I worked recently we needed to manage transaction logs for databases we received from clients before we could load the database for analysis
Garth J Lancaster 19-Jul-20 8:10am View
sorry - (3) also says "UserInfoListener.ParseRequest: Cannot find access token in the request." so if it wont take that as I've suggested, following how it said to do it, I have nothing further I can offer - hopefully someone else has an idea
Garth J Lancaster 19-Jul-20 5:29am View
byte[] userInfoBytes = webClient.DownloadData(userInfoUri);
byte[] userInfoBytes = client.DownloadData(userInfoUri);
Garth J Lancaster 19-Jul-20 2:33am View
yes, its possible, but I dont work with Python all the time, so, at a guess, and noting the blobJson has single quotes in the JSON, try this
blobJson = parsed[0]["blobJson"]
blobJson = blobJson.replace("'", '"')
parsedbj = json.loads(blobJson)
print("[0].x = ", parsedbj[0]["x"])
print("[0].y = ", parsedbj[0]["y"])
print("[0].z = ", parsedbj[0]["z"])
print("[1].x = ", parsedbj[1]["x"])
print("[1].y = ", parsedbj[1]["y"])
print("[1].z = ", parsedbj[1]["z"])
instead of "print(json.dumps(parsed, indent=1))"

My way probably isnt very efficient, there's likely a python library that can do the same, I just 'followed' the data structure after the first parse, pulled out and corrected the required piece (blobJson), than parsed that from json to get a list of dictionary objects
Garth J Lancaster 17-Jul-20 5:10am View
"it does not work" does not help us to identify what the specific issue is - maybe you could use the Improve question button to add that information and any code you have used .. check if this adds any useful information in code .. btw, look at Hide   Copy CodeHide   Copy Code
X509Store store = new X509Store(StoreName.My);
this would be what you want Hide   Copy CodeHide   Copy Code
X509Store store = new X509Store(StoreName.Root);
Garth J Lancaster 16-Jul-20 2:44am View
Well, you've stated the intent, shown some code, but you haven't actually described 'what happens' - do you get an error, exception, or does the code not even compile ? .. it may be a good idea to use Improve question and say what the actual issue is.
Garth J Lancaster 15-Jul-20 5:29am View
"Can we read specific nodes or filter the reading of xml-" - is that a question ? if so, the answer is apparently not, unfortunately .. it may be the column mappings that are taking time, but I'd have to see it's performance and memory stats really to try and decide

With no details of data.xml, except it seems to have 2 different types of data, what I would try is to reduce the data set size, in a number of steps
1) sufficient data to make sure the process in general works, but maybe 100 records
2) split data.xml into the two types/nodes of data, as individual files - I think this is what you're asking as the first question, but I'd go even further, in that each node in each 'split' by type file only contains as much data as it needs and no more
3) wrap the bulk-copies in a transaction - one per copy ...

[Edit] with a little work, you might also try the WriteToServerAsync method
Garth J Lancaster 15-Jul-20 4:09am View
"It is giving error" - I think you should use Improve question to say 'what the error is', AND, any code useful to the API receiving the XML, any parameters in Postman you're using, for example, I would hope you were setting at least 'Content-Type'
Garth J Lancaster 15-Jul-20 2:25am View
You Said "this is not working so well" - could you please use Improve question to indicate 'why not' - it may help people know what you need, it is not clear to me exactly what you're asking for

In general, yes, it should be possible - take a look here for example ... if you want a quick critique on 'ModuleOne', ok ..
1) ModuleOne is a bad name and not indicative of it's purpose - vs 'sqliteDBModule' for example (I forget the VB 'case' conventions)
2) openDB does too much - it should take maybe the name/path to the db, and return a db connection or error (or even throw an exception), that's it - one purpose
3) you could extend your Sqlite 'Module' to implement openDB, closeDB, executeSQL etc etc, but of course I'd say consider what's out there already and re-use/extend it
4) in addition to (3), I'd say, think of 'layering'/'abstractions' .. at the bottom-most layer, you have a sqlite database module that does only low level things with ANY database. 'On Top' of that layer, you then build Module(s) that are specific to the data you wish to handle - One Module per database or table maybe

Does this help or get you any closer to what you need ?

Edit - Also useful,,
Garth J Lancaster 14-Jul-20 5:53am View
+5 Carlo :-)
Garth J Lancaster 14-Jul-20 2:32am View
the format of you journal file - "ABCD20200710.jrn" - is there ALWAYS only 4 characters (for example, the 'ABCD') before the date ?
Garth J Lancaster 13-Jul-20 21:10pm View
I think you need to use "Improve question" here and add some more detail
1) you say 'dataframe' -since you dont show any code, what data frame - 'pandas' ?
2) what is the error/message you get ? - we cant see your screen/code
In general I'd be looking at 'queuing' selected data-frames and saving them in a separate ? thread, but that's just a quick thought on the 'type' of problem you pose - without seeing code and knowing m ore about the error etc, its no more that a finger in the wind guess
Garth J Lancaster 13-Jul-20 21:05pm View
well, without having the project in front of me and seeing if 'you' have added a reference to System.Web.Extensions, I can't think of much - I don't work with these components a lot these days, so I'd have to Google it myself. Sorry
Garth J Lancaster 12-Jul-20 0:53am View
"and failed." & "it still failed." you really need to use Improve question and include how it failed and what the errors were - as succinctly as possible, but more information that you have provided so far - it could be an easy or hard 'fix'

You are correct in that a console program type of project is wrong, it doesnt include enough of the framework(s), most noteably MFC that you need, so I'd have expected a better result with "MFC static linked" .. dont lose heart, it does get easier .. likely, you could start with a Dialog based Project .. this may help ..
Garth J Lancaster 11-Jul-20 9:04am View
Sir ? to which 'Sir' do you refer to - this doesnt make sense without the original reference or article - you would have been better off to reply there or to use 'Improve question'
Garth J Lancaster 11-Jul-20 3:16am View
Donec pharetra viverra pulvinar. Duis nec faucibus ex. Morbi vel ipsum viverra, tristique diam quis, sollicitudin sem. Maecenas eu faucibus eros, sed tempus urna. Sed vehicula sollicitudin dui, eu cursus dui viverra in. Sed interdum arcu pharetra, finibus metus rutrum, dictum purus. Ut dignissim consequat molestie.
Garth J Lancaster 11-Jul-20 2:13am View
dammmit I wish these pages refreshed more quickly - if I'd seen that you'd updated it (with the same as I had) I wouldnt have bothered :sigh:
Garth J Lancaster 11-Jul-20 2:08am View
should this Hide   Copy Code
'' &language=es-MX&page=1
be more like this Hide   Copy Code

BTW : Please DO NOT display your API keys here - I have removed them and replaced with x's
Garth J Lancaster 11-Jul-20 1:58am View
I notice in here
            foreach (string strFile in strFiles)
                ClsExcelUpload objExcelUpload = new ClsExcelUpload();
                string szConnectionString1 = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + strFile + "';Extended Properties=\"Excel 12.0;HDR=YES;\"";
                objExcelUpload.ReadExcel(szConnectionString1, strFile);


you don't dispose of objExcelUpload - would this for example
            foreach (string strFile in strFiles)
                ClsExcelUpload objExcelUpload = new ClsExcelUpload();
                string szConnectionString1 = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + strFile + "';Extended Properties=\"Excel 12.0;HDR=YES;\"";
                objExcelUpload.ReadExcel(szConnectionString1, strFile);
                // Presumably something else happens here 
                objExcelUpload = null;
make a difference ?
Garth J Lancaster 11-Jul-20 1:31am View
"they did not work:" - that is ambiguous isnt it ? what do you mean by that - did you get no result whatsoever on the serial monitor, or a reading from one of the sensors, or ? - you should use Improve question to update the information and state exactly what that means.

Ok, so, I guess the sensors are wired correctly (in parallel) in terms of the SDA, SCL lines with a pull-up resistor between them and A4 (SDA) and A5 (SCL) on the UNO. They both have different I2C addresses (MLX90614 = 0x5A, VL53LOX = 0x29) by default, so unless you've changed the addresses, it's not that

I see in your combined setup code
void setup()
  while (! Serial)
  if (!lox.begin())
    Serial.println(F("Failed to boot VL53L0X"));
could you please try moving the mlx.begin(); 'down', so
void setup()
  while (! Serial)

  if (!lox.begin())
    Serial.println(F("Failed to boot VL53L0X"));

I'd also ask if you really need the
if (Serial.available())
around the combined sensor reading code since you wait for serial to be available in the setup code
Garth J Lancaster 10-Jul-20 21:01pm View
It would also be handy if you posted the definition of the stored procedure if its 'small' enough
Garth J Lancaster 8-Jul-20 4:43am View
Thanks Maciej - I was looking more forward to maybe a skip and take paging solution for his rows, but it seems he only has one data row :-(
Garth J Lancaster 8-Jul-20 1:40am View
How many rows are there in the worksheet ?

Splitting a single row into groups of 10 columns is 'easy', but you dont say how many rows you have, this may cause 'paging' issues as in the PDF Table running over the page.
Garth J Lancaster 7-Jul-20 23:40pm View
What you have provided so far doesnt provide us with enough information to be able to help you. Please use the 'Improve question' button to add more information, maybe the data and how FillBybill reads it. It may be that you have to 'partition' the data by a number of rows for the 1st 1/2 of the Receipt, then the rest of the items go on the 2nd 1/2 of the receipt.

It also depends on the RDLC definition though
Garth J Lancaster 7-Jul-20 9:55am View
Can you elaborate on "my code is not working properly." .. what is it doing .. also, your code has no comments - commenting code is useful for two reasons - it lets others know what your intent is, and, by the act of commenting you're reading what you've written and seeing if it makes sense

Also - we know nothing about the format of your input file - is it one word per line, or sentences, or ?? there are quicker ways to read the file if its one word per line, and you can avoid character by character reading
Garth J Lancaster 4-Jul-20 4:11am View
nice - here was I thinking of yields, ElementAt ....
Garth J Lancaster 4-Jul-20 4:06am View
it looks 'plausible' - what's the issue ? .. probably better if you use "Improve question" to spell it out 'above'
Garth J Lancaster 3-Jul-20 9:44am View
"But it still doesn't work" - maybe you'd like to use 'Improve question' and show/state why it's not working or what you get for various inputs - we cant read your screen or your mind
Garth J Lancaster 2-Jul-20 0:58am View
tl/dr; short answer 'no, not sorry'
long answer - apart from that I disagree with what you're doing to your logs, the information is out there on the net on how to split logs how you asked (excluding the 'Method1' example, which is likely formatting the log strings) is out there on the net .. you're probably being paid to do this work - I am currently unemployed, so at some stage you should do your own research/leg-work
Garth J Lancaster 1-Jul-20 3:09am View
"I have created equivalent stored procedure but it seems wrong" - why don't you use 'Improve question' to update with your attempt at a stored procedure, and, outline what the issue(s) are with it - that way we can help you fix your own code (we dont write code for people anyway, so unless you post your own code all you'll likely get back is a list of google links on stored procedures)
Garth J Lancaster 30-Jun-20 10:01am View
btw - log4net file appenders have a setting iirc that allows you to set the locking mode of the file - see this ... you should probably set yours to MinimalLock
Garth J Lancaster 30-Jun-20 9:58am View
ok, that's a 'different' requirement ... what you need to do is set up an appender for each level -> log file
So, for each level, create a new appender (file, rolling file, whatever) - using 'info' as an example ..
1) name it eg RFAppender-info
2) set the file value to a unique file path/file-info
3) set the filter type to "log4net.Filter.LevelRangeFilter"
4) set the filter levelMin & levelMax to "INFO"
5) add the appender to the 'root' list of appenders
Im sure if you google for 'log4net different file per level' you will find the information if this doesnt make sense
Garth J Lancaster 30-Jun-20 6:57am View
From what I have seen of discussions on 'WriteAllLines', it will write to a file but not truncate it first (I havent yet found the exact code for the library) ..

That being the case, can you write to eg /sftp/sftpuser/", if everything else you're doing is successful, delete the original file and rename .new to the original file name ?
Garth J Lancaster 30-Jun-20 6:22am View
1. please update your question with which SFTP Client you are using (use "Improve question")
2. have you verified - eg using Console.WriteLine() and/or a debugger that newLines has the correct content ? (ie, missing the 4 lines from []indexdelete) ?
3. have you checked the permissions on the directory/file ?
4. have you tried deleting the file before writing the new lines to it (since I cant tell what sftpClient.WriteAllLines is doing) ... try a System.IO.File.Delete("/sftp/sftpuser/test.txt") before the sftpClient.WriteAllLines ...
Garth J Lancaster 30-Jun-20 2:14am View
ok.. there's plainly data that doesnt look good/work as CSV - so I'd be looking at
1) going directly from your SQL server to RedShift ie a Custom tool, bypassing the CSV issue altogether (or)
2) Cleaning up the data so it works as CSV (removing tabs, cr/lf etc) before it's stored in the SQL server table
3) 'maybe' storing the data as a blob in the SQL Server table, but that would still require (1) to upload it into Redshift
Garth J Lancaster 29-Jun-20 19:29pm View
I think you miss the point of CodeProject - we aren't a coder for hire site - there are plenty of those out there - we help people write code ... but even if you went to a coder-for-hire, you would have to supply proper 'requirements' with an analysis of your data, which you havent done well here - you could have put that comment about the '88' in your question for example and made life easier.

You havent answered the question I asked you about how large/many lines there are in the files - another vital piece of the information that could make the cost cheap or expensive

My answer to this question would be 'yes', it could be done, but could cost a 'a lot' ..

Is there a name for this data format ? (or, where does it come from - North America Utility companies ??)
Where are the files ? all in one directory or scattered ?
What do the filenames look like ?
How large are the files/how many lines are in them ?
Garth J Lancaster 29-Jun-20 8:39am View
yes, I did wonder about that myself - my mind went back to the recent C# 'var' discussion !
Garth J Lancaster 29-Jun-20 7:09am View
sorry - misread your question

what about
deg.ToString().PadLeft(3, "0"c)

- its the .PadLeft()... that's important here
Garth J Lancaster 26-Jun-20 3:41am View
I see you've updated it - I might have missed that the data for this 16,475,16228,,42,6414 comes from the line 'below it' ie an '88' line ... not impossible to account for, depending on how many lines are in the files on average
Garth J Lancaster 26-Jun-20 2:46am View
no, I meant the type of SMTP Server - I dont care about the 'name' of it .. 'what' is it
Garth J Lancaster 26-Jun-20 2:14am View
you might want to update your question (use "Improve question") and let us know what SMTP Server you're using eg Exchange 2013, GMail, ...
Garth J Lancaster 25-Jun-20 20:35pm View
I was having a coffee and had an oh-no moment - you're going to a dictionary so that's not the correct place to do that conversion anyway .. I'm going to modify the response

See the edit I did - at the output stage - hopefully there's a ToString() exposed on that object
Garth J Lancaster 25-Jun-20 20:22pm View
I was having a coffee and had an oh-no moment - you're going to a dictionary so that's not the correct place to do that conversion anyway .. I'm going to modify the response
Garth J Lancaster 25-Jun-20 3:17am View
Have you thought about either polling the shared memory for a 'signature' or 'sequence ID' at the start of the block or perhaps using a pipe between the two processes as a 'signalling' mechanism ?

The only other thoughts I had, likely 'too heavy-weight', use a small message protocol between the two systems - ZeroMQ for example (not RabbitMQ)
Garth J Lancaster 23-Jun-20 22:34pm View
Your issue would suggest that the first and/or last 'node' of your list isn't correct - since you don't provide the code that builds the list I/we can't say.

I am assuming (always dangerous) that this is an assignment/homework of some sort where you must use your own list - else you would just use the STL List implementation and a standard reverse iterator with rbegin && rend, yes ?

I think you should use 'Improve question' and show the code that build's the list and comment why prevNode/curNode and particularly spaceNode exist

I'm not sure what dev environment you're using, but you should also be able to highlight the line that causes the exception (and it will almost certainly have null's where you dont expect) by 'single stepping' through the code - debugging is a useful skill
Garth J Lancaster 23-Jun-20 18:22pm View
just delete that line
Garth J Lancaster 23-Jun-20 0:41am View
it looks like your DB layer is different ? ancient .. try masking it out, and given that, you might need to change the insert statement to
with con:
  //cursor = con.cursor(prepared=True)
  sql_insert_query = """ INSERT INTO TempDB (temperature, humidity) VALUES (%s,%s)"""
  insert_tuple = (temperature, humidity)
  cursor.execute(sql_insert_query, insert_tuple)
Garth J Lancaster 22-Jun-20 22:07pm View
My spacing was bad AND you need to replace 'connection' with 'con' .. so I think yours should look like
with con:
  cursor = con.cursor(prepared=True)
  sql_insert_query = """ INSERT INTO TempDB (temperature, humidity) VALUES (?,?)"""
  insert_tuple = (temperature, humidity)
  cursor.execute(sql_insert_query, insert_tuple)

You need to be prepared to experiment and test a bit
Garth J Lancaster 22-Jun-20 21:41pm View
please modify your answer to include the create statement used to create the table (that should have the details) - I dont know how you expect us to figure out which 'youtube guide' you're referring to without actually supplying it, and most of 'us' wont watch some random youtube link anyway
Garth J Lancaster 22-Jun-20 3:46am View
whatever is / whoever wrote it, is saying that you're not supplying the required arguments on the command-line, as in

python -i <some input> -o <some output>

you could also try

python -h

for help it seems
Garth J Lancaster 21-Jun-20 22:10pm View
you do realise that
info = API.infoB(2018, 'FALL')
will give you a zero/nothing return right ?? look at your data 'Fall' vs what you are searching for 'FALL' .. you have to be a bit more precise - the computer can only do what you tell it, it doesnt know that 'Fall' != 'FALL'

I ran your code with
def infoB(year, sem):    return cursor.execute("SELECT * FROM COURSES WHERE sem_year = ? AND semester = ?", (year, sem))

info = API.infoB(2018, 'Fall')
and did get the correct result
Garth J Lancaster 20-Jun-20 21:13pm View
Why is 'PlayerController' uppercased as in here
private PLAYERCONTROLLER playerControllerScript;
and here
playerControllerScript = GameObject.Find("Player").GetComponent<PLAYERCONTROLLER>();

On the little bit of code you've put, there is no reason - should it not be PlayerController ? (unless something is happening elsewhere in the code you havent shown us)
Garth J Lancaster 20-Jun-20 19:08pm View
This site suggests you can used 'named parameters' - look at
Garth J Lancaster 20-Jun-20 7:09am View
I have not a clue what you're talking about, and without a minimum sample of the code causing concern/under question, I dont know what you expect from (us).. please use "Improve question" and elaborate what code you are referring to and what you mean by 'why to divide to numbers in dynamic'
Garth J Lancaster 19-Jun-20 4:10am View
Why dont you give it a shot, it isnt complex - use 'Improve question' and add at the bottom what you think it is doing - start at the
int main() {}
block of code....We'll then help and comment - else it looks like we're doing your homework for you
btw, I reformatted your code and added some spaces, I didnt fix the typing errors
Garth J Lancaster 18-Jun-20 3:44am View
+5, nice
Garth J Lancaster 16-Jun-20 8:22am View
I'm pretty sure I answered you question "Hi I want to push data in to datadog API, I have datadog API key but don't know how to send data from my window service in c#" ... if you want now to do a GET to receive data, you need to change some of the code

httpWebRequest.Method = "POST";

using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
    string json = "{...your event data here...}";


Then you'll need to read trhe DataDog API link, and see how to format the request - ie this "" will be different
Garth J Lancaster 15-Jun-20 9:03am View
+5 Maciej
Garth J Lancaster 15-Jun-20 3:41am View
surely if "might be used in a commercial product" then you can get a trial ITextSharp license and test that (ITextSharp is the only product I know capable of doing this in C#) .. Once it becomes a commercial reality you can then negotiate and pay for a license
Garth J Lancaster 15-Jun-20 1:30am View
I think you should modify (use 'Improve question') your question and give a few more details- eg, 'which' DB server are you using, MySql, SQL Server etc, Maybe 'abridged' schemas etc. It is very hard for 'us out here' to give you an answer based on what you have so far.

I could say 'indexing'/partitioning and/or creating views over your data as a very general technique but likely wrong approach because there isnt enough information in what you have supplied to refine an answer
Garth J Lancaster 12-Jun-20 19:25pm View
It seems to me your query should be
SELECT to From Flights WHERE fino = 1
... the Flights table does not have 'flno' and 'tod' columns in the above definition, unless to->tod and fino->flno are just 'typos'
Garth J Lancaster 10-Jun-20 1:01am View
I would have thought this question would be more appropriately directed towards the manufacturers of the device itself - do they not provide an API / SDK etc ?

You don't even say what the device is, so expecting us to guess is a waste of time
Garth J Lancaster 9-Jun-20 22:54pm View
"but nothing special so far." really - that is a pretty useless comment, it tells us nothing about what difficulties you had - as Richard pointed out, it's in the documentation - in particular, you can issue a GET for /api/tunnels to your ngrok instance, it it would respond with the JSON below .. it's a pretty simple task to whip up a C# HttpRequest to handle this ...
{  "tunnels": [      {          "name": "command_line",          "uri": "/api/tunnels/command_line",          "public_url": "",          "proto": "https",          "config": {              "addr": "localhost:80",              "inspect": true,          },          "metrics": {              "conns": {                  "count": 0,                  "gauge": 0,                  "rate1": 0,                  "rate5": 0,                  "rate15": 0,                  "p50": 0,                  "p90": 0,                  "p95": 0,                  "p99": 0              },              "http": {                  "count": 0,                  "rate1": 0,                  "rate5": 0,                  "rate15": 0,                  "p50": 0,                  "p90": 0,                  "p95": 0,                  "p99": 0              }          }      },      ...  ],  "uri": "/api/tunnels"}
Garth J Lancaster 9-Jun-20 9:42am View
you're joking, right ? - you have to put the code somewhere, and to repeat it in all the existing methods is not good programming style

you've been given good help so far - if you dont understand you need to get help from your tutor, lecturer, teacher, textbook etc you dont seem to be interested in applying yourself fully, we can only help you so far
Garth J Lancaster 9-Jun-20 3:54am View
That's worth a +5 - pity it's only a comment - is my frustration with these questions showing ?
Garth J Lancaster 9-Jun-20 3:46am View
Ok - I would add a HashTable/Dictionary to the DistinctWords Class

Hashtable<string, integer> words;

And Inititialise it in the DistinctWords Constructor

words = new Hashtable<string, integer>();

That will hold each word, and a count how may times it occurs

Then I would add a method for example loadWordsFromFile() That populates the words array with words and counts - you will need to open the file using this.filename, read each line as a string, then split the string into words, maybe based on a space character as the delimeter. For each word, check if it exists in words HashTable, if it doesnt, add it with count 1, else increase the count.

To each of count_distinct_words, count_total_words... methods, add a check to see if the HashTable words has any entries, if not, call loadWordsFromFile().

count_distinct_words, count_total_words can then be filled out by looking at the number of entries in the words HashTable, or summing the Counts of all the Words (The Integer part) aka values of the HashTable.

Then refine this for checking if the words are correct
Garth J Lancaster 9-Jun-20 2:12am View
REGEX .. Regular Expressions - to resize an image ? Interesting approach, It would not have been my first choice of tools, depending on what you actually mean - good luck
Garth J Lancaster 9-Jun-20 2:12am View
REGEX .. Regular Expressions - to resize an image ? Interesting approach, It would not have been my first choice of tools, depending on what you actually mean - good luck
Garth J Lancaster 5-Jun-20 1:07am View
How about you use 'Improve question' and add the last script that you were trying, and where you think the issue may be - else it just looks like you're asking us to write all your code for you - a homework type question. No code = no help unfortunately
Garth J Lancaster 4-Jun-20 5:53am View
What you have tried ... ok - but the code you present doesnt explain the error message "NotSupportedException: The URI prefix is not recognized." .. where/how are you setting up a ?WebRequest ? .. it may be a good idea to use 'Improve question' and show that code, too
Garth J Lancaster 4-Jun-20 4:41am View
I think you need to improve your question a little - for instance, why is TEAM2 the Team for Karl here "KARL|TEAM2|2|3|5" ? - ok, it appears to be the last team Karl was in by date or the Max by date ..

Right now I can't see a single query that would do as you ask, I can think of getting a distinct list of names & last team name by date, then using a cursor to iterate through the records for a team member to build the points & dates sections

btw - wtf is 'transponation' ? do you mean 'transposition' perhaps ?
Garth J Lancaster 4-Jun-20 4:10am View
This looks like homework - we don't do people's homework for them. You say 'not giving any output' .. ok, why don't you update your question (use 'Improve Question') with some data samples for each table, then show the SQL queries you tried - that way 'we' may be able to assist you .. else, we only have your word that you've tried
Garth J Lancaster 4-Jun-20 1:43am View
since you provide so little information it really isnt easy to help you - I could say 'indexes' or 'tuning' or all sorts of things. but with so little info they'd all be guesses .. why don't you use 'improve question' and outline your db/table structure, show what code you're using etc
Garth J Lancaster 28-May-20 9:50am View
you could up until Vista (and I should know, I did it for two companies) - then the ability to write a custom 'GINA' was removed - so your answer is correct :-)
Garth J Lancaster 27-May-20 1:59am View
sorry, I don't know what's going on there - I dont know how 'simply' adding the missing return View(model); statement to fix the first error can cause that .. btw, the first level refactor of your Create I would
public async Task<IActionResult> Create(int id, int type)
        InsuranceViewModel model;
        ViewBag.Type = type;

        var companies = await _context.InsuranceCompany
            .Where(e => e.IsActive)
        ViewData["CompanyList"] = new SelectList(companies, "Id", "CompanyName");

        switch ((InsuranceType)type)
            case InsuranceType.Body:
                model = await insuranceTypeBodyCreate(id, type);
            case InsuranceType.ThirdPart:
                model = await insuranceTypeThirdPartCreate(id, type);
		// Throw An Exception ?

        return View(model);

Which needs two new functions insuranceTypeBodyCreate(id, type); & insuranceTypeThirdPartCreate(id, type); and I'm sure the logic in each of those for not null vs null could be made 'nicer'
Garth J Lancaster 27-May-20 0:16am View
Well, first thing is always to make it work .. add the missing
return View(model); 
so the top block has it, ie
        if ((InsuranceType)type == InsuranceType.Body)
            var bodyInsurance = await _context.BodyInsurance
           .Include(e => e.InsuranceCompany)
           .FirstOrDefaultAsync(e => e.Id == id);

            if (bodyInsurance == null)
            return View(model);    // Missing return !!!!
and leave the rest of the code for now. I'll post back later with a cleaner option
Garth J Lancaster 26-May-20 21:17pm View
I did say it was rough and needed a bit more work, we are not supposed to do all your work for you ... colValue is the bit that you need to fill in, since you didnt really explain 'results in one string' .. you could, for example
using SqlCommand cmd = new SqlCommand("select field from table where value = @Value", maConn);                {                    
  SqlParameter param = new SqlParameter();                    
  param.ParameterName = "@Value";                    
  param.Value = aplSymbol;  // your actual value here                     
  using SqlDataReader reader = cmd.ExecuteReader();                    
    StringBuilder colStr = new StringBuilder("");                        
    while (reader.Read())                        
      string colValue = reader["Column/Field Name"].ToString();                         
    return colStr.ToString();                    

to get a comma separated list of values as a string, and then remove the last
return colValue;
shown in the major block of code.

It's up to you though, to adequately define the problem and what you need
Garth J Lancaster 26-May-20 7:56am View
well, we can't help you to fix what we can't see - we dont read minds/remote code ... why dont you modify your question (use 'Improve question') and post the RELEVANT code
Garth J Lancaster 26-May-20 7:15am View
I posted the solution, but the OP has probably lost interest, as sooo many do
Garth J Lancaster 26-May-20 6:28am View
sure, but your code style is horrible - if I were reviewing this it would fail
Garth J Lancaster 26-May-20 1:10am View
I think I understand that you want everyone to do your work for you. Put a button on your form, look at the button's events, select the ? 'Click(ed) Event, assign a handler to it, then fill out the handler with the code from above.
Garth J Lancaster 25-May-20 0:57am View
What - you want me to write it for you ? .. er, no - 1) if you're a student then you have to assume you lecturers are watching, and we wouldnt be doing you any favour by cheating for you, or 'the industry' a favour if you had to work with one of us in the future 2) if you're being paid to do this then you're in a better position than many, myself included, having been 'hibernated' thanks to Covid-19 ...

- looking at the first link I supplied, there was this

private static void ExportPDF<TSource>(IList<TSource> customerList,string[] columns, string filePath)
    Font headerFont = FontFactory.GetFont("Verdana", 10, Color.WHITE);
    Font rowfont = FontFactory.GetFont("Verdana", 10, Color.BLUE);
    Document document = new Document(PageSize.A4);
    PdfWriter writer = PdfWriter.GetInstance(document, 
               new FileStream(filePath, FileMode.OpenOrCreate));
    PdfPTable table = new PdfPTable(columns.Length);
    foreach (var column in columns)
        PdfPCell cell = new PdfPCell(new Phrase(column, headerFont));
        cell.BackgroundColor = Color.BLACK;
    foreach (var item in customerList)
        foreach (var column in columns)
            string value = item.GetType().GetProperty(column).GetValue(item).ToString();
            PdfPCell cell5 = new PdfPCell(new Phrase(value, rowfont));

that's a good start
Garth J Lancaster 23-May-20 9:30am View
so far you've asked 2 prior questions, and your work has been done for you /// why don't you try yourself, and post some actual code - you might wish to start by reading and
Garth J Lancaster 22-May-20 2:06am View
bvgger ! where's that hidden camera ;-) .. now you're awake I'll just quit for the day
Garth J Lancaster 18-May-20 0:02am View
It seems like a scoping issue - if you've declared your 'doc' instance local to another handler or such .. you really need to declare it somewhere 'global', so it can be 'loaded' ? Imported in your terms in one handler, then Exported by the handler you're working on ... there's usually a spot somewhere within a WinForms app you can declare such, but Im on a Mac at the moment without Visual Studio, so cant check....
Garth J Lancaster 17-May-20 2:43am View
:face-palm: .. and there's the reason I only gave the notes I did.. ok, thanks, I'll see how much further I can take him
Garth J Lancaster 15-May-20 19:40pm View
why 'nothing helpful so far' - that article said "To use LDAP with Oracle you have to set up a separate database with Oracle Internet Identity Management repository. " - did you do this, what was the result or why is it not helpful ?

Please consider updating your question with more relevant information

We can't read your mind, computer etc to see the results - does this have any useable info ?
Garth J Lancaster 14-May-20 10:10am View
cheers :-)
Garth J Lancaster 14-May-20 10:10am View
ta - Rick had an answer along the lines of the keypress event as well, so he does deserve some credit - the OP's fooling around anyway, so I'm packing up my crayons
Garth J Lancaster 14-May-20 10:08am View
I'm sorry - I answered the question you asked - you haven't shown any work you've done or actually done any work, you've just changed the requirements - I think you should go back to your teacher/whatever and ask for more help
Garth J Lancaster 14-May-20 8:22am View
not sure what you mean 'loop' - there is no loop - you enter digits into the textbox, push the enter key, and then those digits ie number get added to the listbox (nb, you should validate that the value in textbox1 is actually a number ... I've modified my original answer taking VB6 into account at point 6, but it will still require work from you to fill in the blanks etc
Garth J Lancaster 13-May-20 2:04am View
Have a '5' :-)
Garth J Lancaster 6-May-20 5:37am View
ok - well, I guess it depends on how accurate Geolocation etc is where you are or in the 23 countries - if it is accurate at least to the geographical 'boundary' - eg Country or 'Region', then, why don't you create your own database for the language component - that mitigates any concerns over security/safety etc
Garth J Lancaster 6-May-20 4:32am View
yes, I am anti automatic selecting using Geolocation/IP address - by the data I showed, I should be speaking Novocastrian - what if the example was based on Belgium (ignoring that people could speak more than one language) - how would you pick from potentially French, Flemish ? I'll ignore personal experience that says when buying chocolate in Belgium they speak English and Money
Garth J Lancaster 5-May-20 2:40am View
;-) yes - I guess if a person can construct a for loop they should be able to figure it out - I was trying to suggest a 'simple' path from a known result
Garth J Lancaster 4-May-20 8:53am View
How many records do you receive at once ? your 'sample' suggests three (3), but can you receive 1000, 10,000 etc ?

Are these 'lines' in a file or a buffer of size <n>
Garth J Lancaster 28-Apr-20 5:39am View
I don't honestly know - btw this might help as well

ok, so, what I would do at program start, is load and compile all the rules/expressions and store them pre-compiled maybe in a hash/dictionary, thus decreasing the time for the evaluate step. Then on a timed event or whatever, run though the 'rules' with the data

Garth J Lancaster 28-Apr-20 4:16am View
Does the same thing happen if the image/template is on your local machine ? - it would be nice if you could update your question with the minimum amount of code to illustrate the setup
Garth J Lancaster 28-Apr-20 2:18am View
My 'gut feel' is that ApiAppGp is an anonymous type, which as the error suggests, doesn't have AsEnumerable() defined on it - hence the .FirstOrDefault() fails.

As the error message suggests, you could try something line

lastReqName = ApiAppGp.AsEnumerable().FirstOrDefault().LastReqStatusNavigation.Name,

but that still looks/feels wrong. Hopefully someone else will give you a better answer, I dont have time right now to run it up and play with it.
Garth J Lancaster 27-Apr-20 4:45am View
I have to say, looking at your data model, I'd be simplifying it for a REST point of view

regionobject structure:
{region_id : value,
region_name : value,
region_fullname : value,
region_type : valuee
region_misc : value,
projects: [{projectobject},{…}…]}

Would be two data domains,


and then maybe an aggregator that returns a joined 'set'