Search Results

Search found 511 results on 21 pages for 'roy andre'.

Page 14/21 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • CakePHP hasOne ineffeciency?

    - by Andre
    I was looking at examples on the CakePHP website, in particular hasOne used in linking models. http://book.cakephp.org/view/78/Associations-Linking-Models-Together My question is this, is CakePHP using two queries to build the array structure of data returned in a model that uses hasOne linkage? Taken from CakePHP: //Sample results from a $this-User-find() call. Array ( [User] => Array ( [id] => 121 [name] => Gwoo the Kungwoo [created] => 2007-05-01 10:31:01 ) [Profile] => Array ( [id] => 12 [user_id] => 121 [skill] => Baking Cakes [created] => 2007-05-01 10:31:01 ) ) Hope this all makes sense.

    Read the article

  • Serializing Request.Form to a Dictionary or something

    - by André Alçada Padez
    Hi i need to pass my Request.Form as a parameter, but first i have to add some key/value pairs to it. I get the exception that the Collection is readonly. I've tried: System.Collections.Specialized.NameValueCollection myform = Request.Form; and i get the same error. and i've tried: foreach(KeyValuePair<string, string> pair in Request.Form) { Response.Write(Convert.ToString(pair.Key) + " - " + Convert.ToString(pair.Value) + "<br />"); } to test if i can pass it one by one to another dictionary, but i get: System.InvalidCastException: Specified cast is not valid. some help, anyone? Thanx

    Read the article

  • Calculate open timeslots given availability and existing appointments - by day

    - by Andre
    Overview: I have a table which stores a persons "availability" for a current day, e.g. Mon - 8:00am - 11:30am Mon - 1:30pm - 6:00pm A second table stores appointments that this person already has for the same day, e.g. Mon - 8:30am - 11:00am Mon - 2:30pm - 4pm Desired result: Doing calculationsI'd like to have the following result - e.g. "this person has availability on the given day": Mon - 8:00am - 8:30am Mon - 11:00am - 11:30am Mon - 1:30pm - 2:30pm Mon - 4:00pm - 6:00pm Any ideas on how to calculate the output given the two inputs (e.g. availability, existing appointments) would be greatly appreciated. Preferably I'd use javascript on the client to do the calculating as I would believe that doing it within the DB (I'm using MSSQL) would be slow for many records, persons, etc. Hope this is enough information to illustrate the problem at hand - Many thanks in advance.

    Read the article

  • fast scrolling background

    - by Andre
    i want a game that scrolls the background in a similar way to a UItableView. I solved it with a timer that moves the background up and brings another copy of the same picture up if (bg1.center.y <= - self.view.bounds.size.height/2 ) { bg1.center = CGPointMake(bg1.center.x, 690); } if (bg2.center.y <= - self.view.bounds.size.height/2 ) { bg2.center = CGPointMake(bg2.center.x, 690); bg1.center = CGPointMake(bg1.center.x, bg1.center.y - movement); bg2.center = CGPointMake(bg2.center.x, bg2.center.y - movement); But the faster i move the pictures the more problems occur: There are appearing gaps between the backgrounds and they are getting biggiger the faster i move them! movement is defined by the speed of swiping over the screen Any idea to solve that?

    Read the article

  • Create a Color Picker, similar to Photoshop's, using Javascript and HTML Canvas

    - by André Alçada Padez
    I am not at all versed in Computer Graphics and am in need of creating a color picker as a javascript tool to embed in an HTML page. First, and looking at Photoshop's one, i thought of the RGB palette as a three-dimensional matrix. My first attempt envolved: <script type="text/javascript"> var rgCanvas = document.createElement('canvas'); rgCanvas.width = 256; rgCanvas.height = 256; rgCanvas.style.border = '3px solid black'; for (g = 0; g < 256; g++){ for (r = 0; r < 256; r++){ var context = rgCanvas.getContext('2d'); context.beginPath(); context.moveTo(r,g); context.strokeStyle = 'rgb(' + r + ', ' + g + ', 0)'; context.lineTo(r+1,g+1); context.stroke(); context.closePath(); } } var bCanvas = document.createElement('canvas'); bCanvas.width = 20; bCanvas.height = 256; bCanvas.style.border = '3px solid black'; for (b = 0; b < 256; b++){ var context = bCanvas.getContext('2d'); context.beginPath(); context.moveTo(0,b); context.strokeStyle = 'rgb(' + 0 + ', ' + 0 + ', ' + b + ')'; context.lineTo(20, b); context.stroke(); context.closePath(); } document.body.appendChild(rgCanvas); document.body.appendChild(bCanvas); </script> this results in something like My thought is this is too linear, comparing to the ones i see in Photoshop and on the web. I would like to know the logic behind the color mapping in a picker like this: I don't really need the algorythms itself, i'm mainly trying to understand the logic. Thanks

    Read the article

  • Are NHibernate lists loaded on demand?

    - by André Pena
    This is a pretty simple question. When I do this: session.CreateCriteria(typeof(Product)).List(); The resulting list will load as I access it? Let's say, from 100 to 100 elements for example? Or will it load all once? In the case it's not "virtual" how can I make it so? What's the best pratice about it? Thanks;

    Read the article

  • Dividing numbers between rows in MySQL + PHP

    - by André Figueira
    Hi I am working on a kind of raffle system which divides 1 million random numbers into an x amount of tickets, e.g. 1 million random numbers to 10,000 tickets. Each ticket is a row in a database, we then have another table ticket numbers in which i need to give 100 numbers to each ticket they are related by the ticket id. So at the moment this is my code: //Amount of the 1 million tickets divided to the tickets $numbersPerTickets = $_POST['numbersPerTicket']; //The total cost of the property $propertyPrice = $_POST['propertyPrice']; //The total amount of tickets $totalTickets = NUMBER_CIELING / $numbersPerTickets; //The ticket price $ticketPrice = $propertyPrice / $totalTickets; //Generate array with random numbers up to 999,999 $randomTicketNumbers = createTicketNumbers(); //Creation loop counter $ticketCreationCount = 1; //Loop and create each ticket while($ticketCreationCount <= $totalTickets) { //Create a padded ticket number $ticketNumber = str_pad($ticketCreationCount, 6, 0, STR_PAD_LEFT); $query = ' INSERT INTO tickets( propertyID, ticketNumber, price ) VALUES( "'.$propertyID.'", "'.$ticketNumber.'", "'.$ticketPrice.'" ) '; $db->query($query); //Get the ID of the inserted ticket to use to insert the ticket numbers $ticketID = $db->insert_id; $loopBreak = $numbersPerTickets; $addedNumberCount = 1; foreach($randomTicketNumbers as $key => $value) { $query = ' INSERT INTO ticketNumbers( ticketID, number ) VALUES( "'.$ticketID.'", "'.$value.'" ) '; $db->query($query); unset($randomTicketNumbers[$key]); if($addedNumberCount == $loopBreak){ break; }else{ $addedNumberCount++; } } $ticketCreationCount++; } But this isn't working it adds the right amount of tickets, which in the case for testing is 10,000 but then adds far too many ticket numbers, it ends up exceeding the million numbers in the random tickets array, The random tickets array is just a simple 1 tier array with 1 million numbers sorted randomly.

    Read the article

  • using an already proved lema/theorem/corollary in coq

    - by André Hincu
    I am trying to make a proof in Coq, and I would like to use a lemma already definded and proved by me. Is it possible for the following code? Lemma conj_comm: forall A B : Prop, A /\ B -> B /\ A. Proof. intros. destruct H. split. exact H0. exact H. Qed. Lemma not_conj_comm: forall A B : Prop, ~(A /\ B) -> ~(B /\ A). Proof. intros. intro. unfold not in H. apply H. use H0. In the above I want to use the fact that A /\B is the same as B /\ A in order to prove that ~(A /\ B) is the same as ~(B /\ A). Is it possible to use my proved lemma?

    Read the article

  • ASP.Net Custom Paging (w/ C#)

    - by André Alçada Padez
    Cenario: I have a GridView bound to a DataSource, every column is sortable. my main query is something like: select a, b, c, d, e, f from table order by somedate desc i added a filter form where i can define values to each one of the fields and get the results of a where form. As a result from this, i had to do a custom sorting so that when i sort by a field, i am sorting the filtered query and not the main one. Now i have to do custom paging, for the same reason, but i don't understand the philosophy of it: I want to guarantee that i can: filter the results sort by a column when i click on page 2, i get page two of the filtered and sorted results I don't know what i have to do, so i can bind the GV with this. My sorting Method, that is working just fine looks something like: string condition = GetConditions(); //gets a string like " where a>1 and b>2" depending on the filter the user defines string query = "select a, b, c, d, e, f from table "; string direction = (e.SortDirection == SortDirection.Ascending)? "asc": "desc"; string order = " order by " + e.SortExpression + " " + direction; UtilizadoresDataSource.SelectCommand = query + condition + order; i've never done custom paging, i am trying: GetConditions() //no problem here How can i find out how the GridView is sorted (by what field and sortingorder)? thank you very much

    Read the article

  • Error Handling in Model (MVC)

    - by Andre
    I was wondering what the excepted standard is for handling errors in the Model. Currently I have 'setError' and 'getError' methods that's in use by all my Models. This means I'm only concerned with whether a call to a method in my Model is true or false. If it's false then I would use $this-model-getError() in my Controller. Additionally I'm contemplating setting up a separate file that contains all my errors. One file per model, also wanted to have thoughts on this.

    Read the article

  • Windows Service Printing Behaviour

    - by Andre
    Alright, I was tasked to develop a Windows Service that listens to a directory for files that are dropped in it, read them, delete them and print out a report. I installed the service on my work laptop (Win 7 x86) and a test machine (XP x86) under a User account at first. It would do everything as it should except the print the report. No errors, nothing. Then I made it run under Local System and it produced a "No printers found" exception. Converting the app to a Console Application and running on these machines gave the desired result. OK, so now I was assuming that there are security "stuff" involved. Then I installed the service on a Server 2008 x64 machine (under Local System) and it just worked. Can anybody explain to me why this is happening? Why does the service allow printing from Server OS but not from a Desktop OS or am I missing something very obvious?

    Read the article

  • Does Entity Framework currently support custom functions in the Where clause?

    - by André Pena
    Entity Framework currently supports table valued functions and custom functions defined in the SSDL, but I can't find any example of it being used as a criteria, in the where clause. Example: var query = this.db.People; query = query.Where(p = FullText.ContainsInName(p.Id, "George")); In this example, ContainsInName is my custom function that I want to be executed in the where clause of the query. Is it supported?

    Read the article

  • Indexing affects only the WHERE clause?

    - by andre matos
    If I have something like: CREATE INDEX idx_myTable_field_x ON myTable USING btree (field_x); SELECT COUNT(field_x), field_x FROM myTable GROUP BY field_x ORDER BY field_x; Imagine myTable with around 500,000 rows and most of field_x values being unique. Since I don't use any WHERE clause, will the created index have any effect at all in my query? Edit: I'm asking this question because I don't get any relevant difference between query-times before and after creating the index; They always take about 8 seconds (which, of course is too much time!). Is this behaviour expected?

    Read the article

  • iPhone: Try to send html code to a php script (but fail)

    - by Marc-André Weibezahn
    Hello all, I am trying this for an iPhone app in Xcode: create html code for a website on the fly sending it to a php-script and getting the response with this code: NSError * error = [[[NSError alloc]init]autorelease]; NSURL * phpURL = [NSURL URLWithString: @"http://www.mydomain.com/myscript.php?mywebsite= (...websitestring...) ];NSString * myResponse = [NSString stringWithContentsOfURL:phpURL encoding:NSUTF8StringEncoding error:&error]; It does not work. It should not be a problem of the php code because when I replace the websitestring which contains the html code with "hello" or something, this is accepted. (the script then creates a file "test.html" with the content I sent.) But when I put html code in it, I always get the error: Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)" UserInfo=0x322ec10 {} It seems that there are some things to consider when sending code to php? Thanks in advance!

    Read the article

  • Move and rename file in android

    - by Andre Fróes
    I am trying to copy a file to another folder in the android, but so far, i got no success. I manage to do so with a selected image and when taking a photo, but not with files. I've read and tried several solutions passed by the community (searched over the forum and the internet), but none of it was able to solve my problem when copying. First things first. I added the permissions to my manifest: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> after that, before copying a file, i print its filepath and the directory file path: 06-10 11:11:11.700: I/System.out(1442): /mimetype/storage/sdcard/Misc/Javascript erros for Submit and Plan buttons in IE.doc 06-10 11:11:11.710: I/System.out(1442): /storage/sdcard/mywfm/checklist-files both exists: to copy the file to the expected folder I used the FileUtils: try { FileUtils.copyFile(selectedFile, dir); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } The problem is: I get no exception and the file isn't there. I tried this solution either: How to move/rename file from internal app storage to external storage on Android? same thing, no exception, but no file either.

    Read the article

  • Warning: Illegal string offset 'new_file' - Magento Site

    - by Roy
    We just migrated our magento installation from one of the hosting company and this keeps popping up whenever I try to duplicate product. Something wrong with codebase...Can someone please help. The code at 130 is… $object->setData($mediaAttrCode, $newImages[$attrData]['new_file']); THanks Warning: Illegal string offset 'new_file' in /home/spotzee/webapps/yourchemistonline/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php on line 130

    Read the article

  • Git over SSH Server in Windows, cannot find shared libraries.

    - by Roy Marco Aruta
    I was to setup an SSH Server to Host my Git Repository to my local area network. I followed this tutorial by TimDavis hoping that I would be able to make a secured Git Repository. I tested my connection using Putty and it was successful. My only problem was I cannot run "git" command in the console. Then I tried cloning my repository, and this was the error that outputed: /usr/bin/git-upload-pack.exe: error while loading shared libraries: libiconv2.dll: cannot open shared object file: No such file or directory Also when I ran "git" command in the Putty Bash that was connected to the SSH Server, this was the error I encountered: /usr/bin/git.exe: error while loading shared libraries: pthreadGC2.dll: cannot open shared object file: No such file or directory I seems that all my problem was about the missing libraries but I don't know how to solve it. I am using Windows 7 as an Operating System. Thanks

    Read the article

  • How countdown get Synchronise with jquery using "jquery.countdown.js" plugin?

    - by ricky roy
    unable to get the correct Ans as i am getting from the Jquery I am using jquery.countdown.js ref. site http://keith-wood.name/countdown.html here is my code [WebMethod] public static String GetTime() { DateTime dt = new DateTime(); dt = Convert.ToDateTime("April 9, 2010 22:38:10"); return dt.ToString("dddd, dd MMMM yyyy HH:mm:ss"); } html file <script type="text/javascript" src="Scripts/jquery-1.3.2.js"></script> <script type="text/javascript" src="Scripts/jquery.countdown.js"></script> <script type="text/javascript"> $(function() { var shortly = new Date('April 9, 2010 22:38:10'); var newTime = new Date('April 9, 2010 22:38:10'); //for loop divid /// $('#defaultCountdown').countdown({ until: shortly, onExpiry: liftOff, onTick: watchCountdown, serverSync: serverTime }); $('#div1').countdown({ until: newTime }); }); function serverTime() { var time = null; $.ajax({ type: "POST", //Page Name (in which the method should be called) and method name url: "Default.aspx/GetTime", // If you want to pass parameter or data to server side function you can try line contentType: "application/json; charset=utf-8", dataType: "json", data: "{}", async: false, //else If you don't want to pass any value to server side function leave the data to blank line below //data: "{}", success: function(msg) { //Got the response from server and render to the client time = new Date(msg.d); alert(time); }, error: function(msg) { time = new Date(); alert('1'); } }); return time; } function watchCountdown() { } function liftOff() { } </script>

    Read the article

  • Is there a measurestring equivalent in Silverlight xaml?

    - by Roy
    What I am trying to accomplish: Create a dynamic bubble that expands on height and width depending on the text in the bubble. What I researched so far: In an so article they described the measurestring to figure out the exact width or height so dynamic changes in the .cs to the width and height can be accomplished. Is there something like this in Silverlight? Is my only option to utilize the myTxt.Text.length and then change the myGrid.height and myGrid.width to leave wasted space to accommodate all cases?

    Read the article

  • How can resolve Error: "Could not load type 'Microsoft.SharePoint.WebControls.SPGridView" SharePoin

    - by ricky roy
    Following error comes when creating a WebPart In sharePoint 2010 Server. Web Part Error: Unhandled exception was thrown by the user code wrapper's Execute method in the partial trust app domain: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. --- System.TypeLoadException: Could not load type 'Microsoft.SharePoint.WebControls.SPGridView' from assembly 'Microsoft.SharePoint, Version=14.900.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. at ListMenuSample.ListMenuSample.ListMenuSample.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.ExecuteHttpRequest(SPUserCodeWebPartHttpRequestContext webPartExecutionContext, SPUserCodeWebPartHttpResponse httpRequestResponse) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.Execute(SPUserCodeExecutionContext executionContext) at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext) Thanks & Regards, Basant

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >