Search Results

Search found 77 results on 4 pages for 'jimbo'.

Page 2/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Sorting an array in PHP based on different values

    - by Jimbo
    I have an array whose elements are name, reversed_name, first_initial and second_initial. A typical row is "Aaron Smith", "Smith, Aaron", "a", "s". Each row in the array has a first_initial or second_initial value of "a". I need to display the rows alphabetically but based on the "a" part, so that either the name or reversed_name will be displayed. An example output would be: Aaron Smith Abbot, Paul Adrian Jones Anita Thompson Atherton, Susan I really have no idea how to sort the array this way so any help will be much appreciated!

    Read the article

  • Putting Images Inside a BUTTON Element (HTML & CSS)

    - by Jimbo
    I have a simple button (as shown below) on which I need to display two pictures, one on either side of the button text. Im battling to create the CSS that will work in both Firefox and Internet Explorer! (the button images are coming from a JQuery UI skin file) CSS button div{ width:16px; height:16px; background-image: url(images/ui-icons_d19405_256x240.png); } button div.leftImage{ background-position: -96px -112px; float: left; } button div.rightImage{ background-position: -64px -16px; float: right; } HTML <button><div class="leftPic"></div><span>Button Text</span><div class="rightPic"></div></button>

    Read the article

  • Emacs shell output buffer height

    - by jimbo
    Hi , i have the following in my .emacs file(thanks to a SOer nikwin), which evaluates the current buffer content and displays the output in another buffer. (defun shell-compile () (interactive) (save-buffer) (shell-command (concat "python " (buffer-file-name)))) (add-hook 'python-mode-hook (lambda () (local-set-key (kbd "\C-c\C-c") 'shell-compile))) The problem is that the output window takes half the emacs screen. Is there any way to set the output windows's height to something smaller. I googled for 30mins or so and could not find anything that worked. Thanks in advance.

    Read the article

  • C# Get Type of IEnumerable<TModel>

    - by Jimbo
    I have a method to which I pass an IEnumerable<TModel>. Then depending on the type of TModel, the method carries out a set of instructions as below: public void MyMethod<TModel>(IEnumerable<TModel> items) where TModel : class { int operationType; switch (typeof(TModel)) { case typeof(MyModelOne): operationType = 1; break; case typeof(MyModelTwo): operationType = 2; break; case typeof(MyModelThree): operationType = 3; break; default: throw new Exception("The collection model passed to MyMethod is not recognized"); } ... } This doesnt work, I get the error: There is no application variable or memeber 'TModel'

    Read the article

  • Bring object to the front, in Flash AS3

    - by jimbo
    Hi All, i have the below code, which is basically animating object across the screen, when roll-over happens it pauses the anim, and displays some information. Everything works fine, but when its paused, i wold like that current object to be 'on top' so other items run behind. I have looked at setChildIndex, but didn't have much luck. package { import flash.display.MovieClip; import flash.display.Sprite; import flash.events.MouseEvent; import flash.geom.Point; import flash.events.KeyboardEvent; import flash.events.*; import caurina.transitions.Tweener; import fl.motion.Color; public class carpurchase extends Sprite { public function carpurchase() { var carX = 570; //Set cars var car1:fullCar = new fullCar(); car1.info.alpha = 0; //var c:Color = new Color(); //c.setTint(0xff0000, 0.8); //car2.car.transform.colorTransform=c; car1.x = carX; car1.y = 280; car1.info.title.text = "test"; car1.info.desc.text = "test"; addChild(car1); car1.addEventListener(MouseEvent.ROLL_OVER, carPause); car1.addEventListener(MouseEvent.ROLL_OUT, carContinue); function car1Reset():void { Tweener.addTween(car1, {x:carX, time:0, onComplete:car1Tween}); } function car1Tween():void { Tweener.addTween(car1, {x:-120, time:2, delay:3, transition:"linear", onComplete:car1Reset}); } car1Tween(); var car2:fullCar = new fullCar(); car2.info.alpha = 0; var c:Color = new Color(); c.setTint(0xff0000, 0.8); car2.car.transform.colorTransform=c; car1.x = carX; car2.y = 175; car2.info.title.text = "test"; car2.info.desc.text = "test"; addChild(car2); car2.addEventListener(MouseEvent.ROLL_OVER, carPause); car2.addEventListener(MouseEvent.ROLL_OUT, carContinue); function car2Reset():void { Tweener.addTween(car2, {x:carX, time:0, onComplete:car2Tween}); } function car2Tween():void { Tweener.addTween(car2, {x:-120, time:3, delay:0, transition:"linear", onComplete:car2Reset}); } car2Tween(); function carPause(e:MouseEvent):void { Tweener.pauseTweens(e.target); Tweener.addTween(e.target.info, {y:-150, alpha:1, time:.5, transition:"easeout"}); } function carContinue(e:MouseEvent):void { Tweener.addTween(e.target.info, {y:10, alpha:0, time:.5, transition:"easeout"}); Tweener.resumeTweens(e.target); } } } Any help welcome

    Read the article

  • Casting Between Data Types in C#

    - by Jimbo
    I have (for example) an object of type A that I want to be able to cast to type B (similar to how you can cast an int to a float) Data types A and B are my own. Is it possible to define the rules by which this casting occurs? Example int a = 1; float b = (float)a; int c = (int)b;

    Read the article

  • Best PHP timezone list

    - by jimbo
    I have looked over the PHP list of supported timezones, but the whole list is a little long to include in a drop-down menu, for the user to select his or her timezone. Is there a list with the main city/area on that can be used? My geography is terrible and add that to not knowing all the area and which timezone they fall into it could be a long day to construct the list my self! Thanks in advance

    Read the article

  • C# Event Handlers Using an Enum

    - by Jimbo
    I have a StatusChanged event that is raised by my object when its status changes - however, the application needs to carry out additional actions based on what the new status is. e.g If the new status is Disconnected, then it must update the status bar text and send an email notification. So, I wanted to create an Enum with the possible statuses (Connected, Disconnected, ReceivingData, SendingData etc.) and have that sent with the EventArgs parameter of the event when it is raised (see below) Define the object: class ModemComm { public event CommanderEventHandler ModemCommEvent; public delegate void CommanderEventHandler(object source, ModemCommEventArgs e); public void Connect() { ModemCommEvent(this, new ModemCommEventArgs ModemCommEventArgs.eModemCommEvent.Connected)); } } Define the new EventArgs parameter: public class ModemCommEventArgs : EventArgs{ public enum eModemCommEvent { Idle, Connected, Disconnected, SendingData, ReceivingData } public eModemCommEvent eventType { get; set; } public string eventMessage { get; set; } public ModemCommEventArgs(eModemCommEvent eventType, string eventMessage) { this.eventMessage = eventMessage; this.eventType = eventType; } } I then create a handler for the event in the application: ModemComm comm = new ModemComm(); comm.ModemCommEvent += OnModemCommEvent; and private void OnModemCommEvent(object source, ModemCommEventArgs e) { } The problem is, I get a 'Object reference not set to an instance of an object' error when the object attempts to raise the event. Hoping someone can explain in n00b terms why and how to fix it :)

    Read the article

  • Using Matlab to find maxima for data with a lot of noise

    - by jimbo
    I have noisy data set with three peaks in Matlab and want to do some image processing on it. The peaks are about 5-9 pixels wide at the base, in a 50 x 50 array. How do I locate the peaks? Matlab is very new to me. Here is what I have so far... For my original image, let's call it "array", I tried J = fspecial('gaussian',[5 5], 1.5); C = imfilter(array, J) peaks = imregionalmax(C); but there is still some noise along the baseline between the peaks so I end up getting a ton of local max that are really just noise values. (I tried playing with the size of the filter, but that didn't help.) I also tried peaks = imextendedmax(C,threshold); where the threshold was determined visually... which works but is definitely not a good way to do it since it's not that robust obviously. So, how do I locate these peaks in a robust way? Thanks.

    Read the article

  • Cancel a keystroke in jQuery

    - by Jimbo
    Is is possible (cross-browser compatible) to CANCEL a keystroke after a user has made it (for example on a textbox) The code I currently use edits the textbox value after the keystroke has been displayed: $('.number').keypress(function() { this.value = this.value.replace(/[^0-9\.]/g, ''); });

    Read the article

  • Selecting an item in an HTML SELECT list using keyboard doesnt trigger the CLICK event

    - by Jimbo
    I have an HTML select list which, when an item is selected, must show different information beneath it. The onclick or JQuery change events are triggered when a select list item is selected by being clicked on (mouse), but not when the user uses key presses (keyboard). Any idea what event to watch in order to determine when the selected list item has changed? Here is a BASIC test example: <select id="mylist" name="mylist"> <option value="">(none)</option> <option value="1">Test 1</option> <option value="2">Test 2</option> <option value="3">Test 3</option> </select> <span id="myspan"></span> <script type="text/javascript"> $("#mylist").change(function() { $("#myspan").html($("#mylist").attr("selectedIndex")); }); </script>

    Read the article

  • What type is System.Byte[*]

    - by Jimbo
    I'm being passed an object that returns "System.Byte[*]" when converted to string. This apparently isn't a standard one dimensional array of Byte objects ("System.Byte[]"), so what is it?

    Read the article

  • .NET 3.5 DataGridView Wont Save To Database

    - by Jimbo
    I have created a test Winforms application in Visual Studio 2008 (SP1) to see just how "RAD" C# and .NET 3.5 can be. So far I have mixed emotions. Added a service-based database to my application (MyDB.mdf) and added two tables - Contact (id [identity], name [varchar] and number [varchar] columns) and Group (id [identity] and name [varchar] columns) Added a DataSource, selected "Database" as the source, used the default connection string as the connection (which points to my database) and selected "All Tables" to be included in the data source and saved as MyDBDataSet Expanded the data source showing my two tables, selected the "Group" table and chose to display it as a DataGridView (from the dropdown option on the right of each entity) and dragged it onto Form1, thus creating a groupBindingNavigator, groupBindingSource, groupTableAdapter, tableAdapterManager, myDBDataset and groupDataGridView Press F5 to test the application, enter the name "Test" under the DataGridView's "name" column and click "Save" on the navigator which has autogenerated code to save the data that looks like this: private void groupBindingNavigatorSaveItem_Click(object sender, EventArgs e) { this.Validate(); this.groupBindingSource.EndEdit(); this.tableAdapterManager.UpdateAll(this.myDBDataSet); } Stop the application and have a look at the database data, you will see no data saved there in the "Group" table. I dont know why and cant find out how to fix it! Googled for about 30 minutes with no luck. The code is auto-generated with the controls, so you'd think that it would work too :)

    Read the article

  • An Erroneous SQL Query makes browser hang until script timeout exceeded

    - by Jimbo
    I have an admin page in a Classic ASP web application that allows the admin user to run queries against the database (SQL Server 2000) Whats really strange is that if the query you send has an error in it (an invalid table join, a column you've forgotten to group by etc) the BROWSER hangs (CPU usage goes to maximum) until the SERVER script timeout is exceeded and then spits out a timeout exceeded error (server and browser are on different machines, so not sure how this happens!) I have tried this in IE 8 and FF 3 with the same result. If you run that same query (with errors) directly from SQL Enterprise Manager, it returns the real error immediately. Is this a security feature? Does anyone know how to turn it off? It even happens when the connection to the database is using 'sa' credentials so I dont think its a security setting :( Dim oRS Set oRS = Server.CreateObject("ADODB.Recordset") oRS.ActiveConnection = sConnectionString // run the query - this is for the admin only so doesnt check for sql safe commands etc. oRS.Open Request.Form("txtSQL") If Not oRS.EOF Then // list the field names from the recordset For i = 0 to oRS.Fields.Count - 1 Response.Write oRS.Fields(i).name & "&nbsp;" Next // show the data for each record in the recordset While Not oRS.EOF For i = 0 to oRS.Fields.Count - 1 Response.Write oRS.Fields(i).value & "&nbsp;" Next Response.Write "<br />" oRS.Movenext() Wend End If

    Read the article

  • Sidebar Gadget to Login to website and retrieve information?

    - by Jimbo
    I've been learning how to make gadget and the simple gadgets all make sense. How would I make a Gadget that logs into a website and retrieve details for that user (so it's pretty much simulating the user logging in and showing basic information ?? (eg. like the facebook gadget that shows any messages, "pokes" . etc. etc. ....

    Read the article

  • Analyzing data for noisy arrays

    - by jimbo
    Using MATLAB I filtered a very noisy m x n array with a low-pass Gaussian filter, cleaned it up pretty well but still not well enough to analyze my data. What would the next step be? I'm thinking that signal enhancement, but am not sure how to go about this.

    Read the article

  • Sending time with timezone from PHP to flash

    - by jimbo
    I am trying to send the time to flash but set to the currently timezone. When you view the below even though the echo date, looks like its working the $time is the same. When i test in flash I get the extra hour added. Any help tips welcome on this one... $format = "d/m/Y H:m:s"; $timezone = "Europe/Amsterdam"; date_default_timezone_set($timezone); echo "<h1>Timezone ".$timezone."</h1>"; $date = date($format); echo "<h3>Date: ".$date."<h3>"; $time = strtotime($date); echo "<h3>Time: ".$time."<h3>"; $date2 = date($format, $time); echo "<h3>Reverse: ".$date2."<h3>"; $timezone = "Europe/London"; date_default_timezone_set($timezone); echo "<h1>Timezone ".$timezone."</h1>"; $date = date($format); echo "<h3>Date: ".$date."<h3>"; $time = strtotime($date); echo "<h3>Time: ".$time."<h3>"; $date2 = date($format, $time); echo "<h3>Reverse: ".$date2."<h3>"; ?>

    Read the article

  • C# Reflection Question

    - by Jimbo
    This is a scenario created to help understand what Im trying to achieve. I am trying to create a method that returns the specified property of a generic object e.g. public object getValue<TModel>(TModel item, string propertyName) where TModel : class{ PropertyInfo p = typeof(TModel).GetProperty(propertyName); return p.GetValue(item, null); } The code above works fine if you're looking for a property on the TModel item e.g. string customerName = getValue<Customer>(customer, "name"); However, if you want to find out what the customer's group's name is, it becomes a problem: e.g. string customerGroupName = getValue<Customer>(customer, "Group.name"); Hoping someone can give me some insight on this way out scenario - thanks.

    Read the article

  • Remember (persist) the filter, sort order and current page of jqGrid

    - by Jimbo
    My application users asked if it were possible for pages that contain a jqGrid to remember the filter, sort order and current page of the grid (because when they click a grid item to carry out a task and then go back to it they'd like it to be "as they left it") Cookies seem to be the way forward, but how to get the page to load these and set them in the grid before it makes its first data request is a little beyond me at this stage. Does anyone have any experience with this kind of thing with jqGrid? Thanks!

    Read the article

  • Flash AS3 for loop query

    - by jimbo
    I was hoping for a way that I could save on code by creating a loop for a few lines of code. Let me explain a little, with-out loop: icon1.button.iconLoad.load(new URLRequest("icons/icon1.jpg")); icon2.button.iconLoad.load(new URLRequest("icons/icon2.jpg")); icon3.button.iconLoad.load(new URLRequest("icons/icon3.jpg")); icon4.button.iconLoad.load(new URLRequest("icons/icon4.jpg")); etc... But with a loop could I have something like: for (var i:uint = 0; i < 4; i++) { icon+i+.button.iconLoad.load(new URLRequest("icons/icon"+i+"jpg")); } Any ideas welcome...

    Read the article

  • innerHTML within another tag

    - by jimbo
    Hi all, I have a link: <a id="nextBut" href="somelink" class="button"><span>Next Step</span></a> And I can control the the <span>Next step</span> part with innerHTML but how could I leave the <span> alone and just change the 'Next step' part? For example: var NextButJar = document.getElementById('nextBut'); NextButJar.disabled = true; NextButJar.style.opacity = .5; NextButJar.span.innerHTML = 'Read all tabs to continue'; I also have: NextButJar.onClick = handleClick; function handleClick(){ if (this.disabled == true) { alert("Please view all tabs first!"); return; } else { alert("allowed to run"); } }; Which I can't seem to get working either...

    Read the article

< Previous Page | 1 2 3 4  | Next Page >