Daily Archives

Articles indexed Wednesday July 4 2012

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

  • How to debug slow session start of Gnome 3?

    - by user65521
    After Upgrade from 11.10 to 12.04, the login process of Gnome 3 is extremely slow (It takes in the order of 60 seconds when it was in the order of a few seconds before the upgrade (Harddisk is a SSD!)). Running "top" in a VT shows that gnome-shell is producing about 90% CPU load while dbus-daemon is taking roughly 10%. The moment when CPU-load of gnome-shell drops to normal levels (around 2-3%) corresponds to the time the login process is terminated and the desktop is displayed. De-activating the four gnome-shell extensions (Alternative Status Menu, Quit Button, Remove Accessibility, system-monitor) that I have installed does not have any effect on session start up time. Login to Gnome classic does not show the slow session start. The system logs do not show anything suspicious. Thus, what is the best way to identify the underlying problem?

    Read the article

  • Are there Know issues with Ubuntu 11 and socket 1155? acpi=off

    - by James
    Since building my new system I cant get Ubuntu (or any other flavor of Linux) to "run" properly. To boot the live cd I have to "F6" and turn off acpi or the screen halts at a black screen with "boot stuff" written above the blinking curser. When installed I can only boot if I enter repair mode from Grub menu then once in repair mode I choose Boot Normally and it boots to the desktop. Once on the desktop I can "click" (with the mouse) only on one thing...like firefox or "desktop appearance" and the mouse no longer "clicks" on anything else ...its like the computer freezes but the mouse still moves. I end up using the reset button to restart the computer. I was able to update when prompted to do so....but at the end of the update I could not "click" the "finish" and had to use the manual reset button. I have run Ubuntu since v 8... My system specs are: intel i7 2600k ...Graphics disabled in bios... Asus p8z68-v pro.... 16G Kingston HyperX.... 2 EVGA GTX 570 in SLI.... Mouse is a simple Logitech usb Wireless. Ubuntu installed on secondary sata drive.

    Read the article

  • Deleted files not increasing available free space on Ubuntu (as reported by df -h)

    - by Homunculus Reticulli
    I am writing data munging scripts (python and bash), to munge data and import large quantities of text files into a database. I am currently in the test phase, so I am generating several K's of files and deleting them (the files consume about 20G of space). After a test run, I delete the files (sometimes without having imported into the database). I notice that there is a steady decrease in the amount of free space on my disk (as reported by df -h). I don't understand this, as I use rm * (in the data directory), and in the cases where I use Nautilus, I empty the Trash bin as well. Similarly, I notice that when I import the data into the (postgresql) database, and then delete the data from the tables using DELETE FROM tablename;, the size consumed in the postgresql data directory does not go down either. Currently, I have lost approximately 200G from hard drive, and I need to reclaim that - but don't know what to do to reclaim it - any ideas?. I am running Ubuntu 10.0.4 LTS + postgresql 8.4

    Read the article

  • GtkFileChooserButton 'Select Folder' mode returns no path

    - by user8592
    I have added a GtkFileChooserButton to my app via Glade. It is set to folder selection mode. When the widget is clicked it shows a dropdown list of Nautilus bookmarks with an 'other' option in the end. A new file chooser dialog is launched when 'other' is clicked. The button is not connected to any other custom file chooser dialog. The connecting signal I am using is 'file-set' and I am retrieving the fullpath of user selected folder using Gtk.FileChooser.get_current_folder (). This setup works fine if user selects a folder from 'other' option. But if a user selects a bookmark from dropdown list, no path is returned. How to solve this? Is there a way to disable this dropdown list and directly go to the filechooser dialog? I want to use GtkFileChooserButton only so that the user can get a preview of his selected folder.

    Read the article

  • Wireless acting weird ubuntu 12.04 LTS

    - by Philip Yeldhos
    I'm kinda new here, so please bear with me. My wireless driver is acting very weird. It shows my router's name, but when it is connecting (after entering the correct password), the icon on the tray is like, refreshing every once in a second, while showing the animation that it is connecting. And after a few seconds, error message come up saying that wireless network is disconnected. I installed the drive through "additional drivers". What info do you need? Somebody please help. philip@philip-HP-Mini-110-3100:~$ sudo iwconfig lo no wireless extensions. eth1 IEEE 802.11 ESSID:"" Mode:Managed Frequency:2.472 GHz Access Point: Not-Associated Bit Rate:72 Mb/s Tx-Power:24 dBm Retry min limit:7 RTS thr:off Fragment thr:off Power Management:off Link Quality=5/5 Signal level=0 dBm Noise level=-96 dBm Rx invalid nwid:0 Rx invalid crypt:11 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0 eth0 no wireless extensions. here's what lspci -v gave me: 02:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01) Subsystem: Hewlett-Packard Company Device 1483 Flags: bus master, fast devsel, latency 0, IRQ 17 Memory at 52000000 (64-bit, non-prefetchable) [size=16K] Capabilities: [40] Power Management version 3 Capabilities: [58] Vendor Specific Information: Len=78 <?> Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+ Capabilities: [d0] Express Endpoint, MSI 00 Capabilities: [100] Advanced Error Reporting Capabilities: [13c] Virtual Channel Capabilities: [160] Device Serial Number 00-00-82-ff-ff-3f-e0-2a Capabilities: [16c] Power Budgeting <?> Kernel driver in use: wl Kernel modules: wl, bcma, brcmsmac okay, i removed the driver additional drivers gave me. now, this is what has happened: lsmod gave me: philip@philip-HP-Mini-110-3100:~$ lsmod | grep brc brcmsmac 540875 0 mac80211 436455 1 brcmsmac brcmutil 14675 1 brcmsmac cfg80211 178679 2 brcmsmac,mac80211 crc8 12781 1 brcmsmac cordic 12487 1 brcmsmac and iwconfig gave me: philip@philip-HP-Mini-110-3100:~$ iwconfig lo no wireless extensions. wlan0 IEEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=19 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:off eth0 no wireless extensions. and lspci -v gave me: 02:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01) Subsystem: Hewlett-Packard Company Device 1483 Flags: bus master, fast devsel, latency 0, IRQ 17 Memory at 52000000 (64-bit, non-prefetchable) [size=16K] Capabilities: <access denied> Kernel driver in use: brcmsmac Kernel modules: bcma, brcmsmac

    Read the article

  • Screen split oddly when OS is installed from a Live CD

    - by Brian
    Never used Linux before but I decided I want to start somewhere and Ubuntu seemed like the right place to start. I burned the 64bit version ISO onto a CD and installed it onto a fresh new hard drive I have. The Live CD works and the Live Distro thing works great. However when I attempt to install it, the screen splits oddly in a way where part of the right is on the left. Furthermore, after attempting to log in, the GUI doesn't show up and the computer would freeze and stay that way. However you can still move the cursor. I can't really get in or do anything (possibly because I don't know how) and tinker around since I am not too tech savvy. But I can follow instructions. Graphics Card Radeon hd 6670 I just tried the install with windows thing. There was the exact same problem.

    Read the article

  • Unable to build my c++ code with g++ 4.6.3

    - by Mriganka
    I am facing multiple issues with building my c++ code on Ubuntu 12.04. This code was building and running fine on RH Enterprise. I am using g++ 4.6.3. Here's the output of g++ -v. g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper Target: i686-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu Thread model: posix gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) Here's a sample of my code: #include "Word.h" #include < string> using namespace std; pthread_mutex_t Word::_lock = PTHREAD_MUTEX_INITIALIZER; Word::Word(): _occurrences(1) { memset(_buf, 0, 25); } Word::Word(char *str): _occurrences(1) { memset(_buf, 0, 25); if (str != NULL) { strncpy(_buf, str, strlen(str)); } } g++ -c -ansi or g++ -c -std=c++98 or g++ -c -std=c++03, none of these options are able to build the code correctly. I get the following compilation errors: mriganka@ubuntu:~/WordCount$ make g++ -c -g -ansi Word.cpp -o Word.o Word.cpp: In constructor ‘Word::Word()’: Word.cpp:10:21: error: ‘memset’ was not declared in this scope Word.cpp: In constructor ‘Word::Word(char*)’: Word.cpp:16:21: error: ‘memset’ was not declared in this scope Word.cpp:19:34: error: ‘strlen’ was not declared in this scope Word.cpp:19:35: error: ‘strncpy’ was not declared in this scope Word.cpp: In member function ‘void Word::operator=(const Word&)’: Word.cpp:37:42: error: ‘strlen’ was not declared in this scope Word.cpp:37:43: error: ‘strncpy’ was not declared in this scope Word.cpp: In copy constructor ‘Word::Word(const Word&)’: Word.cpp:44:21: error: ‘memset’ was not declared in this scope Word.cpp:45:52: error: ‘strlen’ was not declared in this scope Word.cpp:45:53: error: ‘strncpy’ was not declared in this scope So basically g++ 4.6.3 on Ubuntu 12.04 is not able to recognize the standard c++ headers. And I am not finding a way out of this situation. Second problem: In order to make progress, I included < string.h instead of < string. But now I am facing linking errors with my message queue and pthread library functions. Here's the error that I am getting: mriganka@ubuntu:~/WordCount$ make g++ -c -g -ansi Word.cpp -o Word.o g++ -lrt -I/usr/lib/i386-linux-gnu Word.o HashMap.o main.o -o word_count main.o: In function `main': /home/mriganka/WordCount/main.cpp:75: undefined reference to `pthread_create' /home/mriganka/WordCount/main.cpp:90: undefined reference to `mq_open' /home/mriganka/WordCount/main.cpp:93: undefined reference to `mq_getattr' /home/mriganka/WordCount/main.cpp:113: undefined reference to `mq_send' /home/mriganka/WordCount/main.cpp:123: undefined reference to `pthread_join' /home/mriganka/WordCount/main.cpp:129: undefined reference to `mq_close' /home/mriganka/WordCount/main.cpp:130: undefined reference to `mq_unlink' main.o: In function `count_words(void*)': /home/mriganka/WordCount/main.cpp:151: undefined reference to `mq_open' /home/mriganka/WordCount/main.cpp:154: undefined reference to `mq_getattr' /home/mriganka/WordCount/main.cpp:162: undefined reference to `mq_timedreceive' collect2: ld returned 1 exit status Here's my makefile: CC=g++ CFLAGS=-c -g -ansi LDFLAGS=-lrt INC=-I/usr/lib/i386-linux-gnu SOURCES=Word.cpp HashMap.cpp main.cpp OBJECTS=$(SOURCES:.cpp=.o) EXECUTABLE=word_count all: $(SOURCES) $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS) $(CC) $(LDFLAGS) $(INC) -pthread $(OBJECTS) -o $@ .cpp.o: $(CC) $(CFLAGS) $< -o $@ clean: rm -f *.o word_count Please help me to resolve both the issues. I searched online relentlessly for any solution of these problems, but no one seems to have encountered these issues.

    Read the article

  • SIP clients not working on Ubuntu 12.04

    - by Xlearner
    I am trying to find a SIP client that works on Ubuntu 12.04. I have an account on voipdiscount (www.voipdiscount.com) and 12voip (www.12voip.com) Earlier on Ubuntu 11.10, I was able to use SIP clients: Twinkle, SFL Phone. Using these clients, I was able to access my account and make the phone calls to different destinations. But after I installed 12.04, Twinkle, SFL Phone and Ekiga stopped. Whenever I try to make a phone call using one of these software, for some reason they are not able to register. They are failing. Any suggestions as to what I can do? Is there any SIP client that works on Ubuntu 12.04? Thanks!

    Read the article

  • Does the app need to be run from /opt directory for in the Ubuntu App Showdown?

    - by costales
    I read this question, but I'm more confused yet. In developer.ubuntu.com/showdown I read: "(2) run out of /opt" (I understand "run out" is not in /opt :O Am I wrong?) In https://wiki.ubuntu.com/AppReviewBoard/Review/Guidelines#Packaging I read: "our package should install most files in /opt/extras.ubuntu.com/" It's not clear for me if the app must be in the /opt or out /opt :$ Then, can I use the /usr? Will be the app rejected if it's on /usr? Thanks! :)

    Read the article

  • Server 2008R2 in Extra Small Windows Azure Instance?

    - by Shawn Eary
    Windows Azure hosting for an Extra Small (XS) Windows VM seems to come out to be about $10 a month right now. I think this XS instance gives you the equivalent of a 1 GHZ CPU with 768MB of RAM. I think the minimum requirements for Server 2008 is 1GHZ CPU with 512MB of RAM. Also, I think the minimum requirements for SQL Server Express is 1GHZ CPU with 256 MB of RAM and that the minimum requirements for Team Foundation Server Express 11 Beta is 2.2 GHZ CPU with 1 Gig of RAM (this 2.2 GHZ part could be a problem for my 1 GHZ XS VM...). Given the performance of the XS Azure instance, would I be able to install: a very basic MVC web site; a free instance of SQL Server Express; a free single user instance of Team Foundation Server Express 11 Beta and run the XS VM instance without serious crashing? I know there are other Shared WebHost providers that can provide these features for me, but those hosting providers have the following disadvantages: They sometimes cost a lot of money after all of the "addons" are in place They probably don't provide the level of security and employee integrity that Microsoft can provide They don't provide the total control that an Azure VM seems to provide

    Read the article

  • Interpolate air drag for my game?

    - by Valentin Krummenacher
    So I have a little game which works with small steps, however those steps vary in time, so for example I sometimes have 10 Steps/second and then I have 20 Steps/second. This changes automatically depending on how many steps the user's computer can take. To avoid inaccurate positioning of the game's player object I use y=v0*dt+g*dt^2/2 to determine my objects y-position, where dt is the time since the last step, v0 is the velocity of my object in the beginning of my step and g is the gravity. To calculate the velocity in the end of a step I use v=v0+g*dt what also gives me correct results, independent of whether I use 2 steps with a dt of for example 20ms or one step with a dt of 40ms. Now I would like to introduce air drag. For simplicity's sake I use a=k*v^2 where a is the air drag's acceleration (I am aware that it would usually result in a force, but since I assume 1kg for my object's mass the force is the same as the resulting acceleration), k is a constant (in this case I'm using 0.001) and v is the speed. Now in an infinitely small time interval a is k multiplied by the velocity in this small time interval powered by 2. The problem is that v in the next time interval would depend on the drag of the last which again depends on the v of the last interval and so on... In other words: If I use a=k*v^2 I get different results for my position/velocity when I use 2 steps of 20ms than when I use one step of 40ms. I used to have this problem for my position too, but adding +g*dt^2/2 to the formula for my position fixed the problem since it takes into account that the position depends on the velocity which changes slightly in every infinitely small time interval. Does something like that exist for air drag too? And no, I dont mean anything like Adding air drag to a golf ball trajectory equation or similar, for that kind of method only gives correct results when all my steps are the same. (I hope you can understand my intermediate english, it's not my main language so I would like to say sorry for all the silly mistakes I might have made in my question)

    Read the article

  • SpriteBatch.Begin() making my model not render correctly

    - by manning18
    I was trying to output some debug information using DrawString when I noticed my model suddenly was being rendered like it was inside-out (like the culling had been disabled or something) and the texture maps weren't applied I commented out the DrawString method until I only had SpriteBatch.Begin() and .End() and that was enough to cause the model rendering corruption - when I commented those calls out the model rendered correctly What could this be a symptom of? I've stripped it down to the barest of code to isolate the problem and this is what I noticed. Draw code below (as stripped down as possible) GraphicsDevice.Clear(Color.LightGray); foreach (ModelMesh mesh in TIEAdvanced.Meshes) { foreach (Effect effect in mesh.Effects) { if (effect is BasicEffect) ((BasicEffect)effect).EnableDefaultLighting(); effect.CurrentTechnique.Passes[0].Apply(); } } spriteBatch.Begin(); spriteBatch.DrawString(spriteFont, "Camera Position: " + cameraPosition.ToString(), new Vector2(10, 10), Color.Blue); spriteBatch.End(); GraphicsDevice.DepthStencilState = DepthStencilState.Default; TIEAdvanced.Draw(Matrix.CreateScale(0.025f), viewMatrix, projectionMatrix);

    Read the article

  • How to kill a quoted string at point in emacs?

    - by user1350992
    I would like to kill a quoted string in a source file without having to mark the beginning of the string and kill-region, but just by placing the point anywhere inside the quoted string and pressing a shortcut. I tried to write a function in elisp for this, but I figured out that the file would need to be parsed from the beginning up to point to determine whether the point is inside quoted string, and to find the bounds of the quoted string(also handle the \")... But the file is already parsed by font-lock. So now I can find out if I'm inside quoted string: (defun inside-quoted-string? () (interactive) (print (find 'font-lock-doc-face (text-properties-at (point))))) But how do I get the bounds of the string? font-lock knows it, since it nicely highlights it in blue, but how do I get it?

    Read the article

  • PXE boot windows versions

    - by iJonathan
    I will make a PXE-server on Ubuntu for the installations of Windows XP and 7. When a computer starts from the network, then it should be display a menu with, for example "installation of XP" and the next item "installation of 7". When I select one of these items, the installation must start. I won't use an image, wds or FOG because the computers aren't the same and there a different departments in the company with a different configuration, programs etc. Neither Windows Server, only an Ubuntu PXE-server How I should start with making that? Thanks.

    Read the article

  • How to avoid StaleObjectStateException when transaction updates thousands of entities?

    - by ThinkFloyd
    We are using Hibernate 3.6.0.Final with JPA 2 and Spring 3.0.5 for a large scale enterprise application running on tomcat 7 and MySQL 5.5. Most of the transactions in application, lives for less than a second and update 5-10 entities but in some use cases we need to update more than 10-20K entities in single transaction, which takes few minutes and hence more than 70% of times such transaction fails with StaleObjectStateException because some of those entities got updated by some other transaction. We generally maintain version column in all tables and in case of StaleObjectStateException we generally retry but since these longs transactions are anyways very long so if we keep on retrying then also I am not very sure that we'll be able to escape StaleObjectStateException. Also lot of activities keep updating these entities in busy hours so we cannot go with pessimistic approach because it can potentially halt many activities in system. Please suggest how to fix such long transaction issue because we cannot spawn thousands of independent and small transactions because we cannot afford messed up data in case of some failed & some successful transactions.

    Read the article

  • How to call a method from another class that's been instantiated within the current class

    - by Pavan
    my screen has a few views like such __________________ | _____ | | | | | //viewX is a video screen | | | | | viewX | vY | | //viewY is a custom uiview i created. | |____| | //it contains a method which i would like to call that toggles |_________________| //the hidden property of this view. and when it hides, a little | | //button is replaced no the top right corner on top of viewX | viewZ | //the video layer | | |_________________| //viewZ is a view containing many square views - thumbnails. my question is, i dont know how to register for touch events so that it recognises any touch event on no matter which view the user touches the screen.. atm im handling the touch events for each view inside it. so all works well... however what im trying to do is that when the user taps anywhere else on the screen but on viewY, viewY should dissapear by calling that method in the viewY class. this viewY class is instantiated and has no xib file attached to it. the uiview is created progammatically in the viewY class. this whole class for viewY behviour is instantiated in viewX - the video view. my boss says add delegates.. although i have now clue how to do that... any help? is there anyway i can just make it really simple and be able to say REMOVE VIEW no matter which class im calling from? Also ive seen other people achieve this by using these funky arrows - ... <- etc.. although im not sure if thats what i need or how to implement such a thing. ah i think ive made my question quite complicated but i really mean it to be a simple one, and know it can be done in an easy way!

    Read the article

  • Getting column index out of range, 0 < 1

    - by Natraj
    I am using OpenJPA 2.2.0 and when I am executing a select statement I am getting "Column index out of range, 0 < 1" error. EntityManager entityMgrObj = emf.getEntityManager(); entityMgrObj.clear(); Query query = entityMgrObj.createNativeQuery("select * from company_user where user_id = 1001); List<CompanyUserDO> companyUserDOObj = null; try { companyUserDOObj = query.getResultList(); } catch (Exception e) { System.out.println(e.getMessage()); } When the query.getResultList() executes I get "Column index out of range, 0 < 1" error. Can somebody let me know what is wrong in the above code?

    Read the article

  • Unsupported operand types when value is integer

    - by Adam Tester
    I'm getting this error when trying to add 2 to an integer. I am using the Codeigniter framework. Fatal error: Unsupported operand types in D:\wamp\www\application\libraries\Gen_images.php on line 180 Here is where its called: // Now process the image var_dump($this->upload->data('image_width')); $this->gen_login->resize($file_name, $this->upload->data('image_width'), $this->upload->data('image_height')); I get the error on line 180 which is: $config['width'] = $width + 2; So I thought $width must be an array or string so I wouldn't be able to add to it, but the var dump shows this: array 'file_name' => string 'genyx_1341414096.jpg' (length=20) 'file_type' => string 'image/jpeg' (length=10) 'file_path' => string 'D:/wamp/www/beer/uploads/' (length=25) 'full_path' => string 'D:/wamp/www/beer/uploads/genyx_1341414096.jpg' (length=45) 'raw_name' => string 'genyx_1341414096' (length=16) 'orig_name' => string 'genyx_1341414096.jpg' (length=20) 'client_name' => string '294207_177080222375077_100002193022560_361510_991268937_s.jpg' (length=61) 'file_ext' => string '.jpg' (length=4) 'file_size' => float 55.85 'is_image' => boolean true 'image_width' => int 720 'image_height' => int 479 'image_type' => string 'jpeg' (length=4) 'image_size_str' => string 'width="720" height="479"' (length=24) Can anyone help me?

    Read the article

  • Super class variables not printing through sub class

    - by Abhishek Singh
    Can u tell me why this code is not displaying any result on the console. class employee { protected String name; protected double salary; protected String dob; public employee(String name, double salary, String dob) { this.name = name; this.salary = salary; this.dob = dob; } public employee(String name, double salary) { this.name = name; this.salary = salary; } } public class Manage extends employee { String dept1; public Manage(String name, double salary, String dob, String dept1) { super(name, salary, dob); this.dept1 = dept1; } public Manage(String name, double salary, String dept1) { super(name, salary); this.dept1 = dept1; } public static void main(String args[]) { employee e = new employee("Vikas", 122345); employee e2 = new employee("Vikas", 122345, "12-2-1991"); Manage m = (Manage) new Manage("Vikas", 122345, "Sales"); Manage m2 = new Manage("Vikas", 122345, "12-2-1991", "sales"); m.display(); m2.display(); } public void display() { System.out.println("Name " + name); System.out.println("Salary " + salary); System.out.println("Birth " + dob); System.out.println("Department " + dept1); } }

    Read the article

  • printing out dictionnaires

    - by kyril
    I have a rather specific question: I want to print out characters at a specific place using the \033[ syntax. This is what the code below should do: (the dict cells has the same keys as coords but with either '*' or '-' as value.) coords = {'x'+str(x)+'y'+str(y) : (x,y) for x,y, in itertools.product(range(60), range(20))} for key, value in coords.items(): char = cells[key] x,y = value HORIZ=str(x) VERT=str(y) char = str(char) print('\033['+VERT+';'+HORIZ+'f'+char) However, I noticed that if I put this into a infinite while loop, it does not always prints the same characters at the same position. There are only slight changes, but it deletes some and puts them back in after some loops. I already tried it with lists, and there it seems to behave just fine, so I tend to think it has something todo with the dict, but I can not figure out what it could be. You can see the Problem in a console here: SharedConsole.I am happy for every tip on this matter. On a related topic: After the printing, some changes should be made at the values of the cells dict, but for reason unknown to me, the only the first two rules are executed and the rest is ignored. The rules should test how many neighbours (which is in population) are around the cell and apply the according rule. In my implemention of this I have some kind of weird tumor growth (which should not happen, as if there more than three around they should the cell should die) (see FreakingTumor): if cells_copy [coord] == '-': if population == 3: cells [coord] = '*' if cells_copy [coord] == '*': if population > 3: cells [coord] = '-' elif population <= 1: cells [coord] = '-' elif population == 2 or 3: cells [coord] = '*' I checked the population variable several times, so I am quite sure that is not the matter. I am sorry for the slow consoles. Thanks in advance! Kyril

    Read the article

  • android exit application completely and go to main applications screen

    - by Totti
    i know that this question is asked many times, but really i can't understand the answer, i want to set button, when user click it i want to exit the application (also the carbage collector should remove the objects), and after exiting i want to go to the screen where the user found the application icon on mobile. for exit i don't know what to do for going to the screen where to find the application icon i tried like this Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); but doesn't work

    Read the article

  • PHP else/if statements

    - by V Neal
    I've written the following PHP statement but everytime i try to combine it into an else/if, it breaks. Can someone please advise? I'm new to PHP and am getting a tad stuck. Thanks :) <?php if (is_page( 19 ) ) {?> <div class="imageSlider"><img src="<?php echo bloginfo('template_directory');?>/Images/mainImages/innerPage-Image.jpg" alt="" /><img src="<?php echo bloginfo('template_directory');?>/Images/mainImages/innerPage-Image2.jpg" alt="" /><img src="<?php echo bloginfo('template_directory');?>/Images/mainImages/innerPage-Image3.jpg" alt="" /></div> <?php }?> <?php if (is_page( 23 ) ) {?> <div class="imageSlider"><img src="<?php echo bloginfo('template_directory');?>/Images/mainImages/innerPage-Image.jpg" alt="" /><img src="<?php echo bloginfo('template_directory');?>/Images/mainImages/innerPage-Image.jpg" alt="" /><img src="<?php echo bloginfo('template_directory');?>/Images/mainImages/innerPage-Image.jpg" alt="" /></div> } <?php }?>

    Read the article

  • POST data to permant json file using PHP

    - by doxsi
    using a url, my idea is the any user can post data. For example via http://myweb.com/index.php?name=Peter&surname=Brown Using the "jedwards" answer, present here , I am hable to create a json an d save it to a file. <? /* This needs to be at the top of your file, without ANYTHING above it */ session_start(); /* ... */ if(!array_key_exists('entries', $_SESSION)) { $_SESSION['entries'] = array(); } $_SESSION['entries'][] = array("name" => $_GET["name"], "surname" => $_GET["surname"]); $json_string = json_encode($_SESSION['entries']); My problem is taht his is not permant amongst different session or user. It work only on the same session. On different sessionthe json built start from the beginning. Any idea about that?

    Read the article

  • PHP XPath - how to get value from result

    - by LeeTee
    I have the followng XML file from Ebay <GeteBayDetailsResponse xmlns="urn:ebay:apis:eBLBaseComponents"><Timestamp>2012-07-04T12:02:14.541Z</Timestamp><Ack>Success</Ack><Version>779</Version><Build>E779_INTL_BUNDLED_14986004_R1</Build><SiteDetails><Site>US</Site><SiteID>0</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Canada</Site><SiteID>2</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>UK</Site><SiteID>3</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Germany</Site><SiteID>77</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Australia</Site><SiteID>15</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>France</Site><SiteID>71</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>eBayMotors</Site><SiteID>100</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Italy</Site><SiteID>101</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Netherlands</Site><SiteID>146</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Spain</Site><SiteID>186</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>India</Site><SiteID>203</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>HongKong</Site><SiteID>201</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Singapore</Site><SiteID>216</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Malaysia</Site><SiteID>207</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Philippines</Site><SiteID>211</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>CanadaFrench</Site><SiteID>210</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Poland</Site><SiteID>212</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Belgium_Dutch</Site><SiteID>123</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Belgium_French</Site><SiteID>23</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Austria</Site><SiteID>16</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Switzerland</Site><SiteID>193</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><SiteDetails><Site>Ireland</Site><SiteID>205</SiteID><DetailVersion>1</DetailVersion><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></SiteDetails><UpdateTime>2009-07-09T10:48:17.000Z</UpdateTime></GeteBayDetailsResponse> I need to get the value of node SiteID where the node Site matches whatever variable I pass. The code I have is: $xml_file ='SiteDetails.xml'; $xmlDoc = new DomDocument(); $xmlDoc->load($xml_file); $xpath = new DOMXpath($xmlDoc); $siteIDList = $xpath->query("/GeteBayDetailsResponse/SiteDetails[Site=$site]/SiteID"); var_dump($siteIDList); echo $siteIDList->SiteID; I get the following result: object(DOMNodeList)#11 (0) { } Can anyone help? I want to get a value of 3.

    Read the article

  • Attach GestureRecogniser to multiple imageviews

    - by AppleDeveloper
    Something strange I encountered today while attaching same gesture recogniser to multiple image views. It gets attached to only the last one, in other words, it can be attached to only one view! I had to create multiple gesture recognisers to meet my requirements. Following is what I have done. Am I doing correct? Is that's the only way to attach recognisers to the multiple imageviews? Please note that I don't want to use UITableView or UIVIew and put all imageviews in it and attach gesture recogniser to only UITableView or UIVIew. I have all image scattered and I have to detect which image is being dragged. Thanks. [imgView1 setUserInteractionEnabled:YES]; [imgView1 setMultipleTouchEnabled:YES]; [imgView2 setUserInteractionEnabled:YES]; [imgView2 setMultipleTouchEnabled:YES]; [imgView3 setUserInteractionEnabled:YES]; [imgView3 setMultipleTouchEnabled:YES]; [imgView4 setUserInteractionEnabled:YES]; [imgView4 setMultipleTouchEnabled:YES]; [imgView5 setUserInteractionEnabled:YES]; [imgView5 setMultipleTouchEnabled:YES]; [imgView6 setUserInteractionEnabled:YES]; [imgView6 setMultipleTouchEnabled:YES]; //Attach gesture recognizer to each imagviews gestureRecognizer1 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer1.delegate = self; gestureRecognizer2 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer2.delegate = self; gestureRecognizer3 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer3.delegate = self; gestureRecognizer4 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer4.delegate = self; gestureRecognizer5 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer5.delegate = self; gestureRecognizer6 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)]; gestureRecognizer6.delegate = self; [imgView1 addGestureRecognizer:gestureRecognizer1]; [imgView2 addGestureRecognizer:gestureRecognizer2]; [imgView3 addGestureRecognizer:gestureRecognizer3]; [imgView4 addGestureRecognizer:gestureRecognizer4]; [imgView5 addGestureRecognizer:gestureRecognizer5]; [imgView6 addGestureRecognizer:gestureRecognizer6];

    Read the article

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