Search Results

Search found 4252 results on 171 pages for 'david 85'.

Page 109/171 | < Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >

  • Mysql SQL join question

    - by David
    I am trying to find all deals information along with how many comments they have received. My query select deals.*, count(comments.comments_id) as counts from deals left join comments on comments.deal_id=deals.deal_id where cancelled='N' But now it only shows the deals that have at least one comment. What is the problem?

    Read the article

  • Recursion with Func

    - by David in Dakota
    Is it possible to do recursion with an Func delegate? I have the following, which doesn't compile because the name of the Func isn't in scope... Func<long, long, List<long>, IEnumerable<long>> GeneratePrimesRecursively = (number, upperBound, primeFactors) => { if (upperBound > number) { return new List<long>(); } else { if (!primeFactors.Any(factor => number % factor == 0)) primeFactors.Add(number); return GeneratePrimesRecursively(++number, upperBound, primeFactors); // breaks here. } };

    Read the article

  • Git using wrong email address when talking to Heroku

    - by David
    git clone [email protected]:myapp.git Results in a "myoldemailaddress not authorized to access myapp" myoldemailaddress was an email address I was using on an old heroku account, but it seems to be stuck using it, I can use my new one. I've removed the .heroku directory, and regenerated it, it has the correct user name and password, I can see my apps listed I've uploaded my key (I've regenerated my several times now) ssh-keygen -t rsa -C mynewaddress I uninstalled and reinstalled heroku on a different user in the same machine it works just fine. Something about my account has my old address, but I can't figure out where.

    Read the article

  • Did I implement clock drift properly?

    - by David Titarenco
    I couldn't find any clock drift RNG code for Windows anywhere so I attempted to implement it myself. I haven't run the numbers through ent or DIEHARD yet, and I'm just wondering if this is even remotely correct... void QueryRDTSC(__int64* tick) { __asm { xor eax, eax cpuid rdtsc mov edi, dword ptr tick mov dword ptr [edi], eax mov dword ptr [edi+4], edx } } __int64 clockDriftRNG() { __int64 CPU_start, CPU_end, OS_start, OS_end; // get CPU ticks -- uses RDTSC on the Processor QueryRDTSC(&CPU_start); Sleep(1); QueryRDTSC(&CPU_end); // get OS ticks -- uses the Motherboard clock QueryPerformanceCounter((LARGE_INTEGER*)&OS_start); Sleep(1); QueryPerformanceCounter((LARGE_INTEGER*)&OS_end); // CPU clock is ~1000x faster than mobo clock // return raw return ((CPU_end - CPU_start)/(OS_end - OS_start)); // or // return a random number from 0 to 9 // return ((CPU_end - CPU_start)/(OS_end - OS_start)%10); } If you're wondering why I Sleep(1), it's because if I don't, OS_end - OS_start returns 0 consistently (because of the bad timer resolution, I presume). Basically, (CPU_end - CPU_start)/(OS_end - OS_start) always returns around 1000 with a slight variation based on the entropy of CPU load, maybe temperature, quartz crystal vibration imperfections, etc. Anyway, the numbers have a pretty decent distribution, but this could be totally wrong. I have no idea.

    Read the article

  • Cucumber : Size of features

    - by David Lyod
    Im new to testing with cucumber and have a question regarding the size of a 'Feature'. Assume you can add a collection of items to a list and do the usual CRUD , is it preferred to create one feature for this complete set of CRUD actions or a feature for each? What is the preferred/accepted method ? At what point does an action become a feature itself ?

    Read the article

  • How can I differentiate a manual scroll (via mousewheel/scrollbar) from a Javascript/jQuery scroll?

    - by David Murdoch
    UPDATE: Here is a jsbin example demonstrating the problem. Basically, I have the following javascript which scrolls the window to an anchor on the page: // get anchors with href's that start with "#" $("a[href^=#]").live("click", function(){ var target = $($(this).attr("href")); // if the target exists: scroll to it... if(target[0]){ // If the page isn't long enough to scroll to the target's position // we want to scroll as much as we can. This part prevents a sudden // stop when window.scrollTop reaches its maximum. var y = Math.min(target.offset().top, $(document).height() - $(window).height()); // also, don't try to scroll to a negative value... y=Math.max(y,0); // OK, you can scroll now... $("html,body").stop().animate({ "scrollTop": y }, 1000); } return false; }); It works perfectly......until I manually try to scroll the window. When the scrollbar or mousewheel is scrolled I need to stop the current scroll animation...but I'm not sure how to do this. This is probably my starting point... $(window).scroll(e){ if(IsManuallyScrolled(e)){ $("html,body").stop(); } } ...but I'm not sure how to code the IsManuallyScrolled function. I've checked out e (the event object) in Google Chrome's console and AFAIK there is not way to differentiate between a manual scroll and jQuery's animate() scroll. How can I differentiate between a manual scroll and one called via jQuery's $.fn.animate function?

    Read the article

  • Navigation Within TabController

    - by David.Chu.ca
    I am trying to use UITabController as may controller in my main window and add navigation controllers to some tab bar items. For example, the first tab has a navigation controller with table view: ![alt text][1] The SettingsViewController is associated with its own NIB file, where a table view is defined. Within that xib file, I have a table view and set it to the outlet of SettingsViewController class property myTableView. The problem is that in the main xib file, for the SettingsViewController navigation, there is one outlet myTableView. I am not sure if I have to set this to somewhere? The exception I get is "[UIViewController _loadViewFromNibNamed:bundle:] loaded the "SettingsViewController" nib but the view outlet was not set." [1]:

    Read the article

  • Aldon and .Net Development

    - by David Stratton
    I'm looking for feedback from .Net developers who have experience with Aldon as a lifecycle management platform. We're seriously considering using Aldon for lifecycle management including source control, automated builds, etc. I know there are a lot of other options out there, but ours is primary an AS/400 shop (with AS/400 programmers outnumbering .Net developers 6 to 1), and Aldon is used already by our iSeries team. The benefit we're looking for is having one lifecycle management suite. Basically, I'm looking for opinions from people who have used Aldon and another set of tools (perhaps TFS, or a combination of SVN, Cruise Control, etc). If you've worked with both, do you have a recommendation on whether this is a good idea, or a bad idea? It's obviously a big choice, so any feedback would be helpful.

    Read the article

  • Making the #include square

    - by David
    I'm trying to write a makefile using CC on Solaris 10. [Only the first bit of that really matters, I think]. I have the following rule for foo.o: foo.o: foo.cc common_dependencies.h CC -c foo.cc -I../../common Unfortunately, common_dependencies.h includes all sorts of idiosyncratic trash, in directories not named '.' or '../../common' . Is this just going to have to be a brute force makefile where I ferret out all of the dependency paths? All of the dependencies are somewhere under '../..', but sometimes 1-level down and sometimes 2-levels down.

    Read the article

  • Get remote PC's date time?

    - by David.Chu.ca
    Is there any class available to get a remote PC's date time in .net? In order to do it, I can use a computer name or time zone. For each case, are there different ways to get the current date time? I am using Visual Studio 2005.

    Read the article

  • Android - Custom Widget doesnt update

    - by david
    Hi, I'm trying to make a widget to my app, but it doesnt update. I just need to change the textview text and open an activity when a press a button, but none of them works... the code public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.newswidget); views.setTextViewText(R.id.tvNews, "prueba1"); views.setString(R.id.tvNews, "setText", "prueba3"); Intent intent = new Intent(context, DoctorChatAndroid.class); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.ibNext, pendingIntent); for (int i = 0; i < appWidgetIds.length; i++) { appWidgetManager.updateAppWidget(i, views); } the layout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageButton android:id="@+id/ibNext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/ic_media_ff" android:layout_alignParentRight="true"/> <ImageButton android:id="@+id/ibLast" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/ic_media_rew" android:layout_toLeftOf="@id/ibNext"/> <TextView android:id="@+id/tvNews" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/nwNoNewAnswer" android:layout_toLeftOf="@id/ibLast"/> </RelativeLayout> the other xml thx a lot!!!

    Read the article

  • Is there a Firebug -vsdoc?

    - by David Murdoch
    If not, does anyone care to write one? I would do it myself...but I don't have time right now...maybe next week (unless someone beats me to it). If you are bored and want to compile the vsdoc: Here is the Firebug API. Here is an example vsdoc (jquery-1.4.1-vsdoc.js). I create the following because I kept typing cosnole instead of console. You can use it as a starting point (ish). console = { /// <summary> /// 1: The javascript console /// </summary> /// <returns type="Object" /> }; console.log = function (object) { /// <summary> /// Write to the console's log /// </summary> /// <returns type="null" /> /// <param name="object" type="Object"> /// Write the object to the console's log /// </param> };

    Read the article

  • Facebook Like Button (<fb:like>) Height Always 80px

    - by David
    Why is the height of my Facebook Like button (technically the iframe that gets generated) always getting set to 80px? Example page is here: http://www.davidkasper.net/test.html I am using the javascript sdk and have had it work on other pages but for some reason the height will not change dynamically on this one! I can even do something like <fb:like style="height:40px"> and that will indeed set the visible height, but the iframe will still be 80px, whereas I can see it changing in the demo at http://developers.facebook.com/docs/reference/plugins/like

    Read the article

  • Are there algorithms for increasing resolution of an image?

    - by David
    Are there any algorithms or tools that can increase the resolution of an image - besides just a simple zoom that makes each individual pixel in the image a little larger? I realize that such an algorithm would have to invent pixels that don't really exist in the original image, but I figured there might be some algorithm that could intelligently figure out what pixels to add to the image to increase its resolution.

    Read the article

  • StructureMap - Injecting a dependency into a base class?

    - by David
    In my domain I have a handful of "processor" classes which hold the bulk of the business logic. Using StructureMap with default conventions, I inject repositories into those classes for their various IO (databases, file system, etc.). For example: public interface IHelloWorldProcessor { string HelloWorld(); } public class HelloWorldProcessor : IHelloWorldProcessor { private IDBRepository _dbRepository; public HelloWorldProcessor(IDBRepository dbRepository) { _dbRepository = dbrepository; } public string HelloWorld(){ return _dbRepository.GetHelloWorld(); } } Now, there are some repositories that I'd like to be available to all processors, so I made a base class like this: public class BaseProcessor { protected ICommonRepository _commonRepository; public BaseProcessor(ICommonRepository commonRepository) { _commonRepository = commonRepository; } } But when my other processors inherit from it, I get a compiler error on each one saying that there's no constructor for BaseProcessor which takes zero arguments. Is there a way to do what I'm trying to do here? That is, to have common dependencies injected into a base class that my other classes can use without having to write the injections into each one?

    Read the article

  • Doing without partial commits the "Mercurial way"

    - by David Moles
    Subversion shop considering switching to Mercurial, trying to figure out in advance what all the complaints from developers are going to be. There's one fairly common use case here that I can't see how to handle. I'm working on some largish feature, and I have a significant part of the code -- or possibly several significant parts of the code -- in pieces all over the garage floor, totally unsuitable for checkin, maybe not even compiling. An urgent bugfix request comes in. The fix is nice and local and doesn't touch any of the code I've been working on. I make the fix in my working copy. Now what? I've looked at "Mercurial cherry picking changes for commit" and "best practices in mercurial: branch vs. clone, and partial merges?" and all the suggestions seem to be extensions of varying complexity, from Record and Shelve to Queues. The fact that there apparently isn't any core functionality for this makes me suspect that in some sense this working style is Doing It Wrong. What would a Mercurial-like solution to this use case look like?

    Read the article

  • How do I read an HttpResponse in ASP.NET 2.0?

    - by David
    For example, I have an ASP.NET form that is called by another aspx: string url = "http://somewhere.com?P1=" + Request["param"]; Response.Write(url); I want to do something like this: string url = "http://somewhere.com?P1=" + Request["param"]; string str = GetResponse(url); if (str...) {} I need to get whatever Response.Write is getting as a result or going to url, manipulate that response, and send something else back. Any help or a point in the right direction would be greatly appreciated.

    Read the article

  • How to perform add/update of a model object that contains EntitySet

    - by David Liddle
    I have a similar concept to the SO questions/tags scenario however am trying to decide the best way of implementation. Tables Questions, QuestionTags and Tags Questions QuestionTags Tags --------- ------------ ---- QID QID TID QName TID TName When adding/updating a question I have 2 textboxes. The important part is a single textbox that allows users to enter in multiple Tags separated by spaces. I am using Linq2Sql so the Questions model has an EntitySet of QuestionTags with then link to Tags. My question is regarding the adding/updating of Questions (part 1), and also how to best show QuestionTags for a Question (part 2). Part 1 Before performing an add/update, my service layer needs to deal with 3 scenarios before passing to their respective repositories. Insert Tags that do not already exist Insert/Update Question Insert QuestionTags - when updating need to remove existing QuestionTags Here is my code below however started to get into a bit of a muddle. I've created extension methods on my repositories to get Tags WithNames etc. public void Add(Question q, string tags) { var tagList = tags.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries).ToList(); using (DB.TransactionScope ts = new DB.TransactionScope()) { var existingTags = TagsRepository.Get() .WithName(tagList) .ToList(); var newTags = (from t in tagList select new Tag { TName = t }).Except(existingTags, new TagsComparer()).ToList(); TagsRepository.Add(newTags); //need to insert QuestionTags QuestionsRepository.Add(q); ts.Complete(); } } Part 2 My second question is, when displaying a list of Questions how is it best to show their QuestionTags? For example, I have an Index view that shows a list of Questions in a table. One of the columns shows an image and when the user hovers over it shows the list of Tags. My current implementation is to create a custom ViewModel and show a List of QuestionIndexViewModel in the View. QuestionIndexViewModel { Question Question { get; set; } string Tags { get; set; } } However, this seems a bit clumsy and quite a few DB calls. public ViewResult Index() { var model= new List<QuestionIndexViewModel>(); //make a call to get a list of questions //foreach question make a call to get their QuestionTags, //to be able to get their Tag names and then join them //to form a single string. return View(model); } Also, just for test purposes using SQL Profiler, I decided to iterate through the QuestionTags entity set of a Question in my ViewModel however nothing was picked up in Profiler? What would be the reason for this?

    Read the article

  • How can I modify input before model binding in asp.net mvc?

    - by David G
    How can I intercept submitted form input and modify it before it is bound to my model? For example, if I wanted to trim the whitespace from all text. I have tried creating a custom model binder like so: public class CustomBinder : DefaultModelBinder { protected override void SetProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor, object value) { string newValue = ((string)value).Trim(); //example code to create new value but could be anything base.SetProperty(controllerContext, bindingContext, propertyDescriptor, newValue); } } but this doesn't seem to be invoked. Is there a better place to modify the input value? Note: I need to modify the value before it is bound and validated.

    Read the article

  • Is anyone familiar with SDPT.clsSDPT?

    - by David Stratton
    Normally I wouldn't ask this kind of question here, but I'm desperate at this point. I'm attempting to support a classic ASP app written by a predecessor who is no longer available. Keeping it short, several applications use a dll to perform encryption of sensitive data. This dll is named SDPT.dll, and the line of code used to create an object is set objSDPT = server.CreateObject("SDPT.clsSDPT") At this point, I am getting errors in a critical app on one of my servers, and I've actually hit a dead end. The error is a standard "Server.CreateObject Failed" message, which I know how to troubleshoot in most cases. However, in this case, all of my normal tries, plus several hours of Google searches are coming up with nothing that works. At this point, I'm not so much looking for help in troubleshooting the issue as I am in finding any sort of reference on this third party component. Even finding that is proving to be difficult, so I'm resorting to asking any of the seasoned developers that hang out here if they are familiar with this product, who it was developed by, and if any documentation on it exists anywhere.

    Read the article

  • Convert Google Analytics cookies to Local/Session Storage

    - by David Murdoch
    Google Analytics sets 4 cookies that will be sent with all requests to that domain (and ofset its subdomains). From what I can tell no server actually uses them directly; they're only sent with __utm.gif as a query param. Now, obviously Google Analytics reads, writes and acts on their values and they will need to be available to the GA tracking script. So, what I am wondering is if it is possible to: rewrite the __utm* cookies to local storage after ga.js has written them delete them after ga.js has run rewrite the cookies FROM local storage back to cookie form right before ga.js reads them start over Or, monkey patch ga.js to use local storage before it begins the cookie read/write part. Obviously if we are going so far out of the way to remove the __utm* cookies we'll want to also use the Async variant of Analytics. I'm guessing the down vote was because I didn't ask a question. DOH! My questions are: Can it be done as described above? If so, why hasn't it been done? I have a default HTML/CSS/JS boilerplate template that passes YSlow, PageSpeed, and Chrome's Audit with near perfect scores. I'm really looking for a way to squeeze those remaining cookie bytes from Google Analytics in browsers that support local storage.

    Read the article

< Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >