Posts

Showing posts from February, 2013

jquery - Bottom Center in CSS (thumb tray) -

i have spent hours googleing on how , have tried many different things. cant thumb tray center @ bottom of page. wanted see if maybe can me out. here website. www.gabitee.com , code have been messing with... from file supersized.css /* thumbnail tray ----------------------------*/ #thumb-tray{ background:#fff; position:fixed; z-index:3; bottom:3px; right:0; background: transparent; padding-top: 8px; height:80px; width:100%; overflow:hidden; text-align:center; } #thumb-back, #thumb-forward{ position:absolute; z-index: 9999; bottom: -2px; height:108px; width: 40px; } #thumb-back{ left:0; background: transparent;} #thumb-forward{ right:0; background: transparent no-repeat center center;} #thumb-back:hover, #thumb-forward:hover{ cursor:pointer; background-color:rgba(256,256,256, 0.1); } #thumb-back:hover{ border-right:1px solid rgba(256,256,256, 0.2); } #thumb-forward:hover{ border-left:1px solid rgba(256,2

asp.net mvc 4 - Use server side variable in jquery MVC 4 -

i'm having server side global variable in mvc4 application. and need use variable in view using j query. can 1 tell me how can use variable in view using j query. variable namespace saif.models { public class clsglobal { static string _absoluterurl; public static string absoluterurl { { return _absoluterurl; } set { _absoluterurl = value; } } } } in j query $(document).ready var url = @saif.models.clsglobal.absoluterurl; try adding '' url in javascript: var url = '@saif.models.clsglobal.absoluterurl'; the url contain value of absoluteurl .

javascript - Slide Effects for Tabs Part 2 -

ok original question got answered , slide effect happens when click in anywhere in div region..here code: $(document).ready(function(){ $('#tabs').tabs(); $("#tabs").click(function() { $(this).effect( "slide", "medium" ); }); }); now i'm wondering if wants copy text 1 of tab regions? every single time try highlight, tab slide away. how make tab region slides when actualy tab ul clicked? use combination of mousedown , mouseup : demo fiddle var down=0; $(document).ready(function(){ $("#tabs").mousedown(function(event){ down=event.clientx+"||"+event.clienty; }); $("#tabs").mouseup(function(event){ var up=event.clientx+"||"+event.clienty; if(up==down) $(this).slideup("medium" ); }); }); updated code prevent slidedown on right-click copy text : demo fiddle 2 var down="||"; $(document).ready(function(){

mysql - In CSV file \t (tab) is not accepting as column delimiter with php -

well, file i'm working save mysql query result .csv format. it's return data when view csv file it's showing ? mark in each row . it's because it's not accepting \t tab character column delimiter seperate each column value. how use t character in csv , how show result in each column column not overwrite each column value column ? what i'm expecting in csv file : -------------------------- column 1 column 2 ------------------------- result 1 result 2 result 1 result 2 result 1 result 2 result 1 result 2 but it's showing: http://propertyjungle.com.au/correct-view.gif csv.php file ?php $filename = 'text.csv'; header('content-type: application/csv'); header('content-disposition: attachment; filename='.$filename); $host=""; $uname=""; $pass=""; $database = ""; $connection=mysql_connect($host,$uname,$pass); echo mysql_error(); //or die("da

windows phone 8 - change page when audio time is ..... like 1.00 , 2.00,3.00 -

in windows phone app, try event of time of player.in requirements wants slide page when audio track time bla blaa. type of event in audioplaybackagent ? please let me know . thanks in advance you can set internal timer fires off every x ms , check current position. if near points, change page. have manually.

SSIS 2012 Colors -

we upgraded sql server 2012 , ssis 2012, being used 2008 colors huge jump , can hardly see when disabled in ssis package. know can change color theme dark or blue still dont not much. any idea how can modify colors more did in 2008? the , feel of 2012 data tool different of 2008 visual studio/bids. these different product (latest data tools , oldest bids/visual studio) can not change theme previous version :)

node.js - npm reports "requires (one version)' but will load (another version)" -

likely after cordove install npm got warning messages every npm operations "requires colors@'>=0.6.0' load .. color" d:\workspaces\enide-studio-2014\openwith.js>npm . -g c:\users\weibl\appdata\roaming\npm\openwith -> c:\users\weibl\appdata\roaming\npm\node_modules\openwith\bin\openwith.js npm warn unmet dependency c:\users\weibl\appdata\roaming\npm\node_modules\phonegap\node_modules\cordova requires colors@'>=0.6.0' load npm warn unmet dependency c:\users\weibl\appdata\roaming\npm\node_modules\phonegap\node_modules\colors, npm warn unmet dependency version 0.6.0-1 npm warn unmet dependency c:\users\weibl\appdata\roaming\npm\node_modules\phonegap\node_modules\node-static requires colors@'>=0.6.0' load npm warn unmet dependency c:\users\weibl\appdata\roaming\npm\node_modules\phonegap\node_modules\colors, npm warn unmet dependency version 0.6.0-1 openwith@0.11.0 c:\users\weibl\appdata\roaming\npm\node_modules\openwith how fix such

java - Selective replication in mongodb -

Image
i have 2 mongodb running in 2 different servers connected via lan. want replicate records few collections server 1 collections in server 2. there way it. below pictorial representation of want achieve. following methods consider using. mongodb replication - replicates collections. selective replication possible in mongodb ?? oplog watcher apis - please suggest reliable java apis is there other way ? , best way of doing ? mongodb not yet support selective replication , sounds though not looking selective replication more selective copying since replication ensures rules of using server. i not sure mean oplog watcher api easy enough read oplog on time querying it: > use local > db.oplog.rs.find() ( http://docs.mongodb.org/manual/reference/local-database/ ) and storing latest timestamp of record have copied within script make. you can use tailable cursor here on oplog effectiely listen (pub/sub) changes , copy them on other server.

.htaccess - Trying to Compare WebIOPi to the Apache Server -

http://code.google.com/p/webiopi/wiki/tutorial_basis webiopi web server , apache server, apache has .htaccess file determine income traffic routed file. permission of file can set in .htaccess file webiopi has config file doesn't seem have routing mechanism .htaccess of apache or it? webiopi doesn't have routing mechanism, said. based on basehttpserver . if python_major >= 3: import http.server basehttpserver else: import basehttpserver take @ secure webiopi more complete comparison between basehttpserver , secure webiopi implementation using apache.

Issue on parsing Html with jsoup for java -

i trying parse html using jsoup. i used "try jsoup" check if parsing of html correct. screenshot of results : please open link ^^ my code : url url = new url("http://tw.search.bid.yahoo.com/search/ac;_ylt=atqkyto06sgghho20hzmpex3_rf8?ei=utf-8&p=%e8%a1%a3%e6%9c%8d"); document doc; try { doc = jsoup.parse(url, 3000); elements descriptions = doc.select("div#srp_sl_result"+" div.att-item"); (element element : descriptions) { system.out.println(element.owntext()); system.out.println("--------------"); } } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } } but results returning empty, getting following output: -------------- -------------- -------------- i expecting output like: 女裝手套衣服*艾爾莎*暗釦長款披風式毛衣罩衫外套s~l【taa1166】 出價 799 元 直購 799 元 運費80元 | 30 次 | 剩 16小時 60分 賣家:艾爾莎時尚精品 (評價 25229) 在新北市 ☆

java - Maven model<modelVersion> version control? -

i know model 2.x maven 4.0.0. here want ask how changed in future. what purpose of tag. from http://maven.apache.org/guides/getting-started/ : modelversion element indicates version of object model pom using. version of model changes infrequently is mandatory in order ensure stability of use if , when maven developers deem necessary change model. the "model" refers structure of pom.xml itself, i.e. elements allowed/mandatory, how interpret them, etc.

javascript - Passing local variable to directive in AngularJs -

i have controller feed repeater array: demo.controller('mycntl', function ($scope, $compile) { $scope.items = [ { name: 'diego' }, { name: 'darko' } ]; $scope.load = function (obj) { $('body').append($compile("<panel data='obj' />")($scope)); } }); <div ng-controller='mycntl'> <p ng-repeat='item in items'> <button ng-click='load(item)'>load {{item.name}}</button> </p> </div> and can see, repeated item has button load further data. when button clicked calls load(obj) function, append page directive: demo.directive('panel', function () { return { restrict: 'e', scope: { data: '@' }, template: '<pre>i\'m panel called {{data.name}}</pre>', controller: function ($scope, $elem

python - grouping rows in list in pandas groupby -

i have pandas data frame like: a 1 2 b 5 b 5 b 4 c 6 i want group first column , second column lists in rows: a [1,2] b [5,5,4] c [6] is possible using pandas groupby? you can using groupby group on column of interest , apply list every group: in [1]: # create dataframe df = pd.dataframe( {'a':['a','a','b','b','b','c'], 'b':[1,2,5,5,4,6]}) df out[1]: b 0 1 1 2 2 b 5 3 b 5 4 b 4 5 c 6 [6 rows x 2 columns] in [76]: df.groupby('a')['b'].apply(list) out[76]: a [1, 2] b [5, 5, 4] c [6] name: b, dtype: object

bash - want to pipe while read find thru shuf util -

i use input random song selector: done < <(sort -zur <(find "$dir" -type f \( -name '*.mp3' -o -name '*.ogg' \) -print0)) but have noticed songs same album in consider rather large music catalogue. anyways wanted try , pipe thru 'shuf' see if notice difference, can't seem work. i tried felt obvious: done < <(shuf <(find "$dir" -type f \( -name '*.mp3' -o -name '*.ogg' \) -print0)) and then: done < <(find "$dir" -type f \( -name '*.mp3' -o -name '*.ogg' \) -print0|shuf) and in case: done < <(find "$dir" -type f \( -name '*.mp3' -o -name '*.ogg' \)|shuf) but far no love. but when create array , walk thru elements 'for' loop pipe 'shuf' seems work fine: trksshuf=($(find "$dir" -type f \( -name '*.mp3' -o -name '*.ogg' \)|shuf) you didn't write how attempts fail you,

c# - Inserting data into database in asp.net froms using the get method -

i want insert data database directly using url. asp.net default utilises post method can mention method want use because post method secured. in method data send in url database. i getting this: http://localhost:37145/website6/default.aspx?__viewstate=%2fwepdwulltezmtc4njy3nthkzh%2fzblwg%2faetocad3rjqba9mpamvbemwh%2fv9x6bpkaeu&__eventvalidation=%2fwedaan9lgp6yeh%2bodzmcfidl9y1escfkfw%2fruhzy1olb%2fnuvm34o%2fgfav4v4n0wgfzhr3f%2fbbzxlqovqaj%2fdsazkteluarerozhikn64xnvvi%2fuvg%3d%3d&textbox1=admin&button1=button in above url there 2 things _viewstate , _eventvalidation these 2 things , @ end value textbox , button appended url , data inserted database. also there method data inside _viewstate code because want insert data databae directly using url , method. also can response database whether data has been inserted or not. 1 if inserted or, 0 if failed. you can like mydata=request.querystring("textbox1") then can insert mydata content databa

Text field position when event raised -

does 1 know how position of cursor when event triggered have textblock (wp8) , when inputting character keydown event fired , position cursor in textblock when event fired. example hello, here @ @ fires event , need position @ is, note can not use function find last occurrence of @ since can move , forth in text , enter @ character , fires again event thanks, jani

mysql - how to return data if catgory have at least three families -

i have 2 tables relationship..every category have family or more 1-product_category 2-family i want select categories , families joined if category have @ least 3 families in family table i try doesn't work..something wrong count() select count(fa_name) count, d_family.*, d_product_type_category.pt_name d_family inner join d_product_type_category on d_family.fa_id = d_product_type_category.pt_id (count > 2) try this. aggregated column must filtered having clause not clause select count(fa_name) count, d_family.*, d_product_type_category.pt_name d_family inner join d_product_type_category on d_family.fa_id = d_product_type_category.pt_id group <add non-aggregated columns in select clause> having (count > 2)

R to SQL server. Make a query joining a database table with a R dataframe -

i have odbc connection sql server database. r, want query table lots of data, want records match dataframe in r columns (inner join). linking odbc tables in ms access 2003 (linked tables "dbo_name") , doing relational queries, without downloading entire table. need reproduce process in r avoiding downloading entire table (avoid sqlfetch ()). i have read information odbc, dbi, rsqlserver packages without success. there package or way fix this? many thanks! if can't write table database, there trick can use. make giant where statement. let's want join table table in database data.frame called a on column id . say: ids <- paste0(a$id,collapse=',') # if a$id character, you'll have surround in quotes: # ids <- paste0(paste0("'",a$id,"'"),collapse=',') dbgetquery(con, paste0('select * table id in (',paste(ids,collapse=','),')')) from comment, seems sql server has proble

MATLAB: Generating function depending on user input -

i new matlab , having trouble following. i using external function, "allcomb" allows me create combination of elements arrays. for example, have array c [1 2 3 4] , integer x of value between 1 20. results want simply, if x 1, function allcomb(c) if x 2, function allcomb(c,c) if x 6, function allcomb(c,c,c,c,c,c) ... on. instead of creating if condition, better way of doing it? thanks interest the long way using strings not necessary, use comma separated list operator : instead: c = [1 2 3 4]; x = 2 in = repmat( {c}, x, 1 ) allcomb( in{:} ) as example allcomb displays input: function allcomb( varargin ) celldisp(varargin) end returns x = 2 : varargin{1} = 1 2 3 4 varargin{2} = 1 2 3 4 and x = 4 : varargin{1} = 1 2 3 4 varargin{2} = 1 2 3 4 varargin{3} = 1 2 3 4 varargin{4} = 1 2 3 4

babel - how do i change flask-admin's locale? -

i wanner change locale, like: locale='zh_cn' not admin's application's locale, need change flask-admin's locale code. try add parameter ?lang=zh_cn to end of url request. if work, may add set $args $args&lang=zh_cn; to nginx conf file.

objective c - calling javascript event strings in to native iOS calendar iPHone -

we have develop iphone application in phonegap environment. call below javascritpt function in objective-c xcode create event in native ios calendar. //calendar.js var calendarplugin = { createevent: function(title, location, notes, startdate, enddate, successcallback, errorcallback) { cordova.exec( successcallback, // success callback function errorcallback, // error callback function 'calendarplugin', // mapped our native java class called "calendarplugin" 'addcalendarentry', // action name [{ // , array of custom arguments create our entry "title": title, "description": notes, "eventlocation": location, "starttimemillis": startdate.gettime(), "endtimemillis": enddate.gettime() }] ); } } i have basic code of calendar event in objective c, need pass string value java

actionscript 3 - How to bind a variable to ResourceManager.getString() in Flex using AS3 -

those day trying find way bind variable localised resource , not have result. the situation following: have class componenttypes.as, contains public variables of type string. want variables bound translated resource: package model { import mx.resources.iresourcemanager; import mx.resources.resourcemanager; public class componenttypes { private static var resourcemanagerinstance:iresourcemanager = resourcemanager.getinstance(); //areas , volumes [bindable] public static var heated_area:string = resourcemanagerinstance.getstring('app','phpx.componenttypes.heatedareas'); [bindable] public static var heated_volume:string = resourcemanagerinstance.getstring('app','phpx.componenttypes.heatedvolumes'); } } however variables not updated when locale changed. clear, not bound. so question is: there way can bound variables resourcemanager class, updated when locale changed? s

Sql select two digits values only -

i'm trying select values sql table (phpmyadmin) contains 2 digits. so: idnumber = '12' //should selected idnumber = '34' //should selected idnumber = '123' //should not selected idnumber = '456' //should not selected this have far, returns nothing / zero select * `tablename` idnumber '[0-9][0-9]' any ideas? try this sql-server: select * `tablename` len(idnumber) = 2 mysql: select * `tablename` length(idnumber) = 2

asp.net mvc - AzureReader2 with ImageResizer prefix issue -

Image
we using azurereader2 plugin read blob urls , imageresizer plugin re-size images on fly. our container name - img azurereader2 prefix name - img <add name="azurereader2" prefix="~/img/" connectionstring="defaultendpointsprotocol=https;accountname=my;accountkey=my endpoint="http://<account>.blob.core.windows.net/" /> so, image url looking below: http://.blob.core.windows.net/img/img/1gks2eef2br171185/f81c8448-47cb-4448-b1d3-d59a07394bb4.jpg?w=500 img repeated twice. is there way handle this? can use empty prefix imageresizer? any advise helpful. based on example url you've provided, think misunderstanding process. the cloud architecture page can helpful here. your image url should not http://myaccount.blob.core.windows.net/img/img/1gks2eef2br171185/f81c8448-47cb-4448-b1d3-d59a07394bb4.jpg?w=500 without cdn, should in form http://myserverwithimageresizer.com/img/img/f81c8448-47cb-4448-b1d3-d59a07394

java - Supporting multiple screens in android in single layout -

i have followed following link application can support different screen sizes: supporting multiple screens in android that solution works perfectly. concern here is, when have android application having 8-9 screens, means have 8-9 different .xml layout files. support screens folder bifurcation , means have manage above fifty xml files layouts , simple change in ui, have go folders , implement change in xml file. can there better way , mean such layout can resize controls or that? i think not complex. create layouts in layout folder. use styles.xml, dimens.xml , strings.xml save font size , strings. when layout finalize i.e no changes required, copy these layouts layout folder , paste in layout-small, layout-large, layout-xlarge . when need change strings, style , font size have make changes in values folders. for example- instead of android:text="hello" use android:text="string/hello" , save value of hello in strings.xml. text size android:te

actionscript 3 - ExternalInterface.call crashes flash for Chrome -

there swf file on website, when click button on it. calls js function, function removes swf , puts another.the problem crashes on chrome. confused problem. these cases: -if comment out code removes swf file , add next swf file, no crash happens. -if call javascript function(which called swf) side, works fine. just idea: make test let call swf return before removing swf dom. try settimeout let call swf return , let remove-code triggered timeout. what kind of crash it? as3 exception or chrome crash?

c++ - Is std::this_thread::get_id() reliable in VS2013? -

the title says everything:) #include <thread> #include <cstdio> int main() { std::thread threads[2]; (int = 0; < 2; ++i) { threads[i] = std::thread([&]() { printf("thread id = %x\n", std::this_thread::get_id()); printf("thread id = %x\n", std::this_thread::get_id()); }); } (auto& : threads) { it.join(); } return 0; } when compiling , running using gcc , clang have (my) expected result, 4 messages 2 different values printed in random order. when using vs2013 have 4 messages (as expected), 4 different values! am doing wrong here or compiler/ms threading library? edit: tony d pointed out problem seems considered thread::id int. next code works expected: #include <thread> #include <cassert> int main() { std::thread threads[2]; (int = 0; < 2; ++i) { threads[i] = std::thread([&]() { st

Installshield Automation is failing while running vbscript with error unable to create object -

i using installshield 2013 sp1 sab(stand alone build). trying change product codes, strings , properties of following vbscript. vbscript failing @ following code error: "unable createobject automation interface" on error resume next set oism = createobject("iswiauto20.iswiproject") if err.number <> 0 wscript.echo "unable createobject automation interface" & vbnewline wscript.quit err.number end if i have registered iswiautomation20.dll manually, not solve issue. using 32-bit build server. tagging installshield gurus ones can help. vbscript gurus can me if wrong in script. could case of iswiauto20 namespace. try i**sw**iauto20 instead of "iswiauto20". rob

TWAIN support for Google Chrome plugin -

now, when chrome states npapi deprecated alternatives twain scanning? seems nacl not have twain support. an alternative html5 + web socket. dynamsoft (the company work for) looking @ providing such solution customers using our npapi twain plugin. meanwhile, twain working group working on sword driverless scanning.

asp.net mvc - Iterating through generic collection using jquery or javascript -

i have view dynamically creates table structure <div> @if (model.parameterlistforreviewerone != null) { foreach (var item in model.parameterlistforreviewerone) { if (item.parmid != null && item.parmid != 0) { <tr class="highlightred parameterofreviewer1 bluebgtable-confi"> <td style="display: none">@html.hiddenfor(modelitem => item.parmid) </td> <td align="center" width="25%"> @html.displayfor(modelitem => item.parameterdesc, new { @readonly = "readonly" }) </td> <td align="center" class="one" width="35%"> @*@html.textboxfor(modelitem => item.reviewer1ratings, new { @class = "revieweroneclass", @id = "ratings1_" + @item.par

JQWidgets jqxGrid: how to get a dropdown from rowcell -

i have jqxgrid dropdown column. now, if in row dropdown item selected, dropdown item should deactivated in following rows. so, first have rows: var rows = $('#jqxgridpop').jqxgrid('getboundrows'); then cells containing dropdown for (var = 0; < rows.length; i++) { var cell = $('#jqxgridpop').jqxgrid('getcell', i, 'languageddl'); and then, whit magic, dropdowncontrol cell disable item. i’m stuck.. any hints or not possible? in advance i became answer on jqwidget forums, here solution: editor.bind('open', function (event) { var rows = $('#jqxgridpop').jqxgrid('getboundrows'); (var = 0; < rows.length; i++) { var value = $('#jqxgridpop').jqxgrid('getcellvalue', i, "languagecode"); var item = editor.jqxdropdownlist('getitembyvalue', value); editor.jqxdropdownlist('disableitem', item); }; });

java - Maven build fails on Ubuntu 12.04, JDK1.7 -

my maven build fine on windows machine fails compilation error on ubuntu. [error] failed execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project [xxx]: compilation failure: compilation failure: [error] /usr/share/tomcat7/[xxx]:[24,23] error: no suitable constructor found xxx [error] [error] constructor xxx not applicable [error] (actual argument class<xxx> cannot converted class<? extends xxx> method invocation conversion) [error] constructor xxx not applicable [error] (actual , formal argument lists differ in length) [error] /usr/share/tomcat7/[xxx]:[36,24] error: no suitable constructor found xxx) [error] -> [help 1] cat /etc/lsb-release distrib_id=ubuntu distrib_release=12.04 distrib_codename=precise distrib_description="ubuntu 12.04.4 lts" java -version java version "1.7.0_51" openjdk runtime environment (icedtea 2.4.4) (7u51-2.4.4-0ubuntu0.12.04.2) openjdk client vm (build 24.45-b08, mi

c# - Convert week and year to milliseconds -

i need convert, title says, weeks , year milliseconds since 1970. best way in .net? have information of week , year event occurred. week stars on monday. think datetime not answer since can't handle week of year. need method double getmili(int week, int year) . anyway you can put that: // let's convert 15th monday in 2014 int mondaysnumber = 15; datetime source = new datetime(2014, 1, 1); int delta = 7 + dayofweek.monday - source.dayofweek; if (delta >= 7) delta -= 7; source = source.adddays((mondaysnumber - 1) * 7 + delta); // finally, convert milliseconds double result = (source - new datetime(1970, 1, 1)).totalmilliseconds;

html - Html5 video tag is not working on iPad -

using phonegap , i'm trying display videos on page. all video tags showing play icon, when click on it, not play video. issue shows on ipad, not on iphone. here's markup i'm using: <video id="video1" width="100" height="100" controls> <source src="video1.mp4" type="video/mp4"/> </video> i can recommend projekktor jquery plugin. check at: http://www.projekktor.com/

Treating typescript enum as class with list of its instances -

i've used such construction in java: public enum mymartdiscountcard { //list of enum instances progressive(3, 10, 0.01), fixedpercent(5, 5, 0); //just normal class fields , methods private int initial; private int max; private int ratio; public mymartdiscountcard(int initial, int max, float ratio){...} public calculatediscount(float totalspent){ return math.max(initial + totalspent*ratio, max); } } now i'm learning typescript , want use similar constructions in it. as know ts specification does't allow it. there workaround patterns declare methods , properties , bind them enum instance? i extrapolating question, may not right answer you; don't see why need enum here. have concept of discount card, specializations. rather writing enum , having code throughout program switching , iff-ing off of type of card, use polymorphism whole program needs know there such thing discount card , doesn't need kn

struts2 - Data collection form inputs hidden Struts 2 -

my problem happens when send data hidden fields action. no data collected , result page receive following message: error setting expression 'idplatos' value '[ljava.lang.string;@354c0a31' error setting expression 'idrestaurantes' value '[ljava.lang.string;@4786b9ce' in form value of hidden fields come previous query, on same page query other data not in form displayed correctly.this code form: <s:form action="detalles.action" namespace="/" method="post"> <s:hidden name="idplatos" value="idplatos"/> <s:hidden name="idrestaurantes" value="restaurante.idrestaurante"/> <s:submit key="detalles" align="center"/> </s:form> this code action: public class platoaction extends actionsupport { private arraylist <platos> detalles; private int idplatos; private int idrestaurantes; public string execute

mpmovieplayercontroller - AudioSessionGetProperty ('tfac') failed with error: 'tahw'" -

i getting following error when play video url:- "[0x3c8eb18c] received corrupt data. property list null 2014-03-06 16:26:30.980[2034:60b] 16:26:30.980 error: [0x3c8eb18c] avaudiosessionutilities.h:88: getproperty_defaulttozero: audiosessiongetproperty ('tfac') failed error: 'tahw'". i error when post video app server , after uploading url , play in mpmovieplayercontroller. if close app , run video works fine. if person knows plz let me know. thanks i had issue , stumped quite while. in end found avaudiosession configured recording instead of playback. setting playback before loading video solved problem. hope helps! // configure audio session [[avaudiosession sharedinstance] setcategory:avaudiosessioncategoryplayback error:nil];

C++ strange behaviour mutator vector -

i've been working on work school have create client class 4 string, 4 int , vector(int) last argument. problem is, when want print of vector's elements, if use mutator directly, printing nonsence. vector<int> v_int; vector<int>::iterator it_v_i; v_int.push_back(2); v_int.push_back(3); v_int.push_back(7); v_int.push_back(1); client client("nom1", "prenom1", "adress1", "city1", "comment1", 1240967102, 44522, 5, 10, v_int); v_int = client.getidresources(); (it_v_i = v_int.begin(); it_v_i != v_int.end(); it_v_i++) { cout << *it_v_i << ", "; } print 2,3,7,1 expected, following code for (it_v_i = client.getidresources().begin(); it_v_i != client.getidresources().end(); it_v_i++) { cout << *it_v_i << ", "; } print unidentified number (like 3417664...), unidentified number, 7, 1 i don't understand why happening edit : constructor : client::client(

css - Jquery jparallax yorigin not working -

i'm using jparallax on site http://www.nalacebu.com/ problem parallax in 3 boxes won't scroll vertically. works if open , close browser "source viewer" or re-size browser. works locally , it's on wordpress theme. here's script: jquery(document).ready(function(){ jquery('#parallax1 .parallax-layer1') .parallax({mouseport: jquery('#parallax1')},{xorigin: 'center'},{yorigin: 'center'}); });

Randomizing Images using javascript -

ok im trying here: want randomize image under dv id splash , have images placed in root folder. tried randomize code using function randomimg() here output empty. ideas? <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>html</title> <meta name="author" content="blahblahblah" /> <!-- date: 2014-03-06 --> <script type="text/javascript"> function randomimg() { var images = new array(); images[0] = "img06.jpg"; images[1] = "img07.jpg"; images[4] = "img08.jpg"; images[5] = "img09.jpg"; images[6] = "img10.jpg"; var random = math

java - how to return one row of an [n][3] array? -

i want return one,two or more rows of [n][3] array. example, array { {1,11,5}, {2,6,7}, {3,13,9}, {12,7,16}, {14,3,25}, {19,18,22}, {23,13,29}, {24,4,28} } i want return {1,11,5} or {2,6,7},{19,18,22},{24,4,28} .how can this? public static int[][] horizontal_view(int first, int end) { if (first == end) return * ; //i want return here 2 or more row of [8][3] array int mid = (first + end) / 2; int[][] x = horizontal_view(first, mid); int[][] y = horizontal_view(mid + 1, end); return merge(x, y); } if won't modify array, can state: int[] row = array[1]; in case modify row, , don't want modifications visible in array , can clone array: int[] rowclone = (int[]) array[1].clone();

ibm mobilefirst - How can we retrieve mobile phone number & IMEI details using IBM Worklight? -

are there api's available in worklight can retrieve mobile phone number & imei details using ibm worklight ?? you need implement cordova plug-in. read training materials purpose . your plug-in can based on code, or similar: how imei number in phonegap?

c# - Prevent hung workers in ASP.NET when reading the posted data -

i have issue caused external factor causing app pool queue requests , hang. issue seems caused when client making http request somehow loses tcp layer connection server, whilst server trying read data post'd it. i using asynchronous http handler, , using following code read posted data: string post_data = new streamreader(context.request.inputstream).readtoend(); i believe happening "readtoend()" blocking worker thread , when tcp layer lost thread stuck there trying read indefinitely. how can prevent happening? i coding in .net 2.0 can use newer framework if required. httprequest.inputstream synchronously read entire request, returns stream 1 huge chunk. you'll want instead (requires .net 4.5): string body = await new streamreader(request.getbufferlessinputstream()).readtoendasync(); getbufferlessinputstream() won't read entire request eagerly; returns stream reads request on-demand. readtoendasync() asynchronously read stream without t

algorithm - Is it possible to come up with a distributed / multi core implementation of a prime sieve. -

i have been working on prime sieve algorithm, , basic implementation working fine me. struggling way divide , distribute calculation on multiple processors. i know require storage of actual sieve in shared memory area or text file, how 1 go dividing calculation related steps. any lead help. thanks! split numbers sections of equal size, each processor responsible 1 of these sections. another processor (or 1 of processors) generate numbers of multiple needs crossed-off. , pass number each other processors. each of processors use remainder of section size divided given number , own section index determine offset own section, , loop through , cross off applicable numbers. alternatively, 1 simpler approach using shared memory. let first processor start crossing off multiple of 2, second multiples of 3, third multiples of 5, etc. essentially let each processor grab next number array , run it. if don't well, may end third crossing off multiples of 4, since

javascript - Java script preload contents three.js -

simply pre-load contents bar or ever in three.js project or javascript either way should fine, im familiar action-script task cant seem manage in javascript: heres code: var loader = new three.objmtlloader(); loader.load( 'myobject.obj', 'myobject.mtl', function ( object ) { for(k in object.children){ object.children[k].position.z =-5; console.log("position changed"); } scene.add( object ); console.log("the item loaded"); i have looked @ loader examples three.js sample files dont follow well, there way check file size vs file bytes received , implement above, have tried returns under-fine. jquery welcomed i have similar problem. have created array preload , store objects in there. passed , returned currentid , able store them after that. in objects3dlistjson put info paths for (var curobj = 0; curobj < objects3dlistjson.length; curobj++) { loadermtl.load(curobj, objpath

events - Google doodle like API -

i looking google doodle api. interesting "events" details event. "event" don't mean concerts, or other events. make feed of interesting past events, anniversaries, birthdays. i have tried pulling wikipedia historic events, problem might not relevant, it's not interesting. have done queried data had 1st, 2nd.. 10th anniversary, still not want. i thinking on querying data have wikipedia against twitter , check events interesting. also there wolframalpha api looks kind of interesting... i'll happy hints , ideas, ideally api. spent time googling something, couldn't find cool.

php - facebook app request not show the notification in mobile app -

Image
i have invite friends feature in application fan page , using following code select friends sending them application request. fb.ui({ method: 'apprequests', message: 'invite friends', }); here screenshot of popup window select friends. when select user/s , click on "send requests" button, application request notification shows in web browser corresponding user/s face-book account, not works in native mobile face-book app. any in regard highly appreciated.

javascript - XMLHttpRequest cannot load xml-file. No 'Access-Control-Allow-Origin' header is present on the requested resource -

this has been asked alot it's json files. have online xml file website want use on subdomain website following error: xmlhttprequest cannot load xml-file. no 'access-control-allow-origin' header present on requested resource this code use load xml file: url = "http://www.worldofleonalewis.com/duets/rss.xml"; $("#video-detail").empty() $("#videos").empty(); $.ajax({ type: "get", datatype: "xml", url: url, success: function (xml) { } the solution have atm copy entire xml file , save xml file xml file updated post new content seems crazy work. i've read json , jsonp solutions can't json file this, xml. xml file

asp.net mvc 4 - How can we create account users under super admin -

can 1 explain me how create user accounts under super admin accesses , restrictions in asp.net mvc4. you can have @ this example in asp.net website , shows how implement membership , authentication in mvc3 applies mvc4 too. you first need setup database membership create sql database , call want. if application uses one, can use membership too. assign , user , password database. run asp.net sql server setup wizard located in .net framework directory. wizard called aspnet_regsql.exe. you can find more information process in this msdn article . once have setup membership, able designate actions or controllers superadmins have access to. [authorize(roles = "superadmin")] public class somecontroller : controller { // controller code here }

javascript - upload a file without having the submit button in mvc -

i want upload file without using submit button. file must uploaded @ moment user picks browse file window. now please provide ajax code or jquery upload file , how delete file. please provide control view this. view>>> <form action="fileuploadpost" method="post" enctype="multipart/form-data"> <label for="file1">filename1:</label> <input type="file" name="files" id="file3" /> <label for="file2">filename2:</label> <input type="file" name="files" id="file4" /> </form> controller>>> [httppost] public actionresult index(ienumerable<httppostedfilebase> files) { foreach (var file in files) { if (file.contentlength > 0) { var filename = path.getfilename(file.filename);

java - Find all possible path from source to destination in udirected graph -

i making android bus app ,in have find possible path between source , destination. using dijkstra algorithm dfs search. but when entered source , destination finding result ,it takeing more time , app crash. please provide solution .. i think crashing as, believe, algorithm using finding path 1 such path exists. kruskals algorithm can find multiple paths. https://github.com/monmohan/mgraphlib may help

iphone - i have error for importing class related issue..already import class but "unknown type name" in xib project ios -

Image
i import class in class. got error when try create object of class. error got unknown type name "classname" for example image attached you have circular dependency/include. think import welcomepage1 in yourplan class use forward declaration ( @class yourplan; ) rather #importing header. either use @class yourplan or import in .m file

c# - Creating a csv file, not adding to the next column -

first time trying build csv file in c#, here code: string filepath = @"c:\users\me\downloads\csvfiles\test-" + datetime.now.tostring("dd-mm-yyyy-hh-mm-ss") + ".csv"; string delimit = ","; list<string> cells = new list<string>(); console.writeline("gathering data..."); sqlconnection con = new sqlconnection(properties.settings.default.connectionstring); con.open(); sqlcommand cmd = new sqlcommand(); cmd.connection = con; cmd.commandtype = system.data.commandtype.text; cmd.commandtext = "select id, name contacts"; sqldatareader reader = cmd.executereader(); console.writeline("building csv file"); while (reader.read()) { addcell((idatarecord)reader, cells); } stringbuilder sb = new stringbuilder(); (int = 0; < cells.count; i++) { sb.appendline(string.join(delimit, cells[i])); } file.writealltext(filepath, sb.tostring()); /*method add each record list*/ public static void addcell(idat

Automatically logged out of all Google services periodically -

i'm getting logged out of google services set period after opening browser or logging in, it's 20 minutes, maybe less. log in page automatically redirect "clear cache , cookies" page, following instructions on page changes nothing , short time later logs me out again. particularly annoying when writing response review on google play developer console, because detects being logged out greys text box it's not possible copy , paste message , not saved draft, has written again. it's important note happens regardless of browser being used , regardless of whether or not logged in on multiple devices. google need fix. has else suffered these problems? it appears i've found solution, android app developer have bunch of tabs open such google play developer console reviews , statistics , google wallet financial reports. turns out problem related google wallet because if close tab, won't log me out of google services. appears bug google wallet servic

assembly - are constants type declaration case sensitive in HLASM? -

is there difference using lower or uppercase c when declaring constant char ? field1 dcl c'1' field2 dcl c'1' code runs if made no difference, see no mention of in documentation . nope, hlasm case-insensitive. can, of course, have mixed-case literal strings ( e.g. , c'hello world' ), labels ( e.g. , field , field1 ) , keywords ( e.g. dcl , dcl ) not case-sensitive.

WorksheetFunction.EoMonth failing in excel 2003 -

i wrote vba in excel 2010 when user on 2003 tries run code falling on @ this: if test >= worksheetfunction.eomonth(date, -1) + 1 , test <= worksheetfunction.eomonth(date, -1) + 9 with runtime error 483, presume because not supported in 2003? how can go solving this? add analysispack , add reference atpvbaen.xls using tools - references you can use function replacing worksheetfunction.eomonth with [atpvbaen.xls].eomonth

google maps - Toggle overlay in a Primefaces GoogleMap -

i using primefaces gmap show markers , circle overlays on markers. want toggle circle overlay on button click. idea how can that? using jsf 2.2 , primefaces 3.4.2. this how load map in jsf page. <p:gmap center="21, 78" id="map" zoom="2" type="roadmap" style="width:99%;height:90%;position:absolute" model="#{scnbean.supplychainmapmodel}" widgetvar="mapvar"> this how load markers , circle overlays in backing bean. @postconstruct public void viewsupplychainnetwork(){ (node node : supplychainnodes) { latlng coord = new latlng(node.getlatitude(), node.getlongitude()); marker = new marker(coord, node.getaddress(), node, getmarkericon(node.getnodetype())); supplychainmapmodel.addoverlay(marker); //adding circle overlay circle circle1 = new circle(coord, riskval*10000); circle1.setstrokecolor("#d93c3c"); circle1.setfillcolor("#d

java - Android How to play media files(.mp4) from assets folder -

i have problem code wherein cant trace problem on second try player.setdatasource(afd.getfiledescriptor(), afd.getstartoffset(), afd.getlength()); cannot determine assetfiledescriptor on 1st try catch statement.. it says local variable not initialized.. if initialized null.. the app unfortunately closed.. package com.thesis.americansignlanguage; import java.io.ioexception; import android.app.activity; import android.content.res.assetfiledescriptor; import android.media.mediaplayer; import android.os.bundle; import android.view.surfaceholder; import android.view.surfaceview; import android.widget.textview; import android.widget.videoview; public class videocompareclass extends activity { string get; videoview gesture; int charindex; char[] getarray; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.gesturecompare); surfaceview videoview = (surfacevi

printing - How can I preserve leading whitespace in this ZPL? -

i trying print receipt zebra qln320 printer. sending whitespace ":" characters appear aligned in ticket: ^xa^ll256^poi^fo20,20^adn,10,8^ci10^fb550,9999,,l^fd \& cra : jab \& contrato no : \& domicilio : rambla del poblenou \& ^fs^xz however, printer striping leading whitespaces , printed result is: cra : jab contrato no : domicilio : rambla del poblenou so, how can add "indent" without having set ^fo each line? ^xa^ll256^poi^fo20,20^adn,10,8^ci10^fd cra : jab contrato no : domicilio : rambla del poblenou ^fs^xz i don't have printer available @ present, haven't tested this. i believe it's ^fb that's causing problem - l option that's l eft-justifying data.

Read stdin line by line - php -

i need read stdin php. need read first line > save variable > print variable > read second line > save same variable (rewrite old content) > print - read third line > ... > end of inserted text. example of imput data: u u b h > b 1 :h1 u c h b > c 1 :h2 u d can me? here example how this. php standard input? here http://www.php.net/manual/en/features.commandline.io-streams.php php manual manipulating i/o streams if have further questions don't hessitate ask

html - Using Accordion inside canvas -

when use accordion, call using id inside div <div id="accordion"> what want using accordion inside canvas element. canvas tag calls id, don't have idea how solve issue. the main purpose have area on left images sorted in 3 sections, put inside accordion. on right, drawed grid inside canvas element. images dropped. here code, stopped here, , don't know reason jsfiddle shows 1 canvas although drawing of grid correct. apologize bad code. http://jsfiddle.net/us4er/4/ the jqueryui accordion wiget not operate inside html canvas. an alternate plan: you create image-source-accordion outside , left of canvas. then use jquery draggable plus canvas dropzone copy image toolbox , draw on canvas. this link shows how use jqueryui draggable "drop" img element on canvas: drag controls container , drop/draw them on canvas

CASE in WHERE in mysql -

this question has answer here: case in clause in mysql 1 answer the question simple title says,but here 1 logic. here code create table `inf_brand_images` ( `id` bigint(99) not null auto_increment, `brand` varchar(255) not null, `thumb` text not null, `is_active` int(2) not null default '1', `cmp_brand` varchar(1024) not null, primary key (`id`) ) engine=myisam auto_increment=6458 default charset=latin1 here data in table id | brand | thumb |is_active| cmp_brand 1 | nike | a.png | 1 | 2 | dunhill| b.png | 1 | 3 | nike | c.png | 1 | 123_nike 4 | nike | d.png | 1 | 789_nike cmp_brand prefixed ids 123_ , 789_ in case. if search nike, have 2 parameters,one nike , other id_nike.where id may 123 or 456 or other. what want is if cmp_brand '' compare brand else compare brand , cmp_brand. here tried sel

Add value from one cell to another then reset cell value. Excel -

hope can answer us. we want following: when value entered in a1, value added value of b1. we want value of a1 reset 0, keep value of b1 is possible in excel? on worksheet's vba private module (right-click report tab , hit "view code"), enter following code: private sub worksheet_change(byval target range) application.enableevents = false if target.address = range("a1").address range("b1") = range("b1") + range("a1") range("a1").clearcontents end if application.enableevents = true end sub worksheet_change called whenever change made worksheet. application.enableevents=false prevents code running continuously (without it, change b1 call worksheet_change). this code assumes value in b1 numeric (or blank). if may contain character text, check need put in place either reset value or not increment.

.net - Translate this C# comparison to VB.NET -

i'm trying translate comparison between 2 nullable(of byte) objects: public byte?[] header { get; private set; } public override bool equals(object other) { // ... more code translate if (this.header != othertype.header) return false; // ... more code translate } an online code translator gives me equivalent: private m_header nullable(of byte)() public property header() nullable(of byte)() return m_header end private set(value nullable(of byte)()) m_header = value end set end property public overrides function equals(other object) boolean ' ... more code translated if me.header <> othertype.header return false end if ' ... more code translated end function but exception: operator '<>' not defined types '1-dimensional array of byte?' , '1-dimensional array of byt

c# - Sql types and encrypted size -

i introducing symmetric key encription on dynamically generated sql server 2012 tables. i expect store: varchar(x) integers date time boolean i create key using create symmetric key mykey     algorithm = aes_256     encryption certificate mycertificate go i insert data using i.e. insert securetable(value) values (encryptbykey(@ui, convert(varbinary(max), 12345))) the result like: 0x0022377e67eff34daaad0f812153593d01000000c867c6f2085d3850bf1f50275945cfea90297c51d537e8c443b5f34050b325e0 how can size target columns? using varbinary(max) doesn't feel right! i'm looking like: int => varbinary(32) varchar(x) => varbinary(y) boolean => varbinary(10) datatime => ... as suggested @joe enos tryed encrypt several data types. empiric result: integer: takes 52 bytes varchar(x): takes x+45 x+65 bytes float: 68 bytes decimal(30,12): 68 bytes datetime: 68 bytes bit: 52 bytes

asp.net mvc - Connecting teamviewer in code via browser link -

i have issue that's driving me mad. have been able connect teamviewer session browser uri required remote resource. achieve using following uri command in browser address bar (in reality, it's button click in html): teamviewer8://remotecontrol?connectcc=123456789 although connects required, presents issue need address. the problem if connection isn't yet open, teamviewer session initiated , window pops in second monitor required. good. however, if session running , initiate subsequent request same uri, new session spawned , i'm left multiple, duplicate session windows. both resource hungry in long run , undesirable in practice. my ideal solution ideally, i'd process function such new session called if not have given id running. if earlier session id running, i'd find way bring focus, rather having teamviewer new new session. what know i know possible teamviewer console if attempt initiate second session against running id. using teamviewer

javascript - HTML Source Editor - Web Part -

i working on html web part. wanted make other web parts on page collapsable , expandable. found script place in html form web part. want. thing other parts automatically expanded when page loaded. read through script but, not familiar jquery syntax. line in code believe need change make sections automatically collapsed is: $(this).closest('.s4-wptoptable').find('tr:first').next().toggle().is(":visible") ? img.attr('src',collapse) : img.attr('src',expand ); i believe need change has toggle visible not visible. not sure how write that. here's whole script: <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.7.1.min.js"></script> <script type="text/javascript"> jquery(function($) { $('.s4-wptoptable').find('tr:first h3').append('<a class=\'min\' style=\'float:right\'><img src=\'/_layouts/ima

android - Buttons not showing when dynamically adding to LinearLayout -

i trying add number of buttons depending upon counter. have button increments counter. problem shows buttons in odd click. not show in clicks. example when click first, shows 1 button. click again, no button shows up. on third time, shows 3 buttons , on. can please tell me can issue. posting increment code , buttons displaying code. <code> animalseasylayout = (linearlayout) findviewbyid(r.id.animalseasylayout); forward.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub log.i("mustang", "increment"); increment(); showdigitimages(); } }); backward.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub