Posts

Showing posts from August, 2011

Handling multiple filters in angularjs -

i using ng-repeat render complex set of data in ui. after receiving data, need filter data based on checkboxes, sliders etc. right have 6 custom filters, based on time, price, , checkboxes. using them following ng:repeat="response in searchresponse|filter:filter1(response)|filter:filter2(response)|filter:filter3(response)|filter:filter4(response)|filter:filter5(response)|filter:filter6(response)|limitto:totaldisplayed this works fine think expensive way of applying filters. have noticed considerable lag in performance in rendering after this. there better way handle filters here ? considering fact may have more such filters in future. please suggest. ! instead of chaining filters, why not like: ng:repeat="response in searchresponse|filter:genericfilter(response, filterconditions)|limitto:totaldisplayed what you're doing chaining filters 1 after another, , may not needed – 1 filter selects out results based on filterconditions

How do I print pdf files in c? -

im doing small project on printing files through c. i use linux os. works fine cant find solution on pdf format. there library can use this? there 2 ways that: you can write own code write pdf file learning pdf file structure pdf reference you can use existing library haru , jagpdf no. 1 hard way apparently it's fun in opinion.

java - What does this block of Scala code mean -

hi relatively new scala, try play 2 framework , stuck following code (used template) <article class="tasks"> @todotasks.groupby(_.project).map { case (project, tasks) => { <div class="folder" data-folder-id="@project.id"> <header> <h3>@project.name</h3> </header> <ul class="list"> @tasks.map { task => <li data-task-id="@task.id"> <h4>@task.title</h4> </li> } </ul> </div> } } </article> what line mean? @todotasks.groupby(_.project).map { and how use scala *.map in context of play 2 framework. i'd appreciate if explain in...

ajax - displaying a jsp page after another jsp page -

i doing jsp project; here using 2 text fields in first.jsp , retrieving values in second.jsp. want display text field values in same page in browser after submit button. don’t know ajax…, first.jsp <html> <head> </head> <body> <form action="second.jsp"> first name: <input type="text" name="fname"> last name: <input type="text" name="lname"><br><br> <input type="submit" value="submit"> </form> </body> second.jsp <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>jsp page</title> </head> <body> <% string fname = request.getparameter("fname"); string lname = request.getparameter("lname"); %> first name <%=fname%><br><br> ...

c# - Custom Video and Audio Settings -

i want make audio/video settings window existing in skype, allow user select devices used in calls , test them, have 2 problems:| how availabe audio/video devices. i want test these devices following: mic: display bar based on input voice (same skype audio setting). camera: view preview selected camera (same skype setting). speaker: button play audio file. i found solution #1 using microsoft expression encoder following: var viddevices = encoderdevices.finddevices(encoderdevicetype.video); var auddevices = encoderdevices.finddevices(encoderdevicetype.audio); this require add microsoft expression encoder increase size of our program, think there should native way communicate audio/video devices without need of external libraries. part 1. non-trivial .net. need integrate direct show , com this, or possibly use wmi queries. however, giant pain in ass. documentation @sheridan provided great starting point. piece of advice, there other frameworks ...

php - Displaying User meta in wordpress -

i want display posts of user using following meta function: <?php $user_id = get_current_user_id(); $key = ''; $single = true; $user_list = get_user_meta( $user_id, $key, $single ); echo '<p>the '. $key . ' value user id ' . $user_id . ' is: ' . $user_list . '</p>'; ?> it works fine, when $key 1 item. want use code run same query multiple keys (as key post id) can use display posts user follows: <?php $args = array( 'post_type' => 'todo_listing', 'posts_per_page' => 4, 'order' => 'asc', 'meta_key' => '1014', 'meta_query' => array( array( 'key' => '$id', 'meta_value_num' => '1', ) ) ); $loop = new wp_query( $args ); ?> <?php while ( $lo...

Java Generics: function parameter for a set of generic typed objects -

i working javax.validation / hibernate validation. validate annotated (e.g. @notnull @ attribute) bean, hibernate validator used javax.validation interfaces: validator validator = validation.builddefaultvalidatorfactory().getvalidator(); public interface validator { <t> set<constraintviolation<t>> validate(t object, class<?>... groups); } public interface constraintviolation<t> { string getmessage(); path getpropertypath(); t getrootbean(); } the goal write single method, accepts differently typed sets, like: set<constraintviolation<tasklist>> violationstasklist = validator.validate(tasklist); set<constraintviolation<taskitem>> violationstaskitem = validator.validate(taskitem); public void consumeviolations(set<constraintviolation<?> violations) { // meaningful... violations.getmessage(); } using wildcard ? best think came until rejected compiler message: consumeviolations(....<...

How to handle the PTS correctly using Android AudioRecord and MediaCodec as audio encoder? -

i'm using audiorecord record audio stream during camera capturing process on android device. since want process frame data , handle audio/video samples, not use mediarecorder. i run audiorecord in thread calling of read() gather raw audio data. once data stream, feed them mediacodec configured aac audio encoder. here of codes audio recorder / encoder: m_encode_audio_mime = "audio/mp4a-latm"; m_audio_sample_rate = 44100; m_audio_channels = audioformat.channel_in_mono; m_audio_channel_count = (m_audio_channels == audioformat.channel_in_mono ? 1 : 2); int audio_bit_rate = 64000; int audio_data_format = audioformat.encoding_pcm_16bit; m_audio_buffer_size = audiorecord.getminbuffersize(m_audio_sample_rate, m_audio_channels, audio_data_format) * 2; m_audio_recorder = new audiorecord(mediarecorder.audiosource.mic, m_audio_sample_rate, m_audio_channels, audio_data_format, m_audio_buffer_size); m_audio_encoder = mediacodec.createenco...

entity framework - My ASP.NET MVC project loads slower -

hi have project developed in asp.net mvc. using entity framework database first approach. problem facing is, first time when user loads website, takes time load unusual. searching reason behind this. can me in this? for moment, assuming since using database first approach, have load database project first before connect. think making website load slower. if case, can guide me generate connection string dynamically during run time in entity framework , connect database? i have stored procedure can connection string. dont know how can use connection string , connect database. when “ first time when user loads website, takes time load unusual ” give comparison of how slow slow first time. , “ first time ” mean after re-starting iis or re-starting app-pool, may take time of code have turned native code just-in-time computer. ef may slow down if have many hundreds of tables , has re-construct context based on of tables , relationships. if case, see delay in every time ...

java - redirects not working in jsp -

i have created jsp page view.jsp , corresponding have created servlet admin.java code of both below... when click on register blank page appears...redirects not working. please me in resolving view.jsp <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> </head> <body> <form action="admin"> username <input type="text" name="username" value="" /> password <input type="text" name="password" value="" /> <input type="submit" name...

Is it possible to change image folder in cakephp 2.4 -

i have read many docs, failed solve problem: images in existing project stored in $_server['document_root'].'/media/' want, can't change in cakephp 2.4 default image folder $_server['document_root'].'/app/webroot/img/' desire. lib/cake/bootstrap.php contains constants: /** * path public images directory. */ if (!defined('images')) { define('images', www_root . 'img' . ds); } /** * web path public images directory. */ if (!defined('images_url')) { define('images_url', 'img/'); } and configure::write('app.imagebaseurl', images_url); i tried change: images $_server['document_root'].'/media/' images_url / and doesn't work @ all. image files still points $_server['document_root'].'/app/webroot/img/' see when try render image in view: echo $this->html->image('/img/ride_scheme/chema.jpg', array( 'width' =>...

javascript - Popover does not get anchored to the triggering element -

Image
so twitter bootstrap popovers seem positionally challenged when triggering element contained within element style -ms-overflow-y: auto; (a scrollable element within window). when element scrolled, popover not scroll it. i popover move content within scrollable element. how can achieve this? popover code: $(this).popover({ animation: false, html: true, placement: popover.placement || 'auto bottom', title: popover.title, content: popover.validationmessage + popover.content, trigger: 'manual', container: '.content-panel' }).click(function (e) { $('button[data-toggle="popover"]').each(function (index, element) { $(this).popover('hide'); }); $(this).popover('show'); $('#' + $(this).attr('data-for')).focus(); }); .content-panel scrollable element. ...

Rails 4 custom translations per User -

we have cms application allows create shops backend multiple users.. when want implement translations face problem. translations stored locale need user.id , locale. because each user can have own translations per language. i tried implement i18n backend described in railscast stucking http://railscasts.com/episodes/256-i18n-backends?view=asciicast customization per user. is there way add additional column translations , ask local , user_id? many thanks there not single best solution given problem. depends on application. given information have i'd suggest like: app/controllers/application_controller.rb class applicationcontroller < actioncontroller::base protect_from_forgery with: :exception before_filter :set_locale private def set_locale i18n.locale = current_user.language || i18n.default_locale end end this set 18n.locale language settings of current_user . need language attribute in users model work. please have @ http://xyzpu...

python 2.7 - How to double a char in a string? -

i trying write function takes 2 arguments, string , letter. function should double number of letter in string. example: double_letters("happy", "p") happppy what have done far; def double_letter(strng, letter): new_word = "" char in strng: if char == letter: pos = strng.index(char) new_word = letter+strng[pos:] but giving me output: pppy how can change function output: happppy? use string.replace string = 'happy' letter = 'p' string = string.replace(letter, letter + letter) print string

jsf - Is it a good idea to use Bean Validation (JSR303) in JSF2 Webapplications? -

iam create webapplication javaserver faces 2. in backend things managed other usual jee technologies ejb3.1 , jpa2. point is, iam following domain driven architecture, means, the domain models used @ jsf layer backing bean models , typically persisted persistent entities @ persistence layer. using same model @ different layers yields advantage of defining related model restrictions once , all. using bean validation @ level provides restrictions of model either jsf, jpa etc. now question is, whether using bean validation jsf2 idea? concerns linking validation restrictions directly model might wrong approach, validation of jsf lifecycle happens somehow earlier accessing model (for validations rules). as know jsf validation not taking place during model processing (aka. phase 4: apply model values) earlier in own dedicated point in time (phase 3: process validations) , applied on component value (submitted value). however, how should jsf validation (in phase 3) know actual restricti...

mailmessage - Send e-mail in using C# -

the code shown below how trying send email. receive error failure sending mail , can tell problem happening here? mailmessage mail = new mailmessage(); smtpclient smtpserver = new smtpclient("smtp1.ajmanchamber.ae"); mail.from = new mailaddress("coo-services@ajmanchamber.ae"); mail.to.add(mailid); mail.subject = "new coo request created"; mail.body = "new coo request created , reference number " + referenceno; smtpserver.port = 587; smtpserver.credentials = new networkcredential("user", "pasword"); smtpserver.enablessl = true; smtpserver.deliverymethod = smtpdeliverymethod.network; smtpserver.send(mail); when change code , try way get mailmessage mail = new mailmessage(); smtpclient smtpserver = new smtpclient("smtp1.ajmanchamber.ae"); mai...

Android: How to reload webview using a button -

i have created webview , loaded url. if network connection not available loads custom url retry button. how can have button reload activity after user has network connection? (if easier calling activity , calling webview again works well.) have handled network connection not available code correctly? below code : import android.net.connectivitymanager; import android.net.networkinfo; import android.os.bundle; import android.app.activity; import android.view.menu; import android.view.menuitem; import android.webkit.webview; import android.webkit.webviewclient; import android.widget.toast; import android.support.v4.app.navutils; import android.annotation.targetapi; import android.content.context; import android.os.build; public class webactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_web); if(isnetworkstatusavailable (geta...

android - send downstream message to google ccs with node js -

i using node-xmpp connect google gcm ccs servers. followed from gcm google groups connect. need send downstream message whenever receive message redis subscriber(i subscribed redis channel redis node package ). code follows var gearmanode = require('gearmanode'); var redis = require("redis"); var xmpp = require('node-xmpp'); var gearjob; var redissubchan = 'test_channel'; var gearmanjobname = 'reverse'; var jobpayload; var redisclient; var xmppclient; var gearclient; gearclient = gearmanode.client(); var options = { type: 'client', jid: 'myid@gcm.googleapis.com', password: 'myserverkey', port: 5235, host: 'gcm.googleapis.com', legacyssl: true, preferredsaslmechanism: 'plain' }; console.log('creating xmpp app'); xmppclient = new xmpp.client(options); xmppclient.connection.socket.settimeout(0) xmppclient.connection.socket.setkeepalive(true, 10000) redisclie...

sql - JasperReport printing repeated values even when set not to -

Image
i combining sql column , using group count print out 1 line combined items. i'm getting result: here's code: (sorry if it's messy) <?xml version="1.0" encoding="utf-8"?> <jasperreport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="tablereceipt" pagewidth="225" pageheight="800" whennodatatype="allsectionsnodetail" columnwidth="195" leftmargin="5" rightmargin="25" topmargin="20" bottommargin="20" isfloatcolumnfooter="true" isignorepagination="true" uuid="516cb110-18eb-4a7a-865b-66c019f5be1a"> <property name="ireport.scriptlethandling" value="0"/> <prope...

javascript - Creating a link that opens a popup on a Google Chrome Extension -

i have code transform words "test" on page links google. there way make clicking on these links open popup.html instead? searchpattern = new regexp ("(test)", "gi"); var pagetext = document.body.innerhtml; document.body.innerhtml = pagetext.replace(searchpattern, "<a href='https://www.google.com/#q=$1'>$1</a>"); edit: ok have function instead of link, still not sure how call extension's popup.html through page's html code: document.body.innerhtml = pagetext.replace(searchpattern, "<a class='popup'>$1$2$3</a>" + "<script>$('popup').click(function(e) {e.preventdefault();" + "});</script>");

google maps - Exclude div from jQuery hover -

as can see on following site, have div containing google maps searchbox. have set jquery hover functions on div show/hide it. hover , searchbox works when select autocomplete result, hover function on parent div thinks moved mouse out. site : http://81.64.185.202/new/ do have idea how resolve problem ? thanks set code $( "panel" ).hover(function() { $( ).animate({"width": 500}) }, function() { $( ).animate({"width": 50}); } );

php - Big PDF to JPEG Conversion with ImageMagick returns 500 Internal Error -

my code converts pdf file pages jpeg images once uploaded, , goes fine when working on light pdfs (not many images , effects, while number of pages no more 40-50 on average). when file heavier, "500 internal error" . pdf has been uploaded , pages have been converted break point. my code: $foldername = str_replace('.','',preg_replace('/\s+/', '', microtime())); mkdir("./mag_thumbs/".$foldername, 0755, true); try { $compression_type = imagick::compression_jpeg; $im = new imagick(); $im->setresolution(250,250); $im->readimage($pdf_path); $pdf_count = $im->getnumberimages(); $im->setimageformat('jpg'); $im->flattenimages(); $im->setimagecompression($compression_type); $im->setimagecompressionquality(40); $im->writeimages('./mag_thumbs/'.$foldername.'/page.jpg',true); $im->clear(); $im->destroy(); } catch(exception $e){ ...

c# - Using external helper classes -

apologies in advance suspect dumb question, can't seem search answer - results on internal helper classes. i've got helper class takes in list of postcodes , determines regions match with: namespace my.helpers { public class postcodehelper { public string compilegeographies(string postcodecsv) { //internals go through codes , find out areas they're in return string.join(", ", resultstring); } } } now, i'd able call directly in xaml, doing this: xmlns:helpers="clr-namespace:my.helpers;assembly=my.helpers" .... <label content="helpers.postcodehelper.compilegeographies="{binding postcodes}" /> that not work, because syntax invalid demonstrates i'm after. possible spin external class, pass in argument through binding, , use result directly in xaml? if so, what's correct syntax? what converter? use helper class inside of converter , pass postcod...

c# - Change Date format in ASCX file -

i have custom list object , binding repeater this <asp:repeater runat="server" id="repeater1"> <itemtemplate> <p><input type="text" class="datepicker2" name="txtenddate" value="<%#eval(" enddate").tostring().replace("t00:00:00", "") %>" /></p> </itemtemplate> note: repeater data-binding done correctly on end. date comes end in format 2012-01-01 ,i want repeater show in 2012/01/01 format. there way achieve this? try use .tostring("yyyy/mm/dd") try code hope help. <asp:repeater runat="server" id="repeater1"> <itemtemplate> <p><input type="text" class="datepicker2" name="txtenddate" value="<%#(convert.todatetime((eval("enddate"))).tostring(yyyy/mm/dd,cultureinfo.invariantculture) %>" /></p> </itemtemplate> ...

bitmapimage - Create Diagonal image from bitmap image in windows phone -

Image
i want make diagonal/ triangle shape image bitmap source without using polygon control, how in windows phone. hm mean without using polygon controls? you can create writeablebitmap, , draw on tools prefer. if want avoid additional tools can call set/get pixel methods , loops. when happy writeablebitmap can create bitmapimagesource , call .asbitmap() on writeablebitmap. complete can use whole imaging sdk chain. edit: can find .asbitmap method in nokia.interopservices.windowsruntime namespace.

r - How to combine two sjp.likert (from the sjPlot package) generated plots in one plot? -

i trying combine several plots using par function. plots generated sjplot function sjp.likert(). i use 2 example plots sjplot package , try combine them: likert_2 <- data.frame(as.factor(sample(1:2, 500, replace=true, prob=c(0.3,0.7))), as.factor(sample(1:2, 500, replace=true, prob=c(0.6,0.4))), as.factor(sample(1:2, 500, replace=true, prob=c(0.25,0.75))), as.factor(sample(1:2, 500, replace=true, prob=c(0.9,0.1))), as.factor(sample(1:2, 500, replace=true, prob=c(0.35,0.65)))) levels_2 <- list(c("disagree", "agree")) likert_4 <- data.frame(as.factor(sample(1:4, 500, replace=true, prob=c(0.2,0.3,0.1,0.4))), as.factor(sample(1:4, 500, replace=true, prob=c(0.5,0.25,0.15,0.1))), as.factor(sample(1:4, 500, replace=true, prob=c(0.25,0.1,0.4,0.25))), as.factor(sample(1:4, 500, replace=true, prob=c(0.1,0.4,0.4,0.1))), as.factor(sample(1:4, 500, replace=true, prob=c(0.35,0.25,0.15,0.25)))) levels_4 <- list(c("s...

sharepoint javascript collection not initialized error -

i have strange problem. occurs totally randomly, have no idea why , in circumstances comes. details: want members of group executequeryasync function. in callback userenumerator = users.getenumerator(); row throws exception: the collection has not been initialized. has not been requested or request has not been executed. may need explicitly requested. there no other async code running. dont know if important, happens if running @ page load. i insert code xml viewer webpart. var ctx = sp.clientcontext.get_current(), groups = ctx.get_web().get_sitegroups(), group = groups.getbyid(6), users = group.get_users(); ctx.load(group); ctx.load(users); ctx.executequeryasync(function () { var userenumerator, user; $("#members-select").empty(); userenumerator = users.getenumerator(); while (userenumerator.movenext()) { user = userenumerator.get_current(); $("#mem...

c# - Generate random date and time in a service -

i'm trying have kind of method in service can accessed form can use method generate random date in date time picker. doesn't work however, have 2 dtp's called dtp_current , dtp_new this accessed on form , have 2 buttons before , after, when before clicked guessing newly generated date before current date , if click after it's guessing it's gonna after generated date. have using service however public int randomdate() is i'd method called in service, how go doing when after button clicked checks dtp_current date see if dtp_new larger i hope makes sense summary: have form , service reference need service reference generate random date in dtp_current when before or after clicked generate new date in dtp_new check if dtp_new larger or smaller dtp_current it seems me main problem here create method generates random date. one way , retain level of control on dates get, generate random numbers date, month , year. year, do: random r = new ran...

unit testing - Jenkins timeout when downloading surefire-junit4 in Maven build -

good morning, i'm running java project in jenkins , in maven building, when project's dependencies downloading, execution takes long , doesn't work when surefire library being installed. execution stops in point: [info] surefire report directory: /usr/local/de/jenkins/.../target/surefire-reports ..... ..... downloaded: [url of nexus path]/surefire-junit4-2.7.2.jar (25 kb @ 905.0 kb/sec) when surefire-junit4-2.7.2.jar being installed, execution doesn't work anymore , takes hours. what problem? can me? kind regards.

wordpress - CSS small screen issue -

Image
my query wordpress site womensfertility n hormones. c o m if view site on smaller screen resolution 1024 x 768 site this: but if view on normal computer screen big resolution looks good, if scale iphone , ipad scale normal responsive. i'm using optimizepress. i've added code make site boxed layout , have background image instead of full width. code i've added was: .banner .logo img{width:200px} .banner.centered-banner > .fixed-width .banner-logo { width: 100%; } .container { margin: auto; overflow: hidden; padding: 0; position: relative; width: 75%; } i guess width: 75%; , .banner .logo img { width: 200px; } makes site looks way, have no idea how make site boxed without doing code. idea? use css media queries @media (max-width: 600px) { /*code screen max 600px*/ } @media (max-width: 480px) { /*code screen max 480px*/ } or: body { color: white; background: gray; font-size: .5in } @media screen , (min-width: 1024p...

C++: "Error: Pointer being freed was not allocated" when handling large lists -

i trying process data in std::vector made of 2d points; basically, need check whether or not points are, directly or indirectly through point, linked relationship don't think needs detailed here. in order process data properly, copied data vector , used lists faster handling. i wrote following 2d vector class: class float2d { public: float x, y; float2d(): x(0), y(0) {} float2d(int a, int b): x(a), y(b) {} bool checkstuffwith(float2d &u); // math }; the code used process data looks this: bool checkstuffinvector(vector<float2d> const &data) { if (data.size() < 2) return true; // copy data in list, thinned out progressively list<float2d> data_copy(data.begin(), data.end()); // points used checkstuff remaining points in data_copy list<float2d> processed_data; // choose arbitrarily last element compare others processed_data.push_back(data_copy.back()); data_copy.pop_back(); list<flo...

angularjs - Unable to get $error.maxlength validation in Directive -

i creating directive adds template text type input view. in directive, trying add span class error notification if text field input more max length setting provided. have code this: <div ng-app="app"> <form name="userform" ng-submit="processform()" novalidate> <div use-text-box name="xyz" ng-maxlength="10" required> </div> <button type="submit" class="btn btn-success">submit</button> </form> </div> my directive this: var app = angular.module('app', []); app.directive('usetextbox', function() { return { replace:true, compile: function(element,attrs) { var name = attrs.name; var maxlengtherror = attrs.hasownproperty('ngmaxlength') ? '<span ng-show="userform.' + attrs.name + '.$error.maxlength" class=...

Why do we need vendor specific android app like "MaaS360 MDM for Samsung"? -

i developing mdm android application not sure if need create separate apk apps each vendor "my app samsung", "my app lg", "my app htc" etc. i found of apps on google play store soti, maas360, airwatch - https://play.google.com/store/apps/developer?id=soti+inc - https://play.google.com/store/apps/developer?id=maas360 we can see separate android application each device vender. "mobicontrol agent", "mobicontrol samsung agent", "mobicontrol zte agent", "mobicontrol htc agent" i create single mdm android apps can provide features basic mdm operation along vendor specific features samsung safe, konx etc. so want know, possible or not? if yes know reason behind creating different vendor specific apps in app store. so want know, possible or not? yes. it's possible. can put of functionality in 1 apk , can check on platform (manufacturer) running , execute manufacturer specific api's. ...

python - generating histogram chart with 3 columns into 1 column -

i genearting column chart want generate histogram data in manner ['name',10,7,3] now getting problem genearting histogram, wants chart 1 column shows both pass(7) , fail(3) different colors out of total(10). i doing in django template. code is google.load('visualization', '1', {packages: ['corechart','table']}); function drawvisualization() { // raw data (not accurate) var data = google.visualization.arraytodatatable([ ['job-names', 'total', 'pass', 'fail'], {{data.0|safe}} ]); var options = { title : 'jenkins job details project {{head_title}}', vaxis: {title: "number of bulds" ,ticks : [2,4,6,8,10] }, haxis: {title: "job-names" , slantedtext:true, slantedtextangle:30 , textstyle : {fontsize : 9}}, is3d: true, height: 550, width: 600, colors : ["#194d86","#33ff66", "...

javascript - focus is not working after the blur event to the textbox in jquery -

while dragging div, need remove focus of input , on dropping it, add focus. have enclosed code here. $('.ui-draggable').mousedown(function(){ $(this).find('input').blur(); $(this).addclass('draggable'); }).mouseup(function(){ $('.draggable').find('input').focus(); $(this).removeclass('draggable'); }); i don't think need call 'blur', input lose focus when click ui-draggable element. should use stop-event of draggable . $('.ui-draggable').on( "dragstop", function( event, ui ) { $('yourinputselector').focus(); });

common lisp - CLSQL trouble using MySQL as backend on windows -

i'm using sbcl on windows. got error when attempted connect mysql using clsql this. (ql:quickload :clsql) (clsql:connect '("localhost" "database-name" "database-user-name" "password") :database-type :mysql) couldn't load foreign libraries "libmysqlclient", "libmysql". (searched clsql-sys:*foreign-library- search-paths*: (#p"c:/users/razenrote/appdata/roaming/quicklisp/dists/quicklisp/software/clsql-20140316-git/db-mysql/")) a note @ bottom of clsql home page ( http://www.cliki.net/clsql ) addresses issue.

php - file_put_contents inserting javascript " " destroy closing -

how put js script in file_put_content : $videonova_content = " var initialscriptapi = "<script src ='http://www.youtube.com/player_api'></script>"; var youtubetitle = "wordpress"; var youtubesource = "fh6b4s9eny4"; var youtubecontrol = "1"; var youtubeautoplay = "0"; var youtubedisplay = 7; var youtubeforcegrab = '0'; "; file_put_contents($file, $videonova_content); the problem when inserting js. " " destroy enclosing . how solve this?? inserting " '""' " how encapsule?? first of all, script not run in php, , syntax error, not see how have tested script. proper way fix current script is, like: $videonova_content = " var initialscriptapi = \"<script src ='http://www.youtube.com/player_api'></script>\"; var yo...

tfs - Can not open Work Item from URL -

tfs 2012 , user limit access team web access. user can create work item , change project page, cannot open work item such url: http://servername:8080/tfs/web/wi.aspx?pcguid={collectionguid}&id={workitemid} it opens page error: tf400409:you not have licensing rights access feature: standard features why user can not open work item such url? while message more or less self-explanatory, try use web access url instead of api web page: http://servername:8080/tfs/[collection]/[project]/_workitems#_a=edit&id=[id]

jquery - Ajax Form is not working on IE -

$(document).ready(function () { $('#upload_photo').click(function () { $('input[type=file]#upload_myphoto').click(); }); }); $(document).ready(function () { $("input[type=file]#upload_myphoto").change(function () { $("#node_profilepic").prop('src', 'loader.gif'); $("#upload_profilepic").submit(); }); }); $(function () { $('#upload_profilepic').ajaxform({ beforesubmit: showrequest, success: function (responsetext, statustext) { alert(responsetext); //$("#node_profilepic").prop('src',responsetext); $('.iframe').click(); }, error: ajaxerror }); }); function showrequest(formdata, jqform, options) { //alert(formdata); var querystring = $.param(formdata); // alert(querystring); return true; } function ajaxerror() {} this code used uploading image using ajax...

hdfs - Hadoop startup error "unrecognized option jvm could not start a virtual machine" -

i facing error after command sudo $hadoop_home/bin/start-all.sh have read discussion on stackoverflow on , refer bug. trying implement hdgs-1943.patch getting following error sudo patch -p0 < /path/hdfs-1943.patch $hadoop_home/bin/hadoop hunk #1 failed @ 71 please help

mysql - How can I duplicate a database from c#? -

i have 'base' database filled generic info within various tables. database created each user have own versions , can modify same info suit needs. i update base database changes new users updates when register. my app mvc3 site on entity framework 4.1 using mysql back-end. currently process above using following steps: run mysqldump on database .sql file update generated file change db name users name run mysql import using new script however have migrated on azure , process seems slow compared old physical server (similar higher specs). is there better way can doing might remove io processes , potentially increase overall speed? changed approach, have 'please wait' animation showing while server heavy lifting.

sql - Finding if current row is last row to be selected from database -

i selecting list of periods database. if current row first row period starts date , can find interval between period start this: select ... case when row_number() over(order r.created_at asc) = 1 r.created_at - r.created_at::date else null end period ... mytable r how can same last row? find time between r.created_at of last row , midnight of date. i aware of first , last functions in postgresql ( https://wiki.postgresql.org/wiki/first/last_(aggregate) ), aggregate functions , not in case. edit: question has 2 great answers. neither of them in case, single line presented part of question part of bigger query, put programmatically , using solutions offered force me alter alot of code, not willing @ point. should scaling problems hit - reconsider. this might faster window functions: with r ( select min(created_at) min_created_at, max(created_at) max_created_at mytable ) select case when (select min_created_at r) = created_at crea...

R performance issues using gsub and sapply -

i have data frame consisting of +10 million records (all_postcodes). [edit] here few records: pcode area east north area2 area3 area4 area5 ab101aa 10 394251 806376 s92000003 s08000006 s12000033 s13002483 ab101ab 10 394232 806470 s92000003 s08000006 s12000033 s13002483 ab101af 10 394181 806429 s92000003 s08000006 s12000033 s13002483 ab101ag 10 394251 806376 s92000003 s08000006 s12000033 s13002483 i want create new column containing normalised versions of 1 of columns using following function: pcode_normalize <- function (x) { x <- gsub(" ", " ", x) if (length(which(strsplit(x, "")[[1]]==" ")) == 0) { x <- paste(substr(x, 1, 4), substr(x, 5, 7)) } x } i tried execute follows: all_postcodes$npcode <- sapply(all_postcodes$pcode, pcode_normalize) but takes long. suggestions how improve performance? all functions used in pcode_normalize vectorized. there's no need loop...

eclipse - Grails app wont start from STS but launches from terminal -

here's i'm getting when try run-app on sts 2014-03-24 16:14:53,737 [localhost-startstop-1] error stacktrace - full stack trace: java.lang.nullpointerexception @ org.springsource.loaded.ri.reflectiveinterceptor.jlrmethodgetdeclaredannotations(reflectiveinterceptor.java:935) @ org.springsource.loaded.ri.reflectiveinterceptor.jlrmethodgetannotations(reflectiveinterceptor.java:1491) @ org.springframework.core.type.standardannotationmetadata.hasannotatedmethods(standardannotationmetadata.java:163) @ org.springframework.context.annotation.configurationclassutils.isliteconfigurationcandidate(configurationclassutils.java:106) @ org.springframework.context.annotation.configurationclassutils.checkconfigurationclasscandidate(configurationclassutils.java:88) @ org.springframework.context.annotation.configurationclasspostprocessor.processconfigbeandefinitions(configurationclasspostprocessor.java:253) @ org.springframework.conte...