Posts

refactoring - How to move function declaration to another file yet retain Git history? -

i refactoring single-file php script declare functions , classes in separate files. how 1 move block of code 1 file file yet preserve git history each individual line? ability use @ least git blame on code. comparing older versions helpful. note not interested in 'workaround' solutions require additional commands or flags (such --follow ) on code view 'old' history, person viewing history have know file needs special treatment. looking solution writes necessary metadata such normal git commands such blame , log , diff , , such 'just work' without presenting them additional flags or arguments. i have read quite few posts looking solutions similar problems , none address issue of git blame on individual lines. 1 solution think work copy file , entire history , work off of that. however, question remains without satisfactory answer. warning: assumes rewriting history acceptable. not use unless know implications of rewriting history. to spl...

ruby on rails - how to append unique string at the end of resource routes in rails4 -

i tried rails guide , searched lot can find answer. trying generate secret post scaffold in rails 4 using scaffold generator scenario : users can create secret posts , link secret token in future works verification string rails g scaffold secret title:string content:text token:string i want append token value in "secret_posts" routes eg: : secret/1/sadkljaldjlak : secret/1/edit/sasadadallkha i want use token unique code verification . appreciated first, create migration chance token:string token:text, use secureramdom.urlsafe_base64 generate token, use code on model: def secret_token if self.new_record? self.token = securerandom.urlsafe_base64 end end after that, create route this: get 'secret/:edit_hash/edit', to: 'secret#edit', as: :secret_offer patch 'secret/:edit_hash', to: 'secret#update' put 'secret/:edit_hash', to: 'secret#update' and on c...

Facebook Search API, keyword search does not display posts made in a page but only in a profile -

i using facebook search api find posts include keyword. noticed posts returned belong facebook profiles never facebook pages. up, searched keywords of low frequency spotted in pages api did not return them. is there way can search keyword , posts pages ? taking @ the documentation : search &type=post . documentation: all public posts: https://graph.facebook.com/search?q=watermelon&type=post

php - How to pass current URL to mailto body -

i have problem passing url mail body. have use this: <?php function currentpageurl() { $pageurl = $_server['https'] == 'on' ? 'https://' : 'http://'; $pageurl .= $_server['server_port'] != '80' ? $_server["server_name"].":".$_server["server_port"].$_server ["request_uri"] : $_server['server_name'] . $_server['request_uri']; return $pageurl; } ?> and mailto:?body=<?php echo currentpageurl(); ?> instead of link result: http://www.something.com/index.php?id=03new&new=50&lang=en i 1 in mail body: http://www.something.com/index.php?id=03new please me how pass link including "&". thx '&' used in mailto separate different parts like: &subject=some_subject&body=message_body so interpreted (invalid) parameter mailto (and omitted). if want have '&' (and rest of url) inside body, needs replaced % val...

c# - KeyNotFoundException unhandled by user -

i trying retrieve query string value inside mainpage.xaml.cs , need access value accessing html id on different page(aspx). point if try access code querystring value not exist keynotfoundexception. i have tried overcome problem doing following htmldocument htmldoc = htmlpage.document; if (htmldoc.querystring["productcode"] != null) { productcode = htmldoc.querystring["productcode"].tostring(); } else { productcode = htmldoc.getelementbyid("vidweeklyfeature").getproperty("value").tostring(); } but still same exception. how can retrieve value based on condition value can accessed querystring or not? (sorry being bit inarticulate) you can use trygetvalue method rather use indexer. it this: htmldocument htmldoc = htmlpage.document; string productcode; if (!htmldoc.querystring.trygetvalue("productcode", out productcode)) { productcode = htmldoc.getelementbyid("vidweeklyfeature").getproperty(...

java - How to remap stripped text position to pdf document position -

i use pdfbox's pdftextstripper extract plain texts 2 pdf files compared using nlp algorithm. algorithm returns postions of common passages of plain texts. what want highlight common passages in pdf. problem have position in plain text not corresponding position in pdf. using pdftextstripper mapping lost. are there solutions/common approaches preserve mapping plain text position pdf document position while stripping text pdfs? accept use different pdf library if supports have use java.

jquery - Why dropdown menu doesn't work in IE9? -

i have dropdown menu works fine in browsers except ie9 . menu http://jsfiddle.net/7xuxv/2/ have no idea why doesnt'work! if have internet explorer 10 , want test in ie9 have hitting f12 on ie10 should start developer tools allows emulate ie9 using browser mode [read more] . any appreciated. thank much. you problem is: z-index: 1 !important; remove in css , works.. yet find why