Search Results

Search found 2232 results on 90 pages for 'matt king'.

Page 12/90 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Programmatically Creating fieldset, ol/ul and li tags in ASP.Net, C#

    - by Matt
    Hi, I need to write an ASP.Net form which will produce the following HTML: <fieldset> <legend>Contact Details</legend> <ol> <li> <label for="name">Name:</label> <input id="name" name="name" class="text" type="text" /> </li> <li> <label for="email">Email address:</label> <input id="email" name="email" class="text" type="text" /> </li> <li> <label for="phone">Telephone:</label> <input id="phone" name="phone" class="text" type="text" /> </li> </ol> </fieldset> However, the fields which are to be added to the form will be determined at runtime, so I need to create the fieldset at runtime and add an ordered list and listitems to it, with labels, textboxes, checkboxes etc as appropriate. I can’t find standard ASP.Net objects which will create these tags. For instance, I’d like to do something like the following in C#: FieldSet myFieldSet = new FieldSet(); myFieldSet.Legend = “Contact Details”; OrderedList myOrderedList = new OrderedList(); ListItem listItem1 = new ListItem(); ListItem listItem2 = new ListItem(); ListItem listItem3 = new ListItem(); // code here which would add labels and textboxes to the ListItems myOrderedList.Controls.Add(listItem1); myOrderedList.Controls.Add(listItem2); myOrderedList.Controls.Add(listItem3); myFieldSet.Controls.Add(myOrderedList); Form1.Controls.Add(myFieldSet); Are there any standard ASP.Net objects which can produce this, or is there some other way of achieving the same result? Matt

    Read the article

  • Use of clone() and appendTo() with draggable - unexpected results with dragging

    - by Matt Gutting
    I'm constructing a UI for a doctor scheduling app. We have several doctors, each of whom can go in one of several locations on a scheduled day (M - F). I have the main day/location grid (table) in the center of the screen. At the left is a table for the doctor names. On loading, each table cell contains a span (outlined) with the doctor name. The doctor name can go in one slot for each day. I didn't want to just put 5 copies of the doctor name, because the doctor might not be available all 5 days of the week. The idea was: Drag the span and drop into the calendar table. On the drag "start" event, clone the span and append it to the table cell. Now there is another span ready to be dropped into the calendar table. One line of code does the work: $(ui.helper).clone(true).prependTo(ui.helper.parent()); This works. But when I move the cloned span, the original one moves in sync - preserving the spatial relationships as I move the clone around (no doubt there's a "position:relative;left=XX;top=YY" inserted somewhere). I'm sure there's a way to do what I'm thinking of, while keeping the two spans independent. But I'm not thinking of one. Does anyone have an idea? Thanks! Matt I posted this identical question to the jQuery forum as well.

    Read the article

  • Pulling info from database and dynamically adding them into different divs

    - by Matt Nathanson
    This may be a bit of a php n00b question but i've managed to get it working this far and I'm a little bit stuck. I'm pulling 12 images with descriptions out of a database. I want to insert them into a client rotator that has 3 sets of 4. They will be contained in divs called clientrotate1, clientrotate2, and clientrotate3 respectively. Inside each of those divs I want to have 4 images with classes thumb1, thumb2, thumb3, and thumb4 I am successful in having the images and descriptions pull into clientrotator 1. Where I get stuck is to how to dynamically add the 2nd and 3rd set of data into clientrotator2 and clientrotator3. Here is my function: public function DisplayClientRotator(){ $result = mysql_query( 'SELECT * FROM project ORDER BY id DESC LIMIT 12' ) or die("SELECT Error: ".mysql_error()); $iterator = 1; while ($row = mysql_fetch_assoc($result)) { echo "<div id='clientrotate1'>"; echo "<div class='thumb$iterator'>"; echo "<img style='width: 172px; height: 100px;' src=".$row['photo']." />"; echo "<div class='transbox'>"; echo "<div class='thumbtext'>"; echo $row['campaign']; echo "</div>"; echo "</div>"; echo "</div>"; echo "</div>"; $iterator++; } Any help or pointers int he right direction would be greatly appreciated! Thanks so much, Matt

    Read the article

  • Parse XML function names and call within whole assembly

    - by Matt Clarkson
    Hello all, I have written an application that unit tests our hardware via a internet browser. I have command classes in the assembly that are a wrapper around individual web browser actions such as ticking a checkbox, selecting from a dropdown box as such: BasicConfigurationCommands EventConfigurationCommands StabilizationCommands and a set of test classes, that use the command classes to perform scripted tests: ConfigurationTests StabilizationTests These are then invoked via the GUI to run prescripted tests by our QA team. However, as the firmware is changed quite quickly between the releases it would be great if a developer could write an XML file that could invoke either the tests or the commands: <?xml version="1.0" encoding="UTF-8" ?> <testsuite> <StabilizationTests> <StressTest repetition="10" /> </StabilizationTests> <BasicConfigurationCommands> <SelectConfig number="2" /> <ChangeConfigProperties name="Weeeeee" timeOut="15000" delay="1000"/> <ApplyConfig /> </BasicConfigurationCommands> </testsuite> I have been looking at the System.Reflection class and have seen examples using GetMethod and then Invoke. This requires me to create the class object at compile time and I would like to do all of this at runtime. I would need to scan the whole assembly for the class name and then scan for the method within the class. This seems a large solution, so any information pointing me (and future readers of this post) towards an answer would be great! Thanks for reading, Matt

    Read the article

  • What harm can javascript do?

    - by The King
    I just happen to read the joel's blog here... So for example if you have a web page that says “What is your name?” with an edit box and then submitting that page takes you to another page that says, Hello, Elmer! (assuming the user’s name is Elmer), well, that’s a security vulnerability, because the user could type in all kinds of weird HTML and JavaScript instead of “Elmer” and their weird JavaScript could do narsty things, and now those narsty things appear to come from you, so for example they can read cookies that you put there and forward them on to Dr. Evil’s evil site. Since javascript runs on client end. All it can access or do is only on the client end. It can read informations stored in hidden fields and change them. It can read, write or manipulate cookies... But I feel, these informations are anyway available to him. (if he is smart enough to pass javascript in a textbox. So we are not empowering him with new information or providing him undue access to our server... Just curious to know whether I miss something. Can you list the things that a malicious user can do with this security hole. Edit : Thanks to all for enlightening . As kizzx2 pointed out in one of the comments... I was overlooking the fact that a JavaScript written by User A may get executed in the browser of User B under numerous circumstances, in which case it becomes a great risk.

    Read the article

  • Testing Shake events on Android Emulator

    - by mob-king
    Can any one help with how to test sensor events like shake on Android Emulator. I have found some posts pointing to openintents but can anyone explain how to use it in android 2.0 avd http://code.google.com/p/openintents/wiki/SensorSimulator This has some solution but while installing OpenIntents.apk on emulator gives missing library error.

    Read the article

  • .net Class "is not a member of" Class .. even though it is?

    - by Matt Thrower
    Hi, Looking over some older code, I've run into a strange namespace error. Let's say I have two projects, HelperProject and WebProject. The full namespace of each - as given in application properties - is myEmployer.HelperProject and myEmployer.Web.WebProject. The pages in the web project are full of statements that use classes from the helper project. There are no imports/using statements but there is a reference to the helper project added in the bin. A few example lines might be: myEmployer.HelperProject.StringHelper.GetFixedLengthText(Text, "", Me.Width, 11) myEmploter.HelperProject.Utils.StringHelper.EstimatePixelLength(Text, 11) However every line that is written in this manner is throwing the error 'HelperProject' is not a member of 'myEmployer'. If you declare the statements like this: HelperProject.StringHelper.GetFixedLengthText(Text, "", Me.Width, 11) HelperProject.Utils.StringHelper.EstimatePixelLength(Text, 11) Everything seems fine. In the solution object browser and the bin folder, HelperProject appears with its full namespace, myEmployer.HelperProject. I don't want to have to change all the statements, and besides I suspect this is masking a more fundamental problem here. But I have no idea what's going on. Can anyone offer any pointers please? Cheers, Matt

    Read the article

  • With regards to urllib AttributeError: 'module' object has no attribute 'urlopen'

    - by Matt
    import re import string import shutil import os import os.path import time import datetime import math import urllib from array import array import random filehandle = urllib.urlopen('http://www.google.com/') #open webpage s = filehandle.read() #read print s #display #what i plan to do with it once i get the first part working #results = re.findall('[<td style="font-weight:bold;" nowrap>$][0-9][0-9][0-9][.][0-9][0-9][</td></tr></tfoot></table>]',s) #earnings = '$ ' #for money in results: #earnings = earnings + money[1]+money[2]+money[3]+'.'+money[5]+money[6] #print earnings #raw_input() this is the code that i have so far. now i have looked at all the other forums that give solutions such as the name of the script, which is parse_Money.py, and i have tried doing it with urllib.request.urlopen AND i have tried running it on python 2.5, 2.6, and 2.7. If anybody has any suggestions it would be really welcome, thanks everyone!! --Matt ---EDIT--- I also tried this code and it worked, so im thinking its some kind of syntax error, so if anybody with a sharp eye can point it out, i would be very appreciative. import shutil import os import os.path import time import datetime import math import urllib from array import array import random b = 3 #find URL URL = raw_input('Type the URL you would like to read from[Example: http://www.google.com/] :') while b == 3: #get file name file1 = raw_input('Enter a file name for the downloaded code:') filepath = file1 + '.txt' if os.path.isfile(filepath): print 'File already exists' b = 3 else: print 'Filename accepted' b = 4 file_path = filepath #open file FileWrite = open(file_path, 'a') #acces URL filehandle = urllib.urlopen(URL) #display souce code for lines in filehandle.readlines(): FileWrite.write(lines) print lines print 'The above has been saved in both a text and html file' #close files filehandle.close() FileWrite.close()

    Read the article

  • UI Design, incase of numerous situations

    - by The King
    Hi... I'm creating a web form, where in there are around 12-15 Input Fields... You can have a look at the screen and The request is such that depending on the data the user selects in the Gridview and the DropDown list, the appropriate Textboxes and CheckBoxes needs to be displayed. Some times the conditions are very direct, like when the DDL value is "ABC", get only paid amount from the user. Sometime they are so complex like... IF DDL is "DEF" and Selected GPMS value is between 1000-2000, calculate the values of allowed, paid etc (using some formula) and the focus should be directed to Page No Field, leaving the other fields open incase user wants to edit... There are around 10-15 conditions like this. As this was done through agile, conditions were being added as and when, and wherever it feels appropriate (DDL on change Event, GridView on selecting change event etc... etc..) After completion, now I see the code has become a big chuck, is growing unmanageably... Now, I'm planning to clear this... From you experience, what you think is the best way to handle this. There is a possibility to add more conditions like this in future... Please let me know, incase you need more information. I'm currently developing this app in C# .Net WindowsForms Edit: Currently there are only three items (The Datagrid, the DDL, the OverrideAmt CheckBox) that change the way other fields behave... Almost all of the conditions will fall between the two situations I mentioned... Mostly they belong to "Enabling/Disabling".. "Setting of Values"... and "Changing Focus" or any combination of these.

    Read the article

  • WCF service with PHP client - complex type as parameter not working

    - by Matt F
    Hi, I have a WCF service with three methods. Two of the methods return custom types (these work as expected), and the third method takes a custom type as a parameter and returns a boolean. When calling the third method via a PHP soap client it returns an 'Object reference not set to an instance of an object' exception. Example Custom Type: _ Public Class MyClass Private _propertyA As Double <DataMember()> _ Public Property PropertyA() As Double Get Return _propertyA End Get Set(ByVal value As Double) _propertyA = value End Set End Property Private _propertyB As Double <DataMember()> _ Public Property PropertyB() As Double Get Return _propertyB End Get Set(ByVal value As Double) _propertyB = value End Set End Property Private _propertyC As Date <DataMember()> _ Public Property PropertyC() As Date Get Return _propertyC End Get Set(ByVal value As Date) _propertyC = value End Set End Property End Class Method: Public Function Add(ByVal param As MyClass) As Boolean Implements IService1.Add ' ... End Function PHP client call: $client-Add(array('param'=array( 'PropertyA' = 1, 'PropertyB' = 2, 'PropertyC' = "2009-01-01" ))); The WCF service works fine with a .Net client but I'm new to PHP and can't get this to work. Is it possible to create an instance of 'MyClass' in PHP. Any help would be appreciated. Note: I'm using PHP 5 (XAMPP 1.7.0 for Windows). Thanks Matt

    Read the article

  • What is natural deduction used for outside of academia?

    - by Danny King
    Hello, I am studying natural deduction as a part of my Formal Specification & Verification Computer Science course at University/College. I find it interesting, however I learn much better when I can find a practical use for things. Could anyone explain to me if and how natural deduction is used other than for formally verifying bits of code? Thanks!

    Read the article

  • Error in glmmadmb(.....) The function maximizer failed (couldn't find STD file)

    - by Joe King
    This works fine: fit.mc1 <-MCMCglmm(bull~1,random=~school,data=dt1,family="categorical", prior=list(R=list(V=1, fix=1), G=list(G1=list(V=1, nu=0))), slice=T) So does this: fit.glmer <- glmer(bull~(1|school),data=dt1,family=binomial) But now I am trying to work with the package glmmadmb and this does not work: fit.mc12 <- glmmadmb(bull~1+(1|school), data=dt1, family="binomial", mcmc=TRUE, mcmc.opts=mcmcControl(mcmc=50000)) It generates the error: Error in glmmadmb(bull~ 1 + (1 | school), data = dt1, family = "binomial", : The function maximizer failed (couldn't find STD file) In addition: Warning message: running command '<snip>\cmd.exe <snip>\glmmadmb.exe" -maxfn 500 -maxph 5 -noinit -shess -mcmc 5000 -mcsave 5 -mcmult 1' had status 1

    Read the article

  • Handle order dependence in loops

    - by Matt
    Hey all, I'm making a templating system where I instantiate each tag using a foreach loop. The issue is that some of the tags rely on each other so, I'm wondering how to get around that ordering from the looping. Here's an example: Class A { public $width; __construct() { $this->width = $B->width; // Undefined! Or atleast not set yet.. } } Class B { public $width; __construct() { $this->width = "500px"; } __tostring() { return "Hello World!"; } } Template.php $tags = array("A", "B"); foreach ($tags as $tag) { $TagObj[$tag] = new $tag(); } echo $TagObj['A']->width; // Nadamundo! EDIT: Ok just to clarify.. My main problem is that Class A relies on Class B, but class A is instantiated before class B, so therefore width has not yet been defined in class B. I am looking for a good way to make sure all the classes are loaded for everyone allowing the interdependencies to exist. For the future, please don't consider any syntax errors.. I just made up this example on the spot. Also assume that I have access to class B from class A after class B gets instantiated. I know this has applications elsewhere and I'm sure this has been solved before, if someone could enlighten me or point me in the right direction that'd be great! Thanks! Matt Mueler

    Read the article

  • Java "compare cannot be resolved to a type" error

    - by King Triumph
    I'm getting a strange error when attempting to use a comparator with a binary search on an array. The error states that "compareArtist cannot be resolved to a type" and is thrown by Eclipse on this code: Comparator<Song> compare = new Song.compareArtist(); I've done some searching and found references to a possible bug with Eclipse, although I have tried the code on a different computer and the error persists. I've also found similar issues regarding the capitalization of the compare method, in this case compareArtist. I've seen examples where the first word in the method name is capitalized, although it was my understanding that method names are traditionally started with a lower case letter. I have experimented with changing the capitalization but nothing has changed. I have also found references to this error if the class doesn't import the correct package. I have imported java.util in both classes in question, which to my knowledge allows the use of the Comparator. I've experimented with writing the compareArtist method within the class that has the binary search call as well as in the "Song" class, which according to my homework assignment is where it should be. I've changed the constructor accordingly and the issue persists. Lastly, I've attempted to override the Comparator compare method by implementing Comparator in the Song class and creating my own method called "compare". This returns the same error. I've only moved to calling the comparator method something different than "compare" after finding several examples that do the same. Here is the relevant code for the class that calls the binary search that uses the comparator. This code also has a local version of the compareArtist method. While it is not being called currently, the code for this method is the same as the in the class Song, where I am trying to call it from. Thanks for any advice and insight. import java.io.*; import java.util.*; public class SearchByArtistPrefix { private Song[] songs; // keep a direct reference to the song array private Song[] searchResults; // holds the results of the search private ArrayList<Song> searchList = new ArrayList<Song>(); // hold results of search while being populated. Converted to searchResults array. public SearchByArtistPrefix(SongCollection sc) { songs = sc.getAllSongs(); } public int compareArtist (Song firstSong, Song secondSong) { return firstSong.getArtist().compareTo(secondSong.getArtist()); } public Song[] search(String artistPrefix) { String artistInput = artistPrefix; int searchLength = artistInput.length(); Song searchSong = new Song(artistInput, "", ""); Comparator<Song> compare = new Song.compareArtist(); int search = Arrays.binarySearch(songs, searchSong, compare);

    Read the article

  • Unable to use stored procs in a generic repository for the entity framework. (ASP.NET MVC 2)

    - by Matt
    Hi, I have a generic repository that uses the entity framework to manipulate the database. The original code is credited to Morshed Anwar's post on CodeProject. I've taken his code and modified is slightly to fit my needs. Unfortunately I'm unable to call an Imported Function because the function is only recognized for my specific instance of the entity framework public class Repository<E, C> : IRepository<E, C>, IDisposable where E : EntityObject where C : ObjectContext { private readonly C _ctx; public ObjectResult<MyObject> CallFunction() { // This does not work because "CallSomeImportedFunction" only works on // My object. I also cannot cast it (TrackItDBEntities)_ctx.CallSomeImportedFunction(); // Not really sure why though... but either way that kind of ruins the genericness off it. return _ctx.CallSomeImportedFunction(); } } Anyone know how I can make this work with the repository I already have? Or does anyone know a generic way of calling stored procedures with entity framework? Thanks, Matt

    Read the article

  • Java array assignment (multiple values)

    - by Danny King
    Hello, I have a Java array defined already e.g. float[] values = new float[3]; I would like to do something like this further on in the code: values = {0.1f, 0.2f, 0.3f}; But that gives me a compile error. Is there a nicer way to define multiple values at once, rather than doing this?: values[0] = 0.1f; values[1] = 0.2f; values[2] = 0.3f; Thanks!

    Read the article

  • Regular expression of unicode characters on string

    - by Marcus King
    I'm working in c# doing some OCR work and have extracted the text I need to work with. Now I need to parse a line using Regular Expressions. string checkNum; string routingNum; string accountNum; Regex regEx = new Regex(@"\u9288\d+\u9288"); Match match = regEx.Match(numbers); if (match.Success) checkNum = match.Value.Remove(0, 1).Remove(match.Value.Length - 1, 1); regEx = new Regex(@"\u9286\d{9}\u9286"); match = regEx.Match(numbers); if(match.Success) routingNum = match.Value.Remove(0, 1).Remove(match.Value.Length - 1, 1); regEx = new Regex(@"\d{10}\u9288"); match = regEx.Match(numbers); if (match.Success) accountNum = match.Value.Remove(match.Value.Length - 1, 1); The problem is that the string contains the necessary unicode characters when I do a .ToCharArray() and inspect the contents of the string, but it never seems to recognize the unicode characters when I parse the string looking for them. I thought strings in C# were unicode by default.

    Read the article

  • Php index page utitlizing an idea for a superswitch...

    - by Matt
    I dont know if this is a great idea...or a crap one. But I was thinking I may use one page to display all my pages using includes. Here is what my index.php would look like...on the functions include there is a function called "superSwitch" which will determine what requested page will be included....for instance if I do a get ?a=a it will goto the function superSwitch(a) superSwitch will take it and associate it with (login.php) then respond with such... here is the code for the index.php...please let me know if this makes sense and might work, or should I just stick to long blocks of code (which is why I am trying this because I hate long pages full of code...) of course as you can tell it is not actually including anything yet...the print is for debugging purposes. :) Thanks, Matt <?php //includes Functions include_once('inc/func.inc.php'); //set superget variable $superget = @$_GET['a']; //check if superget is set or null if (!$superget) { echo "Nothing Requested :)"; } else { //sanitizes the superget request $supergetr = supergetSanitize($superget) //uses the result "good" or "nogood" to determine what happens if ( $supergetr == "good" ) { //pulls superSwitch value of the request $ssresult = superSwitch($superget); print_r ($ssresult); } //if the sanitize is nogood else { //the superSwitch is instructed to respond with a 404 page $superget = "404" $ssresult = superSwitch($superget); print_r ($ssresult); } } ?>

    Read the article

  • Resolve php "deadlock"

    - by Matt
    Hey all, I'm currently running into a situation that I guess would be called deadlock. I'm implementing a message service that calls various object methods.. it's quite similar to observer pattern.. Here's whats going on: Dispatcher.php Dispatcher.php <? class Dispatcher { ... public function message($name, $method) { // Find the object based on the name $object = $this->findObjectByName($name); // Slight psuedocode.. for ease of example if($this->not_initialized($object)) $object = new $object(); // This is where it locks up. } return $object->$method(); ... } class A { function __construct() { $Dispatcher->message("B", "getName"); } public function getName() { return "Class A"; } } class B { function __construct() { // Assume $Dispatcher is the classes $Dispatcher->message("A", "getName"); } public function getName() { return "Class B"; } } ?> It locks up when neither object is initialized. It just goes back and forth from message each other and no one can be initialized. Any help would be immensely helpful.. Thanks! Matt Mueller

    Read the article

  • When using Clipboard, Toolkit and Transferable, I get an error objecting to image width and height

    - by Mike King
    When I run the following code it triggers an error message. The error message is shown below the code. What code changes, or changes to the image file, are needed to fix this error? Help will be appreciated. import java.awt.*; import java.awt.datatransfer.*; public class LoadToClipboard { public static void main( String [] args ) { Toolkit tolkit = Toolkit.getDefaultToolkit(); Clipboard clip = tolkit.getSystemClipboard(); clip.setContents( new ImageSelection( tolkit.getImage("StackOverflowLogo.png")) , null ); } } class ImageSelection implements Transferable { private Image image; public ImageSelection(Image image) { this.image = image; } // Returns supported flavors public DataFlavor[] getTransferDataFlavors() { return new DataFlavor[]{DataFlavor.imageFlavor}; } // Returns true if flavor is supported public boolean isDataFlavorSupported(DataFlavor flavor) { return DataFlavor.imageFlavor.equals(flavor); } // Returns image public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException { if (!DataFlavor.imageFlavor.equals(flavor)) { throw new UnsupportedFlavorException(flavor); } return image; } } Exception in thread "main" java.lang.IllegalArgumentException: Width (-1) and height (-1) cannot be <= 0 at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999) at sun.awt.datatransfer.DataTransferer.imageToStandardBytes(DataTransferer.java:1994) at sun.awt.windows.WDataTransferer.imageToPlatformBytes(WDataTransferer.java:267) at sun.awt.datatransfer.DataTransferer.translateTransferable(DataTransferer.java:1123) at sun.awt.windows.WDataTransferer.translateTransferable(WDataTransferer.java:163) at sun.awt.windows.WClipboard.setContentsNative(WClipboard.java:73) at sun.awt.datatransfer.SunClipboard.setContents(SunClipboard.java:93) at automateSignature.LoadToClipboard.main(LoadToClipboard.java:8) I have tried to find a place in the code where width and height can be specified, but have not succeeded. I also examined the properties of the jpg file and the w and h are specified.enter code here

    Read the article

  • Resolve php endless recursion issue

    - by Matt
    Hey all, I'm currently running into an endless recursion situation. I'm implementing a message service that calls various object methods.. it's quite similar to observer pattern.. Here's whats going on: Dispatcher.php class Dispatcher { ... public function message($name, $method) { // Find the object based on the name $object = $this->findObjectByName($name); // Slight psuedocode.. for ease of example if($this->not_initialized($object)) $object = new $object(); // This is where it locks up. } return $object->$method(); ... } class A { function __construct() { $Dispatcher->message("B", "getName"); } public function getName() { return "Class A"; } } class B { function __construct() { // Assume $Dispatcher is the classes $Dispatcher->message("A", "getName"); } public function getName() { return "Class B"; } } It locks up when neither object is initialized. It just goes back and forth from message each other and no one can be initialized. I'm looking for some kind of queue implementation that will make messages wait for each other.. One where the return values still get set. I'm looking to have as little boilerplate code in class A and class B as possible Any help would be immensely helpful.. Thanks! Matt Mueller

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >