Search Results

Search found 332 results on 14 pages for 'joao andre'.

Page 12/14 | < Previous Page | 8 9 10 11 12 13 14  | Next Page >

  • 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

  • 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

  • Difficults on sql query

    - by João Madureira Pires
    I have the following tables: TableA (id, tableB_id, tableC_id) TableB (id, expirationDate) TableC (id, expirationDate) I want to retrieve all the results from TableA ordered by tableB.expirationDate and tableC.expirationDate. thanks

    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

  • Shopping Cart with multiple orders in ASP

    - by Joao Heleno
    I'm building an e-commerce website in ASP.Net/C# and I'm having some difficulties with my shopping cart... I want my costumers to be able to say "I want X boxes, and each box carries Y items". Let's say, for instance, my website sells flowers. A client logs in and then chooses X bouquets and then for each bouquet he adds flowers from the catalog. Can you point me out some links or tips in order to achieve this behaviour? Thanks

    Read the article

  • Bash script to (more or less) reliably check if the internet is up

    - by João Portela
    I need a bash script to put in a cron job that every minute checks if the internet is up. This is how I did it: #! /bin/sh host1=google.com host2=wikipedia.org curr_date=`date +"%Y%m%d%H%M"` echo -n "${curr_date};" ((ping -w5 -c3 $host1 || ping -w5 -c3 $host2) > /dev/null 2>&1) && echo "up" || (echo "down" && exit 1) How would you do it? Which hosts would you ping? Thanks in advance.

    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

  • Pass Success variable to code

    - by João Dias
    How can I pass a variable that has been calculated in the success callback of an ajax function, to the document.ready ? I have this code function loadActions() { var countDiv; $.ajax({ type: "POST", cache: false, url:"modules/actions/actions.php", success : function (data) { $("#actions-container").html(data); $('.action-details').hide(); countDiv = $('.action-tab-odd').length + $('.action-tab-even').length ; } }); return countDiv; } $(document).ready(function(){ var count = loadActions(); }); But count is allways undefined. How can I get this to work? Thank you

    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

  • 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

  • Warn user when new data is inserted on database

    - by João Menighin
    I don't know how to search about this so I'm kinda lost (the two topics I saw here were closed). I have a news website and I want to warn the user when a new data is inserted on the database. I want to do that like here on StackOverflow where we are warned without reloading the page or like in facebook where you are warned about new messages/notifications without reloading. Which is the best way to do that? Is it some kind of listener with a timeout that is constantly checking the database? It doesn't sounds efficient... Thanks in advance.

    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

  • 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

  • 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

  • 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

  • How do you store accented characters coming from a web service into a database?

    - by Thierry Lam
    I have the following word that I fetch via a web service: André From Python, the value looks like: "Andr\u00c3\u00a9". The input is then decoded using json.loads: >>> import json >>> json.loads('{"name":"Andr\\u00c3\\u00a9"}') >>> {u'name': u'Andr\xc3\xa9'} When I store the above in a utf8 MySQL database, the data is stored like the following using Django: SomeObject.objects.create(name=u'Andr\xc3\xa9') Querying the name column from a mysql shell or displaying it in a web page gives: André The web page displays in utf8: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> My database is configured in utf8: mysql> SHOW VARIABLES LIKE 'collation%'; +----------------------+-----------------+ | Variable_name | Value | +----------------------+-----------------+ | collation_connection | utf8_general_ci | | collation_database | utf8_unicode_ci | | collation_server | utf8_unicode_ci | +----------------------+-----------------+ 3 rows in set (0.00 sec) mysql> SHOW VARIABLES LIKE 'character_set%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.00 sec) How can I retrieve the word André from a web service, store it properly in a database with no data loss and display it on a web page in its original form?

    Read the article

  • Audio capture tool

    - by gernblandston
    I'm looking for a free audio tool for capturing the audio that's playing on my computer to a wav/mp3, etc. I've been messing around with http://lab.andre-michelle.com/tonematrix and would like to capture the results of my labor. Thanks!

    Read the article

  • SpaceX’s Dragon Spacecraft Docks with the ISS [Video]

    - by Jason Fitzpatrick
    This weekend was the first time a commercial space craft successfully rendezvoused with the International Space Station. Check out this video to see the opening of the hatch. From the notes on NASA’s video release: Aboard the International Space Station, Expedition 31 Flight Engineer Don Pettit and Joe Acaba of NASA and European Space Agency Flight Engineer Andre Kuipers opened the hatch to SpaceX’s Dragon cargo craft and entered the vehicle May 26, one day after the world’s first commercial cargo spacecraft was berthed to the Earth-facing port of the Harmony module. Dragon will remain berthed to Harmony until May 31, enabling the crew to unload supplies for the station’s residents before it is re-grappled and released to return to Earth for a parachute-assisted splashdown in the Pacific Ocean off the coast of southern California. If you’re interested in learning more about the SpaceX program, hit up the link below. SpaceX How To Customize Your Wallpaper with Google Image Searches, RSS Feeds, and More 47 Keyboard Shortcuts That Work in All Web Browsers How To Hide Passwords in an Encrypted Drive Even the FBI Can’t Get Into

    Read the article

  • Refresh bounded taskflows across regions using InputParameters

    - by raghu.yadav
    Usecase1 : Selecting record from table in left region reflects dependent detail form of same table in right region using InputParameters Here is the example given by Andre Example Three important crux to be known from above example. 1) create primary key attribute in pagedef of the table in region1 2) add inputparameter name in taskflow inputparameters of region2 3) bind primary key attribute from page definition to above inputparameters in main page where above 2 regions dropped. UseCase2 : Selecting record from location table in left region reflects corresponding department records from department table in right regions. 1) create bind variable on location id in departmentVO. 2) create inputparameter say LocationParam, with type Number, value as #{pageFlowScope.LocationParam} 3) assign LocationId param from pagedef to LocationParam in taskflow2 4) create ExecuteWithParam action in region2 pagedef and invoke the same on IfRefresh condition. during run time - steps executes in backwards (3,2,1)..i,e as user selects column in location table, it assigns location from pagedef to locationParam and then to PageFlowScope and from there to view criteria.

    Read the article

< Previous Page | 8 9 10 11 12 13 14  | Next Page >