Posts

Showing posts from August, 2011

ios - Image file extension Xcode -

i'm programming app similar email. when attach file message show filename + small image (icon), icon should according filetype, example pdf if file pdf, word id file word file .... anyone know how can find these small images ? or representative example ? advanced thank if ios can use uidocumentinteractioncontroller : nsurl *url = [nsurl fileurlwithpath:pathtoyourfile]; uidocumentinteractioncontroller *diac = [uidocumentinteractioncontroller interactioncontrollerwithurl:url]; nsarray *icons = diac.icons; if ([icons count] > 0) { // smallest available icon: uiimage *icon = [icons objectatindex:0]; } else { // no icon found. // according documentation, case *should not* occur... }

java.lang.NoSuchMethodException and the parameterized constructor -

i have class foo follows: public class foo extends bar { public foo(com.example.x displaystate, com.example.y parent) { super(displaystate, parent); } } the bar class shown below: public abstract class bar { public bar(com.example.x displaystate, com.example.y parent) { // received params } } additionally, there factory class following method: public static object getinstance(class thesourceclass, class thetargetclass, class[] parameterclasses, object[] parametervalues) { class theclass = (thetargetclass == null) ? thesourceclass : thetargetclass; try { constructor classconstructor = theclass.getconstructor(parameterclasses); return classconstructor.newinstance(parametervalues); } catch (nosuchmethodexception exp) { // log } the problem nosuchmethodexception exception arises: java.lang.nosuchmethodexception: com.example.foo.<init>(com.example.x, com.example

MySQL Copying row from table to table, using PHP at same time -

i know can this: insert anothertable (a, b, c, d) select a, b, c, d sometable somecolumn = 1 but if instead of select a, b, c, d need update columns a, b, c, "string" so put plainly want statement says: insert anothertable (a, b, c, d) select a, b sometable somecolumn = 1 // , put "string" d update so ran this: insert anothertable (a, b, c, d) select a, b, c, 'string' sometable somecolumn = 1 it selected 3 rows different entries in 'c' column , updates 'anothertable' inserting 3 rows exact same. should different values though... insert anothertable (a, b, c, d) select a, b,"some vale","somevalue2" sometable somecolumn = 1

angularjs - $http.get() with JSON data -

i'm writing server app , wanted client use data in body pararmeterize method, this: # http -v http://localhost:3000/url text=123 foo=bar /url http/1.1 accept: application/json accept-encoding: gzip, deflate, compress content-length: 29 content-type: application/json; charset=utf-8 host: localhost:3000 user-agent: httpie/0.4.0 { "foo": "bar", "text": "123" } in angularjs tried: var params = { "foo": "bar", "text": "123" } // no body $http({ method: 'get', url: '/url', data: params }) // ugly url // has limitation: http://stackoverflow.com/questions/978061/http-get-with-request-body $http({ method: 'get', url: '/url', params: params }) // params in body, wanted $http({ method: 'post', url: '/url', data: params }) is design or bug? i cannot see why documentation . i take answer: for http, it'

Rails: Is there a way to see which view/partial produced which part of the site's HTML? -

in our application working lot of variations of similar views/partials. it's bit difficult find right file when want edit it. handy somehow print out view's/partial's filepaths in generated html code. i guess 1 overwrite render method this, maybe there's solution this? thanks lot josh you can see rendered views/partials on console log or in development log and looks this: rendered static/_menu.html.erb (165.0ms)

php - remove duplicate data in array with key and assoc -

i have executed data table in database , results array(3) { [0]=> array(5) { [0]=> string(1) "1" ["id_pegawai"]=> string(1) "1" [1]=> string(1) "1" ["id_jabatan"]=> string(1) "1" [2]=> string(1) "1" ["id_media"]=> string(1) "1" [3]=> string(7) "marjana" ["nama_pegawai"]=> string(7) "marjana" [4]=> string(8) "nik.0001" ["nik"]=> string(8) "nik.0001" }, [1]=> array(5) { [0]=> string(1) "2" ["id_pegawai"]=> string(1) "2" [1]=> string(1) "4" ["id_jabatan"]=> string(1) "4" [2]=> string(1) "8" ["id_media"]=> string(1) "8" [3]=> string(7) "deny" ["nama_pegawai

java - Primefaces Dialog - Setter not found for property class -

i want implement primefaces 3.5 dialog component . my implemetation: <div class="span10"> <div class="well well-large"> <h:panelgrid columns="1" cellpadding="5"> <p:commandbutton id="modaldialogbutton" value="modal" onclick="dlg2.show();" type="button" class="btn btn-primary"/> </h:panelgrid> <p:dialog id="modaldialog" header="modal dialog" widgetvar="dlg2" modal="true" height="100"> <h:outputtext value="this modal dialog." /> </p:dialog> .... when start server view page get: java.lang.illegalargumentexception: setter not found property class @ javax.faces.component.uicomponentbase$attributesmap.put(uicomponentbase.java:2450) @ javax.faces.componen

google maps - InfoBox button to switch to street view -

i have button within infobox. want button switch street view. button gets triggered , switches street view code below treats street view entirely separete entity google map means cannot zoom out map view , there no visible marker on street view level: var fenway = new google.maps.latlng(this.marker[id].position.jb,this.marker[id].position.kb); var panoramaoptions = { position: fenway, pov: { heading: 34, pitch: 10 } }; var panorama = new google.maps.streetviewpanorama(document.getelementbyid("map-canvas"), panoramaoptions); this.gmap.setstreetview(panorama); how modify streetview triggered within current map rather creating entirely separete instance? this worked me: var streetviewmaxdistance = 100; var point = new google.maps.latlng(this.marker[id].position.jb,this.marker[id].position.kb); var streetviewservice = new google.maps.streetviewservice(); var pan

jsf 2 - Validation of dialog inside a accordion panel affects the acordion panel functionalty -

i have dialog inside accordion command button. if click on command button dialog opens , inside input text component. have made validation saying, name should not empty. the problem facing though did not clicke on command button validation message input text appears, saying should not empty. appears every time , application hangs. have tried setting dynamic="false" did not work neither. i using prime faces 3.5 , jsf2 <p:accordionpanel dynamic="true" id="editseaccordion" > <p:tab id="edit3" title="myedit"> <p:dialog widgetvar="addsapdialog" id="sapdialog" modal="true" minimizable="false" style="position:fixed;" closable="true" position="350,250" maximizable="false" > <p:panel style="border:none;background:#f0f0f0;margin-top:-10px;"> <h:panelgrid columns="2

android - Error assembly with monoandroid -

i have issue mono.android 4.6.04000 have error occurs when try built project "error cs0012: le type 'android.app.activity' est défini dans un assembly qui n'est pas référencé. vous devez ajouter une référence à l'assembly 'mono.android, version=0.0.0.0, culture=neutral, publickeytoken=c4c4237547e4b6cd'. (cs0012) (monapp)' in english sould "the type 'android.app.activity' define in assembly isn't referenced. have add reference assemby 'mono.android, version=0.0.0.0, culture=neutral, publickeytoken=c4c4237547e4b6cd'. and assembly mono.android referenced. know how resolve problem. sorry english. rebuild assemblies version of mono android using. because of changes strongnames in 4.6.0 .

html - Use jQuery to move back to top of anchor when scrolled away -

basically have full screen website scroll through content through links anchors. what want able page automatically scroll top of anchor when user scrolls away mouse wheel or scroll bar, viewer of site never have half of 1 box of content showing , half of other. example: http://nationallgbtmuseum.org/#/home/ when scroll away 1 bit of content page automatically scroll top of section. i hope makes sense, great. what you're looking sounds you're after described in question: snap top of div/element on scroll you @ these questions: animate div snap element in view

iphone - how to shift the slider image knot outside -

Image
i have difficulties understanding math behind on how calculate circumference of knots center of circle. hope guys can give me pointer. the current calculation set knot img in middle of pie, shift nearer outer circle in img 2 thank viewing , commenting, comments appreciated. how wan be. /** draw white knob on circle **/ -(void) drawthehandle:(cgcontextref)ctx{ cgcontextsavegstate(ctx); nslog(@"handlecentera.x %f",handlecentera.x); nslog(@" handlecentera.y %f", handlecentera.y); [[uicolor colorwithwhite:1.0 alpha:1.0]set]; uiimage *myimage = [uiimage imagenamed:@"clock-marker.png"]; //this give me result of image 1 [myimage drawinrect:cgrectmake(handlecentera.x-35, handlecentera.y-40, tb_button_width, tb_button_width)]; //this give me result of image 2 [myimage drawinrect:cgrectmake(handlecentera.x-35, handlecentera.y-40, tb_button_width, tb_button_width)]; cgcontextrestoregstate(ctx); } #pragma mark

azure - How can I tell what is using a large VHD? -

i running vm in windows azure. has 2 disks attached (os 40gb , data 60gb). in addition 2 vhds, storage has 1 more 40gb vhd named dmzvyyq2.jja20130312104458.vhd. i know vhd came , using it. surprisingly 'last modified' date yesterday must have updated it. went through options in portal nothing seems have vhd attached. ultimately delete vhd save storage space , cost. one possibility find out using storage analytics . if have storage analytics enabled, can view contents of $logs blob container, download data data in question , check activity on particular blob. can use tool azure management studio cerebrata view storage analytics data. if haven't enabled analytics on storage account, tough find out information.

php - I can connect to mysql db but my table is not updating -

i able connect mysql db have created table called attorney_users. know missing or doing wrong? have post function code below. when register user confirms success, table not updated. <?php require_once('appvars.php'); require_once('connectvars.php'); // connect database $dbc = mysqli_connect(db_host, db_user, db_password, db_name); if (isset($_post['submit'])) { // grab profile data post $username = mysqli_real_escape_string($dbc, trim($_post['username'])); $firstname = mysqli_real_escape_string($dbc, trim($_post['firstname'])); $lastname = mysqli_real_escape_string($dbc, trim($_post['lastname'])); $firmname = mysqli_real_escape_string($dbc, trim($_post['firmname'])); $email = mysqli_real_escape_string($dbc, trim($_post['email'])); $password = mysqli_real_escape_string($dbc, trim($_post['password'])); $password2 = mysqli_real_escape_string($dbc, trim($_post['

javascript - highlight a text word by word (jquery) (closed) -

i want create effect of highlighting read text. example want highlight text: <div> <p>lorem ipsum <i>is dummy</i> text of printing , typesetting industry</p> <p>lorem ipsum dummy text of <u><b>the printing and</b></u> typesetting industry</p> <p>lorem ipsum <b>simply dummy</b> text of printing , typesetting industry</p> </div> for moment found function not preserve tags: var text = $('div').text(); var regex = text.split(' '); $('div').html(''); (i = 0, len = regex.length; < len; i++) { $('div').append('<span>' + regex[i] + ' </span>'); } $('#click').click(function() { j = 0; var t = setinterval( function() { $('span').eq(j).addclass('highlight'); j++; }, 500 ); }); i think possible regular expression example: /(<[^>]+>)?([^<]*)/g

ms access - Select only some rows from database -

i have following query: string query = string.format("select articlename tblarticles userid={0} order postdate desc", userid); i want not more 3 different values 'articlename'. possible that? (without select 'articlename' 3 of them?) thanks. typically can use limit 3 @ end of query achieve this string query = string.format( "select articlename tblarticleas userid={0} order postdate desc limit 3", userid ); or microsoft access db apparently need use top 3 @ start instead, eg: string query = string.format( "select top 3 articlename tblarticleas userid={0} order postdate desc", userid );

eclipse - How to add Javamail API source code in eclise project -

Image
what steps add source code of javamail api in project can see javamail classes clicking on class project. using eclipse welcome stack overflow. there 2 methods of doing this. method 1: 'easy' way. you use maven, if project maven project. include dependency javamail. right click on project , select maven > download sources should download source files dependencies. method 2: 'hard' way go link , download javamail 1.5 jar. , link download javamail 1.5 source jar. next step, right click on project, select properties . select java build path , click libraries tab , click add external jars . browse location of library , add it. expand javamail library. click source attachment , click edit button. browse location of source zip file , add it. you should able see source javadocs, control clicking on javamail class, should take source class well.

java - Cannot create two TextView in two lines -

Image
this rather layman question totally green in android development. recently trying implement simple calculator using android. i want make 2 rows of calculator display, top 1 showing equations user has input, , bottom 1 answer. here code in layout xml file: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" > <linearlayout android:id="@+id/linearlayout0" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_ali

c# - Understanding Stream.Write Method to overwrite existing text -

i used streamwriter write records file. want overwrite specific record. string file="c:\\......"; streamwriter sw = new streamwriter(new filestream(file, filemode.open, fileaccess.write)); sw.write(...); sw.close(); i read somewhere here can use stream.write method that, have no previous experience or knowledge of how deal bytes. public override void write( byte[] array, int offset, int count ) what have string how use method. need explain byte[] array , int count are, , simple sample code shows how use method overwrite existing record in file. ex. have record mark1287,11100,25| change bill9654,22100,30| . if want override particular record, must use filestream.seek -method set put stream in position. example seek using system; using system.io; class fstream { static void main() { const string filename = "test#@@#.dat"; // create random data write file. byte[] dataarray = new byte[100000]; new random().next

wpf - Selection Changed IsPostBack or refresh -

is there way selectionchangeevent refreshed after selecting item? i'm having trouble on windows phone application. here scenario, have 3 items in combo box, when select item navigate page. now, if select item 1 navigated item 1 page, if hit button, click item 1 again, not navigate anymore or event not fire. is there remedy please? have wasted 3days resolve this. in advance help. thanks.

java - how to solve error of aui radio button in jsp? -

hello using aui radio in jsp. when see output @ web browser, user can select radio button value. user should able select 1 radio button can select all. how solve it? kindly me. here jsp: <aui:input inlinelabel="right" name="veryhigh" type="radio" value="1" label="very high" /> <aui:input name="high" type="radio" label="higher" /> <aui:input name="neutral" type="radio" label="neutral" /> <aui:input name="low" type="radio" label="low" /> <aui:input name="verylow" type="radio" label="very low" /> what mistake have done? please tell me. if want select values radio group "name" attribute of radio type should same radio type in group. simple ex: <input type = "radio" name = "gender" value = "male"/> <input type = &qu

html - Hide subset of background-images until children() are fully loaded with Jquery -

i have articles, each of them containig list multiple list items. every list item has background-image defined. html looks this: <article> <ul> <li><!-- background-image--></li> <li><!-- background-image--></li> </ul> </article> i hide list items until every image loaded , im trying each article. my first attempt use 2 nested loops feels bit akward , complicated. function preloader() { $('article').each( function(i) { $(this).addclass('loading'); var childnum = $(this).find('ul li').size(); $(this).find('ul li').each( function(n) { var bgurl = $(this).css('background-image').replace(/url\(|\)|"|'/g,''); $('<img/>').attr('src', bgurl).load(function() { if (n == childnum) { // remove class .loading current article

python intersection initial state standard practice -

example: complete_dict = dict() common_set = set() count, group_name in enumerate(groups_dict): complete_dict[group_name] = dict() # grabs json file = group_name.json if count > 0: common_set.intersection_update(complete_dict[group_name]) else: # accounts fact common_set empty begin common_set.update(complete_dict[group_name]) where: dict2 contains k:v of members(of group): int(x) is there more appropriate way handle initial state of intersection? i.e. cannot intersect first complete_dict[group_name] common_set because empty , result therefore also empty. one way avoid special case initialize set contents of item. since value intersected value itself, won't lose way. here's attempt show how work. i'm not i've understood different dict(...) calls supposed represent, may not translate code, should on right path. it = iter(dict(...)) # dict(...) statement first_key = next(it) results[first_key] = dict(.

CSS Active menu -

what best way add active class on css menu? .vertical-nav{ width:200px; height:auto; list-style:none; float:left; margin-right:40px; } .vertical-nav li{ width:200px; height:25px; margin:5px; padding:5px; background-color:#666666; border:none; text-align:center; float:left; } .vertical-nav li:hover{ background-color:#f36f25; color:#ffffff; } .vertical-nav li a{ font-family:calibri, arial; font-size:18px; font-weight:bold; color:#ffffff; text-decoration:none; } i add on .vertical-nav li:active { } way can modify both <li> , <a> properties

mysql - Laravel 3: Joining and getting sum of two tables, Is there a better way? -

i'm trying columns of table while getting sum of related table (i'm using mysql database). tables advantages , conversions, advantages has conversionid column join. related via models. first tried achieve eloquent method, not succeed, came fluent method, working fine: db::table('conversions') ->join('advantages','advantages.conversionid','=','conversions.id') ->where('conversions.used','=',0) ->group_by('conversions.id') ->get(array( 'conversions.*', db::raw('sum(advantages.point) totaladvantage') )) i guess query describes how columns , want achieve. so question is: there more efficient way achieve this? using db::raw seemed weird me, , sum() method returns sum of columns. place wrote both fluent , raw query in project, made me think if i'm missing something. thanks in advance you can call aggregate methods through fluent

javascript - Issue using remote method in jquery validation -

i'm following this article in order validate form my problem when have use remote method, e.g. remote: "check-username.php" since documentation remote method not clear me, know: how need structure json output in php script? you don't need json. can put text. example can echo "success"; for passed validation, , enter validation message like: echo "username exists."; for failed validation. in callback this: remote: { url: "check-username.php" , type: "post" , data: { username: function() { return $("#username").val(); }, complete: function(data){ if( data.responsetext != "success" ) { alert(data.responsetext); //handle failed validation } } }

jquery code changes CSS but I want to fire a function instead -

i've got line of code waits #total increase 1 , changes css when happens. $('#total_shares').html(parsefloat($('#total').html())+1).css({ //changes css of #total }); i'd know - if want retain same code instead of .css(); fire function instead have many more options rather changing css alone. possible? thanks! sure, use .each() , this: $('#total_shares').html(parsefloat($('#total').html())+1).each(function() { $(this).css({left: 50});//example css change //changes css of #total });

casting type in methods in java -

what wrong piece of code? consider building arraylist containing buildings , building superclass farm , stonemine: public building returnbuilding(int i) { if(buildings.get(i) instanceof farm) return (farm)buildings.get(i); if(buildings.get(i) instanceof stonemine) return (stonemine)buildings.get(i); else return null; } then if call returnbuilding(1).somemethodejustinfarmclass(); which building.get(1) instance of farm class, run time error returnbuilding returns building , not farm . casting game.buildings.get(i) before returning not change that. if runtime class of game.buildings.get(i) farm , cast return value of returnbuilding farm before calling somemethodejustinfarmclass method.

c# - How do I turn an Animal instance into a Dog instance? -

say have following classes: class animal { public long id { get; set; } public string name { get; set; } } class dog:animal { public void sniffbum() { console.writeline("sniff sniff sniff"); } } if have instance of animal , how cast dog ? this: animal = new animal(); if ( logic determine animal dog ) { dog d = (dog)a; d.sniffbum(); } essentially can't use interfaces. have animal object coming out of database that. dog doesn't have more parameters animal has, new methods. i create new dog object, , pass values across, (or have constructor takes type animal ), seems messy. casting checks not work if animal instance has never been dog instance. you may want @ decorator pattern , allow add dog methods animal instance. essentially, dog , animal both have ianimal interface. dog class takes animal instance in constructor , keeps internal reference. dog 's ianimal implementation defers animal in

javascript - How to bring circlemarker on front in leaflet -

i have 2 circlemarkers , , b, @ same place demo i'd marker b move front when select marker a, , vice versa. use methods bringtofront() , bringtoback() , noted here in leaflet api: http://leafletjs.com/reference.html#path

java - is there any possibility to maintain 5 latest versions of major file in MySql Db? -

subject::::is there possibility maintain 5 latest versions of major file in mysql db? according proj req't need maintain latest 5 versions of file in mysql db, if version count reached 6 i've delete first version of file automatically.. is there path achieve requirement if plz me .thanks in advance assuming store file in data column, can add versions_back column, , use in update , delete statements, this: table structure: id versions_back data <other columns> -- ------------- ---- --------------- 10 0 .... .... 12 1 .... .... 13 2 .... .... 15 3 .... .... 17 4 .... .... performing insertion: update versioned_file set versions_back=versions_back+1 insert versioned_file(data, versions_back) values (<file-data>, 0) delete versioned_file versions_back >= 5

node.js - How to get the key from value in key/value pair in redis store client? -

i storing username/socketid pairs in redis store socket.io chat application. when user disconnects need remove username/socketid pair redis store. have seen how value key never key value. possible? or either way how can delete key/value pair value. here's code for adding store on connect socket.on('username', function (username) { client.set(username, socket.id, function (err) { console.log(username + ":" + socket.id); }); }); for disconnect, client wont know when disconnect happen, might happen due loss of internet connectivity when socket disconnects hits "disconnect" event. in event need delete username/socketid pair. socket.on('disconnect', function () { // dont know username?? client.del(username, socket.id, function (err) { if (err) console.log(err); else { socket.disconnect(); console.log(socket.id + " disconnected"); } }); });

visual studio 2010 - Match two whole words in Regex -

i struggling find solution matching 2 successive whole words using regular expression. have text box user can type in search criteria, enclosed quotations exact matches. quotes , space (if any) replaced regex expressions. here example: user enters: "apple orange" converted to: \bapple\w+(?:\w+\w+){1,6}?orange\b then, regex match based on converted criteria. instructions www.regular-expressions.info/near.html maybe going entirely wrong way? using visual studio. appreciated. if want exact match when user uses quotes, should remove quotes , straight string comparison (equality, not contains) update: based on comments below, same thing single word match: single word: \bapple\b double word \bapple orange\b the idea user enters in search term , match that, wouldn't doing pattern matching term itself, boundaries of (the \b wrapped around it). there's no reason touch search term (all stuff in-between apple , orange trying do) because spa

winapi - mciSendString with Visual C++ - Parameters? -

i not native c++ programmer, need following: i got code working: #pragma comment(lib, "winmm.lib") lpcwstr opencdcommand = l"set cdaudio door open"; //comes windows.h, needs winmm.lib see header includes int errcode = mcisendstring(opencdcommand, 0, 0, 0); questions: do need work lpcwstr? why didn't find system::string example? how should handle 'string concatination'? cant l"foo"+l"baar"? am on totally wrong way play sounds mcisendstring? (actually want use mci command , mci sendstring did in other projects before) is there way include external function mcisendstring can handle handles? the signature of mcisendstring is mcierror mcisendstring( lpctstr lpszcommand, lptstr lpszreturnstring, uint cchreturn, handle hwndcallback); so, regarding first 2 parameters, in unicode wchar pointer , in multibyte char pointer. it's signature. cannot change , shouldn't worry that. std::wstring some

html5 - Jquery to run mp4 files in firefox,IE and chrome -

hi trying play mp4 file in ie,chrome , firefox. works fine in ie , chrome not in firefox. know firefox doesnt support mp4. requirement playing mp4 only. can share me jquery make possible. in advance. for firefox can tell not possible without plugins flash. about chrome afik subset of mp4 supported, need check use right colorspace. the ie9+ has afik native support, there can in include video simple video html5 tag. you can use jw-player combinds both worlds: html5 , flash.

java - Strange issue with populating LinkedHashSet -

given below code, there reason when final if-else statement steps else clause, if un-comment 2 lines of code , comment "foozanazabar" , "testcairo" lines, not add lines linkedhashset? appears add values.add(new bigdecimal(peunit).multiply(new bigdecimal(1000)).tostring()); correctly when logic drops else clause, not add bd.zero or pefamt field despite fact strings. as note, 0 , pefamt bigdecimal's converted string. these 2 values giving me grief. direction appreciated. public static linkedhashmap<string, linkedhashset<string>> converttransactiontabledata(resultset rs) { linkedhashmap<string, linkedhashset<string>> returnablemap = new linkedhashmap<string, linkedhashset<string>> (); try { while (rs.next()){ string pefamt, pepoln, mcisst, pebrcd, peeffy, peplan; string peunit, petrnc, peco, peityp, zero; pepoln = rs.getstring("pepoln"); mc

c# - "ReorderListBoxItem must have a DragHandle ContentPresenter part." issue -

we working on windows phone 8 app , try use reorder list box control . previous version of our app it's working. now, when bind collection reorder list box, i've got exception "system.invalidoperationexception" in details, see message. system.invalidoperationexception: reorderlistboxitem must have draghandlecontentpresenter part. @ reorderlistboxdemo.reorderlistboxitem.onapplytemplate()} if see such problem or know - please help. use mvvm light , bind data through viewmodel. raw binding not working @ all. sorry russian english. :) the control requires setter property="draghandletemplate". copy base itemcontainerstyle codeplex page of control , extend required: <rlb:reorderlistbox.itemcontainerstyle> <style targettype="rlb:reorderlistboxitem"> <setter property="draghandletemplate"> <setter.value> <datatemplate>

maven 2 - DataNucleus: There is no available StoreManager of type "" -

i'm working datanucleus+maven. below commands results : mvn compile : build successful mvn clean install : build successful mvn -e datanucleus:enhance : build successful however, on mvn -e datanucleus:schema-create : severe: error creating nucleuscontext there no available storemanager of type "". make sure have put relevant datanucleus store plugin in classpath , if defining connection via jndi or datasource need provide persistence property "datanucleus.storemanagertype" org.datanucleus.exceptions.nucleususerexception: there no available storemanager of type "". make sure have put relevant datanucleus store plugin in classpath , if defining connection via jndi or datasource need provide persistence property "datanucleus.storemanagertype" @ org.datanucleus.nucleuscontext.createstoremanagerforproperties(nucleuscontext.java:1157) @ org.datanucleus.nucleuscontext.initialise(nucleuscontext.java:359) @ org.datanucleus.store.sche

android:video is not playing -

i trying run video stored in assets/pages/id(id may rice or sugar or meat ect)/id.mp4 . in app if touch on video of item ( rice or sugar or meat ) play respective mp4 video. video not playing properly. trying find out fail. below code package com.app.teachmesushi; import java.io.file; import java.io.fileoutputstream; import java.io.inputstream; import java.util.hashmap; import java.util.map; import android.app.activity; import android.app.progressdialog; import android.content.componentname; import android.content.context; import android.content.intent; import android.content.serviceconnection; import android.content.res.assetmanager; import android.graphics.pixelformat; import android.media.mediaplayer; import android.media.mediaplayer.onpreparedlistener; import android.os.asynctask; import android.os.bundle; import android.os.environment; import android.os.handler; import android.os.ibinder; import android.os.message; import android.os.messenger; import android.os.remotee

Automatically resize images with browser size using CSS -

i want (or some) of images getting resized automatically when resize browser window. i've found following code - doesn't though. html <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> </head> <body> <div id="icons"> <div id="contact"> <img src="img/icon_contact.png" alt="" /> </div> <img src="img/icon_links.png" alt="" /> </div> </body> </html> css body { font-family: arial; font-size: 11px; color: #ffffff; background: #202020 url(../../img/body_back.jpg

javascript - How to hide the class with values less than 1.6 -

i have code hides rows values 1.6. $('.ind').filter(function() { return $(this).text().indexof("1.6") !== -1; }).parent().hide(); i interested in code hides values less 1.6. please see link . you need parse value compare number: $('.ind').filter(function() { return parsefloat($(this).text()) < 1.6; }).parent().hide(); the code in question looks value 1.6 inside string, leads me think there may other text number in cell. if so, need remove before parsing: $('.ind').filter(function() { return parsefloat($(this).text().replace(/[^\d\.]+/g, '')) < 1.6; }).parent().hide(); to check range, put parsed value in variable, compare lower , upper limit , return result: $('.ind').filter(function() { var value = parsefloat($(this).text()); return value >= 1.6 && value < 1.7; }).parent().hide();

canvas - Delphi How to draw 2d array of TColor on TCanvas quickly? -

i have 2-dimensional array of tcolor. , have tcanvas. how can draw color map on canvas faster for cycle? for example: type t2dar = array of array of tcolor; var ar: t2dar; form1: tform; // mainform function main; var x, y: integer; begin {filling array colors 10x10} x := 0 length(ar)-1 y := 0 length(ar[x])-1 form1.canvas.pixels[x, y] := ar[x, y]; end; this way works slowly. need faster algorithm. this has been answered many times. answer is: use scanline s instead of terribly slow pixels property. example: function createbitmapreallyfast: tbitmap; const white: trgbtriple = (rgbtblue: 255; rgbtgreen: 255; rgbtred: 255); black: trgbtriple = (rgbtblue: 0; rgbtgreen: 0; rgbtred: 0); var y: integer; scanline: prgbtriple; x: integer; begin result := tbitmap.create; result.setsize(1920, 1080); result.pixelformat := pf24bit; y := 0 result.height - 1 begin scanline := result.scanline[y]; x := 0 result.width - 1 begin if odd(x

asp.net mvc 4 - npgsql schema "dbo" does not exist -

i have problem similar entity framework 5.0 postgresql (npgsql) default connection factory i have npgsql declared in app.config : <connectionstrings> <add name="mondbcontexte" connectionstring="server=127.0.0.1;port=5432;database=ma_datab_db;user id=postgres;password=root;" providername="npgsql" /> </connectionstrings> <!-- le factory provider --> <system.data> <dbproviderfactories> <add name="npgsql data provider" invariant="npgsql" support="ff" description=".net framework data provider postgresql server" type="npgsql.npgsqlfactory, npgsql" /> </dbproviderfactories> </system.data> </configuration> my context provider class: public class contextdb: dbcontext { public dbset<personne> personnes { get; set; } public contextdb()