Posts

Showing posts from August, 2015

html - JavaScript issue with animating elements on hover -

i'm having slide in menu, contains 3 elements (div's), idea each 1 on hover expands width 33% 60, while @ same time other 2 shrink 20%, therefore 100% never exceeded. two issues having right now: on fast mouse move element 1 element 3, screen starts behave funny, flickers hover on element 2 being called (because mouse goes on element 2 element3), , results in blank space , overflow second or two, until hover function on element 3 takes place. i tried stopping using timeout function, must not solution, did not work once hover off container, hover on element 1, last hovered time, stays @ 60%, , not return. not quite sure set behavior. on hover of element , check, or mouseout, idk. the code.. html <div id="elem1" onmouseover="focusdiv('elem1')"> <div style="position: relative; top: 50%; left: 0">e1</div> </div> <div id="elem2" onmouseover="focusdiv('elem2')">

amazon web services - AWS Auto scaling drops ~/.ssh/authorized_keys -

the thing have ec2 instance public key inside ~/.ssh/authorized_keys let developers ssh instance, 1 day autoscaling mechanism create new instance , drop old instance(with authorized keys inside), , gotta edit ~/.ssh/authorized_keys in new instance again. how can prevent this? mean how can make sure whenever autoscaling creating new instance or dropping old instance, sync of authorized_keys, don't need manual copying. thanks much. i guess ami id have specified in auto scaling contains old data. create ami of latest , update instance , remove old ami have specified in as-config , add latest ami id. thing work fine.

.net - Parsing JSON correctly through JsonTextWriter -

i facing difficulty binding json data kendo ui grid while searching solution problem came face face other one. how correctly parse json match correct format mentioned @petur subev here. my current json in format: //{"no":null,"desc":"asfasfasfasfasfasfasfasfasfasfasfasf","date":"2013-03-27t00:00:00","height":0,"final":null} //{"no":null,"desc":"etwetwetwetwet","date":"2013-03-27t00:00:00","height":0,"final":0} but pointed out should this: [{"no":null,"desc":"asfasfasfasfasfasfasfasfasfasfasfasf","date":"2013-03-27t00:00:00","height":0,"final":null}, {"no":null,"desc":"etwetwetwetwet","date":"2013-03-27t00:00:00","height":0,"final":0}, {"no":null,"desc":"asfasfasfskfjklajsf

I have an issue with authorization tokens on openshift -

i developing web app on openshift. today got error when did port forwarding command: "your authorization token has expired. please sign in continue on openshift.redhat.com. password:" when enter openshift password nothing happens. know what's going on? i had such problem when have tried execute commands through git bash console. try common console!

html - HTML5/CSS3 proprely lining up elements -

i building website 3 "main" elements, banner, nav section , content section (see joint image) site plane . however, know "proper" way line different elements on vertical (i mean left - right) axis using css propreties. have investigated static, absolute, relative attributes nothing quite worked. i'm doing wrong should do? here's css code @font-face { font-family: florsn17; src: url('fonts/florsn17.ttf'); } ::-webkit-scrollbar { width: 12px; } ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px gray; border-radius: 10px; } ::-webkit-scrollbar-thumb { border-radius: 10px; -webkit-box-shadow: inset 0 0 6px white; } body { font-family:arial,helvettica,sans-serrif; background-image:url("images/background.jpg"); background-color:black; } header { background-color:black; height:300px; width:720px; float:center; border-style:ridge; border-width:1px; margin-lef

javascript - Clear LocalStorage from server-side -

hello need clear() localstorage server-side. the right moment after inserting info in db (info took localstorage) , need redirect , clear localstorage.. i tried node-localstorage can't controller... edit: im working on node.js javascript server side.. part of code: var mpa = require('../models/mpedidosabastecimiento'); var mysql = require('mysql'); var async = require('async'); var localstorage = require('node-localstorage').localstorage, localstorage = new localstorage('./scratch'); function postalta(req, res){ params = req.body; var objdatos = params.objdatos; var objdatosparsed = ""; tipo_de_objdatos = typeof objdatos; if (tipo_de_objdatos == "string"){ objdatosparsed = json.parse(objdatos); }else if (tipo_de_objdatos == "object"){ stringiii = json.stringify(objdatos); objdatosparsed = json.parse(stringiii); } else {

sql update - Preferred method of updating and setting SQL -

i'm learning sql @ moment, , have found different methods of updating , setting table. for example, wondering "most correct way" of doing this? update student set test1 = 7, test2 = 9 stuid = 999 or update student set test1 = 7 stuid = 999 update student set test2 = 9 stuid = 999 thanks. firstly google before posting questions. the answer (as said others) off-course method 1 . not reload database twice. also if beginner try go learn w3schools

.net - Angular code not seeing controller and items -

i new angular trying create , mvc project angular. have create about.js file , code inside it: (function () { var app = angular.module('myapp', []); app.controller('tecknologiescontroller', function () { this.text = tech; }); var tech = { name: 'progamming', csharp: 'c#', asp: 'asp .net', xaml:'xaml', java: 'java', sql: 'sql', plsql: 'pl/sql', xml: 'xml', webs: 'web services' } })(); i have added script tags body of _layout.cshtml file so: <body> <script type="text/javascript" src="angular.min.js"></script> <script type="text/javascript" src="about.js"></script> in about.cshtml file have code show 1 of tech items in about.js code: <div ng-app="myapp" ng-controller="tecknologiescontroller tech

c# - How do I wire up an IAspectProvider so that PostSharp will use it? -

i've written class in c# implements postsharp's iaspectprovider interface. don't understand i'm supposed have it. can't seem find documentation on postsharp's site tells me class once it's written. does postsharp automatically find class because it's derived iaspectprovider , use it? or there link available page have far been unable find? fwiw, class provided below. ( methodtracingaspect our custom aspect we're using training.) namespace loggingsample { using system; using system.collections.generic; using system.linq; using postsharp.aspects; internal class provideraspect : iaspectprovider { public ienumerable<aspectinstance> provideaspects(object targetelement) { var type = (type) targetelement; return type.getmethods() .where(m => type.isassignablefrom(typeof(ireportbuilder)) && m.ispublic

php - How to render a partial view into 2 different DIVs, after AjaxSubmitButton on Yii? -

does know how render 2 different partials 2 differents div's in same page, after pressing chtml:ajaxsubmitbutton , using same controller? i've searched around web far didn't find me. thanks help. you don't need ajaxsubmitbutton() . ajaxbutton() sufficient. in view: <?php echo chtml::ajaxbutton('click me', array('mycontroller/myaction'), array( 'datatype' => 'json', 'success' => 'js:function(res) { $("#div1").html(res.div1); $("#div2").html(res.div2); }', )); ?> in controller: public function actionmyaction() { echo json_encode(array( 'div1' => $this->renderpartial('div1', null, true), 'div2' => $this->renderpartial('div2', null, true), )); }

objective c - iOS: NSXMLParser - A lot of attributes -

i know there lot of answers here , on google stuck since 3 days figuring out how handle problem. hope can give me advice. all content in xml attribute. parse attributedict . trying handle attributes (void)parser:(nsxmlparser *)parser didstartelement.... , display them later in tableview. i have put attributes nsmutablearray , want display device name , channels , value of datapoint. later change value of daterpoint button. not sure if best way trying. found post nspredicate . right way? lot in advance! nsxmlparser delegates handling attributes this code: - (void)parser:(nsxmlparser *)parser didstartelement.... if(![elementname isequal:@"device"]) return; name = [[nsmutablearray alloc] init]; nsstring * name = [attributedict objectforkey:@"name"]; [name addobject:name]; if(![elementname isequal:@"device"]) return; namedatapoint = [[nsmutablearray alloc] init]; nsstring * datapoint = [attributedict o

c# - Getting Connection lost contact even though a new connection is created -

i'm writing asp.net web application. database oracle. i've noticed if leave application open while without doing , try access database "ora-03135: connection lost contact" error. 1 reason can think of first connection timeout create fresh new connection, open it, need , "finally" close every time access database. what's more interesting after error, don't have problems more connecting database. have ideas problem might be? are using connection pool? in case can behaviour because oracle connection pool returns "disconnected" connection. try adding validate connection=true; connection string.

php - Magento: modify free shipping method label with various shopping cart price rules -

i need setup free shipping in magento catalog 3 shopping cart price rules, , need label of "free shipping" different in each scenario. know how modify label instances of free shipping globally via configuration/shipping methods/free shipping editing title , method name fields, want control title , method name depending upon shopping cart price rule applies. example: shopping cart rule 1 returns "title 1, method name 1, $0.00" shopping cart rule 2 returns "title 2, method name 2, $0.00" shopping cart rule 3 returns "title 3, method name 3, $0.00" use following custom script $quote=mage::getsingleton('checkout/session')->getquote(); $data=$quote->getshippingaddress()->getallshippingrates(); foreach($data $_rate){ if($_rate->getcode()=='freeshipping_freeshipping'){ $_rate->setcarriertitle('new carrier name'); /* new carrier title here */ $_rate->setmethodtitle('new me

Tomcat or Jetty for Java server application -

suppose have design server process concurrent independent http requests. processing cpu-bound (no database involved). requests relatively small (1-10k) , latency important (the less better). number of concurrent requests , "rate' (requests per second) still unknown. we going develop server in java. should use tomcat or should use embedded http server (e.g. jetty) part of application? either 1 satisfy stated requirements. tomcat require install - or can embedded; jayan correction. jetty can embedded or run in stand-alone mode. choose on basis. but if you're setting centralized server, might consider netty on both. nio might throughput. per joakim erdfelt below, jetty uses nio well. thank education , correction. don't know if tomcat has followed suit.

YouTube API "published" filter doesn't seem to work -

i'm trying use youtube api return videos published, filter i'm using doesn't seem work expected. this api call returns 2 videos whereas there should tons more published after march 1st: https://gdata.youtube.com/feeds/api/videos?q=&fields=entry[xs:datetime(published)%20%3e%20xs:datetime('2013-03-01t12:00:00.000z')] however, if add query string, many more results returned. example: https://gdata.youtube.com/feeds/api/videos?q=surfing&fields=entry[xs:datetime(published)%20%3e%20xs:datetime('2013-03-01t12:00:00.000z')] anyone know why? there approach should using me latest videos published regardless of query string? i understand confusion, that's not fields= parameter used for. documentation should clear things up, summarize, using fields= in manner equivalent making request without fields= parameter , filtering results of request includes entries match filter. so if request without fields= return 25 specific v

jquery - Tab validation in mvc3 -

im using mvc3 application jquery validation. have disabled hidden field validation in jquery.validate.unobtrusive.js using ignore: ":hidden". i have 2 tabs in application. when click submit, tab highlighted gets validated though have tab, fields not getting validated there on tab. decided use javascript function input fields on tabs , validate them. function nextonclick() { (var = 0; < 4; i++) { $('input', '#tab' + i).valid(); } } however when validate method called gives me error form null or not object what doing wrong here? there other approach tab validation in mvc3, other eager validation? want validation on form submit. thanks!

JSON to Object - JavaScript -

i trying take json list formatted such: (real list has on 2500 entries). [ ['fb.com', 'http://facebook.com/'] ['ggle.com', 'http://google.com/'] ] the json list represents: ['request url', 'destination url'] . redirect audit tool built on node.js. the goal put json value pairs in javascript object key value array pair such: var importedurls = { requesturl : [ 'fb.com', 'ggle.com' ], destinationurl : [ 'https://www.facebook.com/', 'http://www.google.com/' ] } due sheer amount of redirects, prefer nonblocking solution if possible. you first need create object: var importedurls = { requesturl: [], destinationurl: [] } now, let's have data in array called importeddata la

Use of the event keyword in c# -

i wondering exact use of events in c#. still in process of learning c# maybe missing possible use delegates. in example wrote class method counts 0 2^64 , every time reaches multiple of thousand raises event. here code: namespace eventdelegate { class program { static void main(string[] args) { eventraiserclass _eventraiser = new eventraiserclass(); _eventraiser.handler = someeventhandler; _eventraiser.handler += anothereventhandler; _eventraiser.loop(); console.read(); } static void someeventhandler(object sender, eventargs args) { console.writeline("event raised"); } static void anothereventhandler(object sendr, eventargs args) { console.writeline("event raised (another handler)"); } } public delegate void handler(object sender, eventargs args); class eventraiserclass { public handler handler; public void loop() { (long = 0; < int64.maxva

.net - ActiveX COM in C#: how to bind C# events method to VBS sub -

let have need create activex com via c#. reason need work sdk, implemented in c# , provided 3d party vendor. have been following great examples here in create activex com c# , load via class id in .aspx. succeed calling new com method when clicks on button web page. now problem that, of new com methods use async callback functions wait vendor response. example in new com method hello(), there corresponding callback function, onhello(), triggered when com dll receives response vendor. my question is, how can bind onhello() function call web page vbs sub such newcomid_onhello(), can display on web page notify user. don't want use busy-waiting check infinitely. this simple in c++ can try map call function vbs via .idl file etc, or begin_connection_point_map, etc. not sure how can in .net/c#. i've tried use comsourceinterfaces, still no way find out how trigger particular vbs sub when 1 of new com method, such onhello() triggered vendor response. or, doable? know msft a

highcharts - How to drag select multiple columns on highstock chart and have it reflect on the navigator? -

i have 2 goals. first able disable default dragging on main chart, , using drag , multiple select on columns. second want know if possible reflect selection on navigator bar under main chart. please advise. thanks this possible using point.select() , chart.events.selection event. here sample config: chart: { renderto: 'container', type: 'column', panning: false, zoomtype: 'x', events: { selection: function (e) { var xaxis = e.xaxis[0], flag = false; // first selected point should deselect old ones if(xaxis) { $.each(this.series, function (i, series) { $.each(series.points, function (j, point) { if( point.x >= xaxis.min && point.x <= xaxis.max ) { point.select(true, flag); if (!flag) { flag = !flag; // other points should include previous points } }

Swagger - nested $ref not working -

i not able nest $ref files in swagger 2.0. i trying define api where-in have provided first $ref statement: definitions: collection-response: type: "object" properties: response-status: $ref: './schema/response-status.schema' the response-status.schema separate file in schema folder. response-status.schema defined below: { "type": "object", "properties": { "http-code": { "type": "integer", "description": "http-code being returned", }, "error-block": { "$ref": "error-block.schema" } } } now swagger-ui not able take second nested $ref, in case file error-block.schema please help. wrong way of doing things? do in case have such nested references?

php - how to user login my site with their facebook username and password.? -

my site have login facility. login once have registration in site. if user dont want registration in site. user can login facebook username , password. access site.. how possible..? you can facebook sdk [it code, can internet]. first create facebook application on developer.facebook.com use credentials in facebook sdk file.

java - Affine transforms for graph, not for text and labels -

Image
this post suite answer made question: transforming shape here image want: here image simple program produces, can see text rotated. want horizontal text: the canvas scaled, translated, rotated drawing, text not displayed horizontaly , font size need extremely reduced (1.4). program wrote in java (awt , javafx) problem not language or technology relevant, suggestion welcome. here simple program: import javafx.application.application; import javafx.geometry.vpos; import javafx.scene.scene; import javafx.scene.canvas.canvas; import javafx.scene.canvas.graphicscontext; import javafx.scene.layout.borderpane; import javafx.scene.paint.color; import javafx.scene.text.font; import javafx.scene.text.textalignment; import javafx.stage.stage; public class transrotscale extends application { private static void drawgraph( graphicscontext g ) { //--- g.scale( 10.0, 10.0 ); g.rotate( math.todegrees( math.atan2( -15.0, 40.0 ))); g.translate( -8, -10 );

php - Sanitize all except number, forward slash and $? -

i have entry form 'price', , want like: $250 full price /$230 booking to sanitized within database to: 250/230 or $250/$230 is possible either in php? i've tried: $formdata = ( isset( $_post['price-entry'] ) ? sanitize_html_class( $_post['price-entry'] ) : '' ); but strips except letters , digits. try $price = '$250 full price /$230 booking'; echo get_clean_price($price); function get_clean_price($price) { return preg_replace("/[^\d\/]+/", "", $price); }

ios - FBSDKLoginManager loginWithReadPermissions -

fbsdkloginmanager *loginmanager = [[fbsdkloginmanager alloc] init]; [loginmanager loginwithreadpermissions:@[@"email"] fromviewcontroller:self handler:^(fbsdkloginmanagerloginresult *result, nserror *error) { if (error) { // process error nslog(@"error"); } else if (result.iscancelled) { // handle cancellations nslog(@"is cancelled"); } else { // if ask multiple permissions @ once, // should check if specific permissions missing if ([result.grantedpermissions con

android - my application not save image -

my app crashes when press save button. have been following this tutorial . logcat showing error "unable open database file here code: import android.provider.mediastore; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.imageview; import android.widget.textview; import android.widget.toast; public class mainactivity extends activity implements onclicklistener { protected static textview textview; protected static imageview image1, image2; protected button get_image, save_image, read_image; private string selectedimagepath; private static final int select_picture = 1; string db_name = environment.getexternalstoragedirectory() + "/test.db"; string table_name = "mytable"; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_

ios - iPad doesn't detect shake-motion events -

Image
the simulator detects shake-motion event without problem. when run app on physical device (ipad 2) - nothing happening. starting doubt myself if know how shake it... i think have done necessarily: -(bool)canbecomefirstresponder{ return yes; } calling becomefirstresponder on view; and have implemented: - (void)motionended:(uieventsubtype)motion withevent:(uievent *)event; - (void)motionbegan:(uieventsubtype)motion withevent:(uievent *)event; do have suggestions? why working on simulator , nothing happening on device? this questions resembles situation: shake motion events not working doesn't me lot. i have found , 'fixed' problem. the device should set ipad or universal in order ipad detect shake motion. may obvious (but apparently have missed it) ... wanted produce sample application , have forgotten change default setting 'iphone' 'ipad'.

javascript - Prevent future date and today date using custom validator -

i'm developing project using entity framework in .net 4 . there page sign has field of date of birth. want validate date of birth cant in future or today. if 5 years compared today. here code. date of birth: <asp:requiredfieldvalidator id="rfv_txtbx_dob" runat="server" controltovalidate="txtbx_dob" cssclass="validator" display="dynamic" errormessage="date of birth required" setfocusonerror="true" text="*" validationgroup="vg" /> <asp:customvalidator id="cv_txtbx_dob" runat="server" controltovalidate="txtbx_dob" cssclass="validator" display="dynamic" errormessage="date of birth cannot today or in future" setfocusonerror="true" text="*" validationgroup="vg" clientvalidationfunction="validatedate"/> <asp:textbox id="txtbx_dob" runat="server" cssclas

iphone - Connection issue of Xib and created outlets -

i have 2 seprate projects , both having viewcontroller classes same name . import 1 projects file in other xib,i changed second class xib name , running fine . when in xib objects in xib not showing refrence outlets created in .h class. please me in situation . click file's owner in xib wants referenced , select or write class name appropriate class select file's owner click identity inspector(3rd tab on inspector view) select or write appropriate class names under custom class. after this, reference add on .h file show on it.

javascript - ng-repeat not outputting results -

i'm still new @ learning , though had right, i'm unable output fruits in first app. i'm using ng-repeat= "foods in body.fruits" output, nothing showing. ideas? <!doctype html> <html ng-app="app"> <head> <title>bootstrap 3</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script type="text/javascript" src="angular.min.js"></script> <script type="text/javascript" src="app.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mtjoasx8j1au+a5wdvnpi2lkffwweaa8hdddjzlplegxhjvme1fgjwpgmkzs7" crossorigin="anonymous"> <link href="index.css" rel="stylesheet" type="text/css"> <link rel="stylesheet" hr

ios - How to create a grouped TableView without using a TableViewController -

i have uitableview , have 2 sections. know can have grouped sections if you're using uitableviewcontroller , if you're using static cells, neither of am. want possible? if can turn on setting up. seems every tutorial have found example of using uitableviewcontroller. setting tableview's style property .grouped , return 2 numberofsections... -method should yield result. standard approach fail?

How to get the json result from struts2 action methode thru ajax(Using jquery) -

i have used below code display countrycode in front end onchange of country dropdown thru ajax.but not able json result action class front end. can 1 me out resolve problem ?. struts.xml file: <result-types> <result-type name="json" class="com.googlecode.jsonplugin.jsonresult"/> </result-types> <action name="populatecountrycode" class="com.custregnmanageraction "method="populatecountrycode"> <result name="success" type="json"> <param name="root">jsondata</param> </result> </action> action class method: public string populatecountrycode() throws exception { jsondata = new hashmap<string, string>(); try{ if(!getcountry().equals("") && getcountry()!=null){ list<country> countrycodenew =(list<country>) custregnmanagerservice.getcountrycode(getcountry());

c# - Check if number is prime number -

i ask if correct way of checking if number prime or not? because read 0 , 1 not prime number. int num1; console.writeline("accept number:"); num1 = convert.toint32(console.readline()); if (num1 == 0 || num1 == 1) { console.writeline(num1 + " not prime number"); console.readline(); } else { (int = 2; <= num1 / 2; a++) { if (num1 % == 0) { console.writeline(num1 + " not prime number"); return; } } console.writeline(num1 + " prime number"); console.readline(); } var num1; console.writeline("accept number:"); num1 = convert.toint32(console.readline()); if(isprime(num1)) { console.writeline("it prime"); } else { console.writeline("it not prime"); } public static bool isprime(int number) { if (number == 1) return false; if (number == 2) return true; if (number % 2 == 0) return false; var boundar

Import Historical Records from Excel to Custom App -

i need bit of help. company has data in multiple excel sheets. sheets straight forward (in map data types). of them merged rows , cells etc within 1 header. developing application in c# maintaining massive database proper user , role management , multiple departments stake holders. i have identified relations within excel sheets , well. cannot understand how import historical data map data tables? basically, when new custom system designed, how import senseless data within it? the thing think of writing utility program reads every row , every cell of excel sheets , extract required values insert proper database table. take ages due numerous number of excel sheets. wondering of went through same thing have?how did or handle this? many guys :) if data not regular, you've got world of pain ahead of you. object model in excel can driven of windows scripting host languages, vbscript , jscript. in fact, scripting languages have support excel traversal. however, you

Can structure always end with a semicolon in C -

here have 2 structures. first is: struct complex { double real, imaginary; }; which know must end semicolon. but 1 function struct complex add_complex(struct complex c1, struct complex c2) { struct complex c3; c3.real = c1.real + c2.real; c3.imaginary = c1.imaginary + c2.imaginary; return c3; } here if don't include semicolon @ end, compiler generate no error. why? a structure definition must have semicolon @ end. you'd compiler error if removed ; struct complex definition. the second 1 ( add_complex )isn't structure definition, it's function returning structure. functions don't have semicolons @ end of them. i mean, if write struct complex add_complex() { }; 1 true. why? it being "ok", depends on compiler. compilers i've used (gcc , micosoft's example) allow this, can made display warning/error correct flags (adding -pedantic gcc give: warning: iso c not allow ‘;’ outside of function [

c++ - Reading any file (not .bin file) byte by byte -

i want read any file (.bin, .txt, .jpg, .zip, .mp3 etc.) byte byte (or bit bit) , display on console (in format 00100011). there questions answered in website .bin files. should not matter file format work with. example, when open .png file in text editor, see weird characters on screen "∑p®pt™5à*" , presume these every 8 bits of file turned ascii letters , displayed on editor (please correct me if wrong). i writing program in c++ , far tried fstream file("foo.txt", ios_base::binary); to read file in binary mode , 8 bits of chunks, works .txt files , displays characters in text file do. not work or open other file formats .png . can hints how can achieve this, , please correct me if gave wrong information. you assigning values "char" datatype. should use unsigned types ("unsigned char" should suffice case) because there no negative values binary files , able read 0-255 instead of 0-127(text characters). then, if want disp

java - Play Resumable Upload Permissions Error -

i can't find cause of error occurs when upload file using play scala , resumable.js: thread "application-akka.actor.default-dispatcher-3": controllers.resumable$$anonfun$dopost$1.apply(resumable.scala:44) some(resumableinfo) resumableparams =>: resumableinfo(authorname,1048576,1430174,1430174-allegrofromduetincmajormp3,allegro duet in c major.mp3,allegro duet in c major.mp3,/allegro duet in c major.mp3.temp) [error] p.c.s.n.playdefaultupstreamhandler - cannot invoke action java.io.filenotfoundexception: /allegro duet in c major.mp3.temp (permission denied) @ java.io.randomaccessfile.open0(native method) ~[na:1.8.0_71] @ java.io.randomaccessfile.open(randomaccessfile.java:316) ~[na:1.8.0_71] @ java.io.randomaccessfile.<init>(randomaccessfile.java:243) ~[na:1.8.0_71] @ java.io.randomaccessfile.<init>(randomaccessfile.java:124) ~[na:1.8.0_71] @ controllers.resumable$$anonfun$dopost$1.apply(resumable.scala:46) ~[classes/:na

Split before decimal in django -

i have variable fetches data database {{i.rewardpoints}} and values returns such 1.799 or 12 db has multiple values contains decimals , without decimals but need show values without decimals how can this to round nearest integer: {{ i.rewardpoints|floatformat:"0" }} to integer part: {{ i.rewardpoints|stringformat:"d" }} the floatformat filter documentation the stringformat filter documentation in [19]: tpl = template('{{ x|stringformat:"d" }} {{ x|floatformat:"0" }}') in [20]: tpl.render(context({'x': 1.1})) out[20]: u'1 1' in [21]: tpl.render(context({'x': 1.9})) out[21]: u'1 2'

What is the correct format to pass a javascript function parameter using the kendo ui framework? -

i have image links dynamically generated kendo datasource , need call function uses id... how format href call javascript function parameter? see attempt here: http://screencast-o-matic.com/watch/cifvlpvyuh thanks if replace anchor tag below <a href="javascript:getitems(${id})">...</a> then, getitems() method call. example, function getitems(value){ // use value wish } then, can 'id' value parameter.

ios - Send imessages without MFMessageComposeViewController -

i make own imessages message app. app ready dont know how send imessages without showing mfmessagecomposeviewcontroller. know there way. using in bytesms , other message.app alternatives. so there way so? thanks answer! it shouldn't submited appstore. app should submited cydia or other 3rd party stores. you can't tired send message in background using ctmessagecenter works me apple rejected app due using private framework (ctmessagecenter) so if want , wants upload app on appstore way use 3rd party webservice if dont want upload appstore can use ctmessagecenter surely works you #import <coretelephony/ctmessagecenter.h> [[ctmessagecenter sharedmessagecenter] sendsmswithtext:@"your message here" servicecenter:nil toaddress:@"receiver's phone number here"]; here post may looking send sms using core telophony?

Datepicker control: add +1 day at required check-out date in Using jQuery -

i need in jquery date picker have 2 textbox 1 check in , other check out ... want 1 day add in checkout box code , unable date in check out box 1 day ahead...plz help $("#checkindatepicker").datepicker({ defaultdate: "+1w", mindate: 0, changemonth: true, showon: "button", buttonimage: "/images/base/calander.png", numberofmonths: 2, showbuttonpanel: true, buttonimageonly: true, onselect: function (selecteddate) { var mindate = $(this).datepicker('getdate'); if (mindate) { mindate.setdate(mindate.getdate() + 1); } $("#checkoutdatepicker").datepicker("option", "mindate", mindate || 1); } $("#checkindatepicker").datepicker({ defaultdate: "+1w", mindate: 1, changemonth: true, showon: "button", butt

JQuery addClass SyntaxError: Unexpected token illegal -

what's wrong jquery code? in chromium browser, "uncaught syntaxerror: unexpected token illegal" in using jquery addclass. in advance. <!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> $(document).ready(function(){ var url = window.location.href; $('ul.menu li').each(function() { var $this = $(this); var suburl = $this.find('a').attr('href'); if(url.indexof(suburl) > 0) { $this.addclass("active");​ // **uncaught syntaxerror: unexpected token illegal** //alert("url=" + url + ", suburl=" + suburl); } }); $("button").click(function(){ $("ul.nav a.active").hide(); }); }); </script> </head> <body> <div> <p>list<p> <ul class="menu"> <li><a href="/test/jq_test.html&q

database - How to find top 10 sum of each match? -

i mean if have several x , several y , match this: x -[ w ]-> y with x , y related several w ( there can several w between same pairs (x,y) ) i want top ten x each y property sum(w.property) if return return y , sum(w.property) , x order sum(w.property) desc limit 10 i 10 need every y, is there way that? match x -[ w ]-> y y, sum(w.property) total, x order total desc y, collect({sum: total, x: x})[0..10] values unwind values value return y, value.sum, value.x you can skip unwind , change second with return if you're ok returning array. bit more efficient because you're not repeating values of y on , over. if going change map structure array this: collect([total, x])[0..10]

json - Prettify stringified object in javascript to serve in a static html page -

i'm trying use code prettify json object retrieved service , return in static page (has be). the javascript functions work i'm having issues dealing stringified object. it works fine encoding example before return statement html json = "{\"a\":\"b\",\"c\":\"d\"}" and not using stringify not using json.stringify real json object instead. function getstaticresponse(jsonobjectretrieved){ return '<html>' + '<head>' + '<title>' + 'title' + '</title>' + '<link rel="stylesheet" type="text/css" href="' + '/something' + '">' + '</head>' + '<body>' + '<pre class="json-output box bg-color-weight-6 font-calibri">' + jsonformat(json.stri

How to Allow Special Characters(#,@,!,&,(,),%) as search keyword in Sphinx -

i have got struck implementation of allowing special characters(#,@,!,&,(,),%) search keyword in sphinx.. please suggest me.. below config file, /* starts */ source dbserver { type = mysql sql_host = localhost sql_user = root sql_pass = sql_db = mydb #sql_sock = /var/run/mysqld/mysqld.sock sql_port = 3306 } searchd { listen = localhost:3312 # port = 9313 log = /* searchd.log path */ query_log = /* query.log path */ pid_file = /* searchd.pid path */ max_matches = 10000 seamless_rotate = 0 } source adsearch : mydbserver { sql_query_post = replace sph_tracker select 1,'ad',current_timestamp; sql_ra