Posts

Showing posts from June, 2010

jquery - ASP.Net MVC - updating areas of page based on drop down lists -

i have product page has 3 x drop down lists allow visitor select product attributes - example pair of trousers colour / waist size / leg length. currently have drop downs hooked cascading use of jquery , json - each selection populates next drop down list down hierarchy calling jsonresult action via jquery within page. when selections made, , visitor has decided upon product variant, need update page contents - elements such price / image / stock availability / long description , table of specifications can product variant specific. these page elements need change distributed throughout markup rather being in 1 block complicate matters little. currently page (view) has these elements within main view - best way achieve changing page reflect visitors choice? this webforms app made use of several updatepanels achieve same thing, relative mvc newbie i'm not sure of approach tackle kind of problem? thanks. basically have 3 major options: display prerendered vi...

c# - ASP.NET Build Error : The type exists in both dlls -

while building project, got below error message. the type 'tracker_ascx' exists in both 'appdata\local\temp\190\temporary asp.net files\root\web_tracker.ascx.7a9a6bd4.fnv2mhdj.dll' , 'appdata\local\temp\190\temporary asp.net files\root\web_tracker.ascx.7a9a6bd4.pxdl7dxj.dll'. the application runs in .net framework 4.0 this happend because may have reference of old dlls if u added new version. clean solution , rebuild it.

collections - Polymorphism in Java -

why uses polymorphism in java while using collections. what difference between these initializations. private list<order> orderlist = new arraylist<order>(); private arraylist<order> orderlist = new arraylist<order>(); in second form, orderlist can treated arraylist<order> or inheriting arraylist<order> . in first form, orderlist treated list<order> , recommended when use functionality defined list<t> interface. way code more flexible , can refactored (e.g. realize need linkedlist<t> instead, change initialization , of code not need changed). also, helpful code refactoring use interfaces instead of actual types, if possible (e.g. use parameters of type list<t> instead of arraylist<t> ), because allows caller change list type without changing in called function.

C++ what is the difference between static and dynamic declaration internally -

i have 2 codes: normal: int* p[5]; (int i=0;i<5;i++){ int s = rand()%25; p[i]=&s; } dynamic: int* p[5]; (int i=0;i<5;i++){ int* s = new int; *s = rand()%25; //edit: typo, didn't want make random pointer p[i]=s; } now if print array p, p[i] first , then: *p[i] after it, get: static dynamic 0x22ff04 7 0x22ff30 7 0x22ff04 7 0x22ff24 14 0x22ff04 7 0x22ffa6 2 0x22ff04 7 0x22ff89 8 0x22ff04 7 0x22ff13 21 now why elements in p pointing @ same location normal declaration while in dynamic declaration there multiple objects created? why this? in first case, entries point s , left dangling moment s goes out of scope. dereferencing p[i] leads undefined behaviour. in second case, each entry points separate heap-allocated object. here, there's no undefined behaviour (but there's memory leak).

pass data from java to python and back jython -

i using jython run python script java. able send data python script command line arguments when invoke script using pythoninterpreter . now want call java method within jython script, passing list method argument. how do that? i posting code both passing of data java -> python , python -> java. hope helps !! in this, string array "s" passed python script , python, "city" list passed python java through function call getdata(). javaprog.java: import org.python.core.pyinstance; import org.python.util.pythoninterpreter; public class javaprog { static pythoninterpreter interpreter; @suppresswarnings("resource") public static void main( string gargs[] ) { string[] s = {"new york", "chicago"}; pythoninterpreter.initialize(system.getproperties(),system.getproperties(), s); interpreter = new pythoninterpreter(); interpreter.execfile("pyscript.py"); pyinstance hello =...

javascript - Nodejs mongodb fetching document size without actually fetching cursor -

my question is, how can cursor size (in kbs) without fetching ? i've examined lot of question such here don't want fetch query result learn how kb it. i want like: var mongoclient = require('mongodb').mongoclient, test = require('assert'); mongoclient.connect('mongodb://localhost:27017/test', function(err, db) { var collection = db.collection('simple_query'); // insert bunch of documents testing collection.insertmany([{a:1}, {a:2}, {a:3}], {w:1}, function(err, result) { test.equal(null, err); collection.find(/**some query*/).size(function(err, size) { test.equal(null, err); test.equal(32111351, size); // in bytes or kilobytes whatever db.close(); }); }); }); something this? var avgsize = db.collectionname.stats().avgobjsize; // ... collection.count(/* query */, function(err, count) { var approximatesize = count*avgsize; // work simple database models } i know not perfect,...

c# - .NET: class definition explanation -

i understand basic inheritance , understand basics of generics. but not understand class definition: public class exportcontroller : abstractfeedcontroller<iexportfeed> the exportcontroller inherits abstractfeedcontroller ... but, <iexportfeed> do/mean? generics? yes, generic definition. in short, abstractfeedcontroller defines generic implementation can applied various types including iexportfeed in case. look @ definition of class abstractfeedcontroller , see class abstractfeedcontroller<t>{ ... in class see type t used multiple times. whenever see t , can swap in mind type think can apply. in class definition, might see where t : ... . condition on type t , limiting kind of types class can use. read this msdn article in-depth explanation.

ios - Xcode: Undefined symbols for architecture i386 -

honestly, i'm quite inexperienced in obj-c. i've looked solution on stack overflow , other pages hard i'm still not able fix issue. final project in school have program ios-app should able display data mysql-database. checked out article of code chris ( http://codewithchris.com/iphone-app-connect-to-mysql-database/#creatingphpservice ) , tried modify specifications school. so here's error: undefined symbols architecture i386: "_objc_class_$_data", referenced from: objc-class-ref in homemodel.o ld: symbol(s) not found architecture i386 clang: error: linker command failed exit code 1 (use -v see invocation) as found out means homemodel-file wants access "data"-class defined in "data.h". have imported "data.h" "homemodel.m" (and "homemodel.h" although unnecessary think). does know how fix this? ps: checked "compile sources" of project. i had same issue , warning disappeared after ...

c# - How do I add a Report column with data derived from a method call or dll call -

i maintaining report in vs 2013 gets user data table in sql using c#. connected sql , has dataset table. the report displays data, want add user name. user name not stored on table. seem unable add field dataset tied table. plan add field , populate upon load dll call or following vb code... public function getname(lanid string) string dim app microsoft.office.interop.outlook.application dim appnamespace microsoft.office.interop.outlook._namespace dim recip microsoft.office.interop.outlook.recipient dim ae microsoft.office.interop.outlook.addressentry app = new microsoft.office.interop.outlook.application appnamespace = app.getnamespace("mapi") recip = appnamespace.createrecipient(lanid) recip.resolve() try ae = recip.addressentry catch ex exception getname = "not found" exit function end try dim name string name = ae.name getname = name end function i have tried following #...

javascript - D3.js Multiple Line Chart -

i tried show 2 line chart using d3.js, i can display first chart "blob", but doesn't work "blub"!! how can fix , how simplify loop? var canvas=d3.select("body") .append("svg") .attr("width",500).attr("height",300); var donnees= { blob:[ {x:10,y:20},{x:20,y:60}, {x:30,y:70}, {x:40,y:202},{x:50,y:260}, {x:60,y:70}, {x:70,y:75},{x:80,y:70}, {x:90,y:0} ], blub:[ {x:100,y:20},{x:110,y:20},{x:120,y:60}, {x:130,y:70}, {x:140,y:32},{x:150,y:60}, {x:160,y:90}, {x:170,y:75},{x:180,y:100}, {x:190,y:20} ] }; var groupe= canvas.append("g") .attr("transform", "translate(20,20)"); var line= d3.svg.line() .x (function(d){return d.x}) .y (function(d){return d.y}); var colors = d3.scale.category20(); var index = 0; (var in donnees) { groupe.selectall("path") .data([donnees[i]]) ....

python - How to display the variable in a tkinter window? -

i new python , working on following code made big of fellow stackflow user. after running script tkinter window open can select gcode file (it file many many lines of instructions 3d printer) , later specific value file found. what achieve to: 1) display value under load gcode button in tkinter window description/label. 2) make calculations on value , display them in tkinter window too. 3) finaly make executable of script can use it, without python installed. i not sure if super easy or it's lot of work new python (and not in programming overall). hope have explained things enough , thank in advance input! gcode file code testing: gcode file finaly code: from tkinter import * import re tkinter import messagebox tkinter import filedialog # here, creating our class, window, , inheriting frame # class. frame class tkinter module. (see lib/tkinter/__init__) class window(frame): # define settings upon initialization. here can specify def __init__(self, ma...

How to make xor result equal in c# and javascript -

i'm trying convert javascript code c# code. @ point, in javascript, have expression this: var result = 8797569417216^909522486; the result variable contains value 1849046582. have heard javascript uses 32bit numbers bitwise operators, don't know how use information same results in c#. when ran same line of code, result contains 8797942068790. what missing? you can convert result int : var result = 8797569417216^909522486; var realresult = unchecked((int) result); note unchecked, because value larger int32.

c# - enable javascript on webbrowser control win ec 7 -

this first post in here. searched on web solution problem, have not found nothing. read webbrowser haven't support javascript in win ec7. but first question is: -why web page javascript works fine in ie in wec7 , doesn't work in webbrowser on same platform? i enabled script options control panel, still not works. how can make page works in webbrowser works in ie? thanks in advance or tips. bennaloz q. -why web page javascript works fine in ie in wec7 , doesn't work in webbrowser on same platform? a. the compact framework has smaller operating system full blown windows, otherwise large fit on device. to make compact framework smaller, many features microsoft not foresee use left off. when windows ce , windows mobile first introduced, not many people trying use these devices @ online content. web browser included, lot of things in web browser limited (for same reasons). therefore, javascript may work while other javascript not. nothing...

c# - Get the largest Value from table unless null -

i'm quite new c# , asp.net (and programming in general) , try simple exercises. what trying do: build simple mvc app records have versions. is: given record, change via "edit"-view, record not overwritten. instead new record created (like new version). both, old , new record, have same itemid (which not primary key!), links them "semantically". in order know, record newer version, newer record has versionid +1 versionid of older one. currently: i've started working on create-action. new record shall value of 1 it's versionid , itemid largest itemid in db plus 1 - unless there no record in db in case itemid shall 1. the model: namespace howtoupdate.models { public class itemwithversion { public int id { get; set; } public int itemnr { get; set; } public int versionnr { get; set; } public string name { get; set; } } } the controller action: [httppost] [validateantiforgerytoken] public actionresu...

ios - Instantiate view from nib throws error -

Image
i tried make @ibdesignable uiview subclass following ( link ) tutorial. first custom view goes fine. when try make one, have errors. first got failed update auto layout status: agent crashed , failed render instance of ... . somehow started able biuld , run project these errors, new error - exc_bad_access ... on line let view = nib.instantiatewithowner(self, options: nil)[0] as! uiview . here whole method: func loadviewfromnib() -> uiview { let bundle = nsbundle(forclass: self.dynamictype) let nib = uinib(nibname: "advancedcellview", bundle: bundle) let view = nib.instantiatewithowner(self, options: nil)[0] as! uiview return view } with first custom uiview no problem. use same code.. any ideas? thank you the loadviewfromnib() method post looks fine, you're getting bundle correctly , specifying nib name string literal, should find nib. else commented, there's wrong set of nib instead. here few things chec...

node.js - Slice specific keys in javascript object -

in rails, have special slice method keep in hash keys need. handy permit required keys in hash. is there method in node.js ? in javascript there not such method, in libraries lodash there method called _.pick var data = { a: 1, b: 2, c: 3 }; console.log(_.pick(data, 'a', 'c')) <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js"></script> you can install lodash via npm npm install lodash --save and require project var _ = require('lodash') // import methods // or import pick method // var pick = require('lodash/object/pick');

c++ - Background subtraction with shadow removal -

i'm working kth dataset contains videos basic human action. i've tried subtract background using opencv-2.4.9 backgroundsubtractormog2 , still getting shadows in result. here code (written in c++) i'm using: #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/video/background_segm.hpp> //c #include <stdio.h> //c++ #include <iostream> #include <sstream> using namespace cv; using namespace std; //global variables mat frame; //current frame mat fgmaskmog2; //fg mask fg mask generated mog2 method ptr<backgroundsubtractor> pmog2; //mog2 background subtractor int keyboard; //function declarations void processvideo(char* videofilename); int main(int argc, char* argv[]) { pmog2 = new backgroundsubtractormog2(); //mog2 approach pmog2->setint("nmixtures",3); pmog2->setdouble("ftau",0.5); processvideo("person14_boxing_d1_uncomp.avi");// r...

github - GIT | Set default branch using org.kohsuke java API -

i exploring org.kohsuke java api perform git operations.i create git repo , created branch well. not finding way set branch created default branch in git using java api. can assist me on this. please find code snippet below ghorganization organization = github.getorganization(organizationname) map<string,ghteam> teams = organization.teams ghrepository repo = organization.createrepository reponame, null, null, teams.'backend-developers', true ghcontentupdateresponse commitresponse = repo.createcontent "read me "+reponame, "readm me "+reponame, "readme.md" repo.createref("refs/heads/testbranch", commitresponse.getcommit().getsha1()) //creating test branch here working. //but below line doesn't work repo.setdefaultbranch "refs/heads/testbranch" i believe have right idea; appear though original snippet missing parentheses. said, repo.setdefaultbranch("branch-name"); is correct kohsuke's gi...

android - Collapsing Toolbar Layout expand on click event and not on scroll -

i have simple toolbar info icon item on right. when click on item expand toolbar animation. new view , fab button. textra sms doing. when clicking outside expanded toolbar, want colapse toolbar. i looking how can handle collapsingtoolbarlayout? possible? example find on web collapsing/expanding scroll of the view (recyclerview, scrollview etc...). don't want toolbar move when scrolling view. it way use collapsingtoolbarlayout? or need myself? collapsingtoolbarlayout seems fine purpose (and believe make layout better 1 in textra sms app). you need few things: a way disable collapsingtoolbarlayout . best way in opinion (at least best found far) use custom coordinatorlayout instead of regular coordinatorlayout . public class disableablecoordinatorlayout extends coordinatorlayout { private boolean mpassscrolling = true; public disableablecoordinatorlayout(context context) { super(context); } public disableablecoordinatorlayout(cont...

ios - Image Scalling with multiple UICollectionView -

Image
i building tvos app. have uitableview has around 25-30 sections. each section has 1 row , in each row have 1 horizontal uicollectionview has 1 section many rows. in each row in uicollectionview have image view scale when uicollectionviewcell selected. i know can adjustsimagewhenancestorfocused case little more complicated. have 2 imageviews in uicollectionviewcell using adjustsimagewhenancestorfocused on bigger imageview if use on smaller imageview bad. that's why have use scaling on smaller imageview. the issue facing when somewhere uicollectionviewcell indexpath messing up, results when go new uicollectionviewcell smaller image scaled , becomes bigger , bigger , cells very big because of on scaling here image storyboard setup here code great. func collectionview(collectionview: uicollectionview, didupdatefocusincontext context: uicollectionviewfocusupdatecontext, withanimationcoordinator coordinator: uifocusanimationcoordinator) { guard let next...

spring - Entity getting saved without @Transactional -

we facing issue related spring @transactional , have controller , service class, though service class not marked @transactional , entity getting saved. using @enabletransactionmanagement(proxytargetclass = true) , openentitymanagerinviewinterceptor spring data jpa . guess info may not sufficient insight on possible reasons behavior. few logs before entity persistence 2016-01-07 20:58:15,393 debug [org.springframework.data.repository.core.support.transactionalrepositoryproxypostprocessor$customannotationtransactionattributesource] (default task-23) adding transactional method 'save' attribute: propagation_required,isolation_default; '' 2016-01-07 20:58:15,393 debug [org.springframework.transaction.jta.jtatransactionmanager] (default task-23) creating new transaction name [org.springframework.data.envers.repository.support.enversrevisionrepositoryimpl.save]: propagation_required,isolation_default; '' 2016-01-07 20:58:15,394 debug org.hibernate.engine.tra...

java - JCheckBox selecting 1st option automatically -

i'm developing system that, once selected field of jcombobox , change text of jbutton , connected offline depending on status of field written in jcombobox . all has been done, have problem. when run program, system automatically enters event addactionlistener , not have ever selected field of jcombobox ? can give me hand? edited in answer ... block of code (under) wrote method executed before combobox.addactionlistener. code, wrote, beacause have need popolate dinamically elements of jcombobox... private void actionofsearch(){ table.addmouselistener(new mouseadapter(){ public void mouseclicked(mouseevent me){ if(ipavailable){ blocksetremoteunit = false; timer = new timer(10000, new actionlistener() { public void actionperformed(actionevent e) { //extracted_values vector<stirng> if(typeofconnection.equals("abc") || typeofconnection.equals("def")) extracted_values...

mysql - Compare a rows in a table for simularites and diffrences -

i have issue need block bots on site , need list of there account block question answer this. same account using different ip address @ same time. need simple table of account numbers can copy , paste security if account number appears 2 or more times under different ip address @ same time show me account number. here example of table working with. table temp1 account ip last_used 14k4chc 79.110.19.199 2016-01-07 09:06:52 17ffhqy 79.110.19.199 2016-01-07 09:06:52 14k4chc 91.215.136.75 2016-01-07 09:06:52 17ffhqy 91.215.136.75 2016-01-07 09:06:52 15lessr 193.9.158.98 2016-01-07 09:06:51 lines 1 thru 4 example of same 2 accounts using 2 different ip addresses @ same time spamming site , possible bot. as starting point, identify different ip addresses same account , last_used time, use query this: select t.account , t.last_used , count(distinct t.ip) cnt_ip temp1 t group t.account, t.la...

Java / Grails : Send SMS from application -

i have training management system in grails (grails version 2.0.4) my requirement whenever user enrolls training must receive sms alert mobile number given while registering. sms indian mobile phones (as provide training in india) one way sms, application mobile (reply not required) is there plugins available in grails? java way of doing work fine in grails application. i have used twilio partner's app. paid service , rates international sms india here . there grails plugin available twilio but, opted write custom code send , receive messages. there issues plugin, don't remember. the barebones code looked like: def twiliohttpendpointbean = new httpbuilder("https://api.twilio.com/2010-04-01/") def sid = 'your sid here' def auth_token = 'the auth token goes here' twiliohttpendpointbean.auth.basic(sid,auth_token) def result = twiliohttpendpointbean.request(method.post) { req -> requestcontenttype = contenttype.urlenc ...

Xunit plugin (Junit) in Jenkins shows every test case as passed while this is not the case -

xunit plugin has no troubles reading xml file considers every case passed. <?xml version="1.0" encoding="utf-8" standalone="yes"?> <testsuites errors="0" failures="1" disabled="" name="processing.lvproj" tests="1" time="216"> <testsuite tests="3" time="216" name="bad pixel correction.vi" failures="1" errors="0" timestamp="1/01/1904 1:00:00" id="0" hostname="jenkins" skipped="0" disabled=""> <testcase name="test case 1" classname="0" status="failed" time="124" assertions=""/> <testcase name="test case 2" classname="0" status="passed" time="59" assertions=""/> <testcase name="test case 3" classname="0" status="passed" ti...

javascript - get characters up to first occurrence of 'x' from reverse -

i want split string first occurrence of 'dot' right left match. //if have input string follows var string = "hi.how.you" ; //i need output following output="you"; you can split dot , use pop() last element of resulting array: var string = "hi.how.you" ; var last = string.split('.').pop() //=>

git - Check length of commit message -

i have git hook should prevent commit messages have more 72 characters: #!/usr/bin/env bash # hook make sure no commit message line exceeds 72 characters while read line; if [ ${#line} -ge 72 ]; echo "commit messages limited 72 characters." echo "the following commit message has ${#line} characters." echo "${line}" exit 1 fi done < "${1}" exit 0 this working fine until now. tried rebase commit , change commit message, , git rightfully tell me: commit messages limited 72 characters. following commit message has 81 characters. # editing commit while rebasing branch 'master' on '984734a'. not amend commit after picking 19b8030dc0ad2fc8186df5159b91e0efe862b981... fill susy decay dictionary on fly when needed due empty commit message, or pre-commit hook failed. if pre-commit hook failed, may need resolve issue before able reword commit. the method use not smart. how properly? ...

c# - Details on what happens when a struct implements an interface -

i came across stackoverflow question: when use struct? in it, had answer said bit profound: in addition, realize when struct implements interface - enumerator - , cast implemented type, struct becomes reference type , moved heap. internal dictionary class, enumerator still value type. however, method calls getenumerator(), reference-type ienumerator returned. exactly mean? if had like struct foo : ifoo { public int foobar; } class bar { public ifoo biz{get; set;} //assume foo } ... var b=new bar(); var f=b.biz; f.foobar=123; //what happen here b.biz.foobar=567; //would overwrite above, or have no effect? b.biz=new foo(); //and here!? what detailed semantics of value-type structure being treated reference-type? every declaration of structure type declares 2 types within runtime: value type, , heap object type. point of view of external code, heap object type behave class fields , methods of corresponding value type. point of view of inter...

python - django admin need full table -

i have 1 (first - username) column of database displayed in admin. how can display columns in "select change" panel, on picture? in advance! need this in model admin, set list_display list of fields want display. class mymodeladmin(admin.modeladmin): list_display = ['field_1', 'field_2', ...] admin.site.register(mymodel, mymodeladmin)

javascript - How to position a React component relative to its parent? -

i have parent react component contains child react component. <div> <div>child</div> </div> i need apply styles child component position within parent, position depends on size of parent. render() { const styles = { position: 'absolute', top: top(), // computed based on child , parent's height left: left() // computed based on child , parent's width }; return <div style={styles}>child</div>; } i can't use percentage values here, because top , left positions functions of child , parent's widths , heights. what react way accomplish this? the answer question use ref described on refs components . the underlying problem dom node (and parent dom node) needed position element, it's not available until after first render. article linked above: performing dom measurements requires reaching out "native" component , accessing underlying dom node using ref. refs 1 of pr...

r - How can i rapidly explore the classes of all columns in a dataframe? -

i want rapidly explore classes of columns in dataframe, made function print columns names , arrange them class. want tell me numbers of columns aren't of class factor. columnsclass<-function (x){ a<-vector() b<-vector(mode="character") c<-vector c=0 (i in 1:dim(x)[2]){ a[i]<-paste(class(x[,i]),names(x)[i],sep="--") if (class(x[,i])!= "factor"){ c<-c+1 b[c]<<-i }} #1st print print(sort(a)) #2nd print print(paste("columns aren't factors number:",paste(b,collapse=","),collapse=" ")) } however when run it, doesn't #2nd print though code working. > columnsclass(cars) [1] "numeric--dist" "numeric--speed" [1] "columns aren't factors number: " #it doesn't print numbers of columns of class factor if run separately ,it runs > print(paste("columns aren't factors number:",paste(b,collapse=","),collapse=" "...

python - Set initial value for dynamically created ModelChoiceField in Class Based View -

i'm creating form has modelchoicefield . i'm able set values field follows: class deviceform(form): devices = modelchoicefield(queryset=none, widget=radioselect, empty_label=none) def __init__(self, *args, **kwargs): super(deviceform, self).__init__(*args, **kwargs) user_id = kwargs['initial']['user_id'] devices = device.objects.filter(user_id=user_id, is_validated=true) self.fields['devices'].queryset = devices this works perfectly, can't seem able set initial value. i've tried multiple things such adding initial value get_initial() : def get_initial(self): initial = super(deviceview, self).get_initial() initial['user_id'] = self.kwargs['user_id'] default_device = device.objects.get(user_id=self.kwargs['user_id'], is_validated=true, is_default=true) initial['devices'] = default_device.id return initial but doesn't work. i've come acr...

amazon web services - How to prevent EMR Spark step from retrying? -

i have aws emr cluster (emr-4.2.0, spark 1.5.2), submitting steps aws cli. problem is, if spark application fails, yarn trying run application again (under same emr step). how can prevent this? i trying set --conf spark.yarn.maxappattempts=1 , correctly set in environment/spark properties, doesn't prevent yarn restarting application. you should try set spark.task.maxfailures 1 (4 default). meaning: number of failures of particular task before giving on job. total number of failures spread across different tasks not cause job fail; particular task has fail number of attempts. should greater or equal 1. number of allowed retries = value - 1.

rest - Download zip file using URL in java -

i have below code download file using httpclient url. though program works downloads 3k everytime run it. have setup few proxies overcome corporate network , trying below code automate downloads external website. the site has few other files(like video, audio well). when try them size 3k. using rest interface files. there need change in code make work still ? url = "https://samforloogin.com/video.zip"; uri uri = uri.create(url); defaultproxyrouteplanner routeplanner = new defaultproxyrouteplanner(proxy); closeablehttpclient httpclient = httpclients.custom() .setrouteplanner(routeplanner) .build(); httpget httpget = new httpget(uri); httpget.setheader("authorization", "basic " + encoding); closeablehttpresponse response = httpclient.execute(httpget); java.io.inputstream = response.getentity().getcontent(); string filepath = "c:\\users\\smandodd\\appdata\\local\\temp\\8ee47df6c5a44c9d9c8ff3326d932819\\scree...

xpages: how do attachments work in a web page -

the context here that, in cms type of app, users create content reproduce notes' way of having attachments anywhere in text, not list of attachments @ bottom of page. when creating page, want able create links attachments right away, using link , img tag, not saving document first , edit again. i have found youatnotes html5 multi file upload control, enables users upload attachments before document saved. url attachment uploaded befor ethe doc saved then: http://myserver/mydb.nsf/xsp/.ibmmodres/persistence/dominodoc-new_569-body/indifference.jpg i use url in ckeditor create image , looks ok: image shows in editor , has url: /mydb.nsf/xsp/.ibmmodres/persistence/dominodoc-new_569-body/insanity.jpg i save document, , still looks good. image showing , url still: http://myserver/mydb.nsf/xsp/.ibmmodres/persistence/dominodoc-new_569-body/indifference.jpg i close browser, , open page again, , see image not showing up, url still: /belair/xbiblio.nsf/xsp/.ibmmodres/pe...

javascript - How to get slider value on click of button? -

i have range-slider has 2 ranges. want value of slider in javascript. here have done: <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script> $(function() { $("#find_match").click(function(){ alert($('#amount').val(ui.values[ 0 ])); }); $(function() { $( "#slider-range" ).slider({ range: true, min: 20, max: 60, values: [ 20, 30 ], ...

Sessions in Codeigniter with PHP7 -

the problem simple. if use $this->session->sess_destroy(); $this->session->sess_regenerate(true); i error: message: session_regenerate_id(): cannot regenerate session id - session not active filename: session/session.php line number: 625 that happens php 7 , works 5.6. figured parameter in regenerate function set destroy old session data when regenerating. when leave out sess_destroy() don't error, session data not destroyed , can't log user out. use ob_start() before session library. , before session destroying code add ob_flush() , after line set ob_clean() and set $this->session->sess_regenerate(true); false . ob_flush , ob_clean perfectly.

c++ cli - Adding a System::String^ as key in VC++ Dictionary -

i new c++, i'm stuck on i'm sure trivial. i have dictionary: dictionary<string^, room^>^ roomlist = gcnew dictionary<string^, room^>(); i'm trying add new room dictionary: room r("room 1", x, y); roomlist->add(r.getname, %r); room defined follows: ref class room { private: string^ mname; double mx; //scaled x-coordinate of top left corner (meters) double my; //scaled y-coordinate of top left corner (meters) public: room(string^ name, double x, double y); string ^ const getname() { return mname; } double const getx() { return mx; } double const gety() { return my; } }; when try compile code following error: 'room::getname': non-standard syntax; use '&' create pointer member" what doing wrong? reason can't use object's name (a system::string^) key, i'm not sure why. roomlist->add(r.getname, %r); you declared getname function, not property. needs r.getname() , note ad...

linux - how to convert asterisk in gui? -

i use virtual box use asterisknow, got command prompt , want graphic user interface? new user of asterisknow, please me. http://www.asterisk.org/downloads asterisknow software pbx available gui version can use it!

elasticsearch - How to fetch1 million documents from elastic server. -

i'm trying export data excel sheet. when try export huge amount of data , elastic search server not responding. there work around fetch huge amount of data? setting value of "size" field in elasticsearch search request large value not recommended. use scan , scroll api when want fetch such huge number of documents.

ruby on rails - How to copy file in amazon s3 Paperclip? -

i have model shop has logo and it's stored in amazon s3, want copy model company , i'm doing simply: shop = shop.find(1) company = company.find(1) company.logo = shop.logo company.save! but giving error: [paperclip] copying logos/1/original/220px-bart_simpson.png local file /tmp/dac9e3329951078b23c5deed39f3193120160107-30855-ivrdms.png no such key - cannot copy logos/1/original/220px-bart_simpson.png local file /tmp/dac9e3329951078b23c5deed39f3193120160107-30855-ivrdms.png command :: file -b --mime '/tmp/dac9e3329951078b23c5deed39f3193120160107-30855-nz0h5c.png' [paperclip] content type spoof: filename 220px-bart_simpson.png (["image/png"]), content type discovered file command: inode/x-empty. see documentation allow combination. rollback activerecord::recordinvalid: validation failed: logo has extension not match contents can hell going on here, or how it? can try as, may know version of paperclip being used. shop = shop.find(1) compa...

Key Vault and Azure Table Storage Retrieve -

when doing simple retrieve table storage seeking out encrypted data set, following error: error occurred while decoding oaep padding have created key , got key id through azure powershell. ms tutorial on works, if update , retrieve in same method call. when called individually through seperate posts/gets, above error. i'm pulling hair on 1 , starting suspect bug within azure/table storage/keyvault (encryption). appreciate if knows this. rsakey key = new rsakey("mykeyid"); tablerequestoptions retrieveoptions = new tablerequestoptions() { encryptionpolicy = new tableencryptionpolicy(key, null) }; tableoperation operation = tableoperation.retrieve(patientid.toupper(), questionnaireid.toupper()); var answers = answerstable.execute(operation, retrieveoptions, null);

html - Image overlapping text and logo not centering on top of image -

my header image overlapping text , annoying me. thing buggy how logo text leans right of center of image. if me both awesome. here code: https://jsfiddle.net/c2bom0cc/1/ here tags relevant this: #index_header { position: block; z-index: 0; left: 0; top: 0; height: 100%; width: 100%; text-align: center; vertical-align: middle; } #index_header img { position: block; float: left; width: 100%; height: 100%; } .background_title { position: absolute; font-family: 'montserrat', sans-serif; color: #fff; font-size: 64px; left: 50%; top: 50%; } <div class="page_container"> <div id="index_header"> <a href="#"> <img alt="slider" id="index_headerimg" src="http://www.bakeryandsnacks.com/var/plain_site/storage/images/publications/food-beverage-nutrition/bakeryandsnacks.com/regulation-safety/coles-freshly-baked-claims-false-...

ios - How to hide button after click -

i create start_button , make @iboutlet , @ibaction @iboutlet weak var start_button: uibutton! @ibaction func start_button(sender: anyobject) now, want hide button after click. try this, don't work: @ibaction func start_button(sender: anyobject) { start_button.hidden = true; } error message: fatal error: unexpectedly found nil while unwrapping optional value (lldb) how can hide button? thanks helping! its nil because haven't connected storyboard/nib. need connect outlet, can't create outlet in code , expect connected visible element. same goes action. @iboutlet / @ibaction stands interface builder outlet/action , means have connect them in interface builder . also better if action uses sender, , not local variable (when pointing same thing). , shouldnt use ; at end of line. @ibaction func start_button(sender: uibutton) // change uibutton { sender.hidden = true // or // (sender as! uibutton).hidden = true } ...

mysql - msqli non inserting long strings into database through php -

so first i'll cover bit of background. have cms company use update news articles , images website. written in php , uses msqli database manipulation. for reason whenever try add text of substantiation length (around 4,000) characters doesn't insert table , leaves field blank. happens when existing news article updated, lot of text added whole link deleted , field blank. code:- page user adds text: <body> <div id="container"> <div id="header"> </div> <?php include('includes/nav.php')?> <div id="contentcontainer"> <div id="contentleft"> <ul> <?php if(isset($_session["myusername"])) { echo "<li>welcome ".$_session["myusername"]."!</li>"; ...