instruction stringlengths 34 19.9k |
|---|
I have seen this article: CSS3 Loading elements at HTML5 and CSS3 Tutorials pages.
How did someone made this calculations? what angle, how much space, how much rotation to give?
If I do it with hand, starting number one, I fear it takes too long as a process to complete.
Is there some tool, or some trick that do this ... |
I want to know what is considered better way of returning when I have if statement.
Example 1:
public bool MyFunction()
{
// Get some string for this example
string myString = GetString();
if (myString == null)
{
return false;
}
else
{
myString = "Name " + myString;
// Do somethi... |
As I'm trying to get better at designing good software I'm wondering if there are out there good (as in well written) open source software with lot of code documentation that aims to explain details about why this or that design choice was made in the context of that specific problem set. I'm interested in OOP and I do... |
When I started learning programming with the .NET framework, I started by using WinForms as a UI technology. It uses “classic” menus just like this office 2000:
A few years later Office 2007 was released, the ribbon was born:
And even some years later Office 2010 was released, which also added new features like the s... |
I'm learning Clojure to see if it's something I can leverage at my current job, and more importantly, how I can convince my bosses that Clojure has a 'killer feature' over java that makes it worth the investment1.
The feature that I'm guessing most clojure evangelists would tout is state management and concurrency.
The... |
From time to time I've encountered scenarios where several complex conditions need to be met prior to triggering an event. Furthermore, most listeners also run additional checks to determine the course of action. This got me thinking whether a better solution would be to think in terms of smaller events and let them tr... |
In c++, the * operator can be overloaded, such as with an iterator, but the arrow (->) (.*) operator does not work with classes that overload the * operator. I imagine that the preprocessor could easily replace all instances of -> with (*left).right, and that would make iterators nicer to implement. is there a practica... |
I am writing a utility that runs on RHEL5 command line. I need my command line options to be simple but powerful. I looked at the various UNIX utilities to get an idea of how simple command line utilities have to be. Do you guys suggest any documents/links that talk about command line etiquette? I am modelling my util... |
Its very interesting for me which advantages gives "global root class" approach for framework.
In simple words what reasons resulted the .NET framework was designed to have one root object class with general functionality suitable for all classes.
Nowadays we are designing new framework for internal use (the framework... |
I was going through this heavily discussed and highly voted question on SO and stumbled across one comment that got 5 upvotes.
So I assume this was a great comment.But it got my head spinning at the same time. Can any one explain this comment? The comment says:
You can't compare big-O values directly without thinking ... |
I want to split poker pot to chips.
Example:
Pot = $17.500.
I have the endless piles of chips. I have the following types of chips: ChipsTypes = [$1, $5, $10, $25, $100, $500, $1.000, $5.000, $10.000, and so on]. Index starts from 0.
I want to get an array that says which chips I have to take to divide the pot and in w... |
I am currently adding some functionality to a popular open source project. It written in C and in Every file GPL license text is embedded. The functionality I am adding is not supported by the project. So you can say its some sort of extending.
My code gets compiled when the main project is compiled. My code is inside... |
I'm designing a tiered .NET application, and I want to use the Code First approach. I'm new to this, so I'm struggling to envision how it ought to be designed. Would the following be a reasonable approach? What problems or limitations might I run into?
Write DTO classes for my domain. These will be used for data t... |
Is the ISC license suitable as a MIT or Simplified BSD license replacement?
What are the pros and cons of ISC compared to MIT or BSD?
|
My company is exploring the move from Perforce to a DVCS and we currently use lots of Perforce proxies because the software development teams are spread over Germany, China, USA and Mexico and sometimes bandwidth from one place to another is not that great.
Speaking with IT, we started looking for a way to keep things ... |
I recently encountered a situation in our codebase where a different team created a 'god class' containing around 800 methods, split across 135 files as a partial class.
I asked the other team about this. While my gut reaction was to nuke it from orbit, they insist that it's a good design, a common practice, and that ... |
My service has a large ongoing number of user events, and we would like to do things like "count occurrence of event type T since date D."
We are trying to make two basic decisions:
What to store? Storing every event vs. only storing aggregates
(Event log style) log every event and count them later, vs.
(Time-series... |
My team is currently locked into using a tool we dislike that takes the form of a Eclipse plugin and a .jar; the plugin gives us a button to quickly run a single file's code (via invoking the main .jar and passing to it the current file). We want to move to C#.net. Is there any way to get Visual Studio to replicate th... |
In PHP you can have a function take an infinite number of arguments like
/**
* Do abc...
*
* @since 1.0
* @param mixed $arg1 Arg description
* @return string Results
*/
function abc($arg1 = null){
$args = func_get_args();
// do smth with $args
}
How should I illustrate thi... |
I am creating a software package that will be useful to programmers, engineers and scientists. List price will be in the region of $1,000 -- way beyond the budget of most open-source developers, hobbyists and enthusiasts. So I am considering two things, the first generous, the second maybe a little greedy:
Offering ... |
I'm a python programmer who sees a lot of C++ code but doesn't know the language and there seems to be two ways to initalize a class. I was hoping that someone can tell me the difference.
class Point {
int x, y;
public:
int get_x();
int get_y();
Point(int, int);
}
// ok we are goin... |
Is it normal and still proper (in agile/SCRUM-based software development) for a product owner to be in charge of more than one product?
|
I'm basically trying to wrap my head around the concept of CQRS and related concepts.
Although CQRS doesn't necessarily incorporate Messaging and Event Sourcing it seems to be a good combination (as can be seen with a lot of examples / blogposts combining these concepts )
Given a use-case for a state change for somethi... |
Part of the FSF's instructions for placing a program under the GPL is including the following "copying permission statement" at the top of your file, under the copyright notice:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the ... |
This blogpost was posted on Hacker News with several upvotes. Coming from C++, most of these examples seem to go against what I've been taught.
Such as example #2:
Bad:
def check_for_overheating(system_monitor)
if system_monitor.temperature > 100
system_monitor.sound_alarms
end
end
versus good:
system_monitor.... |
currently, we have a closed source project on hand. However, we would like to have a communication channel together with our end users.
We would like to have our end users to know, what features we are currently working on, and what features they are going to get in next release.
We would like to know users' thought, ... |
I'd like to find a way to write an API that can be accessed from any other programming language via language bindings (or some other framework). Is it possible to do this? If so, which programming language would be the most suitable for writing a "cross-language" API? My goal is to create a single set of functions that... |
My team has been developing a web business application for more than a year. It started quite small, but now it is growing bigger and bigger. I think it's time for refactoring.
Looking at the code, I see the below situation:
IUserService
addUser
deleteUser
updateUser
addMember
deleteMember
updateMember
registerMember
... |
I am lucky in the sense that I have been given the opportunity to be a 'Technical Troubleshooter' for our offshore development team. While I am confident and capable of dealing with most issues, I have come across something that I am not. Based on initial discussions with various team members both on and offshore, a re... |
I can't figure out what would be an appropriate data structure for my problem. I need to write a script that will count some events. Input is a list of events (thousands of them). Each event is an object with following attributes:
class Event
company
city
office
department
You can look at it like this: „Each e... |
I often read/overhear that good commit messages should be written in present tense or to use imperative mood when describing the change eg. Fix xyz instead of Fixed xyz.
What are the advantages of doing so? Are there differences between the various VCS (I mostly read these about git but that maybe because I mainly work... |
I'm in the process of coding a game and almost done with the game mechanics to the point where it's pretty playable. I later discovered an open source version of the kind of game I'm making with the same mechanics, whereas I coded mine from scratch.
However, in the interest of optimizing later on, I may want to adapt a... |
I was doing my ER diagram for a rails application I'm about to begin with and there I have an entity called Class News so I'd have a model ClassNew but I don't know if I will have problems in the future with the New part or what would be the right way to do this o how should I call the model? since the right thing woul... |
You can indicate that XXX is method name by writing XXX().
But in Objective-C, you can not write XXX() for XXX method.
If you write XXX, you can't tell if XXX is method name or other type of identifier.
How can you indicate that XXX is method name of Objective-C class?
EDIT
Method call of Objective-C is different from ... |
I would have this asked on StackOverflow if it had code, but it's more on the idea/concept so I asked here.
I am working on the UI of our inventory system when I found out that when registering a user in the system, the username and password of the user is optional. I asked our supervisor why is this so. He said that i... |
Ok, I have used the word python in the question, but it well could be language agnostic in that: If a language X has a well optimised compiler targeting assembly and an OS is written in that language, then will it compete favorably with C in benchmarks?
This comes from two conceptions I have (could be wrong):
Langua... |
If we have a large development team, say 100, and we would like to keep our encryption key hidden from developers who are not directly involved in the encryption module/algorithm, what are some best practices to keep this key as secret as possible while still allowing for development and debugging?
|
Consider a logging system - used absolutely everywhere in your codebase.
(note - logging is just an example, don't take it too literally and point me at your favourite logging system).
public interface ILogger
{
void LogMessage(string message);
}
// Just used for testing, do nothing
public class NullLogger : ILogg... |
I am tasked with building a piece of software that interfaces with a MySQL database, in order to allow the user to pick songs to play and que using a touch screen, and then they are shown simultaneously on a second monitor as videos.
Questions:
To allow both displays to work, would it be best to write two pieces
of... |
I'm working on some project where I have to make a database to store data which is currently kept in Excel files, so I have to do some changes before writing the data into the database.
I'm going to read those files using Java and write them from Java into the database. Should I use Hibernate for that job? Or how else... |
I'm trying to find a way to write an application with lock-free IPC on Linux, in C, with multi-core processors.
Let's assume I have process 1 and process 2 that write to a FIFO or shared memory. Then process 3 and process 4 will read from that shared memory or FIFO.
Is this possible with a lock-free algorithm?
Your gui... |
I've only worked at once place since graduating my CS degree. This is a pretty basic architecture question but i don't know any better since i've only worked at one place. Where i work we maintain a large number of code tables. For example say you have a Sales/Order system and you have an Order Status. We would maintai... |
So this is the first time I am trying to work with an Open Source Project.
I created a Code Plex Account browsed for a project that I thought I might become a part of.
I sent a request to join the project.The project head accepted my request.
I have already downloaded the source code of the project.
Can some one just s... |
I am exposing a few REST methods on a server for an mobile app.
I would like to avoid that users can sniff how HTTP methods are built (from the mobile app) and then send them again to the server. Example :
The mobile app send a request
The user uses a proxy and can check what's going on on the network
The user see... |
Clojure does not perform tail call optimization on its own: when you have a tail recursive function and you want to have it optimized, you have to use the special form recur. Similarly, if you have two mutually recursive functions, you can optimize them only by using trampoline.
The Scala compiler is able to perform TC... |
I've been making small improvements to a public ASP.NET site that I have and have ran it through Google's online Page Speed several times. I have a specific problem, but something that really threw me off was that even if I didn't make any changes and just kept running it time after time (5 minutes intervals) I'd keep ... |
The following is from the preface of Jon Resig's new book : Secrets of JavaScript Ninjas
The portions of this book that cover features that are relatively un-changing, such as code evaluation, with statements, and timers are continually being used in interesting ways. There are now a number of active programming lang... |
I'm making an indexOfReverse utility function in my C++ program, and I have caught a bit of a snag. Implementing the offset and maxOffset in my indexOf was very intuitive to me.. These start from the beginning of the string (+offset), and go forth to the end of the string (or maxOffset if given).
While implementing off... |
So In my app (iOS), you have to register in order to use the service (a food service). But in order to change details about your account (username, password, and email), you have to reenter your password. Except for if the user logged out, this is the only time you need your password to use the app. So I was wonderi... |
Many a times I have to deal with code files which are quite long - about 5 screen pages at the minimum. Almost always there is something towards the top/bottom that I need to refer when I'm at the bottom/top (respectively). It's a mammoth overhead to constantly scroll back-n-forth between the file parts.
It's a cognit... |
When you download and install asp.net MVC, does it just add code to the .net framework class library? Or does it also modify the installed Visual Studio editions?
Another question: If it is just adding code to the .net framework class library, why can it not be installed on top of .net 2.0?
|
I have lots of ideas for products to be built. The problem is that I have less than a year of professional work experience and I am afraid of getting judged negatively in the future based on what I produce now. I have no clue if my code is any good.
I am not familiar with any of the coding patterns. All I know is to bu... |
Is it better to use multiple html pages and link them together with href or just change content on the same page using JavaScript? I am thinking of how to layout a page and I don't have a lot of content. It would probably be about three of for pages if I just used all html. If I toggled and swapped bits of html around ... |
I started learning arrays in C++ and came over a little side note in the book talking about 2D arrays in breif.
I tested it out and i was amazed that it could give the programmer the ability to store data or information and lay it out infront of him in a spread sheet format.
In a normal array to access elements i would... |
I was asked this question in an interview. I'm somehow supposed to "read" a file into my C program as input without using a file pointer (including "f" functions, e.g. fgets, fscanf etc.). I'm also not allowed to redirect it using the terminal, i.e. no system or exec calls. The program will not get the file during runt... |
On my way to learn Lisp I have discovered the all powerful and feared so called Macros, then after spending a hard time trying to understand them and their usefulness I said to myself, I FINALLY GOT IT.
I couldn't be more wrong, I was thinking that the only purpose of Macros was to define new control structures and tha... |
I've always used git before, but I want to contribute to python so now I have to learn mercurial and I find it very frustrating.
So, I've made a couple of small patches and I wanted to track them as commits in my local mercurial repository. Apparently there are 4 ways to handle branching in mercurial.
1 and 4 looked co... |
I am looking at some C/C++ code that appears to have functions that are defined, but never used. This is a pretty tedious process to trace through the code and verify. I've done some surveys and there are a number of tools that can do this type of analysis.
Can anyone share any experiences or tips on which tools and te... |
I'm working on an application which will run on multiple Amazon EC2 instances. I wish to incorporate auto update feature for my application. The updater should update all the Ec2 instances. Also, there is a central server which governs the creation/termination of EC2 instances as per load. The central server creates a ... |
Well, I am reading Programing Windows with MFC, and I came across Unicode and ASCII code characters. I understood the point of using Unicode over ASCII, but what I do not get is how and why is it important to use 8bit/16bit/32bit character? What good does it do to the system? How does the processing of the operating s... |
We already have a fully operational web service which caters requests from multiple paltform devices.
Each device sends only one request at a time and immediately after a response for the request the device sends an applicative ACK, this ack message is like a regular request message, and it's all via http.
During a pe... |
My development on Android is based on scientific programs and while I'm building these most of the code is in one or two long classes. When I come to deploy these programs I try to decouple everything and use classes and objects like I would on a Java desktop application.
However reading guide Designing for Performanc... |
I am using Java.
How does an event source like a (button in a GUI) knows which method to call in an interface?
For example, I am listening to Mouse Events and have implemented a Mouse Listener interface in my class then how would the event source know whether it should call mousePressed(), mouseReleased() or some other... |
I currently developing some M2M-transformations with the Atlas Transformation Language (ATL).
During studying the language constructs and properties I have often read, that ATL is a prototype for QVT, but was not used for QVT. This leads me to the question, if ATL is a deprecated language.
Personally, I claim that ATL ... |
I mean everything, not just schema changes. Even a simple SELECT on a primary key can't go into production, even though it has been code-reviewed by other developers (in context), without a DBA review of every statement, extracted from the code and submitted with EXPLAIN output, details of how often it will be called, ... |
Background
I'm currently designing my own programming language as a research project.
I have most of the grammar done and written down as context-free grammar, and it should be working as is. - Now I'm working on the actual compiler that should translate the language into x86 binary assembly code, more specifically, I ... |
On a project I'm working on, I'm trying to find a noun to describe the different parts of the application dependent on user interface. There are three parts: super admin, admin and regular users. Each of these parts consist of modules, interfaces with users, interfaces with the other parts.
I've tried "sub-system", "mo... |
Important: we have no issues whatsoever with source code documentation. This belongs to regular code audit and is kept up to date. Our problem is with developers documentation (or, "external" if you like), little blog-like tips from programmers to programmers which tend to be once written, often left behind.
We use wi... |
I am thinking about introducing my 12 year old son to hardware programming. I built a robot with the .NET Micro Framework and while he was fascinated with controlling the robot, his eyes glazed over when I attempted to explain how the code worked. And to be fair, it's quite complex for a beginner, requiring knowledge... |
I wrote a little app to manage an arbitrary series of tasks (e.g., call a SQL sproc and capture out-vars, run another app, run an SSIS package) with dependencies between tasks. Each task has a status (waiting to start, failed and waiting to retry, failed and abandoned, succeeded, etc.). Internally, each Task object h... |
I have written various user stories that describe functionality at a pretty high-level. For example:
As an analyst, I want to view the current share price, so that I have quick access to an up-to-date valuation of stock across the Euronext, London and New York stock exchanges.
This requirement is based on existing fun... |
One of the few things that most software developers agree on is that
you shouldn't rely on code to work correctly unless you test it. If
you don't test it, it may have hidden bugs that are only going to
cause you more work down the road.
I understand how to test my normal code, but how should I test my test cod... |
I am new to BitBucket. I have my repository. And 2 people working on it me, Admin and another developer with Read only access.
So in order for him to do changes he forked repository and made changes, uploaded to his repository and created pull request.
Now I merged this pull request with my repository. And made few sma... |
I work for a large company which has several non-RESTful APIs. I am tasked with building a web application to interact with these APIs. Each API handles and provides very different business processes and data.
I'd like to build RESTful (a) interface(s) fronting the APIs so as to make them reusable by other future web a... |
I have a friend who has a slightly greater amount of programming experience as me. We were talking about all the different programming technologies we use and Interface Builder came up in conversation.
Being of no programming background except for what I've taught myself, I personally believe that IB and all it's featu... |
I'd like to see some valid examples of needing to let a thread enter a locked, non-re entrant mutex, then destroying the mutex (which supposedly terminates the thread).
I can't think of any good reason to do this. I can't remember precisely what we were arguing about earlier today, but my colleague insists such techniq... |
Have a very large project more than 70k LOC.
The project definitely needs some code refactoring in Core Framework and in other parts as well. There was NO time set in the beginning of the project for refactoring. However with time and more than 40 developers joint and left the project. From my perspective is indispensa... |
I have my own ideas about how a pointer-sized mutex could be made: The integer is used as a set of flags, counter, index, and a spinlock that guards an entry in a table of pre-allocated kernel objects given to mutexes only when threads are contending, and released afterward (only need at most N table entries for N thre... |
I've started reading the design pattern book by the GoF. Some patterns seem very similar with only minor conceptual differences.
Do you think out of the many patterns some are unnecessary in a dynamic language like Python (e.g. because they are substituted by a dynamic feature)?
|
Over at this question in the comments I mentioned that I heard that partial classes are best avoided if possible.
What if any is the reason for this sentiment? Or If this is an invalid sentiment, how are the perceived detriments overcome?
|
What are the best practices to store and maintain serialized objects in C#? Any strategies or patterns that apply?
What I have come to believe so far is this:
Prefer Json over XML, both for space and for speed, but xml is easier to query/mine data via LINQ to XML for bigger data sets.
For every single property, map ex... |
When using the command line/terminal svn client, a colleague is getting "svn: OPTIONS of " [repo] "...authorization failed" error message when they attempt to checkout the repo to be their local working copy.
They used to be able to do this but have recently had to change their password (periodic routine security polic... |
I'm working on, and adding to, a GitHub-hosted project that includes this LICENCE.md (apparently the MIT licence verbatim):
Copyright (c) 2012 [Acme Corp]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the So... |
On a project that I am working on we encountered some performance problems.
We decided to drop hibernate in favor of plain Jdbc to gain database performance.
By converting our code to Jdbc we achieved the performance that we aimed for but the code quality seems to have deteriorated. And it took us three months to imple... |
I’ve been working in an eXtreme programming team and doing pair programming for over 7 years in a windows environment. When we first started doing it someone would log in with their windows credentials and therefore all access to domain resources, and more specifically version control, would be accountable to that wind... |
I am writing code that uses one library with GPL (not LGPL) license, and one with the 3-clause BSD license. Since I link to GPL-licensed library, my code will need to be GPL as well. How should I, in practice, deal with the original LICENSE.txt from the BSD-library?
(A) Can I distribute a project so that the main sourc... |
I have read many posts similar to this on the site: however I still am questioning what is best in my situation (also the answers are contradicting from question to question).
I have a website (web-application) with a controller per section of domain logic (i.e. ProductsController, NewsController, ContactsController, ... |
I am new to StackExchange, but I figured you would be able to help me.
We're crating a new Java Enterprise application, replacing an legacy JSP solution. Due to many many changes, the UI and parts of the business logic will completely be rethought and reimplemented.
Our first thought was JSF, as it is the standard in J... |
I have 5-10 files on one server that all catch XMLRPC-PHP requests. There's about 20 lines of require_once in each one that are all the same. It'd make life simpler for me to create a separate file that only has the requires and require that in my XMLRPC files. Is this best practice, or does it open up issues that I... |
I'm releasing an open source project. I want to make it as inclusive as possible for any community that might embrace it. Specifically, I don't want the code copyrighted in my name when an entire community might work on it; that approach seems self-centred and alienating. My immediate thought to avoid this issue is to ... |
I'm very new to source control management and one thing puzzles me: is it possible to search through the whole repository for a string? For example I'm tracking one file, which has 100 commits and I would like to see all the version of the file which contain "xyz" inside.
Is this possible? I'm using various GUI clients... |
I am a junior developer for a small business using scrum / agile development. A long-term goal of ours is to be appraised at CMMI lvl 2. We have a team of 3 senior developers who implement user stories and a handful of junior developers for support.
We are moving towards a "three amigos" methodology, especially in re... |
I practically never see any web application where server pushes messages to the client. While pushing messages from server to client is hugely used in multiplayer games, why this model is so underused in web apps?
Is it wrong? Does it destroy the client-server model?
|
I just graduated with a degree in CS and I currently have a job as a Junior .NET Developer (C#, ASP.NET, and web forms). Back when I was still in university, the subject of unit testing did get covered but I never really saw the benefits of it. I understand what it's supposed to do, namely, determine whether or not a b... |
Is there a difference between stability and reliability (at least in software engineering context) or can they be used interchangeably? If not, what would be some examples of reliable but not necessarily stable systems, and vice versa?
|
I can write code, resolve dependencies, and get my program to run on my computer; I have no idea where to go from here though. How do I get the software ready for distribution?
The school environment has taught me to do a few random tests by hand, make sure nothing is obviously broken, then throw all the source files ... |
So, my boss wants to have a complexity measure for a framework developed internally in our company. Is that possible?
As far as I know, functions points do not apply to software that doesn't have persistence per se, and also doesn't have GUI's (it's a framework, built in C#, useful for crafting business applications, a... |
Consider the following code fragment:
int a[8192], b[8192], c[8192];
int i;
for(i = 0; i < 8192; i++)
c[i] = a[i] + b[i];
For what kind of cache will this program not run well (set associative, direct, associative)? I've been thinking about how to optimize this, but can't really see how it can be done. How can I c... |
The Common Lisp Object System (CLOS) supports multiple dispatch (multimethods). When is this a useful feature in practice? I'm not just looking for an example of hypothetical functionality that would be easier to implement with multiple dispatch[1]. I'm looking for examples of where it's useful in real software, for... |
From Steve Yegge's "Lisp is Not an Acceptable Lisp":
Lisp has a little syntax, and it shows up occasionally as, for instance, '(foo)
being expanded as (quote foo), usually when you least expect it.
What is he talking about with '(foo) being expanded into (quote foo) in some situations? (As opposed, I would imagine,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.