Posts

Showing posts from July, 2014

java - Error in import import net.proteanit.sql.DbUtils package in netbean ID 7.0RC2 -

Image
i don't know solve problem need add external jar please mention name of jar use package. you need jar file rs2xml.jar resolve problem.

c# 4.0 - Impromptu: Could not load type because it attempts to implement a class as an interface -

i have started using impromptu after recommendation on stack. i believe have implemented correctly getting error "could not load type because attempts implement class interface" in portable class library have following model: public class route { public user user { get; set; } } public class user { public name name { get; set; } } public class name { public string title { get; set; } public string firstname { get; set; } public string middlename { get; set; } public string lastname { get; set; } } and have created following iclasses in mvc project: public class iroute { public iuser user { get; set; } } public class iuser { public iname name { get; set; } } public class iname { [required] public string firstname { get; set; } [required] public string lastname { get; set; } } and in controller have following being sent view: route sendthis = new route(); return view(sendthis.actlike<iroute>()); but ...

Mysql - Find duplicates records evaluating 2 columns -

i have mysql table structure this: order_id - customer_name - customer_email_address i need query search records have same customer_name or same customer_email , show result ordered order_id groups (descending order). example: mysql table order_id customer_name customer_email_address 1 pippo pippo@pippo.com 2 pippo pippo2@pippo2.com 3 pluto pluto@pluto.com 4 caio pippo@pippo.com 5 pippo4 pippo4@pippo4.com 6 pluto pluto22@pluto22.com result 6 pluto pluto22@pluto22.com 3 pluto pluto@pluto.com 4 caio pippo@pippo.com 1 pippo pippo@pippo.com 2 pippo pippo2@pippo2.com result 6 , 3 share same customer_name result 4 , 1 share same customer_email_address result 1 , 2 share same customer_name order_id 5 not in results because has no dupl...

android - Disabling GridView scrolling -

i have gridview of more 10 rows. reference chart user unable scroll manually. gridview should scroll down in particular time period. have that? possible make gridview smoothscroll? 1 more question have that. how can access gridview adapter class.? i have solved disabling of gridview scroll by gridview.setontouchlistener(new ontouchlistener(){ @override public boolean ontouch(view v, motionevent event) { if(event.getaction()==motionevent.action_move){ return true; } return false; } });

ruby on rails - Facebook API Publish feeds in Group -

Image
i posting feeds on pages thru facebook api published normally. posts appears on fans feeds, (may irritate them if these in numbers, can understand) i want post these feeds in group like i using koala gem posting feeds using https://graph.facebook.com/[user_id]/feed?message="" rails code graph = koala::facebook::api.new(page[:token]) result = graph.put_object("me","feed",facebook_attributes(feedback)) you cannot because posts grouped facebook algorithms.

html - Problems with JavaScript Dropdown Nav -

i using javascript drop down navigation menu found after googling , i've managed style way want. however, after validating site, errors ul tags (error: element ul not allowed child of element ul in context. (suppressing further errors subtree.)). not error, navigation doesn't work way should. i've tried different variations of ul , li tags, , moved things around, , still cannot work correctly. <div class="nav"> <ul id="menu" class="menu"> <li><a href="#">one</a> <ul> <li class="submenu"> <a href="#">one</a> <ul> <li><a href="#">one</a></li> <li><a href="#">two</a></li> <li><a href="#">three</a></li> </ul> </li> <li class="submenu"> ...

wso2 - wso2esb - aggregate mediator is not being detected -

i using wso2 4.0.3 on mac osx 10.6 have data services server feature enabled(3.2.2 working in wso2esb 4.0.3 on aggregate mediator. below code, iterate mediator worked perfectly, aggregate mediator not seem recognized, log in not getting printed .the response endpoint getting printed in log level=full of outsequence, flow not getting continued in aggregate. could wso2team please confirm whether aggregate behaves expected in wso2 esb 4.0.3? <?xml version="1.0" encoding="utf-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="test" transports="http https" startonload="true" trace="disable" statistics="enable"> <target> <insequence > <log level="full" separator=","> <property name="insequence-entrymessage" value="test - entering insequence."/> </log> <iterate preservepay...

Java sticky instances of class com.mysql.jdbc.Field aggregating -

i noticed (via jmap+jhat) app leaking storing many instances com.mysql.jdbc.field  class - double checked code make sure closing preparedstatements, find few missing didn't change outcome. - preparedstatement created , closed right away - several others created @ start , reused many times - using org.apache.tomcat.jdbc.pool.datasource connection pool what can cause type of behavior? are closing of preparedstatements / result sets using: preparedstatement stmt (possible assignment here); try { // work prepared statement resultset rs; try { while (rs.next()) ... // process results } { rs.close(); } } { stmt.close(); } so guarantee result sets closed when finished (regardless of exceptions) , statements closed (regardless of exceptions)? there other ways write that, idea same. if you're doing of properly, unless have many references it's taking inordinate amount of memory, it's ok , nothing needs done it.

html - IE Conditional operator: OR ... if is greater than ie9 or not IE -

i want include history , ajaxify if browser ie9 or greater, or is not ie: <!--[if gte ie 9]> <script type="text/javascript" src="assets/js/plugins/history.js"></script> <script type="text/javascript" src="assets/js/plugins/ajaxify.js"></script> <![endif]--> how can use or operator this: <!--[if gte ie 9 | !ie ]> ?? thanks! this worked: <!--[if gte ie 9 | !ie ]><!--> <script type="text/javascript" src="assets/js/plugins/history.js"></script> <script type="text/javascript" src="assets/js/plugins/ajaxify.js"></script> <![endif]-->

iphone - Twitter API: How would I pull latest statuses from user_timeline with API 1.1 -

i'm trying basic, want call twitter api iphone app in order receive public data such public timeline of user. i read 2 hours twitter developer doc , still don't understand how should implement this... i don't want users connect or authenticate via twitter. read option use "application-only authentication" - have opened application under account , have api key , secret. please give me example on how use twitter api within iphone app. p.s. can see api calls available via "application-only authentication" ? using bearer token app-only authentication right thing do. you find example sttwitter library in following answer: twitter oauth , accesstoken statuses/user_timeline in objective-c to know calls available app-only authentication, check "resource information > authentication" on right of each api resource documentation https://dev.twitter.com/docs/api/1.1 generally speaking, endpoints don't require user context ...

regex - Java regular expression bug -

i have following regular expression: ^(min|max|sum|average):[(\\d+(\\.\\d+)?), ]+$ the rule attempting implement should allow strings of following format: operation: (comma separated list of integers or real numbers) for example following must allowed: min: 7, 89.7, 67 average: 67.9, 89, 9 however, accepts input of form max: , how can avoid having blank spaces on either side of comma accepted? try "^(min|max|sum|average)\\s?:\\s?(\\d+(\\.\\d+)?)(,\\s?\\d+(\\.\\d+)?)*$" tests: min:4: true min:4,4: true min:4, 5: true min:4 , 5: false min: 7, 89.7, 67: true average: 67.9, 89, 9: true max: , : false

javascript - Convert regular json to flare.json for d3.js? -

i have json so: { "a": { "x": { "y": { "a": {}, "z": {}, "b": {} } }, "c": {}, "b": { "c": { "d": {} } }, "d": {}, ... } } is there quick way convert flare.json format? like so: { "name":"a", "children":[ { "name":"x", "children": { "name":"y", "children":[{"name":"a", "size":0},{"name":"z","size":0},{"name":"b","size":0}] ... } thank you. i have come series of regex transforms this. #replace-this #with-this ^\s*" \{"name":" : \{\}, \}, : \{\} ...

sql - Error 6624 : A Winsock virtual circuit was reset remotely -

we installed new advantage server 11.1 on linux (before used on netware) when run query space command sql openquery, got error: error 6624: winsock virtual circuit reset remotely. and linux service crashes, must restart it. if run same query old server, works fine. example of query error: select * table1 t t.key = space(2) + '776782' why space command crash linux service ?

javascript - Checking if Java Platform SE is enabled on Firefox -

i want run applet on client system before want check if java plugins installed , enabled there 2 java plugin in firefox. java deployment kit java platform se i want check enable/disable status of java platform se plugin in firefox. i able check java deployment kit enable/disable status using following javascript code <script type="text/javascript" src="http://java.com/js/deployjava.js"></script> <script type="text/javascript" > function checkjavaplugin() { if(deployjava.isplugininstalled()==true) { alert('java plugin installed'); } } </script> from have searched, seems such thing not exist. :o

xcode - Saving data to an existing plist -

i working on project has simple tableview detail view. data source plist . trying allow user input saved plist , shown in tableview. have created add view controller gets presented , dismissed modally , has 2 text fields allow user add name of city , name of states, text field input description. problem: how save data existing plist , show in tableview . here code table view: @implementation tableviewcontroller @synthesize content, searchresults; - (id)initwithstyle:(uitableviewstyle)style { self = [super initwithstyle:style]; if (self) { // custom initialization } return self; } - (void)viewdidload { [super viewdidload]; content = [[nsarray alloc] initwithcontentsoffile:[[nsbundle mainbundle] pathforresource:@"data" oftype:@"plist"]]; } - (ibaction)add; { addviewcontroller* controller = [[addviewcontroller alloc] init]; [self presentviewcontroller:controller animated:yes completion:nil]; } - (void)didreceivememorywarning { [super didreceivemem...

java - GWT: Native method using JSNI: how to call methods dynamically -

i using gwt , have created native method calls method cmd_addspace in class everlinkedactions , works fine now: private static native string execute(string functionname, object[] vparams)/*-{ try{ @es.gwt.client.dash.actions.impl.everlinkedactions::cmd_addspace([ljava/lang/object;)(vparams); }catch(e){ alert(e.message); } }-*/; how can make method name dynamic? means instead of "cmd_addspace" want call method "functionname" name passed argument in native method. and way make class name dynamic? want have that: private static native string execute(string classname, string functionname, object[] vparams)/*-{ try{ @es.gwt.client.dash.actions.impl.classname::functionname([ljava/lang/object;)(vparams); }catch(e){ alert(e.message); } }-*/; thanks help not sure you're trying achieve here i'm afraid jsni doesn't work that. code such @es.gwt.client.dash.action...

c++ - Seg fault with getline function() Multi 5 compiler -

iam using multi 5 compiler , getting error tried access restricted memory getline function. please suggest issue. anyfunction (std::string filepath) { std:string linear = ""; ifstream in; in.open(filepath); if(in.is_open()) { while (getline(in,linear)) // <- error here seg fault { do_someting(); } } in.close } int main() { std::string filepath = "\hello\asd.xml"; anotherfunction(filepath); anyfunction(filepath); //working of both function similar or both use getline }

php - Compare arrays and search for matching values -

i have 2 arrays, $arr1 , $arr2 : $arr1 list of columns expect read excel file, $arr2 array of columns found. sometimes uploaded file contains misspelled column names columns in different order could missing columns also, column names might contain letters in different charset (ex. greek 'm' looks latin m cannot accounted same). lets say, example, have following 2 arrays: $arr1 = array('action', 'lotsize', 'quantityminimum', 'suppliername', 'spn', 'partnumext', 'uom', 'listprice', 'mpn', 'mfrname', 'catlevel1', 'catlevel2', 'catlevel3', 'catlevel4', 'catlevel5', 'catlevel6', 'acctlevel1', 'acctlevel2', 'acctlevel3', 'acctlevel4', 'acctlevel5', 'acctlevel6', 'desc1', 'desc2', 'picname', 'supplierurl', 'catpart','techspec', 'kad...

Add several subdocument in mongodb -

i have following strucure: { 'name':'something', 'commens':{ 'value':'something' }, { 'value':'something else' } } my question is, how can insert/update subdocuments? if using mongodb console, have use $ positional operator update embedded documents. db.yourcollection.update({ "_id" : objectid("4a33289ae89489"), "commens._id" : objectid("32321eae20fc603aee49124") }, { "$set" : { "commens.$.value" : "something else" } })

database - Can I create multiple associations between two entities in Entity Framework 5, c#? -

e.g. have 2 entities: public class department { public guid id { get; set; } public string name { get; set; } public icollection<employee> employees { get; set; } public employee manager { get; set; } } public class employee { public guid id { get; set; } public string fullname { get; set; } [foreignkey("departmentid")] public department department { get; set; } public guid departmentid { get; set; } public string position { get; set; } } i know can associate (as did:) department.employees employee.id (and inverse: employee.department department.id ). questions: 1) 1 or 2 associations? 2) can create second association between department.manager , employee.id ? don' want store managers in table stored in employee table , have in position field "manager". define relationship follows. protected override void onmodelcreating(dbmodelbuilder modelbuilder) { modelbuilder.entity<depar...

android - The difference of using MotionEvent.getAction() method -

what difference between 2 approaches below? int action1 = event.getaction() & motionevent.action_mask; int action2 = event.getaction(); the action_mask used separate actual action , pointer identifier (e.g. first finger touched, second finger touched, etc.) first 8 bits of value returned in getaction() actual action part, , when bitwise-and action mask (= 11111111 = 255 = 0xff), left action , none of pointer information. keep in mind here & used arithmetic operator (bitwise) , not logical operator (single & valid logical operator in java, && ).`

cordova - Upload a blob with Phonegap FileTransfer - and receive binary -

i want upload binary data (e.g. image, or zip) server using phonegap, , receive binary response. possible? while upload works filetransfer , file stored on disk, cant work blob var blob = new blob([something], {type: 'application/zip'}); var bloburl = window.url.createobjecturl(blob); var ft = new filetransfer(); ft.upload(bloburl, encodeuri('http://server'), win, fail, options); the bloburl of course like blob:1234-... which filetransfer not find. tried save blob first, passing path filetransfer - phonegaps filewriter cannot process blob . using xhr not option cannot receive binary files in phonegap (wp8). mimetypeoverride trick not work in case internet explorers xhr not have option. i working windows phone 8. you can't send binary data through phonegap file transfer. your binary data must converted base64 string , transferred server. same thing goes other way. here's tutorial how handle binary data transfer phonegap: http://...

javascript - Remove part of a string before a certain position -

i have string want cut , remove first part. something 'abcded-cddndcasds--xyz--jkajsjasasasasas' i want remove before position x. so far can find position of x, can't find quick function remove before. thanks try this $(function(){ var str = 'abcded-cddndcasds--xyz--jkajsjasasasasas'; var indexofx = str.indexof("x"); alert(str.substring(indexofx,str.length)); }); demo

How do I determine what line of my javascript is causing this error in IE, when the console reports the bug is in jquery -

i have complex web application working in modern web browsers , ie10. i'm testing in older versions of ie7 , running bug stops page loading. error can see on screen is: script5022: syntax error, unrecognized expression: jquery.min.js, line 3 character 14659 which points to: {throw new error("syntax error, unrecognized expression: "+a)} i have no idea part of javascript triggering this. code base huge don't know begin. there tricks or standard methods me? no errors or problems reported in chrome, firefox, safari (latest versions) or ie10. using ie10 in ie 7 mode... problem persist in ie 7 ran in virtual machine. thanks. edit: running jquery 1.7 source: http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js if codebase big step through until find jquery-operation leads error, try searching jquery-selectors tab -character. i had same problem (in ie7 only) when using jquery 1.7.1. found selector contained tab -character (in middle...

ios6 - Get addressbook all phone labels list -

Image
i need addressbook phone labels. i mean, not phone labels existing contacts, phone labels list(when touch phone label in contacts app there list of labels). is possible? you can create own labels on demand individual abperson records. there no central place ios keeps list of standard labels. here's list of ios constants (i might have missed some) mapped strings via abaddressbookcopylocalizedlabel : kabpersonphonemobilelabel kabpersonphoneiphonelabel kabpersonphonemainlabel kabpersonphonehomefaxlabel kabpersonphoneworkfaxlabel kabpersonphonepagerlabel kabworklabel kabhomelabel kabotherlabel any label add not localized ios, appear verbatim regardless of locale setting.

c# - How to read parts of an RTF file and keep formatting -

i asked create control reads in rtf file , display file in parts. problem running font styling seems stored @ higher level snippets pulling out. there way read snippets 1 file , keep formatting? using richtextbox in wpf. this not perfect solution, works specific scenario. posting in case helps others later, still looking better solution. below work, has 2 pre-requisites: my delimiter has @ beginning , end of text my delimiter has different font or style has own distinct markup surrounding text code: private static ienumerable<string> getlistfromdelimitedtext(string text) { var textsplit = text.split(new[] { "~~~~~~~~" }, stringsplitoptions.none); var header = getheaderofrtf(textsplit); var footer = getfooterofrtf(textsplit); var listwithoutheaderandfooter = textsplit.where((text, index) => index > 0 && index < textsplit.length - 1); return getsnippetswithheaderandfooter(listwithoutheaderandfooter, header, footer); } ...

javascript - Video stream through Websocket to <video> tag -

i use node.js stream via websocket realtime webm video webpage play in tag. following code both server , client: server: var io = require('./libs/socket.io').listen(8080, {log:false}); var fs = require('fs'); io.sockets.on('connection', function (socket) { console.log('sono entrato in connection'); var readstream = fs.createreadstream("video.webm"); socket.on('video_stream_req', function (req) { console.log(req); readstream.addlistener('data', function(data) { socket.emit('vs',data); }); }); }); client: <html> <body> <video id="v" autoplay> </video> <script src='https://localhost/socket.io/socket.io.js'></script> <script> window.url = window.url || window.webkiturl; window.mediasource = window.mediasource || window.webkitmediasource; if(!!! window.mediasource) { alert('mediasource api not available!'); ...

Asp.net mvc is loosely coupled and full control over html -

in mvc, how can loosely couple , full control on html, can body explain me, reference , searched in google not clear me. loosely couple asp.net mvc works abstractions on standard httpcontext classes such httpcontextbase, httprequestbase, httpresponsebase, httpsessionbase allows easier unit testing in isolation because classes abstract , can mocked. in classic asp.net webforms harder unit test code because relies on real asp.net context classes close impossible mock require real context in order work. imho 1 of best things asp.net mvc compared classic webforms. also have clearer separation between various aspects: model logic, view logic , controller logic. doesn't mean in classic webforms cannot achieve separation. it's bit harder if follow standard approach put in view , code behind. full control on html contrary classic asp.net webforms place usercontrol in webform generates html @ runtime (with far or less control on generated html), in asp.net mvc v...

objective c - iOS: Retrieve Game Center friends who are online -

i can retrieve game center friends code... gklocalplayer *lp = [gklocalplayer localplayer]; if (lp.authenticated) { [lp loadfriendswithcompletionhandler:^(nsarray *friends, nserror *error) { nslog(@"my friends: %@",friends); if (friends != nil) { [gkplayer loadplayersforidentifiers:friends withcompletionhandler:^(nsarray *players, nserror *error) { if (error != nil) { // handle error. nslog(@"playerlist error: %@",[error localizeddescription]); } if (players != nil) { // process array of gkplayer objects. nslog(@"players: %@",players); } }]; } }]; } ... however, there way r...

php - Storing User Navigation History in a Cookie/Session -

i'm playing php , looking achieve following (i know possible third party plug-ins, want build on own practice): store history of urls user visits within (joomla driven) site in cookie. send array of values (other user information including url history) source (file or database) when user logs out. have not tackled item 2 yet, answer or pointer appreciated. the php code i've created far: $user = jfactory::getuser(); $helper = juserhelper::getusergroups($user->id); if(!isset($_cookie['pagehistory'])){ setcookie('pagehistory',$_server['request_uri'].'|'); } else { $_cookie['pagehistory'] .= $_server['request_uri'].'|'; } // debug: destroy cookie //setcookie ("pagehistory", "", time() - 3600); $group = ""; foreach ($helper $value) { $group .= $value."|"; } $userinfo = array( 'id' => $user->id, 'username' => $user->use...

jquery animate accelerates in firefox -

it's first question. don't understand why te background animation of site www.enjoyriberadelduero.com acelerates in firefox. i've seen other questions, not seem have been resolved. script its: <script type="text/javascript"> jquery(document).ready(function($) { setinterval(function(){ $('#full-bg img.active').animate({opacity:0},640, function(){ $(this).removeclass('active'); }) if($('#full-bg img.active').next().length>0) $('#full-bg img.active').next().animate({opacity:1},640).addclass('active'); else $('#full-bg img:first').animate({opacity:1},640).addclass('active');`enter code here` } ,6400); //duración total del script. $('#full-bg img:first').animate({opacity:1},500).addclass('active'); }); </script> really thank you, , apologies english. edit----> think it's fixed...

ruby - Rails - Where (directories) to put Models that are not Active Record -

we building out apps have models not database components. curious learn others doing in rails community address subject. we struggling put them. should have: app/models/domain or app/domain/models or perhaps app/models # business models app/models/ar # active record models or perhaps app/models/domain/ # business models app/models/domain/ar # active record models part of struggling how close to rails standards , how create structure need. if think of objects service objects, have app/models/service-object and app/models/ # plain active record another route go down not have stuff within app, e.g. /service_objects instead of /app/models/service_objects presumably if want access via rails app we're better of using app/ in order take advantage of convention on configuration. in experience, division of put these models comes down functionally represent in specific context of application. i reserve app/models resource based models...

Spring validation can't find message -

i have problem validation in springmvc, can't find error messages... have error says: no message found under code 'empty' locale 'en_gb'. if configured in messages.properties . i have configured in spring context servlet: <beans:bean id="messagesource" class="org.springframework.context.support.reloadableresourcebundlemessagesource"> <beans:property name="basename"> <beans:value>web-inf/classes/messages</beans:value> </beans:property> </beans:bean> in project file under src/main/resources/messages.properties , , is: empty.user.password=il campo password non può essere lasciato vuoto empty.user.username=il campo username non può essere lasciato vuoto unique.user.username=l''username {0} è già usato empty=il campo non può essere vuoto then have validator: @override public void validate(object target, errors errors) { final user user = (user) targ...

How to get latest tweet id, using python-twitter search API -

i'm trying find way not same tweets using search api. that's i'm doing: make request twitter store tweets make request twitter store tweets, compare results 2 , 4 ideally in step 5 0, meaning no overlapping tweets received. i'm not asking twitter server same information more once. but think got stuck in step 3, have make call. i'm trying use 'since_id' argument tweets after points. i'm not sure if value i'm using correct. code: import twitter class test(): def __init__(self): self.t_auth() self.hashtag = ['justinbieber'] self.tweets_1 = [] self.ids_1 = [] self.created_at_1 = [] self.tweet_text_1 = [] self.last_id_1 = '' self.page_1 = 1 self.tweets_2 = [] self.ids_2 = [] self.created_at_2 = [] self.tweet_text_2 = [] self.last_id_2 = '' self.page_2 = 1 in range(1,16): ...

ios - Iphone webApp Barcode Scanner -

i have seen multiple examples of below: http://ilevelupapps.com/scanner-go http://www.pic2shop.com/developers.html i'm wondering if there way or if possible in case have webapp on ios device displaying in full screen call barcode scanning tool in middle of flow of app , return result current app page, thoughts once scanner called webapp replaced scanner , returned url open instance of webapp in browser non fullscreen returned url, impossible take w/o going native?, thoughts please. noob thinking along lines of calling method in html url schema , getting result?, im doubtful. thanks!.

javascript - create a new text field when click on previous text field -

i want create new text field while clicking on created text field. have written function working problem is, should create new text field when clicking on last one, example if there 3 text fields , clicking on first 2 not add new text field. clicking on third text field can create new. following code not working (its java script function): var fieldcount=1; function addinputfield(count) //on add input button click { alert(fieldcount); alert(count); if(fieldcount == count) { fieldcount++; var field = "#textfield_"+count; $node = '<input id="textfield_'+fieldcount+'" type="text" name="textfield" onclick="addinputfield(fieldcount);" />'; $(field).after($node); } }; there 1 text field in begging when page loads is: <input id="textfield_1" type="text" name=...

css - Same Fontface for Multiple Styles -

so have base.css file in static folder, accompanied 2 font files, fontin_sans_r_45b.otf , fontin_sans_sc_45b.otf , regular , small-caps styles, respectively. want define fontfaces both styles, i've done following: @font-face { font-family:'fontinsans'; src:url('fontin_sans_r_45b.otf'); font-weight:normal; font-style:normal; } @font-face { font-family:'fontinsans'; src:url('fontin_sans_sc_45b.otf'); font-weight:normal; font-style:small-caps; } i have triple checked file names , locations. yet when try load page, error small-caps font in firefox: [12:17:27.211] downloadable font: download failed (font-family: "fontinsans" style:normal weight:normal stretch:normal src index:0): status=2147500037 source: file:///users/user/documents/djangoprojects/blogengineenv/blogengine/blogapp/static/css/fontin_sans_sc_45b.otf @ file:///users/user/documents/djangoprojects/blogengineenv/blogengine/blogapp/static/cs...

php - URL: year and month vs ids -

i switch wordpress custom cms , came upon decision customize urls. have wp standard /2013/05/title-here format , jump custom format of /news/12345-title-here , stumped. is there difference @ far user concerned, or page load times? if keep wp year , month, user knows content timely. figure year-and-month format, backend have search database titles using slug, id format, can search row number , limit result 1 row. the question then: 1 or other going backend development, or both options same , should consider things ux point of view (in keep year-and-month format)? google doesn't seem care, nor this comprehensive page .

java - String property bound to binary property -

Image
i wish set title of javafx togglebutton depending of state: imperative java code: tgbtn.settext( tgbtn.isselected() ? "stop" : "start" ); i wish use javafx bindings miss "ternary" operator: tgbtn.textproperty().bind( tgbtn.selectedproperty().asstring()); with binding text of button becomes: can suggest binding display "start" / "stop"? tgbtn.textproperty().bind( bindings.when(tgbtn.selectedproperty()) .then("stop") .otherwise("start") );

css - Aligning an INPUT and a DIV side by side -

i'm trying align real button , fake button on single line. i've been asked make link button created image sprite it. problem is, can't input , div play nice. <div class="submitform"> <input type="submit" value="rename" /> <div class="smallbutton">@html.actionlink("cancel", "siteindex", new { id = @html.displayfor(model => model.siteid) })</div> @html.hiddenfor(model => model.siteid) </div> above html (asp.net mvc 4) , below css: .smallbutton { display: inline; } .smallbutton { color: #000 !important; font-family: arial; font-size: 13px; padding: 3px 15px; background: url('../../images/smallbtn.jpg') 0 0; } .smallbutton a:hover { color: #000 !important; background: url('../../images/smallbtn.jpg') 0 -26px; } .smallbutton a:active { color: #000 !important; background: url('../...

c# - VS2012 Designer Could Not Load Assembly -

there solution c# project referencing managed c++ library in turn references native c++ library. c# project contains baseusercontrol , childusercontrol extends it. the problem is: if code native c++ called (via managed c++ library) in constructor of baseusercontrol childusercontrol can't veiwed in designer view; nor can add either of baseusercontrol or childusercontrol form. following error: could not load file or assembly 'testlibcpp, version=1.0.4877.30347, culture=neutral, publickeytoken=null' or 1 of dependencies. system cannot find file specified. how can fix this? i have included simple vs2012 solution demonstrates problem. contrived example based on problem having large codebase has been converted vs2005 vs2012. thanks if have source code ,please try rebuild solution using configuraion( x86 platform) , try open childusercontrol designer.

python - Normalizing Unicode -

is there standard way, in python, normalize unicode string, comprehends simplest unicode entities can used represent ? i mean, translate sequence ['latin small letter a', 'combining acute accent'] ['latin small letter acute'] ? see problem: >>> import unicodedata >>> char = "á" >>> len(char) 1 >>> [ unicodedata.name(c) c in char ] ['latin small letter acute'] but now: >>> char = "á" >>> len(char) 2 >>> [ unicodedata.name(c) c in char ] ['latin small letter a', 'combining acute accent'] i could, of course, iterate on chars , manual replacements, etc., not efficient, , i'm pretty sure miss half of special cases, , mistakes. the unicodedata module offers .normalize() function , want normalize nfc form: >>> unicodedata.normalize('nfc', u'\u0061\u0301') u'\xe1' >>> unicodedata.normaliz...

jquery plugins - x-editable access attribute value of trigger element -

i using x-editable in-line editing inside web app. pass additional parameters server, read data- attributes on trigger element. here editable element: <a href="#" data-url="save_url" data-pk="271" data-type="text" data-value="value" class="editable" data-param="xxx">value</a> i pass data-param attribute, don't know how access trigger element. tried via $(this).data('param') , null... full editable code: $.fn.editable.defaults.mode = 'inline'; $('.editable').editable({ params: { param: $(this).data('param') } }); calling $('.editable').data('param') doesn't come account since have many .editable elements present. thanks i figured out. i'm answering in case needs know: $('.editable').editable({ params: function(params) { // add additional params data-attributes of trigger element params.pa...

xamarin.android - NullReferenceException when calling ShowDialog on Android 2 -

i nullreferenceexception when calling acitiviy.showdialog(int) in response user tapping button. exception occurs in android 2.1 not in android 4.2. here stacktrace: unhandled exception: system.nullreferenceexception: object reference not set instance of object @ (wrapper delegate-invoke) <module>.invoke_void__this___intptr_intptr_intptr_jvalue[] (intptr,intptr,intptr,android.runtime.jvalue[]) <0x000b3> @ android.runtime.jnienv.callvoidmethod (intptr,intptr,android.runtime.jvalue[]) <0x00053> @ android.app.activity.showdialog (int) <0x0011f> @ myapp.androidapp.invoiceactivity.showscheduledatedialog (object,system.eventargs) <0x0003b> @ android.views.view/ionclicklistenerimplementor.onclick (android.views.view) <0x00057> @ android.views.view/ionclicklistenerinvoker.n_onclick_landroid_view_view_ (intptr,intptr,intptr) <0x00063> @ (wrapper dynamic-method) object.be0dcca3-9ca4-47b4-a6a4-f691d34675f1 (intptr,intptr,intptr) <0x00043> any...

css - Footer Overlaps Div before Dropping Below -

i managed make footer stick bottom of window, avoid content div... now, it's overlapping 15px before dropping below. i want footer drop, never overlap content. think may have margins, tweaking has not yet solved this. any suggestions? adding margin-bottom:15px doesn't seem help, because it's shown once footer overlaps enough push footer down. margin shown, not before small amount of overlap. the #push div supposed make possible, understood on twitter's bootstrap example. css: * { margin: 0; padding: 0; } html { height: 100%; } body { margin: 0; height: 100%; } #wrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -50px; min-width: 900px; } .main_nav { list-style-type: none; margin: 0; width: 160px; float: left; padding-left: 40px; overflow: hidden; } #bio_content { width: 700px; min-height: 445px; margin-bottom: 15px; float: left; } #bio_text {...

Layout Editor Continues to crash after Eclipse Reinstall and Java upgrade -

i've been ripping hair out last 2 days trying figure out. everytime open eclipse android layout editor, eclipse crashes. i've reinstalled eclipse, made sure have latest java developer kit, , followed previous posts' advice on changing eclipse.ini file. after reinstalling eclipse, when try open new project, crashes. can please me. i able figure out after intelligent friend. reinstalled video card drivers , worked!!! spent 12 hours trying figure out. anyway - i've posted answer under similar post, please don't flame me repeating myself.

regex - Can domain name have two continuous hyphens -

i looked couple of questions on so, seem suggest 2 continuous hyphens (e.g. my--website.com) not allowed when search same domain name on http://www.register.com/index.rcmx , gladly accepts name while rejects non valid domain names my#website.com. validation url/domain using regex? (rails) it's legal in domain name, , required internationalised domain names (idns) when converted unicode ascii end prefixed xn--

Python regex and spaces? -

if have piece of text, i.e. title="gun control" href="/ebchecked/topic/683775/gun-control" and want create regular expression matches (see inside <> below) title="<1 word or many words separated space>" href="/ebchecked/topic/\w*/\s*" how solve part in <> ? the following regex match 1 word or many words separated space: \w+( \w+)* here "word" considered consist of letters, digits, , underscores. if want allow letters use [a-za-z]+( [a-za-z]+)* .

Can't multiply sequence by non-int of type 'float' in Python -

i have following code in python: class totalcost: #constructor def __init__(self, quantity, size): self.__quantity=quantity self.__size=size self.__cost=0.0 self.__total=0.0 def determinecost(self): #determine cost per unit if self.__size=="a": self.__cost=2.29 elif self.__size=="b": self.__cost=3.50 elif self.__size=="c": self.__cost=4.95 elif self.__size=="d": self.__cost=7.00 elif self.__size=="e": self.__cost=9.95 def determinetotal(self): #calculate total self.__total= self.__cost * self.__quantity def getcost(self): return self.__cost def gettotal(self): return self.__total def menu(self): print("----------------sizes/prices----------------") print(" size = $2.92") print(" ...

C# Json.NET WCF Rest DateTime Format -

take @ following example code, output wcf date format "/date(1237951967000)/" or time zone variant. class program { public class test { public datetime date { get; set; } } static void main(string[] args) { var test = new test { date = datetime.now }; var json = jsonconvert.serializeobject(test); console.writeline(json); } } here output: {"date":"2013-05-09t11:17:38.7990259-07:00"} how can adjust above code give desired format? {"date":"\/date(1237951967000)\/"} var settings = new jsonserializersettings() {dateformathandling= dateformathandling.microsoftdateformat}; var json = jsonconvert.serializeobject(test, settings);

process - How should release management be structured for an agile Professional Services department? -

background professional services departments provide add-on services customers of product. a lot of these projects small (4-10 hours) , need turned around quickly. additionally, these important projects enhancements customers rely on business. some challenges are: there amount of rework or feature changes customers change mind or make tiny additional request. aside obvious mangement issue (managing scope creep etc.), fact remains there minor tweaks need implemented after project "live". sometimes breaks whatever reason , issues need handled expedience. again, these in-production processes customers rely on. currently, our release management ad hoc: engineers manage projects soup nuts, including scoping, customer relationships, code development, production deployment, , project support (for subsequent issues). we have dev servers , have production servers. servers exist on-site in server farm. not backed ever, , have no redundancy because not in colo - kin...

c++ - Writing a birthday calendar with a multiset of birthday objects but sorting isn't working -

i writing birthday calendar multiset of birthday objects. comparison function isn't sorting right , can't search b-day name. class comparename { public: bool operator()(birthday* a,birthday *b) { if(a->getlastname()==b->getlastname() && a->getfirstname() != b->getfirstname()) return( a->getfirstname() < b->getfirstname()); else return (a->getlastname()<b->getlastname()); } this comparison function. wanting able search database birthday or partial birthday , whole name. cant search name part working. void multiset::searchbyname( birthday *a) { nameset::iterator result; result=nameset.find(a); if(result!=nameset.end()) (*result)->print(); } i have used type def multiset , have used in definition include object functor, have left out of code excerpt brevity.

android - Refreshing a fragment View on back from settings change -

what i'm trying accomplish have view refresh when comes settings , changes preference. thought work not. ideas on how can accomplish this? import java.text.simpledateformat; import java.util.calendar; import com.projectcaruso.naturalfamilyplanning.r; import android.annotation.suppresslint; import android.app.datepickerdialog.ondatesetlistener; import android.content.sharedpreferences; import android.os.bundle; import android.preference.preferencemanager; import android.support.v4.app.fragment; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.datepicker; import android.widget.textview; public class chartingfragment extends fragment implements ondatesetlistener { sharedpreferences mpreferences; boolean symptothermal; boolean mucus_stamps; boolean fertile_infertile; @override public void ondateset(datepick...

iOS - Dropbox upoad to "App Folder" -

in ios application, i'm integrating dropbox api upload files. while creating app in dropbox.com, found 2 options. 1 full folder availability , 1 "app folder". opted "app folder" , gave folder name "xxx". i'm calling following method takes full file path parameter. -(void)uploadfile:(nsstring*)filepath { nsstring *destdir = @"/"; [[self restclient] uploadfile:[filepath lastpathcomponent] topath:destdir withparentrev:nil frompath:filepath]; } the problem destination directory shouldn't "/" because want upload "xxx" folder. tried providing destination directory "xxx" , "/xxx", still didn't work out. can 1 point out what's wrong thing i'm doing? we must careful how initilazing dbsession. mentioned "omz" in above comments, have provide appropriate key if kdbrootdropbox or kdbrootappfolder. in case i'm using 2 different types o...