Search Results

Search found 19928 results on 798 pages for 'multiple constructors'.

Page 121/798 | < Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >

  • Modify php shopping cart to support multiple drop down menus

    - by Thomas
    I have a shopping cart script that I am trying to modify to support multiple product selection. As it is now, the customer can select a product from a single drop down menu. Now, I would like to add multiple dropdown menus (all populated with the same options). Here is the php that outputs the dropdown menu: if($eshopoptions['options_num']>1){ $opt=$eshopoptions['options_num']; $replace.="\n".'<label for="eopt'.$theid.'"><select id="eopt'.$theid.'" name="option">'; for($i=1;$i<=$opt;$i++){ $option=$eshop_product['products'][$i]['option']; $price=$eshop_product['products'][$i]['price']; if($option!=''){ if($price!='0.00') $replace.='<option value="'.$i.'">'.stripslashes(esc_attr($option)).' @ '.sprintf( _c('%1$s%2$s|1-currency symbol 2-amount','eshop'), $currsymbol, number_format($price,2)).'</option>'."\n"; else $replace.='<option value="'.$i.'">'.stripslashes(esc_attr($option)).'</option>'."\n"; } } Is there some really simple way of getting the code to output the menu say 3 times instead of once?

    Read the article

  • Run multiple MySQL queries based on a series of ifs

    - by OldWest
    I am just getting started on this complex query I need to write and was hoping for any suggestions or feedback regarding table structure and the actual query itself.. I've already created my tables and populated test data, and now just trying to sort out how and what is possible within MySQL. Here is an outline of the problem: End result: Listing of rates based on specific queried criteria (see below): Age: [ 27 ] Spouse Age: [ 25 ] Num of Children: [ 3 ] Zip Code: [ 97128 ] The problem I am running into is each company that provides rates has a unique way of dealing with the rate. And I am looking for the best approach for multiple queries based on the company (one query with results for each company more or less all combined into one result set). Here are some facts: - Each company deals with zip code ranges which assist in the query result. - Each company has a different method of calculating the rate based on the Applicant, Spouse, Num of Children: Example, a) Company A determines rate by: Applicant + Spouse + Child(ren) = rate (age is pertinent to the applicant within a range). b) Company B determines the rate by total number of applicants like: 1, 2, 3, 4, 5, 6+ = rate (and age is ignored). First off, what would I call this type of query? Multiple nested query? And should I intertwine php within it to determine the If()s ... I apologize if this thread lacks sufficient data, so please tell me anything you would like to see.

    Read the article

  • Handling multiple media queries in Sass with Twitter Bootstrap

    - by Keith
    I have a Sass mixin for my media queries based on Twitter Bootstrap's responsive media queries: @mixin respond-to($media) { @if $media == handhelds { /* Landscape phones and down */ @media (max-width: 480px) { @content; } } @else if $media == small { /* Landscape phone to portrait tablet */ @media (max-width: 767px) {@content; } } @else if $media == medium { /* Portrait tablet to landscape and desktop */ @media (min-width: 768px) and (max-width: 979px) { @content; } } @else if $media == large { /* Large desktop */ @media (min-width: 1200px) { @content; } } @else { @media only screen and (max-width: #{$media}px) { @content; } } } And I call them throughout my SCSS file like so: .link { color:blue; @include respond-to(medium) { color: red; } } However, sometimes I want to style multiple queries with the same styles. Right now I'm doing them like this: .link { color:blue; /* this is fine for handheld and small sizes*/ /*now I want to change the styles that are cascading to medium and large*/ @include respond-to(medium) { color: red; } @include respond-to(large) { color: red; } } but I'm repeating code so I'm wondering if there is a more concise way to write it so I can target multiple queries. Something like this so I don't need to repeat my code (I know this doesn't work): @include respond-to(medium, large) { color: red; } Any suggestions on the best way to handle this?

    Read the article

  • Method to control multiple sites using same cookie?

    - by Frost Shadow
    Is it possible for two different web pages to use the same cookie? For example, some news sites now have buttons on the bottom, where if you are logged into facebook, you can just click the button to "like" the article. Is this a case of a 3rd party website using facebook's cookie to know which account you are, and if so, is there a way I can control it? I'm not sure how the new "like" system works, so maybe the button part isn't actually on the news site, but hosted on facebooks servers or something, so it's really facebook itself accessing its own cookie. If that's the case, is there a way I can choose when a site accesses its own cookie? Thanks for any help!

    Read the article

  • delete multiple files on linux with spaces in file names

    - by raido
    I have a directory on my Linux box with over 10000 files that I have to delete. Running... sudo rm -rf /var/tmp/* Gives the error message... sudo: unable to execute /bin/rm: Argument list too long The solution to this is to run sudo find /var/tmp | xargs sudo rm This only works for files with no spaces in the file name. However, some of the files have names with spaces in them and they are not deleted. For example, if a file is named 'A File With Spaces in the Name.dat', Running the command gives me errors like this.... rm: cannot remove `/var/tmp/A': No such file or directory rm: cannot remove `File': No such file or directory rm: cannot remove `With': No such file or directory rm: cannot remove `Spaces': No such file or directory rm: cannot remove `in': No such file or directory rm: cannot remove `the': No such file or directory rm: cannot remove `Name.dat': No such file or directory How do I pass the complete file path to xargs sudo rm without breaking up the file name.

    Read the article

  • trying to setup multiple primary partitions on ubuntu linux [migrated]

    - by JohnMerlino
    I currently have ubuntu desktop installed on a harddrive. I want to partition the harddrive so that I can reserve 30 gigs for ubuntu server and 30 gigs for ubuntu desktop. The drive has 300 gigs available. Right now I am booting from dvd drive and installing ubuntu server. I selected "Guided partitioning" and created a 30 gig primary partition of Ext4 journaling filesystem, set "yes, format it" for format partition and set bootable flag to on. I intend to use this 30 gig partition to hold ubuntu server and allow me to boot from it. Now I have two other partitions. They are both set to "logical", one is currently using 285.8 gigs and is using ext4 (when I try to set bootable flag to true, it gives a warning "You are trying to set the bootable flag on a logical partition. The bootable flag is only useful on the primary partitions"). More alarming it says "No existing file system was detected in this partition". Actually, Im thinking that this is the parittion that is supposed to be holding my current Ubuntu Desktop. And of course I want this to be bootable and be a primary partition, so I could dual boot from this and the server partition. Now the third partition is also set to logical and it is being used as swap area. My question is regarding that second partition. Its supposed to be a primary partition thats holding my existing ubuntu desktop edition. How do I switch it to primary and to make sure that its pointing to my existing desktop installation?

    Read the article

  • Using multiple USB webcams in Linux

    - by rachelderp
    Running more than one USB webcam in Debian/Linux results in the the following error: libv4l2: error turning on stream: No space left on device VIDIOC_STREAMON: No space left on device What initially seemed to be a programming issue in OpenCV turned into a quest for a mysterious hardware/software problem after the same errors were produced by running cheese and xawtv. Apparently it's caused by webcams requesting all the available bandwidth on the USB host controller. With that in mind I decided to run wireshark and capinfos to see just how much bandwidth a single camera used. 4 megabits per second at 320x240 14 megabits per second at 640x480 32 megabits per second at 1920x1080 Interesting! That might explain why two cameras at 320x240 work but any higher resolution fails. It's as if my USB controller is only operating at USB 1 speeds, yet lsusb shows both webcams belonging to a device which supposedly supports 480 megabits per second. One solution proposed forcing the webcams to calculate their bandwidth usage instead of requesting their maximum by running the following commands: sudo rmmod uvcvideo sudo modprobe uvcvideo quirks=128 Unfortunately that made no difference, so I decided to try another solution. A post on StackOverflow suggested telling my webcams to use a lower FPS or compressed video format like MJPEG, but after running v4lctl list it doesn't appear either of my webcams support changing their video mode. And that's where I'm stuck. Why would two webcams operating well below the maximum speed of USB 2 would produce this error? ps: It's not a disk space issue, df displays no change when the webcams are started. pps: If it makes a difference, here's the output of lsusb

    Read the article

  • How to match against multiple value possiblities in Excel

    - by Henno
    I have list of person names in column A. I want to display "1" in column B for names which end with either "e" or "i" or "n". If there would be only one match to test against, I would write something like: =IF( MID(A1,FIND(" ",B1)-1,1) = "e", "1", "0") In PHP I would solve that like this: echo in_array( $names[$row_number], array('e', 'i', 'n') ) ? '1' : '0'; What formula should I use in column B in Excel?

    Read the article

  • mysql is not using multiple cpus

    - by mhost
    Our MySQL server has been using a lot of CPU lately (it's reached 100% several times and stays there for a while) and I noticed that it the CPU load is all on one core of one cpu. I was hoping to spread that out to all 4 on my server. I have been tweaking the MySQL settings to use more ram and less cpu, but it still occasionally reaches very high CPU usage. It seems like everything about the topic refers to thread_concurrency (which I've read is a solaris only setting). What can I do in Linux? Thanks.

    Read the article

  • Apache httpd VirtualHost config - multiple sites

    - by DaFoot
    [Advised to post here from StackExchange] I have a site to work on, because of the way the URLs are built the application seems to have been created on the assumption that it will be at the server root (only app). On my dev server I have other projects and up to now a simple symlink has been working for me, but that's not the case now because this new app wants to sit at the route and process all URLs arriving on :80. Hopefully this snippet from httpd.conf will help explain what I'm trying to acheive: # default for any not matched elsewhere <VirtualHost *:80> ServerName localhost DocumentRoot /var/www/html/newproject </VirtualHost> # now try to pick out specific URLs <VirtualHost localhost/webdev> DocumentRoot /var/www/html/existingProject ServerName localhost/project </VirtualHost> Also need to be able to get same affect from wherever I'm accessing the httpd instance from. Hope that makes sense.

    Read the article

  • Exchange 2010 mail routing with Hub Transport in multiple sites

    - by jmreicha
    I have two separate physical sites, Site A and Site B. In site A, I have following: 2 CAS servers 2 Hub Transport servers 2 Mailbox servers 2 Edge servers In site B, I have the following: 1 CAS 1 Hub 1 Mailbox 1 Edge Currently everything is working out of site A. That is, all users are housed on mailboxes that are in site A and all inbound mail flow is pointing to site A. I would eventually like to be able to move some of the mailboxes to site B without causing a disruption for resliency and redundancy purposes but I am not quite sure how to go about setting this up or if it is even possible. So far I have created an Edge subscription in site B and am able to send emails out from test accounts set up with mailboxes on the site B Mailbox server. However, I am unable to receive incoming mail messages and am confused. So I'm thinking incoming mail messages are still being directed to site A and then they are getting stuck because there is no way to route the mail to the site B mailboxes. Is this assumption correct? I am unfamiliar with mail flow and routing so I am not really sure what I need to be looking at? Would I add the site B hub transport to the Edge subscription in site A? Or I guess more specifically, how would I go about enabling communication and mail flow between mailboxes split up on site A and B?

    Read the article

  • Find rows that match multiple (two) criteria

    - by Scott Sanders
    I am trying to get a list of items that match on two criteria. DATE PRODUCT CHANNEL DEC 13 Cat Chow DRUG NOV 13 Pupperoni DRUG DEC 13 Meow Mix DRUG DEC 13 Jerky Treats DRUG This is the data from A1 to C5. I want all the product sold on DEC 13 and in the DRUG channel. This is the formula that I have now, which is only bringing back the first example. INDEX($B$2:$B$5, MATCH(1, ("DRUG"=$C$2:$C$5)*("DEC 13"=$A$2:$A$5), 0) )

    Read the article

  • grep/search for multiple lines in a file.

    - by GSto
    Let's say I have a file with a long nested array, that's formatted like this: array( 'key1' => array( 'val1' => 'val', 'val2' => 'val', 'val3' => 'val', ), 'key2' => array( 'val1' => 'val', 'val2' => 'val', 'val3' => 'val', ), //etc... ); what I would like to do is have a way to grep/search a file, and by knowing key 1, get all the lines (the sub-array) it contains. is this possible?

    Read the article

  • Sharing files between multiple computers?

    - by Koalatea
    At my school, we have 13 iMacs that we use to make our yearbook. Currently our school has some servers for us, but since we work with so many files ( thousands of pictures, most of which are ~3MB ) it slows down far too much. Is there a way to better share files between our computers? We are on a wireless network and the whole school shares the same servers, we have around probably 400 computers in the school. Is there a hardware fix I can do? Something like buying an external and hooking only yearbook computers to it?

    Read the article

  • Set an Excel cell's color based on multiple other cells' colors

    - by Lord Torgamus
    I have an Excel 2007 spreadsheet for a list of products and a bunch of factors to rate each one on, and I'm using Conditional Formatting to set the color of the cells in the individual attribute columns. It looks something like this: I want to fill in the rating column for each item with a color, based on the color ratings of its individual attributes. Examples of ways to determine this: the color of the category in which the item scored worst the statistical mode of the category colors the average of the category ratings, where each color is assigned a numerical value How can I implement any or all of the above rules? (I'm really just asking for a quick overview of the relevant Excel feature; I don't need step-by-step instructions for each rule.)

    Read the article

  • How to share datastores between multiple exchange servers?

    - by Johan
    I have an Exchange 2003 box that is seriously overstressed. I want to transfer its duties to a new and faster box. I don't cannot suffer downtime, so I have to do this stuff live. Here's what I plan to do: Install Exchange 2003 on the new server Set up the new server, so it will accept requests from users for their mailboxes I want to do as little manual set up as possible, because that 'll eat up my time and is too error prone Than I want to transfer my datastores one by one to the new server and have those users (once the datastore in the new server is up and running) to get their data from the new server (without them noticing) I don't have to transfer all the datastores, some of them need to stay on the old box (because I'm still waiting for extra HD space to arrive from the supplier) What steps do I need to follow to do this? The new box has never seen this domain before, the old exchange server is not the DC, we have a dedicated DC.

    Read the article

  • CSS3: Stripe table with multiple <tbody> elements

    - by xyz
    Hello, I've got a table with multiple <tbody> elements. At a given time, only one <tbody> is displayed, or all of them are displayed. I currently use this CSS3 code to stripe the table. table tr:nth-child(even) { background: #efefef; } When a single <tbody> element is shown, everything is (obviously) fine, but when multiple <tbody> elements are shown the CSS rules apply to each one separately, and each <tbody> has its own "stripes system". Together the stripes may or may not look consistent, depending on the number of rows. <tbody> <tr> [ODD] <tr> [EVEN] <tr> [ODD] </tbody> <tbody> <tr> [ODD] <tr> [EVEN] </tbody> ... Would I absolutely have to use JavaScript (...jQuery) to fix this?

    Read the article

  • What's the best way to get a bunch of rows from MySQL if you have an array of integer primary keys?

    - by Evan P.
    I have a MySQL table with an auto-incremented integer primary key. I want to get a bunch of rows from the table based on an array of integers I have in memory in my program. The array ranges from a handful to about 1000 items. What's the most efficient query syntax to get the rows? I can think of a few: "SELECT * FROM thetable WHERE id IN (1, 2, 3, 4, 5)" (this is what I do now) "SELECT * FROM thetable where id = 1 OR id = 2 OR id = 3" Multiple queries of the form "SELECT * FROM thetable WHERE id = 1". Probably the most friendly to the query cache, but expensive due to having lots of query parsing. A union, like "SELECT * FROM thetable WHERE id = 1 UNION SELECT * FROM thetable WHERE id = 2 ..." I'm not sure if MySQL caches the results of each query; it's also the most verbose format. I think using the NoSQL interface in MySQL 5.6+ would be the most efficient way to do this, but I'm not yet up to MySQL 5.6.

    Read the article

  • mysql is not using multiple cpus

    - by helpmhost
    Hi, Our MySQL server has been using a lot of CPU lately (it's reached 100% several times and stays there for a while) and I noticed that it the CPU load is all on one core of one cpu. I was hoping to spread that out to all 4 on my server. I have been tweaking the MySQL settings to use more ram and less cpu, but it still occasionally reaches very high CPU usage. It seems like everything about the topic refers to thread_concurrency (which I've read is a solaris only setting). What can I do in Linux? Thanks.

    Read the article

  • Upstart multiple instances of service not working.

    - by Dax
    I started playing with MongoDB on Lucid. Now I would like to run a DB and Config server on the same box. They both use the same binary to launch, but with different config files and running on different ports. All directories for log and lib is split so one goes to mongodb and the other to mongoconf. Each process can be started without any problems on their own. start mongodb stop mongodb start mongoconf stop mongoconf But if I try to start both, the second one would just start and exit. Using 'initctl log-priority debug' I got the following in the logs. Jan 6 12:44:12 mongo4 init: event_finished: Finished started event Jan 6 12:44:12 mongo4 init: job_process_handler: Ignored event 1 (1) for process 5690 Jan 6 12:44:12 mongo4 init: mongoconf (mongoconf) main process (5690) terminated with status 1 Jan 6 12:44:12 mongo4 init: mongoconf (mongoconf) goal changed from start to stop Jan 6 12:44:12 mongo4 init: mongoconf (mongoconf) state changed from running to stopping man 5 init shows that you can use instance names to differentiate the two. I tried using 'instance mongoconf' in the on upstart script and 'instance mongodb' in the other one, and it still fails. I can manually start the other process, so there is definitely no conflicts on port numbers or directories. Any ideas on what to try or how to get output on why it is 'terminated with status 1'? Thanx

    Read the article

  • multiple screen support

    - by pedr0
    Hi at all, I have some problem with multiple screen support, I work with dp(dpi) for specify the layout_heigth and layout_width and I hope that is the better way to support multiple screen, but when I tried with two smartphone I meet two different result. I give an example, this is a layout I use: <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/cities_main_layout" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView android:id="@+id/citieslist" android:layout_width="wrap_content" android:layout_height="320dip" android:layout_gravity="center_vertical" android:layout_below="@id/cities_main_layout" /> <LinearLayout android:id="@+id/cities_button_layout" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/citieslist" android:layout_gravity="center_vertical"> <Button android:id="@+id/bycountry" android:layout_height="50dip" android:layout_width="105dip" android:background="@drawable/buttonmarket" android:text="@string/button_bycountry" /> <Button android:id="@+id/top10" android:layout_height="50dip" android:layout_width="105dip" android:background="@drawable/buttonmarket" android:text="@string/button_top10" /> <Button android:id="@+id/recommended" android:layout_height="50dip" android:layout_width="105dip" android:background="@drawable/buttonmarket" android:text="@string/button_recommended" /> </LinearLayout> </RelativeLayout> The button are at the bottom of the layout, and I see two different result: In the last smartphone I can see the buttons, instead in the first I cannot...what's wrong? I have to write a layout for any set of screen??!!!

    Read the article

  • Why would one want to use the public constructors on Boolean and similar immutable classes?

    - by Robert J. Walker
    (For the purposes of this question, let us assume that one is intentionally not using auto(un)boxing, either because one is writing pre-Java 1.5 code, or because one feels that autounboxing makes it too easy to create NullPointerExceptions.) Take Boolean, for example. The documentation for the Boolean(boolean) constructor says: Note: It is rarely appropriate to use this constructor. Unless a new instance is required, the static factory valueOf(boolean) is generally a better choice. It is likely to yield significantly better space and time performance. My question is, why would you ever want to get a new instance in the first place? It seems like things would be simpler if constructors like that were private. For example, if they were, you could write this with no danger (even if myBoolean were null): if (myBoolean == Boolean.TRUE) It'd be safe because all true Booleans would be references to Boolean.TRUE and all false Booleans would be references to Boolean.FALSE. But because the constructors are public, someone may have used them, which means that you have to write this instead: if (Boolean.TRUE.equals(myBoolean)) But where it really gets bad is when you want to check two Booleans for equality. Something like this: if (myBooleanA == myBooleanB) ...becomes this: if ( (myBooleanA == null && myBooleanB == null) || (myBooleanA == null && myBooleanA.equals(myBooleanB)) ) I can't think of any reason to have separate instances of these objects which is more compelling than not having to do the nonsense above. What say you?

    Read the article

  • Multiple FIle Upload in FTP Using CMD

    - by user697363
    I've large number of files, over 10,000, which I want to upload in FTP server. Now, I can't zip those files & upload it as I've to read those files individually in SAS software for my analysis. If I use mput commant, then the prompt as me to say "y" eact time it tries to upload the file. This is very cumbersome. Is there any method by which it automatically upload the files without I've to manually entering "y" each time file wants to upload. The command I was using was: ftp ftp.myftp.com *my ftp server name username:myusername password:mypassword ftp> lcd c:\local_folder ftp> mput *.*

    Read the article

  • URI Rewrite with fake subdomains and multiple variables

    - by Rich
    Can someone please help with trying to use mod rewrite so foo.domain.com is rewritten to domain.com/p.php?s=foo and foo.domain.com/bar to domain.com/p.php?s=foo&p=bar? Currently my .htaccess is: RewriteEngine On # Remove www RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC] RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L] # Rewrite subdomain etc. RewriteCond %{HTTP_HOST} ^(.*)\.domain\.com$ [NC] RewriteRule ^([^/]+)/?$ p.php?s=%1&p=$2 [QSA,L,NC] But I can't work out how to grab the second variable (being optional and after a slash at the end of the URI. I've tried changing the end of the condition to ?/(.*)$, but to no avail and my mod rewrite skills are certainly naff!

    Read the article

< Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >