Daily Archives

Articles indexed Sunday May 23 2010

Page 4/78 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • TRICKEY ONE PLEASE SOLVE

    - by jack
    Create a DTD to record the sellers of merchandise to the Second-hand shop. Each seller has the child elements sellerID (in the format KSXXXXXXX), name, address, phone and sighted_identification. ? the name element has child elements of title and firstname and surname ? the address element has child elements address_line, suburb, state and postcode ? the sighted_identification can be any of the following – passport – drivers licence – birth certificate – Medicare card. –1. Create a DTD to record the sellers of merchandise to the Second-hand shop. Each seller has the child elements sellerID (in the format KSXXXXXXX), name, address, phone and sighted_identification. ? the name element has child elements of title and firstname and surname ? the address element has child elements address_line, suburb, state and postcode ? the sighted_identification can be any of the following – passport – drivers licence – birth certificate – Medicare card. Create an XML document for five sellers including at least two with multiple sighted identifications. 3. Create an XSLT style sheet to logically display all of the seller’s details. Note 1: it may help you to create lists for both sellers and for sighted_identification. Note 2: The shops database stores the sighted identification of sellers as p, dl, bc and mc rather than by their full name, so creating an entity for each type is required. Note 3: Your XSLT should order the sellers by sellerID – for this reason don’t have them ordered correctly in the XML file – rather sort the sellerID within the XSLT. OUTPUT SHOULD BE SOMETHING LIKE THIS SELLER ID : NAME: ADDRESS : PHONE : IDENTIFICATION : IDENTIFICATION : IDENTIFICATION :

    Read the article

  • can these templates be made unambiguous

    - by R Samuel Klatchko
    I'm trying to create a set of overloaded templates for arrays/pointers where one template will be used when the compiler knows the size of the array and the other template will be used when it doesn't: template <typename T, size_t SZ> void moo(T (&arr)[SZ]) { ... } template <typename T> void moo(T *ptr) { ... } The problem is that when the compiler knows the size of the array, the overloads are ambiguous and the compile fails. Is there some way to resolve the ambiguity (perhaps via SFINAE) or is this just not possible.

    Read the article

  • Installer Creators? What do you recommend?

    - by bobber205
    Can't find a generic topic about this but what do you guys recommend for an application that creates a simple installer? Just need something that places it into an appropriate folder in Program Files, adds shortcuts to the StartMenu. My professor recommend Superpimp but that seems like overkill. :P Thanks SO!

    Read the article

  • Maven "Module" vs "Project" (Eclipse, m2eclipse plugin)

    - by Ricket
    I'm a beginner at Maven and I've played with it from a command line point of view a little, so now I was trying to use it in Eclipse; I installed the m2eclipse plugin to do so. But I'm stumped from the very beginning! Apparently I've missed a bit of terminology somewhere along the line. I can't keep track of all these new Maven terms... What is a Maven Project, and what is a Maven Module? These are my options when creating a new project in the Maven category in Eclipse.

    Read the article

  • PHP (CodeIgniter) Pass Object Through Session

    - by FranticPedantic
    I am using PHP5 and CodeIgniter and I am trying to implement a single-sign on feature with facebook (although I don't think that facebook is relevant to the question). I am somewhat of a novice with PHP and definitely one with CodeIgniter, so if you think my approach is just completely off telling me that would be helpful too. So here is in short what I am doing: //Controller 1 $this->load->plugin("facebook"); $facebook = new Facebook(array ( 'appId' => $fbconfig['appid'], 'secret' => $fbconfig['secret'], 'cookie' => true, ) ); $fbsession = $facebook->getSession(); //works fine $this->session->set_userdata('facebook', serialize($facebook); Now I would like to grab that facebook object in a different controller. //Controller 2 $facebook = unserialize($this->session->userdata('facebook')); $fbsession = $facebook->getSession(); Produces the error: Call to undefined method getSession. So I look up more about serialization and think that maybe it just doesn't know what the facebook object's attributes are. So I add in a $this->load->plugin('facebook'); To controller 2 as well and I get a "Cannot redeclare class facebook." I am strongly suspecting that I am misunderstanding sessions here. Do I have to somehow tell PHP what kind of object it is? Thanks for the help.

    Read the article

  • What software has been written in Scheme?

    - by skiphoppy
    I loved Scheme in the programming languages concepts class I took several years ago. Ever since reading what Paul Graham has to say about Lisp, I've been intending to go back and pick Scheme up again and see if it'll improve my programming in general. Are there any well-known works of software written in Scheme? Open source packages? Websites?

    Read the article

  • Are there any purely functional Schemes or Lisps?

    - by nickname
    Over the past few months, I've put a lot of effort into learning (or attempting to learn) several functional programming languages. I really like math, so they have been very natural for me to use. Simply to be more specific, I have tried Common Lisp, Scheme, Haskell, OCaml, and (a little bit of) Erlang. I did not like the syntax of OCaml and do not have enough Erlang knowledge to make a judgment on it yet. Because of its consistent and beautiful (non-)syntax, I really like Scheme. However, I really do appreciate the stateless nature of purely functional programming languages such as Haskell. Haskell looks very interesting, but the amount of inconsistent and non-extendable syntax really bothered me. In the interest of preventing a Lisp vs Haskell flame war, just pretend that I can't use Haskell for some other reason. Therefore, my question is: Are there any purely functional Schemes (or Lisps in general)?

    Read the article

  • Is there a BitTorrent client that can download files "in sequence"?

    - by Bob M
    Is there a BitTorrent client that can download files "in sequence"? For example, download clip 01.avi (high priority) clip 02.avi (normal priority) clip 03.avi (low priority) clip 04.avi (low) clip 05.avi (low) then when clip 01.avi is done, it will automatically make it: clip 01.avi (high priority) clip 02.avi (high priority) clip 03.avi (normal priority) clip 04.avi (low priority) clip 05.avi (low) this can be useful when download *.rar as well, since download clip.rar, and then clip.r00, r01, r02, in sequence can allow previewing the file by using RAR to recompose the file (even though incomplete file, but will allow previewing). Update: will making all files active still considered a bad use of BT?

    Read the article

  • Creating an image from webcam every x miliseconds

    - by Rita
    Hello everyone, I am using c# to integrate with a web cam. I need to generate a snapshot image every x miliseconds and save it to file. I already have the code up and running to save to file on a button click event, however I wonder what am I supposed to do when taking snapshots in the background - Should this be multi threaded? I'm honestly not sure. I could just block the UI thread, put Thread.Sleep and then just take the snapshot, but I don't know if this is right. I thought of using a background worker, but I am now experiencing cross threaded difficulties with SendMessage... So I wonder if I should even go and bother to multi-thread or just block the UI. Help greatly appertained, thanks in advance.

    Read the article

  • WPF BindingListCollectionView to ListCollectionView for DataTable as ItemsSource

    - by Marco
    Hi everyone, I want to do custom sorting on a ListView which has a DataTable as ItemsSource: myListView.ItemsSource = (data as DataTable); And this are the first lines of my sorting function: DataView view = (myListView.ItemsSource as DataTable).DefaultView; ListCollectionView coll = (ListCollectionView)CollectionViewSource.GetDefaultView(view); The second line throws an execption like: Unable to cast "System.Windows.Data.BindingListCollectionView" to "System.Windows.Data.ListCollectionView" Has anyone a solution? Thx 4 answers

    Read the article

  • How to set RAILS_ENV variable when running Rails tests?

    - by Jason
    In both my environment.rb and test_helper.rb files I have: ENV["RAILS_ENV"] = "development" I have one functional test written, however when I run it, the script tries to connect to my database using the "test" configuration settings which are in the database.ymal file & won't connect the the database. How can I run my tests using the "development" environment settings?

    Read the article

  • Ruby on Rails undefined method `camelize' for "app":String

    - by Lukasz
    Hi! I just tried to play with Ruby on Rails on Snow Leopard. I was following this tutorial: http://developer.apple.com/tools/rubyonrails.html Whatever I try to do with rails I end up with: MacBook-Pro-lm:~ lukasz$ rails blog **undefined method `camelize' for "app":String** MacBook-Pro-lm:~ lukasz$ rails --help **undefined method `camelize' for "app":String** Really basic things... however - verbosing rails works: MacBook-Pro-lm:bin lukasz$ rails -v Rails 2.3.5 MacBook-Pro-lm:~ lukasz$ ruby -v ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin10] MacBook-Pro-lm:bin lukasz$ gem -v 1.3.7 So it seems I have installed and upgarded ruby (using macports), rubygems and rails successfully (according to terminal). There are also few other packages installed to support we development like passenger and mysql5, etc... I can find ruby installed in the /opt/local/bin directory. My environment PATH variable is: PATH=/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin The is something fishy going on. It must be some stupid basic problem. Google says that there could be a problem with ruby-iconv library but I can not find/install this package using port or gem commands. Plese help.... what am I missing here?

    Read the article

  • I disconnected my cellphone while transferring files to its Mini SD card. Now the files aren't there

    - by Martín Fixman
    I use Ubuntu 9.10, and the MiniSD card shows as having the space used as if there were files. Baobab (the disk usage analyzer) shows that the card only has 118 MB used (of the 401 Ubuntu claims there are). Of course, I already tried the obvious (rebooting the phone, adding and removing files, etc.), but I don't want to format my card, because I still have some files on it, the transfer to my computer is slow, and because I use an old wire it fails often.

    Read the article

  • Safari box shadow inset support

    - by codedude
    I have a box in one of my websites that has a these property: -moz-box-shadow:inset 0 0 50px #ecf4de; -webkit-box-shadow:inset 0 0 50px #ecf4de; box-shadow:inset 0 0 50px #ecf4de; This gives the box a nice gradient towards the center. However, Safari does not support the "inset" property and IE doesn't support box-shadow at all. I can't use an image for this because the height of this box changes for each situation. I don't want to use 3 images, (one for the top, a repeating one for the middle and one for the bottom), as this can get very messy code. So what I'm asking is if there is any way to produce the box shadow in all browsers.

    Read the article

  • Move Image or Div Up As Window Resizes?

    - by Wade D Ouellet
    Hi, I have an image in my html with a class of "stretch". Currently, with css, this image re-sizes as the window re-sizes to be 100% of the screen width. I would also like it to move upwards as the window is being re-sized. I'm assuming this can be done with jQuery but I am not quite sure. Basically the "top" css value just needs to change as the screen width does. Here is the css that is currently re-sizing it: .stretch { width: 100%; height: auto; min-height: 420px; position: absolute; top: -200px; } Thanks, Wade

    Read the article

  • Is there a way to make sure a background process spawned by my program is killed when my process ter

    - by Davy8
    Basically the child process runs indefinitely until killed in the background, and I want to clean it up when my program terminates for any reason, i.e. via the Taskmanager. Currently I have a while (Process.GetProcessesByName("ParentProcess").Count() 0) loop and exit if the parent process isn't running, but it seems pretty brittle, and if I wanted it to work under debugger in Visual Studio I'd have to add "ParentProcess.vshost" or something. Is there any way to make sure that the child process end without requiring the child process to know about the parent process? I'd prefer a solution in managed code, but if there isn't one I can PInvoke. Edit: Passing the PID seems like a more robust solution, but for curiosity's sake, what if the child process was not my code but some exe that I have no control over? Is there a way to safeguard against possibly creating orphaned child processes?

    Read the article

  • Implementing the tree with reference to the root for each leaf

    - by AntonAL
    Hi, i implementing a products catalog, that looks, like this: group 1 subgroup 1 subgroup 2 item 1 item 2 ... item n ... subgroup n group 2 subgroup 1 ... subgroup n group 3 ... group n The Models: class CatalogGroup < ActiveRecord::Base has_many: catalog_items has_many :catalog_items_all, :class_name => "CatalogItem", :foreign_key => "catalog_root_group_id" end class CatalogItem < ActiveRecord::Base belongs_to :catalog_group belongs_to :catalog_root_group, :class_name => "CatalogGroup" end Migrations: class CreateCatalogItems < ActiveRecord::Migration def self.up create_table :catalog_items do |t| t.integer :catalog_group_id t.integer :catalog_root_group_id t.string :code t.timestamps end end For convenience, i referenced each CatalogItem to it's top-most CatalogGroup and named this association "catalog_root_group". This will give us the simple implementation of search request, like "show me all items in group 1". We will have a deal only with CatalogModel.catalog_root_group The problem is - this association does't work. I always get "catalog_root_group" equals to nil Also, i have tried to overcome the using of reference to root group ("catalog_root_group"), but i cannot construct appropriate search request in ruby ... Do you know, how to do it ?

    Read the article

  • seeking j2ee books recommendation

    - by john
    Hi, I'm thinking of a serious training in j2ee and found there are too many books to choose from. Could you kindly share your insights as a practicing professional in this respect? For example, some people in other post recommend "SCWCD Exam Study Kit Second Edition Java Web Component Developer Certification Hanumant Deshmukh, Jignesh Malavia, and Matthew Scarpino" by quickly looking at Amazon, I found Enterprise JavaBeans 3.0 (5th Edition) [Paperback] Richard Monson-Haefel received 141 reviews.... thanks

    Read the article

  • Putting update logic in your migrations

    - by Daniel Abrahamsson
    A couple of times I've been in the situation where I've wanted to refactor the design of some model and have ended up putting update logic in migrations. However, as far as I've understood, this is not good practice (especially since you are encouraged to use your schema file for deployment, and not your migrations). How do you deal with these kind of problems? To clearify what I mean, say I have a User model. Since I thought there would only be two kinds of users, namely a "normal" user and an administrator, I chose to use a simple boolean field telling whether the user was an adminstrator or not. However, after I while I figured I needed some third kind of user, perhaps a moderator or something similar. In this case I add a UserType model (and the corresponding migration), and a second migration for removing the "admin" flag from the user table. And here comes the problem. In the "add_user_type_to_users" migration I have to map the admin flag value to a user type. Additionally, in order to do this, the user types have to exist, meaning I can not use the seeds file, but rather create the user types in the migration (also considered bad practice). Here comes some fictional code representing the situation: class CreateUserTypes < ActiveRecord::Migration def self.up create_table :user_types do |t| t.string :name, :nil => false, :unique => true end #Create basic types (can not put in seed, because of future migration dependency) UserType.create!(:name => "BASIC") UserType.create!(:name => "MODERATOR") UserType.create!(:name => "ADMINISTRATOR") end def self.down drop_table :user_types end end class AddTypeIdToUsers < ActiveRecord::Migration def self.up add_column :users, :type_id, :integer #Determine type via the admin flag basic = UserType.find_by_name("BASIC") admin = UserType.find_by_name("ADMINISTRATOR") User.all.each {|u| u.update_attribute(:type_id, (u.admin?) ? admin.id : basic.id)} #Remove the admin flag remove_column :users, :admin #Add foreign key execute "alter table users add constraint fk_user_type_id foreign key (type_id) references user_types (id)" end def self.down #Re-add the admin flag add_column :users, :admin, :boolean, :default => false #Reset the admin flag (this is the problematic update code) admin = UserType.find_by_name("ADMINISTRATOR") execute "update users set admin=true where type_id=#{admin.id}" #Remove foreign key constraint execute "alter table users drop foreign key fk_user_type_id" #Drop the type_id column remove_column :users, :type_id end end As you can see there are two problematic parts. First the row creation part in the first model, which is necessary if I would like to run all migrations in a row, then the "update" part in the second migration that maps the "admin" column to the "type_id" column. Any advice?

    Read the article

  • how to have separate keys per record in mongo_mapper + Rails

    - by Vitaly Kushner
    When I'm adding a record in mongodb I can specify whatever keys I want and it will store it in the db. The problem is that it will remember those keys for the next time I insert another record. so for example if I do the following: Product.create :foo => 123 and then Product.create :bar => 456 I get :foo => nil field in the 2nd record. This is definitely not a limitation of mongodb itself, since if I restart the rails console and create yet another record with different set of columns, it will not add the columns from the 1st 2 records. So it seems like mongomapper remembers all the keys used and inserts them all into all records, even if values are not provided. The question is obviously: how do I disable this crazy attributes explosion? Basically I want only the 'permanent' keys that I specify in the model to be in every record, but all the 'extra' attributes to be specified per record and not to mess the consequent records.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >