Search Results

Search found 3479 results on 140 pages for 'chris cyvas'.

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

  • 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 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • NamedPipeClientStream StreamReader problem in C++

    - by Chris Porter
    When reading from a NamedPipes server using the .net NamedPipeClientStream class I can only get the data on the first read in C++, every time it's just an empty string. In c# it works every time. pipeClient = gcnew NamedPipeClientStream(".", "Server_OUT", PipeDirection::In); try { pipeClient->Connect(); } catch(TimeoutException^ e) { // swallow } StreamReader^ sr = gcnew StreamReader(pipeClient); String^ temp; while (temp = sr->ReadLine()) { // = sr->ReadLine(); Console::WriteLine("Received from server: {0}", temp); } sr->Close();

    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

  • int considered harmful?

    - by Chris Becke
    Working on code meant to be portable between Win32 and Win64 and Cocoa, I am really struggling to get to grips with what the @#$% the various standards committees involved over the past decades were thinking when they first came up with, and then perpetuated, the crime against humanity that is the C native typeset - char, short, int and long. On the one hand, as a old-school c++ programmer, there are few statements that were as elegant and/or as simple as for(int i=0; i<some_max; i++) but now, it seems that, in the general case, this code can never be correct. Oh sure, given a particular version of MSVC or GCC, with specific targets, the size of 'int' can be safely assumed. But, in the case of writing very generic c/c++ code that might one day be used on 16 bit hardware, or 128, or just be exposed to a particularly weirdly setup 32/64 bit compiler, how does use int in c++ code in a way that the resulting program would have predictable behavior in any and all possible c++ compilers that implemented c++ according to spec. To resolve these unpredictabilities, C99 and C++98 introduced size_t, uintptr_t, ptrdiff_t, int8_t, int16_t, int32_t, int16_t and so on. Which leaves me thinking that a raw int, anywhere in pure c++ code, should really be considered harmful, as there is some (completely c++xx conforming) compiler, thats going to produce an unexpected or incorrect result with it. (and probably be a attack vector as well)

    Read the article

  • Wrapping with Dependency Properties

    - by Chris
    I've got a Windows Forms control that I'm wrapping with a WindowsFormsHost-derived class to access WPF's data binding functionality. The Forms control exposes properties that indicate its state, along with the standard property-changed event notifier. For example, a Zoom property on the Forms control is accompanied with a ZoomChanged event. In the WindowsFormsHost wrapper, I'm using a DependencyProperty to represent the underlying Windows Forms control property. Binding works as expected going to the control; however, I'm not sure how to correctly propogate property changes from the wrapped control back out to binding subscribers (i.e., the Windows Form control changes its Zoom property and raises the ZoomChanged event). Any ideas on how to accomplish this? Should I be using a different approach?

    Read the article

  • NetworkActivityIndicator not working the same on iPhone and Simulator?

    - by Chris
    I am using the NetworkActivityIndicator to show that my App is doing some work. When I run the app in the simulator, it shows the way I want - basically spinning the entire time until the selected tab loads the data from the server - but when I put the app onto my phone, I only get a split-second of the spinner before it disappears. Usually only spins right before the view appears on the screen. Ideas?

    Read the article

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