All Questions
75
questions
-3
votes
1
answer
107
views
Learn a framework on a project, or mix languages between backend services [closed]
I am designing my next project, which will do various domain-specific tasks, but all that will be controlled and used via a generic crud web app.
I have been professionally using Java with Spring for ...
2
votes
1
answer
236
views
In python when is absolutely preferable use a class than a module?
Python is the language I use most in this period.
My background in Java
Before start learning Python I have programmed in Java language. In Java all code is written inside the methods of a class and ...
3
votes
2
answers
292
views
Best approach to microservice shared databse architecture
I have two microservices, one Flask (python) and one Spring (java), they currently share a database. The Flask microservice handles processing json files (~40mb) for each user (could be 100's or 1000'...
20
votes
4
answers
4k
views
How do non-RAII languages free resources during stack unwinding?
C++ features deterministic order of calling destructors up the call stack until the exception is handled somewhere.
To my knowledge, neither Java nor (object oriented) Python provide this. In those ...
-2
votes
1
answer
113
views
What should I use to graphically represent an object's position on a fixed path using python(preferred)?
Consider 2 roads merging into one(This map is supposed to remain fixed). The program will not generate this map. The program will read this map and plot positions on it on its own.
The python program ...
-2
votes
1
answer
104
views
How Uber processes orders?
Lets say you created an order. Since Uber is a very dynamic system, one should constantly check if there are available drivers for you.
If orders are saved as a some collection (e.g. in MySQL table ...
-2
votes
1
answer
978
views
How to make code runnable on open source code editors like Ace Editor?
For my computer science uni project I'm required to build a web application with an integrated code editor. I believe I can just integrate open source editors like Ace Editor.
However, I feel ...
3
votes
2
answers
722
views
What is the best way for transferring large datasets between an old java app and a python app on the network?
I am working on a machine learning project at the moment which requires me to transfer the data from an old Java app(which is also the custodian of the data in current paradigm) to a python service ...
16
votes
6
answers
8k
views
How to implement float hashing with approximate equality
Let's say we have the following Python class (the problem exists in Java just the same with equals and hashCode)
class Temperature:
def __init__(self, degrees):
self.degrees = degrees
...
0
votes
1
answer
208
views
Is Java-like restrictiveness OK Python style?
Good Pythonic style is much looser than Java's uptight restrictiveness:
In Java, good style means private on methods wherever possible, all fields encapsulated, type declarations, defined ...
1
vote
0
answers
107
views
Making java code usable from other programming/scripting language
We are "extending" a product developed by a third party and working with them on that. There's a small problem though. They have some functions (written in java) that they use in their Android mobile ...
-5
votes
5
answers
302
views
I learnt a languge suppose (Java). I also know python. I want to write a simple app. Is there any way to run both language same Time?
I had been learning python and i know Java. if i were to write a simple program, can i write both programming language in one document or compiler?
I got into this problem because if i cannot merge ...
1
vote
1
answer
470
views
Using lambdas to simulate python generators in java
I am currently dealing with an app that has several classes which are used to compare files in various formats (xls, csv, xml, html, pdf...). They are all implementing an interface that is defined ...
0
votes
1
answer
694
views
Why are we using mutable collections but immutable strings
In three popular platforms I'm familar with(.NET, java, python) strings are immutable but lists are by default mutable.
In all languages there is some functional support(linq, streams, list ...
6
votes
2
answers
486
views
What role did hardware improvements have in the development of modern languages (eg Python / Java)?
I'd like to ask about the history of programming languages - specifically, the role of hardware in language development over the past 20-30 years.
I have been reading about the history of Python, and ...
4
votes
2
answers
1k
views
Why do we have mutator methods?
I'm switching from Java to Python and am having trouble understanding the @Property decorator. I realized in OOP languages (such as Java) I don't fully understand the point of mutator methods in the ...
2
votes
2
answers
6k
views
Finding total number of subarrays from given array of numbers with equal elements. Better approach
Given an array of numbers, count the total number of subarrays (consecutive elements) where all elements are equal.
Example: For below array
[1,1,3]
Ans: 4
Below are desired subarrays:
[1], [...
-1
votes
3
answers
172
views
Python -- Class and Object [closed]
I got a question that quite disturbs me a lot and I think it might help a lot if I had an answer to it. So I got this:
class Klasse1:
variable1 = "haha"
class Klasse2:
variable2 = "hoho"
...
-4
votes
3
answers
3k
views
Why different languages have different syntax? [duplicate]
Different programming language always/most of the time use different syntax.
For example take PHP, Java and Python.
In Php & Java semicolons are compulsory at the end of the line, yet Python ...
5
votes
4
answers
1k
views
Legitimate cases of having .equals() behaving inconsistently with .compareTo()?
Java documentation says it's "strongly recommended" to have them behaving consistently.
But are there legitimate cases of java/c#/python/etc Object.equals() method behaving inconsistently with the ...
0
votes
4
answers
2k
views
Identifying user of a webapp
For a small webapp I want to be able to identify a user.
The issue is, if the user cheats in some manner, I want to be able
to forbid him the usage of my application.
I already have done extensive ...
0
votes
1
answer
339
views
How do different technologies connect to form a web stack? [closed]
I am a little confused, is it possible to implement a front end using common languages like html, css and javascript and then do server side processing using a language of your choice, say python or ...
0
votes
1
answer
332
views
Simple unicode application?
I want to create simple language learning applications to help friends in learning languages. A simple Java console application would do the trick, but the Windows console does not seem to handle ...
2
votes
1
answer
414
views
Should I separate a web api from the webserver?
Lets say I'm building a site similar to this or Quora (or some arbitrary blog-like site). I need a real-time component that will be using web-sockets/long-polling to notify the user of new posts, ...
5
votes
2
answers
460
views
Is there a name for the number of values a variable can take? [closed]
For example, a bit or a boolean can be either 0 or 1 so the number 2 is associated with it. Similarly, for a byte which is 8 bits, the maximum number of different assignments would be 2^8.
Is there a ...
1
vote
1
answer
318
views
Pythonic version of Java interfaces
I fully acknowledge that Python and Java are different programming languages and should be used differently. That said, "Program to an interface, not to an implementation" is good language-agnostic ...
10
votes
9
answers
6k
views
Is there any difference learning OOP on different programming languages? [closed]
I want to learn OOP. I know Python and I know very little things about OOP.
But when I search for "learn OOP" in forums I saw a guy saying that "Python is so new that's why you can't learn OOP on ...
0
votes
1
answer
251
views
Why can python webapps keep sessions between restart and not java?
I've used both webapp2 + GAE for python and a number of Java/JEE webapp frameworks. The python WSGI framework could keep users logged in while I redeploy the app while none of the Java web framework ...
-1
votes
1
answer
1k
views
Extracting data from log files
I will be extracting certain bits from log files using regular expressions to filter out bit of data. Initially I was going to do this with Python. I later started to think about the fastest way I can ...
6
votes
3
answers
629
views
From an execution perspective is an interpreter the same as the JVM / or the .net Framework
I've recently started two introductory level courses - one using Python, the other Java.
I've read the answers to this Question but still have difficulty understanding how each ends up with machine ...
5
votes
1
answer
486
views
What kind of problems is an Android beginner likely to encounter in using Scala?
I am a hobbyist programmer who makes and maintains one production system, largely coded in Python, which now has to be ported to Android. I don't know Java at all. However, SL4A in Android makes ...
0
votes
2
answers
475
views
Clarity over Python and Jython
I'm a Java programmer, but I want to program in Jython. I've never coded in Python before, but have been looking through some tutorials and I'm fairly confident I can grasp it.
My question is ...
1
vote
2
answers
1k
views
Languages implemented in Python?
AFAIK, Scala and Clojure are implemented in Java and Java is implemented in C. I suppose that many or most languages are implemented in C, for instance Perl, Python and SQL. I don't know much about ...
4
votes
1
answer
511
views
Web app outgrowing current framework
I have quite a bit of experience with using Django for websites and so when I started a new project I naturally chose to use Django for it. Everything went well for a time but now the application is ...
10
votes
3
answers
5k
views
How to sync clocks over networking for game development?
I'm writing a game that has a lot of time based aspects. I use time to help estimate player positions when the network stalls and packets aren't going through (and the time between packet's being ...
26
votes
6
answers
26k
views
How to solve the problem of nested comments
It appears in not just one language that comments can't be nested. Do you have a good solution for this problem? One workaround in C/C++ and Java is to only use the single-line comment but it becomes ...
2
votes
1
answer
11k
views
Why does gmail use java? Is there really a advantage over something like php or python? [closed]
Note: I know that none of you (probably) work for google, so this is a lot more of a conceptual question.
So yeah, i discovered that Gmail uses java and that got me thinking, Why?
I personally never ...
3
votes
1
answer
2k
views
Is it possible to write a code without class methods, globals, and class variables? [closed]
I'm designing my own programming language for fun, and I'm thinking of making it fully Object-oriented (no statics, no globals, no class variables, no class methods), so I need to find a way to ...
37
votes
9
answers
9k
views
Is the algorithm more important than the programming language?
During the current (2013) Google Code Jam contest, there was a problem that took C++ and Java people 200+ lines of code as compared to Python people that solved the same problem only using 40 lines of ...
5
votes
2
answers
5k
views
Is MVC the optimal pattern to build a RESTful web service?
Not being a Java practitioner, I recently came to learn about the JAX-RS specification and Apache CXF framework. While still wrapping my head around all these things, I also read the this question on ...
3
votes
2
answers
253
views
Do I need to learn python first to understand the part 2 of the book Test Driven development?
It seems like Python is used as a coding language for part 2 of Kent Beck's book Test Driven Development. I have read the first part of that book and started appreciating the value of TDD . First part ...
10
votes
11
answers
16k
views
Do I have to learn html and javascript to create web applications? [closed]
I am an experienced Java programmer, and I want to create a complex web application requiring dynamic pages, drawings, etc (take SO as an example). Do I have to learn javascript/html in order to ...
2
votes
7
answers
2k
views
tips, guidelines, points to remember for rendering professional code? [closed]
I'm talking about giving clients professional looking code. The whole nine yards, everything you hardcore professional highly experienced programmers here probably do when coding freelance or for the ...
5
votes
2
answers
3k
views
How to create contracts in python
I am currently learning Python (from Java) and have a question on contracts.
Example: an application defines an interface that all plugins must implement and then the main application can call it.
...
-1
votes
1
answer
1k
views
Using dot to Access Object Attribute and Proper abstraction
I have been programming in python and Java for quite a number of years and one thing I find myself doing is using the setters and getters from Java in Python but a number of blogs seem to think using ...
1
vote
5
answers
2k
views
Call a script over the network
I have a Python script on a box that I want to call from a Java server, over the network. I know that I can start a server on the Python side and then connect to it from the Java site, but I am trying ...
1
vote
1
answer
1k
views
Reading graph inputs for a programming puzzle and then solving it
I just took a programming competition question and I absolutely bombed it. I had trouble right at the beginning itself from reading the input set. The question was basically a variant of this puzzle ...
3
votes
2
answers
4k
views
Web Services as a Back end [closed]
I am contemplating a direction to take an application. The application is written in PHP which implements a MVC framework.
Some of my clients will require web services. I was thinking even building ...
19
votes
5
answers
37k
views
Why is Python slower than Java but faster than PHP [closed]
I have many times seen various benchmarks that show how a bunch of languages perform on a given task.
These benchmarks always reveal that Python is slower than Java, and faster than PHP, and I wonder ...
1
vote
1
answer
2k
views
Java or Python for Google App Engine not knowing either language?
I have a few project ideas that I'd like to deploy on GAE. I'm interested in developing a logging application for amateur radio contacts, shortwave, and utility monitoring. More complex projects ...