Posts

Showing posts from February, 2013

Filter out duplicates in excel spreadsheet. -

i have several thousand rows , handful of them appear more 1 time. need able filter out review them without scrolling through thousands of rows of data. my data strings can't use math calculation (at least don't know how could). need data return in instance seattle symphony (all 3 times). atlanta symphony orchestra kingston symphony seattle symphony seattle symphony seattle symphony orchestra of st. luke's pasadena symphony association how say, please return rows appear multiple times. thank you. in column, starting in row 2 (because row 1 should header row), use formula , copy down (this formula assumes symphony names in column a): =countif(a:a,a2)>1 then filter on column true

sorting - How to print Powershell Array Columns to Rows -

i'm running script find users in exchange folders within inbox. return 1 of users this: $mailbox = @{name=test; folderpath=/inbox/test; foldersize=118.6 kb (121,475 bytes); folderandsubfoldersize=118.6 kb (121,475 bytes)} @{name=test folder 2; folderpath=/inbox/test folder 2; foldersize=0 b (0 bytes); folderandsubfoldersize=0 b (0 bytes)} i want take data , send them email listing folders. i'm using code body of email: "the following folders in inbox: $mailbox.folderpath" i want (with line breaks): the following folders in inbox: /inbox/test /inbox/test folder 2 currently returns on 1 line: the following in inbox: /inbox/test /inbox/test folder 2 how separate entries on different lines? thank you. you try this: $array = @("the following folders in inbox: ") foreach ($folder in $mailbox.folderpath) { $array += ($folder + "`n") } and $array put in body of email.

html - Parsec ignore everything except one fragment -

i need parse single select tag in poorly formed html document (so xml-based parsers don't work). i think know how use parsec parse select tag once there, how skip stuff before , after tag? example: <html> random content lots of tags... <select id=something title="whatever"><option value=1 selected>1. first<option value=2>2. second</select> more random content... </html> that's html looks in select tag. how parsec, or recommend use different library? here's how i'd it: solution = (do { ; string "<tag-name" ; x <- ⟦insertoptionsparserhere⟧ ; char '>' ; return x }) <|> (anychar >> solution) this recursively consume characters until meets starting <html> tag, upon uses parser, , leaves recursion on consuming final tag. it wise note there may trailing whitespace before & after fix that, this, providing parser consumes tags: solutio

javascript - Is it possible to filter the sound from an embedded YouTube? -

is possible somehow intercept audio stream youtube video , filter it? specifically, i'd filter out high , low frequencies , compression make sound megaphone. you'll need use javascript equalizer library, example: http://www.wavesurfer.fm/example/equalizer/ aside equalizing, you'll need audio. may able utilize service such youtube-mp3 or strip audio videos directly.

php - How to avoid inline css in dynamic wordpress style? -

i'm developing wordpress theme allows client upload own header background image. don't want image load mobile users. here what's working me right now: <div class="header" style=" @media (min-width: 676px) { background-image: linear-gradient(to right, rgba(1, 1, 1, 0.7), rgba(1, 1, 1, 0.1) 35%), url('<?php header_image(); ?>'); } "> this works, it's lot of inline styling. there way avoid having inline css? here's method tried didn't work: function header_image_style() { $header_image = header_image(); return "<style type='text/css'> .header{ background-image: linear-gradient(to right, rgba(1, 1, 1, 0.7), rgba(1, 1, 1, 0.1) 35%), url('".$header_image."'); } </style>"; } this method outputs $header_image url page when header_

Jssor drag and drop not working -

i've set slide time ago , today, trying fix bugs, updated library code. during tests noticed pc drag , drop doesn't work anymore, touch event does, i'm not sure worked before because it's been while since checked. is there wrong? here's code: image html template: <div> <img u="image" src="url" /> <div u="thumb"> <div style="width: 100%; height: 100%; background-image: url('url'); background-size: contain; background-repeat:no-repeat; background-position:center;"></div> </div> </div> slider.js: var jssor_slider1; function getcontentheight(){ return $(window).height()-$("#container").offset().top; } jquery(document).ready(function ($) { var options = { $arrowkeynavigation: true, $fillmode: 5, $autoplay: true, $arrownavigatoroptions: { $class: $

python 2.7 - convert depth map (resulting from photometric stereo) to 3d mesh -

i'm woking on project regarding 3d reconstruction. obtained depth map photometric stereo method. now, want do, convert depth map 3d mesh can visualise on meshlab example. can tell me how can ? ps : i'm working python ! thanks this not trivial exercise doable. basic steps are: use dense depth map generate voxel representation construct isosurface voxel model using e.g. marching cubes algorithm take @ paper 1 possible approach though it's far best way this: https://www.academia.edu/6148442/3d_reconstruction_on_a_mobile_device in particular pp43-45 onwards (disclosure: it's mres thesis).

css - jQuery position() top is different in Chrome and Firefox -

when run following fiddle in chrome , opera, position().top returned 0, firefox returning 1 , ie return 0.5. how can fix this? http://jsfiddle.net/scottieslg/loefza24/2/ html: <table id='testtable'> <thead> <tr><td>test</td></tr> </thead> <tbody> <tr><td>body</td></tr> </tbody> </table> <div id='toppos'></div> css: * { margin: 0; padding: 0 } #testtable { table-layout: fixed; width: 100%; padding: 0; margin: 0; border-collapse: collapse; } #testtable thead tr td { border: 1px solid #ccc; } script: $(document).ready(function() { var toppos = $("#testtable thead tr:nth-child(1)").position().top; console.log(toppos); $("#toppos").html("top: " + toppos); }); it seems ff doesn't consider border part of element. possible solution can use box-shadow

c# - How can I separate the navigation of an XpsDocument in a DocumentViewer control from the containing NavigationWindow? -

in wpf xaml, i'm using documentviewer control within navigationwindow display xps document (via xpsdocument class), per simple instructions here on msdn blogs . unfortunately, navigation within xps document (internal hyperlinks) propagate journal of navigationwindow , rather being contained within documentviewer control. i'm wondering how can separate two, perhaps using frame points xaml contains documentviewer , per topic pictured here on msdn . i'm new whole idea. have or know of code point me toward? thanks in advance! i figured out piecing documentation , information msdn. code fragments below in case helps else. within usercontrol navigated navigationwindow placed (among other window content) frame , shown <frame name="xpsframe" navigationuivisibility="hidden" journalownership="ownsjournal" /> and in code behind called xpsdocument xpsdoc = new xpsdocument(pathtodocument, system.io.fileaccess.read); m

eclipse - Is there a Maven plugin or configuration that will verify the Java package declaration matches the source directory? -

i've ran issue maven few times build not fail if there's inconsistency between package declaration , path of source file. other stackoverflow questions, there several examples shows eclipse catches type of error no problem , explains why maven doesn't: eclipse says package declaration not match expected package "" eclipse: declared package not match expected package maven + java package declaration there few different issue can arise when maven doesn't catch inconsistency including run-time failures load classes or unit tests omitted build without flagging errors. although maven doesn't catch compiler, there maven plugin out there validate package name source path? or possibly other configuration value can set in pom.xml or settings.xml maven verify these consistent?

Getting the Product Attribute Term Permalink in WordPress / WooCommerce -

i'm using woocommerce wordpress build store of antique photos. i'm using woocommerce product attributes feature store information item photographer. see here example, photographer attribute pulled out in box on left http://bit.ly/1dp999o the code pulls out attribute looks this: if($attribute['is_taxonomy']) { $values=wc_get_product_terms($product->id, $attribute['name'], array('fields' => 'names')); echo apply_filters('woocommerce_attribute', wpautop(wptexturize(implode(', ', $values))), $attribute, $values); } $values looks this: array ( [0] => photographer 1 ) the problem is, how permalink photographer automatically generated wordpress , woocommerce: http://bit.ly/1jtwbna i can't find documentation within woocommerce, , seems taxonomy within taxonomy goes bit further stabdard wordpress, i'm assuming standard requirement. pointers appreciated. once have attribute term (in cas

coldfusion - Removing solr.PorterStemFilterFactory from Solr fieldtype filter causes Highlighting error -

Image
in coldfusion site using solr searches, trying edit schema.xml file stemming turned off , exact word matches returned. how fieldtype defined text: <fieldtype name="text" class="solr.textfield" positionincrementgap="100"> <analyzer> <tokenizer class="solr.standardtokenizerfactory"/> <filter class="solr.commongramsfilterfactory" words="stopwords.txt" ignorecase="true"/> <filter class="solr.lowercasefilterfactory"/> <filter class="solr.removeduplicatestokenfilterfactory"/> <filter class="solr.porterstemfilterfactory"/> </analyzer> </fieldtype> i removed analyzer node, restarted core handling particular search , following exception message: "element highlightingresult undefined in cfml structure referenced part of exception." in results page, word matches highlighted. page results rendered in fo

java - Is it possible to configure codahale @Timed to report a subset of it's default metrics? -

i using codahale metrics' @timed annotation graphite reporter in spring app, want send subset of metrics our graphite server. for example, have no need p999, removing reduce sum of number of metrics number of @timed instances x number of environments. i don't see how api docs, , don't see examples of this. possible via metrics-spring config or via codahale's config? thanks! -neil

node.js - Can Gulp be modularized? -

i hope i'm close this, it's starting frustrating. i've asked before: is possible setup gulp in distributed fashion? ...but i'm still not quite able work. i've created gist 2 files i'm working with. my-gulp installed via npm . it's hitting my-gulp/gulpfile.js fine, i'm getting following output: > gulp reading my-gulp/gulpfile.js cwd: /users/will/projects/my-app [15:49:11] using gulpfile ~/projects/my-app/gulpfile.js [15:49:11] task 'default' not in gulpfile [15:49:11] please check documentation proper gulpfile formatting if had take guess, it's cwd being root of app, assume error long before making attempt load task ( this fails when attempting run task, btw, not default ). does have ideas? i'm @ blocker here :(.

Close system dialog with applescript -

Image
is there way click ok button on system dialog applescript? have made workflow on , closing dialog part missing. dialog appears on safari app (since make script work on safari) when button "stop reminders" clicked via javascript function. it's confirmation dialog destructive action (stoping reminders). clickid("stop reminders button id") --clicking on button need delay 2 -- making sure dialog has enough time appear pressenterbutton() --just trying close clickid(theid) tell application "safari" javascript "document.getelementbyid('" & theid & "').click();" in document 1 end tell end clickid pressenterbutton() tell application "system events" keystroke return end tell end pressenterbutton that's how try now, not works way (it's sad, because when press "enter" on keyboard, works should , dismisses dialog). @shooteko had point wrapping dialog

Put each element of an array, in a cell of a table created by Javascript -

i've created table using javascript. however, each of cells ( td ) in table display each element in array, in order of elements in array. array words in it: var myarray=['anime','demon','black','death','beast','tokyo','manga','titan','ghoul']; here javascript code far: function display_array(myarray){ var body = document.body, tbl = document.createelement('table'); tbl.style.width = '100px'; tbl.style.border = "1px solid black"; var arraylength = myarray.length; var sqroot=math.sqrt(arraylength); for(var = 0; < sqroot; i++){ var tr = tbl.insertrow(); for(var j = 0; j < sqroot; j++){ if(i == sqroot && j == sqroot){ break; } else { var td = tr.insertcell(); for(var q = 0; q < arraylength; q++){ td.appendchild(docu

awt - Image is drawing sideways to screen (Java BufferedImage, WritableRaster) -

Image
my code drawing image incorrectly. every time try guess what's wrong , fix it, arrayoutofbounds exceptions. array business mixing me up. need help. thanks! (by way, need extract pixel values , store them can blur, sharpening, , other types of methods on data hand. i'm learning how image processing works.) this code gives result (the image sideways when should right-side up): this original image: image.java: package mycode; import java.awt.image.bufferedimage; import java.awt.image.writableraster; public class image { public int height; public int width; public int image[][]; public image(bufferedimage openimage) { height = openimage.getheight(); width = openimage.getwidth(); image = new int[openimage.getwidth()][openimage.getheight()]; for(int x = 0; x < openimage.getwidth(); x++) { for(int y = 0; y < openimage.getheight(); y++) { image[x][y] = 0xff &

tomcat - Database Connection Pooling in Java Servlets -

i'm creating web application employee management system, using: apache tomcat http server, oracle database, applets client side programming , servlets server side programming. want use dbcp manage connections database. i servlet performing queries use username , password entered client connection. far i've seen username , password connection pool must set when configuring resource in context.xml . is there way achieve , still use dbcp? or have open connections in doget() , dopost() every request? as mentioned in comments, normally, restriction logic done on application side not database side. but if want use db security model need create seperate datasource (connectionpool) each logged user , store in session. if have many concurrent access discover running out of resources. for example using datasource easier configure may use connection pool implementation. in login action create new datasource, (for example using apache common: http://commons.apache

datepicker - Set dates for jQuery Date Range Picker from input values -

https://github.com/longbill/jquery-date-range-picker i have working quite can't seem picker use default values set in . there 2 inputs, start date , end date. have value="" date in both should default date datepicker. user has ability change dates. i've played few different ideas can't grab input's value attribute. insight appreciated. here code: <div class="datepicker-to-from"> <input type="date" id="starttimestamp" class="date-picker" value="11/18/2012 05:45 am"> <input type="date" id="endtimestamp" class="date-picker" value="04/09/2014 5:00 pm"> </div> $('.datepicker-to-from').daterangepicker({ format: 'mm/dd/yyyy hh:mm a', showshortcuts: false, time: { enabled: true }, getvalue: function(){ $('#starttimestamp').val() + ' ' + $('#endtimestamp').va

Angularjs filter - Compare multiple checkboxes boolean with JSON list, display union -

in view there 3 checkboxes change states of 3 values of $scope.colorchoice. i write function compares every true color corresponding color in json list. if person has @ least 1 color in array has been checked true, persons name should displayed. how can write such function? so far i've come far: json list: [ { "name": "kevin", "colors": ["red, green"] }, { "name": "hans", "colors": ["green"] }, { "name": "jolene", "colors": ["red, blue"] }, { "name": "peter", "colors": ["blue"] } ] checkboxes: <label ng-repeat="(item,enabled) in colorchoice"> <input type="checkbox" ng-model="colorchoice[item]"> </label> controller: $scope.colorchoice = { red: false, green: false, blue: fa

cocoa touch - Autosize Text in Label for PaintCode CGContext -

i'm using following draw text inside bezier path. how can adjust allow text autosize. edit i able update ios7 methods still nothing. can autosize text within uilabel fine, because cgcontext harder nsstring* textcontent = @"location"; nsmutableparagraphstyle* locationstyle = nsmutableparagraphstyle.defaultparagraphstyle.mutablecopy; locationstyle.alignment = nstextalignmentcenter; nsdictionary* locationfontattributes = @{nsfontattributename: [uifont fontwithname:myfont size: 19], nsforegroundcolorattributename: locationcolor, nsparagraphstyleattributename: locationstyle}; cgfloat locationtextheight = [textcontent boundingrectwithsize: cgsizemake(locationrect.size.width, infinity) options: nsstringdrawinguseslinefragmentorigin attributes: locationfontattributes context: nil].size.height; cgcontextsavegstate(context); cgcontextcliptorect(context, locationrect); [textcontent drawinrect: cgrectmake(c

java - Exception in VOCE sample C++ app -

i've been playing around c++ api of voce speech recognition in 1 of projects. far, i've been able compile c++ version of 1 of sample apps provided voce named recognitiontest (provided under samples directory in voce-0.9.1). however, when try running recognitiontest.exe, hit indexoutofboundsexception (console output provided below). [voce] java virtual machine created [voce] initializing recognizer. may take time... [voce] initialization complete speech recognition test. speak digits 0-9 microphone. speak 'quit' quit. exception in thread "recognition thread" java.lang.indexoutofboundsexception: index: 110,size: 109 @ java.util.sublist.rangecheck(unknown source) @ java.util.sublist.get(unknown source) @ edu.cmu.sphinx.decoder.scorer.scoreablejob.getfirst(threadedacousticscorer.java:516) @ edu.cmu.sphinx.decoder.scorer.threadedacousticscorer.scorescoreables(threadedacousticscorer.java:310) @ edu.cmu.sphinx.decoder.scorer.threadedacou

Passing bash argument as string -

i have little , stupid problem.. i'm trying make alias tar , gzip uses file name (given argument), not converting expected filename in output. my alias is: alias targz='tar -cvzf $1.tar.gz $1' it works, argument stored in $1 not working when setting filename, zips in file called ".tar.gz". i tried echoing '$1.tar.gz' , output '.tar.gz', so, think should stupid in format. any welcome, aliases don't have positional parameters. they're macros (an alias gets replaced text of alias when executed). you use function: targz() { tar -cvzf "$1".tar.gz "$1" } or script #!/bin/bash tar -cvzf "$1".tar.gz "$1" personally, i've been using following script achieve similar goal (comments added convenience): #!/bin/bash #support multiple args arg in "$@" #strip ending slash if present (tab-completion adds them) arg=${arg%/} #compress pigz (faster on multicor

javascript - key binding in react.js -

was trying implement key binding in react.js. did research, still wondering what's cleanest way it. example, if (event.keycode == 13 /*enter*/) { function() } if (event.keycode == 27 /*esc*/) { anotherfunction() } i ended binding keydown event when component mounted , unmounted: ... componentdidmount: function() { $(document.body).on('keydown', this.handlekeydown); }, componentwillunmount: function() { $(document.body).off('keydown', this.handlekeydown); }, handlekeydown: function(event) { if (event.keycode == 13 /*enter*/) { this.okaction(); } if (event.keycode == 27 /*esc*/) { this.cancelaction(); } }, render: function() { return this.state.showdialog ? ( <div classname="dialog" onkeydown={this.handlekeydown}> ... there's better way this. function used part of dialog component: https://github.com/changey/react-dialog

debugging - How to view data before insert in VBA? -

i have vba macro (not excel macro) pulling data 1 system , inserting failing. is there way write text file data trying insert? want see state of data before trying insert. what code supposed do: take returns erp , insert accpac/gl system. custom macro written this, not pull in old returns. believe because of period being lock in accpac, want see referencing such data. the mega macro: option explicit private dsdate1 accpacdatasrc.accpaccustomfield private dsdate2 accpacdatasrc.accpaccustomfield private blncancel boolean private sub cmdexit_click() unload me end sub private sub cmdreceipts_click() dorecpts 'docsv print #2, "interface ended" & close #2 shell "notepad.exe " & "receiptprocess" & format(date, "mmddyyyy") & ".txt" end sub private sub dorecpts() blncancel = false 'dim vrchead accpacview 'dim vrcdet accpacview 'dim vrccomm accpacview 'dim vrcvend accpacview 'dim vrcaddit acc

vba - Visual Basic: Calculating days until birthday from today -

i need make function calculates days until birthday todays date. have far is: function synnipaev(sk date, tana date) synnipaev = datediff("d", sk, tana) end function sk birthdate in excel sheet (formated 10.10.2001 dd/mm/yyyy) tana todays date in excel sheet ( =today() dd/mm/yyyy) it gives me days includes years. how make function not include years? datediff giving total number of days between 2 dates. need find difference between current date , next birthdate: public function daystobirthday(birthday date) integer dim targetyear integer 'has birthday passed year? if month(now) > month(birthday) or _ (month(now) = month(birthday) , day(now) > day(birthday)) 'then use next year. targetyear = year(now) + 1 else targetyear = year(now) end if daystobirthday = cint(dateserial(targetyear, month(birthday), day(birthday)) - now) end function note: vba stores date variables doubles, d

python - Getting the column name of a specific data with sqlalchemy -

i using sqlalchemy 0.8 , want column name of input only, not column in table. here code: rec = raw_input("enter keyword search: ") res = session.query(test.__table__).filter(test.fname == rec).first() data = ','.join(map(str, res)) +"," print data #saw here @ not 1 wanted. displays of columns columns = [m.key m in data.columns] print columns you can query columns want. if had model mymodel can do: session.query(mymodel.wanted_column1, ...) ... # rest of query this select columns mentioned there. you can use select syntax. or if still want model object returned , columns not loaded, can use deferred column loading .

security - Is it safe to buy a dedicated linux server? -

i'm planning buy dedicated linux server. i'll receive root password , i'll change .and i'll have ssh access. safe me keep personal data on server ? i mean , if change root password way datacenter server located ,to access server files while running , if change root password? i know root password can reset if restart server , boot install cd or flash . but if not reset root pass , can access files using usb cable or physical port not know? thank all in general, there no security solution can deal physical access in hostile environment. they pull want off there. if disable remote access, can pull physical disks , read them. if encrypt it, there variety of attacks (such man in middle, since control network) expose key relatively little effort. the only realistic way prevent access encrypt files on end , never ever ever send either raw files or key. however, applies if want server store files. if wanted to, example, host website database on m

Python Random Color Generation using Turtle -

i need generate random color using r g b values fill in these rectangles python school assignment, i'm getting bad color sequence error though i'm sure i'm formatting python documentation suggests. r = random.randrange(0, 257, 10) g = random.randrange(0, 257, 10) b = random.randrange(0, 257, 10) def drawrectangle(t, w, h): t.setx(random.randrange(-300, 300)) t.sety(random.randrange(-250, 250)) t.color(r, g, b) t.begin_fill() in range(2): t.forward(w) t.right(90) t.forward(h) t.right(90) t.end_fill() t.penup() i'm quite confused why t.color(r, g, b) not producing random color? turtle.colormode needs set 255 give color strings in hex code or r g b. adding screen.colormode(255) no longer returned error.

How to take integer and remove other data types from the file java? -

i not know how take integer , ignore strings file using scanner. have far. need know how read file token token. yes, homework problem. thank much. import java.io.file; import java.io.filenotfoundexception; import java.util.scanner; public class clientmergeandsort{ public static void main(string[] args){ int length = 13; try{ scanner input = new scanner(system.in); system.out.print("enter file name extention : "); file file = new file(input.nextline()); input = new scanner(file); while (!input.hasnextint()) { input.next(); } int[] arraylist = new int[length]; for(int =0; < length; i++){ length++; arraylist[i] = input.nextint(); system.out.print(arraylist[i] + " "); } } catch (exception ex) { ex.printstacktrace(); } } } take @ api you're doing. http://docs.oracle.com/javase/7/docs/api/java/util/scanner.html#h

python - What is the approach to generate Topics from text using a wikipedia dump -

i'm new nlp/text processing and building application requires generating topics (music, games, romance, history etc etc.) 2 lines of imput text. i've decided use wikipedia's articlebase me out in process, what steps "train" program recognize , categorize these topics input text? such broad question. automated topic modeling (where don't have train model) might want @ latent dirichlet allocation. in python, gensim nice way lda. i've used weka in java classification tasks, might more you're looking at. , lightside researcher's work bench offers gui text mining tasks.

r - subset based on date in a reference table -

i have table1 follows. studentid date1 lunch 23433 2014-08-26 yes 233989 2014-08-18 no 909978 2014-08-06 no 777492 2014-08-11 yes 3987387 2014-08-26 no i have table, table2 follows id studentid date2 result_nm 1 777492 2012.06.10 0.1 2 777492 2013.12.06 2.0 3 777492 2014.08.30 0.6 4 23433 2011.08.26 3.0 5 23433 2015.04.06 3.0 6 233989 2011.05.14 0.003 7 233989 2014.09.14 0.05 8 909978 2004-09-12 0.2 9 909978 2005-05-10 0.23 10 909978 2015-01-02 2.4 11 3987387 2014-10-06 3.5 12 3987387 2014-08-26 1.17 i want retain observations table2 dataset date2 values less date1 values each studentid. in other words should contain these rows. id studentid date2 result_nm 1 777492 2

printing - How to get Linux Mint 17, print server TP-LInk TL-PS110U and thermal printer Asterix ST-EP4 work together? -

i here community. hope solution here. so got linux mint, , configured work printer asterix st-ep4... but, when connect printer through print server, tp-link tl-ps110u, followed step in tp-link tcp/ip configuration change ip , still cannot print anything. not know if have configured wrongly or print server not compatible printer. i hope here me, totally know nothing now. thanks in advance. it seems print server has different subnet mask (therefore exists on different network), what's needed on same network router/pc/(any other network device have @ home). i'll simple , mechanical can here in example, understand. skip solution part if don't want spend time on it. let's router uses 192.168.1.254 ip address internal network , pc gets 192.168.1.34 ip address. means router's built in switch using "1" network share data between hosts(pc/laptop/phone/tablet/network printer). note third number on hosts , routers ip address! so in case ment

ios - Next Previous buttons with AVPlayerViewController and AVQueuePlayer not working -

i'm using avplayerviewcontroller play number of videos, via avqueueplayer . problem previous/next buttons don't seem anything. can't find way of being notified when buttons touched. missing something? the code i'm using pretty simple: self.player = avqueueplayer(items: playeritems) self.playerviewcontroller = avplayerviewcontroller() self.playerviewcontroller?.player = self.player self.presentviewcontroller(self.playerviewcontroller!, animated: false, completion: { () -> void in self.playerviewcontroller?.player.play() })

How to use multiple count and group by condition in single SQL query -

below sql table. id filename code1 code2 1 002-03_001.tif y179 y179 2 002-03_002.tif y178 y178 3 002-03_003.tif y177 y177 4 002-03_004.tif y178 y179 5 002-03_005.tif y177 y179 6 002-03_006.tif y179 y178 7 002-03_007.tif y178 y178 8 002-03_008.tif y178 y177 9 002-03_009.tif y177 y179 10 002-03_010.tif y178 y177 from above table want make count of code1 , code2 like, code1 count1 code2 count2 y177 3 y177 3 y178 2 y178 3 y179 5 y179 4 you want sql fiddle sample data create table table1 ( id int,filename varchar(100),code1 varchar(10),code2 varchar(10) ) insert table1 values( 1, '002-03_001.tif', 'y179', 'y179'), (2 ,'002-03_002.tif', 'y178', 'y178') ,(3 ,'002-03_003.tif', 'y177', 'y177') ,(4 ,'

python - django install errors on MAC OSX - Yosemite -

i using pip install django on mac osx yosemite , running following errors during install process _^[root:~/development]# pip2.6 install django downloading/unpacking django downloading django-1.8-py2.py3-none-any.whl (6.2mb): 6.2mb downloaded installing collected packages: django compiling /private/tmp/pip_build_root/django/django/contrib/admin/filters.py ... syntaxerror: ('invalid syntax', ('/private/tmp/pip_build_root/django/django/contrib/admin/filters.py', 298, 36, ' self.date_params = {k: v k, v in params.items()\n')) compiling /private/tmp/pip_build_root/django/django/contrib/admin/views/main.py ... syntaxerror: ('invalid syntax', ('/private/tmp/pip_build_root/django/django/contrib/admin/views/main.py', 281, 38, " if not (set(ordering) & {'pk', '-pk', pk_name, '-' + pk_name}):\n")) compiling /private/tmp/pip_build_root/django/django/contrib/auth/hashers.py ... syntaxerror: ('

linux - Is that safe to use kfifo (not a _spinlock flavour) in fiq/nmi handlers? -

basically need pass variable-size records , fiq handler (arm platform). during get/put operation on kfifo (on user-space/kernel side only) going disable irqs , preemption. is safe way use kfifo in linux?

Does Dust.js provide a way to reference an object key/value by keywords "key" and "value"? -

i want use dust.js client template engine. have data json this: var data = { "foo": [{ "somekey": "somevalue", "otherkey": "othervalue" }, { "somekey": "somevalue", "otherkey": "othervalue" }], "bar": [{ "somekey": "somevalue", "otherkey": "othervalue" }, { "somekey": "somevalue", "otherkey": "othervalue" }] } i not know in advance uppermost object keys - not know foo , bar keys, can value. so, need iterate through json keywords key , value . in pseudo-code: {% for(key, value) in data %} {key}: {value} {% /for %} i know dust.js has {#section/} loop through object. again, have provide key name: {#extradata} {! inside section, dust looks values within extradata object !} inside section, v

swift - Xcode: Unable to run simulator error -

Image
an error encountered while running (domain = nsmacherrordomain, code = -308) that popup message every time. found question on here had bunch of solutions. tried dozen of them without luck. after seeing error message load "home" screen of simulator have trouble running app. i made new blank project , added text label see if error still happened next blank app , did. any ideas? open ios simulator , restore clicking on reset content , settings.

php - Joomla 3.3.6: Frontpage giving internal server error 500 -

i have joomla site , tried install akeeba backup component not installed due post_max_size limit. after have tried install via directory option in joomla , changed permissions of "tmp" folder. path not correct , component not installed. admin panel working fine front end gives 500 internal server error. have not changed .htaccess file same. , if put other file " index.html " or other file can access it. joomla not working. what problem? sounds have either incorrect /tmp file path or incorrect permissions. live or local server? can replicate issue locally? turn on error reporting in admin area , see if there errors displayed. in admin area check system information > directory permissions , make sure status writeable. check permissions of of files/directories - /tmp. files should 644 directories should 755 there additional info here hope helps.

java - REST - mark entries read/unread -

i did simple resp app entering blog entries html page, here sample code.. ideas why? googles looks should ok.. showing did.. every entry has id, saved in arraylist , has simple attribute text.. wanna add special commands later, can add event in command line well.. wanna add function can mark read/unread, default unread.. ideas how that? thanks @path("/") public class rootresource { private final entrylistresource entries = new entrylistresource(); @get @path("favicon.ico") public response getfavicon() { return response.nocontent().build(); } @get public response get(@context uriinfo uriinfo) { final uri location = uriinfo.getabsolutepathbuilder().path("/entries").build(); return response.seeother(location).build(); } @path("entries") public entrylistresource getentries() { return entries; } } and @xmlrootelement(name = "entryref") public class entryresourceref { private int id; private uri href; @xmlattr

python - How can I change field option in model automatically in Django? -

how can change model's field option in specific condition? example, want change option of is_it_question (editable) false via save function. class typefourchoice(models.model): question_choice = models.foreignkey(typefour) is_it_question = models.booleanfield(default=false) number = models.positiveintegerfield(blank=false, default=100, editable=false) word_or_words = models.charfield(default='', blank=false, max_length=20) timestamp = models.datetimefield(auto_now_add=true) def __str__(self): return "{} : {}".format(self.question_choice, self.word_or_words) def save(self, *args, **kwargs): if self.pk none , self.is_it_question: self.number = typefourchoice.objects.filter(is_it_question=true).count() + 1 ؟؟؟؟***self.is_it_question.editable = false***???? super(typefourchoice, self).save(*args, **kwargs) you looking statements self._meta.get_field_by_name('is_it_que

android - Show many radio buttons -

i have 7 radio buttons under 1 radio group. rendered them horizontally using orientation = "horizontal" . 4 can visible @ time, rest not. is there way show rest of them in second row while keeping these 'radiobuttons' in 1 'radiogroup`? in case need code - <radiogroup android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <radiobutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1 bhk" /> <radiobutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1.5 bhk" /> <radiobutton android:layout_width="wrap_content"

Need an alternative to Mobile Broadband API in WinRT -

i trying use mobile broadband api interfaces mobile device information imei,etc., on windows rt tablet. you can find api reference here i planning console application retrieve information shown in example below. unable find mbnapi namespace in winrt. i aware not available in winrt. if of know or have managed code or dll same, please point me in right direction. code: using system; using system.collections.generic; using system.linq; using system.text; using mbnapi; namespace consoleapplication1 { class program { static void main(string[] args) { mbninterfacemanager mbninfmgr = new mbninterfacemanager(); imbninterfacemanager infmgr = (imbninterfacemanager)mbninfmgr; mbnconnectionmanager mbnconnectionmgr = new mbnconnectionmanager(); imbnconnectionmanager imbnconnectionmgr = (imbnconnectionmanager)mbnconnectionmgr; imbnconnection[] connections = (imbnconnection[])imbnconnectionmgr.getcon