In EF v1 when we used GetObjectByKey on our context object contrary to linq query it stored queried object in cache is there any change in EF v2 (.NET 4) ?
I'm looking for the best idea for what to do while code is compiling or tests are running. Typically around 5 minutes of thumb twiddling.
Only so many cups of coffee can be made and drunk in a day, and I don't want to be seen always in the kitchen or bothering other people.
Hi,
Some people have told me that my coding style is a lot different than theirs.
I think I am somewhat neurotic when it comes to spacing and indenting though.
Here's a snippet to show you what I mean:
- ( void ) applicationDidFinishLaunching: ( UIApplication *) application {
SomeObject *object = [ [ SomeObject alloc ] init ];
int x = 100 / 5;
object.someInstanceVariable = ( ( 4 * x ) + rand() );
[ object someMethod ];
}
Notice how I space out all of my brackets/parentheses, start curly braces on the same line, "my code has room to breathe", so to speak.
So my questions are a) is this normal and b) What's your coding style?
I have a page with several drop down lists that all have the same contents. The page starts out with only three ddls, but more need to be added based on user input. There is also other information associated with the drop down lists that is all in a table. So, when the user clicks a link I add a new row of textboxes and drop down lists to a table.
When I add a row to my table, the new drop down lists are empty because there is no view data associated with them. How can I use ajax or jquery to pull the viewdata that I need to populate new drop down lists?
We may not have the option to migrate over to Silverlight 4 right away, so I was wondering if anyone found a way to remove the source domain name from the window's title for out-of-browser Silverlight 3 applications. Our window title currently looks like this: "My App - localhost."
Under Mac, I found the Info.plist file in the application bundle and found where you can set the Bundle name property as well as TrimmedSourceDomain. Unfortunately, when I clear the TrimmedSourceDomain property, the title looks like "My App -," and if I delete the property entirely, the application doesn't launch. I assume similar problems would occur under Windows. Have any of you found a workaround?
Hi, I have Start Date and End date parameters that work fine as filters on a query, as follows:
[EMR Reporting].[Appointments].[Appointment Date] between ?Start Date? and ?End Date?
But when I attempt to apply conditional styles to a field based on ?Start Date?, the report blows up.
Should I be able to use parameter values in conditional style expressions, or is this not supported for some reason?
Thanks!
I'm trying to implement a simple api request to the SEOmoz linkscape api. It works if I only use the php file but I want to do an ajax request using jquery to make it faster and more user friendly. Here is the javascript code I'm trying to use:
$(document).ready(function(){
$('#submit').click(function() {
var url=$('#url').val();
$.ajax({
type: "POST",
url: "api_sample.php",
data: url,
cache: false,
success: function(html){
$("#results").append(html);
}
});
});
});
And here is the part of the php file where it takes the value:
$objectURL = $_POST['url'];
I've been working on it all day and can't seem to find the answer... I know the php code works as it returns a valid json object and displays correctly when I do it that way. I just can't get the ajax to show anything at all!!
Hi fellas,
I'm in the midst of an iPhone app that needs to have 4 separate UITableView objects sharing access to one UISearchBar in the first section and first row of the aforementioned UITableView objects.
I have tried to offset the UITableView's frame by 44 pixels, then adding the search bar as a subview of my UIViewController's view. That works, but I cannot use the table index to scroll up to the search bar, since it is not a cell in the tableview. I need to have the search bar in the table view itself.
My goal is to have the same UISearchBar in the first section of multiple tableviews.
Thanks so much.
Basically, this advances to the next hidden span when clicked.
The markup:
<div id="facts">
<span>click to cycle</span>
<span>fact 1</span>
<span>fact 2</span>
<span>fact 3</span>
<span>fact 4</span>
</div>
The js:
$(document).ready(function() {
var current = 1;
$('#facts span').click(function() {
// Hide all of them
$('#facts span').hide();
// Unhide the current one:
$('#facts span:eq(' + (current % $('#facts span').length) + ')').show();
// Increment the variable
console.log(current % 4);
current++;
});
// Unhide the first one on load
$('#facts span:first-child').show();
});?
What I'm trying to do now is remove the first span after it's been clicked, because it is not necessary for the user to see the 'click to cycle' instruction again.
Hello All,
I am new to Android programming and was handed a fairly large program that is almost complete, but needed support for switching between portrait and landscape view. I added android:configChanges="keyboardHidden|orientation" to the manifest and used onConfigurationChanged to save the view data and that works. However, there is a button that displays the date selected (when pressed a calendar to select the date comes up) and a spinner that displays the current view and is used to select a new view. Those two items are being cleared/reset and do not work at all after the screen flip.
I have been attempting to use onSaveInstanceState and onRestoreInstanceState to fix that, but I cannot figure out how to get it to work. Any advice?
I have runtime dependencies on some external jars that I would like to "rejar" into a single jar. These external dependencies are stored in a external_jars directory, and I'd like to be able to not have to list each one out (e.g., to not need to change my build scripts if my dependencies change). Any thoughts?
Google gave me a good answer on how to do this if you don't mind listing out each jar you want as a dependency:
http://markmail.org/message/zijbwm46maxzzoo5
Roughly, I want something along the lines of the following, which would combine all jars in lib into out.jar (with some sane overwrite rules).
jar -combine -out out.jar -in lib/*.jar
I can't seem to find a way to convert, or find, a local identifier from a sublanguage string. This site shows the mappings:
http://msdn.microsoft.com/en-us/library/dd318693(v=VS.85).aspx
I want the user to enter a sublanguage string, such as "France (FR)" and to get the local identifier from this, which in this case would be 0x0484. Or the other way around, if a user enters 0x0480 then to return French (FR).
Has anyone encountered this problem before and can point me in the right direction?
Otherwise I'm going to be writing a few mapping statements to hard code it and maintain future releases if anything changes.
BTW, I'm coding in C++ for Windows platform.
Cheers
I am experiencing some very odd timing behavior from a function I wrote. If I wrap my function inside another empty container function, it gets a 3x speedup.
> tic; foo(args); toc
time elapsed: ~140 seconds
>tic; bar(args); toc
time elapsed: ~35 seconds
Here's the kicker - the definition of bar():
define bar(args)
foo(args)
end
Is there some sort of optimization that gets triggered in MATLAB for nested function calls? Should I be adding a dummy function to every function that I write?
Hello All,
I am trying to display a chart with several different bars that represent a ratio of some values.
For example, one bar may say that there are 25 items in three different groups (maybe dirty, clean, and broken) and of those 25 items x items from each category add up to the total. Later the data will dynamically change and be displayed accordingly. But for now all I want to do is be able to display three different values on the same bar.
Unfortunately, whatever properties I need to bind the data to are buried somewhere in the menus and I cannot seem to find them. Do any of you guys have experience with this sort of chart?
This great SO answer points to a good sparse solver, but I've got constraints on x (for Ax = b) such that each element in x is >=0 an <=N. The first thing which comes to mind is an LP solver for large sparse matrices.
Any ideas/recommendations?
I'm in linker paradise now. I have a C library which only compiles in Visual C++ (it probably works in gcc) if:
I compile it as C++ code
Define __cplusplus which results in all the declarations being enclosed in extern "C" { }
So, by doing this I have a static library called, say, bsbs.lib
Now, I have a C++ project called Tester which would like to call function barbar in declared in bsbs.h. All goes fine, until I try to link to bsbs.lib where I get the all-too-familiar:
Tester.obj : error LNK2001: unresolved external symbol _foofoo
And it always seems to be foofoo which cannot be resolved regardless of which function I call in Tester (barbar or anything else).
What I want to do is that I want to make the many tables dinamically which are the same entity structures. And then I want to refer to the dinamically created tables according to the table name.
What I understood from hibernate reference is that I can only create only one table and it should be matched exactly with entity. So I can't find any solution to my problem.
If you know any relevent open source related to my problem or any tip or web site, let me know.
Thanks allways
Hey guys,
I have an Iqueryable that is populated from the database and then converted to an Array.
That works fine.
The issue is when I only have 1 element in the Array. I try to use the 0th element and it says "ArrayOutOfBoundsException". When I have 2+ elements in the array and pull elements 0 and 1 it works fine.
What gives?
The Goal: Use votes to rank nominated sites. The first answer to reach 100+ votes will be accepted.
Please answer following these 5 simple rules:
ONE SITE per answer.
Link to each page if nominating a "series" of resources on a SITE.
No "offline" books. Only online resources (tutorials, API references, blogs, screencasts, etc).
Don't add "subjective" details/notes in your answer. Add them as a comment to the answer.
Don't post duplicates. If your favourite is already listed Up Vote It!
Example Answer:
Site Name
http://www.example.com
Example Answer (site with a series of resources):
Site Name
http://www.example.com
Series Name A
http://www.example.com/video/a/1
http://www.example.com/video/a/2
Series Name B
http://www.example.com/video/b/1
Hi all,
I need to get the binary data of a download link.
When I run this link in the browser it always starts download manager. Rather I would like to copy that binary and display it on teh browser. How is this possible in any language.
Objective c or c# preferred.
Thanks
I have a place where I want users to submit emails for newsletter subs and a place to submit an entire contact form. Zero php knowledge outside of know that it can do what I need.
I am using Jar Bundler to create a .app file out of my .jar file. When I launch the app, I do not want a dock icon to show at all.
I have already tried modifying my .plist file to include:
<string>NSUIElement</string>
<key>1</key>
But it does not work... Any help?
I've got a class that wraps around an NSMutableSet object, and I have an instance method that adds objects (using the addObject: method) to the NSMutableSet.
This works well, but I'm smelling a performance hitch because inside the method i'm explicitly calling containsObject: before adding the object to the set.
Three part question:
Do I need to be calling containsObject: before I add an object to the set?
If so, then what actual method should I be using, containsObject or containsObjectIdenticalTo:?
If that is not so, what contains method gets invoked under the hood of addObject:? This is important to me because if I pass an object to containsObject: it would return true, but if I pass it to containsObjectIdenticalTo: it would return false.
Suppose I have a matrix A and I sort the rows of this matrix. How do I replicate the same ordering on a matrix B (same size of course)?
E.g.
A = rand(3,4);
[val ind] = sort(A,2);
B = rand(3,4);
%// Reorder the elements of B according the reordering of A
This is the best I've come up with
m = size(A,1);
B = B(bsxfun(@plus,(ind-1)*m,(1:m)'));
Out of curiosity, any alternatives?