This is how I imagine my project's layering:
BLL
Should be independent and contain only pure business logic and properties
DAL
Contain generic repository and Unit of work and data model meaning model that will reflect the database.
Web
This will be ASP.NET MVC app that will use BLL. (Should...
showing two pdo objects in var_dump rather that one.
class A{
private $conn = null;
public function SQL(){
$ready = $this->conn->prepare('SELECT * FROM _session');
$ready->execute();
$value = $ready->fetchall( PDO::FETCH_ASSOC );
}
public function __cons...
I have a requirement where I need to extract pixels of a given rectangle within an image byte[].
Specifically I have an image where I have narrowed down an area that I wish to discard and an area which I wish to return and keep (in my case I'm performing face recognition).
It looks like this.
...
The one computer with two monitors in my work laptop. I'm actually working. One is my primary home computer that I use for all sorts of stuff. The other is the media server - I'm working on sorting through the music library.
Or, rather, if I ran in to one in the wild I would know how to be safe, and it would also probably be a very stupid cheetah (and there are not many of those).
I'm trying to post as a page on a facebook page since 4 days without success. Really frustrating.
I'm under PHP 5.4 (as requested by Facebook 4.0 SDK version).
Here is my code:
For logging-in:
<?php
require_once( BaseRoot. '/include/scripts/facebook_php_sdk/src/Facebook/FacebookSession.php' ...
Working on a server application and I decided to adopt an MVC approach. It's actually helped a lot in understanding my code, especially with learning the whole fat-model, thin-controller style thing. Seeing as I'm working on a server app, I decided I would start with the networking first (which i...
I don't know how to type Chinese characters and didn't want to pass several minutes to find the ones I needed to copy-past. That's why I wrote "I am"...
I am struggling to define where the validation process would be better placed in the different layers of the application? (I am not talking about user input validation here, I'm really talking about the object consistency).
A simple case:
A Blog entity which has a field List<Comment>, and a ...
For the record, everyone, if Jamal ever complains about being the only mod who closes questions that are off topic, please point him back here, and remind him that he can't close them before Captain Obvious..... has seen them, and expect other folk to know that too.
I'm trying to write program searching eulerian circuits in a graph with Fleury's algorithm. I failed on implementing bridges. This is what I got:
graph = {0: [4,5],
1: [2, 3, 4, 5],
2: [1, 3, 4, 5],
3: [1, 2],
4: [0, 1, 3, 5],
5: [0, 1, 2, 4]
...
we don't fix code here, you haven't told us what it isn't doing that it should be doing, and you haven't told us what the error is. — Malachi47 secs ago
you have some redundancy going on here
ImageIcon i = new ImageIcon("D:/ICS3U1/EvilMario/images/Menu.jpg");//Image for menu
menuBg = i.getImage();
i = new ImageIcon("D:/ICS3U1/EvilMario/images/EvilMario_Background.png"); //Image for background
background = i.getImage(); ...
@Malachi I'm afraid it makes no sense as it doesn't do what the OP wanted anymore... Though relying on a minification by ImageIcon isn't really appropiate as the OP does right now
@rolfl Do you know if all unit test classes need to have Test appended to their name in general? (I figured it is the case with some plugin I use for code coverage)
is this the only way to create an image? the way that the OP is doing it? I can't find a way to give the Image class a file location of an image..... maybe I am looking at this the wrong way
A lot of tools grew up in the age of JUnit3, and expect Test as part of the name. Scanning classes and instantiating them to see if they have a @Test annotation is a PITA.
It is much easier to short-circuit the logic by testing the class name before initializing the class.
Victoria Day (in French: Fête de la Reine) is a federal Canadian public holiday celebrated on the last Monday before May 25, in honour of Queen Victoria's birthday. The date is also, simultaneously, that on which the current reigning Canadian sovereign's official birthday is recognized. It is sometimes informally considered as marking the beginning of the summer season in Canada.
The holiday has been observed since before Canada was formed, originally falling on the sovereign's actual birthday, and continues to be celebrated in various fashions across the country on the fixed date; the...
I' making a Simon game with the arduino uno.
The problem is the program takes an input and says it is correct no matter what it is or the length of the input
I am familiar with java and c++ but i can't seem to find why it is doing this, and i know the programming has the error.
#define NOT...
@skiwi It means I am working, but people expect me to do it for free, and still come in happy tomorrow as if I have done nothing but sleep all (long)weekend
I'm not sure why Oracle decided to put some static factory methods in IntStream and stuff though... it's handy to have factory methods in the interface, but then the interface gets coupled with an implementation.
I posted not too long ago, asking for tips/improvements I could use on my models. I have changed quite a lot, so I thought I'll give it another go.
My model is supposed to handle all the data I get from the Foursquare API:
venueService.h
typedef void (^TNVenueServiceCompletionBlock)(UIImage *...
I'm a student new in modeling and I wonder if you could review my UML model and determine if this good or not.
a file had one type (the type is stocked in db), that the file will know his type but the type will not know the files that use
a type contains a group of fields and a ...
@skiwi Were you around when we had a visit from an ex-famous dictator? I flagged one of my own messages where I had explained the situation, and it caused a whole bunch of moderators to drop by.
I'm a student new in modeling and I wonder if you could review my UML model and determine if this good or not.
a file had one type (the type is stocked in db), that the file will know his type but the type will not know the files that use
a type contains a group of fields and a ...
Call me crazy, but right now I have 1000 lines of code in my HStoneTest class, which is supposed to do all the testing of my Hearthstone implementation. All of the tests look more or less like this:
@skiwi The method above does this: Create the game, play a card, play another card and attack, use healing power, use the first card to attack opponent and check the damage. (I do some assertions inside use, target and nextTurn as well to catch errors on the way)
@skiwi In my opinion, eventBus.executeEvent(new AlphaEvent()); inside testConstructorWithEventClassConstraint should be a compiler error. Why are you not using generics on your EventBus? Like this: EventBus<BetaEvent> eventBus = new SimpleEventBus(BetaEvent.class);
Why do you need to create a Variable here?
@Override
public void run() {
computeAllBoards(template);
solveAllBoards();
Scanner c = new Scanner(System.in);
while (c.hasNext()) {
String input = c.nextLine();
printSolution(input);
}
c.close();
}
this seem...
@skiwi Well, I've never been a big fan of your VoidEventBus implementation AFAIK... I think I've said it before but you could override some methods in it to make them do nothing, and so it can be a EventBus<Object>
Hi I am learning symfony2 an I see that my code smells.
First file is a controller, and createAction (especially uploading cover is a thing which frightend me :) )
But i don't know where to delegate this.
https://gist.github.com/anonymous/c2b29c105719fe8cfe17
https://gist.github.com/anonymous/...
I got this code working but it feels clunky. I am wondering if there is a way I can improve it. (I'm intermingling javascript and jQuery). I'm using jquery-1.11.1.min.js hosted on code.jquery.com. (fiddle link is at the bottom).
The JS:
<script>
$('#indices > div').each(function () {
var url =...
Question: I have tabs that users can 'pop out' to get them in separate frames. Closing the frame closes it, that's cool. Minimizing that frame returns it as to its state as a tab. Want or squick?
I like to imagine that this is an impressed, approving silence.
In some answer on SO: "You are trying to allocate space for 3,000,000,000,000 integers, each of which is 4 bytes, which works out to be 12,000,000,000,000 bytes or a bit under 11 TB."
I forgot how much RAM my first custom built (ordered) pc had... I'm 20 years old so don't expect too low of a numbers :p
I have had three custom PC's so far including this one... Started with 2GB on first, then 6GB on second, upgraded to 12GB (+ SSD) at som elater point and now it's 16GB here... So we need some bigger improvement to hit 12TB soon ;)
Though with 3D-stacked memory it may well be on the way
Is there a more efficient way of writing this? It seems like so much redundancy that this can be greatly reduced. Basically the only difference is if isNodeWebkit is true then run a function using keycode 113 or 112
if (isNodeWebkit) {
$(document).keyup(function (e) {
...