Search Results

Search found 21 results on 1 pages for 'rowan'.

Page 1/1 | 1 

  • Are VB.NET to C# converters actually compilers?

    - by Rowan Freeman
    Whenever I see programs or scripts that convert between high-level programming languages they are always labelled as converters. "VB.NET to C# converter" on Google results in expected, useful hits. However "VB.NET to C# compiler" on Google results in things like comparisons between the C# and VB.NET compilers and other hits that are not quite what you'd be looking for. Webopedia defines Compiler as A program that translates source code into object code Eric Lipper in an answer to: "How do I create my own programming language and a compiler for it" suggests: One of the best ways to get started writing a compiler is by writing a high-level-language-to-high-level-language compiler. Is a converter really just a compiler? What separates the two?

    Read the article

  • Should my URLs be lowercase?

    - by Rowan Freeman
    According to this blog ("Understanding SEO Friendly URL Syntax Practices") I should change http://example.com/Hello-Dolly To http://example.com/hello-dolly The reasons given are: URLs, in general, are case-sensitive it will simplify any case sensitive SEO and analytics reports According to this GIF that I found on Wikipedia's article on URL Normalization I should convert my URLs from any uppercase to all lowercase. However I use ASP.NET MVC4 and by default my URLs are structured like this (CamelCase): http://www.domain.com/Controller/Action/Parameter http://www.greatsite.com/Categories/List/Bicycles I've skimmed through the RFC1738 but I didn't see any definitive answers to this. Should I go out of my way to force the framework to change everything to lower case? Why did Microsoft choose to design their framework like this if everybody is telling me to use lowercase?

    Read the article

  • Why should I use List<T> over IEnumerable<T>?

    - by Rowan Freeman
    In my ASP.net MVC4 web application I use IEnumerables, trying to follow the mantra to program to the interface, not the implementation. Return IEnumerable(Of Student) vs Return New List(Of Student) People are telling me to use List and not IEnumerable, because lists force the query to be executed and IEumerable does not. Is this really best practice? Is there any alternative? I feel strange using concrete objects where an interface could be used. Is my strange feeling justified?

    Read the article

  • Are there any concerns with using a static read-only unit of work so that it behaves like a cache?

    - by Rowan Freeman
    Related question: How do I cache data that rarely changes? I'm making an ASP.NET MVC4 application. On every request the security details about the user will need to be checked with the area/controller/action that they are accessing to see if they are allowed to view it. The security information is stored in the database. For example: User Permission UserPermission Action ActionPermission A "Permission" is a token that is applied to an MVC action to indicate that the token is required in order to access the action. Once a user is given the permission (via the UserPermission table) then they have the token and can therefore access the action. I've been looking in to how to cache this data (since it rarely changes) so that I'm only querying in-memory data and not hitting a database (which is a considerable performance hit at the moment). I've tried storing things in lists, using a caching provider but I either run in to problems or performance doesn't improve. One problem that I constantly run in to is that I'm using lazy loading and dynamic proxies with EntityFramework. This means that even if I ToList() everything and store them somewhere static, the relationships are never populated. For example, User.Permissions is an ICollection but it's always null. I don't want to Include() everything because I'm trying to keep things simple and generic (and easy to modify). One thing I know is that an EntityFramework DbContext is a unit of work that acts with 1st-level caching. That is, for the duration of the unit of work, everything that is accessed is cached in memory. I want to create a read-only DbContext that will exist indefinitely and will only be used to read about permission data. Upon testing this it worked perfectly; my page load times went from 200ms+ to 20ms. I can easily force the data to refresh at certain intervals or simply leave it to refresh when the application pool is recycled. Basically it will behave like a cache. Note that the rest of the application will interact with other contexts that exist per request as normal. Is there any disadvantage to this approach? Could I be doing something different?

    Read the article

  • Should I just always Convert.ToInt32 my integers to account for potential nullable integers?

    - by Rowan Freeman
    If my MSSQL database contains a data type that is NULL (i.e. null is allowed) then ORMs, such as EntityFramework in my case, create .NET objects that are nullable. This is great, and the way I use nullables is like this: C# int? someInt = 5; int newInt = someInt.Value; // woot VB.NET Dim someInt As Integer? Dim newInt As Integer = someInt.Value ' hooray However, recently I had to make a change to the database to make an Id field no longer NULL (nullable). This means that .Value is now broken. This is a nuisance if the Id property is used a lot. One solution that I thought of is to just use Convert.ToInt32 on Id fields so it doesn't matter if an int is nullable or not. C# int newInt = Convert.ToInt32(someInt); // always compiles VB.NET Dim newInt As Integer = Convert.ToInt32(someInt) ' always compiles Is this a bad approach and are there any alternatives?

    Read the article

  • HTC Android device mounted as USB drive is read-only unless I'm root

    - by Ian Dickinson
    When I connect my HTC Incredible S to my Ubuntu 10.10 system as a USB drive, the device seems to mount OK, but is read-only unless I access it as root. For example, if I run nautilus, I can't drag and drop files to the SD-card in the phone, but if I run sudo nautilus I can. I have USB debug support set on the phone (Applications > Development > USB debugging) and I have added a rule for the device in /etc/udev/rules.d/51-android.rules on my Ubuntu system. Any suggestions as to how I can mount the drive so that I can copy content to the SD card without needing to sudo? Update Following advice from waltinator, I added the following line to my /etc/fstab: UUID=3537-3834 /media/usb1 vfat rw,user,noexec,nodev,nosuid,noauto However, the Android device is still being auto-mounted on /media/usb1 with uid and gid root. Update 2 syslog output: Nov 21 23:38:40 rowan-15 usbmount[4352]: executing command: mount -tvfat -osync,noexec,nodev,noatime,nodiratime /dev/sdd1 /media/usb1 Nov 21 23:38:40 rowan-15 usbmount[4352]: executing command: run-parts /etc/usbmount/mount.d

    Read the article

  • What TrustLeap G-WAN for?

    - by Rowan
    Hi, Some people said that TrustLeap G-WAN ( http://trustleap.ch/ ) is very fast. But after reading the manual, I dont see guide to use G-WAN with PHP or Python. So, what this application server for? Is it only works only for C language? Thanks in advance

    Read the article

  • PECL on Mac OS X 10.6

    - by Rowan
    I'm having trouble finding PECL on a Mac OS X 10.6 machine. I'm using the default install of Apache and PHP for development and have installed MongoDB, however I can't work with Mongo/PHP without the mongo PECL extension. Is there a copy of PECL on a Mac or will I have to install it? If so, where is it? If not, do you know of a good tutorial for getting it up-and-running? I've tried the obvious stuff: sudo find / -name "pecl" -print returns nothing Thanks very much

    Read the article

  • Comprehensive and well maintained wiki syntax Parser for PHP

    - by Rowan
    I'm looking for a comprehensive and well maintained wiki syntax Parser for PHP, does anybody know of one? I can find some really good parsers for markdown and bbcode but am having trouble with finding a decent wiki parser. I prefer markdown myself, but I'm writing post functions for a CMS and I'd like to give end-users a choice. I thought about downloading a copy of MediaWiki and seeing how they do it, thoughts on this as an option?

    Read the article

  • spl_object_hash for PHP < 5.2 (unique ID for object instances)

    - by Rowan
    I'm trying to get unique IDs for object instances in PHP 5+. The function, spl_object_hash() is available from PHP 5.2 but I'm wondering if there's a workaround for older versions. There are a couple of functions in the comments on php.net but they're not working for me. The first (simplified): function spl_object_hash($object){ if (is_object($object)){ return md5((string)$object); } return null; } does not work with native objects (such as DOMDocument), and the second: function spl_object_hash($object){ if (is_object($object)){ ob_start(); var_dump($object); $dump = ob_get_contents(); ob_end_clean(); if (preg_match('/^object\(([a-z0-9_]+)\)\#(\d)+/i', $dump, $match)) { return md5($match[1] . $match[2]); } } return null; } looks like it could be a major performance buster! Does anybody have anything up their sleeve?

    Read the article

  • Payment gateways and XSS

    - by Rowan Parker
    Hi all, I'm working on a website which takes payment from a customer. I'm using Kohana 2.3.4 and have created a library to handle the payment gateway I use (www.eway.com.au). Basically I'm just using their sample code, copied into it's own class. Anyway, the code works fine and I can make payments, etc. The issue I have is when the payment gateway is returning the user to my site. The payment gateway uses HTTPS so that is secure, and it is sending the user back to a HTTPS page on my site. However I have the NoScript plugin installed in Firefox, and when I get sent back to the page on my website (which also handles storing the transaction data) I get an error message saying that NoScript has blocked a potential XSS attack. Now I understand why it's unsecure (POST data being sent across two different domains) but what should I be doing instead? Obviously during my testing here I temporarily disable NoScript and it all works fine, but I can't rely on that for the end users. What's the best practice here?

    Read the article

  • need php 'if IE' to call a one CSS or alternative for IE

    - by rowan
    definately one or the other, not one and the other if.... HTML doesnt have an else function.. or does it? could you please be so kind as to code it in your answer im a php newb but so far getting nice results! this one's got be buggered though. if browser = IE then css/ie.css else css/moz even a webkit 3rd option if you think its needed... thanks guys you're all marvelous. also, does anyone know of a full properties list for webkit transitions/css?d

    Read the article

  • jQuery Date Picker where text input is read only

    - by Rowan Parker
    Hi all, I want to use the Jquery datepicker. I've got it setup using an the alt field option. I'm displaying Y-M-D in the text field, but submitting Y-M-D. Everything works fine so far, sending the correct data, etc. However I want to stop the user from being able to manually type a date. I add originally set the INPUT field to disabled, which worked in every browser except IE. In IE it would popup the date picker but then not close after clicking a date. Does anyone know the best way to do this?

    Read the article

  • Set the current date in PHP

    - by Rowan
    I'm currently working on my company's in-house CMS and wish to add the ability for an admin to view the site on a specific date. This will allow admins to preview the site with archived or scheduled posts. I'd like to avoid finding all mentions of date() or time() and offsetting them. Is there a way of making PHP think it's a specific date so that all calls to date() default to the new time? Thank you

    Read the article

  • How can I have a certain set of CSS properties affect only IE users?

    - by rowan
    definately one or the other, not one and the other if.... HTML doesnt have an else function.. or does it? could you please be so kind as to code it in your answer im a php newb but so far getting nice results! this one's got be buggered though. if browser = IE then css/ie.css else css/moz even a webkit 3rd option if you think its needed... thanks guys you're all marvelous. also, does anyone know of a full properties list for webkit transitions/css?d

    Read the article

  • An Hour With Bill Buxton MIX10

    After spending a couple of hours with Rowan Simpson yesterday afternoon I found myself continually coming back to some of the things that Bill Buxton talked about in his hour Q&A at MIX10 in Las Vegas. Dont have Silverlight? Download the video in WMV, WMV (High) or MP4 format. At the more theoretical level, Bill discusses technology as a human prosthesis, but he favours metaphors that are as far away from technology as possible. The Seattle Public Library and software building....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • An Hour With Bill Buxton MIX10

    After spending a couple of hours with Rowan Simpson yesterday afternoon I found myself continually coming back to some of the things that Bill Buxton talked about in his hour Q&A at MIX10 in Las Vegas. Dont have Silverlight? Download the video in WMV, WMV (High) or MP4 format. At the more theoretical level, Bill discusses technology as a human prosthesis, but he favours metaphors that are as far away from technology as possible. The Seattle Public Library and software building....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Scrollbar problem with jquery ui dialog in Chrome and Safari

    - by alexis.kennedy
    I'm using the jquery ui dialog with modal=true. In Chrome and Safari, this disables scrolling via the scroll bar and cursor keys (scrolling with the mouse wheel and page up/down still works). This is a problem if the dialog is too tall to fit on one page - users on a laptop get frustrated. Someone raised this three months ago on the jquery bug tracker - http://dev.jqueryui.com/ticket/4671 - it doesn't look like fixing it is a priority. :) So does anyone (i) have a fix for this? (ii) have a suggested workaround that would give a decent usability experience? I'm experimenting with mouseover / scrollto on bits of the form, but it's not a great solution :( EDIT: props to Rowan Beentje (who's not on SO afaict) for finding a solution to this. jQueryUI prevents scrolling by capturing the mouseup / mousedown events. So this: $("dialogId").dialog({ open: function(event, ui) { window.setTimeout(function() { jQuery(document) .unbind('mousedown.dialog-overlay') .unbind('mouseup.dialog-overlay') ; }, 100); }, modal: true}); seems to fix it. Use at own risk, I don't know what other unmodal behaviour unbinding this stuff might allow.

    Read the article

1