Posts

navigation on a textmate page, front of line, end of line, up page etc -

navigation on a textmate page, front of line, end of line, up page etc - in textmate, when editing .rb page (or page), how jump start/end of line? , top/bottom of page? you can utilize emacs key bindings in cocoa text fields: c-a origin of line c-e end of line c-v page down c-p previous line c-n next line there others, these ones commonly use. textmate

html - Would iframes improve performance of sites with very large numbers of dom elements? -

html - Would iframes improve performance of sites with very large numbers of dom elements? - for sites big numbers of dom elements, there performance benefit presenting of content within iframe? example, application i'm working on has big html-based tree contain tens of thousands of nodes @ 1 time (albeit not loaded @ once). putting aside usability problems tree size presents, there benefit placing content within iframe, rather within main page? browsers handle memory differently content embedded within iframes? improve jquery selector performance isolating content? i'm interested in how applied ie 7, although curious if differs between browsers. +1 question. i'm not aware of differences in memory handling between frames , non-frames based content; i've written few xhtml parsers , memory memory; nodes take memory regardless of stored. id lookups done keys (hashtable), collections can quite big non-linear impact. that's parsing , memory side; ho...

ruby on rails - ActiveRecord changed? flag doesn't report changes in associated children -

ruby on rails - ActiveRecord changed? flag doesn't report changes in associated children - i've got next situation activerecord (in rails 2.3.8): class order < activerecord::base has_many :documents accepts_nested_attributes_for :documents end class document <activerecord::base belongs_to :order end now, in controller want direct user differently depending on whether or not made changes existing records, e.g. @order.attributes = params[:order] if @order.changed? # save order # redirect 1 place else # redirect place end for want utilize changed? flag. turns out @order.changed? not query children. i tried implement via association proxy method on has_many :documents association, so: has_many :documents def changed? any? {|doc| doc.changed?} end end but has unintended side-effect loads associated documents disk, apparently wipes out changes made in nested attributes assignment in @order.attributes = params[:order] e...

javascript - What is a good regular expression to match a URL? -

javascript - What is a good regular expression to match a URL? - this question has reply here: what best regular look check if string valid url? 36 answers currently have input box observe url , parse data. so right now, using: var urlr = /^(?:([a-za-z]+):)?(\/{0,3})([0-9.\-a-za-z]+) (?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/; var url= content.match(urlr); the problem is, when come in url www.google.com , not working. when entered http://www.google.com , working. i not fluent in regular expressions. can help me? regex if want ensure url starts https https?:\/\/(www\.)?[-a-za-z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-za-z0-9@:%_\+.~#?&//=]*) if not require https validation [-a-za-z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-za-z0-9@:%_\+.~#?&//=]*) to trial out see http://regexr.com?37i6s or version less restrictive htt...

c# - Programmatically add rules to "Windows Firewall with Advanced Security snap-in"? -

c# - Programmatically add rules to "Windows Firewall with Advanced Security snap-in"? - is there library in .net allow me manipulate windows firewall advanced security in windows 7? the reason inquire because, want able add together program/port exceptions programmatically. for example, want add together program.exe inbound rules section , program, want allow tcp port 5660 , udp port 5660. other ports should blocked programme alone; i reasoned comfortably set in inbound rules section in windows firewall advanced security; hope best way of doing it? however, how accomplish programmatically? i have seen illustration here, think 1 talks "allow programme through windows firewall snap-in", not have port information. greg's reply in question helped me. http://stackoverflow.com/questions/1242566/any-way-to-turn-the-internet-off-in-windows-using-c c# windows-7 firewall

azure - How can I create two DS series virtual machines within the same cloud service? -

azure - How can I create two DS series virtual machines within the same cloud service? - i need create 2 ds virtual machines within same cloud service. in existing portal easy, in preview portal there appears no options set cloud service when creating vm. the problem existing portal cannot create ds virtual machines, or virtual machines premium storage. whilst preview portal can create ds virtual machines, cannot create virtual machines within cloud service. i have tried create virtual machines in existing portal d series vm, , upgrade preview portal ds vm alternative not available. i hoping missing obvious. a central feature of cloud service shared dns name provides vip , load balancer. in preview portal capability exposed through shared dns name. give sec vm same dns name first vm. azure windows-azure-storage azure-virtual-machine azure-cloud-services

xml - Custom tab Excel -

xml - Custom tab Excel - i using custom xml editor ms office create new tab add-in. i've added next code within xlam file: <customui xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <ribbon startfromscratch="false"> <tabs> <tab id="comdinheiro" label="comdinheiro"> <group id="comdinheirologinbutton" label=" "> <button id="comdinheiro_login" label="login" image="login.png" size="large" onaction="onactionlogin"/> <button id="comdinheiro_configuracoes" label="config" image="config.png" size="large" onaction="onactionconfiguracao"/> <button id="comdinheiro_url_import" label="dados" image="dados.png" size="large" onaction=...