Posts

Showing posts from August, 2011

questions that have no specific number of input tests on ACM -

questions that have no specific number of input tests on ACM - i'm trying submission on baskets of gold coins problem on acm-icpc live archive (https://icpcarchive.ecs.baylor.edu) number of problem 3576 i've written code , gave right reply when tried submit on website online justice didn't take (time limit exceeded error) thing it's not possible programme take more 3 minuets it's simple programme question didn't how many time must input had utilize loop don't know when end code wrote class="snippet-code-css lang-css prettyprint-override"> #include <stdio.h> int n,w,d,weight; int search(); int main(){ scanf("%d %d %d %d",&n,&w,&d,&weight); while((n>1 && n<=8000) && (0<w && w<=30) && (d<w)){ printf("%d\n",search()); scanf("%d %d %d %d",&n,&w,&d,&weight); } return 0; } int search(){ int n=n...

android - ACTION_CANCEL when touch size becomes too large? -

android - ACTION_CANCEL when touch size becomes too large? - i researching "in-pocket" smartphone interaction. using android implementation , have run next problem: whenever press fingers firmly against screen (which happens lot in utilize case), android issues action_cancel current motionevent , app (and in fact every app tried) stops receiving touch events until fingers lifted off screen. utilize lg g2 , samsung galaxy alpha testing. on g2, problem seems occur when getpressure() first exceeds 1.0 1 pointer. galaxy alpha, however, returns 1.0 getpressure() , behaves g2. other parameters vary seem cluster around values when action_cancel occurs. i have found few similar cases (e.g. motionevent.action_cancel blocking subsequent action_up on button) , no solution. tried requestdisallowintercepttouchevent() no avail. can tell logs, getevent , show pointer location developer options scheme ( viewrootimpl , exact) keeps reporting events after problem occurs, ...

Devise not working for multiple domains on login - Rails -

Devise not working for multiple domains on login - Rails - i have application respond multiple domain, each domain must have different users on user model validation email like: validates_uniqueness_of :email, scope: :domain_id, case_sensitive: false, allow_blank: true, if: :email_changed? this allow me register users same email on different domains, problem when 1 user registered in 1 domain same user can login domains in platform. wrong because user can login on domain registered. how can have working using devise? ruby-on-rails ruby-on-rails-4 devise

c++ - Using threads to sort two halves of an array, but only second half is being sorted -

c++ - Using threads to sort two halves of an array, but only second half is being sorted - i wrote quick programme sort 2 halves of 1 array, when test sort works fine 1 array, when split array 2 , pass half each thread sorting, when they're done , print array, sec half looks sorted. doing wrong? below sorting function , main. void *sort(void *object){ struct array_struct *structure; construction = (struct array_struct *) object; int *array = structure->partition; int size = structure->size; qsort(array, size, sizeof(int), cmpfunc); printf("sorted %d elements.\n", size); } and main, assume includes fine, , compilation fine also, not of code, parts pertaining problem. int main(int argc, char const *argv[]){ int segments = 2; pthread_t threads[segments]; int i, *numbers; //iterator i, , pointer int array 'numbers' numbers = randomarray(); //return array of size 50 filled random ints for(i = 0; < segments; i++){ struc...

excel - Calculation of average cost -

excel - Calculation of average cost - i have next table: transaction_date ticker cost shares trade_cost ave_cost total_shares total_cost 12/1/2014 aaa 1.50 1,000 1,500.00 1.50 1,000 1,500.00 12/1/2014 bbb 10.00 250 2,500.00 10.00 250 2,500.00 12/10/2014 bbb 11.25 200 2,250.00 10.56 450 4,750.00 12/12/2014 aaa 1.75 800 1,400.00 1.61 1,800 2,900.00 12/15/2014 ccc 32.00 100 3,200.00 1.00 3,200 3,200.00 i have calculate ave cost, total shares, , total cost. my formula total shares sec entry of bbb =sumif(b2:b4,b2,d2:d4) while formula total cost is =sumif(b2:b4,b2,e2:e4) next, sec entry of aaa on date 12/12/2014, total shares = sumif(b2:b5,b5,d2:d5) total cost = sumif(b2:b5,b5,e2:e5) dragging formula downwards require me manually alter range in sumif formula. how calculate running total shares , total cost @ every entry date without manually changing r...

vb.net - Grab username off twitter -

vb.net - Grab username off twitter - how can grab number of favorites off of page this? https://twitter.com/daltonmetzler4 like how can grab # of followers , number of favorites? you'll need utilize twitter rest api: https://dev.twitter.com/rest/public , understand how authenticate application oauth. followers: https://dev.twitter.com/rest/reference/get/followers/ids favorites: https://dev.twitter.com/rest/reference/get/favorites/list you can explore entire api twitter console: https://dev.twitter.com/rest/tools/console here's intro/tutorial twitter api: http://code.tutsplus.com/tutorials/building-with-the-twitter-api-getting-started--cms-22192 vb.net

internet explorer - Javascript palceholder did not work in IE9 -

internet explorer - Javascript palceholder did not work in IE9 - here code, $(document).ready(function() { // create "div" element , design using jquery ".css()" class. var container = $(document.createelement('div')).css({ padding: '5px', margin: '0'}); $(container).append('<input type=text class="input" id="tb1" placeholder="email" />'); $(container).append('<input type=text class="input" id="tb2" placeholder="email" />'); $(container).append('<input type=text class="input" id="tb3" placeholder="email" />'); $(container).append('<input type=text class="input" id="tb4" placeholder="email" />'); $('#main').before(container); // add together div elements "main" cont...

java - how to create a hibernate projection that searches one column for any value = true -

java - how to create a hibernate projection that searches one column for any value = true - i have hibernate entity type so @entity @table(name = "type") public class type { @column(name = "enabled") private boolean enabled = false; } and want create function returns if row in type table has enabled = true. want efficient possible using projection or criterion don't know start maybe efficient way search first row has enabled = true , , check if exists. criteria crit = session.createcriteria(type.class); crit.setprojection(projections.id()); crit.add(restrictions.eq("enabled", true)); crit.setmaxresults(1); boolean anyisenabled = crit.uniqueresult() != null; the query should homecoming result when/if encounters first result enabled = true , doesn't have go through whole table solution using count , example, have to. java hibernate criteria hibernate-criteria

openerp - How to search a property field in OpenERP7? -

openerp - How to search a property field in OpenERP7? - i need property field(property_product_pricelist) available in res.partner table made available in advanced search. i in need of search implementation property field without using store=true. refer bug here: https://bugs.launchpad.net/openerp-web/+bug/1203615 search openerp openerp-7

ruby on rails - Issue with rake db:migrate whilst setting up pins scaffold -

ruby on rails - Issue with rake db:migrate whilst setting up pins scaffold - i have been having issues rake db:migrate while setting pins scaffold 1 mont rails tutorial. when seek migrate in terminal next error: taylors-macbook-pro:pinteresting taylorburton$ bin/rake db:migrate rails_env=development == 20150410031405 adduseridtopins: migrating ================================== -- add_column(:pins, :user_id, :integer) rake aborted! standarderror: error has occurred, , later migrations canceled: sqlite3::sqlexception: duplicate column name: user_id: alter table "pins" add together "user_id" integer/users/taylorburton/.rvm/gems/ruby-2.0.0-p598/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `initialize' /users/taylorburton/.rvm/gems/ruby-2.0.0-p598/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `new' /users/taylorburton/.rvm/gems/ruby-2.0.0-p598/gems/sqlite3-1.3.10/lib/sqlite3/database.rb:91:in `prepare' /users/taylorburton/.rvm/gems/ruby...

html - Wordpress Parent Theme is overridding Child theme -

html - Wordpress Parent Theme is overridding Child theme - i trying alter background image of body of wordpress kid theme. when preview changes , utilize inspect element kid theme code shows crossed out overwritten code in parent theme. have narrowed problem downwards inline php phone call in header.php file custombody class in parent style sheet. used same class in kid theme , still won't override parent. tried utilize higher css specifity: html body, html body.custombody { background-image:url('http://www.katekuhens.com/wp-content/uploads/2015/04/scribble_light_@2x.png') repeat #f3f3f3; } and parent still overrides child. ideas on doing wrong?? is possible @ someplace else, either in kid css or parent css, custombody has unique id? if that's case, no amount of class specificity override id https://css-tricks.com/specifics-on-css-specificity/. html css wordpress wordpress-theme-customize

Android : check wether action button (home,back, etc.. ) is inside the screen or not? -

Android : check wether action button (home,back, etc.. ) is inside the screen or not? - i explain in more detail, some of android device have action button this, while of device have like, in first case action button outside screen while in sec case action button given bottom of screen(inside screen)... how can observe action button present? have no thought it..!! check official android docs : http://developer.android.com/reference/android/view/keycharactermap.html#devicehaskey%28int%29 the method devicehaskey solve problem. (use keycodes keycode_menu, keycode_home, keycode_back). hope helps. android android-layout android-activity

c++11 - Is there a way to detour a c++ constructor? -

c++11 - Is there a way to detour a c++ constructor? - funny thing is, answered question not long ago getting address of c++ constructor saying can't done utilize perfect forwarding instead. however, in terms of detouring using microsoft's detour library, isn't option. address is required in order detour call. have inquire question, if there no address of constructor, possible detour one? , if so, how? not sure ms detour, hooking detour manually inline assembly in c++. if code (constructor instance) mapped in memory, , can write memory region, detouring is possible. the basic mechanism of hooking detour find place replace original opcode jump code cave. if jump code doesn't match size of original opcode, fill nops. execute original opcode in code cave pushad & pushfd doing want using global variables (recommended) call custom function without params popfd & popad jump patched opcode (skill bytes of nops) for first step, obtain address of con...

jquery ui - JQueryUI Tabs Selection and Validation -

jquery ui - JQueryUI Tabs Selection and Validation - i trying validate tab content(using ajax validation) before switching next tab. when user clicks on tab, current tab content sent server validation. , when result server received switch next tab. here code: $('#tabs').tabs({ select: function(event, ui) { ... validate(currentindex, nextindex); homecoming false; } }); function validate(currentindex, nextindex){ $.ajax({ ... complete: function(){ $("#tabs").tabs('select', nextindex); } ... } } you can see problem already, it's infinite loop, because validation causes tab's select handler causes validation , on. how solve without global variables? thanks. i'm not sure if work (haven't tried code) couldn't utilize .data(key,value) add together sort of "already validated" flag check for? add together if statement checks before ...

windows - Ways to provide a framework for DLLs to depend on each other and expose functionality? -

windows - Ways to provide a framework for DLLs to depend on each other and expose functionality? - essentially, how write plugin system, each plugin dll. (or there improve way of plugin scheme each plugin written natively?) suppose each dll offers functionality available to other plugins. if plugin provides funca , plugin b wants funca, how should dependency managed? how should plugins identified (guids?) how should dlls loaded? how should function called? i'm not familiar dlls, , asking on scope of windows api calls enable sane way accomplish this. have dll export function returning meta info plugin itself, i.e. version, dependencies, exported features etc. when walking on plugin directory, dynamically load dlls in directory via loadlibrary , check if export symbol matches query function (via getprocaddress ). if so, load dll, seek query plugin , meaningful info out of it. be sure employ kind of version management plugin system, accommodate api changes. wi...

How to avoid UDP socket transfers limits? -

How to avoid UDP socket transfers limits? - i write little programme sends file client server trough udp socket connection.. programme works correctly if file transfer larger 8192 kb stream stops , file receive corrupt.. how can avoid limitation? server.py host = ... port = ... filename = ... buf = 2048 addr = (host, port) udpsock = socket(af_inet, sock_dgram) udpsock.bind(addr) f = open(filename, 'wb') block,addr = udpsock.recvfrom(buf) while block: if(block == "!end"): # set "!end" interrupt listener break f.write(block) block,addr = udpsock.recvfrom(buf) f.close() udpsock.close() client.py host = ... port = ... filename = ... buf = 2048 addr = (host, port) udpsock = socket(af_inet, sock_dgram) f = open(filename, 'rb') block = f.read(buf) while block: udpsock.sendto(block, addr) block = f.read(buf) udpsock.sendto("!end", addr) f.close() udpsock.close() you still have...

c# - How do I move the AvalonDock Anchorable Pane tab to the top instead of the bottom? -

c# - How do I move the AvalonDock Anchorable Pane tab to the top instead of the bottom? - i using avalondock in project , utilize anchorable pane, instead of tab appearing @ bottom, appear @ top on document pane. project, document pane not appropriate control, need find way create anchorable pane appear in same way. according issue ticket found on codeplex there bug prevents changing tabstripplacement top. way accomplish replace existing style 1 this: <setter property="tabstripplacement" value="top"/> <setter property="template"> <setter.value> <controltemplate targettype="{x:type xcad:layoutanchorablepanecontrol}"> <grid cliptobounds="true" snapstodevicepixels="true" keyboardnavigation.tabnavigation="local"> <grid.rowdefinitions> <rowdefinition height...

web crawler - Scraping Data with Scrapy in Python -

web crawler - Scraping Data with Scrapy in Python - i want help friend analyze posts on social networks (facebook, twitter, linkdin , etc.) several weblogs , websites. i have several questions , seek categorize them: when comes scraping data, thought scraping info on social media via apis , sites via rss or site crawling utilize scrapy library. know if scrapy optimal plenty give me best result in short time , to the lowest degree usage of resources or not? python web-crawler

forms - form_tag cannot align button and input box - rails 4 bootstrap -

forms - form_tag cannot align button and input box - rails 4 bootstrap - i've been trying align button , form input tag nil appears working, if utilize normal html form bootstrap. <div class="input-group"> <input type="text" class="form-control"> <span class="input-group-btn"> <button class="btn btn-primary" type="button">go!</button> </span> </div> i aligned input box , button, when utilize form_tag helper next in erb; <%= form_tag search_nut_databases_path, :class => "form-inline", method: :get %> <div class="input-group"> <%= text_field_tag :search, params[:search], class: "form-control", :placeholder => "search database" %> <span class="input-group-btn"> <%= submit_tag 'submit', class: "btn btn-primary" %> </span> </div...

ruby on rails - Do you need a seperate pair of AWS keys for each S3 Bucket? -

ruby on rails - Do you need a seperate pair of AWS keys for each S3 Bucket? - or can utilize same 1 pair, let's 3 buckets (dev, production, staging). please advise! you can utilize single set of aws credentials manage multiple s3 buckets. or, can set each bucket requires different aws credentials. or, can configure access utilize iam instance role ec2 instance our instances without having create , manage individual keys. or, can grant access users in other aws accounts assume roles manage s3 buckets in account. or, can utilize amazon cognito individual users can log in own personal accounts on amazon, facebook, google, or openid connect-compatible identity provider, , create , manage own objects in s3 buckets without stepping on each other's toes. or, ... [please submit each "how" separate, new question.] ruby-on-rails ruby-on-rails-4 amazon-web-services amazon aws-sdk

authentication - Implementing a SAML SSO in Java -

authentication - Implementing a SAML SSO in Java - i have application (appa) needs access url on application (appb). appb service provider , has identity provider. i want create automatic way of application accessing url's @ appa. i know in saml protocol after service provider gives user(in case app) authentication url user required sign in user password. wanted know if there's generic way of implementing sign or must implement post request user , password have? in saml world have identity decision point (idp), policy decision point (pdp) , policy enforcement point (pep) , service, want call. idp provides authentication in way user can proof identity. pdp trust idp , decide level of authorization user wil providing valid idp document. pep allow or deny access service based on pdp document. the general flow contact service phone call straight causes not authorized response. result should include info accepted pdps. next pdp called, provide info idps acce...

python 3.x - Difference between Python3 and Python2 - socket.send data -

python 3.x - Difference between Python3 and Python2 - socket.send data - i'm practicing buffer-overflow techniques , came across odd issue sending socked data. i have 2 identical codes, except fact in python3 code, changed sock.send encode string (in python2 don't need that) python2 code: import socket,sys sock = socket.socket(socket.af_inet, socket.sock_stream) sock.connect ((sys.argv[1], 10000)) buffer = "a"*268 buffer += "\x70\xfb\x22\x00" #payload: buffer += ("\xfc\x48\x83\xe4\xf0\xe8\xc0\x00\x00\x00\x41\x51\x41\x50\x52" "\x51\x56\x48\x31\xd2\x65\x48\x8b\x52\x60\x48\x8b\x52\x18\x48" ... "\x72\x6f\x6a\x00\x59\x41\x89\xda\xff\xd5") sock.send (buffer) sock.close python 3 code: import socket,sys sock = socket.socket(socket.af_inet, socket.sock_stream) sock.connect ((sys.argv[1], 10000)) buffer = "a"*268 buffer += "\x70\xfb\x22\x00" #payload: buffer += ("\xfc\x48\x83\xe4\xf0\xe8\xc0...

c++ - perf annotated assembly seems off -

c++ - perf annotated assembly seems off - i want measure amount of time c++ atomic fetch_add takes on different settings. wrote this: atomic<uint64_t> x(0); (uint64_t = 0; < reps; i+=1g) { x.fetch_add(1); } so if reps high enough, assume able average the fetch_add per sec happening. first, needed validate of time indeed spent within fetch_add, opposed loop overhead, example. ran perf this. this assembly objdump: 400ed0: b8 00 b4 c4 04 mov $0x4c4b400,%eax 400ed5: 0f 1f 00 nopl (%rax) 400ed8: f0 83 05 7c 22 20 00 lock addl $0x1,0x20227c(%rip) 400edf: 01 400ee0: 83 e8 01 sub $0x1,%eax 400ee3: 75 f3 jne 400ed8 <_z10incrsharedv+0x8> perf (for cycles event) says 100% of cycles go sub $0x1,%eax , opposed expect, lock addl $0x1,0x20227c(%rip) or jump. ideas why? accurate, or measurement artifact? in sec case, why perf systematically attrib...

jql - Script Runner: handle custom field with space in expressions -

jql - Script Runner: handle custom field with space in expressions - i have custom field user picker (single user). field has space in name e.g. "user picker". cannot remove space name used in searches many other people. i want search issues assignee != user picker. installed script runner , added in advanced search: issuefunction in expression("", "assignee != user picker") got error: expecting eof, found 'picker' @ line 1, column 25. i searched net , found should able utilize custom field id eg cf[12345] should able use: issuefunction in expression("", "assignee != customfield_12345") error: field customfield_12345 not found or not number or date custom field. is there way of using user picker custom fields spaces in expressions? thanks jql

c# - Draw Lines on Image in PDF using ItextSharp -

c# - Draw Lines on Image in PDF using ItextSharp - i trying draw lines on image needs loaded on pdf document, draw graphics on paint event of control, fails so. any suggestions ? document pdfdoc = new document(pagesize.a2, 10f, 10f, 10f, 0f); pdfdoc.addheader("batting study - ", txtsearchbox.text); itextsharp.text.image pic = itextsharp.text.image.getinstance(properties.resources.bgww , system.drawing.imaging.imageformat.jpeg); pdfwriter author = pdfwriter.getinstance(pdfdoc, stream); pdfdoc.open(); pdfdoc.add(pic); so, how modify pic object of itextsharpimage can draw lines on image? please take @ watermarkedimages4 example. based on watermarkedimages1 illustration referred in comments. different between 2 examples add together text in illustration written in reply how add together text image? whereas add together lines in illustration written in reply question. we add together images this: document.add(getwa...

arrays - Emulate string split() from Javascript Object Oriented Programing Stoyan Stefanov book -

arrays - Emulate string split() from Javascript Object Oriented Programing Stoyan Stefanov book - im learning js oop stoyan stefanov's book. got problem exercise 4 in chapter 4: imagine string()constructor didn't exist. create constructor function mystring()that acts string()as closely possible. you're not allowed utilize built-in string methods or properties, , remember string()doesn't exist. can utilize code test constructor: below effort creating string split() method. guide me how create work ? class="snippet-code-js lang-js prettyprint-override"> function minestring(string){ this.lengths = string.length; //this[1] = "test"; for(var = 0; < string.length;i++){ this[i] = string.charat(i); } this.tostring = function(){ homecoming string; } this.split = function(char){ var splitedarray = []; var foundedchar = []; var string2...

javascript - NoMethodError in ProfilesController#show -

javascript - NoMethodError in ProfilesController#show - i working angular , rails, , can't seem angular application run within of app. working ruby 2.1.1 , rails 4.1 came error today , think close figuring out: class="snippet-code-html lang-html prettyprint-override"> angular.module('waiting', [ 'ngroute', 'ng-rails-csrf', 'templates' ]).config(function ($routeprovider, $locationprovider) { $routeprovider .when('/api/parties/:partiesid', { templateurl: '../templates/wait.html', controller: 'waitctrl' }); $locationprovider.html5mode(true); }); class="snippet-code-html lang-html prettyprint-override"> angular.module('waiting') .controller('waitctrl', [ '$scope', '$http', '$timeout', 'partyservice', function ...

big o - Implementing a Max algorithm that is O(1) -

big o - Implementing a Max algorithm that is O(1) - i asked implement simple algorithm find maximum number in list 1 of import condition. algorithm should o(1). wrote this: int max = int32.minvalue; foreach (int item in _items) { if (item.compareto(max) > 0) max = item; } homecoming max; as pointed in comment section o(n). how can find maximum number in list algorithm o(1). because me seems have iterate arrays items find max number. possible? after taking business relationship original question comments (and, suppose, inference on part), requirements follows: a list-like info construction with o(1) random access o(1) insertion @ end (amortized) o(1) deletion @ end (amortized) o(1) max the straight-forward solution (keeping track of max element on insertion) fails requirement 4 you'd need recalculate max on deletion. can adjust solve problem? yes, can! instead of keeping track of total maximum, maintain track of maximum indices i. ever...

asp.net - My database (.MDF) doesn't seem to attach to my .\SQLExpress but i can view it in VS 2010? -

asp.net - My database (.MDF) doesn't seem to attach to my .\SQLExpress but i can view it in VS 2010? - can help? i created db under app_data using add together item , choosing sql server db , sure plenty there. can double click , opens in vs 2010 in server explorer tab. the connection have configured in web.config following <add name="applicationservices" connectionstring="data source=.\sqlexpress;integrated security=sspi;attachdbfilename=|datadirectory|testdb.mdf;user instance=true" providername="system.data.sqlclient" /> as can see using .\sqlexpress. if open sql server management , connect .\sqlexpress database not there. actually reason need have access db need add together membership info via aspnet_regsql.exe. i tried via aspnet_regsql.exe pops gui , come in .\sqlexpress in server name , take db db not there. i confused, why not attaching it? vs 2010 can view in server explorer tab. i created blank asp...

java - JSF, override HTTP headers -

java - JSF, override HTTP headers - i need override jsf 2.0 content-type header. default content-type:application/xhtml+xml; charset=utf-8 but need content-type:text/html; charset=utf-8 thanks. how about <f:view contenttype="text/html" /> java jsf jsf-2 facelets

phusion - Ruby on Rails application could not be started -

phusion - Ruby on Rails application could not be started - i'm trying deploy changes, , cannot see them url got sends me on phusion error page "ruby on rails application not started". when check logs, this: exception argumenterror in phusionpassenger::railz::applicationspawner (syntax error on line 36, col 1: ` sdc_id: dcsvdln1l00000kv1qsmc4oob_1p3v') i have absolutely no thought what's going on, help appreciated. thanks in advance, rolf p.s.: whole trace exception argumenterror in phusionpassenger::railz::applicationspawner (syntax error on line 36, col 1: ` sdc_id: dcsvdln1l00000kv1qsmc4oob_1p3v') (process 28735): /usr/lib/ruby/1.8/yaml.rb:133:in `load' /usr/lib/ruby/1.8/yaml.rb:133:in `load' /home/..../config/environment.rb:92 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' /usr/lib/ruby/...

php - Errors while i'm puting my zend framework 2 project online -

php - Errors while i'm puting my zend framework 2 project online - i'm having problem puting zf2 site online. upploaded site godaddy host business relationship , refered dns my_folder/public . it's working redirect have lot of errors don't know i'm doing wrong, can help me please? obs: in local project working fine. this url: http://ceptreinamentos.com.br/ presumably admin\controller\abstractcontroller should admin\controller\abstractcontroller (note case). can have sort of problem if develop site on computer case insensitive file scheme (like windows), host on server using case sensitive file scheme (like linux). php zend-framework zend-framework2

LaunchD and Bing Wallpaper Shell Script -

LaunchD and Bing Wallpaper Shell Script - i'm trying utilize bing wallpaper downloader mac & ubuntu (found here: https://github.com/thejandroman/bing-wallpaper) download daily bing wallpaper , set background. script runs fine if run myself terminal typing: sh /users/noahschneider/pictures/wallpaper-changer/bing-wallpaper.sh however, when seek set launchd tasks, not work. launchd plist file stored in /users/noahschneider/library/launchagents/ , looks this: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple computer//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>label</key> <string>com.ideasftw.bing-wallpaper</string> <key>programarguments</key> <array> <string>/bin/bash</string> <string>/users/no...

java - Detect when user connects his android device to a TV -

java - Detect when user connects his android device to a TV - how can observe micro hdmi cable connection in code? in example, when user connects android device tv. use of these 2 or both depending upon requirement : /** * checks device switch files see if hdmi device/mhl device plugged * in, returning true if so. */ private boolean ishdmiswitchset() { // file '/sys/devices/virtual/switch/hdmi/state' holds int -- if // it's 1 hdmi device connected. // alternative file check '/sys/class/switch/hdmi/state' // exists instead on devices. file switchfile = new file("/sys/devices/virtual/switch/hdmi/state"); if (!switchfile.exists()) { switchfile = new file("/sys/class/switch/hdmi/state"); } seek { scanner switchfilescanner = new scanner(switchfile); int switchvalue = switchfilescanner.nextint(); switchfilescanner.close(); homecoming switchvalue > 0; } ...

google drive sdk - Endpoints for list and cell feeds of previous spreadsheet revisions -

google drive sdk - Endpoints for list and cell feeds of previous spreadsheet revisions - using google drive api, can retrieve list of previous versions of google spreadsheet, so: https://www.googleapis.com/drive/v2/files/fileid/revisions/revisionid where fileid id of spreadsheet , revisionid revision number. each revision returned has exportlinks field urls download these versions csv, xls, etc. with google spreadhseets api, there api endpoints cell- , row-based representations of spreadsheets: https://spreadsheets.google.com/feeds/list/key/worksheetid/private/full https://spreadsheets.google.com/feeds/cells/key/worksheetid/private/full here key same value fileid above , worksheetid code particular worksheet. are there api endpoints access list-based feed or cell-based feed particular revisions of google spreadsheet? no, spreadsheets api operates on current revision. google-drive-sdk google-spreadsheet-api

ndepend - CQLINQ for list of methods that take a type as a parameter? -

ndepend - CQLINQ for list of methods that take a type as a parameter? - what cqlinq list of methods taking (compatible) type or interface @ to the lowest degree 1 parameters? as explained in getting list of types effected extension method in cqlinq an actual limitation of ndepend cannot access method parameter types. hence can still obtain result dealing imethod.name string matching (since parameter types listed in, "method(int32,list<t>)" ) , inspiration cqlinq list of methods returning specific type or interface? ndepend cqlinq

java - ArrayIndexOutOfBounds when reading a file Android -

java - ArrayIndexOutOfBounds when reading a file Android - i trying read file in application content of file looks this: 0 1 1 0 0 2 2 0 ... when read file arrayindexoutofbounds exception how read file: assetmanager amanager ; string word = null; seek { amanager= getassets(); inputstream inputstream = amanager.open("edges.txt"); inputstreamreader streamreader = new inputstreamreader(inputstream); bufferedreader breader = new bufferedreader(streamreader); //word while((word=breader.readline()) != null){ string s = breader.readline(); string[] words =s.split(" "); string sx = words[0]; string sy = words[1]; // ---line 200, line exception system.out.println(sx); system.out.println(sy); } breader.close(); } grab (ioexception e2) { // todo auto-generated grab block e2.printstacktra...

Modify and Compare 2 images in Java -

Modify and Compare 2 images in Java - i have got assignment need validate images. have got 2 sets of folders 1 actual , other folder contain expected images. these images of brands/companies. upon initial investigation, found images of each brand have different dimension of same format i.e png what have done far:- upon googling found below code compares 2 images. ran code 1 of brand , ofcourse result false. modify 1 of image such both images have same dimension.. got same result. public void testimage() throws interruptedexception{ string file1="d:\\image\\bliss_url_2.png"; string file2="d:\\bliss.png"; image image1 = toolkit.getdefaulttoolkit().getimage(file1); image image2 = toolkit.getdefaulttoolkit().getimage(file2); pixelgrabber grab1 =new pixelgrabber(image1, 0, 0, -1, -1, true); pixelgrabber grab2 =new pixelgrabber(image2, 0, 0, -1, -1, true); int[] data1 = null; if (grab1.grabpi...

itunesconnect - iTunes Connect: Your app "*" (Apple ID: *) has one or more issues -- email goes to entire user list, all test flight users, no matter what app -

itunesconnect - iTunes Connect: Your app "*" (Apple ID: *) has one or more issues -- email goes to entire user list, all test flight users, no matter what app - today submitted new test app app store, via xcode, viewed in itunesconnect. app submitted successfully, binary rejected after min itc. there problem appicons having alpha channel in pngs. lot. the problem noticed notified email itc, , email sent entire user list our entity. means of test flight users in itc, our apps. in order add together test flight user, need setup in users&roles, , given arbitrary role "sales/marketing". (why isn't there role test flight users only?). seek turn notifications off them, settings seem limited. finally, these users getting notifications new test app they've never been associated , shouldn't care about. testflight not enabled app, seems irrelevant here. is there way stop entire user list getting technical email errors , such exclusively ...