Search Results

Search found 663 results on 27 pages for 'trail runner'.

Page 20/27 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Regular Expression .net flavor

    - by user1440109
    Dont ask how this works but currently it does ("^\|(.?)\|*$")....kinda. This removes all extra pipes...part one....I have searched all over no anwser yet. I am using VB2011 beta...asp web form......vb coding though! I want to capture special character pipe (|) which is used to seperate words...i.e. car|truck|van|cycle problem is users lead with, trail with, use multiple, and use spaces before and after...i.e. |||car||truck | van || cycle. another example: george bush|micheal jordon|bill gates|steve jobs <-- this would be correct but when I do remove space it takes correct space out. so I want to get rid of whitespace leading, trailing, any space before | and space after | and only allow one pipe (|)....in between alphanumeric of course.

    Read the article

  • Can I have code that executes before and after tests are run by NUnit?

    - by Billy ONeal
    I've got a bunch of tests in NUnit which create garbage data on the filesystem (bad, I know, but I have little control over this). Currently we have a cleanup tool that removes these temporaries and such, but I'd like to be able to run that cleanup tool automatically. I'd have to be able to run it after all tests have finished running. I have similar checking that I'd like to do at the beginning, to ensure that there are none of these temporaries left from previous runs that might change the outcome of the tests. Is such a thing simple or am I going to have to implement a whole new test runner for such a thing?

    Read the article

  • How do you run your unit tests? Compiler flags? Static libraries?

    - by Christopher Gateley
    I'm just getting started with TDD and am curious as to what approaches others take to run their tests. For reference, I am using the google testing framework, but I believe the question is applicable to most other testing frameworks and to languages other than C/C++. My general approach so far has been to do either one of three things: Write the majority of the application in a static library, then create two executables. One executable is the application itself, while the other is the test runner with all of the tests. Both link to the static library. Embed the testing code directly into the application itself, and enable or disable the testing code using compiler flags. This is probably the best approach I've used so far, but clutters up the code a bit. Embed the testing code directly into the application itself, and, given certain command-line switches either run the application itself or run the tests embedded in the application. None of these solutions are particularly elegant... How do you do it?

    Read the article

  • Why is the dictionary debug visualizer less useful in Visual Studio 2010 for Silverlight debugging?

    - by Kevin
    I was debugging in Visual Studio 2010, which we just installed and trying to look at a dictionary in the quick watch window. I see Keys and Values, but drilling into those shows the Count and Non-Public members, Non-Public members continues the trail and I never see the values in the dictionary. I can run test.Take(10) and see the values, but why should I have to do that. I don't have VS 2008 installed anymore to compare, but it seems that I could debug a dictionary much easier. Why is it this way now? Is it just a setting I set somehow on my machine? Test code: Dictionary<string, string> test = new Dictionary<string, string>(); test.Add("a", "b"); EDIT: I've just tried the same debug in a Console app and it works as expected. The other project is a Silverlight 4 application, why are they different? Console Debug Screen Shot Silverlight 4 Debug Screen Shot:

    Read the article

  • JavaScript: function returning NAN

    - by Michael
    I'm working on a codecademy.com lesson with instructions to write the calculateTotal function below. When I click run, it's returning NaN. Anyone know what's wrong with the calculateTotal function as I wrote it that's making it return NaN. Note, I understand that NaN means not a number... // runner times var carlos = [9.6,10.6,11.2,10.3,11.5]; var liu = [10.6,11.2,9.4,12.3,10.1]; var timothy = [12.2,11.8,12.5,10.9,11.1]; // declare your function calculateTotal here var calculateTotal = function(raceTimes){ var totalTime; for(i = 0; i < raceTimes.length; i++){ totalTime += raceTimes[i]; return totalTime; } }; var liuTotal = calculateTotal(liu); console.log(liuTotal);

    Read the article

  • Comments on this assumption about running on dev server vs a real instance in app engine (python)?

    - by Jacob Oscarson
    Hello app engineers! I'm on an app engine project where I'd like to put in a link to a Javascript test runner that I'd like to only exist when running the development server. I've made some experiments on a local shell with configuration loaded using the technique found in NoseGAE versus live on the 'App Engine Console' [1] and it looks to me like a distinction btw real instance and dev server is the presence of the module google.appengine.tools. Which lead me to this utility function: def is_dev(): """ Tells us if we're running under the development server or not. :return: ``True`` if the code is running under the development server. """ try: from google.appengine import tools return True except ImportError: return False The question (finally!) would be: is this a bad idea? And in that case, can anyone suggest a better approach? [1] http://con.appspot.com/console/ (try it! very handy indeed)

    Read the article

  • Is it possible to use the ScalaTest BDD syntax in a JUnit environment?

    - by ebruchez
    I would like to describe tests in BDD style e.g. with FlatSpec but keep JUnit as a test runner. The ScalaTest Quick Start does not seem to show any example of this: http://www.scalatest.org/getting_started_with_junit_4 I first tried naively to write tests within @Test methods, but that doesn't work and the assertion is never tested: @Test def foobarBDDStyle { "The first name control" must "be valid" in { assert(isValid("name·1")) } // etc. } Is there any way to achieve this? It would be even better if regular tests can be mixed and matched with BDD-style tests.

    Read the article

  • Capistrano update causes C: to be placed in the current directory (cygwin)

    - by user321775
    When I run cap deploy:update in a directory on my local machine (via cygwin), "C:" magically appears in the directory. Sure enough, I can cd to it and it's my windows C: drive. Now I'm afraid to delete it, but I definitely don't want it in this directory (a rails project under /home/username/blah/blah). Here's my config/deploy.rb file. custom options set :application, "xyz.com" set :repository, "ssh://[email protected]:yyyy/home/git/xxx" set :user, "myname" set :runner, user set :use_sudo, false server "xxx.xxx.xxx.xxx:yyyy", :app, :web, :db, :primary = true deploy to set :deploy_to, "/home/myname/public_html/xyz" repository set :scm, :git set :deploy_via, :copy ssh options default_run_options[:pty] = true ssh_options[:paranoid] = false ssh_options[:port] = yyyy start passenger namespace :deploy do task :start do ; end task :stop do ; end task :restart, :roles = :app, :except = { :no_release = true } do run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" end end Anyone see the problem? And does anyone know a safe way of getting rid of the C: drives that have already shown up (this has happened in a few directories)?

    Read the article

  • AppEngine GeoPt Data Upload

    - by Eric Landry
    I'm writing a GAE app in Java and only using Python for the data upload. I'm trying to import a CSV file that looks like this: POSTAL_CODE_ID,PostalCode,City,Province,ProvinceCode,CityType,Latitude,Longitude 1,A0E2Z0,Monkstown,Newfoundland,NL,D,47.150300000000001,-55.299500000000002 I was able to import this file in my datastore if I import Latitude and Longitude as floats, but I'm having trouble figuring out how to import lat and lng as a GeoPt. Here is my loader.py file: import datetime from google.appengine.ext import db from google.appengine.tools import bulkloader class PostalCode(db.Model): id = db.IntegerProperty() postal_code = db.PostalAddressProperty() city = db.StringProperty() province = db.StringProperty() province_code = db.StringProperty() city_type = db.StringProperty() lat = db.FloatProperty() lng = db.FloatProperty() class PostalCodeLoader(bulkloader.Loader): def __init__(self): bulkloader.Loader.__init__(self, 'PostalCode', [('id', int), ('postal_code', str), ('city', str), ('province', str), ('province_code', str), ('city_type', str), ('lat', float), ('lng', float) ]) loaders = [PostalCodeLoader] I think that the two db.FloatProperty() lines should be replaced with a db.GeoPtProperty(), but that's where my trail ends. I'm very new to Python so any help would be greatly appreciated.

    Read the article

  • Under what circumstances would a Ruby $LOAD_PATH be acquired from a parent process?

    - by Dr Nic
    In my cucumber scenarios, if I call rake db:schema:load within a target Rails app folder, I get the cucumber process's $LOAD_PATH and not the Rails app's own Gemfile/load path. I think this is very weird. The consequence is that I get the following error: no such file to load -- rails/all I can't reproduce it outside of my cucumber scenario. ruby -rubygems -e "system 'rake -T'" works normally - the 'rake -T' has the application's own Gemfile-based $LOAD_PATH; and doesn't generate the error above. Can anyone think why a child process (rake -T or rake db:schema:load or rails runner...; invoked by either system, exec, %x[...] or backtick; would start with the parent processes' $LOAD_PATH (from the cucumber scenario's Gemfile) instead of its own $LOAD_PATH (from the Rails app's Gemfile)?

    Read the article

  • BeautifulSoup Parser Confusion - HTML

    - by lyngbym
    I'm trying to scrape some content off another site and I'm not sure why BeautifulSoup is producing this output. It is only finding a blank space inside the match, but the real HTML contains a large amount of markup. I apologize if this is something stupid on my part. I'm new to python. Here's my code: import sys import os import mechanize import re from BeautifulSoup import BeautifulSoup def scrape_trails(BASE_URL, data): #Get the trail names soup = BeautifulSoup(data) sitesDiv = soup.findAll("div", attrs={"id" : "sitesDiv"}) print sitesDiv def main(): BASE_URL = "http://www.dnr.state.mn.us/skiing/skipass/list.html" br = mechanize.Browser() data = br.open(BASE_URL).get_data() links = scrape_trails(BASE_URL, data) if __name__ == '__main__': main() If you follow that URL you can see the sitesDiv contains a lot of markup. I'm not sure if I'm doing something wrong or if this is just malformed markup that the script can't handle. Thanks!

    Read the article

  • Current state of Erlang web development? Frameworks, Template languages

    - by pommonico
    Django is to Python as Rails is to Ruby. What is the current front-runner for Erlang? Recent Erlang web activity has resulted in many new frameworks but they are all still moving targets. ErlyWeb is very far along but now seems to be dead. If you were to invest significant capital into a new web product (i.e. not a hobby, you use your own money and you use other's investment in you with expectation of payback), would you choose Erlang as a web platform? If so, what framework and technologies would you choose?

    Read the article

  • JUnit unable to find tests in Eclipse

    - by mikera
    I have a strange issue with JUnit 4 tests in Eclipse 3.5 that I couldn't solve - any hints gratefully received! Initially: I had a test suite working properly, with 100+ tests all configured with JUnit 4 annotations. I'd run these typically by right clicking on my source folder and selecting "Run as JUnit test". All worked perfectly. Now: When I try to run the test messages all I get is an error "No tests found with test runner 'JUnit 4'". Any idea what is happening? I simply can't work out what could have changed to make this fail. My guess is that it is some configuration issue based on the build path or class path?

    Read the article

  • Java Inheritance Concept Understanding

    - by Nirmal
    Hello All.... I am just refreshing the oops features of the java. So, I have a little confusion regarding inheritance concept. For that I have a following sample code : class Super{ int index = 5; public void printVal(){ System.out.println("Super"); } } class Sub extends Super{ int index = 2; public void printVal(){ System.out.println("Sub"); } } public class Runner { public static void main(String args[]){ Super sup = new Sub(); System.out.println(sup.index+","); sup.printVal(); } } Now above code is giving me output as : 5,Sub. Here, we are overriding printVal() method, so that is understandable that it is accessing child class method only. But I could not understand why it's accessing the value of x from Super class... Thanks in advance....

    Read the article

  • what the java command's -jar option really does

    - by JBoy
    Does the -jar option of the java command also compile the sources before running the main method? I believe so but i would like to have a better understanding of the internal process, from the man page you can clearly see a small workflow sequence: -jar Execute a program encapsulated in a JAR file. The first argument is the name of a JAR file instead of a startup class name. In order for this option to work, the manifest of the JAR file must contain a line of the form Main-Class: classname. Here, classname identifies the class having the public static void main(String[] args) method that serves as your application's starting point. See the Jar tool reference page and the Jar trail of the Java Tutorial @ But it does not mention that it compiles the sources.

    Read the article

  • JUnit Theories: Why can't I use Lists (instead of arrays) as DataPoints?

    - by MatrixFrog
    I've started using the new(ish) JUnit Theories feature for parameterizing tests. If your Theory is set up to take, for example, an Integer argument, the Theories test runner picks up any Integers marked with @DataPoint: @DataPoint public static Integer number = 0; as well as any Integers in arrays: @DataPoints public static Integer[] numbers = {1, 2, 3}; or even methods that return arrays like: @DataPoints public static Integer[] moreNumbers() { return new Integer[] {4, 5, 6};}; but not in Lists. The following does not work: @DataPoints public static List<Integer> numberList = Arrays.asList(7, 8, 9); Am I doing something wrong, or do Lists really not work? Was it a conscious design choice not to allow the use Lists as data points, or is that just a feature that hasn't been implemented yet? Are there plans to implement it in a future version of JUnit?

    Read the article

  • Getting all parent rows in one SQL query

    - by Alex
    I have a simple MySQL table thats contains a list of categories, level is determined by parent_id: id name parent_id --------------------------- 1 Home 0 2 About 1 3 Contact 1 4 Legal 2 5 Privacy 4 6 Products 1 7 Support 1 I'm attempting to make a breadcrumb trail. So i have the 'id' of the child, I want to get all available parents (iterating up the chain until we reach 0 "Home"). There could be any number or child rows going to an unlimited depth. Currently I am using an SQL call for each parent, this is messy. Is there a way in SQL to do this all on one query?

    Read the article

  • Drupal 6, how to identify active menu item by url parameters (full link), ?q=page1&filter=10

    - by OlgaV
    I have a submenu that has all items linked to the same node, but with different additional parameters, for ex: ... <li...><a href = "/?q=page1&filter=10" class = "... active">Item1</a></li> <li...><a href = "/?q=page1&filter=11" class = "... active">Item2</a></li> ... in this case all items have class 'active' and none of them has class 'active-trail'. Is there any way to identify the true active link (for styling purposes)? any suggestions will be much appreciated!

    Read the article

  • SQL Contest – Win USD 300 Worth Gift – Cartoon Contest is Back

    - by pinaldave
    There are two excellent contests and we have lots of winning to do this year end. 1) Win USD 25 Amazon Gift Cards (10 Units) This is very simple, you just have to download SQL Server DB Optimizer. That’s it! There are only two conditions: You must have a valid email address. As USD 25 Amazon Gift Card will be sent to the same address. Download DB Optimizer between today and Dec 8, 2012. Link to Download DB Optimizer. Every day one winner will be notified about their winning USD 25 Amazon Gift Cards for next 10 days. 2) Win Star Wars R2-D2 Inflatable R/C This the coolest thing to win. I personally want one but as I am running a contest, I can’t  participate. You get this cool Remote Controlled Device – you just have to answer following cartoon contest. Read the complete story and think what will be the answer provided by the smart employee. There are only two conditions: Leave your answer in the comment area of this blog post (every comment will be hidden till Dec 8, 2012). Please leave your answer in the comment area between today and Dec 8, 2012. Remember you can participate as many times as you want. Make sure that your answer is correct and creative. The most creative answer will be selected. The decision of contest owner will be final. We may have runner’s up prices but for the moment let us try to win R2-D2. Here is the cool video of R2D2. Now here is the cartoon story, please follow the story and complete the very last cartoon template. Your answer should be correct and should be creative. However, the ideal answer will not be longer than one or two sentences. Hint: (Hint) Well, Leave your answer in the comment area of this blog post. If you do not win R2D2, trust me there are chances you may win a surprise gift from me. Remember your answer should be correct and should be creative. However, the ideal answer will not be longer than one or two sentences. Last day to participate in both of the contest is Dec 8, 2012. We will announce the winner in the week of December 10. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Puzzle, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority News, SQLServer, T SQL, Technology

    Read the article

  • The curious case of SOA Human tasks' automatic completion

    - by Kavitha Srinivasan
    A large south-Asian insurance industry customer using Oracle BPM and SOA ran into this. I have survived this ordeal previously myself but didnt think to blog it then. However, it seems like a good idea to share this knowledge with this reader community and so here goes.. Symptom: A human task (in a SOA/BPEL/BPM process) completes automatically while it should have been assigned to a proper user.There are no stack traces, no related exceptions in the logs. Why: The product is designed to treat human tasks that don't have assignees as one that is eligible for completion. And hence no warning/error messages are recorded in the logs. Usecase variant: A variant of this usecase, where an assignee doesnt exist in the repository is treated as a recoverable error. One can find this in the 'pending recovery' instances in EM and reactivate the task by changing the assignees in the bpm workspace as a process owner /administrator. But back to the usecase when tasks get completed automatically... When: This happens when the users/groups assigned to a task are 'empty' or null. This has been seen only on tasks whose assignees are derived from an assignment expression - ie at runtime an XPath is used to determine who to assign the task to. (This should not happen if task assignees are populated via swim-lane roles.) How to detect this in EM For instances that are auto-completed thus, one will notice in the Audit Trail of such instances, that the 'outcome' of the task is empty. The 'acquired by' element will also show as empty/null. Enabling the oracle.soa.services.workflow.* logger in em should print more verbose messages about this. How to fix this The application code needs two fixes: input to HT: The XSLT/XPath used  to set the task 'assignee' and the process itself should be enhanced to handle nulls better. For eg: if no-data-found, set assignees to alternate value, force default assignees etc. output from HT: Additionally, in the application code, check that the 'outcome' of the HT is not-null. If null, route the task to be performed again after setting the assignee correctly. Beginning PS4FP, one should be able to use 'grab' to route back to the task to fire again. Hope this helps. 

    Read the article

  • How To Approach 360 Degree Snake

    - by Austin Brunkhorst
    I've recently gotten into XNA and must say I love it. As sort of a hello world game I decided to create the classic game "Snake". The 90 degree version was very simple and easy to implement. But as I try to make a version of it that allows 360 degree rotation using left and right arrows, I've come into sort of a problem. What i'm doing now stems from the 90 degree version: Iterating through each snake body part beginning at the tail, and ending right before the head. This works great when moving every 100 milliseconds. The problem with this is that it makes for a choppy style of gameplay as technically the game progresses at only 6 fps rather than it's potential 60. I would like to move the snake every game loop. But unfortunately because the snake moves at the rate of it's head's size it goes way too fast. This would mean that the head would need to move at a much smaller increment such as (2, 2) in it's direction rather than what I have now (32, 32). Because I've been working on this game off and on for a couple of weeks while managing school I think that I've been thinking too hard on how to accomplish this. It's probably a simple solution, i'm just not catching it. Here's some pseudo code for what I've tried based off of what makes sense to me. I can't really think of another way to do it. for(int i = SnakeLength - 1; i > 0; i--){ current = SnakePart[i], next = SnakePart[i - 1]; current.x = next.x - (current.width * cos(next.angle)); current.y = next.y - (current.height * sin(next.angle)); current.angle = next.angle; } SnakeHead.x += cos(SnakeAngle) * SnakeSpeed; SnakeHead.y += sin(SnakeAngle) * SnakeSpeed; This produces something like this: Code in Action. As you can see each part always stays behind the head and doesn't make a "Trail" effect. A perfect example of what i'm going for can be found here: Data Worm. Not the viewport rotation but the trailing effect of the triangles. Thanks for any help!

    Read the article

  • links for 2011-02-16

    - by Bob Rhubart
    On the Software Architect Trail Software architect is the #1 job, according to a 2010 CNN-Money poll. In this article in Oracle Magazine, several members of the OTN architect community talk about the career paths that led them to this lucrative role.  (tags: oracle oraclemagazine softwarearchitect) Oracle Technology Network Architect Day: Denver Registration opens soon for this event to be held in Denver on March 23, 2011.  (tags: oracle otn entarch) How the Internet Gets Inside Us : The New Yorker "It isn’t just that we’ve lived one technological revolution among many; it’s that our technological revolution is the big social revolution that we live with." - Adam Gopnik (tags: internet progress technology innovation) The Insider Threat: Understand and Mitigate Your Risks: CSO Webcast February 23, 2011 at 1:00 PM EST/ 10:00 AM PST .  Speakers: Randy Trzeciak, lead for the CERT Insider Threat research team, and  Roxana Bradescu, Director of Database Security at Oracle. (tags: oracle CERT security) The Tom Kyte Blog: An Interesting Read... Tom looks at "an internet security firm brought down by not following the most *basic* of security principals." (tags: security oracle) Jason Williamson: Oracle as a Service in the Cloud "It is not trivial to migrate large amounts of pre-relational or 'devolved' relational data. To do this, we again must revert back to a tight roadmap to migration and leverage the growing tools and services that we have." - Jason Williamson (tags: oracle cloud soa) Edwin Biemond: Java / Oracle SOA blog: Building an asynchronous web service with JAX-WS "Building an asynchronous web service can be complex especially when you are used to synchronous Web services where you can wait for the response in your favorite tool." - Oracle ACE Edwin Biemond (tags: oracle oracleace java soa) Shared Database Servers (The SaaS Report) "Outside the virtualization world, there are capabilities of Oracle Database which can be used to prevent resource contention and guarantee SLA." - Shivanshu Upadhyay (tags: oracle database cloud SaaS) White Paper: Experiencing the New Social Enterprise "Increasingly organizations recognize the mandate to create a modern user experience that transforms existing business processes and increases business efficiency and agility." (tags: e20 enterprise2.0 socialcomputing oracle) Clusterware 11gR2 - Setting up an Active/Passive failover configuration Gilles Haro illustrates the steps necessary to achieve "a fully operational 11gR2 database protected by automatic failover capabilities." (tags: oracle clusterware) Oracle ERP: How to overcome local hurdles in a global implementation "The corporate world becomes a global village as many companies expand their business and offices around different countries and even continents. And this number keeps increasing. This globalization raises interesting questions..." - Jan Verhallen (tags: oracle capgemini entarch erp) Webcast: Successful Strategies for Optimizing Your Data Warehouse. March 3. 10 a.m. PT/1 p.m. ET Thursday, March 3, 2011. 10 a.m. PT/1 p.m. ET. Speakers: Mala Narasimharajan (Senior Product Marketing Manager, Oracle Data Integration) and Denis Gray (Principal Product Manager, Oracle Data Integration) (tags: oracle dataintegration datawarehousing)

    Read the article

  • Oracle at ASMC PDI 2012

    - by jeffrey.waterman
    Recently, I had the pleasure of representing Oracle at the American Society of Military Comptrollers National Professional Development Institute (PDI).  The PDI is the premier training event for resource managers in the Department of Defense and US Coast Guard.  Each year they assemble top presenters and key note speakers to convey their experiences and share the upcoming goals and vision for the Defense Department's financial and resource management community.  This year, the common themes were centered around 'auditability' and 'efficiency'.   What is auditability?  There were many definitions/themes tossed around, but to summarize my notes, it boiled down to:- the proper tracking of funds- audit readiness- proper controls- proper documentation There were sessions regarding entire programs focused on the need for auditability.  For example, FIAR: Financial Improvement and Audit Readiness (http://comptroller.defense.gov/fiar/index.html)   The FIAR stresses the "...improve(ment of) the Department's financial processes, controls and information." The entire conference, one set of solutions kept popping into my head around, "how can Oracle's solutions assist the Department of Defense", or any other Federal Agency, improve their financial processes and controls?   One answer came to mind:  Oracle Governance, Risk, and Compliance Management. Commonly referred to as "GRC". Let me summarize the main components around Oracle's GRC solution: GRC Manager: This solution is the central repository for documenting business processes, policies, and established controls.  All identified risks and issues are documented within the repository as well as action plans necessary for mitigation. GRC Controls:  This solution consists of a set of tools which are embedded with your ERP (financial, human resource, supply chain, etc.) applications to detect, prevent, and/or enforce the policies and procedures established by your Agency.  Components of the solution include:- Application Access Control Governor: a robust tool for managing application roles and responsibilities; simplify segregation of duty maintenance- Configuration Controls Governor: complete audit trail for changes made to configurations- Transactions Control Governor: track violations of internal controls; alert management to suspicious activities; be warned when high dollar transactions are occurring on an irregular basis; - Preventative Controls Governor: prevent sensitive information from being viewed by unauthorized parties; enforce field, block, and form change control If you are in the financial or resource management community and are concerned about auditability within your organization I suggest you follow up this post by reading about Oracle's GRC solutions.  www.oracle.com/grc Please feel free to follow up with thought and questions in the comments section below.  Also, if you have a topic you would like addressed in this blog, just drop me a note at [email protected]  or leave the suggestion in the comment section as well. Thank you for reading.

    Read the article

  • The Case for Complimentary Software Copies

    - by GGBlogger
    As the Geriatric Geek you can understand that I’ve been writing and studying for over 60 years. That means that I’ve seen insane changes in the computer software industry. I’ve made the joke that I get a new college education every 6 months or so. Of course that’s an exaggeration but it doesn’t make the feeling go away. I have a long standing and strong relationship with Microsoft so I’m armed with virtually every tool they make. It also means that I have access to tons of training material. But here’s the rub… Last year I started a definitive read of Professional Visual Basic 2008. The purpose was to fill in holes in my understanding of various things. I’m currently on page 1119 of some 1400 pages. During this sojourn I’ve decided that the future is web related which is to say that the future of “thick client” applications running as Windows applications is likely to slowly disappear. To that end I’ve taken a side trip or two into the world of ASP (including XML), Silverlight and cloud development. After carefully avoiding (that’s tongue in cheek) XML for years I finally had to bite the bullet, so to speak, and start learning XML in earnest. The most recent result of that was trail downloads of Altova’s MissionKit 2010 for Software Architects and Liquid Technologies Liquid XML Studio Developer Edition. These are both beautiful products and I want to learn them and write about them. Now comes the rub… While 30 day evaluations are generous in allowing casual users to assess these technologies for purchase they are NOT long enough to allow an author to evaluate, learn and ultimately write about them. Even if I devoted the full 30 days to learning, using and writing about say Altova’s suite I wouldn’t have enough time. Liquid XML may be a little easier to learn (one product as opposed to 8).  Add to that the fact that I frequently get sidetracked to add to my kit and it really blows out. It can be extremely frustrating when I’ve devoted hours to a project and suddenly discover that to complete it I will either need to purchase a license or abandon the project. Since my life blood does not depend on the product I end up abandoning the project and moving on. So to the folks from whom I request complimentary copies… I guarantee that if I convert your product to doing paid development work I will purchase a license to do that but as long as I am using your product to study for the purpose of writing samples, teaching use or otherwise promoting your product to other paying customers I will ask that you give me a license so that I can do that without facing the dread expiration of a 30 day trial.

    Read the article

  • Mock RequireJS define dependencies with config.map

    - by Aligned
    Originally posted on: http://geekswithblogs.net/Aligned/archive/2014/08/18/mock-requirejs-define-dependencies-with-config.map.aspxI had a module dependency, that I’m pulling down with RequireJS that I needed to use and write tests against. In this case, I don’t care about the actual implementation of the module (it’s simple enough that I’m just avoiding some AJAX calls). EDIT: make sure you look at the bottom example after the edit before using the config.map approach. I found that there is an easier way. I did not want to change the constructor of the consumer as I had a chain of changes that would have to be made and that would have been to invasive for this task. I found a question on StackOverflow with a short, but helpful answer from “Artem Oboturov”. We can use the config.map from RequireJs to achieve this. Here is some code: A module example (“usefulModule” in Common/Modules/usefulModule.js): define([], function() { "use strict"; var testMethod = function() { ... }; // add more functionality of the module return { testMethod; } }); A consumer of usefulModule example: define([ "Commmon/Modules/usefulModule" ], function(usefulModule) { "use strict"; var consumerModule = function(){ var self = this; // add functionality of the module } }); Using config.map in the html of the test runner page (and in your Karma config –> I’m still trying to figure this out): map: {'*': { // replace usefulModule with a mock 'Common/Modules/usefulModule': '/Tests/Specs/Common/usefulModuleMock.js' } } With the new mapping, Require will load usefulModuleMock.js from Tests/Specs/Common instead of the real implementation. Some of the answers on StackOverflow mentioned Squire.js, which looked interesting, but I wasn’t ready to introduce a new library at this time. That’s all you need to be able to mock a depency in RequireJS. However, there are many good cases when you should pass it in through the constructor instead of this approach.   EDIT: After all that, here’s another, probably better way: The consumer class, updated: define([ "Commmon/Modules/usefulModule" ], function(UsefulModule) { "use strict"; var consumerModule = function(){ var self = this; self.usefulModule = new UsefulModule(); // add functionality of the module } }); Jasmine test: define([ "consumerModule", "/UnitTests/Specs/Common/Mocks/usefulModuleMock.js" ], function(consumerModule, UsefulModuleMock){ describe("when mocking out the module", function(){ it("should probably just override the property", function(){ var consumer = new consumerModule(); consumer.usefulModule = new UsefulModuleMock(); }); }); });   Thanks for letting me think out loud :-).

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >