Search Results

Search found 17958 results on 719 pages for 'local delivery'.

Page 52/719 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • Ruby on Rails: How to use a local variable in a collection_select

    - by mmacaulay
    I have a partial view which I'm passing a local variable into: <%= render :partial => "products/product_row", :locals => { :product => product } %> These are rows in a table, and I want to have a <select> in each row for product categories: <%= collection_select(:product, :category_id, @current_user.categories, :id, :name, options = {:prompt => "-- Select a category --"}, html_options = { :id => "", :class => "product_category" }) %> (Note: the id = "" is there because collection_select tries to give all these select elements the same id.) The problem is that I want to have product.category be selected by default and this doesn't work unless I have an instance variable @product. I can't do this in the controller because this is a collection of products. One way I was able to get around this was to have this line just before the collection_select: <% @product = product %> But this seems very hacky and would be a problem if I ever wanted to have an actual instance variable @product in the controller. I guess one workaround would be to name this instance variable something more specific like @product_select_tmp in hopes of not interfering with anything that might be declared in the controller. This still seems very hacky though, and I'd prefer a cleaner solution. Surely there must be a way to have collection_select use a local variable instead of an instance variable. Note that I've tried a few different ways of calling collection_select with no success: <%= collection_select(product, ... <%= collection_select('product', ... etc. Any help greatly appreciated!

    Read the article

  • PHP/MySQL - Working with two databases, one shared and one local to an instance of application

    - by Extrakun
    The situation: Using a off-the-shelf PHP application, I have to add in a new module for extra functionality. Today, it is made known that eventually four different instances of the application are to be deployed, but the data from the new functionality is to be shared among those 4 instances. Each instance should still have their own database for users, content and etc. So the data for the new functionality goes into a 'shared' database. The data for the application (user login, content, uploads) go into a 'local' database To make things more complex, the new module I am writing will fetch data from the local DB and the shared DB at the same time. A re-write of the base application will take too long. I only have control over the new module which I am writing. The ideal solution: Is there a way to encapsulate 2 databases into one name using MySQL? I do not wish to switch DB connections or specifically name the DB to query from inside my SQL statements. The application uses a DB wrapper, so I am able to change it somehow so I can invisibly attempt to read/write to two different DB. What is the best way to handle this problem?

    Read the article

  • Stream PDF to another local App

    - by Nathan
    Hi, I'm currently trying to optimize a small firefox extension that will grab a pdf off the current document and send it to a port that another local application is listening on. Right now it uses a terrifying hackjob of cache viewer. The way I'm getting it is loading the cache, searching through it using the current URL and grabbing the file and saving it to a temp directory. Then I stream the file in, delete the temp, and send it through the socket. Now, my new design, ideally I'd want to build it from scratch and cut out saving it to the local machine at all, and just stream it through the socket. I've been looking at doing something like, //check page to ensure its a pdf //init in/out streams //stream through sock //flush Now, this would be vastly superior to the 400 line hacked up mess I have now, but I'm new to building FF extensions, and after reading a lot about URIs and the file streaming and such I'm probably more confused than when I started trying to fix this three hours ago. I'm okay with sending things through the sockets and whatnot, I understand that, I'm mainly confused about what multitude of interfaces I want to use. Gah! Thanks! Also, long time reader, first time poster!

    Read the article

  • Using Reachability for Internet *or* local WiFi?

    - by randallmeadows
    I've searched SO for the answer to this question, and it's not really addressed, at least not to a point where I can make it work. I was originally only checking for Internet reachability, using: self.wwanReach = [Reachability reachabilityWithHostName:@"www.apple.com"]; [wwanReach startNotifer]; I now need to support a local WiFi connection (in the absence of reaching the Internet in general), and when I found +reachabilityForLocalWiFi, I also noticed there was +reachabilityForInternetConnection. I figured I could use these, instead of hard-coding "www.apple.com" in there, but alas, when I use self.wwanReach = [Reachability reachabilityForInternetConnection]; [wwanReach startNotifer]; self.wifiReach = [Reachability reachabilityForLocalWiFi]; [wifiReach startNotifer]; the reachability callback that I've set up "never" gets called, for values of "never" up to 10, 12, 15 minutes or so (which was as long as my patience lasted. (User's patience will be much less, I'm sure.) Switching back to +reachabilityWithHostName: works within seconds. I also tried each "pair" individually, in case there was an issue with two notifiers in progress simultaneously, but that made no difference. So: what is the appropriate way to determine reachability to either the Internet/WWAN or a local Wifi network (either one, or both)? [This particular use case is an iPhone or iPad connecting to a Mac mini computer-to-computer network; I'm sure other situations apply.]

    Read the article

  • Zend, slow load, "waiting for response" for 20-80 seconds on local site

    - by Tony C.
    So I have several sites running under the same zend setup. All of the sites run pretty normally except one. Upon loading or reloading this one site, reguardless of which page your on (excluding the 404 page explanation later...) you get a serious pause before any content begins to download. Using firebugs net panel you can see that the first request which is www.(siteaddress).com.local you see a "waiting for response" bar (purple) that is going for anywhere from 20 to sometimes 80+ seconds and this isn't on a dev site, this is on a local site under localhost. What I've managed to figure out so far is that all the pages do this except my 404 page. The reason the 404 page doesn't succumb to this is because it uses a seperate controller (the error controller) and therefore bypasses much of the controller and functions the other parts of the site use. Using exit statements I've manged to figure out that the problem happens somewhere between my post dispatch and my main (top most) controllers Init function. If i exit in the main controllers init the page loads (then exits instantly, no wait). If i do the same in the pre or post dispatch the page waits the 20-80 seconds then exits. Is there a diagram or explanation somewhere or a way for me to find out what events fire inbetween the post dispatch and the main controllers init function? Or does anyone have any clue what might cause this? Any help would be greatly appreciated...

    Read the article

  • Create ImageButton programatically depending on local database records

    - by user2507920
    As i described in title, i have a local db in sqlite. I want to create ImageButton parametrically. How many times is local database loop executing? Please see code below : RelativeLayout outerRelativeLayout = (RelativeLayout)findViewById(R.id.relativeLayout2_making_dynamically); db.open(); Cursor c = db.getAllLocal_Job_Data(); if(c!=null){ if(c.moveToFirst()){ do { RelativeLayout innerRelativeLayout = new RelativeLayout(CalendarActivity.this); innerRelativeLayout.setGravity(Gravity.CENTER); ImageButton imgBtn = new ImageButton(CalendarActivity.this); imgBtn.setBackgroundResource(R.drawable.color_001); RelativeLayout.LayoutParams imageViewParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); imgBtn.setLayoutParams(imageViewParams); // Adding the textView to the inner RelativeLayout as a child innerRelativeLayout.addView(imgBtn, new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); outerRelativeLayout.addView(innerRelativeLayout, new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); } while (c.moveToNext()); } } db.close(); But when i run the project, i can see only one button created there. I think there are many buttons but here image button is creating on last created image button. I think i should use android:layout_toRightOf with previous created button but i cant find how to place it here. I have tried some ideas but it did not change any thing. So please anybody has any idea to solve my problem then please share it with me.

    Read the article

  • PHP PDO changes remote host to local hostname

    - by Wade Urry
    I'm trying to connect to a remote mysql server using PDO. However, regardless of the hostname or ip address i supply in the dsn, when the script is run it always reverts the address to the hostname of the local server where the webserver is running. Google suggests this could be something to do with SELinux and apaches ability to connect to remote databases, however i have SELinux disabled. Distro: Ubuntu 11.04 x64 Apache version: 2.2.17 PHP Version: PHP 5.3.5-1ubuntu7.11 with Suhosin-Patch (cli) Edit: Added code as requested. Though i dont believe this is an issue with my coding as it works fine on the local server, but doesnt allow remote connection. public function db_connect($driver, $dbhost, $dbname, $user, $pass) { $dsn = $driver . ':host=' . $dbhost . ';dbname=' . $dbname; try { $this->DB = new PDO($dsn, $user, $pass); } catch (PDOException $err) { print 'Database Connection Failed: ' . $err->getMessage(); die(); } } $remote_db = new DB('mysql', 'remote_server.domain.tld', 'database_name', 'user_name', 'password'); This is the error message i am receiving. Database Connection Failed: SQLSTATE[28000] [1045] Access denied for user 'user_name'@'local_server.domain.tld' (using password: YES)

    Read the article

  • Xap file contents changes if built in Visual Studio or build server

    - by arch
    I'm using MEF with my Silverlight 4 app to dynamically load xap files. To optimize this process, I've removed various assemblies from my xaps since I know they've already been loaded by the base xap. This reduces the size of my dynamically loaded xaps. I accomplished this by setting the "Copy Local" flag for each assembly reference to "false". This all seems to work fine when I build in Visual Studio 2010 - my xaps are much smaller. However, when the same projects are built by the build server, all the excluded references are once again in the xap file hence tripling the size of the xap. I've read several blogs/articles regarding similar experiences but no resolution. Very frustrating - any help is appreciated.

    Read the article

  • Sending emails with CodeIgniter in a local XAMPP server

    - by KeyStroke
    Hi, I'm trying to send emails through localhost (XAMPP Windows 1.7.3 installation), but I've been trying for hours with no success. This is the last code I tried: $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.gmail.com', 'smtp_port' => 465, 'smtp_user' => '[email protected]', 'smtp_pass' => 'mypassword', ); $this->load->library('email', $config); $this->email->set_newline("\r\n"); $this->email->from('[email protected]', 'My Name'); $this->email->to('[email protected]'); $this->email->subject('Email Test'); $this->email->message('Testing the email class.'); if($this->email->send()) { echo 'Your email was sent.'; } else { show_error($this->email->print_debugger()); } Whenever I tried to load this the page shows that it's loading but nothing happens. Is there anything I need to setup in my server to insure email delivery? I messed with php.ini and sendmail's config a bit with no luck. And openSSL isn't available in case that matters. Any idea what's wrong?

    Read the article

  • Why is Mac OS X 10.6 using /usr/lib to start Apache when I compiled PHP using /opt/local/lib?

    - by Anthony
    PHP 5.3.3 compiled on Mac OS X 10.6 - using /usr/lib when trying to start Apache... rather than /opt/local/lib specified when PHP was configured. Why is it trying to load from /usr/lib when I specified in my configure not to? httpd: Syntax error on line 115 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): Library not loaded: /opt/local/lib/libiconv.2.dylib\n Referenced from: /usr/libexec/apache2/libphp5.so\n Reason: Incompatible library version: libphp5.so requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0 The error message above refers to /opt/local/lib which when I run: otool -LD /opt/local/lib/libiconv.2.dylib Message: /opt/local/lib/libiconv.2.dylib: /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0) It shows that the version is different than what httpd is erring out as. I have a feeling I need to recompile Apache using newer libraries, but the error message still doesn't make too much sense to me.

    Read the article

  • PHP compiled on Mac OSX 10.6 - using /usr/lib when trying to start apache... rather than /opt/local/lib specified when php was configured

    - by Anthony
    PHP 5.3.3 compiled on Mac OSX 10.6 - using /usr/lib when trying to start apache... rather than /opt/local/lib specified when php was configured Why is it trying to load from /usr/lib when I specified in my configure not to? httpd: Syntax error on line 115 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): Library not loaded: /opt/local/lib/libiconv.2.dylib\n Referenced from: /usr/libexec/apache2/libphp5.so\n Reason: Incompatible library version: libphp5.so requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0 The error message above refers to /opt/local/lib which when I run: otool -LD /opt/local/lib/libiconv.2.dylib /opt/local/lib/libiconv.2.dylib: /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.0) It shows that the version is different than what http is erring out as.

    Read the article

  • Arguments, local variables, and global variables coding convention in Python

    - by prosseek
    In python, there is no way to differentiate between arguments, local variables, and global variables. The easy way to do so might be have some coding convention such as Global variables start with _ and capital letter arguments end with with _ _Gvariable = 10 def hello(x_, y_): z = x_ + y_ Is this a Pythonian way to go? I mean, is there well established/agreed coding-standards to differentiate them in python?

    Read the article

  • Arguments, local variables, and global variables in Python

    - by prosseek
    In python, there is no way to differentiate between arguments, local variables, and global variables. The easy way to do so might be have some coding convention such as Global variables start with _ and capital letter arguments end with with _ _Global variable = 10 def hello(x_, y_): z = x_ + y_ Is this a Pythonian way to go? I mean, is there well established/agreed coding-standards to differentiate them in python?

    Read the article

  • VirtualBox guest OS accessing local server on host OS.

    - by Maxim
    Hi, On my Ubuntu HOST I have my local webserver. I installed VirtualBox and Debian as a GUEST. I would like Debian guest to be able to hit my webserver running on my Ubuntu host (for example, I just type http://localhost:8080/ in the browser under Debian). How can this be done? Thanks in advance.

    Read the article

  • Converting local timestamp to UTC timestamp in Java.

    - by fiXedd
    I have a milliseconds-since-local-epoch timestamp that I'd like to convert into a milliseconds-since-UTC-epoch timestamp. From a quick glance through the docs it looks like something like this would work: int offset = TimeZone.getDefault().getRawOffset(); long newTime = oldTime - offset; Is there a better way to do this?

    Read the article

  • Setting up SSL on a local xampp/apache server

    - by cvack
    I'm trying to access a Active Directory from my local webserver. To do this I'm using the latest version of xampp and a PHP script called adLDAP. If I understand things right, I need to enable SSL to access https URLs. I've tried to google it but with no luck :( Could anyone link a tutorial or explain to me how to install SSL on xampp/apache for windows 7 64bit? Any help would be appreciated :)

    Read the article

  • Facebook iframe application redirects to local server

    - by PHP thinker
    I am using FaceBook application inside iframe. But when I try to access it using url like http://apps.facebook.com/myapp, it immediately redirects me to my lhttp://localhost:8080 application, which I intended to keep in frame. I assume that my local application should stay in frame, while the general container would be FB site itself, but something is wrong. Any hints?

    Read the article

  • Cannot access website using host headers on local windows 7 and iis 7

    - by Irman
    I have problem of accessing my website created using visual studio on my local pc. the pc using windows 7 with static ip address has been configured and i have added a hostname "192.168.0.1 hosts myweb.mylocal.com" on c:\windows\system32\driver\etc. on the IIS i have configured the binding myweb.mylocal.com with impersonation set enabled and windows authentication is enabled. the user login just keep prompting eventhough i have entered the correct username and password.

    Read the article

  • VS2010 and local databases

    - by Darren
    Is it possible to connect to a local database (in the app_data folder) using the Data - Transact SQL Editor in Visual Studio 2010? When I launch the Transact SQL Editor from VS2010 I get the "Microsoft SQL Server 2008 RC" connect to server dialog. The options I have for Server type are "Database Engine" and "SQL Server Compact"

    Read the article

  • Passing local variables to Erlydtl block

    - by Justin
    Hi, I've got a block of erlydtl code which I use repeatedly and would like to abstract to some kind of block / partial template. The issue is that I need to pass the block a local variable. This is possible with Rails partial templates; it looks like it's possible with Django's blocks [albeit with some kind of Python hackery]; I'm wondering if it's possible with Erlydtl [Erlang implementation of Django templates] Ideas ? Thanks you.

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >