Search Results

Search found 3592 results on 144 pages for 'pointer'.

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

  • Problems after upgrading to 14.04 (only background and pointer after login)

    - by fabikw
    After upgrading from 12.04 to 14.04 I could log in to my X session (albeit with really low graphics). While trying to fix the graphics, I managed to break the X session. Now, after typing my password in the unity-greeter, the items disappear and I can only see the desktop background and the pointer. This happens for every user. I can still log in in tty's. How can I solve this? Also, I cannot seem to be able to install nvidia-current as it tries to install nvidia-304 and it depends on old video-abi libraries. Is there a way to tell the package manager that nvidia-current should use a newer version?

    Read the article

  • No Mouse Pointer - ubuntu 13.10

    - by Paul
    just installed 13.10 on my HP Envy M6 laptop and have no mouse pointer. My USB mouse does not work and neither does the track pad. When I booted from a USB key everything worked OK but once installed it seems to have broken the mouse. Unlike other posts, there is no flicker, it simply doesn't work at all. My laptop is an i5 with 6gb and dual Intel and AMD radeon graphics. Any help would be gratefully received as I really can't stand Windows 8 any longer. Thanks.

    Read the article

  • Question on passing a pointer to a structure in C to a function?

    - by worlds-apart89
    Below, I wrote a primitive singly linked list in C. Function "addEditNode" MUST receive a pointer by value, which, I am guessing, means we can edit the data of the pointer but can not point it to something else. If I allocate memory using malloc in "addEditNode", when the function returns, can I see the contents of first-next ? Second question is do I have to free first-next or is it only first that I should free? I am running into segmentation faults on Linux. #include <stdio.h> #include <stdlib.h> typedef struct list_node list_node_t; struct list_node { int value; list_node_t *next; }; void addEditNode(list_node_t *node) { node->value = 10; node->next = (list_node_t*) malloc(sizeof(list_node_t)); node->next->value = 1; node->next->next = NULL; } int main() { list_node_t *first = (list_node_t*) malloc(sizeof(list_node_t)); first->value = 1; first->next = NULL; addEditNode(first); free(first); return 0; }

    Read the article

  • Mouse pointer strange problem...

    - by Paska
    Hi all, i have last ubuntu installed (10.10), but from an year and thousand updates, video drivers updates, an hundreds of tricks, the mouse pointer is showed like an UGLY square... These are the screenshots: First Second I have no idea what to do to solve this problem. Anyone of you have an idea to solve it? Edit: this problem was encountered from 8.10+! Edit 2, Video card specifications: paska@ubuntu:~$ hwinfo --gfxcard 35: PCI 100.0: 0300 VGA compatible controller (VGA) [Created at pci.318] UDI: /org/freedesktop/Hal/devices/pci_1106_3230 Unique ID: VCu0.QX54AGQKWeE Parent ID: vSkL.CP+qXDDqow8 SysFS ID: /devices/pci0000:00/0000:00:01.0/0000:01:00.0 SysFS BusID: 0000:01:00.0 Hardware Class: graphics card Model: "VIA K8M890CE/K8N890CE [Chrome 9]" Vendor: pci 0x1106 "VIA Technologies, Inc." Device: pci 0x3230 "K8M890CE/K8N890CE [Chrome 9]" SubVendor: pci 0x1043 "ASUSTeK Computer Inc." SubDevice: pci 0x81b5 Revision: 0x11 Memory Range: 0xd0000000-0xdfffffff (rw,prefetchable) Memory Range: 0xfa000000-0xfaffffff (rw,non-prefetchable) Memory Range: 0xfbcf0000-0xfbcfffff (ro,prefetchable,disabled) IRQ: 16 (10026 events) I/O Ports: 0x3c0-0x3df (rw) Module Alias: "pci:v00001106d00003230sv00001043sd000081B5bc03sc00i00" Driver Info #0: Driver Status: viafb is not active Driver Activation Cmd: "modprobe viafb" Config Status: cfg=new, avail=yes, need=no, active=unknown Attached to: #17 (PCI bridge) Primary display adapter: #35 paska@ubuntu:~$ thanks, A

    Read the article

  • White screen with pointer after removing Unity

    - by Sameer Pandit
    I have the same problem . I am a newbie. I added the repository with sudo add apt-get-repository ppa:canonical-dx-team/une then i went to ubuntu software center and installed "unity interface of ubuntu netbook edition" . after installing i found a problem with User interface as it kept on flashing when mouse points to side panel . so i decided to remove it . I removed it form Ubuntu software center . there were other unity related apps installed , but i did not remove then as i had no idea what they were about . Now i ended up with a blank white screen with mouse pointer whenever i login. though i m able to login using gdm , but the screen is blank white. I tried to these commands also sudo apt-get remove gnome-shell sudo apt-get remove unity sudo restart gdm but they did not work at all i also tried sudo dpkg-reconfigure xserver-xorg it too did not work. Note:I donot have any sort of graphics card or video card on my pc please help !!!

    Read the article

  • Bug: unable to handle kernel NULL pointer dereference at

    - by maria
    I have recently installed new system on my disc, Ubuntu 12.04. Installation proceeded without problems, I started installing additional software and put data from other discs. I had already two times bug report, it was quite long, and I have no idea how to acces to log file (which probably is somewhere saved) and since I had to switch off the computer using the button, anything else was possible, here is just a small part of it (what I've noted on paper) could not write bytes: Broken pipe speach dicpatcher disabled: edit etc/default/speach-dispatcher saned disabled: edit .... and than: BUG: unable to handle kernel NULL pointer dereference at 0000009c I've run Memory test in GRUB, everything is fine. First time it occured when I was using rsync, second time when I was trying to install texlive. Should I install whole system once again? Or can it be hardware problem? Or something else? If there is any hardware details which may be relevant, please ask, since I have no idea what is happening, I don't know what kind of information could be useful. Thanks P.S. dmesg output:

    Read the article

  • How does dereferencing of a function pointer happen?

    - by eSKay
    Why and how does dereferencing a function pointer just "do nothing"? This is what I am talking about: #include<stdio.h> void hello() { printf("hello"); } int main(void) { (*****hello)(); } From a comment over here: function pointers dereference just fine, but the resulting function designator will be immediately converted back to a function pointer And from an answer here: Dereferencing (in way you think) a function's pointer means: accessing a CODE memory as it would be a DATA memory. Function pointer isn't suppose to be dereferenced in that way. Instead, it is called. I would use a name "dereference" side by side with "call". It's OK. Anyway: C is designed in such a way that both function name identifier as well as variable holding function's pointer mean the same: address to CODE memory. And it allows to jump to that memory by using call () syntax either on an identifier or variable. How exactly does dereferencing of a function pointer work?

    Read the article

  • MiniMax function throws null pointer exception

    - by Sven
    I'm working on a school project, I have to build a tic tac toe game with the AI based on the MiniMax algorithm. The two player mode works like it should. I followed the code example on http://ethangunderson.com/blog/minimax-algorithm-in-c/. The only thing is that I get a NullPointer Exception when I run the code. And I can't wrap my finger around it. I placed a comment in the code where the exception is thrown. The recursive call is returning a null pointer, what is very strange because it can't.. When I place a breakpoint on the null return with the help of a if statement, then I see that there ARE still 2 to 3 empty places.. I probably overlooking something. Hope someone can tell me what I'm doing wrong. Here is the MiniMax code (the tic tac toe code is not important): /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package MiniMax; import Game.Block; import Game.Board; import java.util.ArrayList; public class MiniMax { public static Place getBestMove(Board gameBoard, Block.TYPE player) { Place bestPlace = null; ArrayList<Place> emptyPlaces = gameBoard.getEmptyPlaces(); Board newBoard; //loop trough all the empty places for(Place emptyPlace : emptyPlaces) { newBoard = gameBoard.clone(); newBoard.setBlock(emptyPlace.getRow(), emptyPlace.getCell(), player); //no game won and still room to move if(newBoard.getWinner() == Block.TYPE.NONE && newBoard.getEmptyPlaces().size() > 0) { //is an node (has children) Place tempPlace = getBestMove(newBoard, invertPlayer(player)); //ERROR is thrown here! tempPlace is null. emptyPlace.setScore(tempPlace.getScore()); } else { //is an leaf if(newBoard.getWinner() == Block.TYPE.NONE) { emptyPlace.setScore(0); } else if(newBoard.getWinner() == Block.TYPE.X) { emptyPlace.setScore(-1); } else if(newBoard.getWinner() == Block.TYPE.O) { emptyPlace.setScore(1); } //if this move is better then our prev move, take it! if((bestPlace == null) || (player == Block.TYPE.X && emptyPlace.getScore() < bestPlace.getScore()) || (player == Block.TYPE.O && emptyPlace.getScore() > bestPlace.getScore())) { bestPlace = emptyPlace; } } } //This should never be null, but it does.. return bestPlace; } private static Block.TYPE invertPlayer(Block.TYPE player) { if(player == Block.TYPE.X) { return Block.TYPE.O; } return Block.TYPE.X; } }

    Read the article

  • Android - Force Close - Null Pointer on Canvas?

    - by user22241
    Please bear with me. I have a very odd problem. Basically, my app so far, has 3 activities (a main splash screen, an 'options/menu' screen and the main app). If I follow the very specific steps oulined below, I get a 'null pointer exception' in the 2nd activity) and the app force closes...... Here are the steps: Start the app (a game based on Surfaceview), tap through to the third activity so the game is running, then hit the home key so the game is paused and put to the background, the activity/app is ended through DDMS in the SDK then restarted on the device (all OK so far), now if I hit the back key on the device twice in quick succession, it happens. All other sequence of events is fine, even to the point of pressing the back key, waiting for the previous activity to show, then hitting back again - all OK. Only when the back key is pressed twice in quick succession following all the above steps does the problem occur. I'm assuming that the canvas isn't ready as it's showing as 'null' when this happens, but I'm not sure why this is happening as surely it's happening when I'm trying to go back to activity 1, but the logcat shows the error in activity 2. if I stop the activity running my 'doDraw' method (which referenced the canvas), then all is OK - so I can safely assume it is the canvas causing the problem. Also, if I skip my first activity (which is a very basic full-screen button which just displays a splashscreen and waits for the user to tap the screen), and make my 2nd activity the launch activity, again, it is OK. this is the part of the code that I think is probably relevant: @Override public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) { vheight = this.getHeight(); vwidth = this.getWidth(); } @Override public void surfaceCreated(SurfaceHolder holder) { vheight = this.getHeight(); vwidth = this.getWidth(); this.viewWidth = vwidth; this.viewHeight = vheight; if (runthread==false){ if (preThread.getState()==Thread.State.TERMINATED){ preThread = new OptionsThread(thisholder, thiscontext, thishandler); } preThread.setRunning(true); preThread.start();} } @Override public void surfaceDestroyed(SurfaceHolder holder) { preThread.setRunning(false); //Stop the loop boolean retry = true; //Stop the thread while (retry) { try { preThread.join(); retry = false; } catch (InterruptedException e) { } } Thank you all for any help you can offer

    Read the article

  • X11: How do I REALLY grab the mouse pointer?

    - by Drew Hall
    I've implemented a horizontal splitter widget in Xlib. I'm trying to grab the mouse when the user clicks & drags on the splitter bar (so that the user can dynamically move the split & thus resize the windows on either side of the splitter bar). I've used XGrabPointer() after receiving a left click, in hopes that all future mouse motion (dragging) will be diverted to the splitter window until the left button is released. Unfortuntately, it doesn't seem to work like that. If the user drags too quickly and the mouse pointer enters one of the windows on either side of the split, the MotionEvent messages are diverted to that (child) window rather than the splitter window. What have I done wrong? My XGrabPointer() call is as follows: ::XGrabPointer(mDisplay, window, True, ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask | EnterWindowMask | LeaveWindowMask, GrabModeAsync, GrabModeAsync, RootWindow(mDisplay, DefaultScreen(mDisplay)), None, CurrentTime);

    Read the article

  • How to get a float value the pointer points to?

    - by aleluja
    Hello, In my app, i've created the TList type list where i store the pointers to 1 string and 2 float(real) values for every 3 items. aList.Add(@sName); //string aList.Add(@x1); //float aList.Add(@x2); //float Then, i want to get the values out from the list, but i could only do that for string sStr := string(lList.items[i]); But i couldn't get the float values as a := real(lList...) will result in an invalid typecast error. So what do i do to get the float values? Of course i have a question if that string casting will actually give me the string value. I'm not good at pointer stuff so i don't know how to do it.

    Read the article

  • "ID 046d:c50e Logitech, Inc. Cordless Mouse Receiver" wheel-click is wrong

    - by sputnick
    I use this mouse under archlinux x86_64 with 3.2.8-1-ARCH kernel. I have some problems to select and then paste with the wheel-click in some applications like konversation, not in a terminal nor an editor. I don't know if it's a hardware problem or a software one. $ lsusb -v Bus 002 Device 110: ID 046d:c50e Logitech, Inc. Cordless Mouse Receiver Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x046d Logitech, Inc. idProduct 0xc50e Cordless Mouse Receiver bcdDevice 25.10 iManufacturer 1 Logitech iProduct 2 USB RECEIVER iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 34 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 70mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 1 Boot Interface Subclass bInterfaceProtocol 2 Mouse iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.11 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 95 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0008 1x 8 bytes bInterval 10 Device Status: 0x0000 (Bus Powered) When I see what's happens in xev, the output is different compared to another mouse My buggy Logitech mouse : ButtonPress event, serial 40, synthetic NO, window 0x4400001, root 0x15a, subw 0x4400002, time 170350700, (48,52), root:(1491,75), state 0x10, button 11, same_screen YES EnterNotify event, serial 40, synthetic NO, window 0x4400001, root 0x15a, subw 0x0, time 170350700, (48,52), root:(1491,75), mode NotifyGrab, detail NotifyInferior, same_screen YES, focus YES, state 16 KeymapNotify event, serial 40, synthetic NO, window 0x0, keys: 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ButtonPress event, serial 40, synthetic NO, window 0x4400001, root 0x15a, subw 0x4400002, time 170350716, (48,52), root:(1491,75), state 0x10, button 6, same_screen YES ButtonRelease event, serial 40, synthetic NO, window 0x4400001, root 0x15a, subw 0x4400002, time 170350716, (48,52), root:(1491,75), state 0x10, button 6, same_screen YES ButtonRelease event, serial 40, synthetic NO, window 0x4400001, root 0x15a, subw 0x4400002, time 170350988, (48,52), root:(1491,75), state 0x10, button 11, same_screen YES LeaveNotify event, serial 40, synthetic NO, window 0x4400001, root 0x15a, subw 0x0, time 170350988, (48,52), root:(1491,75), mode NotifyUngrab, detail NotifyInferior, same_screen YES, focus YES, state 16 a working mouse (dell) : ButtonPress event, serial 40, synthetic NO, window 0x4400001, root 0x15a, subw 0x4400002, time 170245131, (46,32), root:(1489,55), state 0x10, button 2, same_screen YES EnterNotify event, serial 40, synthetic NO, window 0x4400001, root 0x15a, subw 0x0, time 170245131, (46,32), root:(1489,55), mode NotifyGrab, detail NotifyInferior, same_screen YES, focus YES, state 528 KeymapNotify event, serial 40, synthetic NO, window 0x0, keys: 90 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ButtonRelease event, serial 40, synthetic NO, window 0x4400001, root 0x15a, subw 0x4400002, time 170245411, (46,32), root:(1489,55), state 0x210, button 2, same_screen YES LeaveNotify event, serial 40, synthetic NO, window 0x4400001, root 0x15a, subw 0x0, time 170245411, (46,32), root:(1489,55), mode NotifyUngrab, detail NotifyInferior, same_screen YES, focus YES, state 16 A demo of the problem when I use konversation (IRC) : http://www.youtube.com/watch?v=lhmr92M7NCc I tried to modify the button map with xmodmap like this with no success (one at a time) : xmodmap -e "pointer = 1 0 3" xmodmap -e "pointer = 1 1 3" xmodmap -e "pointer = 1 2 3" xmodmap -e "pointer = 1 3 3" xmodmap -e "pointer = 1 4 3" xmodmap -e "pointer = 1 5 3" xmodmap -e "pointer = 1 6 3" xmodmap -e "pointer = 1 7 3" xmodmap -e "pointer = 1 8 3" xmodmap -e "pointer = 1 9 3" xmodmap -e "pointer = 1 10 3" xmodmap -e "pointer = 1 11 3" xmodmap -e "pointer = 1 12 3" xmodmap -e "pointer = 1 13 3" xmodmap -e "pointer = 1 14 3" xmodmap -e "pointer = 1 15 3" xmodmap -e "pointer = 1 16 3" xmodmap -e "pointer = 1 17 3" xmodmap -e "pointer = 1 18 3" xmodmap -e "pointer = 1 19 3" xmodmap -e "pointer = 1 20 3" xmodmap -e "pointer = 1 21 3" xmodmap -e "pointer = 1 22 3" xmodmap -e "pointer = 1 23 3" xmodmap -e "pointer = 1 24 3" xmodmap -e "pointer = 1 25 3" Any clue ? I would like to avoid buying a new mouse just for a paste problem.

    Read the article

  • Why does perl crash with "*** glibc detected *** perl: munmap_chunk(): invalid pointer"?

    - by sid_com
    #!/usr/bin/env perl use warnings; use strict; use 5.012; use XML::LibXML::Reader; my $reader = XML::LibXML::Reader->new( location => 'http://www.heise.de/' ) or die $!; while ( $reader->read ) { say $reader->name; } At the end of the output from this script I get this error-messages: * glibc detected * perl: munmap_chunk(): invalid pointer: 0x0000000000b362e0 * ======= Backtrace: ========= /lib64/libc.so.6[0x7fb84952fc76] ... ======= Memory map: ======== 00400000-0053d000 r-xp 00000000 08:01 182002 /usr/local/bin/perl ... Is this due a bug? perl -V: Summary of my perl5 (revision 5 version 12 subversion 0) configuration: Platform: osname=linux, osvers=2.6.31.12-0.2-desktop, archname=x86_64-linux uname='linux linux1 2.6.31.12-0.2-desktop #1 smp preempt 2010-03-16 21:25:39 +0100 x86_64 x86_64 x86_64 gnulinux ' config_args='-Dnoextensions=ODBM_File' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.4.1 [gcc-4_4-branch revision 150839]', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64 libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.10.1.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.10.1' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF Built under linux Compiled at Apr 15 2010 13:25:46 @INC: /usr/local/lib/perl5/site_perl/5.12.0/x86_64-linux /usr/local/lib/perl5/site_perl/5.12.0 /usr/local/lib/perl5/5.12.0/x86_64-linux /usr/local/lib/perl5/5.12.0 .

    Read the article

  • What does the Asterisk * mean in Objective-C?

    - by Thanks
    Is it true, that the Asterisk always means "Hey, that is a pointer!" And an Pointer always holds an memory adress? (Yes I know for the exception that a * is used for math operation) For Example: NSString* myString; or SomeClass* thatClass; or (*somePointerToAStruct).myStructComponent = 5; I feel that there is more I need to know about the Asterirsk (*) than that I use it when defining an Variable that is a pointer to a class. Because sometimes I already say in the declaration of an parameter that the Parameter variable is a pointer, and still I have to use the Asterisk in front of the Variable in order to access the value. That recently happened after I wanted to pass a pointer of an struct to a method in a way like [myObj myMethod:&myStruct], I could not access a component value from that structure even though my method declaration already said that there is a parameter (DemoStruct*)myVar which indeed should be already known as a pointer to that demostruct, still I had always to say: "Man, compiler. Listen! It IIISSS a pointer:" and write: (*myVar).myStructComponentX = 5; I really really really do not understand why I have to say that twice. And only in this case. When I use the Asterisk in context of an NSString* myString then I can just access myString however I like, without telling the compiler each time that it's a pointer. i.e. like using *myString = @"yep". It just makes no sense to me.

    Read the article

  • Why can't Java/C# implement RAII?

    - by mike30
    Question: Why can't Java/C# implement RAII? Clarification: I am aware the garbage collector is not deterministic. So with the current language features it is not possible for an object's Dispose() method to be called automatically on scope exit. But could such a deterministic feature be added? My understanding: I feel an implementation of RAII must satisfy two requirements: 1. The lifetime of a resource must be bound to a scope. 2. Implicit. The freeing of the resource must happen without an explicit statement by the programmer. Analogous to a garbage collector freeing memory without an explicit statement. The "implicitness" only needs to occur at point of use of the class. The class library creator must of course explicitly implement a destructor or Dispose() method. Java/C# satisfy point 1. In C# a resource implementing IDisposable can be bound to a "using" scope: void test() { using(Resource r = new Resource()) { r.foo(); }//resource released on scope exit } This does not satisfy point 2. The programmer must explicitly tie the object to a special "using" scope. Programmers can (and do) forget to explicitly tie the resource to a scope, creating a leak. In fact the "using" blocks are converted to try-finally-dispose() code by the compiler. It has the same explicit nature of the try-finally-dispose() pattern. Without an implicit release, the hook to a scope is syntactic sugar. void test() { //Programmer forgot (or was not aware of the need) to explicitly //bind Resource to a scope. Resource r = new Resource(); r.foo(); }//resource leaked!!! I think it is worth creating a language feature in Java/C# allowing special objects that are hooked to the stack via a smart-pointer. The feature would allow you to flag a class as scope-bound, so that it always is created with a hook to the stack. There could be a options for different for different types of smart pointers. class Resource - ScopeBound { /* class details */ void Dispose() { //free resource } } void test() { //class Resource was flagged as ScopeBound so the tie to the stack is implicit. Resource r = new Resource(); //r is a smart-pointer r.foo(); }//resource released on scope exit. I think implicitness is "worth it". Just as the implicitness of garbage collection is "worth it". Explicit using blocks are refreshing on the eyes, but offer no semantic advantage over try-finally-dispose(). Is it impractical to implement such a feature into the Java/C# languages? Could it be introduced without breaking old code?

    Read the article

  • the scope of a pointer ???

    - by numerical25
    Ok, so I did find some questions that were almost similar but they actually confused me even more about pointers. http://stackoverflow.com/questions/2715198/c-pointer-objects-vs-non-pointer-objects-closed In the link above, they say that if you declare a pointer it is actually saved on the heap and not on the stack, regardless of where it was declared at. Is this true ?? Or am I misunderstanding ??? I thought that regardless of a pointer or non pointer, if its a global variable, it lives as long as the application. If its a local variable or declared within a loop or function, its life is only as long as the code within it.

    Read the article

  • Can a pointer ever point to itself?

    - by eSKay
    This question was mentioned here. My doubt is: If a pointer variable has the same address as its value, is it really pointing to itself? For example - in the following piece of code, is a a pointer to itself? #include<stdio.h> int main(){ int* a; int b = (int)&a; a = b; printf("address of a = %d\n", &a); printf(" value of a = %d\n", a); } If a is not a pointer to itself, then the same question poses again: Can a pointer point to itself? Also, how is a self pointing pointer useful?

    Read the article

  • NCurses, scrolling of multiline items, "current item" pointer and "selected items"

    - by mjf
    I am looking for hints/ideas for the best (most effective) way on how to scroll multi-line items as well as emphasizing of the "current item" and "selected items" such as: 1 FOO ITEM 1 Foo sub-item 2 Foo sub-item 3 Foo sub-item 2 BAR ITEM 1 Bar sub-item 3 BAZ ITEM 1 Baz sub-item 2 Baz sub-item 4 RAB ITEM 5 ZZZ ITEM 1 Zzz sub-item 2 Zzz sub-item 3 Zzz sub-item 4 Zzz sub-item using NCurses (some combination of windows, sub-windows, pads, copywin? Uff! In fact, the lines could exceed the stdscr's width so that possibility to scroll left/right would be also nice - pads?)... The whole items (including the sub-items) are supposed to be emphasized as full-width window/pad areas. The "current item" (including it's set of lines) should be emphasized (i.e. using A_BOLD), selected set of items of choice (including the set of lines for each the selected item) should be emphasized in another way (i.e. using A_REVERSE). What would you choose to cope with it the most effective NCurses way? (The less redrawals/refreshes the better and terminal is supposed to have the ability to change it's size - such as XTerm running under "floating window" management.) Thank you for your ideas (or perhaps some piece of code where something similar is already solved - I was not able to find anything helpful on the Internet. I mean I am not going to copy/paste foreign code but programming NCurses properly is still somehow difficult to me). P.S.: Would you suggest to "smooth-scroll" +1/-1 screen line or rather "jump-scroll" +lines/-lines of the items? (I personally prefer the latter one.) Sincerely, -- mjf

    Read the article

  • Mouse and touchpad move at different speeds

    - by Juan Manuel
    I have a compaq 610 running windows 7, and I use a USB mouse on it. The pointer speed is different for the mouse and the touchpad, so when I go to a meeting and take the notebook but not the mouse, the pointer moves too slow using the touchpad and I have to manually adjust it (of course when I return, I have to slow it down because the mouse would move the pointer too fast). Is there any way to fix this, or to have this setting separate for both devices?

    Read the article

  • pointer jumping about Lubuntu 12.04

    - by Gary Kirkpatrick
    Using 12.04 on a Samsung NC110. If I disable Touchpad, the cursor does not jump about while typing. This is very very annoying. Tried this tutorial, but this does not help. The problem occurs even when my fingers are well away from the Touchpad. I wonder if another key or key combination causes this problem? I sure could use some help on this. I have had this problem with various versions of Ubuntu and now Lubuntu.

    Read the article

  • Can't slow down the pointer speed enough

    - by murat güler
    I have changed my mouse, bought a new set but still no use - it's too fast for a designer. And in the new version (12.04) I don't even know how to find the xorg.conf, or anything would help Is not there any application for this to adjust mouse sensivity more than the default options like Logitech applications for Windows? Keyboard and mouse model: Logitech mk520 wireless laser mouse & keyboard set. Mouse model: m310 (laser, wireless)

    Read the article

  • Control mouse pointer with keyboard without a number pad

    - by mloman
    I have dell laptop which does not have a numberpad, only a set of numbers above the qwerty layout. I want to be able to control the mouse cursor with my arrow keys. I activated the mouse keys by going to "System Setting" - "Universal Access" - "Pointing and Clicking" and activate "Mouse Keys" But still, I am unable to control the mouse cursor. How do I get this going so I don't have to take my hands off the keyboard?

    Read the article

  • Only can move the pointer after upgrading

    - by Mystogan
    I made a partition on my desktop pc, 100 GB and installed Ubuntu 12.10 on it. It was pretty slow first thought it had to install updates or something, so I rebooted it. Now after the login it looks like everything freezes, I can move my mouse only, but that's it! I can see my desktop and launcher, but the task bar doesn't display time and misc system info, only a black bar, I downloaded the Android SDK pack and installed vlc media player before I rebooted. My computer info: 1 TB HDD 8 GB ddr3 RAM ATI Radeon 4890 videocard (1 GB) AMD Phenom 2 x4 black 3, 2ghz CPU (64 bits)

    Read the article

  • Why can't pass Marshaled interface as integer(or pointer)

    - by cemick
    I passed ref of interface from Visio Add-ins to MyCOMServer (http://stackoverflow.com/questions/2455183/interface-marshalling-in-delphi).I have to pass interface as pointer in internals method of MyCOMServer. I try to pass interface to internal method as pointer of interface, but after back cast when i try call method of interface I get exception. Simple example(Fisrt block execute without error, but At Second block I get Exception after addressed to property of IVApplication interface): procedure TMyCOMServer.test(const Interface_:IDispatch); stdcall; var IMy:_IMyInterface; V: Variant; Str: String; I: integer; Vis: IVApplication; begin ...... Self.QuaryInterface(_IMyInterface,IMy); str := IA.ApplicationName; V := Integer(IMy); i := V; Pointer(IMy) := Pointer(i); str := IMy.SomeProperty; // normal completion str := (Interface_ as IVApplication).Path; V := Interface_; I := V; Pointer(Vis) := Pointer(i); str := Vis.Path; // 'access violation at 0x76358e29: read of address 0xfeeefeee' end; Why I can't do like this?

    Read the article

  • Copy object using pointer (templates)

    - by Azodious
    How the push_back of stl::vector is implemented so it can make copy of any datatype .. may be pointer, double pointer and so on ... I'm implementing a template class having a function push_back almost similar to vector. Within this method a copy of argument should be inserted in internal memory allocated memory. but the argument is a pointer. (an object pointer). Can you pls tell how to create copy from pointer. so that if i delete the pointer in caller still the copy exists in my template class? Code base is as follows: template<typename T> class Vector { public: void push_back(const T& val_in) { T* a = *(new T(val_in)); m_pData[SIZE++] = a; } } Caller: Vector<MyClass*> v(3); MyClass* a = new MyClass(); a->a = 0; a->b = .5; v.push_back(a); delete a; Thanks.

    Read the article

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