w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Follow links returned from PHP array one at a time with a pause
Don't use a loop, just use settimeout and pop an item out of the array. var items = your-array-from-php; var display = function() { if(items.length > 0) { show_url_in_a_new_window(items.pop()); setTimeout(display, 15 * 1000); } }; display();

Categories : PHP

how to pause the program for some seconds?
In case you really need to do that, you have several options You can use QThread's sleep methods by inheriting QThread and making them public (those are protected because it's generally a bad idea) Or you can use QEventLoop exec together with QTimer. Connect timer's signal to QEventLoop's quit() slot. That will cause "non-blocking" wait, so your app will not stay frozen. Or maybe you should instead split your code into two methods, make the second one a slot and call it with a timer when appropriate EDIT: something like, in your eat method you use QTimer::singleShot to call finishEating slot after X seconds. You might also want to read this: http://qt-project.org/doc/qt-5.0/qtcore/thread-basics.html

Categories : Qt

Run setInterval several times, then pause for several seconds
You can keep a run-count, and use normal_duration + 30000 as the setTimeout delay for the X+ 1st time. var runCount = 0, runsBeforeDelay = 20; function myslidefunction(){ // .. stuff runCount++; var delay = 0; if(runCount > runsBeforeDelay) { runCount = 0; delay = 30000; } setTimeout(myslidefunction, 400 + delay); }; // start it off setTimeout(myslidefunction, 1000);

Categories : Javascript

Command sleep to pause for 20 seconds if condition is met
Technically, 0 is a multiple of 28, and your program does work according to that, so I guess that this is simply not what you want. There are two ways I can imagine, maybe in code we understand each other better: // 1. Sleep after every 28 times outputting current date: for($i = $start; $i < $end; $i++) { echo date('H:i:s').'<br>'; if($i % 28 == 27) { echo 'sleeping...<br>'; sleep(20); } } // 2. Sleep before every 28th time outputting the current date, except the first time: for($i = $start; $i < $end; $i++) { if($i != 0) && (($i % 28) == 0)) { echo 'sleeping...<br>'; sleep(20); } echo date('H:i:s').'<br>'; } If neither of these give you the right idea, then you will have to clarify what exact

Categories : PHP

"Twitter like" follow button
Ok the main problem was css specificity not letting btn-danger class take any effect over btn-success. So as a solution i used an empty class that i made up. To track if the button is being followed or not. Whenever i added btn-success i added following class. And through class, as you did, i was able to track the state of the button. With bootstrap!!! http://jsfiddle.net/vjZRA/1/ Without bootstrap:http://jsfiddle.net/vjZRA/ Code Below: var btn = $('.btn'); btn.click(h); btn.hover(hin, hout); function hin() { if (btn.hasClass('follow')) { btn.text('Stop Following'); btn.removeClass('btn-success'); btn.addClass('btn-danger'); } else { btn.addClass('btn-primary'); } } function hout() { if (btn.hasClass('follow')) { btn.text('Foll

Categories : Javascript

how to check if person follow another in twitter API V1.1
In the v1.1 API, they have replaced it with the friendships/lookup API where you can specify a comma separated list of up to 100 users and it'll tell you about the connections between the authenticating user and each of the users specified

Categories : Twitter

Bootstrap twitter like follow button
You can do this in CSS like so: http://jsfiddle.net/Th4th/ .follow { width: 100px; height: 40px; background-color: gray; } .follow:hover span {display:none;} .follow:hover:before { content: "Unfollow" } I don't think you'll need java script for the button changing, only for taking the action of the click.

Categories : Javascript

A function that uses Twitter's API to follow an account
You would need to authenticate using the OAuth flow. There are several libraries that can aid with this process. Here's a javascript library on GitHub with examples on how to authenticate with the library. Once you've authenticated you would want to use the friendships/create method.

Categories : PHP

ACAccountStore - trying to follow on Twitter - 410 error
Well, I got rid of the 410 error by using the 1.1 API: SLRequest *postRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodPOST URL:[NSURL URLWithString:@"https://api.twitter.com/1.1/friendships/create.json"] parameters:tempDict]; Now I get a 400 error: HTTP response status: 400 Error 0error (null) Which suggested invalid authentication, even though the code above looks exactly like the code I see on every tutorial/example I find. I guess I'll create another question...

Categories : IOS

Addthis Twitter Follow Button Customize
Check Twitter api here...https://twitter.com/about/resources/buttons#tweet You can customize your self there.

Categories : Javascript

Like button like Follow (Twitter) in Ruby on Rails
First, you'll want to implement the code provided by Facebook in whole. Then, you can apply CSS styling that hides the count. Try this solution, via Jacob Quatier: /* CSS Hack for hiding the LIKE count */ div.fb-like span { display:block; width:48px !important; } div.fb-like iframe { width:48px !important; } div.fb-like iframe.fb_iframe_widget_lift { width:450px !important; }

Categories : Ruby On Rails

How to reward users if they like a page or follow on twitter on iOS 6
One option but you cant guarantee it is put the code to Like your page or Follow on twitter behind a button and on button push you can process the code that adds the coins. Wether they authenticate and follow through is not verifiable but that would be the only way I could think of doing it.

Categories : IOS

PHP TWITTER bot to follow/unfollow using api version 1.1 and cursors
If your of followers is greater than 5000 then $aFollowers = $oTwitter->get('followers/ids'); will only return the first 5000 ids. In what order? Twitter does not guarantee any order, so we'll just assume random. If the following check $isFollowing = in_array( $iFollowing, $aFollowers );, the person $iFollowing may or may not be in the list $aFollowers depending on how Twitter returned the followers to you. If the person is in the first 5000, then this will work, if they're outside the first 5000 then the check will fail, even if the person is legitimately following you. You'll need to pull all your followers via cursors. Check out the doc on cursors / pages - will help you out a bit. Basically you need to do this. $aFollowers = array(); $cursor = -1; do { $follows = $oTwitter-&g

Categories : PHP

Trying to follow another twitter user's followers, TWYTHON
The following code should work t = Twython(app_key, app_secret, oauth_token, oauth_token_secret) tysfriends = t.get_friends_ids(screen_name="fucktyler") for friend_id in tysfriends['ids']: t.create_friendship(user_id=friend_id) Thanks for using Twython!

Categories : Twitter

How can I find follow requsted users with python-twitter
You have two options here: call GetFriends before the loop: users = [u.id for u in api.GetFriends()] for userID in UserIDs: if userID not in users: api.CreateFriendship(userID) use try/except: for userID in UserIDs: try: api.CreateFriendship(userID) except TwitterError: continue Hope that helps.

Categories : Python

how to use twitter api in my android application to implement follow button only
I find out solution. I am successfully able to follow any user. Following is link that is working absolutely fine. http://code.google.com/p/android-hackathon-in-fukuoka/source/browse/trunk/sodefuri/src/jp/jagfukuoka/sodefuri/TimeLineActivity.java?spec=svn167&r=167 CODE:-- new TwitterTestAsync().execute(); // CALL THIS CLASS IN YOUR MAIN (CREATE) METHOD. private class TwitterTestAsync extends AsyncTask<Void, Void, Void>{ @Override protected Void doInBackground(Void... params) { // TODO Auto-generated method stub try{ doTwitterTask(); }catch(Exception e){ e.printStackTrace(); } return null; } } private void doTwitterTask(){ screenName = "chetan_bhagat"; ConfigurationBuilder cb =

Categories : Android

How to use twitter style follow feature in rails with mongoid 3.0
Check out this book from Rick Copeland: http://www.amazon.com/MongoDB-Applied-Design-Patterns-Copeland/dp/1449340040/ref=sr_1_1?ie=UTF8&qid=1373395463&sr=8-1&keywords=mongodb+design+patterns The book isn't Rails/Ruby/Mongoid specific but the concepts should translate fairly easy for you. Rick is an avid Python guy and strong member of the MongoDB community. In his book there's actually a whole chapter in there dedicated to creating a social follower/following style model. Hope that helps. Edit: This presentation on "Advanced Schema Design" may be of use to you also. I'm going to be doing a blog post on this topic in the near future, but you can get most of the content here form Jared's talk. http://www.slideshare.net/jrosoff/mongodb-advanced-schema-design-inboxes

Categories : Ruby On Rails

what is the best way to launch an activity that will be closed after X seconds from a broadcast receiver
You can do one thing pass a boolean extra with intent when you calling it from broadcast receiver like Intent i = new Intent(); i.putExtra("SETTIMER",true); And inside activity before start timer write a condition like if(getIntent.getBooleanExtra("SETTIMER",false)){ //start timer }else{ //dont start timer }

Categories : Android

How can I list two Linkedin Follow Buttons in a Twitter Bootstrap Dropdown
First i found the buttons load slow sometimes so you could open the drop-down before your buttons loads. I couldn't test on IE. I found a solution for firefox. The linkedin api (js) loads a div in a iframe in a iframe in a span in a span (or something like) that. I found the button iframes load but got a width of only 2px. The 2 px width seems to be caused by the display:none of the ul.dropdown-menu. My solution replace the display with visibility so the div got space: ul.dropdown-menu { display: block; visibility: hidden; } .open > .dropdown-menu { visibility: visible; } See: http://jsfiddle.net/bassjobsen/dsasu/1/ Instead of the visibilty you also could load the content elsewhere with space and copy it to the dropdown on first click.

Categories : Jquery

Rails using Facebook Like and Twitter Follow widgets with layout page with jQuery Mobile
OK, what I have done to work around this is as follows: I placed the following in the body element, but outside of the jQM page (i.e it is present in the DOM, but not visible) :javascript !function(d,s,id){var js,fjs=d.getElementsByTagName(s) [0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)) {js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs'); :javascript (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); -#

Categories : Ruby On Rails

Link to follow someone on WeChat / Weixin
PLEASE NOTE THIS FUNCTIONALITY HAS BEEN DEPRICATED Wechat Protocol is weixin:// We are currently aware of 2 different ways to call this: weixin://contacts/profile/USERNAME - USERNAME is a variable that you will replace. So you will call this like John Doe

Categories : Android

Close Twitter Bootbox after x seconds
This code will close the open bootbox automatically after 10 seconds. window.setTimeout(function(){ bootbox.hideAll(); }, 10000); // 10 seconds expressed in milliseconds See the documentation here

Categories : Javascript

twitter link issue (the same link inserted by different ways give different tweet lenght)
It seems I found out the answer (I suppose that it's true base on my 2 hour investigation, but anyway it works) (I dublicated the answer because at first I chose community wiki): when you post link to twitter, twitter tries to shorten your link, but it does it in a clever way. twitter's shorten url is 15 characters in length. So if you url is larger it will be shorten. but if your url is smaller twitter text will be filled by your shorter url (but anyway when you try to get the link at twitter account, you will see that url is changed anyway, but in fact that changed url doesn't influence your tweet length, the length will be filled only with your shorter link url). I got shorter link at bit.ly (14 characters), but that wasn't enough for me, because I need 12, but then I found that I c

Categories : Iphone

auto-complete follow link on select
jQuery UI's autocomplete plugin triggers a select callback when "... an item is selected from the menu". This callback function receives eventand ui params. The ui params contains a reference to selected item, which easily enables you to construct the redirect you are seeking for: angular.module('MyModule', ['ui.keypress']) .directive('autoComplete', function($timeout, $location) { return function(scope, iElement, iAttrs) { iElement.autocomplete({ source: scope[iAttrs.uiItems], select: function(event, ui) { var path = '/#/name/' + ui.item.value; console.log('redirecting to', path); $location.url(path); return false; } }); }; });

Categories : Javascript

How can I follow a link that contains 2 things using Mechanize in Perl?
You could write a regex that matches both subpatterns: qr/(?=.*?$foo)(?=.*$bar)/is This uses two lookaheads that can match anywhere in the string, due to the .* prefix. Note that this is more inefficient, and that the matched substring will differ.

Categories : Perl

link to follow on tooltip is shown but doesn't bring me there
Not tested: google.visualization.events.addListener(tree, 'onmouseover', function (e) { // your code $('#tooltip a').attr('href', totalService3); // show the tooltip $('#tooltip').show(); }); or google.visualization.events.addListener(tree, 'onmouseover', function (e) { //your code $('#tooltipHyperlink').attr('href', totalService3); // show the tooltip $('#tooltip').show(); });

Categories : PHP

Android Twitter default share-force closed
This is what I do to share stuff with twitter: tweetButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub initShareIntentTwi("twi"); } }); private void initShareIntentTwi(String type) { boolean found = false; Intent share = new Intent(android.content.Intent.ACTION_SEND); share.setType("text/plain"); // gets the list of intents that can be loaded. List<ResolveInfo> resInfo = getPackageManager().queryIntentActivities( share, 0); if (!resInfo.isEmpty()) { for (ResolveInfo info : resInfo) { if (info.activityInfo.packageName.toLowerCase().contains(type) || info.activityInfo.nam

Categories : Android

How to start, pause, continue a task that executes every 5 seconds as a "keep busy" task
I suggest you make the problem much simpler. Have a recurring task which starts ever 5 seconds. the first thing does is check a volatile flag and if set, returns without doing anything. To turn this process, unset the flag. To pause it, set the flag. You task can do more than one thing. If it needs to do an R2 after T finishes, you can check for this and execute it in the same task. There is no need to create another task as such. Note: if you add R2 to the same ExecutorService as T, it has to wait for it to finish before it can start R2. This single threaded service can only do one thing at a time.

Categories : Java

twitter follow button and facebook like button not working on resizing window
The div with the .col-md-3 class is hovering the div with those buttons (.col-md-5). Use z-index to fix that: .col-md-3 { z-index: 2; } .col-md-5 { z-index: 3; } A working jsFiddle Demo

Categories : CSS

How can I stop or pause one of the scripts I use when someone clicks on a specific link?
The longer-running script keeps re-executing itself with selfTimeout. If you want to stop it, all you need to do is call clearTimeout on the returned variable: clearTimeout(timer) Of course, you may need to be a bit more careful, because the script may be in the middle of the execution when you clear the timeout. One way to deal with it would be to set a flag indicating that the script need not be re-executed again. You can pull variable declarations out of the functions to make the code easier to read. So your code can look like this: //variable declaration for use in fadebg function var timer; //variable declaration for the flag var contBg = true; //stop your previous script function stopRandomBg() { clearTimeout(timer); contBg = false; } //changes to fadebg function func

Categories : Javascript

Hide a DIV after 5 seconds or when the user clicks the close link
$(body).on('click','#message a.close-notify',function () { $('#message').fadeOut('slow'); $('#messageContainer').text(); removeMessageLayer(); return false; }); because it is a dynamically created element, best practice says the click event should be delegated. $("#message").fadeIn('slow',function() { $(this).delay(5000).fadeOut('slow'); }); This will give you your five second delay based on the successful creation of the message.

Categories : Jquery

Wordpress, make a page link automatically after a few seconds
The only way I know to achieve this is via javascript, and even then it's unreliable - nullified as soon as you find a user that has JS disabled. This should get you what you need though: http://www.w3schools.com/jsref/met_win_settimeout.asp For example: setTimeout(function(){ self.location = "/magento/home.php"; }, 5000); would redirect a user to your new page after 5 seconds - just drop it in the wordpress template page of choice. (It's also my duty to inform you that this kind of behavior is horrendous usability, and may not get the reaction you're expecting from your audience. </lecture>)

Categories : Wordpress

Change attribute of twitter link
You should use .data() for controlling data attributes. As Daniele states in that answer, you must also stop the event propogation on the a element using preventDefault(). $('#twitterButton').click(function (e) { $('#tweet').data('url',"https://www.google.com"); e.preventDefault(); });

Categories : Javascript

javascript/jquery : Window.open opens child window but after few seconds child window get automatically closed for some urls(for IE and chrome)
It's because this code is executed on init on https://wpc.gcsip.com/wpc/wpc page // check that this page is not in a subwindow (e.g. after a session time out) if ( window.opener ) { window.opener.location = "wpc"; window.opener.focus(); window.close(); }

Categories : Javascript

Android: Twitter link is not working in phonegap app
Here's the Fiddle. I did no change in codes, Its working for me !! ? What's the issue here !? <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>info</title> <link href="jquery-mobile/jquery.mobile.theme-1.0.min.css" rel="stylesheet" type="text/css"/> <link href="jquery-mobile/jquery.mobile.structure-1.0.min.css" rel="stylesheet" type="text/css"/> <link href="themes/f.css" rel="stylesheet" type="text/css"> <link href="styles/dst_mobile.css" rel="stylesheet" type="text/css"> <link href="styles/jquery.zrssfeed.min.js" rel="stylesheet" type="text/css"> <link href="styles/jquery.zrssfeed.css" rel="stylesheet" type="text/css"> <script src="jquery-mobile/jquery-1.6.4.min.js" type="text/javascript"></s

Categories : Android

Share link on twitter with default text
First of all, here is a link to some information on the Tweet Button specifically... https://dev.twitter.com/docs/tweet-button Second of all, I think what you are trying to say is that you want that when someone Tweets your page from the "Tweet Button" on your site that it suggests some kind of default message in the text input. To do this you need to include the attribute "data-text" to your anchor and set it to the default message that you would like to display. It would look something like this: <a href="https://twitter.com/share" class="twitter-share-button" data-lang="en" data-text="this is the default message">Tweet</a> Just below this anchor element, you would include the javascript provided on the page that I linked to earlier in the post (https://dev.twitter.com/do

Categories : C#

Twitter Bootstrap Active Navigation Link
In your code you prevent link default click behavior (open page). Try that way: $(document).ready(function () { $('ul.nav > li a').click(function (e) { $(this).closest('ul.nav').find('.active').removeClass('active'); $(this).parent().addClass('active'); }); });

Categories : Jquery

Link to a modal on another page twitter bootstrap
Ok So I have managed to resolve this (quite easily in the end). Helps if you actually think things through. SO the solution is as follows On Index.php <li><a href="<?php echo site_url('site/invoice#mdx');?>" data-toggle="modal" title="">Open order screen</a></li> On invoice.php Add this to the end of the document <script> $(document).ready(function () { var hash = window.location.hash; if (hash == "#mdx") { $('#myModal').modal(); } }); </script>

Categories : Twitter

Is there a way to pause/stop (preferabley pause) audio playback when the user disconnects the headset from the device?
1.Use Broadcast receiver. Add Intent Filter (Intent.ACTION_HEADSET_PLUG). The intent will have the following extra values: state - 0 for unplugged, 1 for plugged. name - Headset type, human readable string microphone - 1 if headset has a microphone, 0 otherwise From the onRecive() method you can control the Audio playback.

Categories : Android

Link preview plugin for Twitter Bootstrap for cakephp
This might push you in the right direction: http://book.cakephp.org/2.0/en/views.html#using-blocks-for-script-and-css-files

Categories : Cakephp



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.