Search Results

Search found 3484 results on 140 pages for 'chris dubois'.

Page 86/140 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • XSLT: Display unique rows of filtered XML recordset

    - by Chris G.
    I've got a recordset that I'm filtering on a particular field (i.e. Manager ="Frannklin"). Now I'd like to group the results of that filtered recordset based on another field (Client). I can't seem to get Muenchian grouping to work right. Any thoughts? TIA! CG My filter looks like this: <xsl:key name="k1" match="Row" use="@Manager"/> <xsl:param name="dvt_filterval">Frannklin</xsl:param> <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" /> <xsl:variable name="FilteredRowsAttr" select="$Rows[normalize-space(@*[name()=$FieldNameNoAtSign])=$dvt_filterval ]" /> Templates <xsl:apply-templates select="$FilteredRowsAttr[generate-id() = generate-id(key('k1',@Manager))]" mode="g1000a"> </xsl:apply-templates> <xsl:template match="Row" mode="g1000a"> Client: <xsl:value-of select="@Client"/> </xsl:template> Results I'm getting Client: Beta Client: Beta Client: Beta Client: Gamma Client: Delta Results I want Client: Beta Client: Gamma Client: Delta Sample recordset <dsQueryResponse> <Rows> <Row Manager="Smith" Client="Alpha " Project_x0020_Name="Annapolis" PM_x0023_="00123" /> <Row Manager="Ford" Client="Alpha " Project_x0020_Name="Brown" PM_x0023_="00124" /> <Row Manager="Cronkite" Client="Beta " Project_x0020_Name="Gannon" PM_x0023_="00129" /> <Row Manager="Clinton, Bill" Client="Beta " Project_x0020_Name="Harvard" PM_x0023_="00130" /> <Row Manager="Frannklin" Client="Beta " Project_x0020_Name="Irving" PM_x0023_="00131" /> <Row Manager="Frannklin" Client="Beta " Project_x0020_Name="Jakarta" PM_x0023_="00132" /> <Row Manager="Frannklin" Client="Beta " Project_x0020_Name="Vassar" PM_x0023_="00135" /> <Row Manager="Jefferson" Client="Gamma " Project_x0020_Name="Stamford" PM_x0023_="00141" /> <Row Manager="Cronkite" Client="Gamma " Project_x0020_Name="Tufts" PM_x0023_="00142" /> <Row Manager="Frannklin" Client="Gamma " Project_x0020_Name="UCLA" PM_x0023_="00143" /> <Row Manager="Jefferson" Client="Gamma " Project_x0020_Name="Villanova" PM_x0023_="00144" /> <Row Manager="Carter" Client="Delta " Project_x0020_Name="Drexel" PM_x0023_="00150" /> <Row Manager="Clinton" Client="Delta " Project_x0020_Name="Iona" PM_x0023_="00151" /> <Row Manager="Frannklin" Client="Delta " Project_x0020_Name="Temple" PM_x0023_="00152" /> <Row Manager="Ford" Client="Epsilon " Project_x0020_Name="UNC" PM_x0023_="00157" /> <Row Manager="Clinton" Client="Epsilon " Project_x0020_Name="Berkley" PM_x0023_="00158" /> </Rows> </dsQueryResponse>

    Read the article

  • How can I find out which version of emacs introduced a function?

    - by Chris R
    I want to write a .emacs that uses as much of the mainline emacs functionality as possible, falling back gracefully when run under previous versions. I've found through trial and error some functions that didn't exist, for example, in emacs 22 but now do in emacs 23 on the rare occasion that I've ended up running my dotfiles under emacs 22. However, I'd like to take a more proactive approach to this, and have subsets of my dotfiles that only take effect when version = <some-threshold> (for example). The function I'm focusing on right now is scroll-bar-mode but I'd like a general solution. I have not seen a consistent source for this info; I've checked the gnu.org online docs, the function code itself, and so far nothing. How can I determine this, without keeping every version of emacs I want to support kicking around?

    Read the article

  • Can you create a trigger on a field within a table?

    - by chris
    Is it possible to create a trigger on a field within a table being updated? So if I have: TableA Field1 Field2 .... I want to update a certain value when Field1 is changed. In this instance, I want to update Field2 when Field1 is updated, but don't want to have that change cause another trigger invocation, etc...

    Read the article

  • How to get debugging of an App Engine application working?

    - by Chris Lacy
    I've got 10+ years in C/C++, and it appears Visual Studio has spoilt me during that time. In Visual Studio, debbuging issimple: I just add a breakpoint to a line of code, and as soon as that code is executed, my breakpoint triggers, at which point I can view a callstack, local/member variables, etc. I'm trying to achieve this functionality under App Engine. I assume that is possible? All the searching I've done to this point has led me to using Pydev in Eclipse. As best I can tell, I am successfully launching my simple 'hello world' program in Debug mode. But the IDE doesn't even seem to have an option to set a breakpoint? I must be missing something. I've googled long and hard about this, but am having no luck. Most results trace back to the same old threads that don't deal directly with my issue. Can anyone shed some light on how you get basic debugging setup using Pydev/Eclipse with App Engine? Alternatively, if there's an easier way to debug App Engine than using Pydev/Eclipse, I'd love to hear about it. Thanks in advance.

    Read the article

  • DotNetOpenAuth occasionally throws a NotImplementedException

    - by Chris Moschini
    I have DotNetOpenAuth running on a background thread making calls to Google authorized with OAuth on a regular basis. About once a day, which is about one in 10,000 calls, I get the following Exception: An unhandled exception occurred and the process was terminated. Application ID: DefaultDomain Process ID: 3316 Exception: System.NotImplementedException Message: The method or operation is not implemented. StackTrace: at DotNetOpenAuth.Messaging.ProtocolException.GetObjectData(SerializationInfo info, StreamingContext context) in c:\Users\andarno\git\dotnetopenid\src\DotNetOpenAuth\Messaging\ProtocolException.cs:line 90 at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeObject(Object obj, MemoryStream stm) at System.AppDomain.Serialize(Object o) at System.AppDomain.MarshalObject(Object o) If it was thrown and caught once a day I'd be fine, but this is a big one - I'm getting this in the Application Error log on the server, and it's crashing the process entirely - the site goes down and restarts. Has anyone else run into this? Something I'm clearly doing wrong?

    Read the article

  • Fatal error on a non-object

    - by Chris Leah
    Hey, so I have created a function to check the DB for unique entries, but when I call the function it doesn't seem to work and gives me a fatal error any ideas ? Thanks :) //Check for unique entries function checkUnique($table, $field, $compared) { $query = $mysqli->query('SELECT '.$mysqli->real_escape_string($field).' FROM '.$mysqli->real_escape_string($table).' WHERE "'.$mysqli->real_escape_string($field).'" = "'.$mysqli->real_escape_string($compared).'"'); if(!$query){ return TRUE; } else { return FALSE; } } The page calling it..... //Start session session_start(); //Check if the session is already set, if so re-direct to the game if(isset($_SESSION['id'], $_SESSION['logged_in'])){ Header('Location: ../main/index.php'); }; //Require database connection require_once('../global/includes/db.php'); require_once('../global/functions/functions.php'); //Check if the form has been submitted if (isset($_POST['signup'])){ //Validate input if (!empty($_POST['username']) && !empty($_POST['password']) && $_POST['password']==$_POST['password_confirm'] && !empty($_POST['email']) && validateEmail($_POST['email']) == TRUE && checkUnique('users', 'email', $_POST['email']) == TRUE && checkUnique('users', 'username', $_POST['username']) == TRUE) { //Insert user to the database $insert_user = $mysqli->query('INSERT INTO (`username, `password`, `email`, `verification_key`) VALUES ("'.$mysqli->real_escape_string($_POST['username']).'", "'.$mysqli-real_escape_string(md5($_POST['password'])).'", "'.$mysqli->real_escape_string($_POST['email']).'", "'.randomString('alnum', 32). '"') or die($mysqli->error()); //Get user information $getUser = $mysqli->query('SELECT id, username, email, verification_key FROM users WHERE username = "'.$mysqli->real_escape_string($_POST['username']).'"' or die($mysqli->error())); //Check if the $getUser returns true if ($getUser->num_rows == 1) { //Fetch associated fields to this user $row = $getUser->fetch_assoc(); //Set mail() variables $headers = 'From: [email protected]'."\r\n". 'Reply-To: [email protected]'."\r\n". 'X-Mailer: PHP/'.phpversion(); $subject = 'Activate your account (Music Battles.net)'; //Set verification email message $message = 'Dear '.$row['username'].', I would like to welcome you to Music Battles. Although in order to enjoy the gmae you must first activate your account. \n\n Click the following link: http://www.musicbattles.net/home/confirm.php?id='.$row['id'].'key='.$row['verification_key'].'\n Thanks for signing up, enjoy the game! \n Music Battles Team'; //Attempts to send the email if (mail($row['email'], $subject, $message, $headers)) { $msg = '<p class="success">Accound has been created, please go activate it from your email.</p>'; } else { $error = '<p class="error">The account was created but your email was not sent.</p>'; } } else { $error = '<p class="error">Your account was not created.</p>'; } } else { $error = '<p class="error">One or more fields contain non or invalid data.</p>'; } } Erorr.... Fatal error: Call to a member function query() on a non-object in /home/mbattles/public_html/global/functions/functions.php on line 5

    Read the article

  • How do I print an HTML document from a web service?

    - by Chris Marasti-Georg
    I want to print HTML from a C# web service. The Web Browser control is overkill, and does not function well in a service-environment, nor does it function well on a system with very tight security constraints. Is there any sort of free .NET library that will support the printing of a basic HTML page? Here is the code I have so far, that is not running properly. public void PrintThing(string document) { if (Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) { Thread thread = new Thread((ThreadStart) delegate { PrintDocument(document); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); } else { PrintDocument(document); } } protected void PrintDocument(string document) { WebBrowser browser = new WebBrowser(); browser.DocumentText = document; while (browser.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } browser.Print(); } This works fine when called from UI-type threads, but nothing happens when called from a service-type thread. Changing Print() to ShowPrintPreviewDialog() yields the following IE script error: Error: 'dialogArguments.___IE_PrintType' is null or not an object URL: res://ieframe.dll/preview.dlg And a small empty print preview dialog appears.

    Read the article

  • Adding UIComponent to both Canvas and Tree in Flex 3

    - by Chris M
    I currently am trying to add a custom class which subclasses UIComponent to both a tree and a canvas, but when I try to re-order the tree by dragging I get this error: TypeError: Error #1010: A term is undefined and has no properties. at mx.controls::Tree/get firstVisibleItem()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\Tree.as:764] at flash.utils::ByteArray/writeObject() at flash.desktop::Clipboard/putSerialization() at flash.desktop::Clipboard/convertFlashFormat() at flash.desktop::Clipboard/setData() at mx.managers::NativeDragManagerImpl/doDrag()[C:\autobuild\3.2.0\frameworks\projects\airframework\src\mx\managers\NativeDragManagerImpl.as:282] at mx.managers::DragManager$/doDrag()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\DragManager.as:243] at mx.controls.listClasses::ListBase/dragStartHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:9085] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298] at mx.controls.listClasses::ListBase/mouseMoveHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:8822] When I do not add the UIComponent to the canvas, this error does not occur, anyone have any knowledge as to why this happens?

    Read the article

  • Delphi LoadLibrary Failing to find DLL other directory - any good options?

    - by Chris Thornton
    Two Delphi programs need to load foo.dll, which contains some code that injects a client-auth certificate into a SOAP request. foo.dll resides in c:\fooapp\foo.dll and is normally loaded by c:\fooapp\foo.exe. That works fine. The other program needs the same functionality, but it resides in c:\program files\unwantedstepchild\sadapp.exe. Both aps load the DLL with this code: FOOLib := LoadLibrary('foo.dll'); ... If FOOLib <> 0 then begin FOOProc := GetProcAddress(FOOLib , 'xInjectCert'); FOOProc(myHttpRequest, Data, CertName); end; It works great for foo.exe, as the dll is right there. sadapp.exe fails to load the library, so FOOLib is 0, and the rest never gets called. The sadapp.exe program therefore silently fails to inject the cert, and when we test against production, it the cert is missing, do the connection fails. Obviously, we should have fully-qualified the path to the DLL. Without going into a lot of details, there were aspects of the testing that masked this problem until recently, and now it's basically too late to fix in code, as that would require a full regression test, and there isn't time for that. Since we've painted ourselves into a corner, I need to know if there are any options that I've overlooked. While we can't change the code (for this release), we CAN tweak the installer. I've found that placing c:\fooapp into the path works. As does adding a second copy of foo.dll directly into c:\program files\unwantedstepchild. c:\fooapp\foo.exe will always be running while sadapp.exe is running, so I was hoping that Windows would find it that way, but apparently not. Is there a way to tell Windows that I really want that same DLL? Maybe a manifest or something? This is the sort of "magic bullet" that I'm looking for. I know I can: Modify the windows path, probably in the installer. That's ugly. Add a second copy of the DLL, directly into the unwantedstepchild folder. Also ugly Delay the project while we code and test a proper fix. Unacceptable. Other? Thanks for any guidance, especially with "Other". I understand that this issue is not necessarily specific to Delphi. Thanks!

    Read the article

  • NHibernate ManyToMany Relationship Cascading AllDeleteOrphan StackOverflowException

    - by Chris
    I have two objects that have a ManyToMany relationship with one another through a mapping table. Though, when I try to save it, I get a stack overflow exception. The following is the code for the mappings: //EventMapping.cs HasManyToMany(x => x.Performers).Table("EventPerformer").Inverse().Cascade.AllDeleteOrphan().LazyLoad().ParentKeyColumn("EventId").ChildKeyColumn("PerformerId"); //PerformerMapping.cs HasManyToMany<Event>(x => x.Events).Table("EventPerformer").Inverse().Cascade.AllDeleteOrphan().LazyLoad().ParentKeyColumn("PerformerId").ChildKeyColumn("EventId"); When I change the performermapping.cs to Cascade.None() I get rid of the exception but then my Event Object doesn't have the performer I associate with it. //In a unit test, paraphrased event.Performers.Add(performer); //Event eventRepository.Save<Event>(event); eventResult = eventRepository.GetById<Event>(event.id); //Event eventResult.Performers[0]; //is null, should have performer in it How should I be writing this properly? Thanks

    Read the article

  • How can I reuse my javascript code between client and server?

    - by Chris Farmer
    I have some javascript code that includes an ANTLR-generated lexer and parser, and some associated syntax tree evaluation functionality. This code runs in the browser in my web app to support users who author code snippets which process scientific data. Now I'd like to do some additional background processing on the server using the same generated parser. I would prefer not to have to re-implement this stuff in C# and have multiple bits of code that did the exact same thing. Performance isn't as critical to me as eliminating duplication, since this is a background process. So, how can I call into my javascript code from C#? And how can I format my script so that it plays nicely with my .NET web app?

    Read the article

  • IE8 displays white page when adding Javascript

    - by Chris
    I recently created a website and added some jQuery into it. However doing this makes IE8 display a white page. Whenever I remove the Javascript IE8 renders the site fine. I have tested locally as well as on the internet, the problem still persists. This is my code to include my .js files: <script type="text/javascript" src="jQuery/jQuery.js" /> <script type="text/javascript" src="jQuery/effects.js" />

    Read the article

  • NHibernate Proxy Creation

    - by Chris Meek
    I have a class structure like the following class Container { public virtual int Id { get; set; } public IList<Base> Bases { get; set; } } class Base { public virtual int Id { get; set; } public virtual string Name { get; set; } } class EnemyBase : Base { public virtual int EstimatedSize { get; set; } } class FriendlyBase : Base { public virtual int ActualSize { get; set; } } Now when I ask the session for a particular Container it normally gives me the concrete EnemyBase and FriendlyBase objects in the Bases collection. I can then (if I so choose) cast them to their concrete types and do something specific with them. However, sometime I get a proxy of the "Base" class which is not castable to the concrete types. The same method is used both times with the only exception being that in the case that I get proxies I have added some related entities to the session (think the friendly base having a collection of people or something like that). Is there any way I can prevent it from doing the proxy creating and why would it choose to do this in some scenarios? UPDATE The mappings are generated with the automap feature of fluentnhibernate but look something like this when exported <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" auto-import="true" default-cascade="none" default-lazy="true"> <class xmlns="urn:nhibernate-mapping-2.2" mutable="true" name="Base" table="`Base`"> <id name="Id" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <column name="Id" /> <generator class="MyIdGenerator" /> </id> <property name="Name" type="String"> <column name="Name" /> </property> <joined-subclass name="EnemyBase"> <key> <column name="Id" /> </key> <property name="EstimatedSize" type="Int"> <column name="EstimatedSize" /> </property> </joined-subclass> <joined-subclass name="FriendlyBase"> <key> <column name="Id" /> </key> <property name="ActualSize" type="Int"> <column name="ActualSize" /> </property> </joined-subclass> </class> </hibernate-mapping> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" auto-import="true" default-cascade="none" default-lazy="true"> <class xmlns="urn:nhibernate-mapping-2.2" mutable="true" name="Container" table="`Container`"> <id name="Id" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <column name="Id" /> <generator class="MyIdGenerator" /> </id> <bag cascade="all-delete-orphan" inverse="true" lazy="false" name="Bases" mutable="true"> <key> <column name="ContainerId" /> </key> <one-to-many class="Base" /> </bag> </class> </hibernate-mapping>

    Read the article

  • Cross-Domain iframe communication

    - by Chris
    I have an iframe being created on a page, and the page's domain is being explicitly set to 'xyz.com' but the iframe's domain is defaulting to 'dev.xyz.com', which is the actual domain i'm developing for. The problem is, when I try to access that iframe via iframe.contentWindow.document, it fails due to the difference in domain. I've tried setting the iframe's src to a file with document.domain = 'xyz.com' but that doesn't seem to be doing the trick... Any ideas?

    Read the article

  • Manipulating pixels using only toDataURL

    - by Chris
    The problem I have is this: I need to be able to dynamically tint an image using Javascript, but I cannot access pixel data via the canvas. I can, however, store the dataURL (or any other text-based data format) and include that with the code, manipulate that data, and then create an image object using that dataURL. My question is, how can I access the RGBA value of each pixel, given only the dataURL. I assume I need to decode the base64 url, but into what format in order to manipulate on the pixel level? And then would be it be as trivial as re-encoding it as base64, slapping it in a url, and the passing to an image? Thanks.

    Read the article

  • reflection paths between points in2d

    - by Chris H
    Just wondering if there was a nice (already implemented/documented) algorithm to do the following Given any shape (without crossing edges) and two points inside that shape, compute all the paths between the two points such that all reflections are perfect reflections. The path lengths should be limited to a certain length otherwise there are infinite solutions. I'm not interested in just shooting out rays to try to guess how close I can get, I'm interested in algorithms that can do it perfectly. Search based, not guess/improvement based.

    Read the article

  • How can I subsample data from a time series with LINQ to SQL?

    - by Chris Farmer
    I have a database table full of time points and experimental values at those time points. I need to retrieve the values for an experiment and create a thumbnail image showing an XY plot of its data. Because the actual data set for each experiment is potentially 100,000 data points and my image is only 100 pixels wide, I want to sample the data before creating the image. My current query (which retrieves all the data without sampling) is something simple like this: var points = from p in db.DataPoints where p.ExperimentId == myExperimentId orderby p.Time select new { X = p.Time, Y = p.Value } So, how can I best take every nth point from my result set in a LINQ to SQL query?

    Read the article

  • [Java] - Problem having my main thread sleeping

    - by Chris
    I'm in a Java class and our assignment is to let us explore threads in Java. So far so good except for this one this one problem. And I believe that could be because of my lack of understanding how Java threads work at the moment. I have the main thread of execution which spawns new threads. In the main thread of execution in main() I am calling Thread.sleep(). When I do I get an Unhandled exception type InterruptedException. I am unsure of why I am getting this? I thought this was because I needed a reference to the main thread so I went ahead and made a reference to it via Thread.currentThread(). Is this not the way to have the thread sleep? What I need to do is have the main thread wait/sleep/delay till it does it required work again. Any help would be much appreciated.

    Read the article

  • Unable to disable generation of sources JAR with maven-release-plugin

    - by Chris Lieb
    I am trying to release a web project using Maven 2.2.1 and the maven-release-plugin 2.0-beta-9, but it always fails when doing release:perform on generating the sources jar for the EAR project, which makes sense since the EAR project doesn't have any source. [INFO] [INFO] [source:jar {execution: attach-sources}] [INFO] [INFO] ------------------------------------------------------------------------ [INFO] [ERROR] BUILD ERROR [INFO] [INFO] ------------------------------------------------------------------------ [INFO] [INFO] Error creating source archive: You must set at least one file. To try to disable the building of a sources JAR for the EAR project, I added the following to the POM for my EAR project (the version of the release plugin is set in a parent POM): <build> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <configuration> <useReleaseProfile>false</useReleaseProfile> </configuration> </plugin> </plugins> </build> Upon running the release again after checking in this change, I got the same error while generating the sources JAR for the EAR project, even though this should have been disabled by the previous POM snippet. What am I doing wrong? Why is the sources JAR still being built? Edit: I've tried to make the source plugin include my application.xml file so that this error doesn't occur by adding the following POM snippet: <build> <plugins> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <configuration> <includes> <include>${basedir}/META-INF/**/*</include> </includes> <useDefaultExcludes>false</useDefaultExcludes> </configuration> </plugin> </plugins> </build> Unfortunately, this does not fix the problem either.

    Read the article

  • TicTacToe AI Making Incorrect Decisions

    - by Chris Douglass
    A little background: as a way to learn multinode trees in C++, I decided to generate all possible TicTacToe boards and store them in a tree such that the branch beginning at a node are all boards that can follow from that node, and the children of a node are boards that follow in one move. After that, I thought it would be fun to write an AI to play TicTacToe using that tree as a decision tree. TTT is a solvable problem where a perfect player will never lose, so it seemed an easy AI to code for my first time trying an AI. Now when I first implemented the AI, I went back and added two fields to each node upon generation: the # of times X will win & the # of times O will win in all children below that node. I figured the best solution was to simply have my AI on each move choose and go down the subtree where it wins the most times. Then I discovered that while it plays perfect most of the time, I found ways where I could beat it. It wasn't a problem with my code, simply a problem with the way I had the AI choose it's path. Then I decided to have it choose the tree with either the maximum wins for the computer or the maximum losses for the human, whichever was more. This made it perform BETTER, but still not perfect. I could still beat it. So I have two ideas and I'm hoping for input on which is better: 1) Instead of maximizing the wins or losses, instead I could assign values of 1 for a win, 0 for a draw, and -1 for a loss. Then choosing the tree with the highest value will be the best move because that next node can't be a move that results in a loss. It's an easy change in the board generation, but it retains the same search space and memory usage. Or... 2) During board generation, if there is a board such that either X or O will win in their next move, only the child that prevents that win will be generated. No other child nodes will be considered, and then generation will proceed as normal after that. It shrinks the size of the tree, but then I have to implement an algorithm to determine if there is a one move win and I think that can only be done in linear time (making board generation a lot slower I think?) Which is better, or is there an even better solution?

    Read the article

  • Entity Framework vs LINQ to SQL

    - by Chris Roberts
    Now that .NET v3.5 SP1 has been released (along with VS2008 SP1), we now have access to the .NET entity framework. My question is this. When trying to decide between using the Entity Framework and LINQ to SQL as an ORM, what's the difference? The way I understand it, the Entity Framework (when used with LINQ to Entities) is a 'big brother' to LINQ to SQL? If this is the case - what advantages does it have? What can it do that LINQ to SQL can't do on its own?

    Read the article

  • jQuery code working in Safari and Chrome but not Firefox

    - by Chris Armstrong
    I'm got a site that has a long list of tweets, and as you scroll down the right column follows you down, showing stats on the tweets. (See it in action at http://www.grapevinegame.com . Click 'memorise', then 'skip' to get to the list page. Works in Safari and Chrome). I'm using jQuery to update the top-margin of the right column, increasing it as I scroll down. It seems to be working fine in webkit-based browsers, but doesn't budge in Firefox. Heres the code, the right column element is a div with id = "distance". // Listen for scroll function $(window).scroll(function () { // Calculating the position of the scrollbar var doc = $("body"), scrollPosition = $("body").scrollTop(), pageSize = $("body").height(), windowSize = $(window).height(), fullScroll = (pageSize) - windowSize; percentageScrolled = (scrollPosition / fullScroll); var entries = $("#whispers-list > li").length; // Set position of distance counter $('div#distance').css('margin-top', ($("#whispers-list").height()+$("#latest-whisper").height()+33)*percentageScrolled); // Update distance counter $('#distance-travelled').text(Math.round(distanceTravelled*(1-percentageScrolled))); $('#whispers-list li').each(function(index) { //highlight adjacent whispers if ($('#whispers-list li:nth-child('+(index+1)+')').offset().top >= $('#distance').offset().top && $('#whispers-list li:nth-child('+(index+1)+')').offset().top <= $('#distance').offset().top + $('#distance').height()) { // alert("yup"); $('#whispers-list li:nth-child('+(index+1)+') ul').fadeTo(1, 1); } else { $('#whispers-list li:nth-child('+(index+1)+') ul').fadeTo(1, 0.5); } }); }); Appreciate any help or advice!

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >