Daily Archives

Articles indexed Thursday March 25 2010

Page 6/127 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Can you play Halo 2 and Halo 3 on an Xbox360 Arcade?

    - by Jeremy Rudd
    I'm looking at purchasing a Xbox360 because I've wanted to catch up with the Halo trilogy. Does the cheap Arcade edition console support Halo 2 and Halo 3? Would I be able to save my game progress in single player? Would I be able to play online in typical maps? Would I be able to play games using the DVD drive or do I have to download everything? Does the tiny HDD hurt even if I don't download any games, trailers or music? Are there any other differences in comparison to the Xbox360 Pro? I have a regular TV that uses the composite cable, so I don't need the HDTV support in the Pro edition.

    Read the article

  • How to update Preview.app from the command line without losing focus on Mac OS X?

    - by snies
    I want to update Preview.app in the background from the command line without losing focus of my current window. I know that I can use the following to open/update the view of a file, but then I lose focus to the Preview.app. open -a Preview foo.pdf I guess there might be some clever AppleScript commands to do so but so far I didn't find the right one. Alternatively I would be interested into transfering the focus back to my current application directly after the update. I need this in order to update Preview.app's view of a PDF file through a vi autocmd after I update the PDF file according to changes in a TeX file I am editing. Here is an example of what I want to achieve but using Ubuntu and evince.

    Read the article

  • Idiots guide to app engine and memcache

    - by Gareth Simpson
    I am struggling to find a good tutorial or best practices document for the use of memcache in app engine. I'm pretty happy with it on the level presented in the docs. Get an object by ID, checking memcache first, but I'm unclear on things like: If you cache a query, is there an accepted method for ensuring that the cache is cleared/updated when an object stored in that query is updated. What are the effects of using ReferenceProperties ? If a cache a Foo object with a Bar reference. Is my foo.bar in memcache too and in need of clearing down if it gets updated from some other part of my application. I don't expect answers to this here (unless you are feeling particularly generous!), but pointers to things I could read would be very gratefully received.

    Read the article

  • Complex SQL query... names of returned variables

    - by Andrew P.
    Excuse me for what I'm sure is an elementary question for most of you, but I have an issue with table columns from separate tables having the same name as one another, and trying to select from both tables in the same query. Okay, so this is my code: $q_value = $mdb2->quote($_POST['query']); $field = $_POST['field']; $sql = "SELECT m.*, l.name FROM memberlist m, mail_lists l WHERE m.$field=$q_value AND l.id = m.list ORDER BY m.id"; $l_list = $mdb2->queryAll($sql, '', 'MDB2_FETCHMODE_ASSOC'); The table memberlist has the following columns: id, email, list, sex, name and the table mail_lists has the following columns: id, name After running the query, I later loop through the results with a foreach like so: foreach ($l_list as $l){ //blahblah } The problem is that the column 'name' in mail_lists refers to the names of the list, while the column 'name' in memberlist refers to the name of the member. When I later access $l-name (within the foreach), will I get m.name, or l.name? Furthermore, how do I get access to the other? Or will I just have to do two separate queries?

    Read the article

  • DefaultHttpClient GET and POST commands Java Android

    - by RenegadeAndy
    Ok this is my application : An Android app to allow me to submit CokeZone codes into CokeZone.co.uk from a mobile app instead of from the website. So I wrote this section of code to do the post logon command and then check to see if im logged in after. Problem is - the html I get from the homepage after I send the post command is the default - as if im not logged in - so something is going wrong. Can anyone please help! Its probably the URL im sending the POST to, or the params within the POST command - I havent done much of this stuff so its probably something obvious. Below is my code so far: DefaultHttpClient httpclient = new DefaultHttpClient(); HttpGet httpget = new HttpGet(url); HttpResponse response = httpclient.execute(httpget); HttpEntity entity = response.getEntity(); thisResponse = printPage(entity.getContent()); Log.e("debug",thisResponse); System.out.println("Login form get: " + response.getStatusLine()); if (entity != null) { entity.consumeContent(); } System.out.println("Initial set of cookies:"); List<Cookie> cookies = httpclient.getCookieStore().getCookies(); if (cookies.isEmpty()) { System.out.println("None"); } else { for (int i = 0; i < cookies.size(); i++) { System.out.println("- " + cookies.get(i).toString()); } } HttpPost httpost = new HttpPost("https://secure.cokezone.co.uk/home/blank.jsp?_DARGS=/home/login/login.jsp"); List <NameValuePair> nvps = new ArrayList <NameValuePair>(); nvps.add(new BasicNameValuePair("_dyncharset", "ISO-8859-1")); nvps.add(new BasicNameValuePair("/grlp/login/LoginHandler.loginFormBean.name","renegadeandy%40gmail.com")); nvps.add(new BasicNameValuePair("_D:/grlp/login/LoginHandler.loginFormBean.name", "+")); nvps.add(new BasicNameValuePair("/grlp/login/LoginHandler.cookiedUser", "false")); nvps.add(new BasicNameValuePair("_D:/grlp/login/LoginHandler.cookiedUser", "+")); nvps.add(new BasicNameValuePair("/grlp/login/LoginHandler.loginFormBean.password", "passwordval")); nvps.add(new BasicNameValuePair("_D:/grlp/login/LoginHandler.loginFormBean.password", "+")); nvps.add(new BasicNameValuePair("/grlp/login/LoginHandler.rememberMe", "yes")); nvps.add(new BasicNameValuePair("_D:/grlp/login/LoginHandler.rememberMe", "false")); nvps.add(new BasicNameValuePair("/grlp/login/LoginHandler.aSuccessURL", "http://www.cokezone.co.uk/home/index.jsp")); nvps.add(new BasicNameValuePair("_D:/grlp/login/LoginHandler.aSuccessURL", "+")); nvps.add(new BasicNameValuePair("/grlp/login/LoginHandler.aErrorURL", "http://www.cokezone.co.uk/home/index.jsphttps://secure.cokezone.co.uk/home/index.jsp")); nvps.add(new BasicNameValuePair("/grlp/login/LoginHandler.aErrorURL", "+")); nvps.add(new BasicNameValuePair("/grlp/login/LoginHandler.explicitLogin", "true")); nvps.add(new BasicNameValuePair("_D:/grlp/login/LoginHandler.explicitLogin", "+")); nvps.add(new BasicNameValuePair("/grlp/login/LoginHandler.fICLogin", "login")); nvps.add(new BasicNameValuePair("_D:/grlp/login/LoginHandler.fICLogin", "+")); nvps.add(new BasicNameValuePair("/grlp/login/LoginHandler.fICLogin", "LOGIN")); nvps.add(new BasicNameValuePair("_D:/grlp/login/LoginHandler.fICLogin", "+")); nvps.add(new BasicNameValuePair("_DARGS", "/home/login/login.jsp")); httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8)); response = httpclient.execute(httpost); entity = response.getEntity(); System.out.println("Login form get: " + response.getStatusLine()); if (entity != null) { thisResponse = printPage(entity.getContent()); entity.consumeContent(); } Log.e("debug",thisResponse); Log.e("debug","done"); httpget = new HttpGet("http://www.cokezone.co.uk/home/index.jsp"); response = httpclient.execute(httpget); entity = response.getEntity(); TextView points = (TextView)findViewById(R.id.points); points.setText(getPoints(entity.getContent()).toString()); debug.setText(thisResponse); System.out.println("Post logon cookies:"); cookies = httpclient.getCookieStore().getCookies(); if (cookies.isEmpty()) { System.out.println("None"); } else { for (int i = 0; i < cookies.size(); i++) { System.out.println("- " + cookies.get(i).toString()); } }

    Read the article

  • ASP.NET DataList - defining "columns/rows" when repeating horizontal and using flow layout

    - by Ian Robinson
    Here is my DataList: <asp:DataList id="DataList" Visible="false" RepeatDirection="Horizontal" Width="100%" HorizontalAlign="Justify" RepeatLayout="Flow" runat="server"> [Contents Removed] </asp:DataList> This generates markup that has each item wrapped in a span. From there, I'd like to break each of these spans out into rows of three columns. Ideally I would like something like this: <div> <span>Item 1</span> <span>Item 2</span> <span>Item 3</span> </div> <div> <span>Item 4</span> <span>Item 5</span> <span>Item 6</span> </div> [etc] The closest I can get to this is to set RepeatColumns to "3" and then a <br> is inserted after every three items in the DataList. <span>Item 1</span> <span>Item 2</span> <span>Item 3</span> <br> <span>Item 4</span> <span>Item 5</span> <span>Item 6</span> <br> This gets me kind of close, but really doesn't do the trick - I still can't control the layout the way I'd like to be able to. Can anyone suggest a way to make this better? If I could implement the above example - that would be perfect, however I'd accept a less elegant solution as well - as long as its more flexible than <br> (such as inserting a <span class="clear"></span> instead of <br>).

    Read the article

  • In what programing language are the things i actualy care about writin? [closed]

    - by David
    To be more specific and less subjective: In what language are video games like Halo 3/COD 4/ mario cart written? Microsoft word for windows? for mac? The animation software used by big movie studios to make movies like toystory and monsters inc? The software that helps pilots control the F22 raptor? The software that watches the stock market? The software in the computer in my car? The software that makes the internet work? (this one is a bit vague, if more specificness is needed then google specifically) robots?

    Read the article

  • How to chroot Django

    - by Brian M. Hunt
    Can one run Django in a chroot? Notably, what's necessary in order to set up (for example) /var/www as a chroot'd directory and then have Django run in that chroot'd directory? Thank you - I'm grateful for any input.

    Read the article

  • Auto insert date and time in form input field?

    - by Mo Boho
    Using javascript, how can we auto insert the current DATE and TIME into a form input field. I'm building a "Problems" form to keep track of user submitted complaints about a certain service. I'm collecting as much info as possible. I want to save the staff here from having to manually enter the date and time each time they open the form. I have this snippet of code: <input id="date" name="date" value="javascript:document.write(Date()+'.')"/> but it's not working. many thanks for any help.

    Read the article

  • Site Security/Access management for asp.net mvc application

    - by minal
    I am trying to find a good pattern to use for user access validation. Basically on a webforms application I had a framework which used user roles to define access, ie, users were assigned into roles, and "pages" were granted access to a page. I had a table in the database with all the pages listed in it. Pages could have child pages that got their access inherited from the parent. When defining access, I assigned the roles access to the pages. Users in the role then had access to the pages. It is fairly simple to manage as well. The way I implemented this was on a base class that every page inherited. On pageload/init I would check the page url and validate access and act appropriately. However I am now working on a MVC application and need to implement something similar, however I can't find a good way to make my previous solution work. Purely because I don't have static pages as url paths. Also I am not sure how best to approach this as I now have controllers rather then aspx pages. I have looked at the MVCSitemapprovider, but that does not work off a database, it needs a sitemap file. I need control of changing user persmissions on the fly. Any thoughts/suggestions/pointers would be greatly appreciated.

    Read the article

  • Average of two strings in alphabetical/lexicographical order

    - by Bemmu
    Suppose you take the strings 'a' and 'z' and list all the strings that come between them in alphabetical order: ['a','b','c' ... 'x','y','z']. Take the midpoint of this list and you find 'm'. So this is kind of like taking an average of those two strings. You could extend it to strings with more than one character, for example the midpoint between 'aa' and 'zz' would be found in the middle of the list ['aa', 'ab', 'ac' ... 'zx', 'zy', 'zz']. Might there be a Python method somewhere that does this? If not, even knowing the name of the algorithm would help. I began making my own routine that simply goes through both strings and finds midpoint of the first differing letter, which seemed to work great in that 'aa' and 'az' midpoint was 'am', but then it fails on 'cat', 'doggie' midpoint which it thinks is 'c'. I tried Googling for "binary search string midpoint" etc. but without knowing the name of what I am trying to do here I had little luck.

    Read the article

  • Is it possible to read from Mercurial repository using PHP

    - by Metropolis
    Hey Everyone, After trying to get the mercurial repository explorer setup on my shared hosting with no luck, I have decided to try and write a module for our Intranet that will act as a repository explorer. Is it possible for me to get changesets from a Mercurial repository without Mercurial installed on the machine? Thanks for any help! Metropolis

    Read the article

  • How many javascript link I can have in Facebook?

    - by Murvinlai
    Is there a limit of how many js file I can include () in facebook? I include 5 files. no problem.. the 6th one not loaded. Then I have to put the code in the 6th one into the 5th file. then works. so, is it 5 files in max? BY THE WAY, I'm developing the apps now, not in production. so it is not in the stage of compressing JS / minizing it. :) so it is kinda annoying to got missing js files or files not loaded..etc so, what is the limit from FB? what is the file size limit? I know that the JSON request call back data limit is 5000.. but not sure about the js include.

    Read the article

  • Freehand drawing with Quartz 2D

    - by qutaibah
    I am trying to develop a simple freehand-drawing app for red-marking some of my images. Below is a method that is called from within the drawRect. I want to ask if there is a way to avoid add the path every time the path is redrawn? Also, the way the draw method is set up, the drawing gets a bit slow and choopy after a few seconds. How can I improve the smoothness of the drawn path? thanks -(void)freehandDraw:(CGContextRef)context inRect:(CGRect)rect { CGPathAddLineToPoint( path, NULL, drawTip.x, drawTip.y); CGContextAddPath( context, path); CGContextStrokePath(context); } // method

    Read the article

  • strcasecmp in C returns 156 instead of 0, any ideas why?

    - by hora
    I have the following code: printf("num: %d\n", strcasecmp(buf, "h\n")); And I get the following results when I try plugging in different letters: a: -7 g: -1 i: 1 j: 2 h: 156 H: 156 Should strcasecmp not return 0 when buf is equal to H or h? Any ideas why it's returning 156? I need to figure out how to check whether the user types H or h. Thanks!

    Read the article

  • What is the name of this geometrical function?

    - by Spike
    In a two dimentional integer space, you have two points, A and B. This function returns an enumeration of the points in the quadrilateral subset bounded by A and B. A = {1,1} B = {2,3} Fn(A,B) = {{1,1},{1,2},{1,3},{2,1},{2,2},{2,3}} I can implement it in a few lines of LINQ. private void UnknownFunction(Point to, Point from, List<Point> list) { var vectorX = Enumerable.Range(Math.Min(to.X, from.X), Math.Abs(to.X - from.Y) + 1); var vectorY = Enumerable.Range(Math.Min(to.Y, from.Y), Math.Abs(to.Y - from.Y) + 1); foreach (var x in vectorX) foreach (var y in vectorY) list.Add(new Point(x, y)); } I'm fairly sure that this is a standard mathematical operation, but I can't think what it is. Feel free to tell me that it's one line of code in your language of choice. Or to give me a cunning implementation with lambdas or some such. But mostly I just want to know what it's called. It's driving me nuts. It feels a little like a convolution, but it's been too long since I was at school for me to be sure.

    Read the article

  • Core data and @unionOfSets

    - by KevinD
    Im having trouble using the @unionOfSets on my core-data objects. NSLog(@"%@", [NSApp valueForKeyPath:@"delegate.mainWindowController.sidebarViewController.arrayController.selection.list.listElement"]); Prints the set of listElements as expected 2010-03-24 18:11:15.844 Pirouette[7459:80f] Relationship objects for {( (entity: PRPlaylistElement; id: 0x10a71b0 ; data: ), (entity: PRPlaylistElement; id: 0x10ac7d0 ; data: ), (entity: PRPlaylistElement; id: 0x10acf60 ; data: ), (entity: PRPlaylistElement; id: 0x10a6850 ; data: ) However when I try to get the set of file objects for each of the list elements. NSLog(@"%@", [NSApp valueForKeyPath:@"delegate.mainWindowController.sidebarViewController.arrayController.selection.list.listElement.@unionOfArrays.file"]); I get the following error 2010-03-24 18:16:45.843 Pirouette[7505:80f] An uncaught exception was raised 2010-03-24 18:16:45.844 Pirouette[7505:80f] [<NSCFSet 0x10415e0> valueForKeyPath:]: this class does not implement the unionOfArrays operation. 2010-03-24 18:16:45.847 Pirouette[7505:80f] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '[<NSCFSet 0x10415e0> valueForKeyPath:]: this class does not implement the unionOfArrays operation.' Confused because I thought calling to-many relationships in core-data were NSSets.

    Read the article

  • bug/error in basis set path algorithm i can't figure out

    - by Roy McAvoy
    The following looks through a 2d array to find basis set paths. It is supposed to print out the individual paths but not repeat any and end when all paths are found. It however doesn't stop at the last path and has a bug in it somewhere in which the following happens: It goes halfway through the path and then goes to zero and ends the path for some reason. For example the table is filled with the following: all 0s, except for [1][2], [1][3], [2][4], [2][5], [3][5], [4][6], [5][6], [6][0] which all have a 1 in them. The desired paths are P1: 1 2 4 6 0 P2: 1 3 5 6 0 P3: 1 2 5 6 0. The output I get when i run the program is 12460 13560 1250 124 Any and all help on this is much appreciated, this is just the function that scans through the array looking for paths, I can add the entire program if that would be helpful. Thanks.. void find_path(int map[][MAX], int x){ int path =0; int m=1; int blah=0; bool path_found = false; do { for(int n=0;n<(x+1);n++){ if(map[m][n]==-1){ blah=(n+1); if(blah<(x+1)){ for(blah;blah<(x+1);blah++){ if(map[m][blah]==1){ map[m][blah]=-1; path=m; path_found = true; cout<<path; m=blah; n=0; } } } else{ path=m; path_found=false; cout<<path; m=n; if(m==0){ path=0; cout<<path<<endl; m=1; path_found=false; } } } else if(map[m][n]==1){ map[m][n]=-1; path=m; path_found = true; cout<<path; m=n; if(m==0){ path=0; cout<<path<<endl; m=1; path_found=false; } } } } while(m<(x+1) && path_found); }

    Read the article

  • Maths Question: number of different permutations

    - by KingCong
    This is more of a maths question than programming but I figure a lot of people here are pretty good at maths! :) My question is: Given a 9 x 9 grid (81 cells) that must contain the numbers 1 to 9 each exactly 9 times, how many different grids can be produced. The order of the numbers doesn't matter, for example the first row could contain nine 1's etc. This is related to Sudoku and we know the number of valid Sudoku grids is 6.67×10^21, so since my problem isn't constrained like Sudoku by having to have each of the 9 numbers in each row, column and box then the answer should be greater than 6.67×10^21. My first thought was that the answer is 81! however on further reflection this assume that the 81 number possible for each cell are different, distinct number. They are not, there are 81 possible numbers for each cell but only 9 possible different numbers. My next thought was then that each of the cells in the first row can be any number between 1 and 9. If by chance the first row happened to be all the same number, say all 1s, then each cell in the second row could only have 8 possibilites, 2-9. If this continued down until the last row then number of different permutations could be calculated by 9^2 * 8^2 * 7^2 ..... * 1^2. However this doesn't work if each row doesn't contain 9 of the same number. It's been quite a while since I studied this stuff and I can't think of a way to work it out, I'd appreciate any help anyone can offer.

    Read the article

  • How to handle Android SimpleExpandableListAdapter entry selection.

    - by DaveG
    I have created an expandable list in my Android application using the SimpleExpandableListAdapter type. But I'm at a complete loss as to how I detect events when one of the child entries has been selected/clicked. I've tried all the usual OnClickListener/OnChildClickListener etc, but can't seem to find (by experimentation, or half an hour googling) what the correct handler routines should be. Any help greatfully appreciated.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >