I am creating a ASP.NET MVC 3 application using Entity Framework 4. I am using the Repository/Service Pattern and was looking for feedback.
I currently have the following:
MVC Application (GTG.dll)
GTG
GTG.Controllers
GTG.ViewModels
Business POCO's (GTG.Business.dll)
This contains all business objects (Customer, Order, Invoice, etc...)
EF…
I want to do the following
I have a database table of students, and I want to output each student name in a check box list.
so
checkbox. Student 1
checkbox. Student 2
Where the value of the checkbox is the student's ID.
How can I do that using Symfony?
I want teachers to be able to select one or more checkboxes.
I tried following this…
Hi,
I am trying to use the jquery bubble popup inside the jquery carousel. the problem everything works fine. but say if i have 10 items in the carousel, display 5 at a time, hiding the remaining 5 items(which could be opened by clicking the left or right navigation). so when we move the mouse over each carousel item that is visible on the…
I'd like the program to exit if the input number is less than 0, but sys.exit() isn't doing the trick. This is what I have now:
if len( sys.argv ) > 1:
number = sys.argv[1]
if number <= 0:
print "Invalid number! Must be greater than 0"
sys.exit()
Object.update_attribute(:only_one_field, "Some Value")
Object.update_attributes(:field1 => "value", :field2 => "value2", :field3 => "value3")
Both of these will update an object without having to explicitly tell AR to update.
Rails API says:
for update_attribute
Updates a single attribute and saves the record without going…
Say, for example, I've got this simple class:
public class MyClass
{
public String MyProperty { get; set; }
}
The way to get the PropertyInfo for MyProperty would be:
typeof(MyClass).GetProperty("MyProperty");
This sucks!
Why? Easy: it will break as soon as I change the Name of the Property, it needs a lot of dedicated tests to…
Is it possible to position: absolute a <div /> over a Flash banner without adding wmode="transparent" to the banner?
I have a lightbox that needs to appear above my ads but I can't directly modify the banners as they come from a third party.
I have a before filter than calculates a percentage that needs to include the object that is being updated. Is there a one liner in rails that takes care of this?
for example and this is totaly made up:
Object.find(:all, :include = :updated_object)
Currently I'm sending the object that is getting updated to the definition that…
I am trying to parse this array data that way generated from JQuery and JSON.
Array
(
[d] = Array
(
[0] = Array
(
[order] = 1
)
[1] => Array
(
[order] => 2
)
[2] => Array
(…
Hi folks,
I have a translucent toolbar over the bottom of my UIWebView. The trouble is, if there is a link at the bottom of the page, I can't press it because the webview will always bounce back down to the bottom.
I don't want to shrink the webview and use a solid colour toolbar, and UIWebViews interface doesn't open much up.…
To save both client download time and network usage, is it possible to use the localStorage feature of HTML5 to store contents of linked stylesheets, javascript files and binary data (e.g. images), rather than hitting the server each time?
Would that just complicate things - since I assume you would have to add the linked asset…
The answer to this must be somewhere but I'm not finding it -- can anyone help me understand why in Gedit, if I have a page of code there is no extra trailing blank line, but then when I do a file comparison for my svn commit it shows an extra line being added at the end of the file?
I have a feeling that Gedit is automatically…
We have a current eCommerce Site that runs on ASP.NET and we hired a consultant to develop an new site bases on SOA. The new site architecture is as follows
Web Application : Single Page Web Application (built on javascript/jquery templates - do not use any MVVM frameworks) that uses some javascript thrown all over the place.…
how does one use code to do this:
produce 15 random numbers that are not in any order, and that only occur once
eg.
1 4, 2, 5, 3, 6, 8, 7, 9, 10, 13, 12, 15, 14, 11
rand() or arc4rand() can repeat some, which is not what im after.
Thanks
What is GUI anchor? All i have heard is that a person can hold a lock on the GUI for some lenght of time , say 2 hours, and in that peiord no otherr person can access that GUI, beacause if allowed access there can be discrepancy.....
I would like to create a time counter in my app that shows the user how many minutes the app has been running the current session and total. How do I create such time counter and how do I save the value to the phone? I'm new to app developement.
[Update] I see I need the full example to explain.
In my Windows Phone 7 App, I got a page containing a TextBox bound to a Decimal "Amount":
<TextBox Text="{Binding Amount,Mode=TwoWay}" InputScope="CurrencyAmount"/>
The phone settings are set to German. In german localization, a value like 1234.56m would be…
I have this regular expression: [^\\s\"']+|\"([^\"]*)\"|'([^']*)'
which works for splitting a string by white spaces, and anything within a quotation is not delimited. However, I notice that if I put in a string that starts with "" no matches are found. How would I correct this?
For example, if I enter " test 2".
I…
I've been assigned the project of creating a simple console app. that models brownian motion in a 2D plane. I wasn't given much information on how to do so (and I'm hoping that it's a pretty popular assignment so that I could get some insight) just that it relies on random number generation. I researched brownian…
I have a Windows Forms UI running on a thread, Thread1. I have another thread, Thread2, that gets tons of data via external events that needs to update the Windows UI. (It actually updates multiple UI threads.)
I have a third thread, Thread3, that I use as a buffer thread between Thread1 and Thread2 so that…
In c# you can use as to convert a type or get null:
Object o = Whatever();
String s = o as String;
Is there a similar easy way to achieve this in c++? I'm using Visual Studio 2010, if thats important.
[update] Remember, there is a very important difference between casting and using as. Casting (at least…
I am trying to compare two vector objects, and return a single vector containing all the chars which appear in both vectors.
How would I go about this without writing some horribly complex manual method which compares every char in the first vector to every char in the second vector and using an if to add…