Where do I put $this->request->headers('Content-Type', 'application/json');
I'm trying to change the content-type to application/json in Kohana. I put this in an action in my controller:
$this->content = json_encode($json_data);
The request however, has still the text/html content-type.
Where should I put
$this->request->headers('Content-Type', 'application/json'); ?
I know the file needs to be where the getClass().getResource(filename) can find it, but I don't know where that is. I'm interested both in where to put the files on the filesystem itself, and how to g
I'm a developer who is just migrating from CodeIgniter to Laravel. In CI I had library folder where I could put non database functions, for example email verification etc. In Laravel I couldn't find s
in the main file, I would write: <components:mybutton id=mybutton1 rollOver=point_rollOverHandler(event) /> But if I want the component to have that behaviour innately, where do I write it
I have been putting them in the toplevel. I am wondering if it is more logical to put them in lib. Is there a general consensus or convention?
I'm trying to fetch an image from Twitter: open(http://api.twitter.com/1/users/profile_image/barackobama.png?size=bigger) But I get: RuntimeError: redirection forbidden: http://... -> https://..
Let's say I have a set of Countries in my application. I expect this data to change but not very often. In other words, I do not look at this set as an operational data (I would not provide CRUD opera
I faced this problem and I tried to fix it but I couldn't please I need your help .. this is my code: #pragma endregion private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e
I have an XSL style sheet for which I need to add some custom string manipulation using an xsl:function. But I am having trouble trying to work out where to put the function in my document. My XSL sim
I'm working on a bar graph. It shows flu vaccination rate by state. By clicking on the legend, you can switch between demographies in each state, great! However, it takes a double click on the legend
I am trying to restore a DB I am getting this prompt, however I am unable to point to a database to restore from Has anyone else experienced this horrific problem?
I am struggling where to put my uiautomator tests. It seems like the most common place to to put it in the main project under a test folder. And this is actually what Google recommends: http://develop
I'm using ssh root to a VPS Ubuntu 10.04 server from Linode that has Node.JS, Express, MongoDB, etc. installed. What I'm wondering is if I have a file called test-file.js with code: var express = re
1) I have multiple pages PhoneGap applications. Each of them may call PhoneGap API. Should I put deviceready listener on every pages, or is it sufficient to put on the first page only? 2) I use Angula
I have an EntityFramework model which has a boolean field. To make the mapping to the oracle database work properly, our application has the following additions in the app.config. <oracle.dataacces
I am doing a project for school using c++, the project is to be split into multiple files. test_driver.cpp - a file to test the code written storage.cpp - implementation file for storage class and met
I know this would be really easy for you but I am new in scripting. I would like to know how to put a specific path (a directory) where my script output (which is in .txt file) could go. I have this c
I am using Weld as CDI implementation. My integration test, that tries to assemble object graph instantiating Weld container works well, when I have empty beans.xml in src/test/java/META-INF/beans.xml
I have a C++ file that I would like to learn from but I am facing difficulty trying to open my text file which contains data to read. I am trying to figure out where do I put my text file. My code is
This is a code organization question. I have code that will put a gradient background on a view. I want to use this same code on multiple views - therefore, I want to put the code in a function and ca
I have trying to install nhibernate according this tutorial, but it doesn't say where I should place Cat.hbm.xml file and how project should understand its part of project. <?xml version=1.0 enco
My setup: Rails 2.3.10, Ruby 1.8.7 I need to update multiple instances of a model for a transaction. Should I make a class method and updates all the instances in the method or should I move that logi
I have this chunk on jQuery and currently its living in my index.html.erb and it works well. I have alot of snippets like this that i want to move out of the views and into some other file or files to
Ok, so I have inherited some code that isnt quite working ... I have jsp which lays out a dialog box <div class=ShippingPoints> <div id=dialog-form title=Shipping Points> <p class
I was looking at qr code generating libraries and I decided to go with phpqrcode to generate some codes on my server that I can send to mobile devices on command. My only problem is I dont know where
I have a group controller that manages groups, each group can have users. I want to retrieve the users using json but where should i put the logic, in what controller? Its more a matter of what feels
I've got 2 questions about organising Unit tests. Do I have to put test to the same package as tested class, or can I organise tests in different packages? For example if I have validity and other te
Where do I need to place jetty.xml, in case of embedded Jetty? jetty-web is placed inside WEB-INF and it is loaded automatically. I tried to put there jetty.xml, but it failed to load (it does not see
My cfimport works on the page, but I tried moving it to onRequestStart and it didn't work. Then I tried putting it in a cfinclude one folder down, and that didn't work. Does the cfimport have to be on
Django documentation shows how to put your own permissions to YourModel.Meta-class. I'd like to have some permissions that don't have anything to do with a certain model. They would just allow/restri
I'm trying to convince the higher-ups at my work place to migrate to Apache Ivy. I've managed to get a few sandbox projects working using Ivy to power the build, and now I have a greenlight to put tog
I've got a pci device and all I want is to read its memory by cating from /dev/pcidevice. My first attempt for the char device's read function looked like this: ssize_t cdev_read(struct file *filp,
I have application written with Java and Guice. For this application I have several views. Some of them use Guice, other - doesn't. Now I want to separate my code into independent modules. I can devid
Under 'res' there are several folders, from drawable-ldpi to drawable-xxhdpi, where should I put my images if I just want it to be the same image on all devices?
I'm following this guide: http://www.math.umd.edu/~dcarrera/ruby/0.3/chp_01/programs.html and I'm trying to create my first ruby program. So I wrote it in a text editor, but now I dont know how to ope
How do I put two SlickGrid grids on one page? Just having one slickgrid (jquery control) requires a lot of particular commands and the use of a nameless function (it seems). So what if I want two cont
It seems wrong to add <script src=...></script> to the render() of the widget. Especially if I have 2 of them on the same page. Is there a way to add a single script include on the adm
Why can't I put WHERE clause after ORDER BY? SELECT column1 FROM myTable ORDER BY column2 WHERE column2 = 5 Is there any standard reference? Where can i get a SQL standard draft?
I put the class under application\validate\PasswordConfirmation.php And it doesn't work. Error Class 'Default_Validate_PasswordConfirmation' not found still occurs. Does anyone have this problem bef
I found myself having to remove the first line of a string quite often while working on a text parser in C#. I put together a simple function to do that for me, but coming from a PHP background, I hav
I am wondering where to put the Laravel Event Listeners and Handlers. Somebody told me that I can put them anywhere. This is what I have tried so far. # listeners/log.php <?php Event::listen('log.c
I have five results to retrieve from a table and I want to write a store procedure that will return all desired rows. I can write the query like that temporarily: Select * from Table where Id = 1 OR
I currently have the following in my application_controller, but this seems the incorrect way to do this, considering these variables will only be set one time and will not change throughout the serve
I generally live by the rule that Global variables / functions are evil and that every piece of code should live in the class to which it pertains. This is a very easy rule to follow, and I believe th
I'm creating interfaces and abstract classes that represent a messaging framework for short text-based messages like SMS, email, twitter, xml, etc.. and I was wondering where I should put the message
I have the following problem. After I got the android.os.NetworkOnMainThreadException I went looking for a solution, and as it seems, AsyncTask is the best way to handle this. But after I read several
I downloaded a datepicker plugin that is done in jquery. The format is as follows: $('#date-picker').datepicker('show') when I run this command from the console, everything works. However, I'm not su
I'm coming from a Rails background, where there is a Gemfile in each project. I'm trying to learn Sinatra now, and realize I need to install the Nokogiri gem. Where would I list my dependencies?