Resources relating to Java EE and Scala

Are there any good sites / blogs / books / articles on using Java EE together with Scala? Or indeed articles saying that it should not be done. Many Scala resources talk about using Akka and Lift. Akka solves a different domain problem than Java EE. I don't know Lift, but I assume its geared towards the web end of Java EE and doesn't replace app server containers which provide transactions, security, scalability, resource management, reliability, etc. (all those things which Java EE markets itself as being good at).


How to get an image or rectangle to detect collision with another image

Can someone please explain to me how to detect collision with another image? The tutorial I was watching explained how to detect if a collision occurs between two rectangles but I would like to use two images instead. Please see the code below.               public void paintComponent(Graphics g){      //g.drawImage(yellowBall, xCoor, yCoor, this);     Rectangle r1 = new Rectangle((boardXSize/2), (boardYSize/2),50, 50);     Rectangle r2 = new Rectangle(200, (250),50, 50);     g.setColor(Color.red);     g.fillRect(r1.x, r1.y, r1.width, r1.height);     g.setColor(Color.blue);     g.fillRect(r2.x, r2.y, r2.width, r2.height);          if(r1.intersects(r2)){             System.out.println("Collision Detected");          }     repaint();          }      How can I detect if r1 intersects yellowBall instead of r2? Please keep responses at the beginner level but of course, any assistance is greatly appreciated. Thanks!!


Hadoop and Object Reuse, Why?

In Hadoop, objects passed to reducers are reused. This is extremely surprising and hard to track down if you're not expecting it. Furthermore, the original tracker for this "feature" doesn't offer any evidence that this change actually improved performance (unless I missed it). > It would speed up the system substantially if we reused the keys and values > [...] but I think it is worth doing. This seems completely counter to this very popular answer. Is there some credence to the Hadoop developer's claim? Is there something "special" about Hadoop that would invalidate the notion of object creation being cheap?


The destination of cout messages in a GUI program

I've been building some classes and functions in a static library which has the familiar printing of text messages to `stdout`:               cout << "Hello World!" << endl;      I've been developing this library for use in a console application but I'm considering also trying to make a GUI version, because it will be both useful and highly educational (for me). I wonder how is it possible to make output in a library sent to both `stdout` and GUI controls (like a status bar or a popup window). Since such messages are all sent (in my case anyway) to one destination (cout) could some sort of redirection be possible? I've always presumed something like this may be possible as people often release command line and GUI versions of their programs.


Scrum tool for Product Backlog management

My team and I are very keen on doing Scrum "manual"-style (with paper and scissors). Though, we are struggling to find a tool to manage our backlog. The main requirements are:   * To be able to print the backlog in cards to stick to the whiteboard   * To be able to assign backlog items to the releases manually So far we have not found anything that matches these criteria. Suggestions?


How are dates typically handled with testing?

I am writing an app at the moment that has some pretty extensive business logic based around dates. I have several hundred thousand records to test and testers who want to see how those records are handled, which has worked well so far, however, some edge cases are difficult to replicate. The reason is that most of the logic is related to today's date, in one way or another. What is the best way to handle this with both unit testing and for traditional testing? The only way I can really think of is allowing for today's date to be faked and fixed.


Is it bad practice to use reflection to do DB inserts with data from an external service?

Our supplier's webservice is returning address objects (~30 fields) and I'm using LINQ and reflection to store the returned data straight into the databse. I loop over the attributes and set the value from the object to the LINQ class. I'm fairly new to refection and I'm worried this may be bad practice; it saves ~30 lines of code in 3 or 4 methods but I'm afraid it could introduce hard to fix bugs. **EDIT** Here is the code. Target is normally a LINQ to SQL entity and input would be a webservice object.               public static void SetValues(object target, object input)     {         Type targetType = target.GetType();         Type inputType = input.GetType();              PropertyDescriptorCollection inputProperties = TypeDescriptor.GetProperties(inputType);         PropertyDescriptorCollection targetProperties = TypeDescriptor.GetProperties(targetType);              foreach (PropertyDescriptor p in inputProperties)         {             object value = p.GetValue(input);                  var t = targetProperties.Find(p.Name, false);             if (t != null && value != null)             {                 if (value.GetType() == typeof(string) || value.GetType() == typeof(Int64) || value.GetType() == typeof(int) || value.GetType() == typeof(Boolean))                 {                     t.SetValue(target, value);                      }                 else if (value.GetType() == typeof(DateTime) || value.GetType() == typeof(DateTime?))                 {                     if ((DateTime)value > DateTime.MinValue)                     {                         t.SetValue(target, value);                     }                      }                 else                 {                     t.SetValue(target, value.ToString());                 }             }              }


Making Class Diagram for MVC Pattern Project

I have a question about making a class diagram for an MVC based college senior project. If we have 2 actors of users in my system, lets say `Undergrad` and `Graduate` students are the children of abstract class called `User`. (Generalisation) Each actor has his own features. My question, in such case, do we need to have these two actors in separate classes which inherits from the abstract class `User`? even though, I'm going to implement them as roles using one Model called `User Model` ? I think you can see my confusion here. I code using MVC pattern, but I've never made a class diagram for this pattern. Thank you in advance!


Is it a betrayal of user privacy to publish server logs with IP addresses in them?

I have a web application with server logs that are attractive to researchers. Is it ethical or not to release the logs publicly? They contain visitor IP addresses and the user-agent but no more identity-related information than that.


Extend functionallity of a class: inheritance or java's dynamic proxy

Currently I have three classes and respective interfaces and respective builders:   * **Tree** : the data structure (implemented in `SimpleTree`)   * **ProbabilityTree** : is a `Tree` with added functionality to randomly select child nodes and to adjust the probability of selecting a node (implemented in `ProbabilityTreeImpl`).   * **DynamicTree** : is a `ProbabilityTree` which dynamically constructs nodes when a requested node doesn't exist yet. The client code needs Trees that support both random selection of nodes, as provided by `ProbabilityTree`, and the tree dynamically growing when yet unexisting nodes are requested, as provided by `DynamicTree`. _NOTE: Currently all three trees are immutable after having been build; for`DynamicTree` this means clients cannot add or remove nodes, but the tree itself can automatically change._ _NOTE: SeeGithub gist with the five Java classes for the code._ There are at least two issues with this design:   1. `DynamicTree` is derived from `ProbabilityTree`, while conceptionally these two capabilities are unrelated (i.e. orthogonal).   2. Using inheritance to add functionally is often considered "bad design" (correct me if I'm wrong here). * * * An alternative design would be to decouple `ProbabilityTree` and `DynamicTree` using something similar to the decorator and/or adapter pattern. Using Java's dynamic Proxy might enable "decorators" that extend the interface and that can decorate other `Tree`s with extended interfaces; i.e.:               TreeDecorator implements InvocationHandler, ... {         Tree adapted;         ...         Object invoke(Method method, Object[] args) {             if( «this class can/should handle method» ) {                 return method.invoke(this, args);             } else if ( «this.adapted can/should handle method» ){                 return method.invoke(adapted, args);             }         };     }      Again there are some issue's:   1. Using `Proxy` makes the code more difficult to understand. What shall I do? Use inheritance to extend functionallity, use dynamic proxy, or something else?


Can display issues affect SEO?

Can website display issues on certain platforms affect a website's search rankings and potentially hinder any SEO efforts?


Dependency Inversion Principle: How to define "high-level policy" and "low-level detail" to other people?

I am trying to explain the dependency inversion principle to my (mostly junior) colleagues. How can we define which one is the "high-level policy" and which one is the "low-level detail" in a software? For example, if our software automates workflow of several business applications, why do we say that the workflow automation is the high-level policy and the business applications are the details?


QFS (Quantcast File System): Scalable for medium "big data" problems or only for extremely large

I am doing some investigating and research into programming "big data", and am particularly interested in QuantCast (QFS) because it is written in my own favourite programming language, C++. Looking at how this may play a part in the solution to certain "big data" problems, I know this can manage implementation of peta-byte file systems. I would like to know however how scalable it is for big-data systems that are not as hugely big. I have seen a lot of comparisons between QFS and Hadoop, and how QFS can outperform Hadoop and so anyone who uses Hadoop may consider using Quantcast (if they just want mega performance). Essentially is it scalable for medium to large projects? (Someone asked the same about BDD but not Quantcast) (Also I have seen Hadoop and thus Quantcast being called a "database". I would call it a filesystem, on top of which you might build a database but wouldn't call it a database itself).


How might a simple IDE work? Algorithms/Pseudocode/etc

**Background** In a recent school software engineering module, I needed to developed a static program analyzer. Given a ficticious programming language source code, I need to analyze it, then the user can query about the program, eg. what statements uses this variable, which modifies, statements affected by another etc. **Possible link with IDEs** At first, it sounded very useless... it was a software engineering module but in reality more like some theoretical programming language module instead. However, some of these functionality could be what goes into the IDE's we use. So I was wondering how might some common IDE functionality be implemented. _**Static_ Program Analyzer (how to make it _dynamic/realtime_ )** In the project, we designed the analyzer for a _static_ program ... but who needs that? In the IDEs we use, everything is near realtime, as we type, syntax highlighting is done, the IDE's analyzes the code for errors, variables that are not used, etc. How is it done so efficiently? In the static analyzer, there is a parser that parses the source, builds AST & CFG. This can then be used to see if a variable is used by some statement etc. In reality what can be cached are cached. There are many areas that can be optimized, but I am not sure any (I can think of) can make it realtime. Some problems I can see are:   * As we type, things are incomplete, this will lead to a parsing error, but a real IDE somehow is smart enough to know where to continue parsing.    * As we type, things change very rapidly, we cannot parse the entire program. Even if I make the parser smart enough and parse only the changed line, I need to update my AST/CFG/expire relevant cache etc.  **In a real IDE, I don't see that CPU usage spikes as we type etc. How is it done?** Some might suggest looking at the source of some open source IDE eg. Eclipse or Netbeans. But I expect it to be really hard to understand such a big app by just reading code. What I hope to get is a high level _idea_ of how might a simple IDE (and some of the commonly used features) be implemented, a simple paragraph or some pseudocode etc. Some common features I can think of now are   * Refactoring (something like a contextual find and replace)   * Find usages   * Go to definition   * Auto complete (find all possible classes, variables, methods in context)   * Syntax highlighting For static code, some might be trivial to implement, but an IDE is _(near) realtime_


Audiobooks for programmers?

I'm a programmer with a two-hour round trip commute to work each day. I'd like to fill some of that time with audiobooks about software development. Any audiobooks that would help me become a better programmer would be appreciated. I'm thinking that books about design patterns and non-fiction about computing history might be good here, but I'm open to anything. Keeping in mind that I will be listening to this in a car, what are the best audiobooks that I can listen to? EDIT: Many people have also suggested podcasts. This is appreciated, but since podcasts arrive in a constantly arriving stream of data rather than as a finite amount of data, ways to juggle all of these different content streams would also be appreciated. To be more specific to my situation, my commuting vehicle has an MP3 CD player, USB input for MP3 files, and AUX input. I own Android and webOS devices that can be plugged into the AUX input.


Are unused CSS rules so costly that they must be removed?

I have been reading various Web application optimizing articles and many of them suggest to remove unused CSS rules. Currently, I have a page which has jQueryUI css, Bootstrap CSS, Datatables CSS and couple of more. All together they translate to about couple of thousands of rules ( my estimate ) and am quite sure I am using only 20-30% I asked my friend in UK who has very high speed broadband, to check the page load time and he says, like for every other page on his connection this one too loaded in a second which is quite suggestive that rendering time seems insignificant to the page load time. How much improvement is expected in removing unused CSS rules? Is it really worth it?


Would you purchase hardware with your own money to use at work to do your job better?

At work, I was given a reasonably-spec'ed machine (dual quad 2GHz, 4GB RAM, 160GB 7200RPM drive, Win7), but it was lacking in a few places (HDD / RAM). The IT staff was OK with me replacing hardware with my own, so now I'm sporting an SSD and an extra 8GB of RAM (so I can run multiple Visual Studios & virtual machines). I realize it was the company's business decision to pick the machines they did, but at the same time faster hardware made me happier and more productive at work. I guess my question is, am I the only one (self-employs not withstanding :) who's willing to spend personal money on their work hardware for a better quality of life, and should I approach it in a different way? Is it possible to retroactively say "I think you should reimburse me for this $500 in hardware because [blah]"?


How to make sure I don't end up with the blame

I'm working on a contract at present where I'm essentially working as a subcontractor for a fairly big digital agency. The real end customer is a big corp. So far, I have of course done an **_amazing_** job :)   * The agency had a "spec" up front - basically a "sitemap" for the app. This was my "blueprint".   * Inside the first week, I built a working prototype app complete with a new data service - which met the sitemap perfectly. Milestone formally accepted - lots of +ive feedback from the agency.   * In the second week I built and delivered a beautiful fully working CMS for the data (really, it's beautiful - I'm stunned). Milestone formally accepted - again lots of +ive feedback from the agency. Then the problems started... basically I needed the assets and design pack to complete the app and the project, and what the agency delivered was rubbish - unfinished photoshop files completely skipping half of the app and with every page having undecided A/B options. There's nothing decided in this design pack, so we can't even start on the next project phase. I flagged this with them a few times... they ignored me for a week, then came back with "what are you talking about? we finished the design pack weeks ago"... I then asked them if they'd looked at what they produced... they then looked at it and admitted it needed "some work". Since then it's been more delays and nothing delivered. The situation now is that:   * this project is now being delayed and delayed and delayed which is causing problems all over the place (with the customer, within the agency, within my schedule)   * I get the sense that the problems/delays are actually being blamed on "that subcontractor"   * my only contact in the project is one person in the agency - so no-one has any visibility of what the true situation is. I can cope with the delays and the problems, and I'm pretty sure I don't want to work with this current contact ever again. However, I'd really quite like to work for other people in this same agency in the future - and (in my dreams) I also wouldn't mind getting some contact with the end customer too. How can I avoid a "bum rap" on this project? Any ideas?


What's the best way to version a multi-component project

I have a program which is built of 5 major components. I find the standard version numbering too limiting because I would like to see what version each compoment is at. Has anyone found an easy way to do this other than list each separately?


Using gerrit (or similar tool) on a team where multiple devs work on a single feature

We have a team of roughly ~8 devs who regularly work on the same feature over the course of a 3 week sprint. It isn't quite pair programming, but in our current workflow devs regularly push up incomplete code for a colleague to complete. This worked fine before we introduced Gerrit, but now our commits need to represent chunks of test-passing, complete, logical functionality, and so the model breaks. My only idea is to have everybody push up to a separate, untracked branch up until the functionality is ready for review, then squash everything into commits that make sense and push up. Is there another Gerrit-ized workflow that could work? I know this is a widely discussed topic on Google Groups, and that there has recently been some discussion of Gerrit topic reviews, but I wanted to see if there is anybody out there using Gerrit in this way, and what the suggested workflow would be.


ELMAH - Where does it fit right...?

The question title may not be correct. I have worked in a very big ASP.NET web application (without using MVC), there I used a simple error handling strategy :   1. Enclose every statement in try..catch block   2. Have a error label on each page at the very top    3. If any exception occurs then show the error description on the Error Label. Now I am switching to a new project where MVC 3 framework is to be used, so I came across ELMAH. It is indeed a nice tool for error handling and logging. But as I read from many sites, it basically logs unhandled exceptions. If I use the same strategy that every statement in try..catch block and then show the error message on the page at the top, then where does ELMAH sit, how will it log the exception? Which exception will it log if I am not putting a single statement outside try..catch block. So there is no scope for the unhandled exception.


Keeping a project alive with a "skeleton crew"? Bad/good idea?

For political reasons, management seems intent on keeping a project progressing, but stripping away the most senior developers to perform other higher-priority tasks. Instead one more junior developer will be working on the project while consulting periodically with senior devs. Ostensibly the project will keep progressing, but at a much slower pace on the back burner. This seemingly satisfies both those that need the senior devs to fight fires and those that want to see the project continue to be worked on. In theory the senior devs will come back full time 6 mos from now to finish off the project. Is this a good idea? What problems could this cause? Would it be better to completely staff or completely halt the project and finish other stuff?


Should db be mapped directly to the UI or should there be multiple layers of enties/models with mappings to/from each?

I would like to know arguments for/against this concept. Technologies in use from the bottom up:   * MSSQL 2012 DB (exclusively accessed via sprocs)    * Entity Framework    * WCF Web Service    * ASP.NET Webforms Someone on my team would like to use Entity Framework to map the sprocs to ComplexTypes, and then use those ComplexTypes as DTOs, eventually using them as a view model to display on the page. His argument is that it's the fastest/easiest way and we'll get noticeable/valued changes more quickly. Also, he does not like the idea of the numerous mappings that would be necessary to go from DB -> Entity -> DTO -> ViewModel. Another consideration is, the majority of things from the DB are going one direction (db -> web), with only a few things actually needing to be changed on the UI and saved/persisted to the DB. To scope this question, there are thousands of previously existing sprocs written against poorly designed database structure (think tables that are 276 columns wide and single rows actually contain multiple entities). The poor structure isn't about to change soon because there are over 200 legacy apps written on top of it.


Animated requirements analysis flows with PPT or other software?

I've seen people do neat little PowerPoint shows that show data flowing in and out of a system that they use to wow a customer. Is this something you've done before? like show data in from source 1 and out to source 2? I've used mockups and DFD's but never presented anything in motion and I wonder if that adds value or ethos.


How to deal with ad-hoc mindsets?

I joined a dev team of six two month ago. People are nice, all is good. But more and more I observe an ad-hoc mindset. Stuff gets quick fixed, at the cost of future usability, there is little testing and two people happily admitted, that they like to carry the knowledge around in their head, rather than to write it down. How to deal with this? I'd like to lead by example, but time is limited - I like architecting _and_ actually implementing the stuff. But I'm afraid the ad-hoc mindset infects me and rather than striving for clearness and simplicity in design and code - which isn't simple to establish - I get pulled down the drain of an endless spiral of hacks on hacks - which no outsider can uncouple - just for schedule's and management's sake.


Database source control

Should database files(scripts etc.) be on source control? If so, what is the best method to keep it and update it there? Is there even a need for database files to be on source control since we can put it on a development server where everyone can use it and make changes to it if needed. But, then we can't get it back if someone messes it up. What approach is best used for databases on source-control?


What's the best way to use a kinect with multiple software music synthesizers?

For the past few months I've been looking into developing a Kinect based multitouch interface for a variety of software music synthesizers. The overall strategy I've come up with is to create objects, either programatically or (if possible) algorithmically to represent various controls of the soft synth. These should have;   * X position    * Y position   * Height   * Width   * MIDI output channel   * MIDI data scaler (convert x-y coords to midi values) 2 strategies I've considered for agorithmic creation are XML description and somehow pulling stuff right off the screen (ie given a running program, find xycoords of all controls). I have no idea how to go about that second one, which is why I express it in such specific technical language ;). I could do some intermediate solution, like using mouse clicks on the corners of controls to generate an xml file. Another thing I could do, that I've seen frequently in flash apps, is to put the screen size into a variable and use math to build all interface objects in terms of screen size. Note that it isn't strictly necessary to make the objects the same size as onscreen controls, or to represent all onscreen objects (some are just indicators, not interactive controls) Other considerations; Given (for now) two sets of X/Y coords as input (left and right hands), what is my best option for using them? My first instinct is/was to create some kind of focus test, where if the x/y coords fall within the interface object's bounds that object becomes active, and then becomes inactive if they fall outside some other smaller bounds for some period of time. The cheap solution I found was to use the left hand as the pointer/selector and the right as a controller, but it seems like I can do more. I have a few gesture solutions (hidden markov chains) I could screw around with. Not that they'd be easy to get to work, exactly, but it's something I could see myself doing given sufficient incentive. So, to summarize, the problem is   * represent the interface (necessary because the default interface always expects mouse input)   * select a control   * manipulate it using two sets of x/y coords (rotary/continuous controller) or, in the case of switches, preferrably use a gesture to switch it without giving/taking focus. Any comments, especially from people who have worked/are working in multitouch io/NUI, are greatly appreciated. Links to existing projects and/or some good reading material (books, sites, etc) would be a big help.


What is the best way to prove that in-code documentation is greater than extensive external documentation?

What is the best way to prove to my boss that in code documentation is greater than extensive external documents containing documentation and screenshots of code/ui? We have a group in the company running SAP code. Their documentation process involves hours of laborious documentation and screenshots of the code and the interface (before and after). They want us (C# developers) to follow the same rubric as they do. I want to argue that using comments in the code, and a great, self documenting language such as C# is fulfilling the need for documentation the same as, or greater than the other team's document method. Is there any published research by big companies that say external documentation is out dated and that in code comments are more efficient? (or something similar to this point) Edit - This has nothing to do with users. this is NOT user training documentation. Only internal use Edit Edit - This has nothing to do with Design Documents or Architectural Documents. Its comparing screenshots of code, before and after a change, and screenshots of forms, before and after the change, and putting them into a document with extensive documentation, opposed to simply having great incode documentation. Would you really want to have to screenshot your code before and after every single baby change and then write a document explaining the change in great depth? when no one will ever use these documents as reference material in the future?


How do I fix and prevent corrupted MySQL tables?

We have developed software that uses MySQL. After some months of usage, some of the database tables had been corrupted and need to be repaired. Because of the corruption,we are not able to create a backup using Navicat, and we can not generate a dump too. The log file has been indicating the following error for more than 2 days:               YYMMDD HH:MM:SS [ERROR] /usr/sbin/mysqld: Can't open file: 'ini.MYI' (errno:145)      What is the cause of this corruption? How can we fix them? How can we prevent the database tables from corruption in the future?


Should I limit my type name suffix vocabulary when using OOP?

My co-workers tend to think that it is better to limit non-domain type suffixes to a small fixed set of OOP-pattern inspired words, e.g.:   * *Service   * *Repository   * *Factory   * *Manager   * *Provider I believe there is no reason to not extend that set with more names, e.g. (some "translation" to the previous vocabulary is given in brackets):   * *Distributor (=> *DistributionManager or *SendingService)   * *Generator   * *Browser (=> *ReadonlyRepositoryService)   * *Processor   * *Manipulator (=> *StateMachineManager)   * *Enricher (=> *EnrichmentService) (*) denotes some domain word, e.g. "Order", "Student", "Item" etc. The domain is probably not complex enough to use specialized approaches such as DDD which could drive the naming.


Helper functions - well defined inputs or well defined outputs?

### Problem In Codeigniter (PHP framework), I am trying to create a helper function that will inject an ActiveRecord (for MySQL) command into a chain of existing ActiveRecord calls. The reasoning for this is that the current ActiveRecord commands available are not reliable enough, and produce differing results depending on what parameters are passed in. For example:               $param = "";     $this->db->where('field', "");      produces               WHERE `field` = ""      This would provide a result set where **only blank fields were returned**. This is not always the intended behavior, as the input comes from a web form, and may be the result of no specific query being submitted - thus **all results should be returned instead**. ### Attempted solution What I decided to come up with, was a helper method that would take in a set of unknown inputs, and return a result set that would match my desired behavior (eg. return all results or return none). Using test cases and a test method to abstract the desired set of inputs and outputs away, I hoped to produce an easy-to-call method for coercing the database results into my desired behavior. This would be easier then say, **coercing the input into an expected type** , and then using the unreliable behavior of Codeigniter's ActiveRecord commands. My main concern however, is that my helper function may be trying to do too much - my colleague described it as a magic method that takes anything and may have arcane implementation details. It would thus be less readable than the ActiveRecord convention (which is more well-known) and harder to maintain. Is my function the best way to go about it, or are there better alternatives out there?


Rails: Useful example of delegate and Law of Demeter

I am currently learning about `delegate` and the Law of Demeter. I understand the Law of Demeter, but I can't seem to find a good example of where using `delegate` to avoid breaking the law would actually even be useful. I want to find an example related to my project, since I have to give a presentation. The only line of code that I found that could possibly be breaking the Law of Demeter is the following: `@game.promotions.find_by_promo_type("cross")` The model `Game` `has_many` `Promotions` and it is reaching across another model to execute a `find` call based on promotions attribute `promo_type`. From my understanding this is a violation of the Law of Demeter, and I should implement the following solution.               class Game < ActiveRecord::Base        has_many :promotions             delegate :find_by_promo_type, :to => :promotion     end      Can you give me an example where this would actually be useful besides "the Law of Demeter says so". The only thing I can think of, is for some reason I wanted to change the name of `promotions` to `promos`, then the solution would be useful because I would only need to make the following change and `:find_by_promo_type` will still work for `Game`               class Game < ActiveRecord::Base        has_many :promos             delegate :find_by_promo_type, :to => :promos     end      The only thing is, I believe this argument is flawed. If I were to change a models name, I would also have to refactor code in many other places that don't even break the Law of Demeter. It's hard to believe that this is all the Law of Demeter can accomplish in regards to this example. Can somebody please help me understand this.


SQLite resources or any other storage concept for mobile applications?

I would like to know what storage concepts are used for mobile or handheld devices, where an app is operated on?. AFAIK one of them is SQlite. Can anyone shed a light on this concept? perhaps links and resources will be much useful to many of new developers. Thanks a ton.:) EDIT: My target would be Android and ios OS.


What ever happened to the Defense Software Reuse System (DSRS)?

I've been reading some papers from the early 90s about a US Department of Defense software reuse initiative called the Defense Software Reuse System (DSRS). The most recent mention of it I could find was in a paper from 2000 - A Survey of Software Reuse Repositories > ### Defense Software Repository System (DSRS) > > The DSRS is an automated repository for storing and retrieving Reusable > Software Assets (RSAs) [14]. The DSRS software now manages inventories of > reusable assets at seven software reuse support centers (SRSCs). The DSRS > serves as a central collection point for quality RSAs, and facilitates > software reuse by offering developers the opportunity to match their > requirements with existing software products. DSRS accounts are available > for Government employees and contractor personnel currently supporting > Government projects... > > ...The DoD software community is trying to change its software engineering > model from its current software cycle to a process-driven, domain-specific, > architecture-based, repository-assisted way of constructing software [15]. > In this changing environment, the DSRS has the highest potential to become > the DoD standard reuse repository because it is the only existing deployed, > operational repository with multiple interoperable locations across DoD. > Seven DSRS locations support nearly 1,000 users and list nearly 9,000 > reusable assets. The DISA DSRS alone lists 3,880 reusable assets and has 400 > user accounts... > > The far-term strategy of the DSRS is to support a virtual repository. These > interconnected repositories will provide the ability to locate and share > reusable components across domains and among the services. An effective and > evolving DSRS is a central requirement to the success of the DoD software > reuse initiative. Evolving DoD repository requirements demand that DISA > continue to have an operational DSRS site to support testing in an actual > repository operation and to support DoD users. The classification process > for the DSRS is a basic technology for providing customer support [16]. This > process is the first step in making reusable assets available for > implementing the functional and technical migration strategies. > > ...   >  [14] DSRS - Defense Technology for Adaptable, Reliable Systems   >  URL: http://ssed1.ims.disa.mil/srp/dsrspage.html   >  [15] STARS - Software Technology for Adaptable, Reliable Systems   >  URL: http://www.stars.ballston.paramax.com/index.html   >  [16] D. E. Perry and S. S. Popovitch, “Inquire: Predicate-based use and > reuse,''   >  in Proceedings of the 8th Knowledge-Based Software Engineering Conference, > pp. 144-151, September 1993.   >  ... Is DSRS dead, and were there any post-mortem reports on it? Are there other more-recent US government initiatives or reports on software reuse?


Suggesting albums based on friends' top ten lists

Just wondering if someone could suggest a good algorithm in the collaborative filtering vein that I could use to suggest music choices based on top ten lists. This is a personal project, I am a member of a private music blog where most of the users recently submitted "best of 2011" lists. The lists range in size (say 10-50 albums) and are not ranked. Have around 100 lists. Basically hoping to give each user some recommendations based on the correlation of their list with everyone else's.


Ideas on the best way to structure my app in Xcode

I'd like my app to show locations of nearby restaurants, with different categories. It would have a screen with a button to select which categories should be shown. Depending on which button is pressed, map pins come up at nearby locations, and the pins can be pressed for more information. For storing all the restaurant data, should I create a list using 'enum', similar to the Apple sample code 'MapCallouts'?


Ideas for scraping a home-brewed Php-powered bug system

I work at a large company, and we are stuck with a crappy home-baked bug tracking tool, which does too many things half-decently, but it search functionality is next-to-impossible to use (has about 80 fields that one has to / can fill out) and the search needs to be precise. We have many duplicate bugs filed that are never consolidated, plus pulling up all bugs filed against some product in some version just will not be easy AT ALL. Getting rid of the current system is a political and strategical impossibility. Hundreds of people are tied into it. What I am hoping to do it iterate over bugs 1 through however many (there is a way, I believe) and then save the resulting HTML pages named 'bug000001.html', 'bug000002.html', etc. After that I would want some sort of Google-Style full text indexing going. What we have is so bad, that doing this would be worthwhile. Bugs do not change that much over time, so I am not that worried about being out-of-sync with the original - it will not be great. So, my question is: suppose I have downloaded the html files in the same folder. What free and open source tool can I use then that would allow fuzzy search on the content? I realize that I can concoct a specific regex every time I search that would probably do the task, but I would like to make this even easier, where mis-spellings do not hurt. I realize that Google's full power of personalized, history-based search will probably not be accessible to me, but I will gladly settle for something close, that is free and easy to use. If you have suggestions for a good free and open source tool/Python library that I can use to automate simple browser actions, such as entering text into a textbox, clicking the button and then saving the content into an HTML file, then please list that as well, although that probably should be a separate question. **EDIT** I do not have access to the source code for PhP front end or back end; this is all locked away by socialists on another continent.


Providing work experience on my resume

I have a question in writing my resume. I am looking for a career in Java/J2EE etc., I had worked as a teaching assistant for Data Structures in Java. This was from Aug 2009-May 2010. I got internship on PHP during May 2010 and as PHP developer in my univ as RA during Jan 2011 to May 2011. Since I am looking for a long term career in java should I mention the teaching assistant position i.e., Aug 2009- may 2010 at the top or the most recent experience at the top in my experience list.


Is "code that generates code" really all that great?

I was looking through CodePen's "popular pens" and I noticed this cool little spiral animation somebody made with a seemingly ridiculously small amount of code. This is quite impressive until you click the headings for HTML and CSS to show the "compiled" versions of the same code. Suddenly the 3 lines of HAML and ~40 lines of SCSS turns into a gigantic monster of repetition. Here's where my question comes in: Is it acceptable to do something like this in practice? Don't get me wrong - I love using preprocessors to help me write code faster, but in some cases it looks like it's an automatic copy-paste machine.


Is there a name for "More events than expected" bug?

Is there a **name for a family of bugs** , that are caused by assumption, that user would generate only 1 event during the execution of the handler ? Simplest example is: animation triggered by click, which can run several copies of itself, if user rapidly clicks several times.


Help in (re)designing my Swing application

I have developed a Swing application that controls execution of several scripts like jobs. I need to display the interim output of the jobs concurrently. I have followed MVC while writing the application. The application is working as expected. But off late I have the following requirements in hand:     1. A few of the script jobs need special user privileges to execute so as to access specialized resources. There seems to be no way in Java to impersonate as a different user while running an application.[examined in this question]. Also trying to run the Swing application as a scheduled task in windows is not helping.   2. Once started the jobs should be running even if the user logs off after starting the jobs. I am thinking of separating the execution logic from the UI and run that as a service; and introduce JMS in between the two layers so as to store/retrieve the interim the output. Note: I need to run this application on windows. Any ideas on meeting my requirements, will be highly appreciated.


What are the design principles that promote testable code? (designing testable code vs driving design through tests)

Most of the projects that I work on consider development and unit testing in isolation which makes writing unit tests at a later instance a nightmare. My objective is to keep testing in mind during the high level and low level design phases itself. I want to know if there are any well defined design principles that promote testable code. One such principle that I have come to understand recently is Dependency Inversion through Dependency injection and Inversion of Control. I have read that there is something known as SOLID. I want to understand if following the SOLID principles indirectly results in code that is easily testable? If not, are there any well-defined design principles that promote testable code? I am aware that there is something known as Test Driven Development. Although, I am more interested in designing code with testing in mind during the design phase itself rather than driving design through tests. I hope this makes sense. One more question related to this topic is whether it's alright to re-factor an existing product/project and make changes to code and design for the purpose of being able to write a unit test case for each module?


using source control to create release notes?

Lets say i have an off the shelf eccomerce cart. I put all the code inside subversion. I start to make changes and check the code changes back in. is it possible to then display each "check in" with the developer messages so that i can make release notes? I would like to use this for actual quoted time.


ISerializable vs WCF attributes

In C# .NET there is two main possibilities to serialize and object.   1. Implementing the **ISerializable** interface?   2. Using the [DataContract/DataMember] serialization **attribute** of WCF? What are the differences of this two possibilities and what is the better in term of execution time.


How to maintain synchronised state across threads - is this a good use for a Singleton?

I hear a lot about "Singletons are always bad" around the place. I don't hate on them to that degree but I try not to use them if I have a better alternative. In this case I have a system that handles a lot of requests, each of which comes in on its own thread. Every request that comes in needs to be allocated its own unique sequential Id. Currently I have a Singleton class whose role is to initiate this Id at start- up then maintain it while the system runs. The Singleton is created/retrieved and the Id value incremented in a thread safe way, as one would expect. It is actually handed out to the threads on creation by Dependency Injection, but the core of the class is a classic Singleton built around a static representation of the current Id value. Given that we are only likely to do more work that requires a multi-threaded approach, I would be interested to know whether there is a way I could implement this type of functionality in a way that allows data to be maintained synchronously across threads that are otherwise unaware of each other, without using the much feared Singleton pattern?


How to avoid reinventing the wheel when using complex frameworks?

For the backstory, I'm developing a GUI application in C#/WPF. I already had in my code quite many instances of               <ComboBox ItemsSource="{Binding Items}">         <ComboBox.ItemTemplate>             <DataTemplate>                 <TextBlock Text="{Binding ItemName}"/>             </DataTemplate>         </ComboBox.ItemTemplate/>     </ComboBox>      when I accidentally stumbled upon `DisplayMemberPath` during a marginally related StackOverflow search, which makes the above               <ComboBox ItemsSource="{Binding Items}"               DisplayMemberPath="ItemName"/>      Now `ComboBox` has 158 public properties, and I really doubt that I should read all of their descriptions before even starting to use a ComboBox. On the other hand I'm really afraid of encountering this problem on a larger scale, since this is my first WPF app and I sometimes get the feeling of doing it wrong. Note that online tutorials apart from the official documentation are very unreliable, often wrong and/or poorly written; at least I found it hard to find a good one. On the other hand, any programming books I've encountered went into too much detail, taking whole chapters explaining things that were obvious to me after the first paragraph, so I skipped a lot of parts. _When using a complex framework or library, how can I avoid accidentally skipping a relevant part of the impenetrably huge documentation, therefore creating unnecessary work for myself?_ I don't think this is a duplicate of What kind of process should I use to learn a big system? or How do you dive into large code bases?, because these are about learning a codebase that you have to understand/work on/modify/improve, also assuming that you have access to the code itself. My question is about being a user of a framework, and the task at hand is "given the huge official documentation and Google, efficiently find those parts of the framework that I can use to make my work easier".


Unit testing - should tests for a method validate the results of other methods?

One thing bothers me while I'm writing unit tests of my code. did tests of method should include validation of outcome from other methods? Of course, public methods. Let's go to - rather trivial - example:               public int Solve(string forumla)     {         if (forumla.Contains("+"))         {             return SolveAddiction(formula);         }         if (forumla.Contains("-"))         {             return SolveSubstraction(formula);         }         throw new ArgumentException();     }          public int SolveAddiction(string formula)     {         var strings = formula.Split('+');         if (strings.Length != 2)         {             throw new ArgumentException();         }         int firstFactor = int.Parse(strings[0]);         int secondFactor = int.Parse(strings[0]);         return firstFactor + secondFactor;     }      In this case, should tests of `Solve` methods only test control flow, or each possible scenarios for `SolveAddiction`? Let's assume, that `SolveAddiction` and `SolveSubstraction` have they own tests. Using other words, did test scenarios for `Solve` should contains only:   * 2+2   * 2-2   * 2:2 Or also include:   * 2+2+2+2   * 2-2-2-2   * potato - hamster Best regards


And if I ask the job interviewer for reasons to join the company?

In job interviews I am frequently asked if I know the company, explain why do I think I would be the best choice for this company, etc and I have never liked this kinds of questions. Using your experiences in job interviewing, what do you think it would happen if I ask the interviewer to explain me why he think the company is the best company for me and why I should accept their answer? Do you think it would be a good think or bad thing to do? Edit: the idea of the question would not be to "challenge" the interviewer. The idea of the question would be to see what he thinks about the company, what values he thinks are given importance inside the company and what are the strong points of the company.


Suggested Web Application Framework and Database for Enterprise, “Big-Data” App?

I have a web application that I have been developing for a small group within my company over the past few years, using Pipeline Pilot (plus jQuery and Python scripting) for web development and back-end computation, and Oracle 10g for my RDBMS. Users upload experimental genomic data, which is parsed into a database, and made available for querying, transformation, and reporting. Experimental data sets are large and have many layers of metadata. A given experimental data record might have a foreign key relationship with a table that describes this data point's assay. Assays can cover multiple genes, which can have multiple transcript, which can have multiple mutations, which can affect multiple signaling pathways, etc. Users need to approach this data from any point in those layers in the metadata. Since all data sets for a given data type can run over a billion rows, this results in some large, dynamic queries that are hard to predict. New data sets are added on a weekly basis (~1GB per set). Experimental data is never updated, but the associated metadata can be updated weekly for a few records and yearly for most others. For every data set insert the system sees, there will be between 10 and 100 selects run against it and associated data. It is okay for updates and inserts to run slow, so long as queries run quick and are as up-to-date as possible. The application continues to grow in size and scope and is already starting to run slower than I like. I am worried that we have about outgrown Pipeline Pilot, and perhaps Oracle (as the sole database). Would a NoSQL database or an OLAP system be appropriate here? What web application frameworks work well with systems like this? I'd like the solution to be something scalable, portable and supportable X-years down the road. Here is the current state of the application:   * Web Server/Data Processing: Pipeline Pilot on Windows Server + IIS    * Database: Oracle 10g, ~1TB of data, ~180 tables with several billion-plus row tables    * Network Storage: Isilon, ~50TB of low-priority raw data


GPL licensed software installed on commercial hardware

Do vendors need to provide sources, at the customer's request, for GPL licensed software installed on the hardware they sell? For example, a vendor sells an IPTV box and pre-installs some proprietary software product which is linked with some GPLed library. As a consequence, the software becomes GPLed itself.   Does the vendor need to provide the source code for it? The vendor doesn't sell that software, he sells hardware.


git tagging comments - best practices

I've adopted a tagging system of x.x.x.x, and this works fine. However, you also need to leave a comment with your git tag. I've been using descriptions such as "fixes bug Y" or "feature X", but is this the best sort of comment to be leaving? Particularly, what if a tag encompasses several fixes, it seems not to make sense to have a very long tag comment. Does this mean that I should be creating a tag for every bug fix or feature, or should the tag comments be reflective of something else? I have a few ideas that may be good, but I'd love some advice from seasoned git tagging veterans :) For those who prefer specific examples:               1.0.0.0 - initial release     1.0.0.1 - bug fix for issue X     1.0.0.2 - (what if this is a bug fix for multiple issues, the comment would be too long, no?)      Another example, in this example, the comments are more or less the same as the tags, it seems redundant. Is there something else we could be describing? https://github.com/osCommerce/oscommerce2/tags


What is tabular programming?

The Falcon programming language advertises itself as supporting tabular programming: > Falcon provides six integrated programming paradigms: procedural, object > oriented, prototype oriented, functional, tabular and message oriented. And > you don't have to master all of them; you just need to pick the ingredients > you prefer, and let the code follow your inspiration. The documentation expands a bit on how the language's flavour of tabular programming works, but it's focused on the language's own structures and syntax, and doesn't really explain the benefits of the paradigm (except of course those that are obvious from the simplistic examples). I'm a bit confused on how the whole thing works internally, from what I understand Falcon's `Table` is a native structure that works more or less as a relational table and could be described (in OO vernacular) as a native Record Set with relational querying capabilities. A horrible description, I know (blame my OO roots and years of abusing tequila). Could you help me get a better idea of what tabular programming is all about and how it works internally? **Clarification:** I am _not_ asking about Tabular Model Programming.


Why isn't the Microsoft Public License compatible with the GPL?

According to this GNU Project page, regarding Microsoft Public License (Ms- PL): > This is a free software license; it has a copyleft that is not strong, but > incompatible with the GNU GPL. They do not explain _why_ it is incompatible. I cannot find any satisfactory answers nor explanations via Google.


Automatic denormalization for a NoSQL database application

We have a use case where we store table-like data, but we know about the schema of the data only at runtime. In our application, a power user defines a schema and normal user can create records and make relations between those records. The problem that we are having is that when doing complex queries over the related "tables" (one could say, joins) with filtering and sorting, stuff becomes slow, which is logical. To give an example. Lets say we have an article table with 1M rows and supplier table with 500 rows. Some suppliers have 50K articles. Now lets say I want to get all the articles from that supplier, but sorted by the article name. This query is slow. Which is not strange as it basically creates some sort of temporary table/result, which it needs to sort, but it cannot do it fast as there is no index on a temporary table/result. Our current solution uses Neo4j, but I also tried this on orientdb and in both cases queries are slow, because of the same behavior. Now we have solved this problem for now by creating indexes at runtime based on the schema the user provided, denormalizing articles and suppliers in one index. The problem is that keeping this index up-to-date is very cumbersome. Lets say we want to filter on the articles table on its supplier name. Now the supplier name is in the index, but it has been replicated 50K times in the above example. So if the user changes the name of the supplier, 50K index records need to be updated. Giving us all sorts of performance headaches and timing issues such as what happends if the user in a couple of seconds changes the supplier name twice, we need to queue the operations. Etc etc. So my actual question, is there a clean, non-cumbersome way to automatically denormalize or index out of the box, for a system where the DB schema can change at run-time?


How to scope code base health when interviewing for new a company?

I've recently started working for an awesome company, on a product which is a steaming pile once you go under the hood. Apart from asking for a code review (which I doubt I'd get anyway), what are the ways of estimating code quality when interviewing?


How to implement change and new tools in a small dev team?

I have been tasked with producing a plan for implementing a slight change to the work of our developers (there are eight of us working at this company). The change affects a small portion of our work, but introduces a new tool that the developers aren't familiar with, and a new "step". _Very_ schematically the change looks like this Before change:   1. Write stuff   2. Do thing X After change:   1. Write stuff   2. Use tool A   3. Use tool B to do thing X What I have done so far is that I've written documentation for the use of tool A and tool B. My question is what should you be keeping in mind when introducing new tools/changes in development to a small development team? How do you assure that the transmission to the new way of doing things is smooth? What type of educational resources should be available? (The tools introduced are for version control of database schema [so it's only when we make changes the database schema that our development is affected], but I figured that was irrelevant to the topic)


Are there any unions for software developers?

Why does Software Engineering not have union representation like other professional occupations, such as teaching? Are there any unions for software developers that exist and are successful?


What is right choice of Data Access Layer for large application

I am using Singleton pattern for my application, I have used ADO.NET Entity framework as my Data Access Layer, after login to my application, it's taking 3 to 5 minutes to load the dashboard. Is there a way to reduce the time? Or I have to look for some other methods instead of Entity framework?


Should a structure be refactored into smaller structures?

In one of the projects (in C), I have the code that looks like this ( ** _the names are obfuscated specially for question to not give out details of the probject_** ):               typedef struct Module_s {         /* These fields are parsed by f1() */         S1 *s11;         S2 *s12;         size_t n11;         size_t n12;         int i11;              /* These fields are parsed by f2() */         S2 *s21;         S3 *s22;         S4 *s23;         char *c24;              /* These fields are set by f3() and later */         void *v31;         bool b32;         S5 s33[N];         bool b34;     } Module_t;          {         /* Read only header of file and          * parse first 5 fields to determine how to load the rest. */         Module_t *module = f1(input_file);              /* Read the rest of file using information set by f1()          * and determine how f3() should preprocess it. */         f2(input_file, module);              /* Preprocess the file using information provided by f1() and f2(). */         f3(module);              /* Process the file using the information provided by f2() and f3(). */         f4(module);     }      Then, the question is, is it a good move to separate the `Module_t` into 3 smaller chunks, which will contain corresponding fields, set by each function? Then each function will only accept and return a smaller part of `Module_t`, which is probably good, but may complicate further development as interconnections become more complex — and keeping all the dependent fields in one place looks simpler. What I have in mind is this:               typedef struct SS1_s {         /* These fields are parsed by f1() */         S1 *s11;         S2 *s12;         size_t n11;         size_t n12;         int i11;     } SS1_t;               typedef struct SS2_s {         /* These fields are parsed by f2() */         S2 *s21;         S3 *s22;         S4 *s23;         char *c24;     } SS2_t;               typedef struct SS3_s {         /* These fields are set by f3() and later */         void *v31;         bool b32;         S5 s33[N];         bool b34;     } SS3_t;               typedef struct Module_s {         SS1_t ss1;         SS2_t ss2;         SS3_t ss3;     } Module_t;               {         /* Read only header of file and          * parse first 5 fields to determine how to load the rest. */         SS1_t *ss1 = f1(input_file);              /* Read the rest of file using information set by f1()          * and determine how f3() should preprocess it. */         SS2_t *ss2 = f2(input_file, ss1);              /* Preprocess the file using information provided by f1() and f2(). */         SS3_t *ss3 = f3(ss1, ss2);              /* Compose module and          * process the file using the information provided by f2() and f3().          * Store ss1 as well for future use. */         Module_t module = f4(ss1, ss2, ss3);     }      So, should I refactor the structure into smaller substructures?


Where should CMS data logic go

We have a large web site written in `WebForms` and have begun implementing some new modules in MVC. We have a custom CMS in place. I put the data structure to hold CMS data in a `BaseModel` class. Now I`m wondering where would be the best palce to put the logic which calls the CMS data manager to get data relevant to the page. On one hand, I can create a `BaseModel`, which in its constructor receives a page Id, and calls the CMS manager. Then build all models on that model. On the other hand, I can do the same in a `BaseController`. I can't decide which is more correct, since I cannot think of any advantage one will have over the other. Most of my experience is in `WebForms`, so I am wondering what would be the more ASP.NET MVC way of placing this logic.


Do RESTful APIs tend to encourage anemic domain models?

I'm working on a project in which we are trying to apply both domain-driven design and REST to a service-oriented architecture. We aren't worrying about 100% REST compliance; it would probably be better to say we are trying to build resource-oriented HTTP APIs (~Level 2 of Richardson's REST maturity model). Nevertheless, we are trying to stay away from RPC-style use of HTTP requests, i.e. we attempt to implement our HTTP verbs according to RFC2616 rather than using `POST` to do `IsPostalAddressValid(...)`, for example. However, an emphasis on this seems to be at the expense of our attempt to apply domain-driven design. With only `GET`, `POST`, `PUT`, `DELETE` and a few other rarely used methods, we tend to build CRUDdy services, and CRUDdy services tend to have anemic domain models. `POST`: Receive the data, validate it, dump it to the data. `GET`: Retrieve the data, return it. No real business logic there. We also use messages (events) between the services, and it seems to me that most of the business logic ends up being build around that. Are REST and DDD at tension at some level? (Or am I misunderstanding something here? Are we maybe doing something else wrong?) Is it possible to build a strong domain model in a service-oriented architecture while avoiding RPC- style HTTP calls?


Build tools for php, html, css, js web app development

What are some recommendations for a build tool that would allow me to upload changes to a web server or a repository and minify the js and css automatically, and possibly even run Closure compiler on the JavaScript? I'm not worried about doing anything with the php code other than update with most recent changes although in the future would like to have phpdoc updated automatically. Just wondering if there is some way to do all this other than an amalgam of scripts that run or have to be invoked every time?


Low level Linux graphics

For educational purposes, I'd like to write an application on a Linux environment that can process keyboard events and draw graphics without huge dependencies like X or SDL. I presume that this must be possible, because X and SDL are just programs themselves, so they must rely on other methods inherent to the environment. Is this understanding correct? If so, where might I learn to write such a program? My limited experience tells me that it would involve making calls to the kernel, and/or writing to special files; however, I haven't been able to find any tutorials on the matter (I am not even sure what to Google). Also, in case it is relevant, I am running Debian Squeeze on Virtualbox. I have used a netinst cd without networking, so there isn't much installed on it currently. I will install `gcc`, but I am hoping I can get by with nothing more.


reloading singleton classes and dependency

I have a singleton object. It's a DAO that looks somewhat like this (pseudoish code):               class UsersDAO {       public usersDAO init(string sDSN){         variables.sDSN = sDSN;              return this;       }            public array getUsers(){         //do a query to get users, make into array              return aUsers;       }     }      my applications makes an instance of this and uses it throughout the codebase, but I also have another DAO that requires it:               class OrganisationsDAO {       public OrganisationsDAO init(UsersDAO oUsersDAO,string sDSN){          variables.sDSN = sDSN;          variables.oUsersDAO = oUsersDAO;               return this;       }            public array getUsersOrganisations(){         variables.aUsers = variables.oUsersDAO.getUsers();              //getOrganisations for the returned users              return aOrganisations;       }     }      so to make the OrganisationsDAO object I need to pass it the UsersDAO. At a later point in my applications life, I need to update the UsersDAO to include a `public user getUser(int userid)` function. I'm wondering, is there a way of passing through the new UsersDAO to objects that depend on it, without having to restart the application. In this instance the application is a website rather than a desktop based application.


What is the purpose of RESTful URIs for POST/PUT/PATCH/DELETE methods?

In the process of conceiving a web application framework, I spent some time pondering the notion of RESTful paths. If I wanted to create e.g. a new topic, I might send a POST request to /topics. The parameters thereof might be something like: `{ topic: { body: 'Body' } }` As such, the type of resource being created can be inferred from the parameters. Since there is the top-level item 'topic', we can logically ascertain that the request is to create a topic. For me, the strange thing is that POST create is the one action that falls outside of the notion of either a singular resource or a collection. It is arguably neither. Sure, you're adding to a collection, but in contrast to say a `GET index` you are not retrieving any part of that collection, and the state of that collection to a large extent is irrelevant. In contrast to a `GET`, `PUT/PATCH`, or a `DELETE`, you are not retrieving a singular item based on an identifier. You are creating an item where one does not exist. I conceived of a "master registrar" service that would respond to all incoming `POST`requests. Imagine every form `POST`ing to `/`, with the master registrar determining the intended resource based on the params, and deferring to services that exist for the purpose of persisting a resource based on those params. In fact, for any non-GET action, the paths become irrelevant. They don't seem to have an important semantic purpose. A user is not going to link to a form's action URL. Even in the case of `PUT`, `PATCH`, or `DELETE` The type of resource being created or the resource being modified can be inferred from the parameters. For example, if we were editing a topic versus creating one, the parameters might be `{ topic: { id: 1, body: 'New Body'} }`. The presence of an ID in the parameters indicates that the topic in question already exists and should be retrieved foremost. I don't know if this is RESTful or not. Regardless, I cannot see why this approach is invalid or inadvisable. Given my caution and naivete, however, I'd like to know why it might be.


How much data should be required in a request to a webservice?

When recieving data from clients how much data that you provided to them should you require back from them? For example when clients order a product from a webservice should they just need to provide a product code? The other alternative would be to require the product code product name and product price ect. I have alway built webservices the former way with the minimum of data returned back to me, however I have just been consuming another web service that requires the vast majority of the data returned back to them. What are the advantages of the second way?


Designing for an algorithm that reports progress

I have an iterative algorithm and I want to print the progress. However, I may also want it _not_ to print any information, or to print it in a different way, or do other logic. In an object oriented language, I would perform the following solutions: **Solution 1: virtual method** have the algorithm class MyAlgoClass which implements the algo. The class also implements a virtual reportIteration(iterInfo) method which is empty and can be reimplemented. Subclass the MyAlgoClass and override reportIteration so that it does what it needs to do. This solution allows you to carry additional information (for example, the file unit) in the reimplemented class. I don't like this method because it clumps together two functionalities that may be unrelated, but in GUI apps it may be ok. **Solution 2: observer pattern** the algorithm class has a register(Observer) method, keeps a list of the registered observers and takes care of calling notify() on each of them. Observer::notify() needs a way to get the information from the Subject, so it either has two parameters, one with the Subject and the other with the data the Subject may pass, or just the Subject and the Observer is now in charge of querying it to fetch the relevant information. **Solution 3: callbacks** I tend to see the callback method as a lightweight observer. Instead of passing an object, you pass a callback, which may be a plain function, but also an instance method in those languages that allow it (for example, in python you can because passing an instance method will remain bound to the instance). C++ however does not allow it, because if you pass a pointer to an instance method, `this` will not be defined. Please correct me on this regard, my C++ is quite old. The problem with callbacks is that generally you have to pass them together with the data you want the callback to be invoked with. Callbacks don't store state, so you have to pass both the callback and the state to the `Subject` in order to find it at callback execution, together with any additional data the `Subject` may provide about the event is reporting. **Question** My question is relative to the fact that I need to implement the opening problem in a language that is not object oriented, namely Fortran 95, and I am fighting with my usual reasoning which is based on python assumptions and style. I think that in Fortran the concept is similar to C, with the additional trouble that in C you can store a function pointer, while in Fortran 95 you can only pass it around. Do you have any comments, suggestions, tips, and quirks on this regard (in C, C++, Fortran and python, but also in any other language, so to have a comparison of language features that can be exploited on this regard) on how to design for an algorithm that must report progress to some external entity, using state from both the algorithm and the external entity ?


proposed algorithm and representation of an algorithm

What is the difference between an ambiguity in a proposed algorithm and an ambiguity in the representation of an algorithm? I have done some research and found out that ambiguity in the representation of an algorithm is when the representation can be understood by a group of people and not clear to another group e.g. a layman and a programmer.


Which benchmarking software would you use to evaluate the performance of your development rig?

I have been tasked with evaluating a new PC for our dev team that is spec'd only slightly better than our current models. Could anyone recommend appropriate benchmarking software that would be useful to emulate typical development tasks?


Are there architecture smells?

There are tons of resources on the web referring to and listing code smells. However, I've never seen information on _architectural smells_. Is this defined somewhere, and is there a list available? Has any formal research been done into architecture defects, and their impact on project speed, defects, and the like? **Edit:** I wasn't really looking for a list in the answers, but documentation (on the web or in a book) about architecture smells.


Which http response do you return to a hit from a blacklisted ip?

I have been using the http:BL to block bad IP's from accessing my site. If a malicious IP (comment spammer) trys to hit the site I just `exit` the web script which implicitly returns a `200 OK` response. Other responses I could return: 404 - Not found? If I return a 404 maybe the robots will think "this is a waste of time, lets move on to attack another site" which would reduce the load on the site (I currently get about 2 spam-hits per second). However   * I'm reluctant to return 404's on urls that, under normal circumstances, _can_ be found.    * I'm not sure if spam robots can 'waste time'. i.e Why would a bot writer be bothered to code for 404's when they just blitz the web anyway? 401 Unauthorized? Blocking a bad IP is not quite the same as "resource requires user authentication 1) which has not yet been provided or 2) which has been provided but failed authorization tests" * * * In general I feel that 'responding to the bad-bots according to proper http protocol' gives the bad guys the upper hand. In the sense that I play by the rules while they do not (a bit like Britain in the EU - ha, ha). On some days I feel like I should do something clever to divert these bot's away. On other days I just think that I should not take it personally and just ignore them. Accepting it as par for the course of running a web site. I dunno - what are your thoughts? How do you respond when you know its a bad IP?


Were they joking when they named PHP?

PHP stands for: > PHP: Hypertext Preprocessor This a recursive loop, if I'm not mistaken. Did the creator of PHP have this in mind when he named PHP? Is this the only language where the name has some sort of spurious grammar, spelling or phonetic?


Required skills for a senior level ActionScript/Flex developer

I'm looking to take my Actionscript knowledge to the next level and I've been having trouble finding what it takes to become a senior level AS developer. From my searching this has what I've come up with so far:   * Component Creation   * Memory Usage Debugging/Profiling   * AS specific usage of OOP    * Correct Use of Code-behind    * Accessing remote data   * Flex architecture frameworks   * Component lifecycle Those are just the topics I've been able to find. Resources on mastering those topics have been very hard to come by(i.e. what are common AS design patterns, etc). I may just not be searching correctly, but any help here would be greatly appreciated. My focus is on Flex specific AS development. Currently I've found here and here are the most similar SO questions I've been able to find. Any help would be appreciated, though I'm looking for specific examples. * _this question was first asked onstackoverflow and asked to be moved here_


What's the best way to organize our unit tests

We've built up a substantial number of unit tests for our main program over the years. Several thousand. The problem is that we don't have a clear idea of what tests we have because there are so many. And that's a problem because we don't know where we're weak on tests (or where we have duplicates). Our app is a reporting engine. So you can have a template that is used to test parsing (do we read all table properties), merging in data (did we keep the correct table properties in the merge), formatting the final page (is the table placed correctly on the page), and/or the output format (is the created DOCX file correct). Add to this what we need to test. Take the padding around a table cell (we use Word, Excel, & PowerPoint for the report design). We have to test the padding across page break, for a table inside a cell, vertically merged cells, horizontally merged cells, a vertically & horizontally merged cell that contains a table with a vertically & horizontally merged cells in the inner table, where that table breaks across a page. So what category does that test go in? Table padding, page breaks, nested cells, vertically merged cells, horizontall merged cells, or something else? And how do we document these categories, name the unit tests, etc.? **Update:** A number of people have suggested using coverage tools to verify that we have full coverage. Unfortunately that is of limited use in our case because the bugs tend to be due to specific combinations so it's code that has all been tested, but not in that combination. For example, we had a customer yesterday that started a Word bookmark at the end of a forEach loop in their template (a Word document) and ended it in the beginning of the next forEach loop. This all used code that has unit tests against it, but we had not thought of the combination of a template expanding a bookmark start to be started 25 times, then ended 10 times (the two forEach loops had a different number of rows).


Commenting strategies in C# & asp.net web api

I've been working on a ASP.NET Web Api 2 project as a learning exercise, and I was wondering what the norm regarding commenting is. I use the Repository / Service Pattern, and everything is very much decoupled, which results in having a large number of classes whose purpose is pretty clear. I also name my variables in a way that they explain themselves. This leaves me wondering what I should actually be commenting in this scenario.   * Should I just stick to class-summaries ( even if the class itself is self-explanatory ) ?    * What about self-explanatory methods ?   * Do data / business entity classes need a summary ?    * What about interfaces ? To give a bit more context, here is one of my repository classes which provides CRUD functionality:               public class UserRepository : RepositoryBase<User, decimal>     {         private readonly ShortStuffContext _context;              public UserRepository(ShortStuffContext context)         {             _context = context;         }              public override IEnumerable<User> GetAll()         {             return _context.Users.BuildUser();         }              public override User GetById(decimal id)         {             return _context.Users.FirstOrDefault(u => u.Id == id).BuildUser();         }              public override CreateStatus<decimal> Create(User entity)         {             if (_context.Users.Any(u => u.Id == entity.Id))             {                 return new CreateStatus<decimal> { status = CreateStatusEnum.Conflict };             }                  var user = new Data.Entities.User();             user.InjectFrom<SmartConventionInjection>(entity);             _context.Users.Add(user);             _context.SaveChanges();                  return new CreateStatus<decimal> { status = CreateStatusEnum.Created, Id = user.Id };         }              public override UpdateStatus Update(User entity)         {             var dbUser = _context.Users.FirstOrDefault(u => u.Id == entity.Id)                                  .InjectFrom<NotNullInjection>(entity);                  if (dbUser != null)             {                 var changeTrackerUser = _context.ChangeTracker.Entries<Data.Entities.User>()                                 .FirstOrDefault(u => u.Entity.Id == entity.Id);                      changeTrackerUser.CurrentValues.SetValues(dbUser);                 if (_context.SaveChanges() == 0)                 {                     return UpdateStatus.NoChange;                 }                 return UpdateStatus.Updated;             }             return UpdateStatus.NotFound;         }              public override void Delete(decimal id)         {             var user = _context.Users.FirstOrDefault(u => u.Id == id);             _context.Users.Remove(user);             _context.SaveChanges();         }     }      So in a class like that, is it worthwhile to put a summary like "Provides CRUD functionality for the User Data Entity" ( and then repeat that summary for every other repository ), or not ? What about method comments, or inline comments? Edit: My project is on Github. I know about adding comments to more complex methods, and I'm planning on adding comments to the Extensions and the ValueInjecter classes soon ( which hold by far the most complex code ). Apart from that, any advice regarding where to put comments is very much welcome.


Delegate pattern for retrieving data v.s. using simple setters

I am considering using the Delegate Pattern to get some data necessary for an operation. There are a few different pieces of data that the algorithm needs to run, but they all have default values that can be used if they aren't explicitly set. If I were to use the delegate pattern, I would define an interface that defines a function for each piece of information that the algorithm would then use to retrieve the data as it needs to. The other option I see is to have setters on the algorithm object so that those properties can be set explicitly instead of waiting for it to be requested through the delegate pattern. There are many advantages to using the delegate pattern, but I feel that many of them don't really apply to my situation. One of the biggest things is that it eliminates the need to make specialized subclasses of the object, but in my case, using setters also removes this need. Also, the delegate pattern allows reuse of delegates like "configurations." If I use setters, everything will have to be explicitly set whenever reconfiguring (instead of just changing delegates around). I would definitely lean towards using the delegate pattern, my only issue is that this is a public interface that will be used by people who aren't necessarily familiar with the pattern. I feel that using setters would be a more natural way for someone to do it without knowledge of design patterns. **A very simple example** of what I am trying to do would be the following: I have an algorithm that is going to determine if a certain range of characters exits in a string. The configurable options of the algorithm are:   * First character (e.g. "k" )   * Last Character (e.g. "p" will make it search for k,l,m,n,o and p )   * number of characters out of range that need to match So If I have the string "stack overflow" searching with a character range of "k-p" requiring that at least 4 characters match, it should return true because it contains "k","o","l", and "o". Using the delegate pattern it would look this this (not necessarily the most efficient):               char startRange = delegate.startChar();     char endRange = delegate.endChar();     int targetCount = delegate.charCount();     int currentCount = 0;     for( char c in targetString )     {        if( c >= startRange && c <= endRange )        {            currentCount++;            if( currentCount == targetCount )                 return true;        }     }     return false;      Otherwise the algorithm would require that member functions and variables are defined to set and store those values. The algorithm would look like this.               int currentCount = 0;     for( char c in targetString )     {        if( c >= mStartRange && c <= mEndRange )        {            currentCount++;            if( currentCount == mTargetCount )                 return true;        }     }     return false;      The variables may or may not be changed often, and there will definitely be reuse of those variable configurations. Are there any advantages of the delegate pattern that I am missing? Are there any disadvantages of using setters that I am missing? Any other comments or suggestions? Thanks!!


infrastructure software/technologies for developing web service

[Edit: Thanks S.Lott for the hints] I'm developing a web service from scratch. The service could have potential of 10,000 requests a day. Actually, to be honest, requirements aren't that clear at this point of the project. What the management team wants is to build something and getting it working. However, it does have the potential of getting bigger, so I need to put down the * foundation* right. I've decided to   1. Use Tomcat 6.0 as the application server   2. Use Apache Axis2 as the web service engine (Install it in Tomcat)   3. Use ??? for web service implementation   4. Use Hibernate for accessing database Point 3 is a bit fuzzy, I am not sure if I should use jax-ws or jaxb or spring or ejb or just POJO to implement the service. To people who have used these technologies, which one is easy to use, which one is easy to maintain, and which one is easy to scale? Thanks,   Sarah


Trademark question: naming an app after a common noun when an app from another store uses it

Here's my scenario with made-up names: A big company called Supersoft have announced that in about 3 months they're going to release an Android app called "Supersoft Metronome" (where Metronome is a fairly common noun). I want to call my new iPhone app (notice the other app is on Android) "Metronome" and I'm ready to release in a week. Should I rename my app? Will I get in legal trouble otherwise? Both apps are in the same category of program. I've already bought a related domain name, paid for artwork and styled my app around the name so I really don't want to change it now. I've considered extending the name to something like "Metronome Music Editor". Would this protect me?


CA1819: Properties should not return arrays. Does this happen only with arrays? If yes, why?

I have a question about CA1819 msdn performance warning. The rule is: Arrays returned by properties are not write-protected, even if the property is read-only. To keep the array tamper-proof, the property must return a copy of the array. Typically, users will not understand the adverse performance implications of calling such a property. Specifically, they might use the property as an indexed property. I understand the rule. I want to know if this happens only with arrays? If yes, why?


can I use XML for AJAX in a website created using HTML5

I am new to web programming and just started learning XML and AJAX. I am creating a social gaming website for my college project. I am confused at the point of using XML for AJAX in HTML5. As XHTML is replaced by HTML5 so is it ok to use XML or i should choose JSON (i know nothing about JSON but it is what I found in answers on web to the question related to choice between JSON and XML). My preference is XML because it is in my syllabus but I want to make sure that XML and HTML5 will not conflict.


Is context-driven testing suitable for all projects?

One thing I cannot find anywhere is: is this approach limited to non-critical software? Because in critical (or just when customer wants us to follow his rules) we have no freedom in testing and just follow the procedures. Am I right?


Method to test/reproduce Heisenbug possibly relating to Multimedia Class Scheduler Service?

## The Problem I am hunting down a bug in a web application related to multi-uploads using a Flash movie/applet. Sometimes, the progress bar that is used in the Flash applet to indicate file upload progress will read over 100% for a progress and causes the entire upload system to halt. Aside from the logic errors associated with the rest of that code, attempting to reproduce this bug to trace execution and debug is a feat in itself. It's a Heisenbug, and I have seen it just once in about two days of trying. Other developers' machines can reproduce it with more regularity. The only time I reproduced it was rebooting after changing my registry key for `SystemResponsiveness`, as my machine uses Windows Server 2008 R2. That registry key controls CPU priority for multimedia applications. Windows Server 2008 R2 sets this key to `100` (giving multimedia applications very low priority), whereas I set mine to `20` as it is what a desktop Windows 7 install sets it to. All other developer machines that can reproduce this issue have `SystemResponsiveness` set to a default 100. When I set my `SystemResponsiveness` back to `100`, I immediately saw this issue. However, reproducing the issue is still spotty. ## My Theory So I am going on the assumption that this bug, as it involves Flash, is related to the `SystemResponsiveness` registry key as described in Microsoft's documentation for Multimedia Class Scheduler Service, which is the multimedia subsystem of Windows 7 and Windows 2008 R2. By setting the responsiveness to 100, multimedia like Flash 'movies' (which this uploader is) may encounter problems, and this becomes a timing/interruption issue for the uploader, which then causes other bugs to manifest themselves. ## How to test? Now I'm trying to come up with a way to test this theory. I think I need to have a background process peg the CPU usage at 100% (across 4 cores), and then attempt to use the uploader. The background/non-multimedia services should cause stuff like Flash to perform worse and I should run into problems. **edit** I decided to run a CPU stress test to peg my system's CPU utilization at 100% - other than make my machine slow to a crawl, the bug did not manifest itself. This Heisenbug is really eluding reproduction. ## My Inquiry However, I'm not sure if that is the correct approach to test my theory, so I'm wondering if anyone has any insight into tracking down MMCSS-related issues?


How to name nested function?

When you have a function that wraps another one in Scala. What do you call the nested function? I found this :               def factorial(i: Int): Int = {            def fact(i: Int, accumulator: Int): Int = {          if (i <= 1)             accumulator          else             fact(i - 1, i * accumulator)       }            fact(i, 1)          }      I usually use just _do_ because it is shorter, generic, and explicit. But is there a better way or a naming convention for nested functions?               def myFunction() = {            def do(i: Int) = {         ...       }       do(1)          }


Is there any difference between Custom Control and User Control in .NET

As stated in the question, is there any difference in the meaning of the two as applied to the Controls of .NET. Or are they alias of one another?


What do you think of the F# language?

What do you think of the F# language? I would like to learn it's positive and negative points. What is your experience with this language? When should or shouldn't someone use F#? See also: F# at Microsoft Research


Should I bother learning about small or niche languages?

If you browse the code golf questions on StackExchange, you notice a ton of non-standard but real world (Eg not brain-f*ck) languages like F#, Scala, R, J and Clojure. Visiting their websites, some of the languages look interesting solving problems in whatever language your already using. However there is coding in spare time, and coding for money. The closest thing we have to the truth on who uses a language is the TIOBE Index, which lists none of the above languages in the top 10-15. Which makes me wonder if I'll ever use them. Should I even bother learning some of the small niche languages? It doesn't seem I would be making money, and some will probably fail anyway.


How forgiving do you need to be on new employees?

Recently we have a new developer in our team. We are getting him up to speed and he is picking it all up quite fast, but a new developer means new (foreign) coding styles and ways to solve things. It feels kinda petty to start whining about coding styles at the first three classes he codes, but how forgiving are you guys when dealing with new developers? Do you let them muddle on, and point it out later? Or do you wield the scepter of intolerance immediately? When do you draw the line, or if not, why not? _P.S. New guy, if you read this: you are doing great, keep up the good work ;)_ **Edit:** I've accepted the most up-voted answer, as most answers share the same message: Be nice, but tell them asap!


How to do thread management in C++?

We use `pthread` for thread management in C based systems. pthread is in general compilable by C++ compiler (like g++). However, what are the better ways of abstractions for threads in C++? Also, for making any system to be working in a multi-threaded system, it is also important to make thread safe. What are the standard libraries that requires alternative (installs) to be thread safe or are they unsafe for multi-threaded environments? Is smart pointers, templates require special measures to make it safe? What are the best practices for the thread managements in C++?


Where to find common database abbreviations in Spanish

I'm doing a little pro bono work for an organization in Central America. I'm ok at Spanish and my contacts are perfectly fluent but are not techincal people. Even if _they_ don't care what I call some fields in a database _I_ still want to make as clean a schema as possible, and I'd like to know what some typical abbreviations are for field / variable names in Spanish. I understand abbreviations and naming conventions are entirely personal. I'm **not** asking for the "correct" or "best" way to abbreviate database object names. I'm just looking for references to lists of typical abbreviations that would be easily recognizable to a techincally competent native Spanish speaker. I believe I am a decent googler but I've had no luck on this one. For example, in my company (where English is the primary language) 'Date' is always shortened to 'DT', 'Code' to 'CD', 'Item' to 'IT', etc. It's easy for the crowds of IT temp workers who revolve through on various projects to figure out that 'DT' stands for 'Date', 'YR' for 'Year', or 'TN' for 'Transaction' without even having to consult the official abbreviations list.


MS Certifications for Non-IT students

It may seem like a silly question, but it's important at least for me and I'm interesting to hear from you. I'm a .NET developer 4 years ago, even before I went to university, I'm currently earning an MCTS in web development, and some of them told me that it's invaluable for my position, I'm not and wouldn't be an IT student anyway, just because I believe that in IT field, knowledge could be gained from experience and self-teaching (via books and videos) , I know lot of IT students (in my region at least) fight just for the sake of having a degree and to get a job, no more... I'm currently looking forward to complete my path in MS Certifications and hold the MCPD, is it really that you should be an IT guy in order to be certified? does it make sense for you that non IT students never need those certifications?


When to stop inheritance?

Once upon time ago I asked a question on Stack Overflow about inheritance. I have said I design chess engine in OOP fashion. So I inherit all my pieces from Piece abstract class but inheritance still goes. Let me show by code               public abstract class Piece     {         public void MakeMove();         public void TakeBackMove();     }          public abstract class Pawn: Piece {}          public class WhitePawn :Pawn {}          public class BlackPawn:Pawn {}      Programmers has been found my design a little bit over engineering and suggested to remove colored piece classes and hold piece color as a property member like below.               public abstract class Piece     {         public Color Color { get; set; }         public abstract void MakeMove();         public abstract void TakeBackMove();     }      In this way Piece can know his color. After implementation i have seen my implementation goes like below.               public abstract class Pawn: Piece     {         public override void MakeMove()         {             if (this.Color == Color.White)             {                  }             else             {                  }         }              public override void TakeBackMove()         {             if (this.Color == Color.White)             {                  }             else             {                  }         }     }      Now I see that keep color property causing if statements in implementations. It makes me feel we need specific color pieces in inheritance hierarchy. In such a case would you have classes like WhitePawn, BlackPawn or would you go to design by keeping Color property? Without seen such a problem how would you want to start design? Keep Color property or having inheritance solution ? **Edit:** I want to specify that my example may not completely match real life example. So before try to guess implementation details just concentrate the question. I actually simply asking if using Color property will cause if statements better to use inheritance ?


design for a parser to handle very large files

I have written a program which records protocol messages between an application and a hardware device which matches each application request with each hardware response. This is so that I can later remove the hardware, connect a 'replay' application to the main application and wait for an application request and reply with a matched copy of the requisite hardware reply message. My replay application saves the matched request/response in a list (using C++ std::list). This works fine on a small interaction session. My problem now is that I need to be able to use the replay over a long long session. With my current implementation, the replay program eventually uses up all available memory on my computer and crashes. So I need some sort of lookahead - and not parse the whole session in one go. Can anyone make any suggestions on how to get started?


HTML, CSS, and some JavaScript... what's next?

I just completed a front-end web development course. I now have a rudimentary understanding of what it takes to make a website sorta pretty and minimally functional. I also now know (barely) how to link up to an api via AJAX. I don't know what's next. I know I want to learn what it takes to make real- time collaborative web apps. node.JS? An online course? What should a beginner learn to jump into development of real-time collaborative software?


@Deprecated as of version x.y in JavaDoc

This question & its answers are useful but not sufficient for my problem. My Question is if I want to add a javadoc as _@Deprecated As of version x.y, replaced by {@link SomeClass}_ in my current file's javadoc then what should be the version no. in place of x.y ?? Let my current version is 1.2 & after CVS checkin it will be 1.3