Search Results

Search found 34 results on 2 pages for 'macek'.

Page 1/2 | 1 2  | Next Page >

  • Trying to find a duplicate version of PHP on my system. Where is it?

    - by macek
    I have having a helluva time trying to track down which php binary my apache is using. locate bin/php returns this list /usr/bin/php /usr/bin/php-cgi /usr/bin/php-config /usr/bin/phpize /usr/local/bin/php /usr/local/bin/php-cgi /usr/local/bin/php-config /usr/local/bin/php-shell.sh /usr/local/bin/phpize Let's see the versions: /usr/bin/php -v shows 5.3.2 /usr/bin/local/php -v shows 5.3.2 What about which? [macek ~]$ which php /usr/bin/php The problem phpinfo(); when executed by apache shows 5.2.11 Where is this phantom 5.2.11 on my system?

    Read the article

  • Howto: Download local copy of Google's Pacman game

    - by macek
    It looks like this is HTML+JavaScript. Is there a way I can download a copy so I can continue playing after they take it down? Thanks for any help :) Edit Ok, ok, I wasn't completely forthcoming. Not only would I like to continue playing it, I kinda want to look at the source code, too... I was able to find this: Google pacman10-hp.2.js See it reformatted on Github here. Thanks @SteD Github repo I setup a github repo: macek/google_pacman. Check out the README, I think we're very close! Send me pull request if you make any progress. Put any useful details in the README. Let's get this working! :)

    Read the article

  • Why would you use EAP-TTLS instead of PEAP?

    - by Ivan Macek
    As I understood EAP-TTLS and PEAP share same level of security when implemented in wireless networks. Both only provide server side authentication via certificate. The drawback of EAP-TTLS can be non native support in Microsoft Windows so every user has to install additional software. The benefit of EAP-TTLS can be support for less secure authentication mechanisms (PAP, CHAP, MS-CHAP) but why would you need them in modern and properly secure wireless system? What are you opinions? Why should I implement EAP-TTLS instead of PEAP? Let's say that I have most Windows users, medium Linux users and least iOS, OSX users.

    Read the article

  • Easy way to access cookies in Chrome

    - by macek
    To view specific cookies in Chrome, currently I have to: Go to preferences Click Under the Hood tab Click Content Settings... button Click Cookies tab (if it's not already active) Click Show cookies and other site data... button If I want to narrow this down to a specific domain, I have to type it in, too. Compare this to Firefox: View Page Info Click Security tab Click View Cookies The domain for the page I'm currently on is already used as a filter, too. My question: Is there an easier way in Chrome? I've done some searching for an extension but have come up with nothing.

    Read the article

  • Easy way to access cookies in Chrome

    - by macek
    To view specific cookies in Chrome, currently I have to: Go to preferences Click Under the Hood tab Click Content Settings... button Click Cookies tab (if it's not already active) Click Show cookies and other site data... button If I want to narrow this down to a specific domain, I have to type it in, too. Compare this to Firefox: View Page Info Click Security tab Click View Cookies The domain for the page I'm currently on is already used as a filter, too. My question: Is there an easier way in Chrome? I've done some searching for an extension but have come up with nothing. Any help is appreciated :)

    Read the article

  • How to remove a package I compiled and installed manually?

    - by macek
    I recently compiled and installed Git on a new install of Mac OS 10.6 but it didn't install the documentation. I now realize I should've used the precompiled package offered here: http://code.google.com/p/git-osx-installer/downloads/list How do I remove all the files that I added to my system using make install with the Git source code? Edit: I've had similar problems in the past with other packages, too. For example, ./configure with the incorrect --prefix= or something. What's the general practice for removing unix packages?

    Read the article

  • How to add custom SOAP-Header element to the generated WSDL in Spring-WS

    - by Petr Macek
    Hi, we are migrating from WebLogic web-services to Spring-WS (1.5.X). There is currently one issue we are facing: We need to pass a context object (on WLS it is passed as SOAP-Header element) to other services that are still running on WLS from the Spring-WS powered service. The header element is still formulated on client side and the newly created WS (Spring-WS) should just pass it to other services. I can imagine how the custom element would be passed: override the doWithMessage(WebServiceMessage message) method... Is there a way to generate the wsdl with the help of DefaultWsdl11Definition to contain that custom header element? See the example: <wsdl:operation name="GetSomeInformation"> <soap:operation soapAction="http://www.dummyservice.com/InformationService/GetSomeInformation" /> <wsdl:input> <soap:body use="literal" /> <soap:header message="ctx:ServiceContextMessage" part="serviceContext" use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> <wsdl:fault name="Error"> <soap:fault name="Error" use="literal" /> </wsdl:fault> </wsdl:operation> Thanks for help

    Read the article

  • Build associative array based on values of another associative array

    - by macek
    I'm looking for an elegant way to turn this array: Array ( [foo] => 1 [bar] => 1 [zim] => 3 [dib] => 6 [gir] => 1 [gaz] => 3 ) Into this array: Array ( [1] => Array ( foo, bar, gir ), [3] => Array ( zim, gaz ), [6] => Array ( dib ) ) Note:, there is no relationship between the keys or values. They are completely arbitrary and used as examples only. The resulting array should be an associative array grouped by the values of the input array. Thanks!

    Read the article

  • Math: How to sum each row of a matrix

    - by macek
    I have a 1x8 matrix of students where each student is a 4x1 matrix of scores. Something like: SCORES S [62, 91, 74, 14] T [59, 7 , 59, 21] U [44, 9 , 69, 6 ] D [4 , 32, 28, 53] E [78, 99, 53, 83] N [48, 86, 89, 60] T [56, 71, 15, 80] S [47, 67, 79, 40] Main question: Using sigma notation, or some other mathematical function, how can I get a 1x8 matrix where each student's scores are summed? # expected result TOTAL OF SCORES S [241] T [146] U [128] D [117] E [313] N [283] T [222] S [233] Sub question. To get the average, I will multiply the matrix by 1/4. Would there be a quicker way to get the final result? AVERAGE SCORE S [60.25] T [36.50] U [32.00] D [29.25] E [78.25] N [70.75] T [55.50] S [58.25] Note: I'm not looking for programming-related algorithms here. I want to know if it is possible to represent this with pure mathematical functions alone.

    Read the article

  • weird behavior with acts_as_taggable_on

    - by macek
    For some reason, tags aren't showing up on a taggable object when an tagger is specified. testing the post class Post < ActiveRecord::Base acts_as_taggable_on :tags belongs_to :user end >> p = Post.first => #<Post id: 1, ...> >> p.is_taggable? => true >> p.tag_list = "foo, bar" => "foo, bar" >> p.save => true >> p.tags => [#<Tag id: 1, name: "foo">, #<Tag id: 2, name: "bar">] testing the user class User < ActiveRecord::Base acts_as_tagger has_many :posts end >> u = User.first => #<User id: 1, ...> >> u.is_tagger? => true >> u.tag(p, :with => "hello, world", :on => :tags) => true >> u.owned_tags => [#<Tag id: 3, name: "hello">, #<Tag id: 4, name: "world">] refresh the post >> p = Post.first => #<Post id: 1 ...> >> p.tags => [#<Tag id: 2, name: "bar">, #<Tag id: 1, name: "foo">] Where's the hello and world tags? Miraculously, if I modify the database directly to set tagger_id and tagger_type to NULL, the two missing tags will show up. I suspect there's something wrong with my User model? What gives?

    Read the article

  • Problem with url_for and named routes in ActionMailer View: "Need controller and action"

    - by macek
    I'm attempting to provide a confirmation link in my user welcome email and I'm getting the following Rails error: Need controller and action! It makes a fuss about this line: <p>Please take a moment to activate your account by going to: <%= link_to confirm_user_url(:id => @user.confirmation_code) %>.</p> In my development.rb environment, I have the following line: config.action_mailer.default_url_options = { :host => "localhost", :port => 3000 } There's no problem with the @user variable. I've tested the email with things like @user.username and @user.confirmation_code. I'm only getting trouble with url_for and named routes like confirm_user_url. When I check my routes with rake routes, confirm_user shows up, so it's not an issue with the named route not existing. I can't seem to figure it out. What gives?

    Read the article

  • Ruby File IO question; Maintain file read position between script executions

    - by macek
    I have two files a.txt and b.txt (henceforth a and b). My script iterates through a, does some operation, and potentially inserts a line to b. In the event the script stops, I need it to pick up where it left off. In the example below: foo was copied to b bar was copied to b zim was not copied to b (did not pass some criteria) gaz was copied to b Script stops (for whatever reason) When script starts again, how to open a and start on line "dib"? a.txt foo bar zim gaz // <= last successful copy dib // <= I want to start here on next script execution gir b.txt foo bar gaz // <= note omission of "zim" above gaz

    Read the article

  • has_many through a habtm relationship in Rails

    - by macek
    I'm trying to define a has_many X, :through => Y where Y is a habtm relationship. Rails is throwing a fit about this. See comment in user model: class User < ActiveRecord::Base has_many :posts # I want to display a list of all tags this user is involved in has_many :tags, :through => :posts # ERROR end class Post < ActiveRecord::Base has_and_belongs_to_many :tags end class Tag < ActiveRecord::Base has_and_belongs_to_many :posts end What can I do to fix this?

    Read the article

  • Docs for auto-generated methods in Ruby on Rails

    - by macek
    Rails has all sorts of auto-generated methods that I've often times struggled to find documentation for. For example, in routes.rb, if I have: map.resources :projects do |p| p.resources :tasks end This will get a plethora of auto-generate path and url helpers. Where can I find documentation for how to work with these paths? I generally understand how to work with them, but more explicit docs might help me understand some of the magic that happens behind the scenes. # compare project_path(@project) project_task_path(@project, @task) # to project_path(:id => @project.id) project_task_path(:project_id => @project.id, :id => @task.id) Also, when I change an attribute on a model, @post.foo_changed? will be true. Where can I find documentation for this and all other magical methods that are created like this? If the magic is there, I'd love to take advantage of it. And finally: Is there a complete resource for config.___ statements for environment.rb? I was able to find docs for Configuration#gem but what attributes can I set within the stubs like config.active_record.___, config.action_mailer.___, config.action_controller.___, etc. Again, I'm looking for a complete resource here, not just a settings for the examples I provided. Even if you can only answer one of these questions, please chime in. These things seem to have been hiding from me and it's my goal to get them some more exposure, so I'll be upvoting all links to docs that point me to what I'm looking for. Thanks! ps, If they're not called auto-generated methods, I apologize. Someone can teach me a lesson here, too :) Edit I'm not looking for tutorials here, folks. I have a fair amount of experience with rails; I'm just looking for complete docs. E.g., I understand how routing works, I just want docs where I can read about all of the usage options.

    Read the article

  • I want multipart/alternative; ActionMailer only sending text/html

    - by macek
    I'm following the Ruby on Rails Guide: ActionMailer Basics Section 2.7 Snippet: Action Mailer will automatically send multipart emails if you have different templates for the same action. So, for our UserMailer example, if you have welcome_email.text.plain.erb and welcome_email.text.html.erb in app/views/user_mailer, Action Mailer will automatically send a multipart email with the HTML and text versions setup as different parts. Well, I have both: app/views/user_mailer/welcome_mail.text.html.erb app/views/user_mailer/welcome_mail.text.plain.erb app/models/user_mailer.rb class UserMailer < ActionMailer::Base def welcome_mail(user) recipients user.email from "[email protected]" subject "Thanks for registering" body :user => user end end Any luck?

    Read the article

  • Adding RESTful route to Rails app

    - by macek
    I'm reading these two pages resources Adding more RESTful actions The Rails Guides page shows map.resources :photos, :new => { :upload => :post } And its corresponding URL /photos/upload This looks wonderful. My routes.rb shows this map.resources :users, :new => { :signup => :get, :register => :post } When I do: [~/my_app]$ rake routes I see the two new routes added signup_new_user GET /users/new/signup(.:format) register_new_user POST /users/new/register(.:format) Note the inclusion of /new! I don't want that. I just want /users/signup and /users/register (as described in the Rails Routing Guide). Any help?

    Read the article

  • How to make a jQuery plugin (the right way)?

    - by macek
    I know there are jQuery cookie plugins out there, but I wanted to write one for the sake of better learning the jQuery plugin pattern. I like the separation of "work" in small, manageable functions, but I feel like I'm passing name, value, and options arguments around too much. Is there a way this can be refactored? I'm looking for snippets of code to help illustrate examples provided with in answers. Any help is appreciated. Thanks :) example usage $.cookie('foo', 'bar', {expires:7}); $.cookie('foo'); //=> bar $.cookie('foo', null); $.cookie('foo'); //=> undefined Edit: I did a little bit of work on this. You can view the revision history to see where this has come from. It still feels like more refactoring can be done to optimize the flow a bit. Any ideas? the plugin (function($){ $.cookie = function(name, value, options) { if (typeof value == 'undefined') { return get(name); } else { options = $.extend({}, $.cookie.defaults, options || {}); return (value != null) ? set(name, value, options) : unset(name, options); } }; $.cookie.defaults = { expires: null, path: '/', domain: null, secure: false }; var set = function(name, value, options){ console.log(options); return document.cookie = options_string(name, value, options); }; var get = function(name){ var cookies = {}; $.map(document.cookie.split(';'), function(pair){ var c = $.trim(pair).split('='); cookies[c[0]] = c[1]; }); return decodeURIComponent(cookies[name]); }; var unset = function(name, options){ value = ''; options.expires = -1; set(name, value, options); }; var options_string = function(name, value, options){ var pairs = [param.name(name, value)]; $.each(options, function(k,v){ pairs.push(param[k](v)); }); return $.map(pairs, function(p){ return p === null ? null : p; }).join(';'); }; var param = { name: function(name, value){ return name + "=" + encodeURIComponent(value); }, expires: function(value){ // no expiry if(value === null){ return null; } // number of days else if(typeof value == "number"){ d = new Date(); d.setTime(d.getTime() + (value * 24 * 60 * 60 * 1000)); } // date object else if(typeof value == "object" && value instanceof "Date") { d = value; } return "expires=" + d.toUTCString(); }, path: function(value){ return "path="+value; }, domain: function(value){ return value === null ? null : "domain=" + value; }, secure: function(bool){ return bool ? "secure" : null; } }; })(jQuery);

    Read the article

1 2  | Next Page >