Search Results

Search found 17788 results on 712 pages for 'last'.

Page 12/712 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • PHP find array keys

    - by Jens Törnell
    In PHP I have an array that looks like this: $array[0]['width'] = '100'; $array[0]['height'] = '200'; $array[2]['width'] = '150'; $array[2]['height'] = '250'; I don't know how many items there are in the array. Some items can be deleted which explains the missing [1] key. I want to add a new item after this, like this: $array[]['width'] = '300'; $array[]['height'] = '500'; However the code above don't work, because it adds a new key for each row. It should be the same for the two rows above. A clever way to solve it? An alternative solution would be to find the last key. I failed trying the 'end' function.

    Read the article

  • Both sql LAST_INSERT_ID() and PHP insert_id return 0

    - by jakubplus
    I've been searching google a lot for this issue and really found nothing. People just keep copying MySQL documentation on last_insert_id and nothing else. I've got an issue regarding last_insert_id, because for both situations (php & sql) it returns 0. YES: I've set a PRIMARY & UNIQUE field with AUTO_INCREMENT value YES: i've done some inserting before NO: Making double query with INSERT AND SELECT LAST... doesn't work. I've created a class Db for maintaining connection & query: class Db { public function connect() { $db = new mysqli('','','','',''); ... return $db; } public function insert() { $this->connect()->query("INSERT INTO bla bla..."); return $this->connect()->insert_id; } } And it doesn't work.

    Read the article

  • Last (I think and hope) problems configuring SSL certificate with Apache and VirtualHosts

    - by user65567
    Finally I set apache2 to get a single certificate for all subdomains. [...] # Go ahead and accept connections for these vhosts # from non-SNI clients SSLStrictSNIVHostCheck off # Apache setup which will listen for and accept SSL connections on port 443. Listen 443 # Listen for virtual host requests on all IP addresses NameVirtualHost *:443 # Because this virtual host is defined first, it will # be used as the default if the hostname is not received # in the SSL handshake, e.g. if the browser doesn't support # SNI. <VirtualHost *:443> ServerName domain.localhost DocumentRoot "/Users/<my_user_name>/Sites/domain/public" <Directory "/Users/<my_user_name>/Sites/domain/public"> Order allow,deny Allow from all </Directory> # SSL Configuration SSLEngine on ... </VirtualHost> <VirtualHost *:443> ServerName subdomain1.domain.localhost DocumentRoot "/Users/<my_user_name>/Sites/subdomain1/public" <Directory "/Users/<my_user_name>/Sites/subdomain1/public"> Order allow,deny Allow from all </Directory> # SSL Configuration SSLEngine on ... </VirtualHost> <VirtualHost *:443> ServerName subdomain2.domain.localhost DocumentRoot "/Users/<my_user_name>/Sites/subdomain2/public" <Directory "/Users/<my_user_name>/Sites/subdomain2/public"> Order allow,deny Allow from all </Directory> # SSL Configuration SSLEngine on ... </VirtualHost> So, for example, I can correctly access https://subdomain1.domain.localhost https://subdomain2.domain.localhost ... Now, anyway, I have problems on accessing http://subdomain1.domain.localhost http://subdomain2.domain.localhost ... Since I use a Mac Os, on accessing the "http: version", I get a default page "Your website." (instead of a error). Why does it happen?

    Read the article

  • Uninstall last n of ports/packages

    - by Radio
    While compiling some port, I realized that it depends on 1000+ of other ports and will install forever until I die or my disk is full (my hdd is really small). I interrupted make install clean. How do I uninstall and clean those dependencies which have already been built and installed? (there are at least 100+ of them) pkg_cutleaves wont work in this case, since the main port wasn't registered yet. Please help. FreeBSD 9.0-RELEASE amd64 EDIT: Another way to ask this question: How can I see all dependencies for a non-registered port, and all subdependencies for those dependencies, independent with previously installed ports or their [sub]dependencies?

    Read the article

  • How long do Lithium Ion batteries normally last?

    - by Zifre
    On the laptop I have, I've had to buy a new Li-Ion batter roughly every year. I do use this computer quite a lot, but I'm wondering if this is normal. Right now, my battery is completely dead (it lasts for about 0.1 seconds), so I plan on buying a new one soon. Is there anything you can do to prevent Li-Ion batteries from going dead so quickly?

    Read the article

  • Excel shortcut: switching back and forth between that last active sheet and the current exit sheet

    - by thomasssssss
    I know the shortcut CRTL + page up/down but I need the similar function that exists eg in internet explorer: Shift + alt I found a macro that is close but does not entirely solve the problem: If ActiveSheet.Name = "To Do" Then Sheets("Budget").Activate ElseIf ActiveSheet.Name = "Budget" Then Sheets("To Do").Activate I can name the A1 cell with the sheet name and use search (f5) and type the name, but this is to cumbersome. Any ideas, guys?

    Read the article

  • Winxp system context menus blank after last security update

    - by Peter Rowell
    Because of a CERT advisory of several out-of-band security updates released by MS I did a Critical Updates pass on my WinXP Pro SP3 machine. I now have the situation where it seems that all of my WinXP-generated menus come up with all items black. If I wave the cursor over the menu, the items will update as they become active (go blue) and then update correctly (to black-text-on-white-background) as they go non-active. Separators (which never get a hover event) stay black. App-level context menus seem to work fine (Firefox, OpenOffice, etc.) with the exception of Windows Explorer and Internet Explorer, which both exhibit this behavior on both their context menus and on their menu bar drop down menus. I'm assuming that's true because they are all using the same library code. Thoughts? Fixes? Help!

    Read the article

  • Bash script to keep last x number of files and delete the rest

    - by Brady
    I have this bash script which nicely backs up my database on a cron schedule: #!/bin/sh PT_MYSQLDUMPPATH=/usr/bin PT_HOMEPATH=/home/philosop PT_TOOLPATH=$PT_HOMEPATH/philosophy-tools PT_MYSQLBACKUPPATH=$PT_TOOLPATH/mysql-backups PT_MYSQLUSER=********* PT_MYSQLPASSWORD="********" PT_MYSQLDATABASE=********* PT_BACKUPDATETIME=`date +%s` PT_BACKUPFILENAME=mysqlbackup_$PT_BACKUPDATETIME.sql.gz PT_FILESTOKEEP=14 $PT_MYSQLDUMPPATH/mysqldump -u$PT_MYSQLUSER -p$PT_MYSQLPASSWORD --opt $PT_MYSQLDATABASE | gzip -c > $PT_MYSQLBACKUPPATH/$PT_BACKUPFILENAME Problem with this is that it will keep dumping the backups in the folder and not clean up old files. This is where the variable PT_FILESTOKEEP comes in. Whatever number this is set to thats the amount of backups I want to keep. All backups are time stamped so by ordering them by name DESC will give you the latest first. Can anyone please help me with the rest of the BASH script to add the clean up of files? My knowledge of BASH is lacking and I'm unable to piece together the code to do the rest.

    Read the article

  • Adium last message?

    - by Charles
    I need to quickly send messages with a little variation in IRC (ie, irc commands). On windows/mirc, I can just click up and the chat input will fill with my previous message. I'm currently using Adium, but it doesn't have this basic feature? Does anyone know how I can get this, or perhaps suggest a different client. Thanks.

    Read the article

  • Last (I think and hope) problems configuring SSL certificate with Apache and VirtualHosts

    - by user65567
    Finally I set apache2 to get a single certificate for all subdomains. [...] # Go ahead and accept connections for these vhosts # from non-SNI clients SSLStrictSNIVHostCheck off # Apache setup which will listen for and accept SSL connections on port 443. Listen 443 # Listen for virtual host requests on all IP addresses NameVirtualHost *:443 # Because this virtual host is defined first, it will # be used as the default if the hostname is not received # in the SSL handshake, e.g. if the browser doesn't support # SNI. <VirtualHost *:443> ServerName domain.localhost DocumentRoot "/Users/<my_user_name>/Sites/domain/public" <Directory "/Users/<my_user_name>/Sites/domain/public"> Order allow,deny Allow from all </Directory> # SSL Configuration SSLEngine on ... </VirtualHost> <VirtualHost *:443> ServerName subdomain1.domain.localhost DocumentRoot "/Users/<my_user_name>/Sites/subdomain1/public" <Directory "/Users/<my_user_name>/Sites/subdomain1/public"> Order allow,deny Allow from all </Directory> # SSL Configuration SSLEngine on ... </VirtualHost> <VirtualHost *:443> ServerName subdomain2.domain.localhost DocumentRoot "/Users/<my_user_name>/Sites/subdomain2/public" <Directory "/Users/<my_user_name>/Sites/subdomain2/public"> Order allow,deny Allow from all </Directory> # SSL Configuration SSLEngine on ... </VirtualHost> So, for example, I can correctly access https://subdomain1.domain.localhost https://subdomain2.domain.localhost ... Now, anyway, I have problems on accessing http://subdomain1.domain.localhost http://subdomain2.domain.localhost ... Since I use a Mac Os, on accessing the "http: version", I get a default page "Your website." (instead of a error). Why does it happen?

    Read the article

  • Passing the output of the last command to sed as an argument

    - by neurolysis
    Hi, Basically, I'm wanting to automate adding something to xorg.conf in the right place, I've used some commands to get the line number of the line I want to manipulate, but I'm not really sure how to go about passing this line number (as an argument and NOT something to be manipulated) to sed. I have been told about xargs and looked at the docs on it, but after some reading and experimentation I can't seem to get it to work. In case anyone can think of a better method entirely, the process I want to automate is just finding the line containing both "Identifier" and "Monitor0" (there will only be one) and adding a line below it. The problem with just finding Monitor0 and manipulating that line is that there are multiple lines with Monitor0 in. I've got this far: fgrep -n "Monitor0" </etc/X11/xorg.conf | fgrep "Identifier" | cut -f1 -d: This gives out the line number which I'm wanting to pass to sed, but I'm not really sure how to do it. ...or is there a simpler way which I'm not seeing? Thanks. :)

    Read the article

  • Having two IP Routes/Gateways of last Resort on an HP Switch

    - by SteadH
    We have an HP Layer 3 Switch that is doing IP routing between vlans. The general set up is that the switch has an IP address on each VLAN and IP routing is enabled. On our servers VLAN, we have a firewall that has a connection to the outside world. To set a IP route on the HP router, we use IOS command ip route 0.0.0.0 0.0.0.0 192.168.2.1 where 192.168.2.1 is the address of our firewall, and the zeros essentially mean to route all traffic that the switch doesn't know what to do with out the firewall as a gateway. We're in the middle of an ISP and firewall change. I set up the new firewall and ran the IOS command ip route 0.0.0.0 0.0.0.0 192.168.2.254 (the address of the new firewall). Things started working nicely. When I reviewed the configuration of the switch though, I noticed that it did not replace the previous ip route command, but just added another route. Now, I know how to remove the old firewall route (no ip route 0.0.0.0 0.0.0.0 192.168.2.1), but what is the effect of having these two 0.0.0.0 routes? Is it switch implosion? Will a server just respond back over the route it receives the request from? I've read elsewhere that having two default gateways is an impossibility by definition, but I'm curious about this situation that our switch allowed. Thanks!

    Read the article

  • Last step in HDD Recovery (fixing windows)

    - by Atom Computing
    My dad’s hard drive corrupted which was a result of many bad sectors. Anyway, I made a clone of the drive and have now repaired it totally (recreating the MBR and MFT) and doing a series of ChkDsk's on it. I can now see all the files and folder on it and it is all intact. I currently have it as a slave in my computer (where I was doing all the repairs). When putting it back into the computer, it comes up with "A disk read error occurred: Press Ctrl + Alt + Del to Restart". I don’t know why this is happening but think it might have something to do with file permissions. I have tried a start-up recovery on the Vista boot CD and it found no problems. When trying to apply file permissions (and creating file perms for the SYSTEM group (as it didn’t have any for SYSTEM group)) it couldn't apply them for some of the System32 folder files. I have tried applying them as admin and with as powerful privileges I can get. All to no avail. When it is in my PC I can boot it up (I added it into my bootloader) and it boots up fine except when it logs in it comes up with the error - "Rundll32.exe - Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access the item" This message keeps coming back and nothing loads at all. Any help would be greatly received as I have got so far with the data recovery and want to avoid a reformat at all costs due to the vast number of programs installed and I don’t have much time on my hands! Thanks

    Read the article

  • last time an AD user has logged in?

    - by Roy
    I've noticed that we have in Active Directory more users than the company has actual employees. Is there a simple way to check multiple Active Directory accounts and see if there are any accounts that have not been used for a while? This should help me determine whether some accounts should be disabled or deleted.

    Read the article

  • "When firefox starts" setting does not last after a reboot

    - by user3990
    I have set the "when firefox starts" and "home page" values, but when I reboot the computer (or more accurately, when I restart the computer as it has been crashing frequently of late), those values get reset to some default value which I don't want. If I close Firefox then reopen, the correct values appear. How I do store the values over reboots? The values are when firefox starts: show a blank page home page: about:blank I'm still using Windows XP so there's no problem about directory permissions.

    Read the article

  • php doctrine last identifier issue

    - by mike
    I'm running in to the issue below when trying to run the following: $store = new Store(); $store->url =$this->form_validation->set_value('website'); $store->save(); $store_id = $store->identifier(); Fatal error: Uncaught exception 'Doctrine_Connection_Exception' with message 'Couldn't get last insert identifier.' in /home/yummm/public_html/system/application/plugins/doctrine/lib/Doctrine/Connection/UnitOfWork.php:932 Stack trace: #0 /home/yummm/public_html/system/application/plugins/doctrine/lib/Doctrine/Connection/UnitOfWork.php(632): Doctrine_Connection_UnitOfWork->_assignIdentifier(Object(Category_store_assn)) #1 /home/yummm/public_html/system/application/plugins/doctrine/lib/Doctrine/Connection/UnitOfWork.php(562): Doctrine_Connection_UnitOfWork->processSingleInsert(Object(Category_store_assn)) #2 /home/yummm/public_html/system/application/plugins/doctrine/lib/Doctrine/Connection/UnitOfWork.php(81): Doctrine_Connection_UnitOfWork->insert(Object(Category_store_assn)) #3 /home/yummm/public_html/system/application/plugins/doctrine/lib/Doctrine/Record.php(1691): Doctrine_Connection_UnitOfWork->saveGraph(Object(Category_store_assn)) #4 /home/yummm/public_html/system/application/controllers/auth.php(375): Doctrine_Reco in /home/yummm/public_html/system/application/plugins/doctrine/lib/Doctrine/Connection/UnitOfWork.php on line 932 When I echo $store_id, it seems to be grabbing the last id without any issues. Any idea why this error keeps coming up even though the ID is passing correctly?

    Read the article

  • iphone - keeping the last frame of a frame animation visible

    - by Mike
    I have this code UIImageView *sequence = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"balao_surge0.png"]]; NSMutableArray *array = [[NSMutableArray alloc] init] ; for (int i=0; i<30; i++) { UIImage *oneImage = [UIImage imageNamed:[NSString stringWithFormat:@"balao_surge%d.png",i]]; [array addObject:oneImage]; } sequence.animationImages = array; sequence.animationDuration = 2.0; sequence.animationRepeatCount = 1; [umaVista addSubview:sequence]; [sequence release]; sequence.startAnimating; The animation plays fine, but after the last frame is shown, it vanishes. I would like to make it stay visible, that is, make the animation stop on the last frame. Is there any way to do that? thanks for any help.

    Read the article

  • OpenGL ES Simple Undo Last Drawing

    - by Erika
    Hi Everyone, I am trying to figure out how to implement a simple "undo" of last drawing action on the iPhone screen. I draw by first preparing the frame buffer: [EAGLContext setCurrentContext:context]; glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer); I then prepare the vertex array and draw this way: glVertexPointer(2, GL_FLOAT, 0, vertexBuffer); glDrawArrays(GL_POINTS, 0, vertexCount); glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer); [context presentRenderbuffer:GL_RENDERBUFFER_OES]; How do I simple undo this last action? There has to be a way to save previous state or an built-in OpenGL ES function, I would think. Thanks

    Read the article

  • Javascript replace last occurence of text in a string

    - by Ruth
    Hi all see my code snippet below: var list = ['one', 'two', 'three', 'four']; var str = 'one two, one three, one four, one]; for ( var i = 0; i < list.length; i++) { if (str.endsWith(list[i]) { str = str.replace(list[i], 'finsih') } } I want to replace the last occurence of the word one with the word finish in the string, what I have will not work because the replace method will only replace the first occurence of it. Does anyone know how I can amend that snippet so that it only replaces the last instance of 'one' Thank you Ruth

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >