Posts

Showing posts from July, 2010

angularjs - Is passing a method as a string param to a directive not a bad thing? -

while discovering directives bumped on following: <div ng-app="twitterapp"> <div ng-controller="appctrl"> <div enter>roll on load more tweets</div> </div> </div> var app = angular.module('twitterapp', []); app.controller("appctrl", function ($scope) { $scope.loadmoretweets = function () { alert("loading tweets!"); } }) app.directive("enter", function () { return function (scope, element, attrs) { element.bind("mouseenter", function () { scope.loadmoretweets(); }) } }) they say: "it better practice decouple loadmoretweets() method entirely passing directive string parameter in view, , retrieving attrs parameter in directive." so becomes: <div ng-app="twitterapp"> <div ng-controller="appctrl"> div enter="loadmoretweets()">roll on load more tweets</div> </div> &

python - plotting multiple y vectors against different x vectos -

i have several y vectors. want plot them on same graphs x vectors not match well. there way elegantly this? for example x1 = [1,4,8,9,10,15,17] x2 = [2,14] x3 = [5,11,18,19] plot(x1,y1) plot(x2,y2) plot(x3,y3) the ys equal whatever measured value ends being , same length corresponding x's. how make these appear on same line plot?

ios - Google Analytics not tracking events in HTML5 mobile app properly on iPhones -

we using google analytics track events, events don't appear track 100% of time. track, , don't. we're not exceeding quota limits per session (at have 20 events per session). shouldn't issue. the tracking fails work consistently on our normal website our html5 mobile app version, though it's far less reliable html5 mobile app version. code: var share_url = 'http://twitter.com/intent/tweet?text='; // log in ga _gaq.push( ['_trackevent', 'share twitter', ''] ); // open url in browser open_external( share_url + encodeuricomponent( msg ) ); function open_external( url ) { window.open( url + '#phonegap=external' ); } _gaq.push( ['_trackevent', 'share twitter', ''] ); this won't anything. for _trackevent , third argument (where pass empty string) required . it's 'action' parameter. empty string falsey, fails silently. pass value there, , it'll work.

dropzone.js - Programmatically Add Existing File to Dropzone -

i'm trying add existing image dropzone programmatically, using dropzone.js faq guide: // add existing image if it's there. // headerdropzone dropzone (debug shows existing , initialized @ point. var on_load_header = $( '[name="on_load_header_image"]' ).val(); var on_load_header_path = $( '[name="on_load_header_image_path"]' ).val(); if ( on_load_header ) { // hardcoded size value testing, see second question below. var on_load_header_data = { name: on_load_header, size: 12345 }; // call default addedfile event handler headerdropzone.options.addedfile.call( headerdropzone, on_load_header_data ); // , optionally show thumbnail of file: headerdropzone.options. thumbnail.call( headerdropzone, on_load_header_data, on_load_header_path); } my first problem not working. addedfile event doesn't fire (or @ least addedfile handler in headerdropzone never fires), same goes thumbnail. my second problem/questio

groovy - Trying to setCellValue on blank cell -

i trying insert text blank cell getrow( 0 ).getcell( 0 ).setcellvalue( 'hat selection' ) and keep getting cannot invoke method setcellvalue() on null object why can't insert text blank cell? how can i? in case of object null, should first create , should set value on that. use createrow if have not created row already. sheet.createrow(0); if have created row, not respective cell first create respective cell , put desired value. use sheet.getrow(0).createcell(0).setcellvalue(value); or can combine all sheet.createrow(0).createcell(0).setcellvalue(value);

Creating a Password in C++ -

i looking 1 of tech campers create program allows them check if password entered correctly. have limited knowledge , appreciate provide. thank you. //this lets user input password enter area #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _tchar* argv[]) { cout << "please enter password"; char* userdata; { cin.getline(userdata, 70); //says data cout << userdata; }while (userdata != '\n'); if (userdata == 'this password') { cout << "welcome back"; } else { while(userdata != 'this password'); cout << "******** intruder alert *********"; } return 0; } i can see number of issues code. first, want do~while loop include password check condition well, otherwise checking password after user types in blank line (which match password if password li

sql server - SQL Combining 2 rows into one -

this question has answer here: can comma delimit multiple rows 1 column? [duplicate] 5 answers i have following query: select qn.id, qn.title, qt.description, l.displayname language, count(q.id) questioncount dbo.questionnaires qn join dbo.questionnairetext qt on qn.id = qt.questionnaireid join dbo.questions q on q.questionnaireid = qn.id join dbo.languages l on l.id = qt.languageid (qn.questionnairetypeid = (select id questionnairetypes value = 'quiz')) group qn.id, qn.title, l.displayname, qt.description which outputs following table: 36132a45-f09c-4eb5-9bd2-34a227ec03b9 test null english 1 36132a45-f09c-4eb5-9bd2-34a227ec03b9 test null spanish 1 24395bc7-a890-4514-ab35-7614e226b2a5 quiz null english 1 24395bc

printing - Report estimate items -

i need print individual estimate items in quickbooks on separate packing stickers company , item information, 1 sticker each item. have created print format estimate template desired information retrieves first item of estimate. need same form print items on separate stickers using same template. a related problem printer setup establishes default estimate printer, apparently can different each user in multi-user situation allows same estimate printer formats of single user. establish default printer each estimate format of individual user (i print estimates in several formats , want use different printers - e.g. page printer , sticker printer).

database - What is the minimum number of a valid B+tree? -

i'm trying appeal on question had on exam other day, b+tree. the question was: consider b+tree l factor (assuming l positive , even), h>=0 height (the root considerto 0) , n>=1 number of records. there 5 answers. 3 of them eliminated immediately, , had choose between these two: h>1 ==> n >= 0.5*l*(l+1) . second direction not guaranteed: depends on arrival order of keys. none of above. i chose (2) , lecturer says option (1). have following example think contradicts it: 7 / \ 3 9 / \ / \ 1 2 3 4 5 7 8 9 10 with l=4 , , h=2 : does b+tree represent valid b+tree? is lecturer wrong? i appreciate here. example 1 base appeal on? in general, minimum number of records n in b+tree height h , factor l ? well, apparently right... tree showed legal , contrasting lecturer's answer. by inserting following

javascript - Overriding the Jquery ajax success -

hi have base model - var basemodel = backbone.model.extend({ initialize : function(input){ // base initialization implementation common concrete models }, ajaxcall : function(input){ var dfd = new jquery.deferred(); $.ajax({ type: 'get', url: input.url, success:function(data){ // on success implementation dfd.resolve(data); }, error:function(){ dfd.reject(); } }); return dfd.promise(); } }); now, want create concretemodel extends basemodel's fetch function , overrides ajax success var concretemodel = basemodel.extend({ ajaxcall : function(input){ basemodel.prototype.ajaxcall.call(this, input);

html - Vertical-align middle for block inside div -

i'm having trouble vertical-align: center <p> inside <div> . there nothing more explain link jsfidle i'm jsfiddle link edit: please remember there ` .cover-price p{ width: 100%; height: 50px; background-color: rgba(0,0,0, .3);` so there small blackbackground price. i added "position:absolute;" attribute-value css sheet along "margin-top:170px; (which effects 170 in relation imaged div) .cover-price{ height: 300px; width: 300px; background-repeat: no-repeat; background-size: cover; *position:absolute;* } .cover-price p{ margin: auto 0; width: 100%; background-color: rgba(0,0,0, .3); color: white; *margin-top:170px;* } let me know if helps @ all. is, of course, placing $20.00 in middle of image (i hope that's want).

javascript - How to correctly bind the html5 'ended' event to any future (jquery-produced) elements? -

the title explains of it. have list of links lead videos , audio-files load in page through javascript. html looks this: <html> ... <body> ... <div id="main"> <ul> <li><a class="video" href="video/file1">video 1</a></li> <li><a class="audio" href="audio/file1">video 1</a></li> </ul> </div> ... </body> </html> my javascript looks follows. idea when click audio link insert audio tag, when click video link insert video tag. clicking anywhere on page plays/pauses audio/video. works except bottom block of code supposed handle 'ended' event. idea head list of links when media has finished. seems event won't bind @ all. $(document).ready(function() { var mediablock; var playing = false; $(".video").on("click", function() { var link = $(this).attr("href"); $("

kernel - One-vs-all multiclass classification -

i trying classify walk cycles svm. using precomputed kernel rbf kernel. k(x,x') = exp(-sigma*dtw(x,x')^2). trying 1 against stratergy multiclass classification. currently, using probabilty predict class want use majority vote kind stuck, need thought on how can use majority voting make class decisions, thought test examples on models , predict class more vote, acceptable approach? have following code. %# walk cycles dataset clear clc close % addpath libsvm toolbox %addpath('../libsvm-3.12/matlab'); % addpath data dirdata = './data'; addpath(dirdata); % load/read seprated datasets load(fullfile(dirdata,'mytraindata.mat')); traindata = mytraindata (:,5:104); clear data; trainlabel = mytraindata(:,1); clear label; load(fullfile(dirdata,'mytestdata.mat')); testdata = mytestdata(:,5:104); clear data; testlabel = mytestdata(:,1); clear label; % extract important informa

pdf - pspdfkit Custom Save iOS -

i using pspdfkit ios , can annotate pdf local directory. problem annotation saved automatically. have opened pdf this. how can save pdf when press save button? can custom save button following codes. pspdfdocument *document = [pspdfdocument documentwithurl:documenturl]; pspdfviewcontroller *pdfcontroller = [[pspdfviewcontroller alloc] initwithdocument:document]; pdfcontroller.openinbuttonitem.openoptions = pspdfopeninoptionsoriginal; uibarbuttonitem *backbutton = [[uibarbuttonitem alloc] initwithtitle:@"back" style:uibarbuttonitemstylebordered target:self action:@selector(backfromdocument)] ; pdfcontroller.leftbarbuttonitems = @[backbutton]; pdfcontroller.rightbarbuttonitems = @[pdfcontroller.annotationbuttonitem, pdfcontroller.searchbuttonitem, pdfcontroller.outlinebuttonitem, pdfcontroller.viewmodebuttonitem]; uinavigationcontroller *navcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:pdfcontroller]; [self presentviewcontroller:navcontroller

hudson - Access Jenkins build log within build script -

how go accessing contents of build (console) log within running build script? i have deploy script runs, logs series of servers , runs scripts on servers. need obtain output of remote scripts , use them later in build process , in completion email. you can in post build section, don't think can earlier in job. groovy post build plugin can information console log: if(manager.logcontains("text find")) { }

xcode - Unable to create a snapshot -

after looking similar posts, unable find solution worked me. whenever try create snapshot, error: unable write info file dvtfilepath:0x40333f360:'/users/home/library/developer/xcode/snapshots/projectname-fjjxrqffjieitcfaybymhrbrjxkr.xcsnapshots/info.plist'> after searching while found blog: xcode-unable-to-create-snapshot-plist basically states deleting xcode , re-installing solved problem. have different solution? thank you.

jsf - FacesExceptionFilter OmniFaces using error pages inside WEB-INF -

hi guys need in using omnifaces feature. i trying use facesexceptionfilter redirect user error page when exception encountered. i have following web.xml config <?xml version="1.0" encoding="utf-8"?> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <display-name>xxxxx</display-name> <session-config> <session-timeout>1</session-timeout> </session-config> <welcome-file-list> <welcome-file>pages/secured/main.xhtml</welcome-file> </welcome-file-list> <servlet> <servlet-name>facesservlet</servlet-name> <servlet-class>javax.faces.webapp.facesservlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>facesservlet</servlet-name> <url-pattern>*.xhtml</url-pattern> </servlet-mappi

ios - Multiple UIWindows and touch events -

i have created second window , add on top of default : [topwindow makekeyandvisible]; topwindow.hidden = no; it works top window block access of application's default window. want know if it's possible if there no element ( button exemple ) in top window @ given place of screen, can access elements of default window @ below. i hope understandable. sorry english. advance help. i have created second window , add on top so, think usual expectation there's 1 window per screen in ios app. the docs seem imply this : every app has 1 window displays app’s user interface on ios-based device display. if external display connected device, app can create second window present content on display well. it's possible ios assumes there's 1 window per screen, , hit-testing process considers 1 window, key window. since you're making second window key window, i'd suggest making first window key after create second window , see if changes thing

c# - Xamarin LINQ to Objects support -

is there linq support querying object collection (linq objects) in xamarin android or ios? seem it's linq sql or that? include queries in demo, it's querying table: table<entity> and saw linq query querying xml, there native collection support, , how enable it? thanks. yes, monotouch/xamarin.ios support linq objects. believe need support add using system.linq. for example, introduction monotouch.dialog : via clever usage of linq , c#’s initialization syntax, linq can used create element hierarchy. example, following code creates screen string arrays , handles cell selection via anonymous function passed each stringelement: var rootelement = new rootelement ("linq root element") { x in new string [] { "one", "two", "three" } select new section (x) { y in "hello:world".split (':') select (element) new stringelement (y, delegate { debug.writeline("cell tapped"); }) } };

winforms - How to change direction in which a control resizes in vb.net -

i'm making application in vb.net , have control (a label specific) , it's been set auto size based on texts in it. currently, label box resizes left , down: [label] -> | v i want label resize right , down: <-[label] | v how this? edit: label display's windows account name. it's aligned right side of window, that's why text must autosized , expand left rather right. the way can think of adjust location according change in size. here's code that. used tag property hold current size before resize. in resize event handler adjusted location. whenever label's text changed tag gets size. when resize called size has changed , comparing 2 tell how change location. since defaul autosize operation down didn't change that. private sub label1_textchanged(sender system.object, e system.eventargs) handles label1.textchanged label1.tag = label1.size end sub private sub label1_resize(sender system.object, e s

jquery mobile reflow table refresh issue -

Image
hi everbody trying use jquery mobile reflow mode , try update contents dynamically using refresh code provided in jquery mobile demos link . when try update appending data previous values (especially in mobile screen only) not in desktop posting image of 1 below. have body experience kind of behavior or bug you must refresh table , use .trigger('create') avoid duplicated label try use : var row = "<tr><td></td></tr>" $("#yourtable").append(row); $("#yourtable").trigger("create"); $("#yourtable").table("refresh"); if have loop try use : for() { var row = "<tr><td></td></tr>" $("#yourtable").append(row); } $("#yourtable").trigger("create"); $("#yourtable").table("refresh");

meteor - Why do these collection objects only contain _id? -

i have number of collections publishing client, 1 being stubborn: on db there collection 'cargoes'. collection contains 2 documents, , have number of fields. // in /lib/collections/cargoes.js cargoes = new meteor.collection('cargoes'); on server side we're publishing /server/server.js meteor.publish('cargoes', function() { return cargoes.find(); } ); on client side we're subscribed in /client/main.js meteor.subscribe('cargoes'); when type in cargoes.find().fetch(); in browser's (client's) console, 2 objects have correct _id values of objects expect back, but no other fields . any ideas of going wrong, or how debug this? edit1 - fixed typo in code, publish has had return, missed when entered on stackoverflow. your publish function isn't giving back meteor.publish('cargoes', function() { return cargoes.find(); }); -- update -- if isnt working, double check objects valid via mongo shell. m

sql - how to solve time-out HYT00 teraData -

Image
i have been working on asp.net , charts , want run query display data in charts. however, query takes lot of time , every time error comes time-out. the query : select colum, sum(case when column1 = 1 column2 end)mins, sum(column3)as rev, sum(column4)as qty table1 column5 between date-10 , date group 1 order column5; how can increase time out value? please help! there's no query timeout setting (only login timeout) in teradata's odbc driver when use odbc data source administrator, must set applcation using sql_attr_query_timeout attribute sqlsetstmtattr(). and default zero, means no timeout, must applied visual studio (global default automatically applied connections?) or program.

jquery - SimpleCart JS change color of cart according to quantity -

i'm having trouble trying use simplecart js events produce effect changes color of shopping cart according of quantity. essentially trying achieve function this: http://shop.hotelcostes.com/en/music/26-hotel-costes-1.html by using simplecart js: http://simplecartjs.org/documentation i have 2 scripts far work not ideal simplecart.bind( "afteradd" , function( item ){ if(simplecart.quantity() > 0){ simplecart.$("#cart").attr( "style" , "color:red" ); } }); simplecart.bind( "ready" , function( item ){ if(simplecart.quantity() > 0){ simplecart.$("#cart").attr( "style" , "color:red" ); } }); the problems: the script 'afteradd' function changes color of cart when add .hide() , .fadein() effects add function continues work hide, fadein, or add color effects don't work. simplecart provides event called 'beforeremove' need sort of function '

java - How to Retrieve Another Statement Records Using HashTable? -

good evening, try use hashtable() storing database table records temporarily . problem dunno why records being put inside hashtable() first record. think problem occur because of wrong loops concept, related code: declare hashtable hashsample = new hashtable(); for loop for (i = 0; i< db.getnumberofrows(); i++) { hashsample.put(i, db.getdata()); system.out.println(hashsample); } p/s: i'm new in hashtable, db (database statement) run fine... need hints , advised, in advanced^^ i tried code mocking db: public static void main(string[] args) { hashmap db = new hashmap(); db.put(0, "zero"); db.put(1, "one"); db.put(2, "two"); db.put(3, "three"); hashtable hashsample = new hashtable(); (int = 0; < db.size(); i++) { hashsample.put(i, db.get(i)); system.out.println(hashsample); } } and works fine. here output: {0=zero} {1=on

mysql - tables related with foreign key are synched with each other -

Image
i using phpmyadmin mysql. have 4 tables project1, project2, project3 , combine table. suppose combine table connected other tables foreign keys , add data of background script project1, prject2, , project3 tables. there way update corresponding foreign keys in combine table automatically ( without manually updating record). using yii framework gui. please suggest way new mysql , yii framework. http://dev.mysql.com/doc/refman/5.6/en/create-table-foreign-keys.html not understanding question think referring on delete , on update . on delete & on update options cascade set null no action restrict on delete & on cascade placed constraints in fk table , occur when parent id either deleted or updated. so if change id within projects table , wish change reflected in combine table, use on update cascade . as side note, why have 4 tables? can see need 2 tables. please note sql below may not syntactically correct. create table tbl_projects ( id integer no

How do we change the binding property of text block on demand in windows phone 8? -

i'm working on windows phone 8 application, which should work in 2 languages, english , arabic. default language english. later user can change language either english arabic or arabic english in settings page. when user clicks on "cities" button in home page, i'm displaying cities in listbox. default i'm binding city english value i.e. textblock x:name="city" text="{binding citynameen}" . below ui code. <listbox x:name="citieslist" selectionchanged="citieslist_selectionchanged"> <listbox.itemtemplate> <datatemplate> <grid height="50" margin="0,10,0,0"> <grid.rowdefinitions> <rowdefinition height="40"/> <rowdefinition height="10"/> </grid.rowdefinitions> <stackpanel x:name="datarow" grid.row=&

c++ - Is 'avct' a legal long value or a legal var/const? -

i'm reading source code of avchat. it's video chat program using udp , directshow. in header file globaldef.h , however, find definitions below: // messages const long msg_filtergrapherror = 'avct' + 1; const long msg_mediatypereceived = 'avct' + 2; const long msg_tcpsocketaccepted = 'avct' + 3; const long msg_udpcommandreceived = 'avct' + 4; const long msg_modifyfiltergraph = 'avct' + 5; // let main thread modify filter graph #define wm_modifyfiltergraph (wm_user+123) // udp command defines const long max_command_size = 100; const long cmd_clientcalling = 'avct' + 100; const long cmd_deviceconfig = 'avct' + 101; const long cmd_buildfiltergraph = 'avct' + 102; const long cmd_disconnectrequest = 'avct' + 103; i thought '' used surround single char, why code runs without problem on vs2010? these long consts used commands sent client server. i've set break

php - Tree Structure of Categories? -

i want display categories in tree structure in seller page marketplace extension in magento ce1.7 i'm getting in drop down list not looking great. any ideas <?php $_helper = mage::helper('catalog/category') ?> <?php $_categories = $_helper->getstorecategories() ?> <?php $currentcategory = mage::registry('current_category') ?> <?php if (count($_categories) > 0): ?> <select id="category" class="myinput-text required-entry widthinput" name="category"> <option value="">--select categories--</option> <?php $_helper = mage::helper('catalog/category') ?> <?php $_categories = $_helper->getstorecategories() ?> <element onclick="<?php $currentcategory = mage::registry('current_category') ?>&q

.net - Creating MVC project sometimes adds references? -

so i've been having issue adding mvc4 project solution. when add existing solution, throws warnings of mvc 4 framework dlls cannot found. however, when start new project mvc 4 project on own, references seem fine. i noticed in properties, there no path set in first scenario, set packages directory in project in second scenario not allow me type path any ideas?

MYSQL: Update replace on 2million records -

ok have on 2 million phone numbers in 1 table , need remove spaces phone field. i have index phone field , optimised table still when run following query slow , takes forever - in fact still waiting , 30minutes have past update actnsw set phone = replace(phone, ' ', ''); i need know if there away speed process not take long. database scheeme using innodb server version: 5.5.31-1 (debian) this basic sql query . can't can 1 thing don't run update query whole table . make multiple update queries .. update actnsw set phone = replace(phone, ' ', '') id < .2 milian update actnsw set phone = replace(phone, ' ', '') id < .4 milian , id > .2 milian update actnsw set phone = replace(phone, ' ', '') id > .5 milian , id > .4 milian .... i think .

setuptools - How to solve pkg_resources.VersionConflict error during bin/python bootstrap.py -d -

i tring create new plone environment using python plone-devstart.py tool. got bootstrap error. used command bin/python bootstrap.py -d project directory. it(bin/python bootstrap.py -d command) worked fine before got error like oomsys@oomsysmob-6:~/demobrun$ bin/python bootstrap.py -d downloading http://pypi.python.org/packages/source/d/distribute/distribute- 0.6.49.tar.gz extracting in /tmp/tmpdqvwya working in /tmp/tmpdqvwya/distribute-0.6.49 building distribute egg in /tmp/tmpv4bzyv /tmp/tmpv4bzyv/distribute-0.6.49-py2.7.egg traceback (most recent call last): file "bootstrap.py", line 118, in <module> ws.require('zc.buildout' + version) file "build/bdist.linux-i686/egg/pkg_resources.py", line 698, in require file "build/bdist.linux-i686/egg/pkg_resources.py", line 600, in resolve pkg_resources.versionconflict: (setuptools 0.6c11 (/home/oomsys/demobrun /lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg), requirement.parse

c# - Do linq queries re-execute if no changes occured? -

i reading on linq. know there deferred , immediate queries. know deferred types running query when it's enumerated allows changes data set reflected in each enumeration. can't seem find answer if there's mechanism in place prevent query running if no changes occurred data set since last enumeration. i read on msdn referring linq queries: therefore, follows if query enumerated twice executed twice. have overlooked obvious - but...? indeed, there none. actually, that's not quite true - linq providers spot trivial common examples like: int id = ... var customer = ctx.customers.singleordefault(x => x.id == id); and intercept via identity-manager, i.e. check whether has matching record in context; if does: doesn't execute anything. you should note re-execution has nothing whether or not data has changed; re-execute (or not) regardless . there 2 take-away messages here: don't iterate any enumerable more once: not least, isn'

jquery mobile - Bring text of an anchor tag with data-role=button in center using css -

i want bring text of button in center using css. have tried using text-align vertical-align nothing working. please advice. button css .button_eclipse { width: 100px !important; height: 100px !important; border-radius: 50% !important; background: rgb(247,107,32) !important; color: rgb(255,255,255) !important; } and in template creating buttons <div> <a data-role="button" id="btn_gotohomepage" class="button_eclipse"><%= val_btn_gotohomepage %></a> <a data-role="button" id="btn_gotologinpage" class="button_eclipse"><%= val_btn_gotologinpage %></a> <a data-role="button" id="btn_gotolistpage" class="button_eclipse"><%= val_btn_gotolistpage %></a> </div> please me. in advance. working example: http://jsfiddle.net/hyjeg/4/ html : <div> <a data-role="button" id="btn_gotohomepage"

validation - Can java annotations be overridden? If so? How? -

i built validation mechanism around application based on java annotations - similar java bean validation , sole exception mine easier - has value , type of value float . @target({ field }) @retention(runtime) @documented public @interface min { float value() default 0f; } now need extend mechanism support integer values. possible provide overriding of annotation? like: @target({ field }) @retention(runtime) @documented public @interface min { int value() default 0; } or possible 1 of 2 properties present? like: @target({ field }) @retention(runtime) @documented public @interface min { float value() default 0f; int intvalue(); } any other mechanism welcomed. thank you! an annotation type cannot declare superclass or superinterface; see jls 9.6 details. here couple of options: modify annotation support 2 values create second annotation different name , value, , have annotation processor handle both annotations.

Navigating to a html page from Windows Application -

i have create native application device has windows ce 5.0 , having .net cf 2.0 installed in it. app has ip address of device , open html page ip address has passed using post method. i able ip address , open page using process.start. using method(i can see value in address bar) now how can post parameter page?? i using microsoft visual studio 2008 pro edition. please help....thanks in advance see blo article here: http://www.hjgode.de/wp/2009/06/14/mdiwatch2/ it shows how use post send data server (java servlet). code uses httpwebrequest , builds post stream. in simpler form need use httpwebrequest , build special uri: http://msdn.microsoft.com/en-us/library/debx8sh9.aspx

lucene - Index Mysql database using Data Import Handler in Solr -

i want index mysql database in solr using data import handler. i have made 2 tables. first table holds metadata of file. create table filemetadata ( id varchar(20) primary key , filename varchar(50), path varchar(200), size varchar(10), author varchar(50) ) ; +-------+-------------+---------+------+---------+ | id | filename | path | size | author | +-------+-------------+---------+------+---------+ | 1 | abc.txt | c:\files| 2kb | eric | +-------+-------------+---------+------+---------+ | 2 | xyz.docx | c:\files| 5kb | john | +-------+-------------+---------+------+---------+ | 3 | pqr.txt |c:\files | 10kb | mike | +-------+-------------+---------+------+---------+ the second table contains "favourite" info particular file in above table. create table filefav ( fid varchar(20) primary key , id varchar(20), favouritedby varchar(300), favouritedtime varchar(10), foreign key (id) references filemetadata(id) ) ; +---

html - Make image link to a page using Logo Attributes in Oracle APEX -

i'm running oracle applications express on corporate network (for internal project) , trying make logo have used link home page. logo appears on every page , when user clicks on logo, navigates them home page. i've tried sorts of different strings, $('a[href*="home"]') <a href="/"> <a href="f?p=300"> etc. etc. my application lying on application 300, since development version. home url is: f?p=300:1:17112837468263 is asking possible do? thanks when define logo on application attributes, shown on pages because has been included in page template(s). example, on apex (4.2) instance i'm using "theme 24 - cloudy". in "one level tabs - no sidebar" template logo substitution string #logo# used in "definition > body" section: <header id="uheader"> #region_position_07# <hgroup> <a href="#home_link#" id="ulogo">#logo#&

imageview - Android: align two images -

i'm trying put 2 imageview in linearlayout , don't align it. want them appear: |<----space----> image 1 <----space----> image 2 <----space---->| but 2 images on left without margin. code: java int terciopantalla = modulo.anchopantalla(this) / 3; linearlayout.layoutparams layoutparams2 = new linearlayout.layoutparams(terciopantalla, terciopantalla / 2); layoutparams2.gravity = gravity.center; ruta1.setlayoutparams(layoutparams2); linearlayout.layoutparams layoutparams3 = new linearlayout.layoutparams(terciopantalla, terciopantalla / 2); layoutparams3.gravity = gravity.center; ruta2.setlayoutparams(layoutparams3); modulo.anchopantalla public static int anchopantalla(context context) { int ancho = 0; displaymetrics metrics = context.getresources().getdisplaymetrics(); ancho = (int) (metrics.widthpixels); return ancho; } xml <linearlayout android:layout_width="match_p

asp.net - How to Check Server Connectivity in javascript -

in asp.net application, having form different controls , after filling form, when click save button, if server connection available, datas has saved directly sql server , if connectivity not available, datas has saved local indexeddb datatbase. , later, if connectivity becomes available, indexeddb datas should saved sql server , indexeddb datas should deleted upon successful insertion of datas in sql server. want know how check whether connectivity available or not??? you can use navigator.online check if online. window.addeventlistener('load', function () { function onlinestatuschanged(event) { alert( 'now ' + navigator.online ? "online" : "offline" ); } window.addeventlistener('online', onlinestatuschanged); window.addeventlistener('offline', onlinestatuschanged); }); keep in mind not guaranteed correct.

firefox os - How to connect to rilproxy on Gecko -

i working on firefox os gecko v 1.3. getting error below when try call(mo call). d/ril_qc_b2g( 472): [sub0] [0000]> dial 9900110046 0 e/ril_qc_b2g( 472): [sub0] socket ril proxy closed; ignoring request d/ril_qc_b2g( 472): [sub0] [0001]> get_current_calls e/ril_qc_b2g( 472): [sub0] socket ril proxy closed; ignoring request d/ril_qc_b2g( 472): [sub0] [0002]> last_call_fail_cause e/ril_qc_b2g( 472): [sub0] socket ril proxy closed; ignoring request d/ril_qc_b2g( 472): [sub0] [0003]> set_data_subscription e/ril_qc_b2g( 472): [sub0] socket ril proxy closed; ignoring request can 1 please explain me how connect rilproxy. have check gecko/ipc/ril/ril.cpp , gecko/ipc/unixscocket/unixsocket.cpp fine without issue issue related bug 842334 link . issue fixed now

objective c - How to depict a radar chart in iOS? -

Image
i'm developing ios app , want depict graph shape circle pie chart, radius dependent on each specific values. sorry don't know name of such chart is, i'm sure every sane baseball fans or sports fans think should have ever seen such chart. example, if team's batting average best in league consists of 5 teams, radius length 5 (or other length proportional other values), , if same team's earned runs average fourth in league, length 2, etc, etc... , points or "tips" connected each other within chart, , area of connected figure filled colors. sorry awful explanation (it's quite difficult non-english native explain more clearly), question is, feasible depict such graphs in ios application? if can done in ios app, how/what library use plot such graphs? i've read core graphics documentation coreplot example page wasn't able find such charts in pages. don't idea of using d3 embedded in uiwebview suggested in this post since it's slow d

ios - Portrait image is not properly resizing -

landscape resizing portrait image not resizing properly. please me sort out problem. code :- cgsize newsize = cgsizemake(width, height); float widthratio = newsize.width/image.size.width*image.scale; float heightratio = newsize.height/image.size.height*image.scale; nslog(@" image size %f %f %f",image.size.width,image.size.height,image.scale); if(widthratio > heightratio) newsize=cgsizemake(image.size.width*heightratio,image.size.height*heightratio); else newsize=cgsizemake(image.size.width*widthratio,image.size.height*widthratio); uigraphicsbeginimagecontextwithoptions(newsize, no, 0.0); [image drawinrect:cgrectmake(0,0,newsize.width,newsize.height)]; uiimage* newimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); try this: - (uiimage*)resizeimage:(uiimage *)image imagesize:(cgsize)size { cgfloat imagewidth = image.size.width; cgfloat imageheight = image.size.height; cgfloat requiredwidth = (im

php - Hierarchy in Restful Url -

suppose there resource user - users registered book - books available in library favourite books - users favourite books. what restful way construct url favourite books of user ?. i have confusion on hierarchy of resources in url. please me form correct urls. the following urls comes mind when there request find out favourite books of user. users/:user_id/ favourites /books users/:user_id/books/ favourites users/:user_id/ favourite_books please me form correct way of constructing urls. i think it's matter of personal preference. is favourites important part of user , have more favorites movies example? i'd go one: 1. users/:user_id/favourites/books is 'property' of user's books , there more options, example last_read ? i'd go one: 2. users/:user_id/books/favourites is 'property' of user , there more options, example age ? i'd go one: 3. users/:user_id/favourite_books you might want ask question on pr

c# - How to bind xml image in listbox in windows phone 8 -

how bind xml image in windows phone 8? have done methods not working, whenever debug application, contains source of image but, image not displaying. code: list<list> lst = new list<list>(); lst = (from query in doc.descendants("row") select new list { id = convert.toint64(query.element("id").value), icon = query.element("icon").value, xyz = convert.toint64(query.element("xyz").value), url = query.element("url").value, name = query.element("name").value }).tolist(); listbox1.datacontext = lst; xaml code: <listbox.itemtemplate> <datatemplate> <stackpanel orientation="horizontal"> <image source="{binding icon}" stretch="uniform" horizontalalignment="center" height="50" width="50" verticalalignment="top&quo

python - How do I close a csv file created with pandas (pd.to_csv)? -

i first create file (appending mode) db.to_csv(db, mode='a', header=false, sep='\t') then try open it: rdb=pd.read_table(db,sep="\t",header=true,parse_dates=true) and next, python crashes,probably because file open, not it? i have tried: db.close() not work i'm late answer here, else having problem, found answer here: closing file after using to_csv() you can pass to_csv file object instead of path, , close yourself, this: outfile = open(path+'filename.csv', 'wb') df.to_csv(outfile) outfile.close()