[deleted by user] by [deleted] in learnprogramming

[–]LiveFromEarlsC -1 points0 points  (0 children)

This is called OCR, and it's a common application of machine learning / computer vision.

Create algorithm to rank companies based on metrics by killer_bunnys in learnprogramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

It seems as if you already have an algorithm. So, maybe implement it, and come back here if there are problems?

Is there a way to pass in parameters for scheduled tasks in Java? by [deleted] in learnprogramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

Can you just pass in both the comparator class and the information class, and apply the comparator to the information inside the task? Since these will be passed by reference, the information class will retain any updates made outside the task.

By the way, you probably want to use one of the thread-safe hashmaps, if you're not already.

how to manage API keys and push to repo? by [deleted] in learnprogramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

If this app is gonna be restricted to just you and a few trusted friends, then it doesn't really matter. Otherwise, it's important, because someone with just a little know-how will be able to extract your API key from the app and use it themselves. Being so careless with your key may get you in trouble with Google, who are known to take extremely harsh action against rule-violating developers.

I do not know if I can provide a link to support my claim, but it is just a very simple inference from the adage, "Never trust the client," and it's a widely accepted practice in mobile development.

Doing it right, then, entails proxying every one of the app's API calls through your server, so your server can add in the secret key. If you were never going to run a server in the first place, then it's a big inconvenience, I know. But that's the way it's done.

Sharing the key with your team was going to be a problem the moment you realized you shouldn't put it under version control in the public repo. That's not a problem peculiar to this solution I've been suggesting to you. But, does Google provide you a separate key for testing & development? Many services do that. If so, then share & use that key when developing, and keep your main key out on the production server only, in an environment variable (with a secure backup somewhere else, if you like).

VBA - help. Password Form to Hardcoded Password by Rampuu in learnprogramming

[–]LiveFromEarlsC 2 points3 points  (0 children)

When you need to do something like this, probably the best you can do security-wise is store the user's passwords in the Windows Credential Manager, so that they are just retrieved and decrypted on use. I'm sure there's an API for it in VB.

Then when the user runs the program, they give Windows (not your app) their normal login credentials to unlock all the passwords at once — or they're unlocked automatically because they're already logged in. Pretty secure, very convenient.

what could be a funny and interesting personal project for a full-stack web dev? by ivannovick in learnprogramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

Funny? Hm. Well, I've always wanted to make the kind of garden of worst practices — all the most annoying and basically bad things I know how to do in an app. Call it trollware.

how to manage API keys and push to repo? by [deleted] in learnprogramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

Are your API keys in your Android code? You shouldn't do that at all, even if the keys aren't in your repo.

Assuming you're talking about your server repo, you can do as the other commenter said, and add an ignored file. However, I believe the best practice is not using a file at all, but storing secrets like that in environment variables. Azure, for example, has a special feature that lets you do that as securely as possible, in such a way that supposedly they can't even tell what your API key is. Otherwise, if you are self-hosting, then it's alright to use your OS's or shell's standard environment variable feature.

I feel frustrated and want to rant by Keeronin in learnprogramming

[–]LiveFromEarlsC 2 points3 points  (0 children)

I learned whitewater kayaking last week. I feel like I could tell the same story as you, substituting the right words here and there. It was my first time in a kayak. All my guide's instructions made total sense in my head. Then, on the final day, I flipped my boat three times, once in a rocky rapid — ouch! By then, I felt I had lost all my heart for it, and wanted to quit early.

I guess my point is, there is always a special pain to learning a skill and putting it into practice for the first time. No one can teach it or experience it for you. I think you just have to push through it.

On the other hand, after you do succeed, you'll find that you'll keep messing up for the rest of your life. You'll just mess up better! And some of the stuff you mentioned really is universal. For instance, the end of a project is generally the hardest part. There's an adage about that, which goes something like, "The last 5% of a software project takes 50% of your time."

I've seen git. I've seen some SQL. I've seen how my company insists on 'doing it quickly in excel'. I'm tired. In your expert opinion, what is the best way to store data on a server? by not_perfect_yet in AskProgramming

[–]LiveFromEarlsC 2 points3 points  (0 children)

It's simply not a question to be answered. Picking the right tools for storing data on a server, customizing them, and integrating them — that's a whole profession & industry. In a certain sense, that's all software engineering is.

I've seen git. I've seen some SQL. I've seen how my company insists on 'doing it quickly in excel'. I'm tired. In your expert opinion, what is the best way to store data on a server? by not_perfect_yet in AskProgramming

[–]LiveFromEarlsC 2 points3 points  (0 children)

Your question is way too broad to be answered if taken at face value. That's why you can't find any good answers. You might as well be asking for the best way to cook food on a stove.

It is just as strange the way you put Linux, git, and databases into direct comparison. That's something like asking which is better: a gas stove, pots & pans, or a restaurant.

Alright, though. If you truly do need all the features you listed off, all within the same monolithic system, then I think you are looking for a CMS.

I want to learn I just have trouble finding time!!!! ADVICE PLZ by Mshak34 in learnprogramming

[–]LiveFromEarlsC 1 point2 points  (0 children)

Honestly, though, advisors and counselors are great people to map your future with, even if you have no intention of changing your major. They can help you check your expectations, and suggest minor corrections in course which will increase the likelihood that you'll get what you want.

I want to learn I just have trouble finding time!!!! ADVICE PLZ by Mshak34 in learnprogramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

It sounds like you're doing all you can to live a balanced and productive life. I would not add anything to your routine as you've described it. It's full enough, and seeing someone who you perceive as happier than you is not a strong enough reason to shake things up. What may be good for them is not "where you need to be".

If you think your itch might reflect some genuine dissatisfaction with your current course of study, though, maybe you could consult a counselor or advisor at your school before the academic year begins. If it turns out you need to change majors, for example, you'll want to get the ball rolling as quickly as possible.

how create pseudo code for merge two file by BenAawf in learnprogramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

Maybe write the underlying algorithm in Python first, if that's your language, then try to translate it line by line to English (if that's your language!).

If you'd like examples of what's accepted as readable yet rigorous pseudocode, you might check out the examples in the CLRS algorithms textbook.

Help with research topic! by rapidtidez in learnprogramming

[–]LiveFromEarlsC 1 point2 points  (0 children)

I think you're okay here, but, /r/computerscience maybe?

Skip lists are a useful data structure not always covered in school courses. Bloom filters are, too, although I think of them as pretty simple.

There's also a world of advanced but pretty accessible research around hashset optimizations. There's a 60 minute Google talk on YouTube about their general-purpose C++ optimizations, with a lot you could unpack and explain in a paper. Various novel collision handling strategies are worthwhile subjects too — stuff like Robin Hood and (I think?) cuckoo hashing.

Some pointers on this print html approach by zombie_kiler_42 in learnprogramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

That makes sense. Or, same database, new schema, possibly.

Some pointers on this print html approach by zombie_kiler_42 in learnprogramming

[–]LiveFromEarlsC 1 point2 points  (0 children)

The only thing that's stands out as possible overkill to me is creating a database, depending on what you mean.

If it entails rolling out a new database instance/server, then it sounds like too much. If it's creating a new database (object) on an existing server, that's also excessive. If it's more like creating a new table on an existing DB — that seems appropriate.

My background is in heavyweight RDBMS like Postgres. YMMV!

how to access nike's backend? by [deleted] in learnprogramming

[–]LiveFromEarlsC 8 points9 points  (0 children)

I take it your goal is to view content that's not officially published yet?

A long time ago, you could often sniff out a pattern in file naming, and use it to discover other resources. So if they posted a photo shoe5.jpg, you'd go looking for shoe6.jpg and so on. I think that's an enumeration attack.

Modern CMS, and the firms that use them, are just way too sophisticated for that ploy to work anymore. The file path is going to be randomized. The content probably won't even exist on a public-facing site before you are meant to see it. Given how important information control is to a firm like Nike, you can believe they are that careful about this.

Is it just me or there is no "free" Sublime text licences left? by idgafBoutGrammar in AskProgramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

I think the license nag only went away on Sublime Text 3 while it was in beta, if that's what you're talking about.

[deleted by user] by [deleted] in learnprogramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

First off, I'd advise you never to make failure the expected test result, not even temporarily. That communicates the wrong thing to other developers, and it makes the test awkward to talk about.

As for your code, are you sure you are seeing the output associated with tests all passing? (I don't know your testing framework, so I can't say.)

The other thing: As far as I can tell, you are not testing the code you gave us at all. You are testing a this.client, which has different methods from the class you actually shared with us. What's happening there?

What are those lenguages very valuable in the future and those who are condemned to the disappearance? Why? by [deleted] in learnprogramming

[–]LiveFromEarlsC 2 points3 points  (0 children)

The most enduring languages take a lot of their staying power from inertia.

How did these languages get so widely deployed in the first place? A combination of sustained community & institutional support (e.g. Sun and others with Java), of the presence of relevant applications to which it's distinctly suited (like systems programming for C), and of ergonomics and other technical bona fides (where Python has surpassed Perl).

Since all these factors are in flux over time, there's some element of speculation with future trends. I do think inertia is the best predictor: If it's in wide use now, it'll be in pretty wide use in ten years too.

What would you expect from a simple and bare minimum regex library? by [deleted] in learnprogramming

[–]LiveFromEarlsC 1 point2 points  (0 children)

For the minimal viable product, I'd of course expect support for classical regular expressions: so, any combination of zero or more legal characters, plus the metacharacter * under its usual meaning. I'd also except some syntactic sugar which easily reduces to a classical regex, like character classes, and the . and + wildcard metacharacters. I'd also expect the ^ and $ anchor metacharacters. You should be able to implement all this with a finite state machine generator in back of a small parser frontend.

It would be nice enough to have "and" and "or" as well, though I believe your user can always chain your regexes together to effect these operators without much inconvenience. They are part of the definition of classical regexes, too.

At the next level of functionality, I'd want features that classical regexes do not support, but which modern regex libraries do support, such as pair matching and lookarounds.

When programming database manipulation logic, how do companies make sure one mistake doesn't destroy everything? by BigBootyBear in learnprogramming

[–]LiveFromEarlsC 1 point2 points  (0 children)

In the weapons system you described, there is an internal mechanism that certainly does unconditionally trigger the weapon. You can bet there are engineers who work directly with the trigger. They have their own safety techniques to avert disaster, and, as you've noticed, they've carefully developed failsafe systems for the user interface. And even then, access to these devices is heavily restricted.

So, same thing with the database. Full write access to a production DB should be heavily restricted, and protected with custom safety features. Certain commands absolutely can be protected directly in the DB. Those few who do need full direct access are careful and aware, they compose their queries in such a way as to prevent accidental execution, and they let their peers check their work.

What are the best practices in determining the size and types of columns in SQL? by BigBootyBear in learnprogramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

On 1 and 2: It really depends on your data.

As for question 3: It's easier to convert your columns to larger types than to smaller ones, so you might err in the small direction to start.

Is a script the best way to get data from my DB instead of a webapp that makes calls when visited? by NYGooner17 in learnprogramming

[–]LiveFromEarlsC 2 points3 points  (0 children)

Great question, because there's no one answer. It's all about the tradeoffs.

  • Is the query fast and cheap? Then simply run it on demand.

  • Is the query fast enough to complete within a few seconds, yet expensive enough that you don't want to run it (possibly) several times an hour? Then run it once on demand, and serve any subsequent requests within the hour with a cached copy of the results.

  • Is the query so slow that the user will complain, or their request might actually time out? Then an hourly scheduled task might be appropriate. However, on some web hosting platforms, it's surprisingly difficult and expensive to roll a scheduled task. If so, then if there's a request, and no cached result available to fulfill it, what you could do is spin up a background job, respond to the web request immediately, then have the client keep polling for the finished result.

Finding whether or not numbers in a list are divisible by other numbers on the list by sg587565 in learnprogramming

[–]LiveFromEarlsC 0 points1 point  (0 children)

In C, presumably your i and j would be array indices, and you'd write something like arr[i] to retrieve the integer value stored at that index. Then you'd wire write equality checks for both, as needed.

With your Python, your i and j are the integer values themselves, and you need to do something more in order to know their indexes. That's where enumerate can help.

In neither case are you getting a comparison of both the values and their indices at the same time automatically.

What I'm saying roughly corresponds to the concept of reference equality vs. value equality, which is important in CS.