Daily Archives

Articles indexed Tuesday June 26 2012

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

  • How can I use Ubuntu to rescue files from an NTFS drive?

    - by dago
    I reinstalled windows on the laptop of my daughter. Before doing this we made a copy of her music, pictures and so on. Unfortunately, the folder we created for the backup was empty (I checked after I reinstalled windows). Today a miracle happened, as suddenly the data were back but when Itried to copy them to another place thez disappeared again. Checking the drive with disk utility I got the message "filesystem is not clean". Is there a way to recover the data? Preferred solution would be a tool with a gui. The drive I need to repair is formatted in NTFS and is connected via usb to laptop.

    Read the article

  • Why do I get a 403 error when accessing my apache server?

    - by nishan
    Im running Ubuntu 12.04 LTS on a system with 2 GB RAM and a 500 GB HDD. My hard drive has 4 partitions: Partition 1 = 40 gb Windows (NTFS, lable = win32) Partition 2 = 320 gb Windows (FAT label = common) Partition 3 = 40 gb Ubuntu (EXT4) I installed apached2. Then, to change its default www directory, I ran gksu gedit /etc/apache2/sites-enabled/000-default and, in the editor, changed the location to /media/common/www. After that I ran these commands in a terminal: chmod 777 /media/common/www chmod 777 /media/common/www/*.* After that I ran: firefox 127.0.0.1/index.php It said: Forbidden You don't have permission to access / on this server. Apache/2.2.22 (Ubuntu) Server at 127.0.0.1 Port 80 Before my changes it was working fine. How can I run my websites?

    Read the article

  • How to diagnose Ubuntu CPU spikes / IO wait?

    - by Jeff Welling
    I'm using Ubuntu and every couple minutes it goes unresponsive for a half second to a full second, which isn't normally a problem but makes trying to code extremely frustrating when your trying to hit backspace or navigate the code and nothing is happening. The problem is, the freezes are so brief that top doesn't have time to show me what is spiking the CPU (assuming something is, but I don't know what else could cause this). Does anyone know how to troubleshoot this performance issue? Edit: I've tried login in with Gnome Classic (No Effects) instead of Unity but it still freezes up every once in awhile. Edit: The CPU graph doesn't seem to be showing any actual spikes so it seems you were right and my original diagnosis of CPU spikes being the problem was incorrect, I now suspect IO wait. I don't recall this happening for the brief few weeks I had Windows 7 Starter running on it though, which leads me to believe it isn't (just?) the hardware.. is there anything I can tweak to improve this? I'm using an Acer Aspire One D257, with Ubuntu 11.10. Edit: Output of dmesg is at http://paste.ubuntu.com/1060054/ and kern.log is at http://paste.ubuntu.com/1060055/

    Read the article

  • Not able to change flash settings

    - by Zeyu
    My Gnome crashes constantly when I open web pages containing flash so I tried to turn off the hardware acceleration. I opened the Adobe flash player settings panel but found that the buttons are not clickable. I can still switch between display/privacy/storage.. panels using TAB and ENTER key. But for others like the "Enable hardware acceleration" checkbox this won't work. Anyone knows how to solve it? Thanks.

    Read the article

  • LXDE will not suspend when laptop lid is closed, and will die when woken up

    - by user46061
    I am not an experienced Linux user, although I have been using Ubuntu occassionally some time already. ( Since Feisty Fawn probably? ). Now I installed Ubuntu 11.10 and it is nice ( well, after I installed LXDE, Unity sucks and I didn't really like gnome-fallback-session ), but it has one problem: After being suspended, when I wake my computer up, it starts up and in about 5 seconds it dies. Like a normal shutdown. Then, when I start it again, the screen stays blank, so I have to hard-turn it off - only then, when I turn it on, it works. It is an MSI laptop, about 3-4 years old. The second problem is: After installing LXDE, when I close the laptop lid, it does not suspend. I can only suspend using the shutdown menu - and the waking up problem remains. Many thanks for your time and advice guys.

    Read the article

  • Cannot boot from live cd

    - by Sam
    I have a Hcl notebook P38 PDC, the hard disk is completely blank. I tried installing Ubuntu 11.04 as a .iso image from a cd but it did not boot. Later I tried installing it from USB using UNetbootin and also Universal USB installer but both in vain. Can someone please tell me what wrong am I doing or what else needs to be done. I am using a Toshiba pen drive 4Gb. I tried booting from the rescue mode but again had the same problem. Would be great if someone helps me out ASAP. Thank you( for reading as well as for helping).

    Read the article

  • SEO and Spelling mistakes in keyword

    - by Sushil
    I am about to register a domain name (suppose) someone.com (with proper spelling), in mind targeting the keyword "SOMEONE". But then I discovered on 'google keyword research tool' that not this but a typo "SOME1" seems to be more popular and people search this significantly more often than the proper keyword. And luckily someone.com and some1.com both are available. I understand that I can register both the domains, but I don't know on which should I keep my website and redirect the other one. Should I make the typo "some1.com" my base site? But that's a typo. P.S., my site has a totally relevant content and not just keyword targeted worthless site. What do you guys suggest? I am confused. How would that affect my SEO ranking?? EDIT: Because the competition for the keyword I am targeting is fairly low, I think nevertheless whatever domain I choose, it will appear on the search engine first page.

    Read the article

  • What can I do to make my eService website customers feel it is a luxurious service? [closed]

    - by Farshid
    I'm developing an e-service website that its monetization model is via paid membership. Beside quality service and content, because I'm serving them for a high fee, I want to make them feel like it is a personal, unparalleled kind of service and I want to spend money for creating things that I give them after their registration such as a beautiful physical membership card so that I can use the effect of mouth-words better and beside that let them be proud about the service. I've tried my best to develop the site experience classy and I'm looking for things in real world to send them after their registration (such as membership card and a small paper tutorial). What are your suggestions? Have you seen things like this before that a website sends you some physical things for making you more loyal and/or something like that? Please kindly share your experiences/suggestions.

    Read the article

  • Analytics - how to tell where converted traffic came from?

    - by Eric
    I must be missing something obvious. I have Analytics set up with conversion tracking (goals), and I had 4 customers complete the goals yesterday. I'm trying to find out where those 4 customers came from (organic search? if organic, what keywords? etc) but I can't figure out how to do that in Adwords. When I click into the goal tracking overview, I see my 4 customers and it breaks it down so I see that 3 of them came from adwords (cpc) and 1 of them came from organic. I'd like to know exactly what ads brought the traffic and what keywords on the organic search led them to me. How can I do this? It seems like a simple request... but I can't figure it out... thanks for your help!

    Read the article

  • Another question about handling game states

    - by Eva
    I'm making a game designed with the entity-component paradigm that uses systems to communicate between components as explained here. I've reached the point in my development that I need to add game states (such as paused, playing, level start, round start, game over, etc.), but I'm not sure how to do it with my framework. I've looked at this code example on game states which everyone seems to reference, but I don't think it fits with my framework. It seems to have each state handling its own drawing and updating. My framework has a SystemManager that handles all the updating using systems. For example, here's my RenderingSystem class: public class RenderingSystem extends GameSystem { private GameView gameView_; /** * Constructor * Creates a new RenderingSystem. * @param gameManager The game manager. Used to get the game components. */ public RenderingSystem(GameManager gameManager) { super(gameManager); } /** * Method: registerGameView * Registers gameView into the RenderingSystem. * @param gameView The game view registered. */ public void registerGameView(GameView gameView) { gameView_ = gameView; } /** * Method: triggerRender * Adds a repaint call to the event queue for the dirty rectangle. */ public void triggerRender() { Rectangle dirtyRect = new Rectangle(); for (GameObject object : getRenderableObjects()) { GraphicsComponent graphicsComponent = object.getComponent(GraphicsComponent.class); dirtyRect.add(graphicsComponent.getDirtyRect()); } gameView_.repaint(dirtyRect); } /** * Method: renderGameView * Renders the game objects onto the game view. * @param g The graphics object that draws the game objects. */ public void renderGameView(Graphics g) { for (GameObject object : getRenderableObjects()) { GraphicsComponent graphicsComponent = object.getComponent(GraphicsComponent.class); if (!graphicsComponent.isVisible()) continue; GraphicsComponent.Shape shape = graphicsComponent.getShape(); BoundsComponent boundsComponent = object.getComponent(BoundsComponent.class); Rectangle bounds = boundsComponent.getBounds(); g.setColor(graphicsComponent.getColor()); if (shape == GraphicsComponent.Shape.RECTANGULAR) { g.fill3DRect(bounds.x, bounds.y, bounds.width, bounds.height, true); } else if (shape == GraphicsComponent.Shape.CIRCULAR) { g.fillOval(bounds.x, bounds.y, bounds.width, bounds.height); } } } /** * Method: getRenderableObjects * @return The renderable game objects. */ private HashSet<GameObject> getRenderableObjects() { return gameManager.getGameObjectManager().getRelevantObjects( getClass()); } } Also all the updating in my game is event-driven. I don't have a loop like theirs that simply updates everything at the same time. I like my framework because it makes it easy to add new GameObjects, but doesn't have the problems some component-based designs encounter when communicating between components. I would hate to chuck it just to get pause to work. Is there a way I can add game states to my game without removing the entity-component design? Does the game state example actually fit my framework, and I'm just missing something?

    Read the article

  • Scrolling background stops after awhile?

    - by Lewis
    Can anyone tell me where my maths is wrong please, it stops scrolling after awhile. if (background.position.y < background2.position.y) { background.position = ccp(background.contentSize.width / 2, background.position.y - 50 * delta); background2.position = ccp(background.contentSize.width / 2, background.position.y + background.contentSize.height); } else { background.position = ccp(background2.contentSize.width / 2, background2.position.y - 50 * delta); background.position = ccp(background2.contentSize.width / 2, background2.position.y + background.contentSize.height); } //reset if (background.position.y <-background.contentSize.height / 2) { background.position = ccp(background.contentSize.width / 2 ,background2.position.y + background2.contentSize.height); } else if (background2.position.y < -background2.contentSize.height / 2) { background2.position = ccp(background2.contentSize.width / 2, background.position.y + background.contentSize.height); }

    Read the article

  • How to load chunks of 2d map segments when player reaches a certain point?

    - by 2kan
    In my 2d platformer (made with Java and Slick2d), random maps are made by combining different segments together and displaying them one after the other. My problem is that I can't load too many segments or the game will run out of memory, so I want to load n number of segments at a time in chunks, then load the next chunk when the player comes near the end of one. I've attempted to do this for a couple of hours now, but I just can't get it to work at all. This is my chunk generation function where chunkLoad is the number of segments to load and BLOCK_WIDTH is the number of blocks/tiles each segment is across. Chunk1 and map are arrays of segments. Random r = new Random(); for(int i=0; i<chunkLoad; i++) { int id = r.nextInt(4)+2; chunk1[i] = new BlockMap("res/window/map"+id+".tmx", i*BLOCK_WIDTH); } map = chunk1; chunksLoaded++; The map is then drawn on the screen like this. tmap is a TiledMap object and each block/tile is 16 pixels wide for(int i=0; i<chunkLoad; i++) { map[i].tmap.render((i * BLOCK_WIDTH * 16) + (cameraX), 0); } I can successfully load new chunks, but I can't display them in the correct position, nor the hitboxes. Any suggestions? Thanks.

    Read the article

  • checking boolean property in XML(Spring)

    - by Abhishek Bhandari
    I am using Spring Framework . While writing coustum SQL queries , i am unable check a parameter of boolean value. For example this is not working .. do some SQl cods The above checking is not working , it is evaluating as equal in both the cases when booleanVariable is true and false . i tried to replace compareValue ="tree" and "false". As that is a monkey work i do sometimes . is it possible to check the boolean property in XML like above .

    Read the article

  • C# Lists, Foreach, and Types

    - by user406470
    I was wondering if there is a version of foreach that checks only for a specific type and returns it. For example consider this class tree: org.clixel.ClxBasic - org.clixel.ClxObject - org.clixel.ClxSprite - WindowsGame1.test Then consider this code public List<ClxBasic> objects = new List<ClxBasic>(); foreach(GroupTester tester in objects) { tester.GroupTesterOnlyProperty = true; } tester.GroupTesterOnlyProperty is a property created in GroupTester. Is there some way to make something like this work, like an overload of foreach, or another snippet that might help me? I want to make it easy for a programmer to sort through the lists grabbing only what type they need.

    Read the article

  • Javascript for a prompt which accepts simple math as a value and then returns the answer

    - by user1139403
    I have written a snippet of code in javascript, for a prompt to appear when clicked. I want to be able to enter a simple math problem (i.e. 230/2) and have it output the answer, rather than the math problem I just entered. Your help will be much appreciated. <!DOCTYPE html> <html> <body> <button onclick="myFunction()">Click me</button> <p id="demo"></p> <script type="text/javascript"> function myFunction() { var x; var mathProblem=prompt("Enter your math problem",""); if (name!=null) { x = mathProblem; document.getElementById("demo").innerHTML = x; } } </script> </body> </html>

    Read the article

  • Issues with Rails 3.1 API with Query String to Create action on Mac OSX Mountain Lion

    - by hjaved
    Hi I've been stuck on this problem for a while and would appreciate your help. I'm writing an API to allow an external source like a Browser Query String or a smartphone to enter some model User info in a form and hit the User create action to write the data to the db. Please tell me what I'm doing wrong with the code below. I've also observed that if I have code like @user = User.new(params[:user]), that this approach only works when a user enters their data within the form. And that if I have code such as @user = User.new( name: params[:name], location: params[:location], password = params[:password], email: params[:email]), that this code ONLY works for a Query string entry, but NOT both Query string AND regular form submission. Why is that and how can I write the code above in the Users Controller Create action, so that it takes care of both situations? URL used: localhost:3000/users/create?name=John&&[email protected]&&password=secret&&location=SanFrancisco&date=06122012 The date is of type string but it doesn't show up in the database. Why? Everything else does. UsersController.rb def create @user = User.new(params[:user]) if @user.save session[:uid] = @user.id redirect_to thanks_path, notice: "Welcome #{@user.name}!" else redirect_to root_path end end New User Form: <%=u.text_field :name, placeholder: "Name"%><br> <%=u.text_field :email, placeholder: "Email"%><br> <%=u.password_field :password, placeholder: "Password"%><br> <%=u.text_field :location, placeholder: "City"%><br> <%=u.text_field :date, placeholder: "Date"%><br> <%if params[:partner_id]%> <%=u.hidden_field :partner_id, value: params[:partner_id]%> <%end%> <button class="btn btn-large btn-primary">Enter</button> I also tried to create a separate method called remotecreate for User creation for something other than a regular web form. I entered remotecreate in the Query string but it didn't work. def remotecreate @user = User.create(name: params[:name], email: params[:email], password: params[:password], location: params[:location], date: params[:date]) if @user.save session[:uid] = @user.id redirect_to thanks_path, notice: "Welcome #{@user.name}" else redirect_to root_path end end Thanks!

    Read the article

  • How to embed XBase expressions in an Xtext DSL

    - by Marcus Mathioudakis
    I am writing a simple little DSL for specifying constraints on messages, and Have been trying without success for a while to embed XBase expressions into the language. The Grammar looks like this: grammar org.xtext.businessrules.BusinessRules with org.eclipse.xtext.xbase.Xbase //import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase import "http://www.eclipse.org/xtext/common/JavaVMTypes" as jvmTypes generate businessRules "http://www.xtext.org/businessrules/BusinessRules" Start: rules+=Constraint*; Constraint: {Constraint} 'FOR' 'PAYLOAD' payload=PAYLOAD 'ELEMENT' element=ID 'CONSTRAINED BY' constraint=XExpression; PAYLOAD: "SimulationSessionEvents" |"stacons" |"any" ; Range: 'above' min=INT ('below' max=INT)? |'below' max=INT ('above' min=INT)? ; When trying to parse a file such as: FOR PAYLOAD SimulationSessionEvents ELEMENT matrix CONSTRAINED BY ... I can't get it to work for ... = any kind of Arithmetic expression, although it works for ...= loop or if expression, or even just a number. As soon as I do something like '-5' or '4-5' it says Couldn't resolve reference to JvmIdentifiableElement '-', even though the Xbase.xtext Grammar looks like it allows these expressions. I don't think I'm missing any Jars, as it doesn't complain when I run the mwe workflow, but only when trying to parse the input file. Any help would be much appreciated.

    Read the article

  • apply CSS style to particular elements dynamically

    - by WHITECOLOR
    I have a div with paragraphs inside: <div> <p>...</p> <p>...</p> </div> I want dynamically to apply a certain style to paragraphs inside this div. Is it possible to do that without handling each paragraph element, but just attach somehow style to div element and all inside paragraphs would be affected? Maybe with jquery. It sounds for me like dynamical change of the stylesheet, is it possbile? Thanks.

    Read the article

  • android - Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException

    - by chinna_82
    Im trying to get image from my URL and display in application but it throw error Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. Below is my code Code package com.smartag.bird.dev; public class MainActivity extends Activity { static String ndefMsg = null; static String ndefMsg1 = null; NfcAdapter mNfcAdapter; PendingIntent mNfcPendingIntent; IntentFilter[] mNdefExchangeFilters; static final String TAG = "Read Tag"; TextView mTitle; private static ImageView imageView; static String url = "http://sposter.smartag.my/images/chicken_soup.jpg"; private static Bitmap downloadBitmap; private static BitmapDrawable bitmapDrawable; private static boolean largerImg = false; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //setContentView(R.layout.main); mNfcAdapter = NfcAdapter.getDefaultAdapter(this); mNfcPendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0); IntentFilter ndefDetected = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED); try { ndefDetected.addDataType("text/plain"); } catch (MalformedMimeTypeException e) { } mNdefExchangeFilters = new IntentFilter[] { ndefDetected }; if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) { NdefMessage[] messages = getNdefMessages(getIntent()); byte[] payload = messages[0].getRecords()[0].getPayload(); ndefMsg = new String(payload); setIntent(new Intent()); // Consume this intent. } ConnectivityManager connManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE); NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if(ndefMsg == null || ndefMsg.length() == 0) { startActivity(new Intent(MainActivity.this, MainMenu.class)); } else { setContentView(R.layout.main); if (mWifi.isConnected()) { ndefMsg1 = ndefMsg; new DownloadFilesTask().execute(); ndefMsg = null; } else { AlertDialog.Builder dialog = new AlertDialog.Builder(this); dialog.setTitle("Attention"); dialog.setMessage("No Internet Connection. Please enable the wifi."); dialog.setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { } }); dialog.show(); } } } private class DownloadFilesTask extends AsyncTask<Void, Void, Void> { protected void onPostExecute(Void result) { } @Override protected Void doInBackground(Void... params) { try { URL myFileUrl = new URL("http://sposter.smartag.my/images/chicken_soup.jpg"); HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection(); conn.setDoInput(true); conn.connect(); InputStream is = conn.getInputStream(); downloadBitmap = BitmapFactory.decodeStream(is); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } ImageView image = (ImageView) findViewById(R.id.imview); image.setImageBitmap(downloadBitmap); return null; } } }

    Read the article

  • console.log() and google chrome

    - by Lorenzo C
    I'm testing a library and I use console.log() function to visualyze values. There is a strange behaviour of Google Chrome (in other browser like Firefox it doesn't happend). If I try to store strings in Array object when I log them, sometimes values appears undefined. Code example (item.name is a string) var arrayItemsSearch = [item.name]; var itemRedrawName = [item.name]; console.log("arrayItemsSearch: ", arrayItemsSearch); console.log("itemRedrawName: ", itemRedrawName); Firefox output is correct arrayItemsSearch: ["elem[0]"] itemRedrawName: ["elem[0]"] Chrome output is not correct arrayItemsSearch: [undefined × 1] itemRedrawName: ["elem[0]"] Is this a Chrome bug? Or is this beacuse in Javascript strings are immutable objects and so something that I don't understand goes wrong?

    Read the article

  • Spring Controller's URL request mapping not working as expected

    - by Atharva
    I have created a mapping in web.xml something like this: <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/about/*</url-pattern> </servlet-mapping> In my controller I have something like this: import org.springframework.stereotype.Controller; @Controller public class MyController{ @RequestMapping(value="/about/us", method=RequestMethod.GET) public ModelAndView myMethod1(ModelMap model){ //some code return new ModelAndView("aboutus1.jsp",model); } @RequestMapping(value="/about", method=RequestMethod.GET) public ModelAndView myMethod2(ModelMap model){ //some code return new ModelAndView("aboutus2.jsp",model); } } And my dispatcher-servlet.xml has view resolver like: <mvc:annotation-driven/> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:viewClass="org.springframework.web.servlet.view.JstlView" p:prefix="/WEB-INF/jsp/" p:suffix=".jsp"/> To my surprise: request .../about/us is not reaching to myMethod1 in the controller. The browser shows 404 error. I put a logger inside the method but it isn't printing anything, meaning, its not being executed. .../about works fine! What can be the done to make .../about/us request work? Any suggestions?

    Read the article

  • generated service mock: everything but RhinoMocks fails?

    - by hko
    I have the "quest" to search for the next Mocking Framework for my company, and basically it's down to NSubstitute (simplest syntax, but no strict mocks), FakeItEasy(best reviews, Roy Osherove bonus, and slightly better lib support than NSubstitute), Moq (best "other libs support", biggest featureset, downside: mock.Object). We definitely want to move on from RhinoMocks, e.g. because of the unusefull interactiontest error messages (it should tell me what the parameter was instead, when a verification fails). So I was pretty surprised the other day (that was yesterday) when I found out RhinoMocks could do a thing where every other mock framework fails at: Mocking an autogenerated SomethingService (a typical VS autogenerated service with a default construtor in a partial class). Please don't argue about the design.. I intend to write lightweight integration tests (and some unit tests), and I can't mess around with the service, the product is installed on too many customers system. See this code: // here the NSubstitute and FakeItEasy equivalents throw an exception.. see below TicketStoreService fakeTicketStoreService = MockRepository.GenerateMock<TicketStoreService>(); fakeTicketStoreService.Expect(service => service.DoSomething(Arg.Is(new Guid())).Return(new Guid()); fakeTicketStoreService.DoSomething(Arg.Is(new Guid())); fakeTicketStoreService.VerifyAllExpectations(); Note that DoSomething is a non-virtual methodcall in an autogenerated class. So it shouldn't work, according to common knowledge. But it does. Problem is that it's the only (non commercial) framework that can do this: Rhino.Mocks works, and verification works too FakeItEasy says it doesn't find a default constructor (probably just wrong exception message): No default constructor was found on the type SomeNamespace.TicketStoreService Moq gives something sane and understandable: Invalid setup on a non-virtual (overridable in VB) member: service=> service.DoSomething Nsubstitute gives a message System.NotSupportedException: Cannot serialize member System.ComponentModel.Component.Site of type System.ComponentModel.ISite because it is an interface. I'm really wondering what's going on here with the frameworks, except Moq. The "fancy new" frameworks seem to have an initial perf hit too, probably preparing some Type cache and serializing stuff, whilst RhinoMocks somehow manages to create a very "slim" mock without recursion. I have to admit I didn't like RhinoMocks very well, but here it shines.. unfortunately. So, is there a way to get that to work with newer (non-commercial!) mocking frameworks, or somehow get a sane error message out of Rhino.Mocks? And why can Rhino.Mocks achieve this, when clearly every Mocking framework states it can only work with virtual methods when given a concrete class? Let's not derail the discussion by talking about alternative approaches like Extract&Override or runtime-proxy Mocking frameworks like JustMock/TypeMock/Moles or the new Fakes framework, I know these, but that would be less ideal solutions, for reasons beyond this topic. Any help appreciated..

    Read the article

  • How do IOS know which viewController is being viewed and hence need viewWillAppear to be called

    - by Jim Thio
    How does iOs know? Does each view has a pointer to it's controller? What happened? When we pop a viewController from navigation, does the navigationController arrange which view should be called? For example: If I added: [[BNUtilitiesQuick window] addSubview:[BNUtilitiesQuick searchController].view]; viewWillAppear will be called. However, window doesn't know the viewController. I am passing the view outlet of the controller not the controller. How can iOs 5 knows that it has to call [[BNUtilitiesQuick searchController] viewWillAppear:YES]

    Read the article

  • Socket php server not showing messages sent from android client

    - by Mj1992
    Hi I am a newbie in these kind of stuff but here's what i want to do. I am trying to implement a chat application in which users will send their queries from the website and as soon as the messages are sent by the website users.It will appear in the android mobile application of the site owner who will answer their queries .In short I wanna implement a live chat. Now right now I am just simply trying to send messages from android app to php server. But when I run my php script from dreamweaver in chrome the browser keeps on loading and doesn't shows any output when I send message from the client. Sometimes it happened that the php script showed some outputs which I have sent from the android(client).But i don't know when it works and when it does not. So I want to show those messages in the php script as soon as I send those messages from client and vice versa(did not implemented the vice versa for client but help will be appreciated). Here's what I've done till now. php script: <?php set_time_limit (0); $address = '127.0.0.1'; $port = 1234; $sock = socket_create(AF_INET, SOCK_STREAM, 0); socket_bind($sock, $address, $port) or die('Could not bind to address'); socket_listen($sock); $client = socket_accept($sock); $welcome = "Roll up, roll up, to the greatest show on earth!\n? "; socket_write($client, $welcome,strlen($welcome)) or die("Could not send connect string\n"); do{ $input=socket_read($client,1024,1) or die("Could not read input\n"); echo "User Says: \n\t\t\t".$input; if (trim($input) != "") { echo "Received input: $input\n"; if(trim($input)=="END") { socket_close($spawn); break; } } else{ $output = strrev($input) . "\n"; socket_write($spawn, $output . "? ", strlen (($output)+2)) or die("Could not write output\n"); echo "Sent output: " . trim($output) . "\n"; } } while(true); socket_close($sock); echo "Socket Terminated"; ?> Android Code: public class ServerClientActivity extends Activity { private Button bt; private TextView tv; private Socket socket; private String serverIpAddress = "127.0.0.1"; private static final int REDIRECTED_SERVERPORT = 1234; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); bt = (Button) findViewById(R.id.myButton); tv = (TextView) findViewById(R.id.myTextView); try { InetAddress serverAddr = InetAddress.getByName(serverIpAddress); socket = new Socket(serverAddr, REDIRECTED_SERVERPORT); } catch (UnknownHostException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } bt.setOnClickListener(new OnClickListener() { public void onClick(View v) { try { EditText et = (EditText) findViewById(R.id.EditText01); String str = et.getText().toString(); PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true); out.println(str); Log.d("Client", "Client sent message"); } catch (UnknownHostException e) { tv.setText(e.getMessage()); e.printStackTrace(); } catch (IOException e) { tv.setText(e.getMessage()); e.printStackTrace(); } catch (Exception e) { tv.setText(e.getMessage()); e.printStackTrace(); } } }); } } I've just pasted the onclick button event code for Android.Edit text is the textbox where I am going to enter my text. The ip address and port are same as in php script.

    Read the article

  • Display cube when overlapped?

    - by lptrung
    Hi all! I have a problem when run animation with three.j. See example: http://jsfiddle.net/5ywdE/13/ When the green cube is rotated to position of the blue cube, the red cube will be rotated. Question: why is the blue cube displayed while the green blue is in front of it. I want the green cube is displayed in front of the blue cube (like so the red cube is displayed in front of all). Can I set the cube which will be displayed in front of other cube in case of overlapped? What am I doing wrong?? Thanks in advance

    Read the article

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