Retrieving records from database using eloquent with optional query parameters

i have the following block of code in my Resource Controller:$travel_company_id = Input::get('travel_company_id');$transport_type = Input::get('transport_type');$route_type = Input::get('route_type');$travelRoutes = TravelRoute::where('trav

Override Plugin Function in WordPress

I have a Plugin installed on my WordPress site.I'd like to override a function within the Plugin. Do I override this in my theme's functions.php and if so, how do I do this?Here's the original function in my plugin: /** * sensei_star

Posting comment with ajax and jquery

I want to display the posted comment once the user comments. Just to add it under all of them as facebook does.I have this: // Interceptamos el evento submit $('#CommentAddForm').submit(function() { alert(entro); alert($(th

How to use new scala syntax to rewrite “TowersOfHanoi”

The code is coming from TowersOfHanoi { import scala.reflect.Manifest def simpleName(m:Manifest[_]):String = { val name = m.toString name.substring(name.lastIndexOf('$')+1) } trait Nat

const char* in my class has junk character(s) after it's returned from function

Class:class myclass { public: myclass(void); const char* server; private: char pidchar[6]; int pidnum;};The functionmyclass parseINI(const char* file){ myclass iniOptions; CSimpleIniA ini; ini.SetUnicode(); ini.Loa

How to get the data using dataLoader in amCharts?

I'm using amCharts library (it's a JavaScript library for loading data in charts) to extract the data from mySQL database, and display it using a Stock Chart.I found a complete tutorial here:

How can I center a button inside a div vertically

I want to display a button centered inside a div. I did it with the following:transformation:translateY(25%);but this is is not allowed for older version of browsers. This is the follwing CSS code for the div and the button:#buttonSwap.swap

How to upgrade the project build in visual studio 2005 to visual studio 2008?

I have one OPC ( OLE for Process control ) server project which is developed into visual studio 2005. I want to run it in visual studio 2008. The coding for the OPC server project is done in VC++. I want to connect my OPC client to this OPC

Convert 'Xamarin.Form.Image' type 'byte[]'

I am supposed to get an Image from a url and convert it into byte[]. The following is what I achieved var webImage = new Image { Aspect = Aspect.AspectFit };webImage.Source = ImageSource.FromUri(new Uri(

Struts2 parameter to javascript

I have a struts2 action with a field: private Long omradeId;The field has a getter.The action is sent to a jsp and within that jsp i can access the field using tag. Thats all good.Now i also have within the jsp a section where i

Glassfish and Tomcat

I write a web service program on NetBeans. it's work without any problem with GlassFish server but when I want to run by Tomcat 7.x.x I received this error:Type Exception reportmessagedescription The server encountered an internal error ()

how to convert a float into binary using struct.unpack?

I'm trying to convert a float into binary. I'm using the module struct. For instance, with the value of 3.5, when I execute this line :struct.pack('>f',3.5)I get this :b'@`\x00\x00'I suppose the two x00 x00 represent hexadecimal values for

how do i use json api in my kivy program

hi I'm currently reading O'Reilly's Creating Apps in Kivy and there's an example that I can't get it to work correctly because by the time he wrote the book openWeatherMap didn't require api key (APPID) but now it does and I'm a novice prog

Item selection MVC view with KnockoutJS

I am trying to implement a generic MVC view. The UI should display a list of available and selected items loading data (basically list of string) from server. User can make changes into the list i.e. can select new items from availa

How to not open multiple windows in WPF

In my WPF application I use this code to open a new windows from a button:private void LoginBtn_Click(object sender, RoutedEventArgs e){ LoginDialog dialog = new LoginDialog(); dialog.Show(); }But when there is already a LoginDialo

Change HTML Post parameter on Submit

I have 1 form, with 2 Submit buttons.When I click one button, I want certain values to be posted. When I click other button I want other values to be posted.This is what I tried, did not work:

Extract table row data with button on that row with jQuery each()

TLDRI want my script below to return the

spork: command not found

I've just installed spork via adding the version to the gemfile and running bundle install. When I gem list I can see spork (0.8.4) so the gem is installed. Im still tyring to configure spork, so when I type spork --bootstrap or spork -v to

Check all checkboxes inside an iframe (when inviting guests to a facebook event)

i'm trying to check all checkboxes when inviting guests to a facebook event. Facebook has changed something i think beacuse i usually used this code and now it is not working:var elms=document.getElementsByName(checkableitems[]);var lunghez

Pygame Line of Sight from Fixed Position

I am currently working on a 2D game in which the player has to sneak up on a still person within a certain amount of time. There are various crates in the way (depending on which level it is), and I would like to make it so that the player

WIA scanning in a WPF application

I'm using WIA 2.0 to scan images from a HP scanner. The problem is that saved TIFFs are around 9MBs big (A4 page at 300dpi, grayscale). I convert WIA's ImageFile that contains scan in TIFF format to BitmapSource like this: public static

Dragging inside div - Firefox issue

Greetings,I've run into a problem with a simple jQuery mousemove function:When I click and drag inside a div, sometimes the browser will attempt to drag the div like it is an image. This only exhibits in Firefox (tested version 4.0), and is

Python ctypes: pass argument by reference error

I have a C++ function that I want you call in Python 2.7.12, looking like this:extern C { double* myfunction(double* &y, double* &z, int &n_y, int &n_z, int a, int b) { vector _x; vector _y; vector

Child records not posting on ASP.NET MVC form

I have two tables, Author and Book, where an author can have many books. I've got an edit view set up as System.Web.Mvc.ViewPage(of MyDatabase.Author). The form is set up to show the Author and all his books, with the ability to edit book i

Handle result when dynamic SQL is in a loop

I have a bunch of table that have a stat column (stat for status ;-)I would like the count of each stats, and see it!My tables look like thiscreate table a ( a_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), a_stat status_t);create tabl

 1892    1 2 3 4 5 6 7 8 9 10 下一页 尾页