Daily Archives

Articles indexed Sunday February 20 2011

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

  • Reverse X11 forwarding

    - by Oli
    I was playing with my phone (that runs a Linux/X stack) last night and I managed to ssh into my desktop and run an application and have it show up on my phone. It was awesome. Today I'd like to sort of do the opposite. I want to view an application running on my phone on my PC. I could install a SSH server on my phone but I frankly don't fancy that purely for security reasons. I want this to be initiated from my phone. Is there a way to connect from my phone and tunnel the PC's X connection back to the phone and then run an application on the phone that show on the PC?

    Read the article

  • Unity does not display properly [closed]

    - by Ben Isaacs
    Ubuntu Unity on the Ubuntu netbook edition installs without a problem but when I log in though, where the panels are, there is just blank area with a shadow effect style thing on it. I can open apps but the Window buttons and the global menu are not visable. Does this mean that I cannot use Unity. I'm running it through Wubi on a Dell Inspiron 1501 laptop. My total ammount of graphics memory is 831MB My dedicated memory is 128MB. The odd thing is is that Windows Aero displays without a problem so why is there a problem with Unity Hope this helps Ben

    Read the article

  • Simple form validation

    - by ElendilTheTall
    Hi, I have a site with a simple contact form using ASP for customers to e-mail quote requests. However, I'm getting quite a few messages through with no contact information; I think people assume that their e-mail address is coming through automatically. I'd like a simple way to make the e-mail and/or telephone number fields required, preferably so that the fields are highlighted as such if they're submitted without anything in them. I've Googled for this but they seem either too simple, diverting people to a separate page and requiring a 'back click', or incredibly complicated with massive reams of code. Any suggestions?

    Read the article

  • Domain held at one registry, need to redirect to subdomain on my own hosting provider

    - by Glinkot
    Hi, There are lots of questions around this general area, but I haven't seen one that exactly mirrors what I'd like to know. It's per the title really. My understanding (and what I'm told by my host) is the easiest thing is just to get the transfer key and bring the DNS across to my own hosting provider. Also I'm told by my host this doesn't affect the client's ownership of the domain itself. Basically, I have a subdomain setup with the site (this has the same IP address as the top level domain). So presumably just giving the other registrar that IP address will only refer it only to the TLD rather than the subdomain. What's the easiest way to achieve this? It's an asp.net site, I don't have a hosted directory on the client's account where I can code a redirect. Thanks all Mark

    Read the article

  • Optimizing perceived load time for social sharing widgets on a page?

    - by Lucka
    I have placed the facebook "like" and some other social bookmarking websites link on my blog, such as Google Buzz, Digg, Twitter, etc. I just noticed that it takes a while to load my blog page as it need to load the data from the social networking sites (such as number of likes etc). How can I place the links efficiently so that first my blog content loads, and meanwhile it loads data from these websites -- in other words, these sharing widgets should not hang my blog page while waiting for data from external sites?

    Read the article

  • Is a subdomain per service a good idea for SEO?

    - by Kennie R.
    I am creating a site with quite a few services, such as a free account service, and of course a subdomain for my site's blog and then for article base and other related services, would having them all on subdomains be a good idea? Are there any caveats you are aware of in existing search engines for this? I believe mapping foo.example.com to example.com/foo to provide an alternative just in case is a good idea for sitemaps, I like to keep things clean.

    Read the article

  • Resources on expected behaviour when manipulating 3D objects with the mouse

    - by sebf
    Hello, In my animation editor, I have a 3D gizmo that sits on the origin of a bone; the user drags the mesh around to rotate the bone. I've found that translating the 2D movements of the mouse into sensible 3D transforms is not near as simple as i'd hoped. For example what is intuitively 'up' or 'down'? How should the magnitude of rotations change with respect to dX/dY? How to implement this? What happens when the gizmo changes position or orientation with respect to the camera? ect. So far with trial and error i've written something (very) simple that works 70% of the time. I could probably continue to hack at it until I made something that works 99% of the time, but there must be someone who needed the same thing, and spent the time coming up with a much more elegant solution. Does anyone know of one?

    Read the article

  • Slot Machine Pay Out

    - by Kris.Mitchell
    I have done a lot of research into random number generators for slot machines, reel stop calculations and how to physically give the user a good chance on winning. What I can't figure out is how to properly insure that the machine is going to have a payout rating of (lets say) 95%. So, I have a reel set up wit 22 spaces on it. Filled with 16 different symbols. When I get my random number, mod divide it by 64 and get the remainder, I hop over to a loop up table to see how the virtual stop relates to the reel position. Now that I have how the reels are going to stop, do I make sure the payout ratio is correct? For every dollar they put in, how to I make sure the machine will pay out .95 cents? Thanks for the ideas. I am working in actionscript, if that helps with the language issues, but in general I am just looking for theory.

    Read the article

  • C#: Basic Reflection Class

    - by Mike
    I'm trying to find a basic reflection abstract class that will generate basic information about a class. I have a template of how I would like it to work: class ThreeList<string,Type,T> { string Name {get; set;} Type Type {get; set;} T Value {get; set;} } abstract class Reflect<T> { List<ThreeList<string, Type, T> list; ReturnType MethodName() { foreach (System.Reflection.PropertyInfo prop in this.GetType().GetProperties()) { object value = prop.GetValue(this, new object[] { }); list.Add(prop.Name, prop.DeclaringType, value); } } } I'd like it to be infinitely deep, recursively calling Reflect. Something like this has to exist. I'm not really opposed to coding it myself, I just don't want to go through the hassle if its already been done.

    Read the article

  • CSV Parser works in windows, not linux.

    - by ladookie
    I'm parsing a CSV file that looks like this: E1,E2,E7,E8,,, E2,E1,E3,,,, E3,E2,E8,,, E4,E5,E8,E11,,, I store the first entry in each line in a string, and the rest go in a vector of strings: while (getline(file_input, line)) { stringstream tokenizer; tokenizer << line; getline(tokenizer, roomID, ','); vector<string> aVector; while (getline(tokenizer, adjRoomID, ',')) { if (!adjRoomID.empty()) { aVector.push_back(adjRoomID); } } Room aRoom(roomID, aVector); rooms.addToTail(aRoom); } In windows this works fine, however in Linux the first entry of each vector mysteriously loses the first character. For Example in the first iteration through the while loop: roomID would be E1 and aVector would be 2 E7 E8 then the second iteration: roomID would be E2 and aVector would be 1 E3 Notice the missing E's in the first entry of aVector. when I put in some debugging code it appears that it is initially being stored correctly in the vector, but then something overwrites it. Kudos to whoever figures this one out. Seems bizarre to me. rooms is declared as such: DLList<Room> rooms where DLList stands for Doubly-Linked list.

    Read the article

  • Querying my JPA provider (Hibernate) for a collection of <Id,Name> of an entity

    - by Ittai
    Hi, I have an entity which looks something like this: Id (PK) Name Other business properties and associations... I have the need for my DAL (JPA with hibernate as provider) to return a list of the entities which correlate to some constraints (or just return them all) but instead of returning the entities themselves I'd like to receive only the Id and the Name properties. I know this can be achieved with HQL/SQL (something like: select id,name from entity where...) but I don't want to go down that road. I was thinking of somehow defining the pair a compositioned part of the entity and thought that might help me but I'm not sure that's "legal" as the Id is the PK. The logic for this scenario is to have a textbox which asynchronously queries the web-service (and through it the DAL) for the relevant entities and once an entity is selected then it is loaded as a whole and shipped to the front-end. Would appreciate any feedback, Ittai

    Read the article

  • How to prevent parallel builds per build configuration across multiple Build Agents

    - by vanslly
    I have many build configurations in TeamCity, each servicing a large project. In the past if a build is kicked off the Build Agent could be busy for up to 20min! In order to improve throughput I installed a second Build Agent on the same machine such that if a build run is kicked off by say Build Agent 1 and it is busy for 20min and someone from another project makes a change then Build Agent 2 can do the build for the other project without needing to wait on the current build run to finish. All was well until two successive check-ins resulted in both Build Agents running a build for a single build configuration in parallel. Since some resources are shared, IIS directories & databases, I don't want a single build configuration to run on both Build Agents in parallel. How can I ensure a build isn't triggered if a build is currently running for that build configuration on a different build agent? One way seems to involve environmental variables and ensuring a 50/50 split by Build Agent in terms of build configuration compatibility, but that seems a little clunky.

    Read the article

  • E2251 Ambiguous overloaded call to ....

    - by Eric M
    I inherited some Delphi components/code that currently compiles with C++ Builder 2007. I'm simply now trying to compile the components with C++ Builder RAD XE. I don't know Delphi (object pascal). Here are the versions of the 'Supports' functions that appear to be in conflict. Is there a compiler switch I can use to make RAD XE backward compatible? Or is there something I can do to these function calls to correct the ambiguous nature? {$IFNDEF DELPHI5} procedure FreeAndNil(var Obj); var Temp: TObject; begin Temp := TObject(Obj); Pointer(Obj) := nil; Temp.Free; end; function Supports(const Instance: IUnknown; const Intf: TGUID; out Inst): Boolean; overload; begin Result := (Instance <> nil) and (Instance.QueryInterface(Intf, Inst) = 0); end; function Supports(Instance: TObject; const Intf: TGUID; out Inst): Boolean; overload; var Unk: IUnknown; begin Result := (Instance <> nil) and Instance.GetInterface(IUnknown, Unk) and Supports(Unk, Intf, Inst); end; {$ENDIF} {$IFNDEF DELPHI6} function Supports(const Instance: TObject; const IID: TGUID): Boolean; var Temp: IUnknown; begin Result := Supports(Instance, IID, Temp); end; {$ENDIF}

    Read the article

  • login to any site using curl in php

    - by user550265
    login to a website using curl php I have tried $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.sitename.com"); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt'); curl_setopt($ch, CURLOPT_POSTFIELDS, true); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ); curl_setopt($ch, CURLOPT_USERPWD, "username:password"); curl_exec($ch); curl_close($ch); ? But this does not log in .

    Read the article

  • MD5 hash validation failing for unknown reason in PHP

    - by Sennheiser
    I'm writing a login form, and it converts the given password to an MD5 hash with md5($password), then matches it to an already-hashed record in my database. I know for sure that the database record is correct in this case. However, it doesn't log me in and claims the password is incorrect. Here's my code: $password = mysql_real_escape_string($_POST["password"]); ...more code... $passwordQuery = mysql_fetch_row(mysql_query(("SELECT password FROM users WHERE email = '$userEmail'"))); ...some code... elseif(md5($password) != $passwordQuery) { $_SESSION["noPass"] = "That password is incorrect."; } ...more code after... I tried pulling just the value of md5($password) and that matched up when I visually compared it. However, I can't get the comparison to work in PHP. Perhaps it is because the MySQL record is stored as text, and the MD5 is something else?

    Read the article

  • iPad: Detecting External Keyboard

    - by StuartW
    My app uses a UIAccessoryView to provide additional keyboard functionality (such as forward/backward tabs and arrows keys) for the virtual keyboard, but that causes UIKeyboardDidShowNotification to fire even when a physical keyboard is present (the accessory appears at the bottom of the screen). I'd like to check if a physical keyboard is attached when handling UIKeyboardWillShowNotification, to prevent the accessory view from appearing and to prevent my custom view from scrolling up (to make room for the non-existent virtual keyboard). I've tried examining the UIKeyboardFrameEndUserInfoKey key, but it returns a real size for the virtual keyboard, in spite of nothing being displayed. Is there any way to detect the presence of a physical keyboard to prevent this unwanted behaviour? Hmm, the plot thickens. I tried disabling the input accessory by returning nil from the inputAccessoryView property of the Responder object which triggers the keyboard. That suppresses UIKeyboardWillShowNotification and UIKeyboardDidShowNotification when there is a physical keyboard present, but keeps these notifications when there is no such keyboard. All good so far. Then I tried re-enabling inputAccessoryView only after UIKeyboardWillShowNotification had been received. This only fires when a virtual keyboard is needed, so it should allow me to reintroduce the accessory view in those circumstances. Or so I thought. Unfortunately, it seems the OS doesn't check inputAccessoryView after UIKeyboardWillShowNotification, so it fails to show the accessory view when it is needed :o( That leaves me with two options: Include the input accessory view, giving extra functionality for virtual keyboard users, but lose the ability to detect a physical keyboard and hence not supporting physical devices; or Exclude the input accessory altogether, preventing most users from accessing the extra keys, but allowing the app to work with a physical keyboard. Not a great choice, so I'm still keen to see if anyone else has addressed this problem!

    Read the article

  • How to convert all images to JPG format in PHP?

    - by SzamDev
    I am developing a website in PHP that let the user to upload images and then let him to decide how the image should be using jQuery - PHP integeration to select the area that wanted to be the picture and then click the crop button to crop it and save it. The problem that I am facing is that not all images type are good to crop and save so I noticed that the easy solution for it to convert the image to JPG and then let the user to crop it because it's the easy way to do it in JPG format. How I can do it? Is this the best solution for images types problem?

    Read the article

  • PHP File Upload using url parameters

    - by Arthur
    Is there a way to upload a file to server using php and the filename in a parameter (instead using a submit form), something like this: myserver/upload.php?file=c:\example.txt Im using a local server, so i dont have problems with filesize limit or upload function, and i have a code to upload file using a form <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <body> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="fileForm" enctype="multipart/form-data"> File to upload: <table> <tr><td><input name="upfile" type="file"></td></tr> <tr><td><input type="submit" name="submitBtn" value="Upload"></td></tr> </table> </form> <?php if (isset($_POST['submitBtn'])){ // Define the upload location $target_path = "c:\\"; // Create the file name with path $target_path = $target_path . basename( $_FILES['upfile']['name']); // Try to move the file from the temporay directory to the defined. if(move_uploaded_file($_FILES['upfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['upfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } } ?> </body> Thanks for the help

    Read the article

  • Assign to a slice of a Python list from a lambda

    - by Bushman
    I know that there are certain "special" methods of various objects that represent operations that would normally be performed with operators (i.e. int.__add__ for +, object.__eq__ for ==, etc.), and that one of them is list.__setitem, which can assign a value to a list element. However, I need a function that can assign a list into a slice of another list. Basically, I'm looking for the expression equivalent of some_list[2:4] = [2, 3].

    Read the article

  • Singelton restricted to instance of dll

    - by codeySmurf
    If I create a singleton class in the context of a dll, the singleton class is instantiated once and used by all instances of the dll. I am using a dll as a plug-in for an application. Now the following thing came to my mind: If I use a singleton Class, it will be shared across multiple instances of the plug-in. However, this makes it difficult to manage the lifetime of the singleton class efficiently. The only way I could think of would be to use a reference count and to make the singleton delete its self when the reference count is 0. Does anyone have any better ideas on that? Is there any good way to restrict the singleton object to one instance of the dll? Language is c++

    Read the article

  • Enumerate all paths in a weighted graph from A to B where path length is between C1 and C2

    - by awmross
    Given two points A and B in a weighted graph, find all paths from A to B where the length of the path is between C1 and C2. Ideally, each vertex should only be visited once, although this is not a hard requirement. I supose I could use a heuristic to sort the results of the algorithm to weed out "silly" paths (e.g. a path that just visits the same two nodes over and over again) I can think of simple brute force algorithms, but are there any more sophisticed algorithms that will make this more efficient? I can imagine as the graph grows this could become expensive. In the application I am developing, A & B are actually the same point (i.e. the path must return to the start), if that makes any difference. Note that this is an engineering problem, not a computer science problem, so I can use an algorithm that is fast but not necessarily 100% accurate. i.e. it is ok if it returns most of the possible paths, or if most of the paths returned are within the given length range.

    Read the article

  • xCode: iPhone Swipe Gesture crash

    - by David DelMonte
    I have an app that I'd like the swipe gesture to flip to a second view. The app is all set up with buttons that work. The swipe gesture though causes a crash ( “EXC_BAD_ACCESS”.). The gesture code is: - (void)handleSwipe:(UISwipeGestureRecognizer *)recognizer { NSLog(@"%s", __FUNCTION__); switch (recognizer.direction) { case (UISwipeGestureRecognizerDirectionRight): [self performSelector:@selector(flipper:)]; break; case (UISwipeGestureRecognizerDirectionLeft): [self performSelector:@selector(flipper:)]; break; default: break; } } and "flipper" looks like this: - (IBAction)flipper:(id)sender { FlashCardsAppDelegate *mainDelegate = (FlashCardsAppDelegate *)[[UIApplication sharedApplication] delegate]; [mainDelegate flipToFront]; } flipToBack (and flipToFront) look like this.. - (void)flipToBack { NSLog(@"%s", __FUNCTION__); BackViewController *theBackView = [[BackViewController alloc] initWithNibName:@"BackView" bundle:nil]; [self setBackViewController:theBackView]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:window cache:YES]; [frontViewController.view removeFromSuperview]; [self.window addSubview:[backViewController view]]; [UIView commitAnimations]; [frontViewController release]; frontViewController = nil; [theBackView release]; // NSLog (@" FINISHED "); } Maybe I'm going about this the wrong way... All ideas are welcome...

    Read the article

  • Problems writing a query to join two tables

    - by Psyche
    Hello, I'm working on a script which purpose is to grant site users access to different sections of the site menu. For this I have created two tables, "menu" and "rights": menu - id - section_name rights - id - menu_id (references column id from menu table) - user_id (references column id from users table) How can a query be written in order to get all menu sections and mark the ones where a given user has access. I'm using PHP and Postgres. Thank you.

    Read the article

  • How: Start an Activity inside a Thread and use finish() to get back.

    - by Kirk Becker
    Hello, I am programming a game on android. I'm using a Thread while calling a Surface View class to update and draw my game. Inside the update I wanted to start an activity based on if the game has just started and this would launch my MENUS. My Thread for the most part.. while (myThreadRun) { Canvas c = null; try { gameTime = System.currentTimeMillis(); c = myThreadSurfaceHolder.lockCanvas(null); synchronized (myThreadSurfaceHolder) { // Update Game. myThreadSurfaceView.onUpdate(); // Draw Game. myThreadSurfaceView.onDraw(c); You can see there where I am updating the game... here is onUpdate(); protected void onUpdate() { // Test if menu needs to be displayed. while (thread.getMenu()) { // Test if menu activity has been started. if (thread.getMenuRunning() == false) { Intent menuIntent = new Intent(this.getContext(), MyMenu.class); ((Activity) cxt).startActivityForResult(menuIntent, 1); thread.setMenuRunning(true); } } I am using a while loop because if I didn't use it the thread just keeps going. Basically I just don't know how to implement my menus using a thread as a game loop. Everywhere I look it seems like that's best practice. In my menu activity I just display the menu layout and a few buttons and when the person wants to start the game it uses finish() to go back to my thread where they play the game. I am very new to this so any insight will be helpful, Thanks

    Read the article

  • Servlet 3 spec and ThreadLocal

    - by mindas
    As far as I know, Servlet 3 spec introduces asynchronous processing feature. Among other things, this will mean that the same thread can and will be reused for processing another, concurrent, HTTP request(s). This isn't revolutionary, at least for people who worked with NIO before. Anyway, this leads to another important thing: no ThreadLocal variables as a temporary storage for the request data. Because if the same thread suddenly becomes the carrier thread to a different HTTP request, request-local data will be exposed to another request. All of that is my pure speculation based on reading articles, I haven't got time to play with any Servlet 3 implementations (Tomcat 7, GlassFish 3.0.X, etc.). So, the questions: Am I correct to assume that ThreadLocal will cease to be a convenient hack to keep the request data? Has anybody played with any of Servlet 3 implementations and tried using ThreadLocals to prove the above? Apart from storing data inside HTTP Session, are there any other similar easy-to-reach hacks you could possibly advise?

    Read the article

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