Posts

Showing posts from August, 2013

pointers - Problems with free() function in C -

i have while loop inside for loop handle strings. here structure of code: char mystring[1000]; //initialize , maybe change mystring for(/*conditions*/){ while(/*conditions*/){ if(strchr(mystring,' ') == null){ break; } char *temp = malloc(sizeof(char) * strlen(mystring)); strcpy(temp,mystring); *strchr(temp,' ') = '\0'; strcat(mystring," "); strcat(mystring,temp); free(temp); } } sometimes, code works fine, process ends , returns 3 means there error (3 return value when try use null shouldn't example mypointer->example mypointer null). after tests, found out line causing problem free(temp); . tried replace if(temp != null){free(temp);} didn't change anything. tried declare temp char temp[1000] instead of malloc , take away free(temp); line still same thing. if take away free(temp); line , still use malloc problem solved instead there huge m

swift - Looping through every nodes name -

i have lot of objects in different positions in scene dae file, names like: "ball01, ball02... ball15" , make them example have physics body of own shape , in own position. there way automatically? you can use scnnode.childnodes(passingtest:) in combination scnnode.name find these nodes easily.

Different messages for CompletionException under different minor versions of Java 8 -

i different output same code snippet under different minor version of java. not able find related ticket on open jdk bug tracker. completablefuture<string> completablefuture = new completablefuture<>(); completablefuture.complete("xxx"); completablefuture.thencompose(str -> { completablefuture<string> completablefuture1 = new completablefuture<>(); completablefuture1.completeexceptionally(new exception("hello")); return completablefuture1; }).exceptionally(ex -> { system.out.println(ex.getmessage()); return null; }).get(); output under jdk 1.8.0_25: hello output under jdk 1.8.0_102: java.lang.exception: hello is newer 1 fix or regression? related ticket? there's bug report here discussing change. key in javadoc of completablefuture#thencompose returns new completionstage that, when stage completes normally, executed stage argument supplied function. see completionstag

Django Array contains a field -

i using django, mongoengine. have model classes inscriptions list, , want docs have id in list. classes = classes.objects(inscriptions__contains=request.data['inscription']).all() perhaps i'm missing something...but seems should using .filter() : classes = classes.objects.filter(inscriptions__contains=request.data['inscription'])

c++11 - Defined function returning const reference to class member and copy of the variable -

i still little bit confused returning const reference. probably, has been discussed, let's have following code did not find same: #include <vector> #include <iostream> struct { int datasize; std::vector<char> data; }; class t { public: t(); ~t(); const a& getdata(); private: dataa; }; t::t() : dataa{1} { } t::~t() { } const a& t::getdata() { return dataa; } void main() { t t; datareceivedcpy = {}; datareceivedcpy = t.getdata(); const a& datareceivedref = t.getdata(); std::cout << datareceivedref.datasize << std::endl; } what happens, when call datareceivedcpy = t.getdata(); is correct? point of view, , copy of requested struct made, right? on other hand, const a& datareceivedref = t.getdata(); returns reference object member, correct, unless t object not destructed. right? yes, understanding sounds correct. datareceivedcpy = t.getdata(); calls copy ass

html - Change selected option color of bootstrap-select (selectpicker) -

i can't color of selected option in bootstrap-select change.. think real simple, tried different things can't change. select option[selected]{ background-color: xxx }

Cassandra: update value of a clustering column -

i have created table: create table postsbyuser( userid bigint, posttime timestamp, postid uuid, postcontent text, year bigint, primary key ((userid,year), posttime) ) clustering order (posttime desc); my query user posts in 1 year ordered desc posttime. ordering ok, problem posttime changed if user edits postcontent: update postsbyuser set postcontent='edited content' , posttime=edit_time userid=id , year=year i error : [invalid query] message="primary key part time found in set part" have idea how order posts changing time ? you should specify clustering column in query. update postsbyuser set postcontent='edited content' , posttime=edit_time userid=id , year=year , posttime=previous_post_time

internet explorer - Sharepoint Drag and Drop hangs and keeps loading -

Image
i trying upload files on sharepoint farm through drag , drop. users works , hangs. loader icon keeps on loading , nothing happens. if cancel, file gone. can please provide cause , applicable solution? , happens on ie. other browsers ok this. do errors in console ? -> developer tools (hit f12) -> console tab also, still in developer tool, see request 4xx or 5xx status code under network tab after dropping file? maybe gave solution when said works in different browser :) - understand users not have different browser other ie due group policy

jquery - Expand months on click of year -

how can expand (and toggle) archivemenumonths on click of year link? <div class="archivemenu"> <ul class="archivemenuyear"> <li class="year"> <a href="#">2016</a> </li> </ul> <ul class="archivemenumonths"> <li class="month"> <a href="#">july</a> </li> <li class="month"> <a href="#">june</a> </li> <li class="month"> <a href="#">may</a> </li> <li class="month"> <a href="#">march</a> </li> <li class="month"> <a href="#">february</a> </li> </ul> </div> i have archivemenumonths

vb.net - Renci.SshNet ShellStream seems to be dropping characters -

after google, have not found answer matches exact situation. maybe more info care, think need set stage question. simple goal read , command cisco ios device either serial console or ssh. abstract "business logic" transport looking @ building stream. serial console, after creating serial port, use basestream , works well. fyi rosetta moment getting serial port streaming working. if must use .net system.io.ports.serialport adding ssh stream (for me) research took me sharps , renci ssh connection.i decided try renci first. downloaded , compiled dll (my project in vb.net). connected, created shell stream, passed stream same functions serial stream used. works except when "show run". have terminal length set 0 there no page breaks. output, when using ssh there missing parts in capture. theory @ serial speed (9600 baud) stream able keep up, @ lan speed (1 gig bit) overrunning buffer. captured little different, around same area text missing. small screen grabs such

android - AppCompat ActionBar restoring original layout -

in app, use mainactivity storing main layout (drawerlayout, coordinatorlayout content root, toolbar , fragment holder in it), , various fragments screens. on 1 particular screen i'd expand actionbar size, , give specific content (remove toggle button, menu bar, etc., , specify own layout). done mainactivity.toolbar.setcustomview(); . works pretty well, when navigate different fragment, i'd restore original layout. there simple way of doing this? yes, in order remove custom view , restore appcompat actionbar can call setdisplayoptions. getactivity().getactionbar().setdisplayoptions(actionbar.display_show_title | actionbar.display_show_home);

javascript - How to apply a filter on an ajax repeated list using Vue.js? -

i'm trying apply filter on list retrieve using ajax, problem have vue.js tries apply filter before list loaded , shown. this have far: <template> <div class="grid__container games"> <h2>games</h2> <div v-if="games"> <table> <tr> <th>player one</th> <th>results</th> <th>player two</th> <th>played at</th> </tr> <tr v-for="game in games.data"> <td>{{ game.player_one }}</td> <td>{{ game.player_one_goals }} - {{ game.player_two_goals }}</td> <td>{{ game.player_two }}</td> <td>{{ [ game.created_at, "yyyy-mm-dd h:mm:ss" ] | moment "dddd, mmmmm, yyyyy" }}</td> </tr> </table> </div> </div> </template> <script>

run php code on user logout in joomla 3 -

version - joomla 3.6.2 my package includes 1 admin component, 1 frontend component , 1 module. i trying run php code(http request) on user logout. confused write code. have few questions - i unable find resource on implentation of events . how use these events ( https://docs.joomla.org/plugin/events ) do need write plugin ??? yes, writing user plugin want, , pretty simple. below skeleton start with: make new folder in installation, ex /plugin/user/yourplugin add xml-file: yourplugin.xml following content: <?xml version="1.0" encoding="utf-8"?> <extension version="3.0.0" type="plugin" group="user" method="upgrade"> <name>plg_user_yourplugin</name> <author>neil</author> <creationdate>aug 2017</creationdate> <version>3.1.0</version> <description>add description</description> <files> <filename plugin=&quo

linux - ubuntu backup-manager Permission denied -

Image
i've installed backup manager onto ubuntu machine have automated backup going. problem when go set automatization using code - it comes saying "bash: /etc/backup-manager.sh: permission denied" i not understand error. i've tried change user read/writes other root , didn't work. tried changed chmod number 770 700 , still didn't work. any info on welcome. thank :) wondering using tutorial giving me host. https://documentation.online.net/en/dedicated-server/tutorials/backup/configure-backup/start i'm using desktop version of ubuntu 16 incase needed the sudo doesn't want in case. happens shell evaluates redirection , attempts open /etc/backup-manager.sh before sudo cat gets started. fails because shell still runs unprivileged user. have sudo -i open new root shell, execute commands , exit again. alternatively try sudo nano /etc/backup-manager.sh , paste contents there. work because editor run root , file opening when save.

android - Synchronize scrolling of two ScrollViews inside a RelativeLayout -

i need synchronize scrolling positions of 2 scrollviews . both scrollviews contain individual recyclerview (i can't put them inside same scrollview due design requirements). how can achieve that? i highly recommend change design there way achieve this for first scroll view, define 2 variable x,y , current scroll position x = firstscrollview.getscrollx(); y = firstscrollview.getscrolly(); and pass these values other scrollview "scrollto" method. like: scrollview secondscrollview = (scrollview)findviewbyid(r.id.scrollview); secondscrollview.scrollto(x, y); if didn't work try: secondscrollview.post(new runnable() { @override public void run() { secondscrollview.scrollto(x, y); } });

Passing two dimensional arrays by reference when calling COM DLL from C# -

i have registered com dll , have reference in c# project in visual studio 2012. i want call 1 function dll. has following signature in documentation: hresult crating( [in] bstr compmodelname, [in] long refrigcode, [in] long powsupcode, [in] variant_bool tempmidpoint, [in] variant_bool suctionsgr, [in] double suctionretgastemp, [in] double subcooling, [in, out] safearray(variant_bool)* requiredoutput, [in, out] safearray(double)* capacity, [in, out] safearray(double)* power, [in, out] safearray(double)* current, [in, out] safearray(double)* massflow, [in, out] safearray(double)* heatreject, [in, out] safearray(long)* errorcode); but when open object browser see following: void crating( string compmodelname, int refrigcode, int powsupcode, bool tempmidpoint, bool suctionsgr, double suctionretgastemp, double subcooling, ref system.array requiredoutput, ref system.array capacity,

firebase - Why am I missing angular-cli-build.js? Do I have to use it? -

i trying build webpage using angular2, firebase 3 sdk , angularfire2. have gotten of these frameworks or sdks. have difficulties understanding functions in files systemjs.config, typings.json, tsconfig.json,packages.json , etc. think got understanding these files, i'm not confident enough configure of them project. followed angular2 tour of heroes tutorial , im trying transform angular2 tour of heroes web page own web page. trying use firebase 3.0 sdk instead of liteserver , in-memory-data.service, decided angularfire2 work firebase easier. watching several youtube videos (for example 1st , 2nd ) angularfire2 , reading setup guide angularfire2 on github , noticed mentioning angular-cli-build.js file when setting projects. have looked through files , can't find here. file-structure looks project |-app | |-html | | |-. | | |-all html files(templates) | | |-. | |-js | | |-. | | |-all js , map files(generated typescript) | | |-. | |-css | | |-. | | |-all css files template

javascript - throw err; ReferenceError: document is not defined -

router page var express = require('express'); var router = express.router(); var mysql = require('mysql'); /* home page */ router.get('/', function(req, res, next) { res.render('mysql', { title: '', }); }); var connection = mysql.createconnection({ host : '', user : '', password : '', database : '' }); connection.connect(); connection.query('select hashtag recipients', function(err, rows, fields) { if (!err) { console.log(rows); document.getelementbyid('recipients').innerhtml = rows; } else { console.log('error while performing query.'); } }); connection.end(); module.exports = router; views page <html> <head> </head> <body> <p id='recipients

data warehouse - SASS : Bridge table won't work when browsing the cube -

Image
as described in data source view schema in picture above, have transaction fact table, gl_hierarchy dimension,the accountlist dimension , bridge table links between them. here example of each dimension the gl_hierarchy dimension parent/child dimension : the accountlist dimensions contains accounts of general ledger the bridge dimension links between account , one/many categories of gl hierarchy (many many relationship) when browsing cube want see amount of transactions , drill down through hierarchy when filtering account works fine but want filter using gl_hierarchy attribute "category description" results wrong, accounts recurrent every category if there no bridge dimension i'm helpless , can't manage make work. thank you.

python - how to loop through xml file and save the result into a dataframe -

i have big xml file without knowing exact structure of file. try loop through xml hierarchies , extract results , put them dataframe. however, code break down after parsed soome text. error returned as file:"c:\python34\lib....\frame.py", line 4327, in append elif isinstance(other, list) , not isinstance(other[0], dataframe): indexerror: list index out of range here code python 3.4: def getelements(fn): df = pd.dataframe() index = 0 context = iter(et.iterparse(fn, events=('start', 'end'))) _, root = next(context) event, elem in context: if elem.tag=='row': alist=[] index += 1 c = elem.findall('column') cl in iter(c): pair = (str(cl.get('name')), str(cl.text), index) alist.append(pair) df=df.append(alist) #print out during processing print(df[ :index]) print (&

python - NameError: name 'sys_platform' is not defined -

i have viewed several other posts , tried --upgrade upgrade setuptools , not helps. the output follows, way use osx, my python version python 2.7.6 -- 64-bit ~$ pip install urlopen collecting urlopen using cached urlopen-1.0.0.zip ..... return eval(compiled_marker, environment) file "<environment marker>", line 1, in <module> nameerror: name 'sys_platform' not defined ---------------------------------------- command "python setup.py egg_info" failed error code 1 in /var/folders/tb/gh49g76s63l3rk1p63lfbs800000gn/t/pip-build-navlzp/urlopen update: i try uninstall 'distribute' first, fails output mean ~$ pip uninstall distribute using pip version 6.0.6, version 8.1.2 available. should consider upgrading via 'pip install --upgrade pip' command. not uninstalling distribute @ /applications/canopy.app/appdata/canopy-1.5.2.2785.macosx-x86_64/canopy.app/contents/lib/python2.7/site-

javascript - passportjs jwt, client response not getting authenticated -

trying implement login passport-jwt. both signup , login work fine, token produced on login , sent client stores , returns back. after login authentication request reaches app , nothing happens.. help? :) jwt strategy var jwtstrategy = require('passport-jwt').strategy, extractjwt = require('passport-jwt').extractjwt; var opts = {} opts.jwtfromrequest = extractjwt.fromauthheader(); opts.secretorkey = 'secret'; opts.issuer = "http://localhost:3000"; opts.audience = "http://localhost:3000"; passport.use('jwt', new jwtstrategy(opts, function(jwt_payload, done) { console.log(1) return user .findone({where : {username : jwt_payload.email } }) .then(function (user) { if(user === null){ return tempuser .findone({where : {username : jwt_payload.email } }) .then(function(user

node.js - Is there a way in mongoose create global instance call for all Schemas? -

i know possible create instance method each schema, there way of creating instance call relates schemas. you may want create function , function want use schema. if have understood requirement need create function in separate file , add file schema plugin. for example: in lastupdate.js file create function function use different schema module.exports = exports = function lastupdateplugin (schema) { schema.add({ updatetime: date }) schema.pre('save', function (next) { this.updatetime= new date next() }); } in user.js schema file: var lastupdate = require('./lastupdate');//load lastupdate.js file var user= new schema({name: string, ... }); user.plugin(lastupdate); in bank.js schema file: var lastupdate = require('./lastupdate');//load lastupdate.js file var bank= new schema({bankname: string, ... }); bank.plugin(lastupdate); then when save user , bank automatically update updatetime each schema

javascript - Is there any reason to refactor declaration functions into an expression function? -

i have these 3 functions, different of them happen in same context, related, have components in commons (ex: class names). function btnsubmitloading($btn, cleanerror, classtoremove) { // 5-10 lines of code } function btnsubmitcomplete($btn, classtoadd) { // other 5-10 lines of code } function btnfeedback($btn, $msg, classtoadd) { // more 5-10 lines of code } they declared before $(document).ready(), global , called in different pages. when need 1 of them: btnfeedback($('button'), 'success', 'fa-check'); my question here if there reason transform these functions expression function, resulting in this: var buttonsubmit = function() { this.btnsubmitloading = function($btn, cleanerror, classtoremove) { // 5-10 lines of code } this.btnsubmitcomplete = function($btn, classtoadd) { // other 5-10 lines of code } this.btnfeedback = function($btn, $msg) { // more 5-10 lines of code } } call

NetWorkDays Function in SQL SERVER 2012 -

is there function in sql server 2012 calculates working days? i have been searching no luck far. thanks! no, sql server doesn't have such functions, can use calendar table: declare @date_start date = '2016-01-01', @date_end date = '2016-12-31'; cte ( select @date_start [d], 0 level union select dateadd(day,1,[d]), [level] + 1 [level] cte [level] < datediff(day,@date_start,@date_end) ), holidays ( --table holidays (usa) select * (values ('2016-01-01'), ('2016-01-18'), ('2016-02-15'), ('2016-05-30'), ('2016-07-04'), ('2016-09-05'), ('2016-10-10'), ('2016-11-11'), ('2016-11-24'), ('2016-12-26')) t(d) ) select c.d, case when datepart(weekday,c.d) in (1,7) 0 --saturday , sunday, use (6,7) friday,saturday when h.d not null 0 else 1 end isworking cte c left join holidays h on c.d=h.d option (maxrecursion 1000); it generat

java - Downcasting while calling super.clone() method -

consider following program class implements cloneable { string str = null; public void set(string str) { this.str = str; } @override public clone() { a = null; try { = (a) super.clone(); if(a.str!=null) { system.out.println(a.str); } else { system.out.println("null"); } } catch (clonenotsupportedexception e) { e.printstacktrace(); } return a; } public static void main (string args[]) { a = new a(); a.set("1234"); b = a.clone(); } } why output of above program 1234 , not null. i expecting null, because of following understanding of mine. super.clone() method create new object of parent type (object in case) in attributes of parent class shallow copied. when downcasting in our clone() me

node.js - Node js natural sort on array of objects based on string and numeric key values -

i have array of object string , numeric values. need natural sort work on combined values. example: input array: [ { key1: '156557_08_315f036d', key2: 30, key3: 's' }, { key1: '156557_08_315f036d', key2: 10, key3: 'm' }, { key1: '156557_08_315f036d', key2: 10, key3: 's' }, { key1: '156557_08_315f036d', key2: 15, key3: 's' }, { key1: '156557_08_315f036d', key2: 20, key3: 's' } ] this should sorted in ascending order of key3+key1+key2 format, key2 numeric , wants sorted naturally..not string. output be: [ { key1: '156557_08_315f036d', key2: 10, key3: 'm' }, { key1: '156557_08_315f036d', key2: 10, key3: 's' }, { key1: '156557_08_315f036d', key2: 15, key3: 's' }, { key1: '156557_08_315f036d', key2: 20, key3: 's'

javascript - Highcharts showing ticks number, instead of date -

i'm trying create graph json received web api. i had working, , decided start refactoring. after while noticed xaxis no longer shows dates, instead seems showing ticks. i'm quite inexperienced javascript , more highcharts cannot spot mistake. high charts showing ticks. http://mortentoudahl.dk/images/highchartsbug.png the change did making option object, , pass highcharts upon instantiation, according instructions found here: http://www.highcharts.com/docs/getting-started/how-to-set-options when compare code last code block in link, seems same, except options object. var pm10 = []; var pm25 = []; var options = { chart: { zoomtype: 'x', renderto: 'container' }, title: { text: "compounds in air @ hcab" }, subtitle: { text: document.ontouchstart === undefined ? 'click , drag in plot area zoom in' : "pinch chart zoom in" }, xaxix: { type: 'datetime' }, yaxis

javascript - GitHub API with Angular - how to get user's public repos? -

i'm trying print out repos count of each angular organisation member on github. succeeded print of usernames, can't print repos , don't know causes it. here's html: <!doctype html> <html lang="en" ng-app="myapp"> <head> <meta charset="utf-8"> <title>github app</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="app.css"> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script> <script src="app.js"></script> <script src="cntrlr.js"></script> </head> <body ng-controller="myctrl"> <h1>github users ranking</h1> <h3>{{org.login}}</h3> {{user.public_repos}} <p ng-rep

emacs - boot-clj: browser repl after cider-jack-in -

my workflow starting "boot dev" process within emacs using cider afterwards this: go shell buffer. enter "boot dev" wait until message "time elapsed..." cider-connect (enter, enter) in case clojurescript project, 1 start browser repl with: (start-repl) when using cider-jack-in ease bit problems last step, clojurescript repl. here's beginning of error message: boot.user> (start-repl) << started weasel server on ws://127.0.0.1:45341 >> << waiting client connect ... java.lang.nullpointerexception @ clojure.java.io$make_parents.invokestatic(io.clj:443) @ clojure.java.io$make_parents.doinvoke(io.clj:438) @ clojure.lang.restfn.invoke(restfn.java:410) (the full message can found here: http://pastebin.com/chbnbykg ) i did add ~/.boot/profile.boot according cider manual. use cider-jack-in-clojurescript ( c-c m-j default) instead of cider-jack-in clojurescript repl. (or connect external repl.) d

SSIS Performance Issue -

i'm loading text files sql server database. each file contains 1000 records , total number of files 15. problem each file taking more 5 mins time load. the files contain 12 columns (string). i converting 2 columns integer using derived column , remaining 10 loading string below code used conversion: (dt_i4)mailer_id (dt_i4)move_effective_date i have tried increase dft buffer size , using data conversion in place of derived column. problem still exists. try loading directly source , put staging, while accessing data staging transformation.

xamarin ios release - Apps that include an arm64 architecture are required to include an armv7 -

i'm trying upload ipa file, coded using xamarin built visual studio. meet architecture error. there're suggestion here in xcode, how in xamarin studio or visual studio ? "apps include arm64 required include include both armv7 , armv7s architecture" error in applicaiton loader here configurations: vs config1 , vs config 2 does know how achieve without enable "armv7" ? [updates] thinking make app support iphone5 , above, seems rejected while upload ipa. i've succeed upload setting build "armv7, armv7s, arm64" setting. thank guys quick reply! the issue here in first image can see supported architectures listed armv7s + arm64 . armv7s not same armv7 - derivative can run on arm cpus support it. in case of iphones, iphone 5 , newer. armv7s support not required apple, , there no need include in app unless using of the, specific, optimisations brings. you need use dropdown change armv7 + arm64 , able submit app successfull

ios - Find Inner most Polygon using actual Area from array of nested Polygon -

Image
i have array of gmspath , have coordinate. want find out path in coordinate falls. able find out total polygons in location falls. (using https://stackoverflow.com/a/38826411/2225439 ) working fine step. the actual issue comes when 1 closed gmspath overlap closed gmspath , coordinate in overlapped area. per requirement, have 1 gmspath out of these 2 , have smaller area another. please refer image better understanding. you can find out area of gmspolygon using following method google maps ios sdk, gmsgeometryarea() , provides area of given polygon. have area, can compare different polygons , find innermost area. double gmsgeometryarea(gmspath *path); as per description provided google returns area of geodesic polygon defined |path| on earth. "inside" of polygon defined not containing south pole. if |path| not closed, implicitly treated closed path nevertheless , result same. coordinates of path must valid. if segment of path pair of antipodal poin

ios - Reloading row contains UITextField with a rightView causes infinite loop and memory overflow -

Image
i'm facing strange bug reloading uitableviewcell contains uitextfield custom rightview . i created simple example demonstrate bug: my custom cell uitextfield : @implementation tableviewcell - (instancetype)initwithstyle:(uitableviewcellstyle)style reuseidentifier:(nsstring *)reuseidentifier { if (self = [super initwithstyle:style reuseidentifier:reuseidentifier]) { _textfield = [[uitextfield alloc] initwithframe:cgrectmake(0, 0, 320, 44)]; _textfield.text = @"this text field"; [self.contentview addsubview:_textfield]; } return self; } @end my view controller uitableview : @interface viewcontroller () <uitableviewdatasource> @property (weak, nonatomic) iboutlet uitableview *tableview; @property (nonatomic) uiview *rightview; @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. // press reload row rightview self.n

apache - Interceptor in PHP -

i want intercept request php page, read data url(key:value format) , forward request php page. can suggest approach task? using apache 2.4 webserver , php 5.6.24. i used "require" in start of php file , in file performed activity on url , redirected intended page.

c - net_ratelimit message in kernel log when creating multiple TCP connection in NONBLOCKING mode -

i've c program tries poll devices in network , if devices available tries read value them. when no devices present running of application creates following message in kernel log. there no other warning/alert messages in log below message. (even after disabling ratelimit using net.core.message_cost=0 ) net_ratelimit: xx callbacks supressed and @ same time application broadcasts messages on network starts fail in send system call returning einval . once stop polling tcp client udp broadcast application runs fine. the system run ramfs based system running 3.14 series kernel rt_preempt patch applied . i've written sample application mimics same behavior original application when start 5 process in background. (note more 4 process triggers it). below sample client code. #include <sys/types.h> #include <sys/socket.h> #include <sys/select.h> #include <sys/time.h> #include <sys/ioctl.h> #include <arpa/inet.h> #include <netinet/in.

javascript - how to write a single jquery function for different ids -

here jquery code want work different ids same function. in coding same function/code being repeated every different id , want make single function different ids reduce code . how can ? /$(function(){ // // $('a[href^="#"') .click(function(e){ // var target = $(this).attr('href'); // var strip = target.slice(1); // var anchor = $ ("a[name='" + strip +"']"); // e.preventdefault(); // $('html,body').animate({ // scrolltop: anchor.offset().top // },(3000)); // }); //}); $("#get").click(function(){ $('html, body').animate({ scrolltop: $("#getto").offset().top }, 2000); }); $("#features").click(function() { $('html, body').animate({ scrolltop: $("#featuresto").offset().top }, 2000); }); 1 //$("#myelement").offset({left:34,top:100}); $(

javascript - 'jquery is not defined' when using webpack to load bootstrap -

i starting learn use webpack (previously use manual way include individual scripts separately). , used bootstrap-loader loading bootstrap. here webpack.config.js var path = require("path") var webpack = require('webpack') var bundletracker = require('webpack-bundle-tracker') module.exports = { context: __dirname, entry: './assets/js/index', // entry point of our app. assets/js/index.js should require other js modules , dependencies needs output: { path: path.resolve('./assets/bundles/'), filename: "[name]-[hash].js", }, plugins: [ new bundletracker({filename: './webpack-stats.json'}) ], module: { loaders: [ { test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader'}, // transform jsx js { test: /\.css$/, loader: 'style-loader!css-loader'}, // transform css // images { test: /\.png$/, l

iphone - how to send JSON in post api using Alomofire SWIFT -

i need send json format in post api using alamofire in swift. way data need send is { "data": [{ "id": "1015683997", "name": "pawel" }, { "id": "108350039247", "name": "randeep" }, { "id": "115607797616", "name": "mohit" }] } and way able generate of is: ["data": { data = ( { id = 101583997; name = "pawel"; }, { id = 108359247; name = "randeep"; }, { id = 11567616; name = "mohit "; } ); } ] using below mentioned way generate json format. for in 0..<self.arrfriendslist.count { let dictfrndlist:[string: anyobject] = [ "id" : arrfriendslist[i].valueforkey("id")!,"name" : arrfriendslist[i].valueforkey("name")!

cakephp - How to create custom validation for Modelless Forms in cakephp3 -

i want create custom validation fields. form has been extended cakephp form class (modelless forms). note: bear in mind modelless forms there no table or database. the problem when create validation give me error. method isvalidcardnumber not exist here code: <?php namespace app\form; use cake\core\configure; use cake\form\form; use cake\form\schema; use cake\network\exception\socketexception; use cake\validation\validator; use sagepay\sagepaydirectpayment; /** * payment form */ class paymentform extends form { /** * define schema * * @param \cake\form\schema $schema schema customize. * @return \cake\form\schema schema use. */ protected function _buildschema(schema $schema) { return $schema ->addfield('name', 'string') ->addfield('card_number', 'string') ... ...; } /** * define validator * * @param \cake

javascript - gulp-eslint not throwing any error on console -

i working gulp , reactjs . have added eslint static analysing of code. using gulp-eslint follows: var eslint = require('gulp-eslint'); gulp.task('eslint', function() { // process script files, ignore npm_modules gulp.src(['widgets/**/*.js', 'server/**/*.js', '!node_modules/**']) .pipe(eslint.format()) .pipe(eslint.failaftererror()); my .eslintrc file : { "parser": "babel-eslint", "plugins": [ "react" ], "parseroptions": { "ecmaversion": 6, "sourcetype": "module", "ecmafeatures": { "jsx": true } }, "extends": ["eslint:recommended", "plugin:react/recommended"], "env": { "browser": true, "amd": true, "es6": true, "node": true, "mocha": true }, "rules": { "comma-dangle": 1, "quotes": [ 1, "single

hibernate - map multiple model attributes to a ModelAndView in spring -

i have tried implement one-to-many association using spring , hibernate. cant implement 2 model attributes using single form. how map 2 model attributes in single form. my controller code is, @requestmapping(value = "/admin/test", method = requestmethod.get) public modelandview admintestpage(@modelattribute("employee") employee employee, @modelattribute("education")education education, bindingresult result, modelmap map, model model) { return new modelandview("test","command",new employee()); } my jsp form is, <%@ page language="java" contenttype="text/html; charset=utf-8" pageencoding="utf-8"%> <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@taglib uri="http://www.springframework.org/tags" prefix="spr

ios - I could't upload my ipa in Application Loader and i get the below error -

i could't upload ipa in application loader , below error. could not find cfbundlepackagetype" within info.plist; or package missing info.plist when install ipa using itunes not getting error. confused on how proceed this? i think problem due way packaging wrong. for instance if zip payload causes above issue and 1 of wrong way zip -r -s 64 payload.zip payload/ mv payload.zip appname.ipa the right way use below or use xcrun zip -r payload.zip payload/ mv payload.zip appname.ipa itunes have many validation finds out problem. to validate ipa use altool go terminal , use below script /applications/xcode.app/contents/applications/application\ loader.app/contents/frameworks/itunessoftwareservice.framework/support/altool -v -f app.ipa -u itunesconnect@user.com -p password look inside script it'll solve problem reference