Posts

android - Where to place SlidingTabLayout.java and SlidingTabStrip.java files in project? -

i'm new android studio , i'm following tutorial implements sliding tab layout application. tutorial says put slidingtablayout.java , slidingtabstrip.java in our project, doesn't where. now, put declared them 2 classes , put them under java folder. (...app\src\androidtest\java). however, when try include slidingtablayout object in xml file, says "the following classes not be: found:com.android4devs.slidingtab.slidingtablayout", means must have put 2 files in wrong place. used these files before , know put them? thank you the error says could not found slidingtablayout class. means have tell correctly slidingtablayout file placed. in xml change com.android4devs.slidingtab package name. can find package name in slidingtablayout.java or in manifest file.

mocking - Mock method reported as called 0 times when it seems it MUST be being called at least once -

i have method i'm mocking reported being called 0 times, though seems should being called 1 times. here's test class method (simplified): function testfailedpasswordlogin() { $badpassword = 'not'.$this->testpassword; // setup fake user repo returns our test user (since we're passing valid username, incorrect password) $this->users = $this->getmock('users', array('getbyusername')); $this->users->method('getbyusername')->with($this->testuser->username)->willreturn(null); $this->auth = new auth($this->users); $this->assertfalse($this->auth->login($this->testuser->username,$badpassword)); $loggedinuser = $this->auth->user(); $this->assertequals(null, $loggedinuser); } update: decided try using mock framework (prophecy): $this->users = $this->prophesize('users'); $this->users->getbyusername($this->testuser->username)->s...

mysql - FInd the names of customers are interested in every artist -

i looking customer names of customers have interest in artists. i understand in relational algebra, can use division operator, not understand sql format in doing so. i have these tables columns: customer (customerid, firstname, lastname) artist (artistid) customer_interest_in_artists (artistid, customerid) how go doing this? you using simple min() construct: select c.firstname, c.lastname, min(ci.customerid not null) interest_all artist left join customer_interest_in_artists ci using (artistid) left join customer c using (customerid) group c.customerid having interest_all = 1

Improving pure HTML+CSS iframe menu -

i'm making website simple menu bar @ top of each page. make menu easy update, hard-coding whole menu each page not ideal. modifying , re-uploading every page cumbersome , since website hosted statically, cannot use php create menu either. my current solution uses iframe , separate html file menu. pasted in body of each new page: <iframe src="menu.html" width="100%" height="55x" id="menuframe" style="border:none"></iframe> i this, works nicely: <!-- `theme.css` --> #menudiv { width: 100%; height: 38px; } .menu-item { height: 20px; width: 120px; margin: 0; display: inline-block; text-align: center; padding: 4px; border-radius: 50px; background: 000000; border: 2px solid black; } <!-- `menu.html`: --> <!doctype html> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href=...

ruby on rails - Difference in ways to call partials? -

i assuming applies other things well, i've noticed in tutorials i've gone through far. basically, difference between: <%= render :partial => "shared/warning" %> and <%= render partial: "shared/warning" %> the syntax hash literal in ruby is: { key => value } the key can object, including symbol , eg. { :foo => "bar" } using symbol keys in hash became popular, , idiomatic in ruby in ruby 1.9 optional syntax added hash created symbol keys, , there on following precisely equivalent above: { foo: "bar" } update further specific use case, ruby allows drop {} s when passing hash argument method (as being able drop () s), following equivalent: foobar( { foo: "bar" } ) foobar( foo: "bar" ) foobar foo: "bar" foobar :foo => "bar"

Slider Bar for date time javascript jquery. Need advice -

i see useful link make slider bar date ranges, 1 time , dates. ideally, i'm looking @ times , date within 3 day period. looking able slide 2 points! http://ghusse.github.io/jqrangeslider/ got using formatter: function (value) http://jsfiddle.net/vm844/1861/

Jquery and php not working to load images onto screen from folder -

i have folder images in , trying load images file onto webpage. know images in correct format , dir correct. images not appearing on page. html file. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script> $(document).ready(function() { $.ajax({ url: "loadimages.php", datatype: "json", alert("this working"); success: function(data) { $.each(data, function(i, filename) { $('#imgs').prepend('<img src="' + filename + '"><br>'); }); } }); }); </script> <html> <body> <div id="imgs"> </div> </body> </html> this php file. <?php $filenamearray = [".png"]; $handle = opendir(dirname(realpath(__file__)).'/images/'); while($file = readdir($handle)){ if($fil...