Search Results

Search found 17 results on 1 pages for 'user94154'.

Page 1/1 | 1 

  • Uses of Erlang in Telecom

    - by user94154
    I'm a web developer and a college student majoring in telecommunications. This means I'm decent at programming and I know a little about telecom networks (at a high, non-technical level). I keep reading that Erlang is used all over the telecom industry (supposedly for its performance). I'm wondering if there's anyway I can combine my programming skills with my telecommunications major with Erlang. Is most of the Erlang/telecom stuff closed source? Are there any open source telecom projects written Erlang? UPDATE: sipwiz's comment makes me think in terms of a question larger than "uses of Erlang". How can I leverage a high-level understanding of telecom networks and the telecom regulatory environment with programming. I hope this hasn't veered too off-topic for SO.

    Read the article

  • Rails flash hash violation of MVC?

    - by user94154
    I know Rails' flash hash is nothing new, but I keep running into the same problem with it. Controllers should be for business logic and db queries, not formatting strings for display to the user. But the flash hash is always set in the controller. This means that I need to hack and work around Rails to use Helpers that I made to format strings for the flash hash. Is this just a pragmatic compromise to MVC or am I missing something here? How do you deal with this problem? Or do you not even see it as one?

    Read the article

  • Re-factoring a CURL request to Ruby's RestClient

    - by user94154
    I'm having trouble translating this CURL request into Ruby using RestClient: system("curl --digest -u #{@user}:#{@pass} '#{@endpoint}/#{id}' --form image_file=@'#{path}' -X PUT") I keep getting 400 Bad Request errors. As far as I can tell, the request does get properly authenticated, but hangs up from the file upload part. Here are my best attempts, all of which get me those 400 errors: resource = RestClient::Resource.new "#{@endpoint}/#{id}", @user, @pass #attempt 1 resource.put :image_file => File.new(path, 'rb'), :content_type => 'image/jpg' #attempt 2 resource.put File.read(path), :content_type => 'image/jpg' #attempt 3 resource.put File.open(path) {|f| f.read}, :content_type => 'image/jpg'

    Read the article

  • Use hash or case-statement [Ruby]

    - by user94154
    Generally which is better to use?: case n when 'foo' result = 'bar' when 'peanut butter' result = 'jelly' when 'stack' result = 'overflow' return result or map = {'foo' => 'bar', 'peanut butter' => 'jelly', 'stack' => 'overflow'} return map[n] More specifically, when should I use case-statements and when should I simply use a hash?

    Read the article

  • Trouble installing Rhodes framework

    - by user94154
    When I run rake run:android, I get the error (I'm using Ubuntu): Your java bin folder does not appear to be on your path. This is required to use rhodes. Here is the relevant part of my bash.bashrc file: export PATH="$PATH:$HOME/ruby/gems/bin" export GEM_HOME="$HOME/ruby/gems" export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8" export GEM_CACHE="$GEM_HOME/cache" export RUBYOPT=rubygems export ANDROID_HOME="/home/username/ruby_files/android-sdk-linux_86" PATH="$PATH:$ANDROID_HOME/tools" export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0_21 export JAVA_HOME PATH=$PATH:$JAVA_HOME/bin export PATH

    Read the article

  • Reversing column values in mysql command line

    - by user94154
    I have a table posts with the column published, which is either 0 (unpublished) or 1 (published). Say I want to make all the published posts into unpublished posts and all the unpublished posts into published posts. I know that running UPDATE posts SET published = 1 WHERE published = 0; UPDATE posts SET published = 0 WHERE published = 1; will end up turning all my posts into published posts. How can I run these queries in the mysql command line so that it truly "reverse" the values, as opposed to the mistake outlined above? Thanks

    Read the article

  • How to stay DRY when using both Javascript and ERB templates (Rails)

    - by user94154
    I'm building a Rails app that uses Pusher to use web sockets to push updates to directly to the client. In javascript: channel.bind('tweet-create', function(tweet){ //when a tweet is created, execute the following code: $('#timeline').append("<div class='tweet'><div class='tweeter'>"+tweet.username+"</div>"+tweet.status+"</div>"); }); This is nasty mixing of code and presentation. So the natural solution would be to use a javascript template. Perhaps eco or mustache: //store this somewhere convenient, perhaps in the view folder: tweet_view = "<div class='tweet'><div class='tweeter'>{{tweet.username}}</div>{{tweet.status}}</div>" channel.bind('tweet-create', function(tweet){ //when a tweet is created, execute the following code: $('#timeline').append(Mustache.to_html(tweet_view, tweet)); //much cleaner }); This is good and all, except, I'm repeating myself. The mustache template is 99% identical to the ERB templates I already have written to render HTML from the server. The intended output/purpose of the mustache and ERB templates are 100% the same: to turn a tweet object into tweet html. What is the best way to eliminate this repetition? UPDATE: Even though I answered my own question, I really want to see other ideas/solutions from other people--hence the bounty!

    Read the article

  • Ruby: Dynamically calling available methods raising undefined method (metaprogramming)

    - by user94154
    I have an Activerecord object called Foo: Foo.attribute_names.each do |attribute| puts Foo.find(:all)[0].method(attribute.to_sym).call end Here I'm calling all attributes on this model (ie, querying for each column value). However, sometimes, I'll get an undefined method error. How can ActiveRecord::Base#attribute_names return an attribute name that when converted into its own method call, raises an undefined method error? Thank

    Read the article

  • Dynamically changing validations in Rails

    - by user94154
    I have a model with a validation. At runtime, I'd like to change a value of the validation. For example: in the model bid.rb: class Bid ActiveRecord::Base @foo = Foo.find(1) validates_inclusion_of :amt, :in => [email protected], :message => "must be between 1 and #{@foo.bar}" end and in the application_controller (pseudocode): if today == 'wednesday' Foo.update(1, :bar => 10) else Foo.update(1, :bar => 5) end However, this setup isn't working. The "foo" attribute never updates. It seems that the validation code is set only when the dev server starts and then doesn't change.

    Read the article

  • iPad as programming platform--What future do touch screens have with programming?

    - by user94154
    I read this question a few weeks ago. I thought about it when I first saw the iPad. Do you think it would be possible to set up a development environment on the iPad? I think it would be awesome if there was an InstantRails App, a Django App, maybe even 280 North's Atlas could run on it :). Would you develop using an on-screen keyboard and a 10 inch screen? Steve Jobs seems to think touch-screens are the future of web browsing. What Future does touch have with programming?

    Read the article

  • Using non-Railsy route to prepopulate a form

    - by user94154
    I have many instances of a Rails model, Post. When viewing an individual post, I'd like to create a form to create a child of Post called Comment. I'd like to prepopulate this form with a hidden tag that contains the post_id which is the foreign key in Comment. The Railsy way to do this is to create a fancy-ish route such as: /comments/new/post/:post_id However, this gunks up the routes file and doesn't leave much flexibility. Let's say I want to create a link somewhere else that prepopulates a different attribute of the form...then I'd have to add another route for this. So I think I'm going to create urls like this on /posts/show/:id: /comments/new?comment[post_id]=<%= @post.id %> This way I can add any other attributes as I need. I know the plus side associated with this, now what are the downsides?

    Read the article

  • Search for string within text column in MySQL

    - by user94154
    I have mysql table that has a column that stores xml as a string. I need to find all tuples where the xml column contains a given string of 6 characters. Nothing else matters--all I need to know is if this 6 character string is there or not. So it probably doesn't matter that the text is formatted as xml. Question: how can I search within mysql? ie SELECT * FROM items WHERE items.xml [contains the text '123456'] Is there a way I can use the LIKE operator to do this? Thanks

    Read the article

1