« first day (856 days earlier)      last day (3165 days later) » 

12:00 AM
RELOAD!
There are 1485 unanswered questions (94.4419% answered)
 
Too late
 
12:13 AM
Hooray! I can star again!
2
 
Zak
So ,how was everyone's weekend?
 
Zak
ooh, Kitkat
just found one in my drawer
 
> Next badge: epic 47/50
Still waiting for my socratic
 
Zak
12:29 AM
what's epic for?
 
@Zak Good, I'm writing Python for the first time :D
 
@Zak scoring +200, 50 times
I guess socratic is awarded at tag recalc, in about 75 minutes
 
12:44 AM
bbl
gonna watch a movie
 
wtf... profile/badge summary congratulated me for achieving socratic...
 
Zak
who knows. I guess give it 24 hours?
 
:(
 
Zak
On the plus side. Now that my project is finally "finished", I'll be posting the whole thing for review. Then I'll probably go back to the bits of it I posted as questions and anwer with things I came up with while building the rest of it.
 
12:54 AM
0
Q: check a string for any occurrences of certain character classes

Curt F. You are given a string S. Your task is to find if string S contains: alphanumeric characters, alphabetical characters, digits, lowercase and uppercase characters. Input Format Single line containing, string S. Constraints 0<len(S)<1000 Output Format In First...

 
Damn those PEP8 inspections just won't let you do anything wrong
 
@Phrancis Are you being bad?
Why would you want to go against PEP8?
 
I don't want to, I just do by accident a lot :)
 
Does this code provide result you want? - than it is correct (you may want to post code in this case to CodeReview SE to get comments). If it does not provide results you want - have you debugged it? Also consider existing questions like stackoverflow.com/questions/20638351/… which show existing ways to find row by property. — Alexei Levenkov 15 secs ago
 
1:13 AM
@Phrancis PEP8 is harsh, but helpful :-)
 
2:02 AM
> You've earned the "Socratic" badge (Ask a good question on 100 separate days, and maintain a positive question record).
...and I was right, it's awarded at tag score recalc ...whatever the reason is for that
 
Zak
2:18 AM
Congratulations @Mat'sMug on being only the second CR user ever to earn the Socratic Badge
Also, I'm feeling very happy. I'm going through and manually checking my Reports against our financial records. About halfway through and matching perfectly so far :)
 
0
Q: Cron job that sends an email

EkinThe following is a sample cron job I've written that sends an email with some conditions. I haven't run it yet but I'm using another cron job (and will rewrite very soon) that does the same thing but written using mysqli_query, mysqli_fetch_assoc, mysqli_fetch_array, mysqli_error instead. Whic...

 
@Zak thanks!
 
2:33 AM
@Zak The joy of successful sanity checks :)
 
0
Q: Properties and tryparse

TimI have a class with 3 properties, and I would like to know how I can write my code better. I want to use Single.TryParse so that if any token is unknown string, I could still get 0. But using this method, I need to use a temp variable, and as my properties list increases, I will have more temp va...

0
Q: Battleship algorithm

Sam SanchezIm looking to improve my search algorithm in my battleship game. Code is not perfect but would appreciate any suggestions or recommendations. Running the simulation using a 100x100 grid (10,000 possible locations) Im averaging ~30% accuracy. Games played 500 Average = 0.31108 Im using a fo...

 
3:02 AM
Hello
 
Hey @EthanBierlein.
 
Zak
@Phrancis Aye. On the one hand, I've been checking of numbers for 2 hours now. On the plus side though, everything is checking out
And since this is the company's financials, accounts, the Advisers' commission (upon which their bonus is determined) and the basis of their performance evaluations, checking everything thoroughly really isn't that much to ask.
 
3:19 AM
@Zak Hear ya. When are you planning on eventually moving all this stuff to a database, so you don't have to rely on Excel so much?
 
Zak
@Phrancis Just as soon as the company gives me authority over how we structure our Financial reporting (I.E. never)
Once I'm comfortable working with databases, I can get the data from Excel into a DB and work on it from there, but I can't change the fact that it's all in Excel in the first place.
 
Well, you could still just import your Excel sheets into Access, you'd at least benefit in performance doing calculations and such over Excel
 
Zak
Yeah. And something like 80-90% of this project was just getting all the data aggregated, formatted, and cleaned up.
Actually allocating it was about 5%
and visual formatting another 5
 
Oh wow.
 
Zak
Let me put it this way
The Overarching Sub Calls eleven other subs
The first 7 involve finding the data, getting it into arrays, Filtering it, aggregating it and cleaning up non-standard data
One for allocating each aspect of the data (which would be where it goes into a DB)
and then 3 very similar macros for displaying that data in different formats
 
3:26 AM
That's crazy
I guess the source data is just that bad eh?
 
Zak
The thing is, it's really not
1 sec
To be clear, this data has been anonymised / randomised
That's a section of one of the 9 sheets
They're very detailed, and they've worked very effectively fir this company for years
The problem is mainly that I need to be 100% accurate
So there's a lot of overhead involved in making sure that either all the data is there, in a format the macro understands, or it will fail.
 
Wow that does seem quite detailed
@Zak I can see that, sounds like you've been quite thorough
 
Zak
35 columns * 1,300 rows across 9 sheets
with different column layouts
@Phrancis yes
On the plus side
 
Does each sheet have 1.3K rows?
 
Zak
No (Thank god)
 
3:36 AM
lol
 
Zak
That's the overall total
1,183 to be exact
Anyway, on the plus side, I've now spent 3 hours manually checking my output against the raw data, and it's 100% match so far
 
Awesome
 
Zak
IT is :)
 
Goodnight
 
Zak
'nite
 
3:39 AM
Later @EthanBierlein
 
Zak
I've got 1 sheet left to cross-reference
then it's onto Stres--testing the error-handling
 
What do you use to cross-ref, if I might ask? I'm curious, as I have used databases as well as Excel's VLOOKUP function to xref, but not ever in VBA
 
Zak
I just copy-pasted the relevant columns from the sheets together
Sorted by Adviser/Date
then did some sum() functions
and checked that the numbers matched what my MAcro spat out
 
Ah ok, manual xref; I thought you were automating that
 
Zak
nah. At some point, gotta actually check it by hand
 
3:42 AM
(perhaps you've done that already, it sounds like)
Yeah agreed
 
Zak
just ot be absolutely certain
 
Only thing worse than bad code is bad data produced by said code
 
Zak
Sometimes, that's the hardest bug to find :)
 
^^
Dude, I'm liking this Python more and more
 
Zak
Python?
 
3:47 AM
The language
34 LOC for a script that would be much, much longer in practically any other language
 
Zak
Awesome :)
Python is on my list of potential languages to learn next.
Mainly for heavy-duty Maths/Analysis type stuff
 
I've heard R is good for analysis.
And FORTRAN.
 
Zak
Also, my Output is officially a 100% Match with our financial records :)
2
YAAAAAAAAAY!
 
Starred because I know the feeling.
 
Zak
it was nerve-racking right up until the end :)
 
3:56 AM
What's even better is the feeling when you get 100% on a paper you had a lot of trouble on, and need to score high to get an A in the class.
 
Zak
But it's officially done. Over. Meeting all specifications. Going above and beyond requirements. Refactored extensively. Easily extendable. Designed to handle future use-cases. Easily configurable.
 
@Hosch250 ++
 
@Zak Until you move it to a database.
 
Zak
And it only took an entire month :)
 
@Zak Super big kudos. I hope your employer is as happy with it as you are (which they should)
 
3:58 AM
Wow. Why didn't you write a program to test it all for you?
 
Zak
I certainly hope so.
 
Oh, you were writing a program, not manually testing data.
 
Zak
@Hosch250 Because at some point, it needs to be checked against results that weren't produced by MAcro
 
(Sometimes I miss things...)
 
Zak
@Hosch250 :)
 
3:59 AM
@Zak :(
 
Zak
Right. I have about 3 hours until anybody else turns up for today. I think this means a well-deserved break :)
And hot chocolate
And a Bagel
 
You mean you came in early to do this?
 
Zak
@Hosch250 Yep.
 
I'd be working on a personal project - if I was even up at all.
 
Zak
Well, our Director of Finance is in this morning
And it was so nearly finished
 
4:00 AM
And you wanted to get it done.
Good job.
 
Zak
that I decided to just come in early, take 5 hours and get it all done.
 
Given the time I go to bed, coming in 5 hours early would basically be pulling an all-nighter for me.
And I'd be useless the rest of the day.
 
Zak
This basically was. My sleeping pattern got distinctly out-of-sync ver the weekend
Woke up sunday afternoon
 
if zak == achiever:
    if employer == grateful:
        zak += recognition
 
@Phrancis That is NOT how you do that.
 
4:02 AM
LOL
 
if zak == achiever and employer == grateful:
    zak += recognition
 
Um, right ;)
 
Right, right.
 
Zak
Plus, on a good timing note. The MD's been on holiday for the last month. Gets back tomorrow
 
You've got to watch your nesting and logic gates (or lack thereof on either).
 
Zak
4:04 AM
So I can present him with a shiny new report generator when he gets back in
 
@Phrancis Now you need to go turn those 34 lines into 30 or so.
 
Zak
I think I may go do some revision now
 
@Zak You should put an Easter egg in it.
 
@Hosch250 I'm actually thinking of extracting some functions that could be useful generally into their own classes
 
@Phrancis Not a bad idea.
 
Zak
4:06 AM
I've got 120 pages of European Financial Regulation to become intimately acquainted with. Joy oh joy.
 
I've extracted a regex into a RegexUtilityPatterns class so far
 
Zak
@Hosch250 nobody would ever find it
 
OK, I guess it's not really a class, just a file. But yeah it does the job of cleaning up the script
import re

URL_MATCH = re.compile(r"""
    http[s]?://     # Match protocol, secure or not
   (?:[a-zA-Z]     # Match any letter
   |[0-9]          # Match any number
   |[$-_@.&+]      # Match other allowed symbols
   |[!*\(\),]      # Match exclamation, parens, commas
   |(?:%[0-9a-fA-F][0-9a-fA-F])     # percent (%) sign followed by 2-digit hex
   )+              # Match one or more of preceding tokens
   """, re.VERBOSE)
 
Getting ready for bed, see you later.
 
Later!
 
4:10 AM
Huh, comments that aren't evaluated in a multiline string are cool.
 
0
Q: C++ Win32 Message won't display

JekasGI have this Win32 Wrapper code which I got from this website http://www.infernodevelopment.com/c-win32-api-simple-gui-wrapper#YourNewSimpleWinMain I copied most of the stuff and do have a slight idea of how it works. But for some reason as I compiled the code. It doesn't show any popup of the m...

 
@Hosch250 Verbose regex FTW
URL_MATCH = re.compile(r"""
    http[s]?://     # Match protocol, secure or not
   (?:
        [a-zA-Z]        # Match any letter
        |[0-9]          # Match any number
        |[$-_@.&+]      # Match other allowed symbols
        |[!*\(\),]      # Match exclamation, parens, commas
        |(?:
            %[0-9a-fA-F][0-9a-fA-F]  # percent (%) sign followed by 2-digit hex
        )
   )
   +  # Match one or more of preceding tokens
   """, re.VERBOSE)
Just tweaked it a bit more :)
I've only seen that in Python and Groovy, so far. I'm sure other languages support those too, or I hope anyways.
 
I'm voting to close this question as off-topic because it belongs to codereview.stackexchange.comShiva 27 secs ago
@Shiva Why do you think this is a code review question? — torazaburo 59 secs ago
@torazaburo See codereview.stackexchange.com/tour and search for "Ask about..." . Don't you see "Performance" listed in there? — Shiva 57 secs ago
yes, but this question is not asking for a Code Review, or asking for a performance tune-up. It's asking why one method is significantly faster than another, which is definitely the purview of SO. — Zak 13 secs ago
Questions asking for an explanation of code (which this is) are off topic on Code Review. — Phrancis 58 secs ago
 
Zak
4:28 AM
Right. Report attached and sent to the directors (no harm in letting them know I'm here 5 hours early ^^ )
now, for breakfast. And coffee. And hot chocolate. And a Bagel.
BBL
 
Enjoy
Hmm, why do I need to call test_list as an argument to its own method for it to work?
class ListOfFilesInDirectoryWithExtension(object):

    def __init__(self, directory, extension=""):
        self.directory = directory
        self.extension = extension

    @staticmethod
    def print_directory(self):
        print self.directory
        print self.extension

test_list = ListOfFilesInDirectoryWithExtension("hello", "world")

test_list.print_directory(test_list)
 
I don't think you do have to.
 
test_list.print_directory()  # TypeError: print_directory() takes exactly 1 argument (0 given)
 
board.move(player, move[i-1], move[i])
def move(self, player, from_coords, to_coords):
You must be doing something wrong.
 
Apparently
 
4:40 AM
@Phrancis Oh, it is a static method.
Remove that attribute.
 
The static method flag?
 
Static methods are not tied to a class instance - they are supposed to be able to be used and always work the same regardless of which class they belong to.
Yeah.
 
Oh
 
Static methods don't take the self argument.
@staticmethod
def start_rows(player):
 
There we go, thanks a lot @Hosch250
 
4:43 AM
No first posts yet. There'll probably be a zillion as soon as I close my browser.
 
Holy carp, it works
 
What did you expect?
in The Whiteboard, 12 secs ago, by Hosch250
Free flags/close votes all over the front page, everyone.
 
I think I've overdone it again
thanks! a very nice approach i dint think of! and thanks for all the tips! :) — Tim 5 mins ago
 
@Hosch250 If I write the code, "it works" is the last thing I expect.
2
 
@Mat'sMug This isn't worth an answer by itself.
But, on that question you just answered, Single.TryParse is the same as float.TryParse.
 
4:52 AM
yes.. darn, it occurred to me, but I forgot to mention it
 
Just edit it.
 
well I implicitly mention it:
var success = float.TryParse(value, out dop);
 
def __init__ is basically a constructor, right?
 
@Phrancis I believe so.
@Mat'sMug Did you see my latest question?
 
I don't think so
 
4:54 AM
Mind if I ask you a couple questions about it before I leave?
 
which one is it?
 
3
Q: Remove Empty Argument Lists from Attributes

Hosch250I converted a C# analyzer for removing empty argument lists from attributes to be a C# and VB.NET analyzer: public override void Initialize(AnalysisContext context) { context.RegisterSyntaxNodeAction(AnalyzeSymbol, Microsoft.CodeAnalysis.CSharp.SyntaxKind.Attribute); } private void AnalyzeS...

To start with, I originally had that split into two methods, one for C# and one for VB.NET.
And the only thing different in the two methods was the name and the first variable type (VisualBasic.Syntax... instead of CSharp.Syntax...)
So, I changed it into what is in the question.
So, I asked a question on Programmers, and got this answer: programmers.stackexchange.com/a/296582/113093
That answer seems to suggest I should split it apart and keep the languages sort of "siloed" because they are liable (if unlikely) to change at any time, and they just aren't related because they are two separate languages.
At least, that is my interpretation of it.
So, I am thoroughly confused over this.
 
I agree they should be separated
but I also agree this isn't DRY:
 
OK. I'll revert it (or rather, I was doing this in a different branch).
 
var csAttributeExpression = context.Node as Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntax;
var vbAttributeExpression = context.Node as Microsoft.CodeAnalysis.VisualBasic.Syntax.AttributeSyntax;
 
5:02 AM
private void AnalyzeCSharpSymbol(SyntaxNodeAnalysisContext context)
{
    var attributeExpression = context.Node as Microsoft.CodeAnalysis.CSharp.Syntax.AttributeSyntax;

    if (attributeExpression?.ArgumentList == null || attributeExpression.ArgumentList.Arguments.Any())
    {
        return;
    }

    context.ReportDiagnostic(Diagnostic.Create(Rule, attributeExpression.GetLocation()));
}

private void AnalyzeVisualBasicSymbol(SyntaxNodeAnalysisContext context)
{
    var attributeExpression = context.Node as Microsoft.CodeAnalysis.VisualBasic.Syntax.AttributeSyntax;
That is my original code.
 
why not make two separate classes?
 
You mean, two analyzers?
I could do that, but that is even less DRY.
And I think I would need two Code Fixes then too.
 
so wait a minute, I'm writing C# code, and I'm using VSDiagnostics, and the thing is running a bunch of checks to see if I'm not writing VB code?
 
No.
It fires the analyzer if your code is on a certain node type.
So, if you are in C#, it will only fire for C# nodes.
If you are in VB.NET, it will fire for VB.NET nodes.
 
yes, I know the node will only be for the language you're analyzing...
but who's calling AnalyzeCSharpSymbol?
who's calling AnalyzeVisualBasicSymbol?
 
5:07 AM
Not me. Roslyn is somewhere deep in the bowels of the compiler, or something.
 
Roslyn is the compiler
 
Well, I'm not calling it.
This is where it is set up:
 
Monking
 
public override void Initialize(AnalysisContext context)
{
    context.RegisterSyntaxNodeAction(AnalyzeSymbol, Microsoft.CodeAnalysis.CSharp.SyntaxKind.Attribute);
}
@Heslacher Monking.
 
heya
 
5:08 AM
(BTW, I should see of my mom won't let me send a pen out of the country to you guys.)
(You've earned it.)
I should go to bed now. I'll be back to discuss this sometime next week, if nothing unforeseen happens in the form of school, car accidents, or viruses.
 
Zak
'nite
I think I may go have a nap myself
got a good 2 hours before anyone else turns up for the day
 
Zak
5:30 AM
Seems like a nap just isn't going to happen
 
5:44 AM
NVM, @Mat'sMug, I realized the code in my question was thoroughly broken anyway.
I'll update it tomorrow.
 
@Hosch250 I just wrote an answer pointing that out !
 
Zak
5:59 AM
And now I'm back to data-mining Corporate records again. Hopefully, with the aid of some proper benchmarking, I can get it down to a reasonable runtime.
 
6:13 AM
@Zak How long is "reasonable"?
 
Zak
Well, put it this way. If I could trust excel not to crash halfway through due to memory overload or something similar. It could filter all this data in about 300 hours of run-time.
I'll be happy if I can get it down to about 24
And I'd be okay with getting it down to 50
But, reading through code I wrote 6 months ago, I've decided the first order of business should be to re-write the whole thing from scratch :)
 
6:31 AM
@Zak Performance is not listed anywhere on SO FAQ / Tour, whereas it is, on codereview.stackexchange, so how are you saying "definitely the purview of SO"? Still not convinced. Show me how this fits into SO. — Shiva 20 secs ago
BEcause they're not asking for performance help as such, they're saying "Function A is faster than Function B, why?". Which is all about how those functions actually work. Which is a SO-type question. I can tell you right now, this question would be immediately closed as off-topic on Code Review. We don't do code explanations. — Zak 42 secs ago
 
@Zak 300 hours!?
2
 
Zak
It's something like 10 Million Financial Records
Provided as HTML conversions of XBRL files
With inconsistent formatting
 
Wait, the financial records are provided as HTML?
 
Zak
like this
 
WOW...
Is it valid XHTML, at least?
 
Zak
6:43 AM
courtesy of Companies House
 
(i.e., valid XML)
 
Zak
I have no idea. I know there's occasionally an XML file in there with the HTML ones (maybe 1%?)
 
Any chance you could put one on pastebin? (removing company data of course)
 
Zak
Don't have t, they're all public records
 
If it's valid XML, you might have some really interesting options
 
Zak
6:45 AM
If you really want, you can download the whole lot yourself rom that link :)
but I'll put one up
 
Well, just one will do ;p
 
Zak
I don't think you really want to download 200,000 at a time
It doesn't help that there's at least half a dozen "standard" formats for these disclosures
And that because they're converted files, there's often weird formatting (headers in different columns, merged cells, missed rows etc.)
 
Oh wow, it's not only valid XML, it's actual XML shoved into a HTML file (with some JavaScript for good bad measure)
 
Zak
yep, and I have several million of these to go through
All in all, I think 300 hours is quite an achievement
given that all I have to work with is Excel
 
Are you using any of VBA XML tools?
42
Q: How to parse XML using vba

Devdatta TengsheI work in VBA, and want to parse a string eg <PointN xsi:type='typens:PointN' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xs='http://www.w3.org/2001/XMLSchema'> <X>24.365</X> <Y>78.63</Y> </PointN> and get the X & Y values into two separate integer variables. I'm a...

 
Zak
6:50 AM
I have no idea what those are
 
Then how are you parsing those files? String functions?
 
Zak
I don't think I'm parsing them. I'm literally opening each file, searching for various pointers, searching nearby, grabbing data if I find it, then closing it and moving onto the next one
 
Hmm. Do you know if the stuff that's within <ix:header> is pretty consistent, as far as where the values are in the data structure?
 
Zak
I have no idea what that means
I also have no idea how to work with XML either :)
 
Would be better in Code Review? — Soner Gönül 35 secs ago
 
6:56 AM
Right click a HTML file and look at the page source. Line 116 (in the file you posted) has <ix:header> element
And it closes on line 143
Looks like about 80% of the HTML file is just fluff, like style formatting and such. The actual data makes a fairly small portion of the file
 
Zak
interesting.
 
Which means, if you're using string functions to parse/search the files, chances are you're wasting about 80% of the computer's time looking at garbage
 
Zak
code around line 396, about "cash in hand", that looks like one of the values I'm after
but I've no idea how to read HTML either :)
I think, just for now, I'll stick with my current arrangement. With some decent benchmarking and some experimentation, should be possible to get it down to a reasonable timeframe.
But yes, sometimes I wish work understood the magnitude of the tasks they lay before me
 
I am just trying to speed up the code, i am new to this site so would Code Review be better for me? — Sam 43 secs ago
 
7:05 AM
I took the XML processing instructions at the very top of the file, then added lines 116-143 (along with closing html tag)
And shoved them into an XML formatter, to show the actual structure of the data
 
Zak
Interesting, but the data I'm after is deeper in the structure
(I think)
Quite Specifically, reported levels of Cash, Assets and Profits.
Which can come under about 2 dozen different phrases
 
You see in the file there are elements like <ix:something> right?
<ix:nonFraction contextRef="cfwd_31_12_2013" name="ns5:CashBankInHand" unitRef="GBP" decimals="0" format="ixt2:numdotdecimal" scale="0" xmlns:ix="http://www.xbrl.org/2008/inlineXBRL">10,455</ix:nonFraction>
 
Zak
yes
 
That's the XML data you're looking for, from my understanding
 
0
Q: c# speed up bruteforce

SamI have created a brute-force algorithm class in C# and I was Wondering if I could speed up the process of creating a new string. There is two methods inside the class, one returns the brute-force string and one returns the number of strings created. public class BruteForce { int IntPasswords...

 
Zak
7:09 AM
wait, that's in that pastebin?
 
No, it's in the HTML source, line 396
This attribute: xmlns:ix="http://www.xbrl.org/2008/inlineXBRL" defines the XML namespace ix
 
Zak
I'll be honest, this is getting very confusing very quickly :)
 
That's OK
 
Zak
I'm getting roughly what you're saying
 
HTML (as in, web pages) don't use namespaces in that way. But XML does.
 
Zak
7:11 AM
but (as I guess with any language / structure / format) only in a general sense
 
So, you can deduce that any element with the ix prefix, for instance, uses http://www.xbrl.org/2008/inlineXBRL
And any without, is just plain old HTML that you can very likely disregard
 
Zak
Yep, I took a look at that link, I'm thoroughly overwhelmed at this point :)
 
Alright look at this:
<foo:my-thing id="42">Hello, World!</foo:my-thing>
That's basic data in XML format. my-thing has an attribute id of 42, and a value of Hello, World!
 
Zak
okay
 
And it uses the foo namespace
 
Zak
7:17 AM
okay, so which bits of e.g. that cash snippet from above would be the identifier?
 
That was wrong
 
That being said, StackOverflow is not a forum. Do not post follow-up posts. They do not work here, because a) answers are not being ordered by date (but by number of votes), b) the section below the question is reserved for answers (and though you can answer your own question, this post does not qualify as an answer) and c) we do not like seeing a thread mutate into an interactive code review/debugging session, because that tends to be completely useless for future visitors of the thread. So, for the future, please keep to the "question at the top, answer at the bottom, no followups" style. — Tomalak 56 secs ago
 
The name of the node/element is nonFraction, with the ix namespace. It has several attributes, which you may or may not need. contextRef="cfwd_31_12_2013" seems to be an identifier
And the element contains the value 10,455
Judging from the other data I formatted in that pastebin, it looks like the name attribute is an identifier as well
name="ns5:CashBankInHand"
It can be a bit tricky to reverse-engineer data structures, but in the end, the performance gain you would get would likely be enormous
 
Zak
Most likely. I think, probably, it's not worth it (in the short term). If I can get it down to "Filter in a day" or somewhere close, that'll be more than enough for our needs
 
Sure
XML allows you to "drill down" its nodes so if you know the name/id of the thing you're looking for, it can find it very fast
You'd use a node path just like in a file system, it's a bit verbose to write the code for, but it's vastly faster than doing string searching
3
Q: Excel VBA getting specific node from XML

yoz1234I have an XML file from a URL API (the URL I have not shared since it allows access to secure info). From this file I want to get certain info out. My problem is, once I am in the parent node (eventNode) I want to simply be able to get the data from specific child nodes. For example if eventNod...

 
7:29 AM
-1
Q: Importing Excel file to a database

pocHow should I rewrite an if-return-else condition in the middle of this function? def import_excel_to_database(xls_file_path) q_param = {~~~~} # if exsisted then return or continue the remaining if ImportHistory.where(q_param).exists? return false else ImportHistory.create(q_param...

 
Zak
Thanks, I'll bookmark it and givr it a look later
 
Cool. Hope it helps.
I think the second answer by barrowc is especially good, albeit not accepted for some reason
 
7:49 AM
You seem to be looking for a code review? You could check out CodeReview.SE, but be sure to check out their FAQ though to make sure your question is on topic. — Jeroen 38 secs ago
 
Monking
@CaptainObvious Why does he want to rewrite it anyway?
 

« first day (856 days earlier)      last day (3165 days later) »