|
It looks very much like you have a .git in your home folder. Git will check parent folders recursively until it finds one with a .git folder inside it.
|
# ? Jun 5, 2018 10:17 |
|
|
# ? Jun 7, 2024 15:35 |
|
Boris Galerkin posted:I have a question about logging practices. Basically what's the "best practice" placement of logging outputs? Here's a silly example In that example I'd probably put it in do_something, so that the log messages continue to appear when it's called even as the rest of the program is restructured so that where it's called from changes. Although for that sort of "logged every time a function is called" message I prefer to use TRACE over DEBUG if the logging library supports it.
|
# ? Jun 5, 2018 11:29 |
|
Boris Galerkin posted:I have a question about logging practices. Basically what's the "best practice" placement of logging outputs? Here's a silly example If you’re going to rip it out before shipping, why care? If you’re not, be mindful of how chatty libs you maintain are, how often the function is going to be called, and what the logging function does. You don’t want your logs to cause perf or resource issues. If you’re using python, and your logs look like that, look into decorators.
|
# ? Jun 5, 2018 11:56 |
|
Sad Panda posted:Honestly, no idea how to do that either. Is there no way of telling it, the cwd is where you are? When I was running things through Sublime Text it'd work perfectly like that and if I say logging = /logs/audit.log, it'll put it in the logs subdirectory relative to that file. That's weird because /logs/audit.log is not a relative path! That's an absolute path because it beings in a / All I'm suggesting is that you maintain a file - call it settings.py if you want - that's just something like Python code:
Python code:
Note that the __file__ magic doesn't work in the REPL. Or at least didn't used to.
|
# ? Jun 5, 2018 16:43 |
|
Boris Galerkin posted:I have a question about logging practices. Basically what's the "best practice" placement of logging outputs? Here's a silly example I'll do either depending on what I'm trying to accomplish. Putting logging inside the function works well unless the function has multiple exit points and you want to log the same thing regardless of which is taken.
|
# ? Jun 5, 2018 17:15 |
|
robostac posted:It looks very much like you have a .git in your home folder. Git will check parent folders recursively until it finds one with a .git folder inside it. I ended up finding one. No idea how it got there but hopefully that's the problem resolved.
|
# ? Jun 6, 2018 11:14 |
|
This is a VBA question which I am not sure where to ask so I am going to drop it here. I have a code for a stock homework assignment where I need to compare what the market opened up at the start of the year for a certain stock and where it closes. If it was just one stock then that would be simple enough but I need to do this for hundreds of stocks. code:
code:
Hunt11 fucked around with this message at 17:09 on Jun 6, 2018 |
# ? Jun 6, 2018 17:05 |
|
Hunt11 posted:This is a VBA question which I am not sure where to ask so I am going to drop it here. I don't know the answer, but you're more likely to get help if use code tags to format your code. Click the button labeled "bbcode" when you post or edit your post to see instructions on how to do that.
|
# ? Jun 6, 2018 17:08 |
|
Thermopyle posted:I don't know the answer, but you're more likely to get help if use code tags to format your code. Click the button labeled "bbcode" when you post or edit your post to see instructions on how to do that. Just did that and thanks for the advice.
|
# ? Jun 6, 2018 17:10 |
|
It's honestly really hard to parse that without being able to see the spreadsheet it's pulling data from (not that I know VBA anyway, but yknow). A pic of a few rows and the bad results would help! Also what does "not getting any workable results" mean - is the calculation wrong, or is there some kind of error or something? It might help to create some dummy data with only a few entries for a stock, that way you can get a better idea of where it's going wrong. Or if you have a debugger, definitely use that to step through the program and watch what it's doing, and work out if those are the steps you meant
|
# ? Jun 6, 2018 17:32 |
|
Here is a picture with the issue. So the number in the top box is where the market closes at the end of the year so the result for the B ticker should be 12.03. In terms of what is going wrong with my calculation the formula is adding up every number in the F and C column and then subtracting the result.
|
# ? Jun 6, 2018 17:45 |
|
I've got a bunch of boilerplate code I need to generate for a project. If I want to create a new Foo component I've gotcode:
code:
|
# ? Jun 6, 2018 18:13 |
|
Sounds like a Yeoman problem.
|
# ? Jun 6, 2018 19:15 |
|
Hunt11 posted:
I assume it's a string of B ticker results followed by BA tickers, right? Look at where you're putting your results in the summary bit. Where are you getting your data for Total_Change? You said it calculates the year's volume correctly - how are you handling that differently? Spoilered for homework (try and work it out first because coding is 90% staring at a thing that doesn't work going ???) Your volume works because you're keeping a running total for every row in the year. Total_Change needs to do that too, or at least keep track of the year's opening value, or a reference to the cell where it is. Right now you're comparing the opening and close on the last day At least I think that's what you're doing - I don't know the syntax, but from looking it up, the Right(i, 6) stuff takes 6 characters from the right side of i? I don't know what Cells(Right(i, 6)) - Cells(Left(i, 3)).Value is doing. It would usually be Cells(i, 6).Value - Cells(i, 3).Value right to compare on the same row, right? Also you're missing a .Value off the first Cells call if that matters
|
# ? Jun 6, 2018 19:53 |
|
huhu posted:I've got a bunch of boilerplate code I need to generate for a project. If I want to create a new Foo component I've got I wonder if there's a sort of "React CLI"... That's exactly the sort of thing that Angular CLI does.
|
# ? Jun 6, 2018 20:09 |
|
[code] If Cells(i + 1, 1).Value <> Cells(i, 1).Value Then Total_Change = Cells((i, 6)) - Cells((i, 3)).Value Total_Change=0 Range("J" & Summary_Table_Row).Value =Total_Value Total_Change =0 Else Total_Change = Cells(i, 6)) - Cells(i, 3)).Value [code] I realized what I posted was wrong, and this is what I originally used. The issue is that I need to compare the first i,3 in the sequence with the last i,6.
|
# ? Jun 6, 2018 21:01 |
|
Remember that i is the number of the current row youre looking at. When you start a new sequence, you need to store the value of i for that row, so when you get to the end you can compare (i, 6) with (first, 3). Or you can just store the value, so instead of looking up the first cell you can do (i, 6) - openingValue Your code basically runs like this, right code:
|
# ? Jun 6, 2018 23:53 |
|
Is Xamarin still a pile of poo poo? (I asked this question about 5 years ago and the answer was "you bet") I'm mainly interested in Xamarin.Forms Looking for the feasibility to build: App A: - SQLite - Barcode scanning via camera - Rest Calls - Map with light customized markers - Location Services - Everything else just Forms. App B: - Same as above but with - Bluetooth LE connections
|
# ? Jun 8, 2018 03:32 |
|
Anyone got a handy link for working with an external .EXE from within a WPF UI? I had a conversion process for our old files that are MS Access DBs, so the converter must be built as a 32-bit EXE/DLL because of the garbage that is the OLEDB. So i've got to call out to that external EXE and then wait on its completion, right now the solution I have fails sometimes because I try and create the IO tab before the conversion s finished...
|
# ? Jun 8, 2018 22:42 |
|
roadhead posted:Anyone got a handy link for working with an external .EXE from within a WPF UI? I had a conversion process for our old files that are MS Access DBs, so the converter must be built as a 32-bit EXE/DLL because of the garbage that is the OLEDB. If its System.Diagnostics.Process can't you just use an event or something?
|
# ? Jun 9, 2018 07:07 |
|
mystes posted:How are you currently launching the exe that doesn't allow you to deal with this? As in move the part that responds to the finish into an event handler? That sounds interesting I'll try that.
|
# ? Jun 9, 2018 19:37 |
|
roadhead posted:As in move the part that responds to the finish into an event handler? That sounds interesting I'll try that. mystes fucked around with this message at 19:53 on Jun 9, 2018 |
# ? Jun 9, 2018 19:47 |
I need to add logging to my little app, I've read over and over that all logging should be sent to stdout; I agree, our now ex-developers would log directly to disk and this predominantly Windows environment would crash when the C:/ drives filled up. lol ok But how do I capture and save that stdout to disk on a remote logging machine? Closest answer I could find: quote:Standard out is an output stream that can be captured and redirected to a variety of sources. It's generally a best practice, but it is also a more advanced option as it requires server level configuration to capture the stream and redirect it to the desired destination. Is standard out logging primarily for container level deployments? I'm just working with a bunch of Windows VMs here in legacy. Sumologic asks me this:
|
|
# ? Jun 18, 2018 19:16 |
|
A lot of the logging-as-a-service things like reading from log files as they can do it asynchronously on their own time. Syslog is more for the system and HTTP for web clients. I've actually done one project for Sumologic and they explicitly said to dump to a local file. Boost.Log has some nice examples. For the one time I BYOL I used ZeroMQ which I think Loggly uses too. MrMoo fucked around with this message at 19:24 on Jun 18, 2018 |
# ? Jun 18, 2018 19:20 |
|
I need some historical weather data for rainfall. Nothing older than 6 months, hourly would be fantastic, I have the exact GPS coordinates I'm interested in but something county-level/ZIP code would be fine as well. OpenWeatherMap has what I'd need... for $950/month. This is a goof-off thing, I don't really want to pay for it and certainly not that much. Weather Underground is free, but rainfall data is daily. That'll work in a pinch, but I'm curious if someone knows a good source for this kind of data.
|
# ? Jun 19, 2018 02:14 |
|
The national weather service has an api, maybe that will help? https://www.weather.gov/documentation/services-web-api
|
# ? Jun 19, 2018 02:28 |
|
Gosh that's... complete. I can pick a particular station and go digging through the history it seems? But I think I can get what I need with a few queries, start with the GPS coordinate, figure out the grid, go back as far as I need. Thanks!
|
# ? Jun 19, 2018 02:38 |
|
There's also https://darksky.net/dev/docs#time-machine-request which might be simpler and you can do 1000 calls/day for free
|
# ? Jun 19, 2018 15:43 |
|
My General Programming Question is: Is this not the coolest paper?
|
# ? Jun 19, 2018 17:57 |
|
Thermopyle posted:My General Programming Question is: Is this not the coolest paper? It is with high probability the coolest paper.
|
# ? Jun 19, 2018 22:52 |
|
leper khan posted:It is with high probability the coolest paper. made no sense to me, what i want to see is Robert Morris' Spell checker code, It was small, compact and had no dictionary yet it got a 99% hit rate. unfortunately his son became more famous than he did. Edit: found a reference to it The second does not use a dictionary at all (Morris and Cherry 1975). Like the previous method, it divides the text into trigrams, but it creates a table of these, noting how often each one occurs in this particular piece of text. It then goes through the text again calculating an index of peculiarity for each word on the basis of the trigrams it contains. Given pkxie, for instance, it would probably find that this was the only word in the text containing pkx and kxi (and possibly xie too), so it would rate it highly peculiar. The word fairy, by contrast, would get a low rating since fai, air and iry probably all occur elsewhere, perhaps quite often, in the passage being analysed. Having completed its analysis, it draws the user's attention to any words with a high peculiarity index. Like the previous method, it would fail to spot a high proportion of ordinary spelling errors, but it is quite good at spotting typing errors, which is what it was designed for. An advantage that it has over all dictionary-based methods is that it is not tied to English; it will work on passages of, say, French, German or Greek. His Son: https://en.wikipedia.org/wiki/Robert_Tappan_Morris TheresaJayne fucked around with this message at 07:26 on Jun 20, 2018 |
# ? Jun 20, 2018 07:22 |
|
TheresaJayne posted:made no sense to me, what i want to see is Robert Morris' Spell checker code, It was small, compact and had no dictionary yet it got a 99% hit rate. Might be in this paper if you have IEEE access. https://ieeexplore.ieee.org/document/6593963/
|
# ? Jun 20, 2018 18:16 |
|
ulmont posted:Might be in this paper if you have IEEE access.
|
# ? Jun 21, 2018 05:06 |
|
Cross Posting from Stupid Questions thread I'm trying to build a form that will import data in several variables and give them proper case. So for example JANE SMITH run through this code will change to Jane Smith. Likewise, jane smith becomes properly capitalized. print @str.substring($customer.firstname,0,1); print @str.substring(@str.tolower($customer.firstname),1) & " "; print @str.substring($customer.lastname,0,1); print @str.substring(@str.tolower($customer.lastname),1); This works fine. I'm trying to do the same thing for addresses, and those are stored as 123 fake st and I want them to be 123 Fake St The problem is I don't know how long the numerical part of the address is, so I can't just say skip the first three characters, plus a space, and then capitalize like above. So, what I was thinking was to make a loop that would stop at each space and effectively break the line into however many parts the street address is, and then capitalize the first character in each part. But again, I don't recognize this language and I did not find any examples of doing what I want.
|
# ? Jun 22, 2018 14:22 |
|
CzarChasm posted:Cross Posting from Stupid Questions thread What you're looking for in general called a regular expression (regex). In javascript, doing something like: code:
Unfortunately, I don't recognize the language in the file, either. The string concatenation operator is &, which is strange. Do you have more context clues about the language (like, a filename extension)? Also, is the text of the script exactly as in the original file? My best guess from looking at http://rigaux.org/language-study/syntax-across-languages.html#StrngStrnCnct is that it might be awk, based on the names of the methods and sigils present in the variable names. In that case, this might work: https://www.gnu.org/software/gawk/manual/html_node/String-Functions.html
|
# ? Jun 22, 2018 15:03 |
|
Also, most languages (but possibly not the weird one you’re using) will have some sort of capitalize function and that’s what you should be using unless the goal is simply to learn.
|
# ? Jun 22, 2018 15:46 |
|
Usually they have a name like "title casing", or at least that's what C# calls it.
|
# ? Jun 22, 2018 18:16 |
|
I apologize, in my other post I mentioned that I thought it looked like AWK or bash, but it appears to be something proprietary. Thank you all for your help. I'm going to try their support and see what they say.
|
# ? Jun 22, 2018 18:35 |
|
Best/popular coding practice websites/games/apps? OK I have learned C++. Next I get bombarded with "just go code stuff" from every person I ask.
|
# ? Jun 28, 2018 22:20 |
|
|
# ? Jun 7, 2024 15:35 |
|
tricksnake posted:Best/popular coding practice websites/games/apps? OK I have learned C++. Next I get bombarded with "just go code stuff" from every person I ask.
|
# ? Jun 28, 2018 23:27 |