Home » Programming Languages » Page 3
why use authentication token instead of session_id for app(android side) in REST API
23/12/2015 11:22 am by seigel in Programming Languages

in normal php web application after login we use session_id that came from web browser to check if user loged in or not.

But in REST API authentication I read some tutorials that say php should send back authentication "token" for android app to save it and give it back to php server for every request.

my question is why should


Strategies to maintain contract between mocks and APIs
23/12/2015 11:22 am by Stephen Judge in Programming Languages

Using a mock instead of hitting a 3rd party API like Postgres or Stripe can often be necessary when writing tests. A problem I've seen is when the API can unknowingly diverges from the data the mocks return. How can I maintain the contract between test data and real APIs? This is a Javascript project.


Is equating a variable to a function that takes the same variable bad programming?
23/12/2015 11:22 am by Matthieu Bozec in Programming Languages

Is it improper programming to set a variable equal to the result of a function that accepts the same variable? The languages in question here are c#, javascript and PHP (not sure if this works in C families, personally).

var a = 1;
a = alterData(a);

Pattern for creating wrapper classes for wcf client?
23/12/2015 11:22 am by Victorian Gray in Programming Languages

I have multiple wcf service which follows Request/Response pattern.

I have added the proxy classes generated by svcutil.exe to my project.

I need to create a wrapper classes for connecting to the wcf service which should follow IOC (i.e Dependency injection).

I am searching for a pattern to implement that. Anyone please suggest some approach to achieve that.


How can i reduce http request while i have 100s of image + 1000s of users.
23/12/2015 11:22 am by Poland in Programming Languages

I need an idea or concept how to reduce http request. Conditions : 1000s of users(android/iphone) active 100s of small images (150kb/image) to be fetched

Simply by giving each image a hardcode link, server will have to handle 100 * 1000 http request. How could i minimize the requests ?


Blaming the ills of today on the technical debt of yesterday
23/12/2015 5:12 am by Gerle in Programming Languages

A surprising number of quality, scalability, and load problems have been occurring on an application I currently support that I did not originally write. Thankfully I have new projects that I have been doing from the ground up to retain some semblance of my sanity.

The original team consisted of 20 some developers (most of them with outdated skill sets), no business requirement documen


Has "Not everyone can be a programmer" been studied?
23/12/2015 5:12 am by Jeremy Pinnix in Programming Languages

An old adage that many programmers stick to is "It takes a certain type of mind to learn programming, and not everyone can do it."

Now I'm sure that we all have our own trove of anecdotal evidence, but has this been studied scientifically?


What is the point of using lists over vectors, in C++?
23/12/2015 5:12 am by gorcorps in Programming Languages

I've run 3 different experiments involving C++ lists and vectors.

Those with vectors proved more efficient, even when a lot of insertions in the middle were involved.

Hence the question: in which case do lists make more sense than vectors?

If vectors seem more efficient in most cases, and considering how alike their members are, then which advantages are left for lists?<


What to do if a team member delivers bad quality code? [duplicate]
23/12/2015 5:12 am by Alex Sadzawka in Programming Languages
Improving the efficiency of containers with dynamically allocated objects
23/12/2015 5:12 am by bauer100 in Programming Languages

This is not strictly related to C++ but its type system serves to illustrate the problem well.

Assume:

  • We have a generic template Container<T> (such as a std::vector<T>) which stores an unspecified number of elements of the same type T on the heap. Each element is allocated and deallocated via the constructor and destr


Can this argument be enough?
23/12/2015 5:12 am by Remyx in Programming Languages

We have two C++ classes named Important and Small

The class Small use a few methods and attributes from the class Important, but not all.

Since our application is performance critical, instead of copying all attributes (possibly pointers) of Important that are needed by Small and redefine the few meth


Proper use of model in asp mvc
23/12/2015 5:12 am by DigDog in Programming Languages

What is a proper use of model in asp mvc?

Should a model contain only data that will be accessed inside a form, or it is also a good idea to put data that are static and would be used in a view, but not inisde a form of a view.

I am asking this because I am curious about relevance of a model size on performance. If this static data should not be kept in a model, what would be a

TAGS : Proper model

Is there a standard way to indicate that a function returns a new pointer?
23/12/2015 5:12 am by Jesper in Programming Languages

Sometimes I want to delegate the construction of objects that a class owns to a separate function. Something like

Vertex* new_vertex(const Options& options) {
  // do stuff...
  return new Vertex(...);
}

where the function is only intended to be used to within a class that owns the Vertex. Clearly this function can cause some memory-leaking con


How to break TFS or Mercurial repository in some way with a bad commit? [closed]
23/12/2015 5:12 am by Javed in Programming Languages

I'm having an internet argument about Git, in which one of the points are that even if someone does something wrong (bad reset, bad merge, pushing rewritten history upstream or something like that), it is possible to still recover from it. My opponent states that there's no such problem with other VCS's since you can't break them in such a way to start with. I want to counter him somehow and pr


Can a pimpl variation be implemented without any performance penalty?
23/12/2015 5:12 am by Nidleb in Programming Languages

One of the issues of pimpl is the performance penalty of using it (additional memory allocation, non-contiguous data members, additional indirections, etc..). I would like to propose a variation on the pimpl idiom that will avoid these performance penalties at the expense of not getting all the benefits of pimpl. The idea is to leave all private data members in the class itself and move only th


Does Python have any features which can be used for encapsulating private data?
23/12/2015 5:12 am by Colin Henry in Programming Languages

Usually in OOP world we are told that modularity is a good practice and keeping loose coupling between module is a great thing. Encapsulation helps us achieve this loose coupling.

In Java encapsulation is achieved via access modifiers, in Ruby


What is the most efficient way to store this data?
23/12/2015 5:12 am by Zog in Programming Languages

I am in charge of rewriting some old VB code. I understand how it works, but I feel like there is a far-more efficient way to do what they did. I just can't figure out what it is. Here is a contrived example that in terms of data requirements is really similar to what I need to do.

The user has to pick out the manufacturer, make, model and color of their car in a GUI. I have a large tex


When using DDD and CRQS, should be exactly one event per command?
23/12/2015 5:12 am by odunthorne in Programming Languages

I am looking for a way to design a ddd application with convention over configuration.

Say an aggregate "Client" has a command defined "FillProfile". It will logically raise an event "ProfileFilled".

Are there cases when a command will raise more than an event, or where a command will raise different events based on some logic? Or is this always a 1 - 1 relationship (1 command


How to organize data transfers
23/12/2015 5:12 am by Yst in Programming Languages

I feel comfortable with transferring data over the internet using sockets but I don't completely understand how the data being sent and received should be organized.

For instance, if I had game server responsible for updating clients on different objects' position in the world, as well as other stuff, what organization would I use to achieve this? Would I first send a message to the c






Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .