Posts

Showing posts from May, 2015

c# - Unable to get method SyntaxTree.ParseFile in new nuget of Roslyn? -

i have installed nuget roslyn install-package microsoft.codeanalysis -pre i'm still unable method syntaxtree.parsefile want pass code in .cs file any clue why ? how can pass file here? the api changed little bit, 1 way : var path = @"c:\...\somefile.cs"; using(var stream = file.openread(path)) { var syntaxtree = csharpsyntaxtree.parsetext(sourcetext.from(stream), path: path); }

Generic MongoRepository Interface for Multiple Documents in MongoDB -

here example on accessing person document mongodb. public interface personrepository extends mongorepository<person, string> @query("{ 'firstname' : ?0 }") list<person> findbythepersonsfirstname(string firstname); } if have 5 documents ex: person, family, relation. etc. need create 5 repositories , extend mongorepository or there way achieve in 1 mongorepository.

ajax - grails remoteField javascript -

i'm having trouble returning value view decides if submit button should selectable or not. i'm checking value of accnbr against api call returns json. simple want not if user found or not. a snippet within form on view - here account number input: <g:remotefield paramname="accnbr" action="validatecustomer" update="[failure: 'error']" bean="${accnbrinstance}" required="" size='40' name="accnbr" value="${accnbr}" data-trigger="change" data-required="true" data-regexp="[0-9]{12}" data-regexp-message="this field requires valid account number of 12 digits"/> then have js (which think has errors: function accountnoerror(){ if($('#accountvalid').html().value = "not found"){ $('#submit').attr("disabled", true); $('#clear_btn').show(); }else{ $('#submit').attr(

sql - Advanced hstore with postgresql -

in ruby on rails application have sql retrieve advanced data , convert sql output hash , update proper model record. in sql have line one: hstore(array_agg('some_key'::text), array_agg('some_value'::text)) loaded_user_data which after converting hash returns me: "loaded_user_data"=>"\"some_key\"=>\"some_value\"" but problem want have hash looks little bit different. example: loaded_user_data: { loaded: { count: 100, details: [] }, failed: { count: 2, details: ['duplicate', 'invalid_external_id']}, invalidated: {count: 1, details: ['requested client']} } is there way hstore?

Message - Cannot find installed version of python-django or python3-django -

i'm new ubuntu, , love far. have been trying install django website development project. in terminal, when start python interpreter , type import django django.version i face no issues , get (1, 8, 2, 'final', 0) then, start project, typed django-admin startproject trialsite and got message saying cannot find installed version of python-django or python3-django i installed django using pip install django==1.8.2 , installed django-admin package before using via apt-get. also, have been following django book guide through whole process. can tell me issue is? my /usr/local/lib/python2.7/dist-packages , site-packages both empty. don't know if important. according django book, django-admin should be. use following command , solved. sudo apt-get install python-django

Unable to understand this concept of handlers in c++ -

i going through piece of code when came across new. tried write own code better understanding. #include<iostream> using namespace std; class material { public: material() { cout<<"material() called"<<endl; } bool test_func() { cout<<"hello world"<<endl; return true; } }; class server { private: material *mat; public: server() { cout<<"server() called"<<endl; } material *matrl() { return mat; } }; class handler { public: handler() { cout<<"handler() called"<<endl; } server svr; bool demo() { bool ret; ret=svr.matrl()->test_func(); return ret; } }; int main() { handler h; cout<<"returned demo():"<<h.demo()<<endl; return 0; } even getting desired output, is: server() called handler() called hello world returned demo():1 but not able understand concept here : material *matrl() { return mat; } and fun

How to load a class function outside declaring class in Java Reflections -

i using java reflections api load functions dynamically variable.when calling functions in same class,the function calls working. now trying call functions outside declaring class.this code using. package com.test.controller; try { class cls = class.forname("com.test.actions"); system.out.println("trying method name"); java.lang.reflect.method method=cls.getmethod(action,string.class,httpservletrequest.class); system.out.println("got method name"+method); val=method.invoke(this, instinputtext,request).tostring(); } catch(exception e){e.printstacktrace();} i trying acess different class , functions , following error. java.lang.illegalargumentexception: object not instance of declaring class the exception because of line val=method.invoke(this, instinputtext,request).tostring(); . you passing this instance call, means perform this.method() . instead need create instance of class actions , use

neo4j - SDN4: Recent snapshot build broken -

just started getting following exception while starting server: error creating bean name 'myrepository': invocation of init method failed; nested exception java.lang.noclassdeffounderror: org/springframework/data/mapping/context/invalidpersistentpropertypath: org.springframework.data.mapping.context.invalidpersistentpropertypath what changes have caused exception? thanks. i using gradle , experiencing exact same issue. invalidpersistentpropertypath seems have been introduced in latest snapshot build of spring-data-commons (1.11.0.build-snapshot). project includes spring data jpa relies on more stable version (1.11.0.m1). gradle did conflict resolution , went m1 library, not have new class , resulted in noclassdeffounderror . for now, working around telling gradle ignore spring-data-commons transitive dependency of jpa snapshot build being pulled in transitive dependency of sdn used: compile("org.springframework.data:spring-data-jpa:$springda

jquery - How to add Highcharts low and high data series using javascript -

i trying create graph represents schedule of our store using highcharts. that, use columnrange start , end time store open. but i'm stuck on how can push data using array , json. here's want achieve. made mock-up hard coded data; jsfiddle: http://jsfiddle.net/rds_a/lscqugbp/3/ code: $(function () { window.chart1 = new highcharts.chart({ chart: { renderto: 'container1', type: 'columnrange', inverted: false }, title: { text: "store schedule" }, xaxis: { categories: ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'yesterday','today'] }, yaxis: { min: 0, max: 24, categories: ['01','02','03', '04','05', '06','07', '08', '09','10', '11',

jquery - Buttons changing position on full-size -

Image
i'm using flexslider, , edited buttons in following form: however keep position (which correct position) on window re-size. when putting window on full size, button animation , placed follow: how fix them in same position on full-size when window re-sized. ps: jsfiddle : http://jsfiddle.net/v8hgwg8k/ if re-size result window you'll notice problem. html: <!doctype html> <html> <head> <title>the mode website template | home :: w3layouts</title> <link rel="stylesheet" href="../sss/woothemes-flexslider-83b3cae/flexslider.css" type="text/css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script src="../sss/woothemes-flexslider-83b3cae/jquery.flexslider.js"></script> <!-- place in <head>, after 3 links --> <script type="text/javascript" charset="utf-8"> $(window).load(func

ios - Core Data filter to many ordered relationship with predicate -

i have core data model task , list, list has to-many ordered relationship task, , task has inverse to-many relationship list. need retrieve tasks given list in correct order, filtered match predicate. example, if priority field on task, nspredicate* predicate = [nspredicate predicatewithstring:@"priority == high"] list* list; // fetched i can accomplish nsarray* alltasks = list.tasks; nsarray* sometasks = [alltasks filteredarrayusingpredicate:predicate]; but requires pulling tasks memory. fetch tasks directly nsfetchrequest* req = [[nsfetchrequest alloc] initwithentityname:@"task"]; [req setpredicate:[nspredicate predicatewithformat:@"list == %@ , priority == high", list]]; nsarray* sometasks = [context executefetchrequest:req error:&error]; but task order not preserved. is there way filter relationship fault predicate? i think following method work, though inefficient: fetch required tasks using desired predicate, ens

wso2esb - Validation error with WSO2 ESB generated WSDL -

i created proxy service wso2 esb 4.8.1 using complex wsdl using wsdl import , lot of schema imports. can import original wsdl soapui not 1 generated proxy service. wsdl validation gives error error - rpcmessagereceiver wsdlexception (at /wsdl:definitions/wsdl:message 1 /wsdl:part): faultcode=unbound_prefix: unable determine namespace of 'null:updateconsumerbydms_v1'. i found similar problem https://wso2.org/jira/browse/carbon-12030 . how solve problem? appreciated. best regards, teemu i think on using original wsdl proxy parameters <parameter name="useoriginalwsdl">true</parameter> <parameter name="modifyuserwsdlportaddress">true</parameter> wso2 esb alters wsdl keep original wsdl file in registry, lets in conf/myresources folder , use below after target. <publishwsdl key="conf:myresources/<wsdl_file>.wsdl"/> <parameter name="useoriginalwsdl">true</paramet

database - How combine user device data and fact table design? -

it needed store following information: user device data device id, device brand, screan size, type (pc, tablet, mobile). actual facts, odrder id, total cost, goods count, goods ids etc. how put user device data - fact or dimension table? if put fact table, have lot of duplicates, e.g. each row have cotained detailed information device, same 1 user. if put dimesion table, have update dimension table - add new device or update older. important note here analytical system designing not analyze user behaviour, see data not gather. there can situation when different application versions provide different "fullness" of information - 1st version gather 50% of user device, 2nd - 75%, 3rd - 99%. have update (not insert) data in devices table. you need @ least 2 dimensions i.e. user , device snowflake schema. user dimension should reference device table device id. user keep list of users. use foreign key reference device table(on device id). might go

javascript - Why Python datetime and JS Date does not match? -

i have code, returns utc offset given date: >>> import datetime >>> import pytz >>> cet = pytz.timezone("europe/moscow") >>> cet.localize(datetime.datetime(2000, 6, 1)) datetime.datetime(2000, 6, 1, 0, 0, tzinfo=<dsttzinfo 'europe/moscow' msd+4:00:00 dst>) >>> int(cet.localize(datetime.datetime(2000, 6, 1)).utcoffset().seconds/60) 240 ok, in js using code ( http://jsfiddle.net/nvn1fef0/ ) new date(2000, 5, 1).gettimezoneoffset(); // -180 maybe doing wrong? , how can plus-minus before offset (like in js result)? on system both python , javascript produce same result (modulo sign): >>> datetime import datetime, timedelta >>> import pytz >>> tz = pytz.timezone('europe/moscow') >>> dt = tz.localize(datetime(2000, 6, 1), is_dst=none) >>> print(dt) 2000-06-01 00:00:00+04:00 >>> dt.utcoffset() // timedelta(minutes=1) 240 and new date(200

wix - Second elevation dialog -

i have simple application in i'm installing exe , running @ end of installation. when installation finished shows second elevation dialog app.exe don't want show, here wix code. <?xml version="1.0" encoding="utf-8"?> <!-- following 3 sections how to: add file installer topic--> <directory id="targetdir" name="sourcedir"> <directory id="programfilesfolder"> <directory id="applicationrootdirectory" name="my application name"/> </directory> </directory> <directoryref id="applicationrootdirectory"> <component id="app.exe" guid="12345678-1234-1234-1234-222222222223"> <file id="app.exe" source="mysourcefiles\app.exe" keypath="yes" checksum="yes"/> </component> </directoryref> <feature id="mainapplication" title="main a

httprequest - Sending a post in android with bad encoding -

i'm sending post content server android. problem data @ server arrives wrong, encoding problems, example "{" arrives "%7b%". this code android: requestparams params = new requestparams(); params.put("alta", "{s}"); string ruta = "http://www.something.com/receive"; client.post(ruta, params, new asynchttpresponsehandler() { @override public void onsuccess(string response) { } } the server part receiving data, like: $data = $this->request->data; $data =file_get_contents('php://input'); this issue not directly related text encoding per se. as can seen docs requestparams , text values directly included in url. text included in urls has encoded include characters allowed in urls (ascii), text url encoded . asynchttpclient automatically encoding in background, receive strings in encoded form on php side. in order original text sent, can use

Linux How to check process scheduling policy & Priority? -

i want check scheduling policy & priorities of threads without programming it. is there way top or other command ? in top, can see pr column (which priority) how can scheduling policy ? thanks you can find looking on /proc/<your_pocess_id>/sched. for example: awk '/policy/ {print $nf}' /proc/8888/sched that should return policy process id 8888 you try chrt -p 8888

swift - When i try to apply "Font" to one tableview cell it automatically apply to other cells when scroll tableview -

i have custom tableview. i need set bold italic (helvetica-boldoblique) font cell.but when scroll tableview apply other cells 1 one.how solve this? func applyfonttotableviewcell() { var couin = nsindexpath(forrow: 2, insection: 0) var coucell = colortableview.cellforrowatindexpath(couin) coucell?.textlabel?.font = uifont(name: "helvetica-boldoblique", size: 18.0) } i tried same code in cellforrowatindexpath also.but same issue occured. thanks in advance. you can applied bold font on alternative cell bellowed way. func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let coucell = tableview.dequeuereusablecellwithidentifier(textcellidentifier, forindexpath: indexpath) uitableviewcell let row = indexpath.row if row == 2 || row == 4 || row == 6 { coucell?.textlabel?.font = uifont(name: "helvetica-boldoblique", size:

the read only property is not able to disable using jquery -

this question has answer here: disable/enable input jquery? 9 answers in jquery according condition make 1 field read below code $("#name").attr("readonly", true); it working fine but when try disable using below codes $("#name").attr("readonly", false); or $("#name").attr("disabled", false); it not getting disabled. how can achieve it the value of disabled attribute not matter. if in attribute list, element disabled regardless of whether false or true or empty . need remove attribute enable back. use $("#name").removeattr('disabled') re-enable element.

html - Centered text being pushed over CSS -

i'm going make question applicable viewers. question: how can keep centered div centered relative header, , have div @ same time side , not pushing centered div over? whenever add header, centered title being pushed over. don't understand why happening since css supposed relative parent. css code: #logout_link { margin-right:0; text-align:right; float:right; } #centered { text-align:center; } php/html code: <div id='header'> <div id='centered'>centered title</div> <div id='logout_link'> logout </div> </div> try one. <style> #header{ width:100%; overflow:hidden; } #logout_link { margin-right:0; text-align:right; float:right; width:20%; } #centered { text-align:center; width:80%; float:left; } </style> <div id='header'> <div id='centered'>centered title</div> <div id='logout_link'> logo

mysql - Copy last N characters of SQL column in another column (AKA I messed up!) -

i messed big time: added 2000 images phoca gallery , instead of leaving "title" field empty, use filenames title, wrote name of category... renaming each 1 manually pita, i'm sure can done in sql, except don't know how. what have is: (15574, 1379, 0, 'thursday, 25.6.', 'thursday-25-6', 'competitions/hrprvprj/25.6/120/vucemilo_filip/_mg_5545.jpg', 1, null, '2015-07-01 16:55:11', 0, '', '', 0, '', 0, null, 0, 212111, 1, 1, 0, '0000-00-00 00:00:00', 13, null, null, null, null, null, null, '', 0, '', '', '', '', '', '', '*'), and i'd need is: (15574, 1379, 0, '_mg_5545.jpg', '_mg_5545.jpg', 'competitions/hrprvprj/25.6/120/vucemilo_filip/_mg_5545.jpg', 1, null, '2015-07-01 16:55:11', 0, '', '', 0, '', 0, null, 0, 212111, 1, 1, 0, '0000-00-00 00:00:00', 13, null, null,

batch file - how to escape every character up to a point? -

situation : i want variable contain command can execute doing : %command% tries : set command=echo file used cleaning executable ^>^> dummyfile %command% this works, have specific editing each command... isn't there take after = symbol quote? set command="echo file used cleaning executable >> dummyfile" %command% then command not recognised because of quotes your idea quoting not bad: set "command=echo file used cleaning executable >> dummyfile"

html - CSS - Curved Corner after using border-left and border-bottom -

Image
i have used border-left , border-bottom create sort of 1 sided parallelogram shape bootstrap navbar, need right side curved while keeping left side transparent. current outcome: wanted outcome: i have tried using border-top-right-radius nothing happens: .navbar { position: relative; min-height: 50px; margin-bottom: 20px; border: 1px solid transparent; height: 20px; width: 100px; border-bottom: 50px solid rgba(58, 162, 178, 0.5); border-left: 50px solid transparent; /* tried */ border-top-right-radius: 2em; } i have made jsfiddle here: http://jsfiddle.net/6qfbhxty/ in example blue bar bottom border. won't work because can't give "end" of border curved look. you try apply blue color background , use :before create triangle. please notice apply same color background , border! body { background-image: url("http://lorempixel.com/800/800/abstract"); background-attachment: fixed;

java - How to open local text file with JavaFX WebView -

Image
is possible open local text file javafx webview ? have try following code not working. how can make enable this? thanks. webview wv = new webview(); wv.getengine().setcreatepopuphandler(new callback<popupfeatures, webengine>() { @override public webengine call(popupfeatures p) { stage stage = new stage(stagestyle.utility); webview wv2 = new webview(); stage.setscene(new scene(wv2)); stage.show(); return wv2.getengine(); } }); wv.getengine().loadcontent("<a href="file:///c:\users\dev\infor.txt">open file</a>"); stackpane root = new stackpane(); root.getchildren().add(wv); scene scene = new scene(root, 300, 250); primarystage.settitle("hello world!"); primarystage.setscene(scene); primarystage.show(); yes, can open local text file javafx webview. sample app: import javafx.application.application

php - A non well formed numeric value encountered while using fmod -

i new in php using fomd function. if ($time_long > 8){ $z=8; $q= fmod($time_long,$z); $x2=$q; i getting modulus fine notice saying non formed numeric value encountered suggerstion in code every thing looks perfect. problem $time_long variable. passing string value if function. read fmod() function well. so check that, use print_r($time_long); die(); this print content of variable. so come $time_long = 15//integer value if ($time_long > 8){ $z=8; $q= fmod($time_long,$z); $x2=$q;

How to use single player for both ads and video using google android Exoplayer -

currently in given exoplayer demo app google using 2 exoplayers play ads , video. have problem of video overlapping while playing pre roll , mid roll ads. avoid want use 1 exoplayer play both ads , video. has tried using single exoplayer?

python - While loop multiple conditions not working -

i tried add condition if while loop meets "y" or "y" still move letters end, keep "y" or "y" @ beginning, yet loop end , add "ay" print("pig latin translator test!") name = raw_input("what name, friend?") if len(name) > 0 , name.isalpha(): print("hello!") else: print("that's not name!") word = raw_input("what word?") vowels = ("a", "e", "i", "o", "u", "a", "e", "i", "o", "u") ylist = ("y", "y") if word[0] in vowels: word = word + "yay" else: this section causing problems: while word[0] in ylist or (not vowels): word = word[1:] + word[0] word = word + "ay" print (word) the value of (not vowels) falsy because vowels truthy. you meant write: while word[0] in ylist or (word[0] not in vowels):

javascript - D3 chart Y axis line is not visible in some resolutions -

i have stacked bar chart similar link , graph plotted correctly problem y axis line invisible. if increase browser page size in example chart, can see @ resolution x, y axis lines , horizontal tick lines appear. x, y axis lines , horizontal tick lines appearing , disappearing subjected resolution of page. how solve this? i defining x , y axis below var yaxis = d3.svg.axis() .scale(y) .orient("left") .ticks(5) .ticksize(-width - 180, 0, 0) .tickformat(d3.format("$")); var xaxis = d3.svg.axis() .scale(x) .orient("bottom") .tickformat(d3.time.format("%b")); svg.append("g") .attr("class", "y axis") .attr("transform", "translate(0,0)") .call(yaxis); svg.selectall('.axis line, .axis path') .style({ 'stroke': '#ddd', 'fill': 'none', 'stroke-width': '1px' }); svg.append("g") .attr("class", "

Has IBsonSerializationOptions been removed from the latest C# driver of MongoDB? -

i have following source code in c# project, can built mongocsharpdriver version 1.8.3. after have upgraded mongodb c# driver 2.0.1, compile fails error indicating ibsonserializationoptions , datetimeserializationoptions classes (interfaces) cannot found, , checked namespaces in assembly, , seems types removed latest version of mongodb c# driver. public void apply(bsonmembermap membermap) { ibsonserializationoptions options = null; switch (membermap.memberinfo.membertype) { case membertypes.property: propertyinfo propertyinfo = (propertyinfo)membermap.memberinfo; if (propertyinfo.propertytype == typeof(datetime) || propertyinfo.propertytype == typeof(datetime?)) options = new datetimeserializationoptions(datetimekind.local); break; case membertypes.field: fieldinfo fieldinfo = (fieldinfo)membermap.memberinfo; if (fieldinfo.fieldtype == typeof(datetime) ||

android - Scroll layout containing listview -

Image
i have listview contains 600 elements, right above have 2 spinners use filter list. possible make when start scrolling down listview, first scroll entire page hide 2 spinners before start scrolling actual listview. (the red box framelayout) i've sketched out current layout along desired effect. start seeing 2 spinners, single list item use header listview, , listview itself. when start scrolling, want first spinners dissapear under toolbar, , start items scroll. is possible? if not, alternatives display list filtering controls while not occupying of screen? edit: i've started experimenting nestedscrollview, , sorta works. here layout: <android.support.v4.widget.nestedscrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="16dp"> <linearlayout android:layout_width="match_parent&q

asp.net - Scraping using Html Agility Package -

i trying scrape data news article using htmlagilitypackage link follows http://www.ndtv.com/india-news/vyapam-scam-documents-show-chief-minister-shivraj-chouhan-delayed-probe-780528 i have written following code below extract comments in articles reason variable atags returning null value code: var gethtmlweb = new htmlweb(); var document = gethtmlweb.load(txtinputurl.text); var atags = document.documentnode.selectnodes("//div[@class='com_user_text']"); int counter = 1; if (atags != null) { foreach (var atag in atags) { lbloutput.text += lbloutput.text + ". " + atag.innerhtml + "\t" + "<br />"; counter++; } } i have used xpath still same result //div[@class='newcomment_list']/ul/li/div[@class='headerwrap']/div[@class='com_user_text'] please me correct xpath extract comments

visual studio - Why is typescript telling me "Cannot compile external modules unless the --module flag is provided? -

Image
i getting typescript error message indicated in title above. included here 1 example of doesn't like... if click on error message takes me in iglobals definition below. export interface iglobals { homepageurl: string; loginpageurl: string; timeout: number; changed(url: string) } i using vs2013 these settings. no matter value choose "module system" still error. i'm running version 1.5.0 beta of typescript (which issue, not sure)... wrap code in module... module mymodule{ export interface iglobals { homepageurl: string; loginpageurl: string; timeout: number; changed(url: string) } }

How can I execute .bin file with assembly or C? -

i working on os. i've started building since a-day before yesterday. want know how can open .bin files c language or assembly. want open when os running , click button. i can use assembly or c. in general .bin files not executable high-level operating systems, since don't contain enough information (which why typical operating systems use other file formats programs; elf common). if os can run properly-prepared .bin files, know how make happen.

sql - Sorting jtable data from database by clicking on table header java -

i have created program connects server database , retrieves information based on search criteria entered user, placed jtable. the user able click on column headers of jtable , sort data accordingly. this code have unfortunately nothing when clicking on header: pst = conn.preparestatement(sql); rs = pst.executequery(); if (rs.next()) { tblr.setmodel(dbutils.resultsettotablemodel(rs)); tblr.setautocreaterowsorter(true); } else { joptionpane.showmessagedialog(null, "no matches found according search criteria. please make sure entered data correct."); } does line tblr.setautocreaterowsorter(true) not work in case? how can work? i found own error. i had not placed jtable in jscrollpane , therefore method not working.

html - responsive div and height % does not work -

i've got small problem when trying make div img background responsive. the div doesn't size of image : 540px-290px when resize browser 2 div not resize together. in each div have background image, want div responsive both 2 div don't full size, using % responsive. if use pixels not make responsive. that image how should div. http://imgur.com/v9oroud i using bootstrap framework html <div class="row index-banner"> <div class="col-xs-6"> <div class="latest-mobile"> <h1> releases?</h1> <p>we got </p> <p>find out more ></p> </div> </div> <div class="col-xs-6"> <div class="sponge-bob"> <h1>we have ....</h1> <p>let kids enjoy .</p> <p>find out more ></p> </div> </div> </div>

Correlating Java features with Wikipedia's definition of Polymorphism -

wikipedia states there 3 (major) types of polymorphism. correlating definition limited understanding of java polymorphism, mapping came - adhoc polymorphism - java function overloading (dynamic dispatch). parametric polymorphism - java generics. subtyping - java function overriding (static dispatch). is correct? references - 1. https://en.wikipedia.org/wiki/polymorphism_%28computer_science%29 2. polymorphism - define in 2 sentences ad-hoc polymorphism map method overloading (where method known @ compile time) is correct subtyping map to overriding (dynamic dispatch)

javascript - Problems when passing parameters of an Angular application for a Rails controller -

i have application made in angularjs, i'm having trouble reading parameters on server side. as i'm sending data: api.factory('authprovider', function($resource, env){ var baseurl = env.apiendpoint; return $resource(baseurl, null, { login: { method: 'post', url: baseurl+'sessions' } }); }); angular.module('tuneduc.controllers.admin',[]) .controller('admincontroller', function($scope, $location, authprovider) { var auth; $scope.login = function (credentials) { auth = new authprovider(credentials) auth.$login(function(res) { console.log('success'); }, function(res) { console.log(res.data.errors); }) } }); so parameters coming way on server: {"{\"email\":\"assdaf@adfasdf.com\",\"password\":\&

javascript - CKEDITOR remove element event -

i using ckeditor text, , want limited number of embed ( video , pictures ) can upload user, mean need count there, problem don't know count when video or picture delete white backspace. trying many way catch event change , key event key not track when press backspacing , remove element. , event change not see element removed or make comparation between actual data , previous data. try find undo implemented don't found. if have ideea can track when remove element please me. i found combination between change , beforecommandexec count number of oembed class , number of img tag, don't know if best practice moment posibility count elements.

c# - Crystal Report Viewer Error -

Image
using c# windows forms application i'm generating crystal report using following code. private void frmreportviewer_load(object sender, eventargs e) { using (reportdocument report = new reportdocument()) { string = (new system.uri(assembly.getentryassembly().codebase)).absolutepath; string b = path.getdirectoryname(a); string fullpath = path.combine(b, "..\\..\\reports\\dailyattendance\\rpt_dailyattendance.rpt"); dataset ds_attendance = new dataset(); ds_attendance = obj_daltimeattendance.getattendancereport(); ds_attendance.tables[0].tablename = "rpt_timesheet"; report.load(fullpath); report.setdatasource(ds_attendance); report.setdatabaselogon("cil_hr", "asd@123"); rptviewer.reportsource = report; rptviewer.displaytoolbar = true; rptviewer.refreshreport();

ant - Idea highlighting tags in build.xml as not allowed -

Image
my ide (idea) says: element 'property' not allowed here. and other elements not allowed too. project building successfully. how can fix this? it looks idea not recognizing file ant build file. fact <project> tag in red indicates is, pardon pun, root of problem. try following: got file > invalidate caches / restart (or application > invalidate caches / restart on mac) click invalidate , restart button on "invalidate caches" dialog let idea restart , re-index project. another thing check, although long shot, ant support plugin enabled in file > settings > plugins . if not solve issue, can please put cursor on <project> element , indicate error element.

ios - swift - UIImageWriteToSavedPhotosAlbum causes EXC_BAD_ACCESS -

i saving image in camera roll. when done, should make reference image in db. logic pretty simple class mydownloader{ let db : dbhelper = dbhelper.sharedinstance func downloadfilefromserver(){ let urlstring = "http://any-image.jpg" let url = nsurl(string: urlstring) let data = nsdata(contentsofurl: url!) let image = uiimage(data: data!) if(image == nil){ println("no downloaded image") } else{ // works no errors --> --> uiimagewritetosavedphotosalbum(image, nil, nil, nil); // never works --> --> uiimagewritetosavedphotosalbum(image, self, "image:didfinishsavingwitherror:contextinfo:", nil) } } func image(image: uiimage, didfinishsavingwitherror error: nserrorpointer, contextinfo:unsafepointer<void>) { if error != nil { // error feedback goes here } else{

Install LuCI on ubuntu instead of OpenWRT -

friends, i have linux board ubuntu trusty on - board has wifi, ethernet port , gprs modem well. in addition application running on it, looking install luci on can use linux board router , use luci gui router. dependencies of luci? are there other alternatives luci can try well? see gargoyle-router i'm unclear on how install on ubuntu well. i doubt luci work on openwrt - designed work openwrt configuration, scripts, etc. i'd imagine same gargoyle's web interface. one alternative wifiadmin , seems should work. use webmin . another option, of course, installing openwrt instead of ubuntu - runs on x86 hardware (i'm assuming here have x86 system) , give ability use luci , treat system appliance.

ios - apple LLVM 6.1 error Could not read profile: No such file or directory (after upgrade to XCode 6.4/7.0 beta2) -

i'm trying compile cordova project. project working fine xcode 6.3 , ios 8.3 phone. upgraded phone 8.4 stopped working. tried xcode 6.4 - got error. tried xcode 7.0 beta 2 - got error. search on google shows many have problem no solution. tried clean code, project->build for->generate optimization profile, restart computer, etc. noting help. it cordova's problem: fix it: remove both platform , plugins folders. cordova platform add ios add plugins again. don't forget select profile on project's first tab. same steps when trying remove plugin (never working ios).

Error:input is undefined Angular when Ajax request to get data from php -

i trying make ajax request php angular js. not getting data have sent php file. i'm getting error: error:input undefined my source: file app.js: (function () { var app = angular.module('myapp', ['ngroute']); app.config(function ($routeprovider) { $routeprovider .when('/', { controller: 'contentsctrl', templateurl: 'views/contents.php' }) .when('/jalse/:jalseid', { controller: 'recordsctrl', templateurl: 'views/jalse.php' }) .otherwise({redirectto: '/'}); }); }()); file view.html: <div class="content-panel"> <div class="content-panel-title"> <a href="#/records/" class="left"></a> <h2> {{jalse.contentdate }}</h2> </div> <div ng-repeat="jalse in records">

c# - Custom functions on data Selected from IQueryable? -

i have database i'm trying query via entity framework , select return data collection output object - while using iqueryable improve performance - , apply couple functions resultant data comes db query. one, can't use .tolocaltime() on datetime object it's not supported. error: linq entities not recognize method 'system.datetime tolocaltime()' method, , method cannot translated store expression. if try call other custom functions on returned data similar exception. here code below: iqueryable<databaseentitytype> query = context.myentities.where(c=> c.finished == true); db.myentities.orderbydescending(c => c.datecreated).select(c => new outputobject() { guid = c.guid, notes = c.notes, datecreated = c.datecreated.tolocaltime(), related = string.join("<br/>", c.relatedentities.select(c => c.tractnumber)), others = string.join("<br/>", c.otherrelatedentities.select(c => c.ow

ios - How to change border and icons in Search bar (Swift) -

i have this: http://postimg.org/image/ag29m3e7d/ and need http://postimg.org/image/4bacislw5/ i have create border or set image? how change search icons(magnifier , x icon) or change colors? sorry links cannot insert images here. to add borders use views layer property. self.searchbar.layer.bordercolor = uicolor.bluecolor().cgcolor self.searchbar.layer.borderwidth = 1 if want add corner radius searchbar: self.searchbar.layer.cornerradius = 3.0 self.searchbar.clipstobounds = true to change searchicon call following method on searchbar: self.searchbar.setimage(image, icon: uisearchbaricon. uisearchbaricon.search, state: uicontrolstate.normal) to change cross: self.searchbar.setimage(image, icon: uisearchbaricon. uisearchbaricon.clear, state: uicontrolstate.normal)

c++ - does av_read_frame add FF_INPUT_BUFFER_PADDING_SIZE? -

i'm using libav read mpeg stream. i'm using function av_read_frame() read frames packets: av_read_frame(pformatctx, &packet) i use function avcodec_decode_video2 decode packet frame. documentation of function avcodec_decode_video2 contains following warning: the input buffer must ff_input_buffer_padding_size larger actual read bytes because optimized bitstream readers read 32 or 64 bits @ once , read on end. end of input buffer buf should set 0 ensure no overreading happens damaged mpeg streams. i wanted know if function av_read_frame doesn't allocate additional ff_input_buffer_padding_size? thank you. yes, av_read_frame() adds ff_input_buffer_padding_size you. need care if use own demuxed data input avcodec_decode_video2(), e.g. if write own demuxers (like vlc or mplayer do).

php - Can you paginate a nested query with Laravel? -

is possible paginate nested query? user.php public function favoriteposts() { return $this->morphedbymany('app\post', 'favoritable', 'favorites') ->withtimestamps(); } profilescontroller.php public function posts($username) { $user = user::with(['profile', 'favoriteposts' => function($q){ $q->paginate(15); }])->whereusername($username)->firstorfail(); return view('profiles.posts')->withuser($user); } profiles/posts.blade.php ... {!! $user->favoriteposts->appends(request::except('page'))->render() !!} ... error call undefined method illuminate\database\eloquent\collection::appends() i ended using 2 queries. public function posts($username) { $user = user::with('profile')->whereusername($username)->firstorfail(); $posts = $user->favoriteposts()->paginate(15); return view('profiles.posts')->

c# - PDF995 set Product code to create 2 documents -

i have c# method needs create 2 documents separately using pdf995. simplified version: public void printdocuments(printdocument report1, printdocument report2) { printutility.setpdf995key(); // method set product code in registry. report1.print(); // pdf995 "save as" dialog box appears here. printutility.setpdf995key(); report2.print(); } in order create document , avoid having pdf995 advertising banners appear, first have set product code registry item. click on save in pdf995 save file dialog, product key blanked out, means have set product code again create second document. the problem is, save file dialog box displayed asynchronous / modeless dialog box, means code creates second document reached before user has had chance click on save first one. so now, though product code set second time, clicking on save first document blank out, , because program has passed call printutility.setpdf995key() method before printing second one, st

Extracting specific file from zip in matlab -

currently have zipfile containing several thousand .xml files, extracted folder 1.5gb in size. have function matches data specific files inside zip file. want read specific file , extract additional data. my question: there way extract these specific files archive without unzipping entire archive? the built in unzip.m function can used unzip entire file won't work thinking have use com interface or other approach. matlab version: r2013a while searching solutions found this: read data of csv file inside zip file without extracting contents in matlab but can't code in answer work situation edit: credit hoki , intelk zipfilename = 'hmdb.zip'; zipjavafile = java.io.file(zipfilename); zipfile=org.apache.tools.zip.zipfile(zipjavafile); entries=zipfile.getentries; cnt=1; while entries.hasmoreelements tempobj=entries.nextelement; file{cnt,1}=tempobj.getname.tochararray'; cnt=cnt+1; end ind=regexp(file,'$*.xml$'); ind=find(~cellfun(@

php - Bootstrap Toggle Navigation And AJAX working on Localhost, but not in webhosting and not working on my computer -

please me, some feature on website ( php ) not working on server , when im copying file of website new directory, can't work too. , when im trying upload database, can't work too. <!-- navigation --> <div id="cont-banner"> <div id="banner"> <a href="index.php"> <img class="banner-image" src="image/<?php setbrand();?>" alt=""> </a> </div> </div> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container" id="navigation-cont"> <!-- brand , toggle grouped better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1&qu

php - WooCommerce security on checkout -

i've been trying add kind of security, captcha or security question, checkout form. i've tried using php, add-ons, plugins, can't find works. guys know how can this? it's don't lot of orders bots. preferably in code. tried using $number = 2 //other wordpress/woocommerce code 'human' => array( 'label' => __( 'are human?', 'woocommerce' ), 'placeholder' => __( 'what 1 + 1?', 'woocommerce' ), 'required' => true, 'validate' => $number ), in woocommerce/includes/class-wc-countries.php wouldn't work: showed form, enter anything, , continue, if entered e.g. 324. you edit page form on: hide button until user enters captcha correctly, or answers math question properly: http://jsfiddle.net/robinvandernoord/pexhll2g <div id="place_order" style="display:none"> <but

c++ - Why can't I pass a type member of a class as a template parameter? -

i unable pass type member of class template parameter. example in following piece of code : std::array<int, 1> a; std::array<typename a::value_type, 1> a2; won't compile. what reason ? there workaround? a not type, hence can't apply :: it. can use decltype retrieve a 's type : std::array<int, 1> a; std::array<decltype(a)::value_type, 1> a2;

d3.js - D3 custom library - Collapsible Tree in Drupal 7 -

i trying create views taxonomies - collapsible tree ( http://bl.ocks.org/mbostock/4339083 ). i installed d3 modules, imported d3 libraries , started create custom library. created d3.[mynewlibrary].libraries.info file, [mynewlibrary].css , [mynewlibrary].js , uploaded under d3.[mynewlibrary] folder. however, went views , couldn't able select [mynewlibrary]. i wonder best way validate codes written in custom library , if views automatically add new custom library selection. i new d3. can provide help? here below js , css codes. thanks! /** *@file *javascript d3 collapsible tree library. */ (function($) { drupal.d3.collapsibletree = function (select, setting) { var vis = d3.select("#viz").append("svg:svg") .attr("width", 400) .attr("height", 300) .append("svg:g") .attr("transform", "translate(40, 0)"); // shift right // create tree "canv

ios - How to tell the difference between a Boolean and an NSNumber in CoreData -

i have parsing code i'm using serialising , deserialising objects our web service , i've hit bit of problem when serialising booleans. the serialisation looks this: - (nsdictionary *)dictionaryrepresentationwithmapping:(nsdictionary *)mappingdictionary { nsmutabledictionary *dictionary = [[nsmutabledictionary alloc]init]; (id key in[mappingdictionary allkeys]) { id value = [self valueforkey:key]; if ((value != [nsnull null]) && (![value iskindofclass:[nsnull class]]) && (value != nil)) { [dictionary setobject:value forkey:mappingdictionary[key]]; } } return [nsdictionary dictionarywithdictionary:dictionary]; } the problem when call valueforkey: on nsmanagedobject , add dictionary end value being set if calling: [dictionary setobject:@1 forkey:mappingdictionary[key]]; instead of: [dictionary setobject:@yes forkey:mappingdictionary[key]]; this means when turn json, in next stage,

Unable to connect to Microsoft band from Background Task -

i'm using ms band sdk version 1.3.10518 , when try init band client background task got: backgroundtaskhost.exe' has exited code 1 the crash happens after following line of code: dim bands = await microsoft.band.bandclientmanager.instance.getbandsasync() i'm able connect band main application on windows phone 8.1 developer preview. band build version: 10.3.3213.0 09 r i found solution related await in sub run, solution consists of using : taskinstance.getdeferral public async sub run(taskinstance background.ibackgroundtaskinstance) implements background.ibackgroundtask.run dim deferral = taskinstance.getdeferral dim bands = await microsoft.band.bandclientmanager.instance.getbandsasync 'other work ... end using deferral.complete() end sub in addition need user consent main application follow: bandclient.sensormanager.heartrate.getcurrentuserconsent thanks for: httpclient getasync fails i