instruction stringlengths 34 19.9k |
|---|
How can I check if an Android application running on a not rooted device is "secure" without knowing its source?
I would look for:
Plain text in Web-Requests (wireshark and emulator)
SQL-injection (in EditTexts...)
Doing stuff, that isn't always expected (i.e. fast clicking to check for race conditions)
Question: Wh... |
Is there some sort of standard regarding HTTP API responses?
After reading this discourse thread I started to wonder. We are developing our public HTTP JSON API at my work, and we do not return anything when it's not strictly needed (for example a PUT to /resource/{id} only returns 200 when OK or the corresponding 4XX... |
I am trying to learn how to do events in C#, and according to the MSDN Events tutorial,
Events are declared using delegates. If you have not yet studied the Delegates Tutorial, you should do so before continuing
so now I'm trying to understand Delegates first, and failing horribly. What are they for? What problem ar... |
I've been reading about law of Demeter and I would like to know how to solve this traversing model properties problem that I see a lot on Objective-C. I know that there is a similar question but in this case I'm not calling a method from the last property that do some calculations, instead, I'm just setting values (Ok,... |
I haven't found much on this, but what I did find doesn't explain it well enough (at least for me).
What makes the application I make portable?
Or what defines a portable application?
Is there a specific difference that makes an app portable or not?
I always thought if I just made an executable file and some images... |
I have built this CMS that has the option to add entries to the database. Each entry that is created has about 5 to 10 new images showing the product for sale. Each image is about 150Kb in size.
I already know that images should always be stored in Git however my problem is that the sales team users that add new entri... |
We have employees with competencies:
Pete Welder
Carpenter
Melissa Carpenter
Assume they both work 40 hours/week, and have not yet been assigned work.
We need to report the availability of these competencies, expressed in hours.
As far as I can see now, we can report this in two ways:
Method A. ... |
The this keyword is primarily used in three situations.
The first and most common is in setter methods to disambiguate variable references.
The second is when there is a need to pass the current class instance as an argument to a method of another object.
The third is as a way to call alternate constructors from wit... |
I came across the concept of web development bootcamps, these 9-10 week intensive crash courses claim to teach beginners web development and help them get 80k starting salary jobs. Many of you might have heard of these.
Is what the bootcamps promise feasible? Is it possible for web technologies like Ruby on Rails, HTML... |
I have a class that represents a file in specific binary format on disk (the parent in the title) and another class that represents an object inside that file (child). When the object changes, it sometimes needs to relocate to a new position in the file and the file class has to be notified about this new position.
To ... |
I recently stumbled upon Microsoft's framework for code contracts.
I read a bit of documentation and found myself constantly asking: "Why would I ever want to do this, as it does not and often cannot perform a static analysis."
Now, I have a kind of defensive programming style already, with guarding exceptions like thi... |
I use yii framework that implements Active Record pattern as ORM base. It has CActiveRecord class that is a table wrapper class with attributes reflecting table columns. So each object of this class represents a database row.
Wiki says about Active Record pattern:
Active record is an approach to accessing data in a da... |
.NET defines the InvalidOperationException as
The exception that is thrown when a method call is invalid for the
object's current state.
In an optimal software design, would it ever make sense to throw this exception? I would argue that the 'optimal' API prevents any misuse, including, never allowing a method to be... |
I am writing some software that (for once - usually I open source stuff on sourceforge/github/etc.) I plan on selling. To each source file, I want to attach a proprietary software license that doesn't allow anyone to use, modify, derive, etc. the software (and source code) without my express permission.
I have been loo... |
I have been asked to automate the operation of a Windows (WinForms) application, performing some fairly complicated statistical analysis along the way.
My first thought was the usual suspects: .NET, C# and White or AutoItX.
Then it occured to me that I could try an alternative stack: SBCL, CFFI, and AutoItX. That way,... |
What do you think until what point should a programmer refactor the code?
Basically having
def method
do_something
end
Pieces of code would be handy, but they increase spaghetti code until the point where you have to remember the path of more than 8-10 methods. So wouldn't be easier to have no more than 3 methods ... |
In computer science, what is the abstract common name of types and values (I mean an abstract "something" that can be a type or a value) ?
To be more specific:
If we have template <typename X> or template <int X> what is the abstract name of X?
|
Suppose a piece of software is distributed under some permissive license, e.g. BSD. Now, I modify this software and want to distribute my derivative work. My questions:
Who is the owner of the derivative? Is it the original author, the new author or there is joint ownership?
Is a copyright notice (say under the origin... |
This is a followup question to this other question.
Background
Working from the MSDN Delegates Tutorial (C#), I see the following:
Note that once a delegate is created, the method it is associated with never changes — delegate objects are immutable.
And then, in the code sample, I see this (Spread out a little throu... |
I played with 8-bit machines (C64), I used 16-bit machines (Win 3.1), I enjoyed flat 32-bit address space (Linux).
Every time as a user (which was also means being a developer for fun or profit) I felt the need for more bits and welcomed the next wider bit architecture. Accessing to bigger memory space got easier, grap... |
I started a discussion on StackOverflow earlier this week about one of my work project and how to lead it correctly.
But it seems that this stack is a more appropriate place to ask those sort of questions, so here is my last question about my project:
How do you value your work? / How do you rate it in a financial way?... |
I read a lot about auto-incremental id (guid, interlocked.increment, ObjectIdGenerator...) but don't find nothing for my situation.
In my domain model user ask to have an automatic progressive numeric Id for each Activity they create.
Since it's a user request I want to put it in my domain model, but the mode I usually... |
So we present a straightforward coding exercise to new candidates with some well defined requirements. Occasionally we receive solutions which don't really solve the problem at hand, but are over-engineered to solve a perceived problem - often outside the bounds of the exercise.
Now my question is, is this a warning si... |
I have a typical MVC based website, and I'd like to give some registered users the abillity to extract data from the database (in a variety of formats). The workflow is very simple:
User logs in,
User clicks export,
A file is generated,
User downloads the file.
I'm trying to figure out a way to secure the last step a... |
Scenario
A clustered environment running N identical application nodes interacting with a single relational database.
Problem
Is it possible to upgrade the nodes to a new application version, which requires a new database schema and maintain data integrity in the database without any downtime in the application and wit... |
I am working on a warehouse management system (WMS) that needs to support having stock in multiple locations. Could be in a different building, could be stored in n* places in a building (quick example would be stock, overflow, or fast moving slots all containing a qty of the same item).
Where I am, they have always us... |
I'm in the design stages of a program that based upon input received, would select a particular category, and action within that category. The category, the action within in, and the value(s) related to that action are all immutable values, along with the relationship between category and action.
Normally I'd just assi... |
THE QUESTION:
There is an event where there are N contestants. There are three tasks in the event: A,B,C (say). Each participant takes part in the events in the listed order: i.e a contestant must first complete A and B before beginning C.
However, in event A only one person can participate at a time. Any number of peo... |
For example, say I want to fetch a User and all of his phone numbers and email addresses. The phone numbers and emails are stored in separate tables, One user to many phones/emails. I can do this quite easily:
SELECT * FROM users user
LEFT JOIN emails email ON email.user_id=user.id
LEFT JOIN phones phone ON ph... |
Several years ago, Microsoft announced that Ruby and Python were coming to .net. The projects were called IronRuby and IronPython, respectively. Microsoft said that the projects would be built on top of the .net DLR.
WIKIpedia indicates that for all intents and purposes, these projects have been abandoned by Microsof... |
Recently my team has programmed a custom developer console in a video game which can easily be hidden or displayed, because it's more comfortable and less of a hassle.
The Console class contains a log(string) function which should be easily accessible from anywhere outside of it, without having to reference it everywhe... |
I have had some experience in documenting the design for project developed in OOP languages. I made classes and used class diagrams to showcase the overall design structure of the implementation when I used OOP languages.
Problem : I am about to begin a project in C language. How am I supposed to go about writing the d... |
This is related to "Extends is evil" vs. OCP? but separate because the idea of "implement the interface" doesn't exist in Python.
I'm writing a class to pull some data off a webpage. It's going to need to hold on to a cookie for authentication, so I'm going to use a requests.Session object in some form. I'm never sure ... |
There are some guidelines out there (eg scala guidelines) and I'm wondering if it's okay to do some tidying up when committing other changes or if the commits should be more focused and to the point?
Eg - remove unused, reorder per style guide.
It might make it harder to read the pull request - but it will improve the ... |
I've reached a point in my career where I want to consider myself less "an {x} engineer" where {x} is a specific programming language, and I want to be more of a language-agnostic software engineer.
The obvious next step is to start learning as many languages as possible to build experience, but there's only so many ho... |
I'm thinking of working with some other people on a c++ or java project. Usually for small projects, we collaborate mostly through emailing source code files back and forth, but on a larger scale, it becomes too easy for things to go wrong.
I read up on version control systems such as git and it seems to fit my needs ... |
There is a point in time where you make design choices and debate them with management. In my case I have to debate my positions and design choices with senior management but it is frustrating that management only strives for performance while I think stability is a must while performance can be achieved later.
E.g. W... |
I'm creating a program (in C++) that will password protects its user's database (.dat) file. I'm confused on where to store the password? In the user's database file or somewhere else.
I'm new to this concept. I don't know where a program should store the hashed password. I've been thinking for this from a long time.
I... |
I'm working with a fairly complex web application. It's split up into the following layers:
Presentation - HTML
Service layer - A REST and SOAP API communicating with the business layer
Business layer - Contains the business logic.
Data access - Provides access to the storage (SQL etc)
The business layers contains cl... |
Assume that I'm a front-end developer (HTML, CSS)
And some one who got their website built using ASP.NET came to me and asked for a new design and I don't know about ASP.NET.
Then, how can I change the design of their website without affecting their code?
Do I have to learn a little bit of server side languages to be a... |
Say I have a method that inserts a record into the database. I don't need to know the newly-inserted ID or anything else. I have two options:
public void Insert()
public string Insert()
In the first: if an insert is successful, the calling code will continue. If it fails, an exception with the details will be returne... |
I have developed an application where you should be able to browse products catalog(READ ONLY) even network access is down no wifi or 3g/lte etc. Clients(windows,ios,android etc) consume the rest api. So far There is a REST api that grabs parts like categories with products and other api call to get preferences etc. T... |
I have an API that returns a JSON formatted array of users within a given pair of lat/ long bounds.
I'm using this data to plot a number of markers on a map, based on the location of each user.
I also want to render a HTML list on each client request so that I can show the list of plotted users alongside the map.
What ... |
I am new to Branching and Merging but I have been tasked with making future development on an application possible while still allowing bug fixes to production. Usually I am the only developer on the application unless I am on leave.
I have watched a Pluralsight video on Branching and done some forum/stack reading. I w... |
I'm designing a function that given a UTC timestamp will convert it to the local time.
The question I have, should the current times DST settings be applied to the conversion, or the timestamps DST settings?
If going with the former, current DST setting applied to timestamp - it would mean 4pm that was recorded with DS... |
We maintain a web application for a client who demands that new features be added at a breakneck pace. We've done our best to keep up with their demands, and as a result the code base has grown exponentially. There are now so many modules, subsystems, controllers, class libraries, unit tests, APIs, etc. that it's start... |
My module has no dependency on its own but for running tests you need to install jasmine-node module. Should I include that module as a dependency?
|
It says in the book (APress Ganesh / Sharma) about Java 7:
You create a method named fill() in the Utilities class with this
declaration:
public static <T> void fill(List<T> list, T val)
You declare the generic type parameter T in this method. After the
qualifiers public and static, you put <T> and then followed... |
Question
For those of you working with html/javascript/css "thick clients", specifically those that work against some client-independent server API, how do you manage your deployment environment configuration?
Do you manage the configuration at build time with per-environment release builds (e.g. QA, STAGE, etc) or do ... |
There are two types of color mixing: Additive and Subtractive. http://en.wikipedia.org/wiki/Color_mixing
Is is possible that color mixing model be done in XOR?
|
I have been considering the following situation as part of documenting and interface (A) and an implementation (B) of that interface.
The interface A contains methods which involve the following two arguments:
A percentage, passed as an integer.
A name, passed as a string.
The valid values for the percentage are the ... |
Probably few of you are interviewing wannabe programmers. I'm 28, never worked as a programmer, but spent few months learning C and solving problems. I loved it so much that I do it every day just because I can, now and started studying CS at local university.
Now I'd like to try make living from it and am trying some... |
I always appreciated the Java language. It is known as a very secure platform and many banks use it in their web applications.
I wanted to build a project for my school and I discussed the options with some developers. However, one of them said we should ignore Java ecause of vulnerabilities appreared recently in it. ... |
I'm designing an instant messaging server as a personal exercise to improve my understanding and application of multi-threading and design patterns in Java. I'm still designing, there's no code yet.
My goal is to have a server that should make effective use of a multi-CPU box. I'd like the server to be distributable ac... |
The web platform is hip these days. But the web platform consists of many parts that are conceptually separable, developed at different times and paces, and (most important to me) could be useful on their own. Basically the web platform is "a browser", but the browser lumps together several things:
HTML/CSS renderer... |
This is a question I've to-and-fro'd with for a while, and searched for and found nothing on: what're the accepted practices surrounding duplicating domain models in Javascript for a web application, when using a framework like Backbone or Knockout?
Given a web application of a non-trivial size with a set of domain mod... |
I have been thinking of a couple of possible extensions to the C language which I'd like to know the opinion of others about.1 This one is about multi-dimensional arrays.
Imagine the following situation in C:
void matrix_mul(double **res, double **a, double **b, size_t n, size_t m, size_t r);
You cannot pass a double ... |
I'm currently planning the database structure of a used car's advertisements site. Each advert contains information about a vehicle, and a vehicle can be advertised multiple times over its lifespan (granted, quite unlikely). I'm unsure which approach to take - a single table, or two separate relational tables, each has... |
I know about Simple Factory Idiom, Factory Method and Abstract Factory Design patterns.
But I have two situations that I'm not sure how to call (PHP code example) :
class User {
public static function LoadUserById($id) {
$objUser = new User();
//load details from DB
return $objUser;
}
}
class UserFacto... |
When creating a table, there is an option for us to set the numeric primary key as autoincrement where its value increases whenever a new data in inserted.
This primary number can be used for setting the relationship of a table where it is assigned as a foreign key to that table.
So my question is it a good practice f... |
Is it good idea to require to commit only working code?
This commit doesn't need to leave the repository in a working state as:
... we are in early design stages, the code is not yet stable.
... you are the sole developer on the project. You know why things aren't working. Furthermore, you are not stopping anyone's... |
So I have this problem: in order to structure my code hierarchically, for every new tiny thing, I create a separate sub-folder, file, class ... and in it one 10-line function. It is an anti-pattern.
Lately I have been trying to err on the opposite side. That is, when I need something new, instead of dreaming up grand h... |
Recently I came across a moderately large python codebase with lots of MyClassAbstractFactory, MyClassManager, MyClassProxy, MyClassAdapter etc. classes.
While on the one hand those names pointed me to research and learn the corresponding patterns, they were not very descriptive of what the class does.
Also, they seem ... |
I need to make a "SELECT * FROM" Sql from PHP, that now returns about 10.000 records, that I insert in an Array and re-utilize in a page to show results in a table.
I need to have all that elements also in a hidden input fields, to connect via API to a SMS service to send SMS
<input type="hidden" id="destinatariSMS" na... |
I have been reading the Wikipedia article on double check locking and one thing that's not clear from it (at least to me) is what the pattern achieves. What is the reason for making the two checks below? Why not have triple checked locking? Wouldn't that be even better?
if (mySingleton == null) { // 1st check
... |
Planning my architecture for an MVVM application I come to this:
MyApp.UI
View
MyApp.BusinessLayer
ViewModel
MyApp.DataAccessLayer
RepositoryImplEF
MyApp.DomainLayer
DomainObject
RepositoryInterface
MyApp.Common
Logging
Security
Utility (contains some reflection method used by many levels)
CustomException
My... |
For my simple MUD client I'm using Apache Telnet (no, not ssh). A mud client is a strange beast:
Generally, a MUD client is a very basic telnet client that lacks VT100 terminal emulation and the capability to perform telnet negotiations.
...
Standard features seen in most MUD clients include ANSI color su... |
This question focuses on user documentation, not on code documentation.
I just finished my software project, and the people I work for are expecting me to write user documentation, describing everything the software does.
All the documentation they had until now (about the rest of the software they use) is full of scre... |
Using C# and WPF I have a situation where my data is organized hierarchically.
I am using a treeview to represent this (each node is a Class type that containts a Children property that is an ObservableCollection:
Group_01
Object_01
Material_01
Texture
Material_02
Texture_02
Group_02
Object_02
Material_03
T... |
The users for our software will want to upload potentially large amounts of files in bulk to our servers. It is then desired that we display the upload status any time the user views the upload screen. This doesn't have to be any more fancy than a progress bar with a percent status.
My question is, how can I keep trac... |
Using C# and WPF I have a situation where my data is organized hierarchically.
I am using a treeview to represent this :
Group_01
Object_01
Material_01
Texture
Material_02
Texture_02
Group_02
Object_02
Material_03
Texture_03
I would like to be able to switch the order of the hierarchy, for example be ab... |
Where should the Models be instatiated in a MVC arhitecture? I understand the preferred way would be outside controllers, in a bootstrap file and injected using a Dependecy Injection Container. But most of the models I'm working with depend on run time parameters.
//PHP Example
class UserController {
protected $objU... |
I am just learning computer networks so please forgive me if this question is naive. I know the TCP protocol binds itself to a port till the transfer of messages is over (port 80) and UDP is best effort (ie no binding). My question is if I try and access two websites at the same time (multiple tabs on my browser), assu... |
I've started a project that involves at least three repositories on GitHub.
One of the repositories is a generic documentation-and-examples dump, and the other two contain the implementation of two programs that form the backbone of the project.
Should I use a GitHub Organization to handle such a configuration? Or sho... |
First of all I have gone through this question Why is #include <iostream.h> bad? and there the reason was simply that it is outdated but I personally think that as a header iostream was better cos you don't have to declare objects like cout and endl in global scope cos they were already in global scope and moreover sin... |
I need to find an optimal set of "n" parameter values that minimize an objective function (a 2-hr simulation of a system). I have looked at genetic algorithm and simulated annealing methods, but was wondering if there are any better algorithms and guidance on their merits and limitations.
With the above optimization me... |
In my current OSS project, I knew literally nothing about what I was doing when I began.
I was integrating with a larger project as a plugin, and that in and of itself had a steep learning curve.
If I had begun with TDD it would have never been written as my code was changing as I was learning.
This has worked for quit... |
My manager has recently really been pushing to use velocity as a target and measure of productivity. We are currently working at an average velocity of 50 story points. My manager wants us to increase it by 40% to 70 story points (with no increase in team members). If we don't achieve this increase he wants us to deliv... |
I appreciate all help and feedback. Parts bolded are critical parts if this is too verbose. Perhaps it will help to mention I am a green developer. I have found some useful info from related questions posted here and on Stack Overflow but nothing that felt 100%.
Background
Currently at work we are developing a web a... |
If a controller gets too fat and model instantiation starts to add up, a service layer could be used.
If I just wrap the logic inside a service class, I will get a bunch of Services with one/two methods. This feels like a code smell. Any best practices regarding this?
Can a service instantiate models?
If a service ins... |
I'm currently reading C++ Concurrency in Action by Anthony Williams and I'm facing an obstacle in thought.
First he describes deadlocks as when two threads lock simultaneously (at least, that's how I understood it), which makes sense.
However, he goes on to explain how you can lock two mutexes at the same time. Obvious... |
I'm making a website in PHP where the user can search a big MySQL database. The user is shown the first result. I want the next button to take the user to the next result, and so on.
The trivial solution is for each result page to execute the user's search query again and use OFFSET and LIMIT to get the n-th result tha... |
Is the Entity Component System architecture object oriented, by definition? It seems more procedural or functional to me. My opinion is that it doesn't prevent you from implementing it in an OO language, but it would not be idiomatic to do so in a staunchly OO way.
It seems like ECS separates data (E & C) from behavi... |
How should I approach writing comments for callback functions? I want to explain the "why" behind the function when the function and parameter names are insufficient to explain what's going on.
I have always wonder why comments like this can be so ordinary in documents of libraries in dynamic languages:
/**
* cb: cal... |
If I have a grid of rectangles and I move one of the rectangles, say above and to the left of another rectangle, how would I resort the rectangles?
Note the rectangles are in an array, so each rectangle has an index and a matching tag. All I really need to do is set the proper index based on the rectangles new center ... |
I've started working at this company, and the software is managed in a Visual Studio solution that includes hundreds of projects (C++ and C#).
After poking around the solution for couple of weeks, I started wondering why there are so many projects. Not only does it slows down VS considerably, but a rebuild can take up ... |
I am trying to run a large amount of sites which share about 90% of their code. They are simply designed to query an API and return the results. They will have a common userbase / database but will be configured slightly different and will have different CSS (perhaps even different templating).
My initial idea was to r... |
The Clojure docs regarding (reduce f val coll) state:
If val is supplied, returns the result of applying f to val and the
first item in coll, then applying f to that result and the 2nd item,
etc.
So I tried:
(reduce str ["s1" "s2"] "s3")
Which leads to:
"[\"s1\" \"s2\"]s3"
However, when I try
(apply str ["s1" "... |
I am doing a page speed optimization for my website and studying how other websites do it. I noticed that some websites such as as Facebook or Ringgitplus show 0 bytes for some of their resources in Chrome's developer tools, Network tab, while the real content size is several kilobytes.
I read some articles that says ... |
We are redesigning an old VB6 application in Net. The application makes extensive use of a database and includes management of club members and their results in the competitions that they partake in.
So, if we are editing a club member's name, address, etc. it is obvious not to send the data back to the database until ... |
Our team has recently inherited a relatively large project from another company (~250k lines). It was developed using C++Builder and we intend to port the Ui side to Qt. Most of the Ui code is separate from the business logic (yay!) but the logic side is quite a mess.
There is a lot of diamond inheritance going on (vi... |
I'm writing my first Objective-C Class. It's responsible for interaction with an HTTP SSO authentication service.
The process requires multiple HTTP transactions in order to complete. The Class acts as a NSURLConnectionDelegate for its own NSURLConnection object. The NSURLConnectionDelegate object operates asynchronou... |
I just want someone to clarify the following questions as Demis Bellot had announced a couple of weeks ago that ServiceStack would go commercial. Refer link below.
https://plus.google.com/app/basic/stream/z12tfvoackvnx1xzd04cfrirpvybu1nje54
(Please note that when I say ServiceStack or SS I refer to all associated SS li... |
If we get assigned to do multiple works simultaneosly, is it good for growth for a developer?
If there is a development project and if you are assigned to work on a maintenance project as well, is it good for the growth or will it inhibit the progress?
|
Can anyone explain me what's the point of overriding base class implementations (if its not abstract), because it's not ethical move to modify features of the parent class according to the wishes of derived classes. The best way is to make the base classes abstract and carry on the inheritance chain. Whereas when desig... |
I'm researching what's needed for EDI as far as protocols and server/application setup.
This is transportation industry and I'm interested in X12 format for transactions like 204, 210, 214.
Specific question is:
Do BOTH trading partners have to run servers? With AS3 it seems like SFTP server and it seems like one partn... |
I am currently involved in the implementation/design of an existing application for a large scale customer. The application has a similar model as e.g. vCenter Server whereby a number of components store information in and extract information and workflows form a central database. The environment is managed from a cons... |
I've been watching a video to learn HTML. I know about HTML but I just wanted to refresh my knowledge. The author declared that he is using HTML5 because the doctype was:
<!doctype html>
but I noticed that the author used the meta element in a different style that I get used to, he used it without the the forward slas... |
For loops are usually inclusice, exclusive, meaning that you start at the bottom, and stops when you reach, but don't to the top.
In Python:
for i in range(0,a):
print(i)
would print 0 through a-1.
The same applies for Java:
for(int i = 0; i < a; i++){
System.out.println(i);
}
would also print 0 through a-1... |
Enumerations1 are often associated with procedural code rather than object-oriented code. They tend to give rise to similar switch statements scattered through the code, and in general, these are replaced by polymorphism in object-oriented code.
For example, see Replace Type Code with Class, Replace Type Code with Subc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.