|
ankum16 wrote: It was asked during one of my interviews. Curious, what company, and for which position?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
One which you won't want.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Yes, but I want to note the name just to be sure, and for any future reference. Works wonders with the "permalink" button.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
|
I think now I know the answer..
Possible relationship between two classes are:
1. Association
2. Aggregation
3. Composition
4. Generalization
|
|
|
|
|
hey guys
i'm trying out MVC with vs2013 and liking it but... the EF stuff is not to my liking as it seems really overkill for the sorts of web projects i do
after a couple of days of head banging i think i understand the basics enough to build what i want but now i'm kinda stuck on how to implement logins
are there any docs that might help? all those i find are referencing the MS solution and hence EF and the whole shooting match - i wanted something more lightweight or some docs on how to roll my own
thanks in advance
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
l a u r e n wrote: i'm kinda stuck on how to implement logins You implement them with a user-unique salt, and a strong hash. Login-logic is contaminated with security-issues and would make a bad example on how to remove the dependency to EF.
Basically, you'd want to access a database from MVC, as shown on w3schools[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
thanks man - that looks great
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
In our development team there is currently a trend to use "out of the box" solutions for different purposes. For example we now introduce a Node.js application using coffee script and iced coffee script beside our PHP application.
Sure - for most complex programming tasks there is already a solution out there which may be well developed and thought-out. But isn't it a high risk of making yourself dependent on these solutions when thinking a few years in the future? Most of these "frameworks" are imported via composer, you have to care about dependencies and updates. Also it gets harder to keep the overview of all the different solutions and technologies you are using and finding people who really understand how they are working. I am a fan of "simple" specific solutions and less dependencies and that brought us very far with our platform. It may be not the most performant one, but it is easy to understand for new people in the team, very stable and easy to maintain.
On the other hand I see the advantages of extending your application in a modular way - frameworks can be exchanged if they are programmed properly. Using new technologies can help you to find an elegant and easy way to solve complex problems and keep your code clean. And for sure - I don't want to be the "blocker" in the team who is always resisting changes.
What are your experiences?
|
|
|
|
|
Member 10873294 wrote: What are your experiences? One of my favourite quotes; "Find dependencies - and eliminate them!".
In Defense of Not-Invented-Here Syndrome[^].
Sounds logical to me, coming from WinForms; but I heard the web is interconnected, and these modules modulate themselves. Don't they?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I don't know how many time I heard "Don't reinventing the wheel". But yes reinvent the wheel. Are our car still build with wood or rock wheels?
|
|
|
|
|
B413 wrote: Are our car still build with wood or rock wheels? I reckon Kevlar[^], but I'm not quite sure - I never owned one
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
In the past I worked in a team of 100 developers on a very big project. The rule was to build everything in the house and avoid "out of the box" solutions. But we where 100 developers, we had the budget, the time and that was the good period and there wasn't a lot of good "out of the box" solutions.
After that I worked in smallest team with people pretending working on big project and it's probably true from their point of view but for me, because of my background, it was small teams and small projects. according to my experience in smallest team developers prefer to work with many "out of the box" solutions. Most of the time they don't have the budget or time to build their own solutions.
I insisted on the "pretending working on big project" because I often read information about people saying they use a lot of "out of the box" solutions in their "big" team or in their previous experience. But I can't imagine how they do when they have to manage their team, new developers and competencies, branching management with 5 or more versions at the same time, and trying to maintain all version of all your thirds party tools. As you said it's impossible to maintain a big project when you have to care about dependencies and updates of these third party frameworks.
I personally divide the developer in two categories just for fun. The alchemist and the magician. The first group are the developers that prefer to compose their code with "out of the box" solutions. The second group are the developers that prefer to build themselves everything. Of course most of people are somewhere between these two extreme.
EDIT -- I just learn that the term of Voodoo programmer already exists. My Alchemists are these Voodoo programmers.
modified 20-Jun-14 2:54am.
|
|
|
|
|
Hey guys, thanks for checking my post out. I'm writing this in hopes of getting some general feedback. Particularly, on my use of the design pattern and the abstractions I came up with.
I've been coding on-and-off for sometime now, but I never thought about design patterns until recently. I'm realizing how much I've missed out on ! But, anyway, I came across the decorator pattern in Head First Design Patterns and it got me thinking about a problem I couldn't solve a few years back...
It happened that I needed to enumerate all the different ways to choose k things from n things. The formula from discrete math tells you the total number of different ways to choose, but I needed to know what they were. I came up with a solution easily enough, but it was not acceptable. My solution (listed below) printed out all the different ways to choose 3 things from 6 things.
for(int item1 = 0; item1 < 6; ++item1){
for(int item2 = item1+1; item2 < 6; ++item2){
for(int item3 = item2+1; item3 < 6; ++item3){
System.out.println(item1 + " " + item2 + " " + item3);
}
}
}
Hopefully, it's obvious why it sucked! I could not vary, at run-time, the number of items I was choosing . I could only vary the total number of things to choose from. Choosing an additional item required hard-coding another nested loop. So, I caved in and just restricted the user to a range and coded for every case .
It was when I was learning the decorator pattern that it hit me. They kept talking about how decorators 'wrap' and 'contain' things and how they can be built dynamically. The figure[^] they used to illustrate the concept screamed "NESTED FOR-LOOPS" at me. I HAD to try and apply this design pattern to my problem. It didn't matter if it did not work or if there was a better solution; I'd count it as practice.
I'm going to assume you are familiar with the Decorator Pattern[^], but I provided the link if not. So, basically, my abstract component is ItemSet and my only concrete component is ChooseItem . The abstract decorator is AdditionalItems and the concrete decorator is ChooseAdditionalItem . Hopefully, the way I named them makes it easy to picture how they work together. I have to say, IMO its pretty nice how effortless the solution looks in the main function. I've written a sample below.
int setSize = 6;
int numberOfItemsToChoose = 3;
ItemSet itemSet = new ChooseItem(setSize);
for(int i=0; i < numberOfItemsToChoose-1; ++i)
itemSet = new ChooseAdditionalItem(itemSet);
Queue<String> waysToChoose = itemSet.chooseItems();
for(String aWayToChoose : waysToChoose)
System.out.println(aWayToChoose);
I promise the rest of the code is very short and human-readable, but I'd really, rather not post all the code here. Instead I'm providing a link[^] to it.
So, if you took a look at the code - thank you if you did! - you might have seen that this new solution is recursive. Meaning that all the different ways to choose are held in memory before they actually get printed out, whereas in the first one they were printed out immediately.
Any kind of feedback is appreciated. If you know of the best solution for this let me know or if you see a non-recursive solution, let me know too. Also, I am unemployed! So, help with that too would be amazing!
modified 5-Jun-14 23:48pm.
|
|
|
|
|
I am working on an embedded project with 2 microcontrollers, uC A and uC B. They are linked by an SPI-bus and uC A is the master and uC B is the slave. Both of the microcontrollers have read/write registers and uC A should be able to read and modify uC B's registers and vice versa. Is there a standard protocol available for this or do I need invent something myself?
|
|
|
|
|
|
I want simple numerical concepts related to Registers, Data Bus and Address Bus.
Please can any one give a clear concepts of solving numericals related to Registers, Data Bus and Address Bus.
example problems like:
If a memory had 16 bit address bus and a 32 bit data bus what is the largest size of the memory?
This will be very beneficial for me.
Thanks!
|
|
|
|
|
nischalinn wrote: This will be very beneficial for me.
Learning to do this[^] will be even more beneficial.
|
|
|
|
|
Hi, first of all, sorry if you don't understand something, english is not my main language.
I have to make a mini bank system (it's an assignment), but I don't really know how banks work. I'm thinking of making to web systems, one for the client and another one for the bank agent, but I don't know if there's a better way to do it. I would add a third kind of account, which is the Admin, to administrate the bank agent accounts and stuff, but I'm kind of lost on how banks actually work with this. I also need to withdraw (I don't know if this word is correct) money from an account, so I will need another app for the ATM (I can just think of the ATM as a "smart-atm", with touch screen and stuff, not necessarily like the ugly ones that exist now). Is it really necessary that I create 3 different systems? can you help me on the "design" of the problem?
I translated the basic requirements:
A bank system is needed. This system must allow deposits on a bank account. Deposits can be made in cash or by check. The system must keep a log of all the movements in the accounts. A "bank agent" can create client accounts, and he will have access to see their movements information, like amount, date, hour, and destination (transfers, deposits, etc). The application must allow:
Deposits by check.
- Validate the info. (ie: serial of the check)
Deposits in cash.
- Validate the info: client info, account number, etc.
User account management
- Profiles: Bank agent, client.
Bank account management
- User "Bank agent" can freeze bank accounts
- User "Client" can see the movements of his account (by date ranges, or a particular day, etc)
The system must have a service to withdraw money from the bank account
Thanks.
|
|
|
|
|
Do you have any restriction on the technology to be used?
|
|
|
|
|
Oh yes, sorry, I forgot. I have to use Java EE and Mysql server.
|
|
|
|
|
I would choose just one application with three different profiles.
Would opt for a presentation layer, a layer with the domain model or business layer and a data layer.
The presentation layer would then be a web application, the business layer would contain all the logic and finally the data layer that abstracts the business layer operations with the database.
The business layer in my opinion should be modeled using the domain language.
Do you already create your data model?
|
|
|
|
|
sebasuraa wrote: but I don't really know how banks work
You are confusing things.
You don't need to know how banks work.
What you need to know is how to implement the assignment that you were given. This should be based on something that you have already done.
Presumably you have already been introduced to designs or perhaps Agile. So that is where you start. Although if not you can still start by just coding one single feature.
|
|
|
|
|
I am building a sharepoint portal for providing services for customers.
the customer uses this portal to submit request that includes his data and his attachments. The attachments will be uploaded in a document library and the data will saved in a sharepoint list.
the expected count of requests that will be provided yearly is 5000 requests, and every request includes 10 attachment files.
What is the best approach that I should follow??
1- using SharePoint list for saving the requests in & using document library for saving the attachments.
2- using list & document library. and make folder for each year in the list and document library.
3- using database table for saving the data and using the document center in sharepoint for saving the attachments.
4- there are another approaches for this user requirement .
Thanks
Maher Elsayed
|
|
|
|
|
I was wondering if it is or is not. I know i586/686 is patched to all new software.
|
|
|
|