Posts

Counting the frequencies of bases using for loop and substr in perl -

Counting the frequencies of bases using for loop and substr in perl - i'm trying count number of bases using loop , substr function counts off , i'm not sure why! please help! have utilize these functions in assignment. going wrong? here code: use strict; utilize warnings; $user_input = "accgtutf5"; #initalizing lengths $a_base_total = 0; $c_base_total = 0; $g_base_total = 0; $t_base_total = 0; $other_total = 0; ( $position = 0; $position < length $user_input; $position++ ) { $nucleotide = substr( $user_input, $position, 1 ); if ( $nucleotide eq "a" ) { $a_base_total++; } elsif ( $nucleotide eq "c" ) { $c_base_total++; } elsif ( $nucleotide eq "g" ) { $g_base_total++; } elsif ( $nucleotide eq "t" ) { $t_base_total++; } else { $other_total++; } $position++; } print "a = $a_base_total\n"; print "c = $c_base_total\n"; print...

performance - Avoiding Landing Page Redirects with SSL -

performance - Avoiding Landing Page Redirects with SSL - i did google pagespeed analysis of website , received next message: avoid landing page redirects your page has 2 redirects. redirects introduce additional delays before page can loaded. avoid landing page redirects next chain of redirected urls. http://example.net/ https://example.net/ https://www.example.net/ is there can (like modifying htaccess file in way), or unavoidable consequence? here htaccess in case: rewritecond %{https} off # first rewrite https: # don't set www. here. if there included, if not # subsequent rule grab it. rewriterule ^(.*)$ https://%{http_host}%{request_uri} [l,r=301] # now, rewrite request wrong domain utilize www. rewritecond %{http_host} !^www\. rewriterule ^(.*)$ https://www.%{http_host}%{request_uri} [l,r=301] you can combine 2 redirects 1 using or flag rewritecond %{https} off [or] rewritecond %{http_host} !^www\. [nc] rewri...

php - How to clear cache or make the images run the code again in html? -

php - How to clear cache or make the images run the code again in html? - i running code <img src="../graphics/g_builder.php?type=funil&interval=1"/> <img src="../graphics/g_builder.php?type=funil&interval=3"/> <img src="../graphics/g_builder.php?type=conversao&interval=2"/> <img src="../graphics/g_builder.php?type=conversao&interval=3"/> <img src="../graphics/g_builder.php?type=nps&interval=2"/> that generates image in folder rest of code utilize later, works 1 time or pressing ctrl +f5 clears cache if im not wrong... so need way renew images everytime phone call php or somehow clear cache without using headers... can do? you append timestamp property end of src attribute. example: <img src="../graphics/g_builder.php?type=nps&amp;interval=2&amp;time=<?php print time(); ?>"/> this way, every time refresh page, src attribute differ...

c++ - JSON parsing with Qt -

c++ - JSON parsing with Qt - hei , have text in json : ( without returns in 1 line) [ { "error":false, "username":"benutzer", "format":"human", "latitude_min":84, "latitude_max":36, "longitude_min":5, "longitude_max":20, "records":203 }, [ { "mmsi":233434540, "time":"2014-10-09 06:19:06 gmt", "longitude":8.86037, "latitude":54.12666, "cog":347, "sog":0, "heading":236, "navstat":0, "imo":0, "name":"helgoland", "callsign":"dk6068", ...

html - WordPress float in article -

html - WordPress float in article - i made website wordpress , have problem float in article. http://img4.hostingpics.net/thumbs/mini_756574capturedcran20141013181858.png has can see, when sidebar finish, content go left , don't want that. want content in right. want content below other. my code: html (all article on tag: <div id="container"> <aside id="sidebar" role="complementary"> code of sidebar here... </aside> <article id="post-53" class="post-53 post type-post status-publish format-standard hentry category-non-classe">code of article here...</aticle> </div> css: #container { width:100%; margin:0 auto; max-width:1000px; margin-top:-3%; } aside{ width:30%; text-align:left; max-width:280px; padding:2%; float:left; background-color: #fff; -webkit-box-shadow: 1px 1px 0 0 rgba(0,0,0,0.1); box-shadow: 1px 1px 0 0 rgba(0,0,0,0...

Facebook permissions for an app which should tag/mention/post to user feed without friendship -

Facebook permissions for an app which should tag/mention/post to user feed without friendship - we event company offers scheme improving social media performance companies on events. f.e. user registers via net event (f.e. concert, sponsored big brand company). during registration process, user has grant permission our facebook app (so can tag/mention or post on feed name, or has our page), otherwise not allowed visit concert. we want following: after registration finished, post on user wall or mention user in post our app: f.e. "max mustermann: hey, visited concert #brandname" (as post on user feed user himself) or: "max mustermann visited concert of #brandname" (as story or mention) we offer scheme create pictures , pictures associated users (they can select user on photo). after user selects him on photo, photo should shared on facebook, either user himself or tagged our app). is there best practices to these things? implemented workflow alr...

regex - Regular Expression to find whitespaces and replace with a dash -

regex - Regular Expression to find whitespaces and replace with a dash - i thought might work: ^['\s+', '-', "this should connected"\w\s]{1,}$ but wrong it. no of regex place dashes between words while @ same time not placing dashes in front end of first word or behind lastly word? i need maintain in mind don't want dash before first word or after lastly word. and, have 1 word no dashes required. the syntax utilize rather strange. why utilize ^ , $ anyway? one can utilize next regex: s/\s+/-/g s means substitute occurence. g means global: matches should replaced. using tool sed or perl . example sed : sed -r 's/\s+/-/' < file regex