Posts

Showing posts from September, 2011

oauth 2.0 - Foursquare API Disconnect User -

i have users have authorized foursquare connect app have subsequently deleted account on app. use foursquare real time push api , foursquare keeps pushing checkins of users no longer use app. right ignore them, i'd make api call disconnect these users app stop recieving pushes. can't find on in docs. pointers? foursquare doesn't provide way programmatically disconnect users. there security implications here, , way foursquare user should able disconnect of apps after have logged in credentials on foursquare.com.

c# - Page Displays Different In Debug Than In Design View -

if display page in design view looks want to, when debug page not display should. grid extend past bottom of page. need make "design" view of page "debug" view of page? here site.master syntax works great on 3 pages (i have on 200 in project). <%@ master language="c#" autoeventwireup="true" codebehind="site.master.cs" %> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head id="head1" runat="server"> <title>test</title> <link href="~/styles/site.css" rel="stylesheet" type="text/css" /> <link href='http://fonts.googleapis.com/css?family=open+sans' rel='stylesheet' type='text/css' /> <link href='http://fonts.googleapis.com/css?f...

Javascript syntax identification -

writing regular expression, found code: json.stringify(e.model.proceduredate).replace(/\"/g, ''); why /\"/g work without being quoted? isn't string, , gather, javascript doesn't have literals... call text passed .replace() ? it regular expression literal , equivalent to: new regexp('\\"', 'g') in same way [] equivalent new array(0) .

javascript - Error: Couldn't find preset "es2015" relative to directory "/Users/username" -

i following error when trying use gulp-babel: error: couldn't find preset "es2015" relative directory "/users/username" i have es2015 preset installed globally , locally can't see why issue. below gulp set , package.json. var babel = require('gulp-babel'); var es2015 = require('babel-preset-es2015'); gulp.task('babel', function() { return gulp.src('./app/main.js') .pipe(babel({ presets: [es2015] })) .pipe(gulp.dest('dist')); }); package.json "devdependencies": { "babel-preset-es2015": "^6.3.13", "babel-preset-es2015-node5": "^1.1.1", "browser-sync": "^2.11.0", "gulp": "^3.9.0", "gulp-babel": "^6.1.1", "gulp-stylus": "^2.2.0" } i using node v5.1.0 , babel v6.4.0 here terminal ouput terminal output you ne...

javascript - WebStorm 11 - unresolved method -

Image
i download webstorm , works fine except im getting annoying markings when usr $(). says: unresolved function or method or ajax() how can fix this? you need add jquery javascript libraries in settings | languages & frameworks | javascript | libraries : either press download... , select jquery 2.0 official libraries list, or use add... button specify path jquery.js. see http://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/

assets - Multiple themes in rails 4.x? -

what best way have multiple themes in rails project. have cms , website. , vendor looks this vendor |-- images/ | |-- <images> |-- javascripts/ | |-- <javascripts> |-- stylesheets/ | |-- <css> | i want this: vendor |-- cms --images/ | |-- <images> | --javascripts/ | |-- <javascripts> | -- stylesheets/ | |-- <css> | |-- web --images/ | |-- <images> | --javascripts/ | |-- <javascripts> | --stylesheets/ | |-- <css> if this.. how "require" them in application.css? make 2 application.css. example application.cms.css , application.web.css , same application.css require cms css files in application.cms.css. require web css files in application.web.css. and add precompile path, # config/application.rb or initializers/assets.rb <- depend on rails version rails.application.config.assets.precompile +=...

javascript - Output returned data from mongo to jade -

i in console. [ { __v: 0, city: 'on1', address: '111', first: 'user', last: 'one', chart: 'char1', doctor: 'doc1', _id: 5698a803d98f05482ba48a4b }, { __v: 0, city: 'city2', address: 'address2', first: 'first2', last: 'last2', chart: 'char2', doctor: 'doc2', _id: 5698d7c56d090e5c28b88f83 } ] and want values in span tag <span> on1 </span> , <span> address </span> . want this. patient.find({}, function(err, patients){ console.log(patients) city = patients[0].city res.render("table.jade", {test : "test", patient : patients}) }) jade: each val, index in patients span= val also normal me array? thought object edit: tried , didn't work. - (var g = 0; g < patients.length; g++){ //- // - alert("hello") span= patients["city"] - } the g in for l...

Creating Users from Arrays in Powershell -

hello i'm using active directory while , want make user creation script arrays learn how works , yes know can make csv , import , works magic know want use powershell , new-aduser , arrays make accounts loop i made code because new in powershell skills noobish $pwd = convertto-securestring -string "pa$$w0rd" -asplaintext -force $name = read-host -prompt 'input username' $ou = read-host -prompt 'input ou' new-aduser $name -accountpassword $pwd -changepasswordatlogon $false -passwordneverexpires $true -path "ou=$ou,dc=contoso,dc=com" enable-adaccount -identity $name what wanted know , couldn't find lot of info how make arrays of ou's , arrays of usernames , ou's , make command roll 5-10 times , reason want learn more powershell , see how works , can go it edit: ok played little powershell , foreach , ended this $userarray = ('bi','ba','bo') foreach ($user in $userarray) { new-aduser $user -samaccou...

Why did git push so much data? -

Image
i'm wondering git doing when pushes changes, , why seems push way more data changes i've made. made changes 2 files added around 100 lines of code - less 2k of text, i'd imagine. when went push data origin, git turned on 47mb of data: git push -u origin foo counting objects: 9195, done. delta compression using 4 threads. compressing objects: 100% (6624/6624), done. writing objects: 100% (9195/9195), 47.08 mib | 1.15 mib/s, done. total 9195 (delta 5411), reused 6059 (delta 2357) remote: analyzing objects... (9195/9195) (50599 ms) remote: storing packfile... done (5560 ms) remote: storing index... done (15597 ms) <<redacted>> * [new branch] foo -> foo branch foo set track remote branch foo origin. when diff changes, (origin/master..head) 2 files , 1 commit did show up. did 47mb of data come from? i saw this: when "git push", statistics mean? (total, delta, etc.) , this: predict how data pushed in git push didn't tell me what...

sas - Function-style macros vs PROC FCMP functions -

i considering replacing lot of function-style macros fcmp equivalents. before go through process wondering limitations fcmp has compared function style macros? has else been through process , there reasons why not want this? my reasons wanting make code easier read , maintain, , less error-prone. believe fcmp functions easier read macro code sas programmers.

video - ffmpeg with php not completed if file size > 5mb -

i'm using ffmpeg upload videos server, i've tested on 1mb file , 1 5mb , working correctly, i've tested on 6mb , 50mb file , try upload still "processing" status no change. here code use exec("/usr/local/bin/ffmpeg -i ../uploadedvideo/".$image_name." -ab 56 -ar 44100 -b 200 -r 15 -s 240x180 -fs 314572800 -f flv ../uploadedvideo/".$image_namew.".flv"); what problem?

How to launch system apps in an iOS Xcode UI test case -

i've got app main purpose enter data healthkit. i'd write xcode ui tests verify it's writing data successfully, i'm having difficulty verifying data in health app. when recorded test, skipped simulated home button press, recording swiped on first home screen , navigated health app show data points. i searched how press home button, , found (which works): xcuidevice.shareddevice().pressbutton(.home) however, none of other calls recorded work navigation outside of app. recorded code swiping on home screen looks wrong, , doesn't work when replace tap() swiperight() or swipeleft() : app.childrenmatchingtype(.window).elementboundbyindex(1).childrenmatchingtype(.other).elementboundbyindex(1).childrenmatchingtype(.other).element.childrenmatchingtype(.other).element.childrenmatchingtype(.other).elementboundbyindex(0).childrenmatchingtype(.scrollview).element.tap() the next couple of lines, launching app on home screen, don't work app icon that's on...

machine learning - Torch7 using weights with unbalanced training sets -

i using crossentropycriterion convnet. have 150 classes , number of training files per class very unbalanced (5 2000 files). according documentation, can compensate using weights: criterion = nn.crossentropycriterion([weights]) "if provided, optional argument weights should 1d tensor assigning weight each of classes. particularly useful when have unbalanced training set." what format should weights in? eg: number training files in class n / total number of training files. i assume want balance training in meaning, small class becomes more important. in general there infinitely many possible weightings leading various results. 1 of simpliest ones, assumes each class should equally important (thus efficiently drop empirical prior) put weight proportional to 1 / # samples_in_class for example weight_of_class_y = # all_samples / # samples_in_y this way if have 5:2000 dissproportion, smaller class becomes 400 times more important model.

Trouble filtering API results with PHP/conditionals -

first, apologies in advance may pretty green question! i'm getting hang of php, , there's not ton of support out there apis... i'm trying filter listing results i've returned using etsy api. i'd limit them specific category or taxonomy id, none of php conditionals i'm using seem returning results. few of things i've tried far: <?php define("api_key", xxx); $url = "https://openapi.etsy.com/v2/listings/active?tags=unicorn,unicorns&keywords=unicorn,unicorns&includes=images:1:0&api_key=" . api_key; while (isset($url) && $url != '' && $next_page < 3) { $curl = curl_init($url); curl_setopt($curl, curlopt_returntransfer, 1); $response_body=curl_exec($curl); curl_close($curl); $response = json_decode($response_body); $taxo = $response->results->taxonomy_id; if($taxo == 66) { foreach ($response->results $listing) { echo "<li>" . '<...

sql server - IF ELSE error in sql -

this code; should print 'buy' prints 'none'. doesn't give ideas. what do? declare @avg8 decimal(18,4) declare @avg3 decimal(18,4) set @avg8=32.4 set @avg3=31.5 if @avg3 >= @avg8 begin print n'buy'; end else begin if @avg3<@avg8 begin print n'sell'; end else begin print n'none'; end end please help. why print buy - have this: set @avg8=32.4 set @avg3=31.5 if @avg3 >= @avg8 begin print n'buy'; where @avg3 isn't greater @avg8

java - Correct usage of TransformGroup -

Image
i have started graphics assignment , first use of java3d. have started off attempting build chair (don't laugh @ following :p). i wanted know if tell me correct usage pattern because pretty sure little bit off. here have drawn: as can see box seat , 4 cylinders legs. here code used draw it: public class chair { public chair() { simpleuniverse universe = new simpleuniverse(); branchgroup group = new branchgroup(); // main seat component box box = new box(.39f,.03f,.37f, new appearance()); transformgroup seatgroup = new transformgroup(); transform3d transform = new transform3d(); vector3f vector = new vector3f(.0f, .0f, .0f); transform.settranslation(vector); seatgroup.settransform(transform); seatgroup.addchild(box); // legs of chair cylinder leg1 = new cylinder(.07f, .45f); cylinder leg2 = new cylinder(.07f, .45f); cylinder leg3 = new cylinder...

iphone - iOS App view and navigation design custom class -

in ios app have below code snipped repeating on , on again in every class. i have tried cast method nsobject class receive errors use of "navigationitem". -(void)customdesign { //background pattern self.view.backgroundcolor = [[uicolor alloc] initwithpatternimage:[uiimage imagenamed:@"bg-pattern.png"]]; // nav bar [self.navigationcontroller.navigationbar setbackgroundimage:[uiimage imagenamed:@"top_bar.png"] forbarmetrics:uibarmetricsdefault]; //back button color #2974c3 [self.navigationcontroller.navigationbar settintcolor:[uicolor colorwithred:41.0/255.0f green:116.0/255.0f blue:195.0/255.0f alpha:1.0]]; //settings button uiimage* settingsimage = [uiimage imagenamed:@"buttonmenu.png"]; cgrect frameimg = cgrectmake(0, 0, settingsimage.size.width, settingsimage.size.height); uibutton *uisettingsbutton = [[uibutton alloc] initwithframe:frameimg]; [uisettingsbutton setbackgroundimage:settingsimage forstate:uicontrolstatenormal]; [uisett...

In Java catch block, how do you know which method/line throws the exception? -

in try block, want execute 2 functions. if first 1 failed don't execute second. want print out function failed. see following code. try { = func1(); b = func2(); //won't execute if failed } catch (exception e) { //todo: print or b failed? } does language support scenario naturally? if not, following practice? (i cannot think of wrong it. concerns me don't remember seeing 1 using return in catch .) try { = func1(); } catch { //print: failed return; //if failed skip execution of b } try { b = func2(); } catch { //print: b failed } edit: summary of comments: throw different exception 2 methods. in case methods written others , have no control. e.printstacktrace() print line number , function i want more printing. more like, if failed, execute following code. what want string methodname = e.getstacktrace()[0].getmethodname()); but hardly practice. standard way log exception using appropriate method in logging framework...

html - Python Selenium: Unable to use ActionChains to go through two menus before clicking on an element -

i have been trying click on element appears 2 levels down in menu accessed hovering over. eg. menu -> sub-menu -> element clicked content_menu = driver.find_element_by_xpath("<xpath>") sub_menu = driver.find_element_by_xpath("<xpath>") click_item = driver.find_element_by_xpath("<xpath>") action = actionchains(driver).move_to_element(content_menu) action.move_to_element(sub_menu) action.click(click_item) action.perform() this code not click on element. if use chain hover on first menu item, does, not display list under it, choose second item. there can fix code, or there better solution particular case? you need in multiple action chains calls : actions = actionchains(driver) actions.move_to_element(content_menu).perform() actions.move_to_element(sub_menu).perform() actions.click(click_item).perform() there might need wait until sub_menu , click_item visible .

Depretieation Warning for CSS in Michael Hartel's Ruby on Rails tutorial 7.7 -

i keep getting error css in section 7.7: deprecation warning: assertion not run because of invalid css unexpected '#' after '[#<nokogiri::css::node:0x000000076e23f8 @type=:element_name, @value=["div"]>]' (called block in <class:userssignuptest> @ /home/ubuntu/workspace/sample-app/test/integration/users_signup_test.rb:14) deprecation warning: assertion not run because of invalid css selector. unexpected '<' after '.' (called block in <class:userssignuptest> @ /home/ubuntu/workspace/sample-app/test/integration/users_signup_test.rb:15) the users_signup_test.rb test below specific problem mentioned in deprecation warning in assert_selects (which lines 14 , 15 in code): test "invalid signup information" signup_path assert_no_difference 'user.count' post users_path, user: { name: "", email: "user@invalid", password: "foo...

ruby on rails - Why does second terminal tab prompt bundle install -

if run rails s in terminal, works. if open new terminal window or tab , run rails c, following error: run bundle install install missing gems. if type cd .. , cd directory , run rails c again, works. question causing occur?

python 3.x - Nested global variables / Defining a variable in a nested function -

i writing program , stumbled across problem. have 'counter' counting how many wins computer , player. problem is, function nested in another. how accomplish without unboundlocalerror ? put global statement or how accomplish it? def nestedfunction(): print("i nested") score += 1 print(score) again = input("would play again? > ") if again == "yes": function() else: exit() def function(): print("i not nested") nestedfunction() if __name__ == '__main__': score = 0 function() expected output : i not nested. nested. 1 play again? > yes not nested. nested. 2 if want use variable not local put global before access global variable def nestedfunction(): print("i nested") global score score += 1 print(score) again = raw_input("would play again?>") if str(again) == "yes": ...

python - Online sorting and removing duplicates on two streams of integers -

suppose i'm receiving 2 streams of integers. each stream of integers (1) not guaranteed in increasing order, , (2) occasionally, 1 or more integers missing first stream present on second stream. example: stream 1 - 1, 2, 3, 5, 4, 6, 8, 9, 10, ... stream 2 - 1, 2, 3, 4, 5, 6, 8, 7, 10, ... what data structures and/or algorithms low space-time complexity constructing sorted stream contains every single integer in union (i.e. duplicates removed) set of both streams? is: sorted stream - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ... of course, naive approach store every result sort in o(n log n), making final pass in linear scan remove consecutive duplicate elements. requires lot of memory , requires both streams terminate before processing can start. this udp packet sequencer on embedded device, code snippets in c preferable, can read python too. do know integers we're getting, or arbitrary? you're going need sort @ point, don't see way avoid o(n lg n). bes...

ajax - Rails .js render html in modal -

i'm passing following parameter modal: "<iframe width="350" height="197" src="http://www.youtube.com/embed/jsexp2ebb4s?feature=oembed" frameborder="0" allowfullscreen></iframe>" then, try render dynamically in modal...in show.js.... $("#modalpostvid").html("params[:vid]") but loads text (i.e. loads string) instead of embedded video. how can make video embeds? thank you. try $("#modalpostvid").html("<%= escape_javascript params[:vid].html_safe %>")

Getting an Error when I try to change file name in PowerShell -

i found similar commands these online. want replace parenthesis in file names either space or empty string. the files i'm trying change following: nehemiah (1).mp3 nehemiah (2).mp3 nehemiah (11).mp3 really i'd them following: nehemiah 01.mp3 nehemiah 02.mp3 nehemiah 11.mp3 here scripts i've tried. dir | rename-item –newname { $_.name –replace “(“,”” } dir *.mp3 | rename-item -newname { $_.name -replace " ("," " } neither of these work. here error message i'm getting. rename-item : input script block parameter 'newname' failed. regular expression pattern ( not valid. @ line:1 char:34 + dir *.mp3 | rename-item -newname { $_.name -replace " ("," " } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : invalidargument: (c:\users...ehemiah (1).mp3:psobject) [rename-item], parameter ndingexception + fullyqualifiederrorid : scriptblock...

rdf - STRAFTER SPARQL 1.1 function in Virtuoso -

does strafter sparql 1.1 work in virtuoso (version 6.04 june 2012 build)? trying prefix qb: <http://purl.org/linked-data/cube#> prefix iodp: <http://data.oceandrilling.org/core/1/> prefix sdmx-dimension: <http://purl.org/linked-data/sdmx/2009/dimension#> select ?p (strafter(str(?p), "http://data.oceandrilling.org/janus/") ?pshort) <http://data.oceandrilling.org/janus/> { <http://data.oceandrilling.org/janus/ngr_section201_1226> qb:observation ?observation . ?observation ?p ?o . filter (regex(?p, "janus")) . filter (!regex(?p, "leg")) . filter (!regex(?p, "site")) . filter (datatype(?o) = <http://www.w3.org/2001/xmlschema#decimal>) . } at http://data.oceandrilling.org/sparql throws sparql compile error. no not support straft, need build 6.1.5 see release notes .

android - notifyDataSetChanged() not working with custom adapter -

i making edit on list of custom objects, notifydatasetchanged() not updating list. setup: fragment displaying list of states. state edited in dialog fragment , applydialogstate() called on edit action. void applydialogstateedit(int id, string name) { // apply stateeditdialog fragment edits directly mstates state state = mstates.get(id); state.name = name; // write state change saves getactivity().getsharedpreferences("mystates", context.mode_private).edit(). putstring(state.date, mgson.tojson(state)).commit(); mstateadapter.notifydatasetchanged(); } things have looked at: i confirmed method called. sharedpreferences updated - changes visible once activity reloaded. there doesn't seem reference problem. after notifydatasetchanged() called, see debugger internal state list in custom adapter correspond mstates updated correctly... in other case notifydatasetchanged() working... i.e. pub...

asp.net - Failed to connect to server in ssis integrationservices in C# upon deployment -

Image
i have code var connectionstring = "data source=" + servername + ";initial catalog=" + databasename + ";integrated security=true"; var connection = new sqlconnection(connectionstring); var integrationservices = new integrationservices(connection); // error here. failed connect server. var package = integrationservices .catalogs["ssisdb"] .folders["myfolder"] .projects["myproject"] .packages["mypackage.dtsx"]; long executionidentifier = package.execute(true, null); executionoperation eo = integrationservices.catalogs["ssisdb"].executions[executionidentifier]; while(!eo.completed) { eo.refresh(); system.threading.thread.sleep(5000); } during development, no error encountered when web deploy it, error occ...

python - Accounting for Leap year in simple math based program -

this question has answer here: python question: year , day of year date? 3 answers basically whenever user gives number of days example 10 , starting year 2008 convert days , add years still 2008, how account leap year? example if enter 848 2008 should 2010 2011. far have: def year_checker(days, year): convert = days // 365 year = year + convert return year this question different because messes when trying find days between 2 leap years. https://support.microsoft.com/en-us/kb/214019 this article tells how calculate leap years. implement formula , check leap years, subtract 366 every leap year encountered. hope helps now. improve answer sample code later.

Twitter API Limitation for my Android App -

i working on new android app displays current trending topics , picture popular social media such twitter. however, ran problem several times "rate limit exceeded" the idea of app when ever screen initiated, twitter authorization established , results. if user initiated screen multiple times, he/she error. or if many users used app , initiated screen @ same time, multiple authorization calls established , error eventually. is there work around solve problem? need establish authorization each time user initiate screen?

java - How to understand PriorityQueue? -

Image
this question has answer here: the built-in iterator java's priorityqueue not traverse data structure in particular order. why? 4 answers here code import java.util.*; public class prioritypuzzle{ public static void main(string []args){ priorityqueue<integer> prq = new priorityqueue<integer>(); ( int = 10; > 0; i-- ){ prq.add (i); system.out.print(i+" , "); } system.out.println ( "\n initial priority queue values are: "+ prq); } } result i donnot know why after priority queue become {1,2,5,4,3,9,6,10,7,8} the tostring() method priorityqueue inherits the 1 abstractcollection . iterates on items in collection , prints them. from docs for iterator of priorityqueue : the iterator provid...

c# - How to check if SQL Server Management Studio is installed on a system programmatically? -

i need find whether sql server management studio installed on system or not. need specially when instance of sql server express installed on system installing visual studio no management studio installed on system. for more information, can find instances of sql server installed on system need understand management studio installed on system or not. you can check registry key , see if returns null: private registrykey _regsql = registry.localmachine.opensubkey (@"hklm\software\classes\applications\sqlwb.exe", false); if (_regsql == null) //if it's null sql server management not installed { //do } also 2 more registry locations can check: hklm\software\microsoft\microsoft sql server\ssmsee software\microsoft\microsoft sql server\90\tools\clientsetup edit according this documents , while using address software\microsoft\microsoft sql server\90\tools\clientsetup change the number part (90) based on versions want check: 90 | sql...

javascript - Bootstrap: Form submit not working in modal box -

below model box , using login. when click on button(both) page reload self. checked in firebug , found this. localhost\index.php?submit=login <div class="modal fade" id="loginmodal" tabindex="-1" role="dialog" aria-labelledby="loginmodallabel" aria-hidden="true"> <div class="modal-dialog"> <form method="post" id="login" name="login" action="login_exec.php" role="form"> <div class="modal-content login-modal"> <div class="modal-header login-modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="close"><span aria-hidden="true">&times;</span> </button> <font color="#288dcb"><h3 class="modal-titles text-center" i...

java - Consequences of creating a large fixed thread pool -

i'm working on standard server application. processing of each request broken down several stages (the second stage requires first finished, , on). now, 1 of these stages takes rather long time can broken down several dozen or tasks, not depend on each other, , hence parallelizable. add thread pool slowstageservice , , wondering how best size it. best thread pool have @ least 1 vacancy of time, implies must process tasks fast or faster server receiving requests; yields reasonable lower bound on size of thread pool. however, generous sizing, since many of numbers involved in calculation change. so question is: downside of making pool large (say factor of 3 or 4), , having many idle threads? understand wastes resources, doesn't reserve cpu , make thereby unavailable other requests, right? how slack in practice 1 can have? i've calculated 6 threads minimum need; safe go 12 on 24-core box under medium load? as i'm writing this, sounds maybe need threadpool...

Permissions for git project when using on remote server -

these commands i've ran on server: $ whoami git $ ls -l drwxr-xr-x 3 git git 4096 jan 16 05:48 git $ ls -l git/ total 4 drwxrwxr-x 7 git git 4096 jan 16 05:55 tpro.git then on local machine: $ git remote add origin git@gitserver:/opt/git/t.git then when want push server local machine have following error: $ git push -u origin master fatal: '/opt/git/t.git' not appear git repository fatal: not read remote repository. please make sure have correct access rights , repository exists. you mention tpro.git trying access t.git . make sure path exists. , make sure tpro.git indeed in /opt/git (not /home/git ) then try: git remote set-url origin git@gitserver:/opt/git/tpro.git, git push -u origin master that ensure master pushing origin/master every time, simple git push .

android cts: Why does package run fail but individual tests pass? -

i'm hitting failures when running cts-tf > run cts --package android.holo but when run failed tests individually, like cts-tf > run cts --class android.holo.cts.holotest --method testholowallpapernotitlebar they pass. without knowing internals, i'd expect failed package test fail individual test. if there dependency on previous test, if failed individual test. is cts timing issue, expected holo, or else? if understand it, please enlighten me, i'm new cts . thanks. holo test cases screen resolution of device under test. can ask google wave-off on these tests if running tests on mobile. as per previous answer, there chance previous set of test cases causing issues leading failures of holo tests (but doubt this)

.net - Redirecting the whole site to HTTPS in ASP.net application -

i have done project using asp.net , ready go live. management has decided use ssl reasons , hence site should load in https since project quite big, , pain full check url , redirect https in pages, there simple way can handle globally or in master pages ? so, if website url typed http, should redirected https site. how can achieve ? help needed. if don't want control per iis nate suggested, can redirection in global.asax : void application_beginrequest(object sender, eventargs e) { if (request.url.scheme != "https") response.redirect("https://yoursite.com"); } may not witty solution, job.

android - How to change color of toolbar options background -

Image
i want change light background of options in toolbar section appears when trying copy something. it's bad right now: here styles.xml : <?xml version="1.0" encoding="utf-8" ?> <resources> <style name="mytheme.base" parent="theme.appcompat.light.noactionbar"> !-- customizations not specific particular api-level can go here. --> <item name="windownotitle">true</item> <item name="colorprimary">@color/primary</item> <item name="colorprimarydark">@color/primary_dark</item> <item name="coloraccent">@color/accent</item> <item name="android:textcolorprimary">@color/primary_text</item> <item name="android:textcolorsecondary">@color/secondary_text</item> </style> <!-- application theme. --> <style name="mytheme" parent="myth...

java - why this code runs out of order -

this code , gave inputs follows, removed step of giving actual output value user, calculated in code, still same thing happens "1" 1st input "0.5" 1st inputs weight "0" second input "0.6" weight "0" desired output "0.002" defined value "0.23" learning rate. package neural4copy; import java.util.scanner; import java.lang.math; public class demo { // inputs declared private int x[][]=new int[1][2]; //weights declared private double w[][]=new double[1][2]; private double temp; private double z[]=new double[1]; private double desiredoutput; private double actualoutput; private double error; private double definedvalue=0.004; private double weightchange[][]=new double[1][2]; private double learningrate; private double epilision=0.000000001; private static double ztotal; private scanner user_input= new scanner(system.in); public void getdata(){...

ember.js - When is filtering in Ember performed? -

this route model: // routes/filter-categories.js import ember 'ember'; export default ember.route.extend({ model() { this.store.findall('product'); var products = this.store.filter('products', function (product) { console.log('filtering product %o', product.get('id')); ... }); return products; }, }); basically, need al products when enter filter-categories route, , need perform client-side filtering on products. taking @ console log, first time visit filter-categories route, see following: filtering product "101" filtering product "102" filtering product "103" ... filtering product "101" ... filtering product "101" ... filtering product "101" ... each product gets filtered 4 times on first entering (the order of processing products not deterministic). expecting each product gets filtered once! from here o...

php - Sum values with a check box/radio button -

Image
i have database table of values 1 of columns displays cost of each asset. i'm trying add checkboxes side of each of costs, can select values want , display averages , sum. for example: here sample html , js code should solve problem.... html blow <table width="100%" border="1"> <tr><th>cost</th><th>action</th></tr> <tr> <td>30</td> <td><input type="checkbox" class="check_list" val="30"/></td> </tr> <tr> <td>20</td> <td><input type="checkbox" class="check_list" val="20"/></td> </tr> <tr> <td>25</td> <td><input type="checkbox" class="check_list...

css - How to make responsive RTL list? -

i have list of links, looks like: <ul> <li><a href="#">link 1</a></li> <li><a href="#">link 2</a></li> <li><a href="#">link 3</a></li> <li><a href="#">link 4</a></li> <li><a href="#">link 5</a></li> <li><a href="#">link 6</a></li> </ul> and list should 2 colums 3 rows, , list should responsive @ left side of page (in right side have responsive banner). also, content has rtl. , link rtl too. you can use css3 make list in 2 columns. this: html: <ul> <li><a href="#">link 1</a></li> <li><a href="#">link 2</a></li> <li><a href="#">link 3</a></li> <li><a href="#">link 4</a></li> <li><a href="#">l...

ios - Clicking on NSURL in a UITextView -

Image
i have uitextview spans 100.0 points across uiview . in uitextview , have links captured following function: - (bool) textview:(uitextview *)textview shouldinteractwithurl:(nsurl *)url inrange:(nsrange)characterrange this works great capture characters have 1 problem: if link last characters in text view, tap pressed way across line. so if have text view following text @test link: // entire remainder of line link (all white space after @test) hello @test how fix this? for me highlights link... missing something? update: here's hacky solution via dummy url's: - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; nsmutableattributedstring* attributedstring = [[nsmutableattributedstring alloc] init]; [attributedstring appendattributedstring:[[nsattributedstring alloc] initwithstring:@"lorem ipsum dolor sit amet, vim iuvaret blandit intellegebat ut. solet diceret interpretaris eos cu, magna dicat explicari mei ex...

save image in database using codeigniter -

i want combine image along other data idnumber, name, , etc. i'm still confuse how can save folder , database cant show it class addstudent extends ci_controller { function indexes(){ if($this->session->userdata('logged_in')) { $session_data = $this->session->userdata('logged_in'); $data['username'] = $session_data['username']; $this->load->view('addstudentinformation',$data); } else{ redirect('welcome', 'refresh'); } if((!isset($session_data) || $session_data !=true)) { redirect('welcome', 'refresh'); } } function do_upload(){ $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $config['overwrite'] = true; $config['remove_spaces'] = true; $config['max_si...

javascript - How to combine two arrays as a cartesian product? -

i have array1 = [1,2,3,4,5]; array2 = ["one","two","three","four","five"]; i want array3 elements of array1 first (and others) element of array2 , etc. for example: array3 = ["one 1", "two 1", "three 1", "four 1", "five 1", "one 2", "two 2", "three 2", "four 2", "five 2"...] i understand need use loop don't know how it. you can use 2 for-loops: var array1 = [1,2,3,4,5]; var array2 = ["one","two","three","four","five"]; var array3 = []; (var = 0; < array1.length; i++) { (var j = 0; j < array2.length; j++) { array3.push(array2[j] + ' ' + array1[i]); } } console.log(array3);