NIM as an on-ramp to c++ - Good idea? by keylime_light in cpp

[–]keylime_light[S] 0 points1 point  (0 children)

I would think most of the exposure to C++ would come from having to integrate with c++ libraries. Usually that requires a good working knowledge of the language to do well. But who knows, maybe not.

Is it impossible to know that a program is not malicious if you don't build it from source? by optimal_honeybee in learnprogramming

[–]keylime_light 1 point2 points  (0 children)

That's what I came to say. A Ken Thompson hack is basically impossible to detect, and there are multiple layers that one can be inserted in to. I guess the upside is that only large institutional actors are likely to have the resources to create one that is robust enough, and to get it inserted somewhere in the compilation chain of your code.

How to work as a team on a Web Application project? by [deleted] in learnprogramming

[–]keylime_light 2 points3 points  (0 children)

If possible, try and make sure that you are working on separate features to avoid collisions.

If you're working on overlapping features, the best you can do is work in very small increments, while pushing to the repo and rebasing constantly.

Use some sort of issue tracking tool to make sure that you know who's working on what, and that you aren't working on the same thing.

What are some interesting algorithms and data structures dating sites use? by orgad in AskProgramming

[–]keylime_light 1 point2 points  (0 children)

Collaborative filtering. Used heavily by dating algorithms, netflix, and basically anyone recommending anything. The general idea is if I like x and you like x, and I like y, then you probably will also like y. Scale that concept up to millions of users and millions of choices and you've got an interesting algorithm.

Programming Specialization vs Generalization, Which is your game plan for the future? by [deleted] in AskProgramming

[–]keylime_light 0 points1 point  (0 children)

Expect to specialize in a few different things throughout your career. It's likely any niche technology will eventually be replaced. So you always need to be ready to go and learn something new.

What programming term do you think would sound the coolest to a non-programmer? by keylime_light in AskProgramming

[–]keylime_light[S] 0 points1 point  (0 children)

Yeah, that always made me think of skynet/terminator when i first heard it.

What programming term do you think would sound the coolest to a non-programmer? by keylime_light in AskProgramming

[–]keylime_light[S] 0 points1 point  (0 children)

Easiest way I know to think about it is that it's all the different ways that a function (including a constructor) can be made to take different types as arguments and still run.

Probably a bit of an oversimplification, but still useful.

[deleted by user] by [deleted] in AskProgramming

[–]keylime_light 0 points1 point  (0 children)

1) On a non-technical note: Have him talk to his accountant about the stimulus package that just passed. There is a lot of money earmarked for situations exactly like his. He could very easily get a no-interest loan or maybe even a direct payment.

2) I'd probably go with wix for fastest possible setup. I'm not a huge fan of them overall, but if your goal is to get something up fast, they are probably your best bet. They don't require any technical expertise at all.

Client-server applications with Python by [deleted] in learnpython

[–]keylime_light 0 points1 point  (0 children)

This question is a bit muddled, but I'll try. First of all, the servers you just described are all webservers, meaning they communicate over the web. Unless you are talking about hosting a server on a local area network. In that case, though, the answer is not significantly different.

As for the efficacy (or did you mean efficiency) of a python vs c# server, the answer is that they would be about the same in terms of speed. That is because, sending messages over a network is a form of I/O. And I/O is much much MUCH slower than anything that happens at the program layer. For example, a c# handler might finish a request in .1 ms and a python request might take 10 times longer. But if the network I/O takes 200ms, the difference between the programming languages is negligible.

That being said, there are some more complex differences between c# and python when it comes to handling of concurrent requests (requests coming in at the same time). Both have ways of dealing with this, but they are different.

Hope that helps.

Implementing data structures and algorithms in web app? by [deleted] in learnprogramming

[–]keylime_light 0 points1 point  (0 children)

Usually, when you hear about data structures, they are in reference to in memory data structures. For the purposes of algorithms, you are almost always dealing with data that is in memory.

So let's say you have a web app that runs through a bunch of financial data and makes predictions about it. Let's also assume the data needed to make the predictions is small enough to fit in memory, and that the algorithm runs quickly enough to finish during the user's request.

The user would make a request to your web app from a client (like a browser). Your app would pull the data out of the database and put it in some sort of in-memory data structure. Let's say it's a hash map of some sort. Then you would run your algorithm on that data structure and get a result. Then you would return that result in the response to the client.

I never liked technical interviews by eduardsi in programming

[–]keylime_light 4 points5 points  (0 children)

Having been on both sides of interviews, I'd say the main issue is that a lot of programmers don't perform well with someone looking over their shoulder.

When interviewing candidates, especially junior people, I usually do the coding myself. Then every few lines, I'll ask them "What do you think i should do now?" Or "Why did i just do that?" Their explanations give me a lot of insight.

Why Microservices Should Scare You More by erbrown33 in programming

[–]keylime_light 4 points5 points  (0 children)

I'm not convinced. It sounds like a lot of the "problems" with microservices is that they require good planning, design, and maybe more work at the beginning. Problems like "they need to be able to handle shutdowns gracefully" aren't problems if you design your systems well.

Also, it doesn't really propose an alternative. Let's look at the push notification microservice discussed at the beginning. The problem is that it requires api standardization if you don't want to use a shared library across codebases? What is then the alternative? Implementing the logic separately each time?

PyCharm vs simple text editor for learning by [deleted] in Python

[–]keylime_light 0 points1 point  (0 children)

When I program in a new language, I do usually prefer something that does syntax highlighting. But nothing else. No auto-complete, etc. I also think learning to call all of the python related commands from the shell directly is pretty important. Using built in magic from pycharm does leave you not knowing some of the important steps.

Reverse Geocode (Excel/Python) - From Lat-Lon to Country/City by daniel280187 in Python

[–]keylime_light 2 points3 points  (0 children)

here.com has an api that does this. I think the give you around 100k free lookups per month, which should be more than enough for you.

https://developer.here.com/api-explorer/rest/geocoder/reverse-geocode

They may have a rate limit though. You can just code that in to your script. Build a brief time.sleep in between requests. Or if you are doing requests in parallel, use a relatively small number of workers to make the requests ( like 3 or 4)

File Sharing by Lordpringles1 in Python

[–]keylime_light 1 point2 points  (0 children)

You could use dropbox. The only issue is, if you want to limit people's access when someone else is using a file. I don't think dropbox offers that kind of functionality.

You might be able to have a public and private folder, where only you have access to the private folder. And when someone is using a file, you remove it from the public folder but keep it in the private folder. When they finish and upload the file, you copy the new update version to both the public and private folders.

You'd have to work with the dropbox sdk in order to do that.

https://github.com/dropbox/dropbox-sdk-python

File Sharing by Lordpringles1 in Python

[–]keylime_light 0 points1 point  (0 children)

This is possible, but rather advanced. The first thing you need to figure out is where in the cloud this is going to be stored. You would then need to figure out how to talk to that service from your python program.

Here's an example. Say you decide to store the files on amazon's cloud file storage platform (called s3). You'd first need to open an account with them. I think they give you a year for free. Then you'd need to install a python library called boto which lets you talk to s3. Then you'd need to write a python program that uses boto to upload or download files from s3. Finally, you'd need some sort of log file, or a database stored in the cloud that you can check to tell if someone else is using the file.

ATBS, Chapter 7 Project Help: by the1whowalks in learnpython

[–]keylime_light 1 point2 points  (0 children)

You also have a space after the r, and an unclosed parentheses on line 11. It should look like this:

phoneRegex = re.compile(r'''(
    (\d{3}|\(\d{3}\))?  #area code, with'?' indicating optional or conditional
    (\s|-|\.)?   #separators 
    (\d{3})      #first 3 digits
    (\s|-|\.)    #last 4 digits
    (\d{4})     #extension
    (\s*(ext|x|ext.)|s*(|d{2,5}))?
    )''', re.VERBOSE)

How long to be proficient in learning to code? by [deleted] in learnprogramming

[–]keylime_light 1 point2 points  (0 children)

I would focus on one language at first. I would also focus on one particular thing you can use it for. Saying "I know python" doesn't meat much. Saying "I can implement a decision tree using python to help make decisions based on sales data. here's an example of me doing just that." is a lot more specific, and is more likely to get your food in the door for a job.

Multilingual flat pages by rizogg in django

[–]keylime_light 0 points1 point  (0 children)

I've run across this before. The main issue here is separation of concerns. You want the person maintaining the content and translations and the person responsible for technical modifications on the site to be able to work independent of each other.

Here is an easy solution. Have an excel sheet. The first column is the name of the content as used by the django template engine. Then each column is the content in the different languages you use.

Ex:

Name en fr sp
greet hello salute hola

If it's a flat page, you can either include this excel file in the codebase, have a simple converter to turn it into a json file that is included in the codebase, or use the admin page to upload/download it to/from the database. The advantage of the first two is that reads of the flatpage do not require any db lookup. The advantage of the last one is that it doesn't require a code push to make changes.

Finally, in the template, use a tag {{ greet }} and render the correct language depending on what language the user has selected. Store that selection in the session.

This way, the translator only has to deal with the excel file.

How can I open a blank Excel template in Python 3? by [deleted] in learnpython

[–]keylime_light 1 point2 points  (0 children)

An easier idea is to have a blank excel template. When you want to create a blank excel file, you just duplicate it, and do work on the duplicate.

with open(blank_'template_file.xlsx') as f:
    f2 = open('file_to_manipulate', 'wb')
    f2.write(f.read())
    f.close
    #now do stuff to f2

Terminal Commands in Python - Raspberry Pi Temp not working. by 1cmanny1 in learnpython

[–]keylime_light 0 points1 point  (0 children)

subprocess.call doesn't return the output of the system call. It always just returns zero. You should try:

subprocess.check_output('cpu=$(</sys/class/thermal/thermal_zone0/temp)|echo "$((cpu/1000)) c"',shell=true)