Home » Coding » Page 2024
Effective sort-by-example algorithm
Coding

Assume we have an array of objects of length N (all objects have the same set of fields).


And we have an array of length N of the same type values, which represent certain object's field (e.g. array of numbers representing IDs).


Now we want to sort the array of objects by the field which is represented in the 2nd array and in the same order as in the 2nd array.



effective methods for “editioning” your software in .net
Coding

Given a single .net codebase for a piece of software (let's use C# for argument's sake), and I want to break this software down into different editions based on functionality (like a basic edition and an advanced edition), what is the best way to go about this?


Would I have to factor this into my software architecture?


Effectively passing variables from a model then into the session
Coding

I am new to code igniter and MVC PHP, I have created a basic login system with online resources and it works, I am now trying to improve it to learn ...


my model:


function validate(){
$this->db->where('Email', $this->input->post('email'));
$this->db->where('Password', sha1($this->input->post('password')));

Emacs: Jump back to previous query-replace location
Coding

I do this a lot: [M-%] to query-replace, then hit [y] a few times, then I'm past the area where I'm changing things so I hit [q] to be done.


Then I'd like to get the cursor back to where I was, so here's where it gets awkward. I [C-_] to undo the last replace, then move the cursor on character, then

Emacs ESS keybinding “less than” dash
Coding

How to efficiently program in Emacs ESS-mode the key


"<" "[less than]"

to


"<- " "[less than][dash][space]"

Just like the MacOS version of R utilizes.


Elegant workaround for Safari print without print dialog bug?
Coding

The AppleScript standard suite has a command that will print from an application, allowing for the specifying of certain options and printing without displaying a dialog box. For example:


tell application "Safari"
print document 1 with properties {copies:3} without print dialog
end tell

However, there appears to be a bug in the current version o


EF Error - Unable to update the EntitySet because it has a DefiningQuery
Coding

I have removed the PrimaryKey from my table, refreshed the EDMX, and now I am getting this error message when doing db.SaveChanges():


Unable to update the EntitySet 'Results' because it has a DefiningQuery and no element exists in the element to support the current operation.


Now...
1 - I dont want PrimaryKey in my table. The table is just a bag of values, no PK


EF (Entity Framework) 4.3 Migration tool does not work on EF 4.1 DB
Coding

I want to modify one DB which was developed with EF 4.1 (Code First). I upgraded the project into EF 4.3 and follow this steps:
http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-automatic-migrations-walkthrough.aspx


Everything is going well, but when I want to test on current DB (EF 4.1 Code First), Update-Database raise this error:


Cannot scaffold the next


EF entities that contain relations (PKs,FKs) cannot be Json-ed?
Coding

I have build a very very simple database schema as


**Tickets**:
TicketId (PK)
AreaId (FK)
SeverityId (FK)
AssigneeId (FK)
**Areas**:
AreaId(PK)
AreaName
**Severities**:
SeverityId(PK)
SeverityName
**Assignees**:
AssigneeId(PK)
AssigneeName

I create the Entity Model and in the TicketController I


EF eager load multiple child child collections
Coding

I can't seem to find how to eager load multiple child child collections in EF. So I can do:


blawConext.Blaws
.Include(b => b.ChildCollection
.Select(cc => cc.ChildChildCollection)
)

I can even go deeper and deeper without a problem but I can't get the umm peer? collection, The below does not work


blawC

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .