Posts

git - updating local copy of repository using GitHub for Windows -

i used github windows clone repository(for contributor) local system.now changes have been pushed master copy @ github , want update local copy updates using github windows. tried sync repository guess sync local copy not update after sync shows 'no uncommitted changes'. how can it? using 'sync' option both pushes , pulls, you've updated copy. the 'no uncommitted changes' message means haven't made changes repository aren't committed.

Ruby takes the doubled amount of RAM it should -

i trying things out homeserver , wrote little ruby program fills ram given amount. have halve amount of bytes want put ram. missing here or bug? here code: class ram def initialize @b = '' end def fill_ram(size) puts 'choose if want set size in bytes, megabytes or gigabytes.' answer = '' valid = ['bytes', 'megabytes', 'gigabytes'] until valid.include?(answer) answer = gets.chomp.downcase if answer == 'bytes' size = size * 0.5 elsif answer == 'megabytes' size = size * 1024 * 1024 * 0.5 elsif answer == 'gigabytes' size = size * 1024 * 1024 * 1024 * 0.5 else puts 'please choose between bytes, megabytes or gigabyte.' end end size1 = size if @b.bytesize != 0 size1 = size + @b.bytesize end until @b.bytesize == size1 @b << '0' * size end size = 0 end def...

ios - Have keyboard already presented on view on viewDidAppear? -

i have uipageviewcontroller initialized 3 controllers. when swipe right, presenting uiview has uitextview becomes firstresponder. trying achieve have keyboard appearing when user swipes right, , when swipe away hide keyboard within view. seems keyboard added onto window? facebook seems achieve when posting new post, keyboard seems loaded before view appears? i able keyboard show without animating keyboard when becomefirstresponder invoked on uitextview. there seems delay on when keyboard appears. self.composeview.bodytextview.inputaccessoryview = [uiview new]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(willshowkeyboard:) name:uikeyboardwillshownotification object:nil]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(didshowkeyboard:) ...

php - increment in array -

i have earlier asked question mistake, deleted question reposting question. if (isset($_request['receipts'])) { $params['date'] = '31 jan 2000'; $response = $auth->request('get', $auth->url('receipts/travel', 'core'), $params); if ($auth->response['code'] == 200) { $receipt = $auth->parseresponse($oauth->response['response'], $auth->response['format']); pr($receipt->receipts); } else { outputerror($auth); } } this piece of code provides me travel receipts on 31 jan 2000 , wanted include foreach loop travel receipts whole 12 months of 2000 28 feb 2000, 31 mar 2000 , on till 31 dec 2000. i beginner , hence tried following basic foreach loop didnt work know misplaced logic. if (isset($_request['receipts'])) { $months = array( " 31 jan 2000"," 28 feb 2000"," 31 mar 2000","30 apr 2000","31 may 2000","30...

c++ - C Tokenize String -

im trying tokenize string delimiters while keeping delimiters. tried using strtok(string, delimiters) function doesn't keep delimiters. example, if string is: "my name < is|john >hi" i want split when see symbols "space", "<", ">" . the tokens be: my, space, name, space, < , space, is, |, john, space, <, hi at first, tried read char char until saw delimiter symbol. if didnt see symbol, append read char string before it. example, string "hi|bye". read "h", read next char. "i" append "h". read next symbol, delimiter put "hi" array , "|" array. repeat until done. ran issues doing this. here's code doesn't work: int main() { char *line = "command1 | command2 command3 > command4 < command5"; do_tokenize(line); return 0; } void do_tokenize(char *line) { char *tokenized[100]; char token[100]; int tokencounter = 0;...

textcolor - how to create textview link without underscore in android -

i came wired situation, code follow linearlayout ll = new linearlayout(this); textview tv = new textview(this); ll.addview(tv); tv.settext(html.fromhtml("<a style=\"text-decoration:none;\" href=\"" + stringescapeutils.escapejava(elem.getchildtext("newslink")) + "\">" + stringescapeutils.escapejava(elem.getchildtext("title")) + "</a>")); tv.settextcolor(color.black); but style="text-decoration:none" , tv.settextcolor(color.black) both not working, link still in blue underscore, hints on why they're not working? thanks! you can try this. such as string content = "your <a href='http://some.url'>html</a> content"; here concise way remove underlines hyperlinks: spannable s = (spannable) html.fromhtml(content); (urlspan u: s.getspans(0, s.length(), urlspan.class)) { s.setspan(new underlinespan() { public vo...

c# - why nothing shows up in my output file, it comes out to be blank? -

using system; using system.collections.generic; using system.linq; using system.text; using system.text.regularexpressions; using system.io; namespace wordfreq { class program { static void main(string[] args) { string fullreview = file.readalltext("c:\\reviews.txt").tolower(); string[] stripchars = { ";", ",", ".", "-", "_", "^", "(", ")", "[", "]", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "\n", "\t", "\r","<",">" }; foreach (string character in stripchars) { fullreview = fullreview.replace(character, ""); } // split o...