Posts

Showing posts from January, 2011

javascript - JQuery on click table button -

i have table in each tr has button: <td class='id'><input type='button' class='thisbutton' value='this'></td> in page, define action when there's button click. tried this: $('.thisbutton').click(function() { alert("a"); }); nothing happens. doing wrong. simple not work :-( if correctly include jquery, , script, should work fine. comments have suggested, check console errors give hint problem. it's core part of script debugging. here's doc showing how use console in chrome: https://developer.chrome.com/devtools/docs/console and firefox counterpart in case helps: https://developer.mozilla.org/en/docs/tools/web_console here's fiddle showing in action: http://jsfiddle.net/td4go6t9/ and source it; markup: <table> <tr> <td class='id'><input type='button' class='thisbutton' value='this'></input></td>

ios - Is it possible to apply a vertical gradient as well as a horizontal gradient fade-out on the sides of a graph? -

Image
is possible apply vertical gradient horizontal gradient fade-out on sides of graph? here image demonstrates talking about. can see graph in has vertical cptgradient fill areafill. the code this: cptgradient *areagradient = [cptgradient gradientwithbeginningcolor:[[cptcolor whitecolor] colorwithalphacomponent:.5f] endingcolor:[[cptcolor whitecolor] colorwithalphacomponent:.1f]]; areagradient.angle = -90.0; cptfill *areagradientfill = [cptfill fillwithgradient:areagradient]; tempplot.areafill = areagradientfill; tempplot.areabasevalue = cptdecimalfromdouble(0.0); for edges of graph, this: cptgradient *gradient2 = [[cptgradient alloc] init]; gradient2 = [gradient2 addcolorstop:[cptcolor clearcolor] atposition:0.0]; gradient2 = [gradient2 addcolorstop:[[cptcolor whitecolor] colorwithalphacomponent:.5f] atposition:.05]; gradient2 = [gradient2 addcolorstop:[cptcolor clearcolor] atposition:.05]; gradient2 = [gradient2 addcolorstop:[cptcolor clearcolor] atposition:1.]; gradient

c# - How do I populate a DatagridViewComboboxColumn -

i not sure how populate datagridviewcomboboxcolumn. there several properties in datagridviewcomboboxcolumn, , not sure use: datasource items displaymember valuemember i confused there many properties. tried: datagridviewcomboboxcolumn cb = (datagridviewcomboboxcolumn)datagridview1.rows[0].cells[0].value; cb.items.add("test"); //or cb.datasource = new list<string>() { "t", "e", "s", "t" }; you have cast datagridviewcomboboxcell , not datagridviewcomboboxcolumn :) example: ((datagridviewcomboboxcell)datagridview1.rows[0].cells[0]).items.add("something");

Improve workflow when programming/editing for html/css/js -

my workflow connect via ssh development server use vim. miss convenience of using ide edit html/css/javascript files honest. there workflow mine can in programming html/css/js files e.g. make sure there no typo/syntax error, available properties/methods etc? you can: use graphical environment software (like gnome, kde) mount remote directory via sftp (part of ssh) , edit files locally using ide, use sshfs , same thing without of ge parts, use dropbox (or that) sync data between server , computer, use available network file system (nfs, samba, ???).

html - border under the Home I go into the info then border during the info and not the front -

it such have menu there border in page you're into, whole time on index page, if click onto news should less. i have tried many ways none of them works, think little can get? this means must move find page on, , view page not in menu should not there. there border in home, how can that, example, go info border under info , not front, should there? <div class="pi-header-block pi-pull-right"> <ul class="pi-simple-menu pi-has-hover-border pi-full-height pi-hidden-sm"> <li class="pi-has-dropdown active"><a href="/"><span>forside</span></a></li> <li class="pi-has-dropdown"><a href="/info/"><span>info</span></a></li> <li class="pi-has-dropdown"><a href="/nyhed/"><span>nyhed</span></a></li> <li class=&q

objective c - sending files to server and receiving feedback -

i have code send file server: nsdata *data = [nsdata datawithcontentsoffile:path]; nsmutablestring *urlstring = [[nsmutablestring alloc] initwithformat:@"name=thefile&&filename=recording"]; [urlstring appendformat:@"%@", data]; nsdata *postdata = [urlstring datausingencoding:nsasciistringencoding allowlossyconversion:yes]; nsstring *postlength = [nsstring stringwithformat:@"%d", [postdata length]]; nsstring *baseurl = @"http://websitetester.com/here.php"; nsurl *url = [nsurl urlwithstring:baseurl]; nsmutableurlrequest *urlrequest = [nsmutableurlrequest requestwithurl:url]; [urlrequest sethttpmethod: @"post"]; [urlrequest setvalue:postlength forhttpheaderfield:@"content-length"]; [urlrequest setvalue:@"application/x-www-form-urlencoded" forhttpheaderfield:@"content-type"]; [urlrequest sethttpbody:postdata];

.htaccess - Clean-URL -> URL's with only 1 parameter works, but with more than 1 parameter CSS-file will not be included -

i use clean-url in project. simplicity simplified code. my .htaccess: rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . index.php [l] my index.php: <?php require_once "/login.php"; ?> the .css-file include in html-part in login.php: <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> my project structure: in root-folder "test" index.php, login.php , bootstrap-directory. and problem: if request url 1 parameter http://localhost/test/bla working! but if request url 2 paramter like: http://localhost/test/bla/bla then login-page showing, without css-styles (css-file not included...). but why? first, if htaccess in test folder, should this rewriteengine on rewritebase /test/ rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . index.php [l] then, have add rewrite base (for absolute path ma

objective c - Detect touch within a radius of a node in SpriteKit -

i have player object in spritekit game , @ moment i'm moving using following code: -(void)touchesbegan:(nsset *)touches withevent:(uievent *)event { if (touches.count == 1) { [self touchesmoved:touches withevent:event]; } } -(void)touchesmoved:(nsset*)touches withevent:(uievent*)event { if (touches.count == 1) { [_player runaction:[skaction moveto:[[touches anyobject] locationinnode:self] duration:0.01]]; } } but want move player node when touch within specific range of location. since looks care distance of touch _player object, move radius detection logic _player object , use skregion handle it. note: if need know if touch within radius of multiple nodes might want use method this question instead. to use skregion determine if touch within radius of _player , add skregion instance _player object , initialize radius want. in [_player init] or wherever makes sense project: self.touchregion = [[skregion alloc]

How would you reduce your collection of elements to just spans in JQuery? -

i have been asked couple of questions in regards jquery , not entirely sure on how answer them? 1 how reduce collection of elements spans? 2. given have found $('#anid'), how add context jquery selector restrict scope of search 1 of children? any appreciated thanks i assume in 'reduce collection of elements spans' mean 'get spans in page' - in case, can $('span') (how awesome that? :) ). more information, visit jquery selector documentation . to find decedents of element, can use .find() method, this: $('#anid').find('.child-selector')

multithreading - Android MediaPlayer use lot of resource -

i'm making game in opengl 2.0 , have problems sounds, because sounds slow down application , fps decrease 20 frames. implement service sounds , run on new thread, problem same. mediaserver use more cpu application lot of sprites. play 3 sounds total size less 0.5 mb. code: package com.filsoft.mouse; import java.io.ioexception; import android.app.service; import android.content.intent; import android.media.mediaplayer; import android.media.mediaplayer.oncompletionlistener; import android.os.binder; import android.os.handler; import android.os.handlerthread; import android.os.ibinder; import android.os.looper; import android.os.message; import android.os.process; public class sound extends service implements oncompletionlistener { private final ibinder mbinder = new localbinder(); private looper mservicelooper; private servicehandler mservicehandler; // handler receives messages thread private final class servicehandler extends handler {

java - Instance-controlled classes and multithreading -

in effective java chapter 2, item 1 bloch suggests consider static factory methods instead of constructors initalize object. on of benefits mentions pattern allows classes return same object repeated invocations: the ability of static factory methods return same object repeated invocations allows classes maintain strict control on instances exist @ time. classes said instance-controlled . there several reasons write instance-controlled classes. instance control allows class guarantee singleton (item 3) or noninstantiable (item 4). also, allows immutable class (item 15) make guarantee no 2 equal instances exist: a.equals(b) if , if a==b. how pattern work in multi threaded environment? example, have immutable class should instance-controlled because 1 entity given id can exist @ time: public class entity { private final uuid entityid; private static final map<uuid, entity> entities = new hashmap<uuid, entity>(); private entity(uuid entityid) {

javascript - Reloading a page include every 30 seconds or when user submits form -

Image
i have php page lot of includes make various parts of page video website. i have comments section submits information database (which works fine). need make when done included page/div refreshes. this php: <form id="song-comment-form"> <input type="hidden" value="<?=$rsong->id?>" class="song-id"> <textarea class="editor" id="song-comment-textarea"></textarea><br> <input type="submit" value="submit"><input type="button" value="cancel" id="hide-song-comment-form"> <hr> </form> <div id="player-song-comments"> <?php $showcomments?> </div> here attempt @ doing javascript: <script> var $comments = $("#player-song-comments"); setinterval(function () { $comments.load("/template/sections/player_comments.php #player-song-comments"); }

objective c - Finding the width of an NSString as a CGFloat -

i know has been posted already, solution found -(cgfloat)widthoftext{ cgrect idealframe = [self.text boundingrectwithsize:self.frame.size options:nsstringdrawinguseslinefragmentorigin attributes:@{ nsfontattributename:self.font } context:nil]; return idealframe.size.width; } self uilabel isn't working. i'm trying place button @ end of string need width of string calculate buttons absolute placement can explain why isn't working or suggest different method? one or more of inputs not expect, nslog() self.text , self.frame , self.font -- basic debugging. it better pass in parameters use ivars, allows easier testing. removes dependency on class. example works properly: nsstring *text = @"1235"; cgsize framesize = cgsizemake(300, 50); uifont *font = [uifont systemfontofsize:12]; cgrect idealframe = [t

C Structure initialization (Array of integers and an integer value) -

#define max 10 struct setarray { int item[max]; int count; }; typedef struct setarray *bitset; how should initialize elements in structure? for example struct setarray s = { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, max }; or struct setarray s; ( int = 0; < max; i++ ) s.item[i] = i; s.count = max; or bitset p = malloc( sizeof( *p ) ); ( int = 0; < max; i++ ) p->item[i] = i; p->count = max;

html - jQuery UI Spinner - how to always display 3 decimal places -

i have decimal input presented jquery ui spinner. spinner works not display trailing 0. i display .000 user knows how many decimal points can enter. i have tried $(".spinnermaxtravel").spinner({ min: 0, max: 4000, step: 0.001, numberformat: "n3" }); also set on initialize : var num = 160.000; var c = num.tofixed(3); $('#spinner1').val(c); this looking for, try this. var num = 160.000; var c = num.tofixed(3); $('#spinner1').val(c+'.000'); $("#spinner1").spinner({ min: 0.000, max: 4000, step: 0.001, numberformat: "n3", stop: function (event, ui) { if ($("#spinner1").val().indexof(".") >= 0) { } else { $("#spinner1").val($(this).val() + '.000'); } } }); have fun

c# - Exception in Automapper Mapping and how to frame the class structure properly -

Image
i facing below issues when try achieve requirement. in controller have used automapper map "viewmodel" class "entities" class getting exception.i used automapper exception class catch exception, result : missing type map configuration or unsupported mapping mapping types: empdetails -> staffmember org.entities.empdetails -> org.web.models.staffmember destination path: list`1[0] source value: org.entities.empdetails in data access layer when adding value dropdown getting exception , please advise me whether classes formed/designed , me out rid of these issues. pfb screen shots , codes: exception screenshots exception automapper in controller: exception dropdown in dal: code: controller:- employeestatus ostatusbl = new employeestatus(); // business layer class public actionresult index() { empstatusdetails ostaff = ostatusbl.getempstatusdetails(); staffmemberlist olsit = new staffmemberlist(); mapper.createmap<

php - preg_match capturing two capital letters, 3 digits and 2 capital letters, and than 7 digits -

okay have following string "ig 449ww 6180262 250" i want match first 2 letters, second 5 letters , numbers, , 7 numbers , want capture each of these. so have following preg_match: $scanned_barcode = trim(input::get('barcode')); if (preg_match("/([a-z]{2})\s(\d{3}[a-z]{2})\s(\d{7})/", $scanned_barcode, $found)) { $mfg_id = $found[1]; $game_code = $found[2]; $serial = game::find($found[3]); } am doing correct? there missing? there better way this? your regex works, easier this: <?php $scanned_barcode = trim(input::get('barcode')); // 'explode' string array(), using space delimiter // http://php.net/manual/en/function.explode.php $found = explode(' ', $scanned_barcode); $mfg_id = $found[0]; $game_code = $found[1]; $serial = game::find($found[2]); ?>

java - OO Design pattern for shopping cart -

i trying learn oo design pattern , developing shopping cart application different cart items have different types. each type have additional attributes. option 1: create separate class every cart item own attributes , common attributes in base class. in option, have create multiple classes , corresponding table hierarchy in database. option 2: create single cart item type attribute identify type of attribute. irrelevant attributes particular cart item null in case. i know basic question want know how people follow best practices. thanks in advance. i use strategy this, example: public interface cartitem{ string getname(); bigdecimal getprice(); } only work interface in shopping cart. way, if want new cart item, let implement interface, , work :) by using interface, still have full freedom in how design actual cart items (either having 1 class, or multiple classes)

ios - What is the timing curve for [UIView animateWithDuration:delay:usingSpringWithDamping...] -

the curve uses superficially appears damped oscillator, except able specify duration of animation , ends @ target on time. reaches point regardless of damping set, without either delay @ end or (i don't think) being interrupted @ end. so, have idea how curve calculated? can done putting more clever coefficients damped spring? want able write own version support ios <7 same quality of behavior, , replicate closely possible.

node.js - Using Model method waterline -

i'm starting koa , waterline orm. have problem when try use "testfucntion" method waterline model controller: "use strict"; //https://github.com/balderdashy/waterline-docs var waterline = require('waterline'); var bcrypt = require('bcrypt'); var user = waterline.collection.extend({ identity: 'user', connection: 'default', attributes: { username: { type: 'string', required: true, }, password: { type: 'string', minlength: 6, maxlength: 21 } }, //test function testfucntion: function *(params) { ... console.log('inside'); } }); the code i'm using execute method : function *(){ var params= this.request.body var usermodel = this.models.user; var result = yield usermodel.testfucntion(params) } i dont know if kind of functions public , how can use outs

c# - Using XPath and WebBrowser Control to select multiple nodes -

Image
in c# winforms sample application have used webbrowser control , javascript-xpath select single node , change node .innerhtml following code: private void mainform_load(object sender, eventargs e) { webbrowser1.documenttext = @" <html> <head> <script src=""http://svn.coderepos.org/share/lang/javascript/javascript-xpath/trunk/release/javascript-xpath-latest-cmp.js""></script> </head> <body> <img alt=""0764547763 product details"" src=""http://ecx.images-amazon.com/images/i/51ak1mrii7l._aa160_.jpg""> <hr/> <h2>product details</h2> <ul> <li><b>paperback:</b> 648 pages</li> <li><b>publisher:</b> wiley; unlimited edition edition (october 15, 2001)&

Unix Search (grep) -

i new unix , know command search words in file through grep. with command 'grep star file.txt | grep ptext | grep snum > results.txt' the grep command return following content includes other details tag along same line. star=20140201 14:01:05|ptext=sample1|subm=retapp@s01gretcd1|sbid=retapp|snum=232356|.... star=20140201 14:02:05|ptext=sample2|subm=retapp@s01gretcd1|sbid=retapp|snum=556677|... star=20140201 14:03:05|subm=retapp@s01gretcd1|sbid=retapp|snum=768764|.... star=20140201 14:03:05|ptext=sample3|subm=retapp@s01gretcd1|sbid=retapp|snum=768764|.... is there way results follow: star=20140201 14:01:05|ptext=sample1|snum=232356|.... star=20140201 14:02:05|ptext=sample2|snum=556677|... star=20140201 14:03:05|ptext=sample3|snum=768764|.... results expected : rows includes 3 variables without other redundant data thank you use awk , select columns need. set input , output field separator | data delimited that. once line split, pick columns nee

xamarin.ios - How to use Ninject property injection from UITableViewController? -

i using portable.ninject in xamarin.ios app , inject services on properties. [inject] on property doesn't work because viewcontroller isn't created ninject. how can use ninject property injection in uitableviewcontroller ? you can use kernel.inject(myfooinstance) have ninject perform property injection on existing objects. properties still need [inject] attribute.

java - Source codes have comments after decompiled by JD Decompiler tool -

Image
i have converted classes files source codes jd gui tool. open file using jd-gui version 0.3.5. open file folder, click "save sources". have found out there comments in source codes. eg: /* */ /* */ @managedbean /* 60 */ @sessionscoped how remove comments? need change setting under help > preferences , there can uncheck following settings in image;

angularjs - How to register the event in $scope using handlebar in twitter typeahead -

Image
i using latest twitter typeahead using custom templates using angularjs. i able desired output have button in custom templates appears when enter in dropdown. here plunker : http://plnkr.co/edit/u5zkxhry0bcu6u5r0wup?p=preview now when click on add button event not getting fired. think event not getting registered in $scope. how can on here ? $('#prependedinput').typeahead({ hint: true, highlighter: function (x) { return x; }, minlength: 3, }, { name: 'members', displaykey: 'value', source: getusersearchdata, templates: { suggestion: handlebars.compile('{{member}}') } }); handlebars.registerhelper('member', function (items) { var item = this; var items = '<li><a><div class="row"><img style="height: 40px; float:left" src=

arrays - xcode6-beta5 crashes when creating a dictionary -

Image
i'm little puzzled why switching xcode6-beta4 xcode6-beta5 bring breaking changes app! however, here looking at, this code belongs view controller. i'm not sure other information helpful. trying things @ point... and in console read fatal error: array element cannot bridged objective-c , leads me think can't have nsdictionary in array? i rewrote var suggestions:array<dictionary<string, string> > = [["str1": "s1", "str2": "s2"]] but don't know why can't have nsdictionary in swift array.

c++ - 3d object overlay - augmented reality irrlicht + opencv -

i trying develop augmented reality program overlays 3d object on top of marker. model not move along(proportionately) marker. here list of things did 1) using opencv: a) used solvepnp method find rvecs , tvecs. b) used rodrigues method find rotation matrix , appended tvecs vector projection matrix. c) testing made points , lines , projected them make cube. works fine , getting output. 2) using irrlicht: a) tried place 3d model(at position(0,0,0) , rotation(0,0,0)) camera feed running in background. b) using rotation matrix found using rodrigues in opencv calculated pitch, yaw , roll values post(" http://planning.cs.uiuc.edu/node103.html ") , passed value onto rotation field. in position field passed tvecs values. tvecs values tvecs[0], -tvecs[1], tvecs[2]. the model moving in correct directions not moving proportionately. meaning, if move marker 100 pixels in x direction, model moves 20 pixels(the values 100 , 20 not measured, took arbitrary values illustrate exampl

logistic regression - glm function in R uses incorrect coefficient? -

i have test scores of 2 groups, , b. test.a=c(1.12, 1, 2, 1.4, 2) test.b=c(2, 1, 1.5, 1.7, 1) if person scores on 1.1, want label him/her positive. test.a=ifelse(test.a>1.1,'positive','negative') test.b=ifelse(test.b>1.1,'positive', 'negative') test.ab=c(test.a, test.b) the status binary response variable indicates whether person has disease or not (0 = no diseae, 1=disease) status=c(rep(0,2), rep(1,3)) status=as.factor(status) test.ab=as.factor(test.ab) test.data=data.frame(status, test.ab) test.fit=glm(status~test.ab, data=test.data, family="binomial") summary(test.fit) the summary function returns call: glm(formula = status ~ test.ab, family = "binomial", data = test.data) deviance residuals: min 1q median 3q max -1.58 -0.90 0.82 0.82 1.48 coefficients: estimate std. error z value pr(>|z|) (inte

c++ - Why cstdio includes stdio.h? -

i've found std lib header cstdio ( libcxx implementation line 100 ) include stdio.h . clang (using via libclang - c api) diagnostics reports stdio.h not found (in device specific environment i'm configuring). seems include paths problem (-i) , i'm trying understand dependencies , reason , build correct includes path.

regex - How to use Regular Expression In Find and Replacement -

i've 1 csv file has 50k records. want remove unnecessary records file. can tell me how can achieve regex through find , replacement? the data looks this: item code,,qty cmac-389109,,6 ,serial no., ,954zg5, ,ffnaw8, ,gh8731, ,gxj419, ,hc6y9q, ,y65vh8, cmac-394140,,1 ,serial no., ,4cu3z7, and want convert data below format: itemcode,serial number,qty cmac-389109,"954zg5, ffnaw8, gh8731, gxj419, hc6y9q, y65vh8",6 cmbm-394140,"4cu3z7",1 here's regex captures 2 groups ( item code , shelf ): ^([^,]*?)(?:,(?:[^,]+)?){5},([^,]+),.*$ i don't know syntax dw uses reference groups. it's either $n or \n , in case, can put $1, $2 in "replacement" field of search/replace box. or \1, \2 . if have access linux environment (os-x , cygwin should work too), can use command-line tools cut , grep accomplish quite easily: cat <filename> | cut -d ',' -f 1,7 | grep -v "^,$" > <output_file> the

jquery - is it possible to keep button with fixed position after zoom in or zoom out on mobile -

i working on website having fixed position button works fine on desktop can possible keep button on fixed position after zoom in or zoom out on mobile device. or can reposition button on zoom in or zoom out. css: .exit { text-align:center; } .exit.btn{ position: fixed; bottom: 40px; } html: <div class="exit"> <a href="/" class="btn btn-blue">exit</a> </div> you can set this: <div class="row"> <div class="col-lg-4 col-lg-push-6 text-center"> <div class="exit"> <a href="/" class="btn btn-blue">exit</a> </div> </div> </div> this make sure div holding button stay while change screen size.

javascript - How can I add links to dendrogram texts? -

i have applied clustered dendrogram show organization's structure. works well. in addition, want add links node texts. i have added "url" keys json array each node { "name": "institutes", "children": [ { "name": "social", "url": "http://social.example.com/" }, { "name": "health", "url": "http://health.example.com/" }, { "name": "nature", "url": "http://nature.example.com/" }, { "name": "education", "url": "http://social.example.com/" } ] } there 2 problems: <a> tags not wrap <text> element. displayed <a></a><text></text> . want <a><text></text></a> . how can read url key json in order add href attribute's value (see line comment //??? ) ? d3.json

how to use PinStrap plugin for bootstrap site? -

i want use pinstrap plugin site images uploaded users , might exist in size pinterset. now how can use plugin, mean html structure needed, or whats css file or js file add project? it wordpress theme. need create wordpress account integrate theme necessary files css js , html structure.

GIT Setup and access via IIS on remote server on local network -

thank reading question. case: development machine win7 / server win2012 - both on same network , same login , credentials (have admin access server) installed git & github on server , created bare directory in shared directory , gave permissions required parties including myself installed git on local machine well. on server pointed iis shared directory virtual directory locally, on both machines there no issues , can configure locally. have source code need push new git setup examine if work in team. problem: can not connect local machine remote git server. comments , process far: all examples happily cover unix environments , url samples across net refer unix path structure. need on how share (direct examples / commands) git via iis on win2012 server , how add remote iis shared repository local machine. can access server via https in browser. help!!! :-d everybody. after spending more days work out basic solution, came point have chosen basic i

image - Wpf Document viewer -

in wpf application (.net 4.0, win7), i'm using fixed document , document viewer allow user print , view document. this document displays both images , text , in document viewer every thing looks fine. but when same document printed on paper printed images looking bit dark , not acceptable. i can export same document pdf, , quality looks same in document viewer. but when pdf document printed, same issue (images printing dark) can seen. we have similar applicaiton documents (contains similar images , text previous) designed through dev express , looks dev express takes care of printing. when these dev express documents printed cant see black image issue. images looking fine. but when these documents exported pdf , print though windows same dark image problem seen again. is possible adjust printer settings print images in screen? dev express optimizations before printing?

java - Unable to convert null String into JSON object -

this question has answer here: how set value null org.json.jsonobject in java? 1 answer this code work fine me when take output response in form of string code is: try { string id; string uname; string arg = "{\"id\":\"ets7qkt1luugsj828jugs8vuq5\",\"module_name\":\"users\",\"name_value_list\":{\"user_id\":{\"name\":\"user_id\",\"value\":\"1\"},\"user_name\":{\"name\":\"user_name\",\"value\":\"dbmadmin\"},\"user_language\":{\"name\":\"user_language\",\"value\":\"en_us\"},\"user_currency_id\":{\"name\":\"user_currency_id\",\"value\":\"-99\"},\"user_is_admin\

how to capture trap message in net-snmp -

i work net-snmp , try few commands like: snmptrap -v 1 -c public host trap-test-mib::demotraps localhost 6 17 '' \ snmpv2-mib::syslocation.0 s "just here" snmptrap -v 2c -c public localhost '' notification-test-mib::demo-notif \ snmpv2-mib::syslocation.0 s "just here" snmptrap -v 1 -c public host net-snmp-examples-mib::netsnmpexampleheartbeatnotification "" 6 17 "" \ netsnmpexampleheartbeatrate 123456 but give me new line without error or something can give me advice ? netsnmp provides snmptrapd purpose. it application can listen on port (default 162) on host traps , log received. //edit ... here example ... snmptrapd -f -m +all -lo -c /tmp/snmptrapd.conf 9876 where /tmp/snmptrapd.conf contains 1 line simplicity disables community/password checking disableauthorization yes use man snmptrapd see flags/arguements mean.

Rally Java lookback api do not work behind Proxy -

i'm trying use rally lookback java api , throws exception saying com.rallydev.lookback.lookbackexception: org.apache.http.conn.httphostconnectexception: connection https://rally1.rallydev.com refused @ com.rallydev.lookback.lookbackquery.execute(lookbackquery.java:61) i figure out error due inaccessibility rally server due corporate proxy setup. unlike rally rest api gives setproxy() method set proxy server works me, there no provision lookback api set proxy , throws error. i'm trying out on windows machine,and expecting workaround or solution same platform. thanks, sagar i have forked repo , have made changes. have open pull request reviewed shortly , we'll pushed main repo. here's link branch. https://github.com/trevershick/rally-lookback-toolkit/tree/s72258 if want clone repo , 'mvn package' source generate .jar file you can use. it's same interface 1 you're using has setproxyserver , setproxycredentials authenticat

jquery - Using tables inside Accordion -

how can use html table inside accordion?? i have code: <div id="accordion"> <h3>section 1</h3> <div> <p>div 1 contents</p> </div> <h3>section 2</h3> <div> <table> <tr> <th>a2</th> <th>b2</th> <th>c2</th> </tr> </table> </div> <h3>section 3</h3> <div> <table> <tr> <th>a3</th> <th>b3</th> <th>c3</th> </tr> </table> </div> <h3>section 4</h3> <div> <table> <tr> <th>a4</th> <th>b4</th> <th>c4</th> &

Alfresco: Folder permission by role -

problem: have space template use folder structure share sites document library . our aim make visible folders special users have custom role (created in sitepermissions.xml). can groups need roles (e.g. when invite external user, wish assign him internal role can automatically see folders). please clues. short version: need need assign role (i.e. collaborator) user either directly or indirectly using group. generally speaking, access on node controlled access control lists each list entry triplet (authority, permission, allow-or-deny). groups , individual people authorities, roles sets of permissions. alfresco "only" allows add/remove (allow-)entries authority , permission/role. at end of day, users role (on space!) depends on whether he/she assigned role directly {john,collaborator} or indirectly via {group_containing_john, collaborator}. furthermore assignment (which sticks node) propagates through space hierarchy unless inherit permissions disabled.

label - Modifying the simple_form lable -

i need add span in label being generated simpleform. goal able use this coffeescript validate field presence. currently looks like: <div class="control-group form-group string optional dealer_website"> <label class="string optional control-label" for="dealer_website"> website </label> <div class="controls"> <input class="string optional form-control" id="dealer_website" name="dealer[website]" size="50" type="text"> </div> </div> i need like: <div class="control-group form-group string optional dealer_website"> <label class="string optional control-label" for="dealer_website"> website <span class="error-message"></span> </label> <div class="controls"> <input class="string optional form-control" id="dealer_we

php - Database text in textarea shows <p> -

Image
my situation following: i have database "description" column of type text. in html, column represented textarea. when i'm entering text: then, how stored in database: then, on front-end: as can see, displaying < p > tags. this code showing textarea on both front-end back-end: echo '<textarea class="form_textarea os-input" name="' . $this->getname() . '" id="form_' . $this->getname() . '"'; $required = $this->getrequired(); if(isset($required) && $required == true) { echo ' required'; } echo '>' . $this->getvalue() . '</textarea>'; both front-end , back-end use same database, in front-end looks different. both front-end , back-end use same code showing form (and thereby textarea) there no special escaping @ all. no use of nl2br or etc. i'm using wordpress this weird part: when print on screen, without textarea:

java - What could the reason of the exception 'org.hibernate.QueryException Message Not all named parameters have been set:' possibly be? -

so trying execute following query in grails user user = springsecurityservice.currentuser def approvergrouplist = approvergroupservice.getapprovergroupsbyuser(user.id) return verificationrequest.executequery("select distinct v.fundtransfer verificationrequest v v.fundtransfer.creator.corporatehouse=:corporatehouse , v.verified = false , v.fundtransfer.status ='queued' , v.approvergroup in (:approvergrouplist)", [corporatehouse:corporatehouse],[approvergrouplist:approvergrouplist]) however getting following exception : /fund-transfer/list-verification-requests class org.hibernate.queryexception message not named parameters have been set: [approvergrouplist] [select distinct v.fundtransfer verificationrequest v v.fundtransfer.creator.corporatehouse=:corporatehouse , v.verified = false , v.fundtransfer.status ='queued' , v.approvergroup in (:approvergrouplist)] also corporatehouse object that's passes method executing query , not null. rea

python - Openpyxl missing 'jdcal' -

i tried install openpyxl module, during installation showed errors jdcall . when try import it, error: traceback (most recent call last): file "c:\andrzej\workspace\sandbox\sandbox.py", line 7, in <module> import openpyxl file "c:\python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\__init__.py", line 29, in <module> openpyxl.workbook import workbook file "c:\python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\workbook\__init__.py", line 25, in <module> .workbook import * file "c:\python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\workbook\workbook.py", line 35, in <module> openpyxl.worksheet import worksheet file "c:\python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\worksheet\__init__.py", line 25, in <module> .worksheet import * file "c:\python34\lib\site-packages\openpyxl-2.0.5-py3.4.egg\openpyxl\worksheet\worksheet.

python - Filter by rank of one index level in Pandas? -

i have dataframe customer id , date , price , want aggregate prices except purchase of each id on first date. df=pd.dataframe([[1,1,1],[1,1,1],[1,2,1],[1,2,4],[1,3,1],[2,2,1],[2,3,3]], columns=["id", "date", "price"]) s=df.groupby(["id","date"]).price.sum() # id date # 1 1 2 # 2 5 # 3 1 # 2 2 1 # 3 3 i'd sum prices except ones on smallest dates each id (date 1 id 1; , date 2 id 2). result 5+1+3=9. so, i'd have rank on part of index with-in groups , combine result previous aggregation? any suggestions? you can sort level follows: s = s.sortlevel([0,1]) we can first sum group (ignoring first unit), , sum on result in[153]: s.groupby(level=0).apply(lambda x: sum(x.iloc[1:])) out[153]: id 1 6 2 3 dtype: int64 in[154]: s.groupby(level=0).apply(lambda x: sum(x.iloc[1:])).sum() out[154]: 9 if want more advanced stuff not follow logic iloc[] operato

android - Downloading and installing an application in the system/app on a un-rooted device -

is possible install application in system/app directory on un-rooted device? right can on rooted device, wondering have if device not rooted, custom rom can hold of certificates signed rom. if try on un-rooted device permission denied (read_only file system). if has idea of how can please me, reason why need done can app updates on system applications shipped rom , wont on app store.

php - Yii - simplify retrieving the $_POST var data using getPost() -

i have following yii code , minimise if possible: $request = yii::app()->request->getpost('request'); $username = $request['model']['username']; is possible minimise have work on single line instance? (note code below doesn't work) $username = yii::app()->request->getpost('request['model']['username']'); as can see below (in class chttprequest ): public function getpost($name,$defaultvalue=null) { return isset($_post[$name]) ? $_post[$name] : $defaultvalue; } if can put in $name , returned :d

Where do I set the atlassian-plugin-sdk 'allowGoogleTracking' option to false? -

i have installed/setup atlassian-plugin-sdk can jira plugin development. however, when run "atlas-run-standalone --product jira" command , starts jira instance, tries connect google analytics , gets connection refused (its being blocked our proxy). it says can turn tracking option off: you may disable tracking adding <allowgoogletracking>false</allowgoogletracking> amps plugin configuration in pom.xml my question is, find "allowgoogletracking" option? in pom.xml cant seem find 1 in "atlassian-plugin-sdk" directory. i have tried googling , looking around, cant seem find anywhere tell me pom.xml file supposed edit. from documentation: amps sends basic usage events google analytics default. disable tracking, either: add <allow.google.tracking>false</allow.google.tracking> <properties> section of .m2/settings.xml file include <allowgoogletracking>false</allowgoogletracking> i