Search Results

Search found 1666 results on 67 pages for 'andrew findlay'.

Page 43/67 | < Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >

  • Multiple Questions per page using Drupal Quiz

    - by Andrew
    I'm using the Drupal Quiz module, and have setup some basic quizzes and stuff like that. However some further customization is required, involving more than 1 question per page, and a multi-type answer in this type of format: Question 1: Describe 4 things you did last summer a) [ short answer space - text field ] b) "I wept" c) "My whole family died so I learned self reliance" d) "I got another xbox" Question 2: Describe 2 things you hate about yourself a) "My arms are way shorter than my legs" b) "I was born without human emotion" So I guess in two parts, how to show multiple questions per page, and then how to allow multiple text fields for answers. Oh and this quiz is not graded, it's like a self assessment. Thanks!

    Read the article

  • remote_addr problem

    - by Andrew Kolvik
    I am using xampp on localhost and when I use _SERVER["REMOTE_ADDR"] it returns ::1 (also does this in phpinfo()). Why does it do this? I want it to return a normal ip address like 127.0.0.1. My operating system is windows vista.

    Read the article

  • Finding spelling of an element in an ignore case dictionary

    - by Andrew White
    Hi, Weird question, but I have a dictionary created with StringComparer.OrdinalIgnoreCase, looks something like this AaA, 10 aAB, 20 AAC, 12 I then use myDictionary["AAA"] to find the value associated with the key, but what I also need to know is what the actual spelling of the key is in myDictionary, e.g. in this case I want it to return AaA. Any way to do this without a loop? Thx.

    Read the article

  • Adding additional components to a web page after rendering by Wicket

    - by Andrew Fielden
    I have a requirement to create a web page using Wicket 1.5, which can present a variable number of panels to capture user input. All the panels have the same structure. The page would start off with one panel, and includes a button to dynamically add more as required. So the number of panels is unknown at the time the page is initially rendered. Effectively I'd be altering the structure of the page dynamically. This is possible in Javascript, using document.addElement() I've done a similar thing in the past by creating all the components on page load, and selectively showing/hiding components. The difference here is that the number of components (panels) is initially unknown. I'm unsure as to how this would be achieved with Wicket.

    Read the article

  • how to determine if a character vector is a valid numeric or integer vector

    - by Andrew Barr
    I am trying to turn a nested list structure into a dataframe. The list looks similar to the following (it is serialized data from parsed JSON read in using the httr package). myList <- list(object1 = list(w=1, x=list(y=0.1, z="cat")), object2 = list(w=2, x=list(y=0.2, z="dog"))) unlist(myList) does a great job of recursively flattening the list, and I can then use lapply to flatten all the objects nicely. flatList <- lapply(myList, FUN= function(object) {return(as.data.frame(rbind(unlist(object))))}) And finally, I can button it up using plyr::rbind.fill myDF <- do.call(plyr::rbind.fill, flatList) str(myDF) #'data.frame': 2 obs. of 3 variables: #$ w : Factor w/ 2 levels "1","2": 1 2 #$ x.y: Factor w/ 2 levels "0.1","0.2": 1 2 #$ x.z: Factor w/ 2 levels "cat","dog": 1 2 The problem is that w and x.y are now being interpreted as character vectors, which by default get parsed as factors in the dataframe. I believe that unlist() is the culprit, but I can't figure out another way to recursively flatten the list structure. A workaround would be to post-process the dataframe, and assign data types then. What is the best way to determine if a vector is a valid numeric or integer vector?

    Read the article

  • Django QuerySet ordering by expression

    - by Andrew
    How can i use order_by like order_by('field1'*'field2') For example i have items with price listed in different currencies, so to order items - i have to make currency conversion. class Currency(models.Model): code = models.CharField(max_length=3, primary_key=True) rateToUSD = models.DecimalField(max_digits=20,decimal_places=10) class Item(models.Model): priceRT = models.DecimalField(max_digits=15, decimal_places=2, default=0) cur = models.ForeignKey(Currency) I would like to have something like: Item.objects.all().order_by(F('priceRT')*F('cur__rateToUSD')) But unfortunately it doesnt work, i also faild with annotate. How can i permorm QuerySet ordering by result of value multiplication of 2 model's fields.

    Read the article

  • Can't correctly stream x264 video to mobile via RTSP

    - by Andrew
    Hello! I'm trying to stream video compressed with x264 and NeroAAC and hinted with MP4Box. When i'm playing it with VLC player streaming works fine, as expected. When i'm trying to open URL with my HTC Hero, it switches to player mode, then starts "loading video" animation, then after some time it shows "unable to connect to server". Sample movies provided with DSS streamed fine regardless bitrate. I tried few encoding options, but always the same result. I suspect nocabac and level=11 but it didn't changed nothing. Is there some more specific encoding options for such type? Thank You!

    Read the article

  • How to handle concurrency control in dynamic data?

    - by Andrew
    I've been quite impressed with dynamic data and how easy and quick it is to get a simple site up and running. I'm planning on using it for a simple internal HR admin site for registering people's skills/degrees/etc. I've been watching the intro videos at www.asp.net/dynamicdata and one thing they never mention is how to handle concurrency control. It seems that DD does not handle it right out of the box (unless there is some setting I haven't seen) as I manually generated a change conflict exception and the app failed without any user friendly message. Anybody know if DD handles it out of the box? Or do you have to somehow build it into the site?

    Read the article

  • Monitor resolution changes look of website

    - by Andrew
    I have a website that looks fine in my resolution and even in the more common 1024 x 768. Yet, in someone else's browser in 1024 x 768, it's too wide and the website doesn't even center correctly. Is there a way to have a proper width layout that doesn't change when the resolution is changed?

    Read the article

  • Incremement Page Hit Count in Django

    - by Andrew C
    I have a table with an IntegerField (hit_count), and when a page is visited (ie. http://site/page/3) I want record id 3 'hit_count' column in the database to increment by 1. The query should be like: update table set hit_count = hit_count + 1 where id=3 Can I do this with the standard Django Model conventions? Or should I just write the query by hand? I'm starting a new project, so I am trying to avoid hacks. We'll see how long this lasts! Thanks!

    Read the article

  • MySQL GROUP_CONCAT + IN() = missing data :-(

    - by Andrew Heath
    Example: Table: box boxID color 01 red 02 blue 03 green Table: boxHas boxID has 01 apple 01 pear 01 grapes 01 banana 02 lime 02 apple 02 pear 03 chihuahua 03 nachos 03 baby crocodile I want to query on the contents of each box, and return a table with each ID, color, and a column that concatenates the contents of each box, so I use: SELECT box.boxID, box.color, GROUP_CONCAT(DISTINCT boxHas.has SEPARATOR ", ") AS contents FROM box LEFT JOIN boxHas ON box.boxID=boxHas.boxID WHERE boxHas.has IN ('apple','pear') GROUP BY box.boxID ORDER BY box.boxID and I get the following table of results: boxID color contents 01 red apple, pear 02 blue apple, pear My question to you is: why isn't it listing ALL the has values in the contents column? Why is my WHERE statement also cropping my GROUP_CONCAT? The table I thought I was going to get is: boxID color contents 01 red apple, banana, grapes, pear 02 blue apple, lime, pear Although I want to limit my boxID results based upon the WHERE statement, I do not want to limit the contents field for valid boxes. :-/ Help?

    Read the article

  • Easy way to parse a url in C++ cross platform?

    - by Andrew Bucknell
    I need to parse a url to get the protocol host path and query in an application I am writing in c++. The application is intended to be cross platform. Im surprised I cant find anything that does this in boost or poco libraries. Is it somewhere obvious Im not looking? Any suggestions on appropriate open source libs? Or is this something I just have to do my self? Its not super complicated but it seems such a common task I am surprised there isnt a common solution.

    Read the article

  • P/Invoke a Function Passed a StringBuilder

    - by andrew
    in a C# file i have a class Archiver { [DllImport("Archiver.dll")] public static extern void archive(string data, StringBuilder response); } string data is an input, and StringBuilder response is where the function writes something the archive function prototype (written in C) looks like this: void archive(char * dataChr, char * outChr); and it receives a string in dataChr, and then does a strcpy(outChr,"some big text"); from C# i call it something like this: string message = "some text here"; StringBuilder response = new StringBuilder(10000); Archiver.archive(message,response); this works, but the problem, as you might see is that i give a value to the StringBuilder size, but the archive function might give back a (way) larger text than the size i've given to my StringBuilder. any way to fix this?

    Read the article

  • Doing a join across two databases with different collations on SQL Server and getting an error.

    - by Andrew G. Johnson
    I know, I know with what I wrote in the question I shouldn't be surprised. But my situation is slowly working on an inherited POS system and my predecessor apparently wasn't aware of JOINs so when I looked into one of the internal pages that loads for 60 seconds I see that it's a fairly quick, rewrite these 8 queries as one query with JOINs situation. Problem is that besides not knowing about JOINs he also seems to have had a fetish for multiple databases and surprise, surprise they use different collations. Fact of the matter is we use all "normal" latin characters that English speaking people would consider the entire alphabet and this whole thing will be out of use in a few months so a bandaid is all I need. Long story short is I need some kind of method to cast to a single collation so I can compare two fields from two databases. Exact error is: Cannot resolve the collation conflict between "SQL_Latin1_General_CP850_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.

    Read the article

  • Logical equality in C

    - by andrew cooke
    [It seems odd this doesn't exist, so apologies in advance if it's a duplicate] I want to test for logical equality in C. In other words, I want to know whether two values would be equal if both were converted in the normal way associated with logical expressions. In C99, I think that (bool)a == (bool)b gives what I want. Is that correct? What is the normal way of writing this in traditional C?

    Read the article

  • C# Excel Exception

    - by Andrew James Watt
    I am trying to copy all data from worksheet1 and paste the values into worksheet2 at the same position I am using office 2003 and the Interlop library. Here is my code; public void CreateExcelWorksheet() { Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application(); if (xlApp == null) { Console.WriteLine("EXCEL could not be started. Check that your office installation."); return; } xlApp.Visible = true; Workbook wb = xlApp.Workbooks.OpenXML(@"C:\XML_Export.xml", Type.Missing, 2); Worksheet worksheet1 = wb.Worksheets[1] as Worksheet; Worksheet worksheet2 = wb.Worksheets[2] as Worksheet; worksheet1.UsedRange.Copy(Type.Missing); worksheet2.PasteSpecial(Microsoft.Office.Interop.Excel.XlPasteType.xlPasteValues, false, false, Type.Missing, Type.Missing, Type.Missing, Type.Missing); } For some reason after the paste command the following exception occurs: Exception from HRESULT: 0x800A03EC Could anyone help?

    Read the article

  • Styling individual radio buttons in drupal form

    - by Andrew
    I have this group of radio buttons in which each of individual button has of its own position set through style attribute. I would like to how can I archive the same by using drupal form api. I found how to style as whole but, not as individual control within group. Here's how my html code look like - <input type="radio" name="base_location" checked="checked" value="0" style="margin-left:70px;float:left;"/><span style="float:left;">District</span> <input type="radio" name="base_location" value="1" style="margin-left:50px;float:left;"/><span style="float:left;">MRT</span> <input type="radio" name="base_location" value="2" style="margin-left:60px;float:left;"/><span style="float:left;">Address</span> And this is the drupal code I'm stuck at - $form['base_location'] = array( '#type' => 'radios', '#title' => t('base location'), '#default_value' => variable_get('search_type', 0), '#options' => array( '0'=>t('District'), '1'=>t('MRT'), '2'=>t('Address')), '#description' => t('base location'), I'm aware of #type=radio existence. However, I do not know how to group all my radio buttons together in this regard. If I use same array key for all of them, they would collide each other. If I don't, they aren't seen as part of the same group. I thank you in advance.

    Read the article

  • When to alter a function vs when to just write a new one...?

    - by Andrew Heath
    /is n00b Through the gift of knowledge and expertise encoded here, I am doing my best to avoid n00b mistakes as I learn the basics of programming. I use functions when I (think I) can in PHP, and keep them somewhat sorted in different includes. The n00b problem I'm running into now is situations where perhaps 4/5th of an existing function is relevant to a new need. Maybe there are a slightly different set of inputs, or an additional calculation or two in the series, or output needs a different format/structure... but the core of the function is still applicable. Is there a good rule of thumb regarding when one should bolt-on crap to an original function and when one should (literally) copy & paste most of it into a new function and tweak to fit the situation? On the one hand I feel bad duping code, on the other I feel bad cluttering up an existing function with stuff not always needed...

    Read the article

  • How do I get the server hostname from a mounted directory with cocoa/obj-c?

    - by Andrew
    Currently when I open a file with my program I can select files on a server by clicking on the server name in the sidebar in an NSOpenPanel and then selecting the file. No problem, this works fine for using the file as long as the shared directory is mounted. I get a path like "/Volumes/SHARENAME/filename.bla". My question is how do I get the server hostname of the computer it came from. For instance, if I clicked on the device with name SERVERNAME under "Shared" in the NSOpenPanel how do I get SERVERNAME from "/Volumes/SHARENAME/filename.bla". I have looked at quite a bit of documentation and have been unable to find a solution for this problem. Any help toward this will be greatly appreciated. Thank you.

    Read the article

  • Jquery binding event on selected class

    - by Andrew
    Is it achievable in jquery to bind an event to a group of control that has certain class? It seems to me, it can't. I google a bit and all that came up are nothing to do with events. Here's how my code looks - $('.numonly').bind('keypress',function(event){ if (event.which > 31 && (event.which < 48 || event.which > 57)) return false; });

    Read the article

< Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >