-1
votes
0answers
25 views

How to replace “{” and “}” except those inside a <style> tag?

Let's say I have the following html content: [style] body { width: 100% !important; height: 100%; margin: 0; } [/style] [body] welcome to testing, **{user}**! [/body] ...
-1
votes
0answers
5 views

How to develop animation in Android with the help of given animation by designer?

I am trying to develop Android application. I am searching for animation tutorials on Android but they are very basic like fade-in, fade-out. But what if we want to develop advanced animation like ...
-1
votes
0answers
2 views

Why Apple use autolayout with constraints, instead of columns, like Bootstrap?

Recently I studied how to make responsive applications on iOS, and Apple has adopted the autolayout using the concept of "contrains". I knew create responsive websites using frameworks such as ...
-1
votes
0answers
8 views

can u write this java programming question on 2 D array?

Design a 2D array that helps keep a track of BUS RESERVATION SYSTEM. A user is requested to input a SEAT NUMBER (row & column) for booking a seat. If the seat is available, it prints a ...
1
vote
2answers
18 views

What is the point of calculating these variables this way?

I'm skimming through a very popular game's source code at the moment and I came across these variables inside of this class. public static final BlockPos ORIGIN = new BlockPos(0, 0, 0); private ...
-1
votes
1answer
4 views

java.lang.NoSuchMethodError: org.hibernate.Session.close()V

Background: I'm working on a RESTful API in NetBeans with Jersey, MySQL, and Hibernate. I downloaded the most recent stable version of Hibernate (5.1.0), and added all the jars in the required folder ...
-1
votes
0answers
6 views

UI Testing and Code Coverage

My company wants me to write UI tests that test the business logic (all of the use cases MUST be independently testable) I decided to do it in selenium. I have managed to create a decent product (as ...
2
votes
2answers
27 views

prevent abuse to rest api endpoint

Question 1 I have a login api endpoint http://127.0.0.1:8080/api/account/login it checks if phone number has been validated. If not it'll call POST http://127.0.0.1:8080/api/account/sendsms ...
0
votes
2answers
20 views

Is it a good idea having default static variables for new instances?

OK let's say I have something like this: public class MyObject { public static int DefaultValue = 9 private int _value = DefaultValue; public int Value { get { return _value; } set { ...
-1
votes
2answers
20 views

Junior Dev: Ruby by day and C++ by night - is this healthy?

I'm a junior programmer and recently landed my first job as a software engineer. I'm six months in now, and seem to have a good grasp on my job. I have talked to my manager about personal projects in ...
-2
votes
0answers
47 views

Specific design patterns for the backend and database of a mobile application [closed]

I'm writing a social networking app. Here are the features it will have: user accounts/profiles (so I will need to store profile pictures) following other users posting content that will be seen by ...
0
votes
0answers
7 views

How to use fields from an object after an exception is thrown and the object can't be fully created

The issue that I have is that I need information from an object that a method returns when it throws an exception. It is a little hard to describe so I have this java pseudo code example. I have a ...
-1
votes
4answers
109 views

What algorithm would have the fastest average run time and least memory requirements for sorting a deck of playing cards?

Considering a deck of N playing cards with X different rankings and Y different suits (i.e. there are Y cards with X ranking, thus N=X*Y). What is the fastest algorithm to sort them assuming that X, ...
0
votes
1answer
31 views

What kind of data structure should be used to store components in an electrical schematic program?

Is there a specific data structure, object oriented programming methodology, and/or approach for achieving what programs like LT Spice, Altium Designer, and Cadence Virtuoso use to manage ...
-1
votes
0answers
7 views

How to insert log transformed columns into an existing dataframe using column indices (in pandas, python)

How do I insert columns that are log transformed(after doing log transformation of certain variables)of a data frame called 'log_data' back to it's original data frame 'df' using specific column ...
-1
votes
0answers
11 views

Which search engine should I use to suport complex search scenerio

Let’ assume that I have a database for storing orders for multiple stores and I have following tables: User – represents user Store – represents store UserStore – many to many between User and ...
1
vote
1answer
50 views

Why closure declaration syntax in Swift is different from function declaration

let closure = { (args) -> ReturnT in ... } v.s. func function(args) -> ReturnT { ... } Why didn't Apple follow principle of Occam's razor and make closure and function declarations to be ...
1
vote
1answer
123 views

How are dynamic images programmed? [on hold]

I have two friends that want to create a jewelry store, focused on customized jewels. The core feature is the jewelry designer, based on a jewel model. Here's an example of the sort of thing I am ...
5
votes
6answers
338 views

How much commenting is better for coding? [duplicate]

I don't have a formal computer science education, meaning that I did not study computer science topics in a university. However, I work at a programming job and write a reasonable amount of code. ...
-1
votes
0answers
17 views

How would I implement the following formula as a function in java? [on hold]

Where you are trying to find the smallest number for n with inputs p and y. I tried to implement this as: int index = 0; for (int i = 0; index == 0; i++) { if (bFormula(i, perHit, hitsNeeded) ...
1
vote
1answer
44 views

Sync client-side data after service invocation in SPAs

Here's a simple scenario: We have a list of tasks and can mark a task as completed by invoking a web service. Doing so will transition the status of the task to completed as well as initialize a ...
0
votes
2answers
108 views

Using an answer from any question and answer site in my source code is plagiarism?

Since English is not my native language, I try to be brief as much as possible to understand my question case 1: Sometimes I cannot figure out how to make things to work like in this question,Sending ...
2
votes
1answer
43 views

Which IndexedDB data structure for Chrome app?

I'm on the way to build a Chrome app, dedicated to fulfill shop/marketplace orders. The orders come from marketplace APIs like Amazon MWS. The data is stored only in the app (with backup). The system ...
0
votes
0answers
22 views

Is it ok to copy code from a different repository for generator use?

I am not sure if i have to, my partner says i should, i am a little concerned about the license the repository uses which is apache 2.0 This code is about validate some parameters with a given ...
-1
votes
0answers
9 views

Taskrunner - with multi threading design

I am looking for advice on how to implement a multi threaded task runner. My background is Java and Spring. It would look like the following. BatchTask Each BatchTask shall run in parallel ...
1
vote
0answers
26 views

Good examples for use of design patterns in Unity [on hold]

My students have learned OOP as well as the strategy design pattern during the first semester (Processing/Java), which lead to understanding Unity's component based architecture (similarity of ...
2
votes
3answers
67 views

How can one think of a relational schema in terms of storing it in a NoSQL database?

Recently I've been wanting to experiment with NoSQL databases, especially document store ones. After reading, I still don't understand how one might model information that is contained in a relational ...
1
vote
1answer
34 views

Observer Design Pattern with complicated objects

I am trying to currently get a good grasp on the Observer design pattern, but I am stuck wondering about one specific issue. In the examples I have been able to find of implementation, they are all ...
1
vote
1answer
23 views

Abstracting end-to-end test cases across multiple pages

I am using Protractor and Jasmine to create end-to-end tests for a webpage. To test this initial page, I have abstracted made some common utility functions to create about 20 test cases for this ...
1
vote
3answers
384 views

What's the best way to track updates when syncing data from MySQL remote server to local SQLite database?

I'm making an iOS App, well, two actually. App A will be able to write TO-DOs to a remote MySQL database, and App B will be able to read what App A has written/modified. App B needs to be always ...
119
votes
16answers
5k views

Does craftsmanship pay off? [duplicate]

Possible Duplicates: Prototyping vs. Clean Code at the early stages Frankly, do you prefer Cowboy coding? After working in a number of companies, I am starting to realize that my ...
8
votes
4answers
5k views

What is Visual Studio Lightswitch and how does it differ from normal Visual Studio versions?

How is Visual Studio Lightswitch different from regular Visual Studio? In what sort of situations would you use this IDE over regular Visual Studio? I'm trying to decide if this is something that ...
3
votes
1answer
371 views

How to make clear that a method can be overridden?

I have a library that I use in several applications. It has a method that returns a URL: class UrlBuilder { public function url($config) { $config = do_some_checks($config); return ...
3
votes
0answers
31 views

Perform crossover operation on AST in genetic programming

So in general when you perform a crossover in GA, you directly flip a random section in the "genome", with the corresponding section in the other parent, and mutate it based on the mutation rate. ...
1
vote
2answers
55 views

Ambient dependency injection through static service locator

After some googling I found some debates about whether constructor injection or property/field injection is better, but there is yet another alternative that strikes me as more beneficial. In most ...
71
votes
6answers
11k views

Why are floats still part of the Java language when doubles are mostly recommended instead?

In every place I've looked, it says that double is superior to float in almost every way. float has been made obsolete by double in Java, so why is it still used? I program a lot with Libgdx, and ...
32
votes
5answers
28k views

How to avoid big and clumsy UITableViewController on iOS?

I have a problem when implementing the MVC-pattern on iOS. I have searched the Internet but seems not to find any nice solution to this problem. Many UITableViewController implementations seems to ...
1
vote
2answers
82 views

Approach for inserting rows

Let's say I have a sale order with multiple rows of products. Multiple users insert rows so I must check for concurrency. In my db the ID of the order and the number of the row makes my record unique. ...
1
vote
1answer
70 views

Different instances on deserialization of php objects?

Suppose I have a class called MyClass, with a member variable 'var'. And the following scenario: echo '<pre>'; $x=new MyClass; $y=new MyClass; $x->var=$y; echo 'Checking for ...
2
votes
2answers
44 views

How do you address the problem of dealing with an external service that stores your data and you want to keep in sync?

I'm integrating an enterprise application with an existing pattern. The main problem is how to synchronize data between my system and an external system through RPC (HTTP API calls to be precise). ...
3
votes
2answers
119 views

Service-locator anti-pattern alternative

I'm using Unity as IoC with C#, but I guess the question really isn't really limited to Unity and C#, but IoC in general. I try to follow the SOLID-principle, which means that I got very few ...
3
votes
1answer
86 views

Find minimum number of steps to a goal without estimator for how close intermediate steps are to the goal

I've been trying to find a good way of solving the following problem, but I'm not sure how to even frame it. I think there might be relatively well-known solutions I'm not familiar with, since I don't ...
1
vote
2answers
42 views

Name for Keeping Multiple Copies of a Variable

There is a bad practice in software engineering where a single piece of data is held by value in multiple places. For example, in an FPS, the location of the player could be held by the AI class, the ...
2
votes
1answer
31 views

RESTful HTTP and websocket in the same application?

If an application has already an opened WebSocket for live feeds, should I use it over AJAX for the other communications with the server? Because the connection is already opened, should we use it ...
2
votes
2answers
47 views

Testing properties with private setters

Currently in a part of my project a domain object like below exists: public class Address { public virtual string HouseName { get; set; } public virtual string HouseNumber { get; set; } ...
-3
votes
1answer
122 views

Should I use NoSQL or HDFS for storage?

I have millions of tweets currently stored in HDFS and I plan to analyze them from Spark (Data mining, text mining, Frequent Term-Based Text Clustering, Social Network Analysis) however, do not know ...
1
vote
0answers
48 views

How to authentication user in REST API (domain driven design)

I am using REST API as a presentation layer of a DDD project. In order to secure API calls I am using token based security. ...
-3
votes
1answer
89 views

How to compare and replace value from two object inside array?

Here i want to replace price in data1 to price from data2, and it updated if the id is same. Is it possible to do that without nested loop? var data1 = [{ "id": "56e641d4864e5b780bb992c6", ...
1
vote
0answers
13 views

What should be primary guideline when defining a bounded context?

When defining bounded contexts of a Domain, what should be a primary guideline: departments (Sales/Manufacturing/Warehousing), where each department has a common context ...
-4
votes
0answers
30 views

what is the user requirement and system reqirement [on hold]

John began ABC Furniture (ABCF) as a hobby. Within several years the hobby has evolved into a medium-sized business, employing more than fifty workers. Over the years, increased demand has forced John ...

15 30 50 per page