Posts

Showing posts from January, 2014

html - Hide a page section then reveal it when a link is clicked- JQuery -

i have question within page , want user able able have go answering before answer revealed. have 2 options. 1 link show clues , ideas , 1 link show completed conclusion. firstly tried setting original property not display section using .show() reveal wasn't working. had working code similar purpose tried using .addclass method instead. didn't work either assume must links or can't see because new jquery. advice appreciated! here's code: <section id="page6section2"><div class="page-header"><h1>some ideas</h1></div> <section id="page6section3"><div class="page-header"><h1>conclusion</h1></div> <p><a href="#page6section2" id="someideas">click here clues , ideas!</a> </p> <p><a href="#page6section3" id="conclusion">click here conclusion!</a> .hidesection2 {dis...

ElasticSearch: Search across multiple fields with input strings (NumberFormatException) -

i searching across multiple fields in query using * asterisk notation (ex: want fields startings source specify fields source.* ) , specify query of foobar string. using query string type query. i keep getting numberformatexception , have fields in there mapping type of long , double . any idea how go this? need multi-field search. my query posted below: { "query": { "bool": { "must": [{ "query_string": { "default_field": "source.*", "query": "foobar" } }], "must_not": [], "should": [] } }, "from": 0, "size": 100000, "sort": [], "facets": {} } set lenient true ignore format based failures example : "query_string": { "default_field"...

java - H2 DB - Column must be in Group By list -

i using h2-db access static databases... i have table looks like: country state city lat lng countryid stateid cityid "germany" "berlin" "" 1.23 1.23 1 1 0 "germany" "münchen" "" 1.23 1.23 1 2 0 "usa" "alabama" "auburn" 1.23 1.23 2 1 1 "usa" "alabama" "birmingham" 1.23 1.23 2 1 2 "usa" "alaska" "anchorage" 1.23 1.23 2 2 1 "usa" "alaska" "cordova" 1.23 1.23 2 2 2 its huge list lots of countries, of them have country , state (like germany here, whereas state's cities), few have city (like usa here)... the problem now, w...

c# - Return an IEnumerable with variable number of columns WebApi -

i have request coming with filtering parameters , list of possible calculations perform. code filtering database , grouping date field. at point supposed run through dataset , perform requested calculations, join them based on date field , return front end graph different calculations against each other. my question if there way have web api return ienumerable number , name of columns unknown until function called, or if way create class represent each data point calculation properties null unless called for? yes, return ienumerable. or can serialize them in controller string , return string.

How to replace characters in a string in python -

how replace characters in string know exact indexes in python? ex : name = "abcdefgh" need change odd index positions characters '$' character. name = "a$c$e$g$" (considered indexes bigin 0 ) name = "abcdefgh" namel = list(name) in range(len(namel)): if i%2==1: namel[i] = '$' name = ''.join(namel) print(name)

R: Plot Survival curve with types of death as stacked area chart -

Image
i have dataset right censored containing information of life times , different types of deaths given sample , want produce plot of survival curve (with actual values calculated sample , not model estimation) different types of death stacked area chart, this: how can accomplish in r? the dataset this: death type time event 1 type3 81 1 2 na 868 0 3 type3 1022 1 4 na 868 0 5 na 868 0 6 na 868 0 7 na 868 0 8 na 887 0 9 type3 156 1 10 na 868 0 11 na 868 0 12 na 868 0 13 type3 354 1 14 type3 700 1 15 type3 632 1 16 na 868 0 17 type1 308 1 18 na 1001 0 19 na 1054 0 20 na 1059 0 21 type3 120 1 22 na 732 0 23 type3 543 1 24 type1 379 1 25 na 613 0 26 na 1082 0 27 type3 2...

java - SwipeView change the content of 2 pages -

i've created new activity swipe views, , added code. i have 2 swipeable pages, same content, how can change content of second swipe page. do have create new activity or redirect xml? import java.util.locale; import android.graphics.bitmap; import android.support.v7.app.actionbaractivity; import android.support.v4.app.fragment; import android.support.v4.app.fragmentmanager; import android.support.v4.app.fragmentpageradapter; import android.os.bundle; import android.support.v4.view.viewpager; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.widget.imageview; import android.widget.textview; import com.nostra13.universalimageloader.core.displayimageoptions; import com.nostra13.universalimageloader.core.imageloader; import com.nostra13.universalimageloader.core.imageloaderconfiguration; import com.nostra13.universalimageloader.core.assist.failreason; import com....

php - Find perpendicular segments at ends of segment -

Image
hello, i'm making application in have points (p0,p1), , need find points perpendicular segments @ end of (p0,p1)... namely, (a,b) , (c,d), of length $len. there similar question 1 in this post , unfortunately not sure how interpret answer... i'm using php project, solution can in language can translate later. (a-e)/(l/2) = (p1-f)/l and on...

javascript - how can I get only the text part of an innerHTMLtext that has an image combine on it just like this: -

<div id="demo"> <img src="uparrow.png"> &nbsp; more contests &nbsp; <img src="uparrow.png"> </div> i need more contests part, because of images cannot work. every time i'm running page browser funky thing parameters of image, , therefore doesn't match validation, it? use .textcontent instead of .innerhtml . returns text, not other html elements.

How can I fill the fields of a table in LibreOffice Base automatically? -

i have database contains table of cellphones. let's every cellphone has 10 fields. in order fill or modify table have several forms available user. however, don't want user modify 10 fields every time. want him give information 4 of fields , rest of them automatically filled or modified program. know how that? :) while possible triggers, macros, or other coding, it's bad database practice have calculated fields or duplicate data stored in tables. related data should stored through relationships between tables , displayed in query, not directly in table. so if, say, each store sells single color of phone, have user enter store. have table showed relationship between store name , phone color. when wanted list of users , phone colors, write query looks @ table list of users , bought phones , joins list of stores , colors sell. my advice has 3 tiers: almost best - redesign database more normalized, meaning use relationships between tables prevent need dup...

android - setText from a class for another -

i new android. , english speaking not good. so,i going username using edittext , set textview problem edittext in first class ( myactivity ),and textview in second class( myacyivity2 ). did such findviewbyid and.... when set on click listener : textview1.settext(edittext1.gettext()) and open app, clicking on button says: unfortunately app has stopped. what do? in myactivity : edittext et = (edittext) findviewbyid(r.id.edittext1); on button click, inside onclicklistener : void onclick(view view) { intent intent = new intent(myactivity.this, myactivity2.class); intent.putextra("mystring", et.gettext().tostring()); startactivity(intent); } in myactivity2 inside oncreate() string mystring = getintent().getstringextra("mystring"); textview tv = findviewbyid(r.id.textview1); tv.settext(mystring);

c# - How to map properties of inner/nested classes in DataGridView through BindingSource? -

Image
i have separate project data layer , there 2 basic classes there: [serializable] public class nesinfo { public string filename { get; private set; } public string directory { get; private set; } public mapperinfo mapperinfo { get; set; } } and [serializable] public class mapperinfo { public string number { get; set; } public string prop1{ get; set; } public string prop2 { get; set; } } now want datagridview display columns this: [filename][directory][number][prop1][prop2] how can achieve using bindingsource? i've tried using bindingsource in datagridview, instead of 5 columns, 3 (the nested class treated 1 column, inner properties should there instead): and cannot select inner properties of mapperinfo class when trying add columns: you can create new class properties want display in grid , map existing class either manually or using third-party libraries (ex. automapper). bind new class grid. public class mygridclass { pu...

python - Is there a way to use gevent in ipython notebook? -

i'm using library imports gevent. run in ipython notebook. first cell is: print 'foo' import library print 'bar' but neither print happens. guess library patches thread, otherwise should work: https://github.com/ipython/ipython/issues/2785/#issuecomment-48009193 my ipython file ( /usr/local/bin/ipython ) looks this: #!/usr/bin/python # -*- coding: utf-8 -*- import re import sys ipython import start_ipython if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(start_ipython()) i tried running copy of monkey patching @ top, based on asuggestion here: https://github.com/ipython/ipython/issues/4771 . ipython loads fine, ipython notebook doesn't work. what doing wrong? try this, interactively in python shell. when working, create script need run command line. python3 python 3.4.1 (v3.4.1:c0e311e010fc, may 18 2014, 00:54:21) [gcc 4.2.1 (apple inc. build 5666) ...

angularjs - yeoman generator-material-app: not working -

i started estudr yeoman , testing generator equipment-app ( https://github.com/michaelkrone/generator-material-app ) came across problem. when performing application, umo following error in browser console: typeerror: cssclasses.split not function @ jqliteaddclass (angular.js:2897) @ function.$get.extend.addclass (angular.js:3538) @ angular-animate.js:119 @ foreach (angular.js:336) @ $$addclass (angular-animate.js:118) @ options (angular-animate.js:132) @ close (angular-animate.js:2328) @ queueanimation (angular-animate.js:2156) @ object.$$animatequeueprovider.$get.push (angular-animate.js:2053) @ object.$animateprovider.$get.leave (angular.js:5224) i identified angle coming function in cssclasses parameter rather string follows: cssclasses = (arg1, arg2, arg3) { 2893 if (cssclasses && element.setattribute) { 2894 var existingclasses = (' ' + (element.getattribute('class') || '') + ' ') i ...

regex - Remove tweet regular expressions from string of text -

i have excel sheet filled tweets. there several entries contain @blah type of strings among other. need keep rest of text , remove @blah part. example: "@villos hey dude" needs transformed : "hey dude". ve done far. sub macro1() ' ' macro1 macro ' dim counter integer dim strin string dim newstring string counter = 1 46 cells(counter, "e").select activecell.formular1c1 = strin stripchars (strin) newstring = stripchars(strin) activecell.formular1c1 = stripchars(strin) next counter end sub function stripchars(strin string) string dim objregex object set objregex = createobject("vbscript.regexp") objregex .pattern = "^@?(\w){1,15}$" .ignorecase = true stripchars = .replace(strin, vbnullstring) end end function moreover there entries one: Ÿ³Ã©‡Ã¯¼Å¸Ã£€€Ã¥Ë†Ã£‚ã¦Ã§Å¸¥Ã£‚Šã¾Ã£—ãŸã€‚ shiftã—ãªãŒã‚‰Ã£‚¨Ã£‚¯Ã£‚¹Ã£Æ’ i need them gone too! ideas? for every line in spreadsheet run following regex on it: ^(@.+?)...

c# - How to populate specific DataTable column with values -

hello have datatable updatedvalues, , wondering if there way set value of column value. int rowindex = 0; foreach(string val in something) { try { updatedvalues.columns["books"][rowindex] = val; console.writeline("went here"); } catch { } rowindex++; } the try won't compile because has incorrect syntax, wondering if there similar in try. your question confusing take stab @ response. datatables matrices, similar excel, reference specific value access code: var myval = datatable.rows[row][column]; //to value or var x = 1; var y = 3; datatable.rows[x][y] = myval; //to set value and umphishrey's mcgee posted before me can iterate on values.

Cannot set property 'src' of null in JavaScript -

i'm in middle of changing existing javascript code exports images inside html document word document. new functionality going capture canvas data inside html, convert .png , export i'm getting 'cannot set property 'src' of null' when code reaches part: //capture canvas data var canvasdata = markup.find('canvas'); var tempimage = new image(); ////array hold of images var imagearray = array(); (var = 0; < canvasdata.length; i++) { tempimage.src = canvasdata[i].todataurl("image/png"); imagearray[i] = tempimage; tempimage = null; } any appreciated! as can see nullifying tempimage inside loop, after first iteration assigned null value, in next iteration you'll trying set src null. why getting error. take var tempimage = new image(); inside loop. (var = 0; < canvasdata.length; i++) { var tempimage = new image(); ...

android - How to queue API calls when you're offline while using Retrofit -

i'm using retrofit in combination rx-java , have following question: is there way queue api calls server when device offline can fired when device online again. you need add queue project in first place , pipe retrofit jobs thru queue. either create own queue or check if libraries android-priority-jobqueue fit requirements (that 1 handles persistency of queued jobs, app kill/reboot less painful)

sql server - Can't Figure Out how to show newly inserted rows to my Datagrid view -

i have sql table [dbo].[cashiers] ( cashier_id int primary key identity, cashier_name nvarchar(max) ) now loaded data in table datatable in vb.net private sub form1_load(sender object, e eventargs) handles mybase.load using conn new sqlconnection(my.settings.lol) try dim adp new sqldataadapter adp .selectcommand = new sqlcommand("select * [dbo].[cashiers]", conn) .fill(dt) end bs.datasource = dt datagridview1.datasource = bs adp.dispose() catch ex exception msgbox(ex.message, msgboxstyle.critical) conn.close() end try end using end sub i created 2 global variables dim dt new datatable 'global variable dim bs new bindingsource 'global variable and have text box , button insert records private sub button1_click(sender object, e eventargs) handles button1.click using conn new...

dojo floating pane change minimize/dock icon -

is there way change dojo's floating pane minimize/dock downward arrowhead icon? <div data-dojo-type="dojox.layout.floatingpane" id="floatingpane" data-dojo-props="resizable:false, dockable:true, title:'my floating pane', closable:false" style="position:absolute; top:145px; left:5px; width:565px; height:750px; z-index:3; "> dojo's floating pane </div> one nice option use more standard minimize icon such small line found in upper right border of standard windows window. thanks you can create own theme (or override part of native theme). the css files associated floatingpane : "dojo/dojox/layout/resources/floatingpane.css" you can find details theming on dojo website : http://dojotoolkit.org/reference-guide/1.10/dijit/themes.html

c++ - Socket is open after process, that opened it finished -

after closing client socket on sever side , exit application, socket still open time. i can see via netstat every 0.1s: netstat -tuplna | grep 6676 tcp 0 0 127.0.0.1:6676 127.0.0.1:36065 time_wait - i use log4cxx logging , telnet appender. log4cxx use apr sockets. socket::close() method looks that: void socket::close() { if (socket != 0) { apr_status_t status = apr_socket_close(socket); if (status != apr_success) { throw socketexception(status); } socket = 0; } } and it's processed. after program finished can see opened socket via netstat, , if starts again log4cxx unable open 6676 port, because busy. tries modify log4cxx. shutdown socket before close: void socket::close() { if (socket != 0) { apr_status_t shutdown_status = apr_socket_shutdown(socket, apr_shutdown_readwrite); printf("socket::close shutdown_status %d\n", shutdown_status); ...

java - why does ambiguity not raised for ArithmeticException parameter method -

below code executed out compilation error of ambiguity, , output " arithmeticexception ". guys can u me know reason. class test { public static void main(string[] args) throws unknownhostexception, ioexception { testmetod(null); } // overloaded method of parameter type object private static void testmetod(object object) { system.out.println("object"); } // overloaded method of parameter type exception private static void testmetod(exception e) { system.out.println("exception"); } // overloaded method of parameter type arithmeticexception private static void testmetod(arithmeticexception ae) { system.out.println("arithmeticexception"); } } in cases rule match specific method . since arithmeticexception extends exception , arithmeticexception extends object , there no ambiguity: arithmeticexception more specific of others. if add though: private st...

Git log *.java files and committers -

how can list of java files in repo , original author , every committer file since. my attempt below i'd 1 line each java file , list of committers after that. git log --name-only --pretty=format:"the author of %h %ae on %ad" -- '*.java' i don't think you're far off don't think can obtained directly git, instead, list tracked files first, loop on each one. for file in $(git ls-files | grep \.java$) echo "looking @ $file"; git log --pretty=format:"the author of commit %h %ae on %ad" -- $file; echo; done note: using git ls-files *.java list tracked java files in current directory , not java files in repo.

java - Integer literals -

i can't understand why in java can assign float value double value ,for example : float number=456.7f; but can't same integers , float numbers, such : int numb=56798434l; in c++ these things seem work. you cannot assign value of type higher capacity type of lower capacity without casting. long can store larger numbers, can't assigned int .

jquery - Kendo UI combobox not setting item by value -

i have kendoautocomplete control on page. has datavaluefield set "clientid" store in viewmodel. when user selects desired client related agents , populate them kendocombobox has datavaluefield of "clientid". if selected client agent automatically selected in combobox they'll agent if see mean. i've tried number of things: $("#agentlist").data("kendocombobox").select(viewmodel.get("newclientid")); this doesn't work. testing purposes tried. $("#agentlist").data("kendocombobox").select(0); this - selects first item in combobox that's not i'm after guess "select" method setting based on index. i've tried using "value" so: $("#agentlist").data("kendocombobox").value(viewmodel.get("newclientid")); , measure tried hard coding value i'm using: $("#agentlist").data("kendocombobox").value(900224); none o...

javascript - jQuery check if input value increases/decreases on change -

i have input type number <input type="number" value="5" id="nmovimentos"/> i want especific action when value increases or decreases (alert simpler example). i have following jquery code: $(document).ready(function(){ var oldvalue = $("#nmovimentos").val(); $("#nmovimentos").change(function(){ var newvalue = $(this).val(); if (newvalue > oldvalue) alert("increase!"); else alert("decrease!"); }); }); but doesn't work because can't detect oldvalue var.. clues on how that? thank much! jsfiddle you can make use of property every htmlinputelement has store previous value, example defaultvalue . in case save couple of lines of code, , make code little cleaner , concise: $("#nmovimentos").change(function () { var direction = this.defaultvalue < this.value this.defaultvalue = this.value; if (direction) alert(...

java - c strange use of srand and rand c -

can me understand meaning of these randomization? i have found in c code have translate, return 41: int main(){ srand(1); printf("\n%d",rand()); } how can emulate srand(1) , rand() in java? my answer assumes want emulate behavior of srand() , rand(), not care '41' get. this idea of pseudo-random number generation. if set seed constant value (1 in case), call random() function, return same value. because saying "set index 1 in big list of 'random' numbers" next time call random returns n-th value in 'list'. in reality, bit more complex, that's how think sometimes. emulate behavior of code in java, can try following: public static void main(string[] args) { random rand = new random(1); system.out.println(string.valueof(rand.nextint())); }

Objective C SDK for Pubnub in Swift -

i have added objective c sdk in swift folder structure. https://github.com/pubnub/objective-c/tree/master/pubnub i trying add #import <pubnub/pubnub.h> in bridging header file. not recognizing pubnub @ all. also, throws error cocoalumberjack any leads helpful ! add path pubnub , lumberjack frameworks framework search paths (framework_search_paths) under build settings target. it should this: $(inherited) $(project_dir)/vendor/pubnub $(project_dir)/vendor/cocoalumberjack

c# - TreeView value for Node -

im using code create node: private void radbutton4_click(object sender, eventargs e) { this.radtreeview1.nodes.add(new radtreenode("personal folders")); this.radtreeview1.nodes[0].nodes.add(new radtreenode("simpson")); this.radtreeview1.nodes[0].nodes.add(new radtreenode("maggy")); this.radtreeview1.nodes.add(new radtreenode("friends")); this.radtreeview1.nodes[1].nodes.add(new radtreenode("pig")); radtreeview1.expandall(); } private void radtreeview1_selectednodechanged(object sender, radtreevieweventargs e) { messagebox.show(e.node.text); } and result perfect: http://i.stack.imgur.com/rruu3.png but need set value every node es: if click on maggy return 12121 all content dynamic while. i'm in trouble, can me please? you should set value while adding radtreenode, in way can retrieve...

maven - How to SSH into jenkins host executing code -

i have jenkins job set , i'm having issues getting around company's proxy. i'd ssh jenkins slave executing job. where find host name in jenkins? so can add proper proxy settings.xml file. should located {home}/.m2/settings.xml inspired answer . running groovy script on jenkins script console list slaves , ip address. import hudson.util.remotingdiagnostics; print_ip = 'println inetaddress.localhost.hostaddress'; print_hostname = 'println inetaddress.localhost.canonicalhostname'; // here - shell command, uname example uname = 'def proc = "uname -a".execute(); proc.waitfor(); println proc.in.text'; (slave in hudson.model.hudson.instance.slaves) { println slave.name; println remotingdiagnostics.executegroovy(print_ip, slave.getchannel()); }

ruby on rails - nil class when changing the language from :de to :en but not the other way round -

i use globalize gem translate content in rails app. works fine when change language default language :en :de when want change language :de :en nomethoderror (undefined method 'color' nil:nilclass) i did research , tried few approches have admit don't understand bit reason error: application_controller.rb def set_locale i18n.locale = params[:locale] || i18n.default_locale request.subdomain request.env["http_accept_language"] request.remote_ip end def default_url_options(options = {}) (i18n.locale.to_sym.eql?(i18n.default_locale.to_sym) ? {} : {locale: i18n.locale}) end i highly appreciate hint how solve problem or explanation how code works welcome. here's model: page.rb class page < activerecord::base translates :name, :permalink validates_uniqueness_of :permalink, :message => "this url taken" validates_presence_of :permalink validates_presence_of :name validates_format_of :permalink, :with => /\a[a-za-z0-9-...

php - how can json_encode() not auto convert string to int -

so have array, array ( [0] => array ( [task] => sleeping [duration] => 2 ) [1] => array ( [task] => eating [duration] => 1 ) ) when json_encode() it, returns [{"task":"sleeping","duration":2},{"task":"eating","duration":1}] i need be [{"task":"sleeping","duration":"2"},{"task":"eating","duration":"1"}] is there way how? the dump shows variable inside array int in first place cast string before pushing inside array

c# - Extract all strings between two strings -

i'm trying develop method match strings between 2 strings: i've tried returns first match: string extractstring(string s, string start,string end) { // should check errors in real-world code, omitted brevity int startindex = s.indexof(start) + start.length; int endindex = s.indexof(end, startindex); return s.substring(startindex, endindex - startindex); } let's suppose have string string text = "a1firststringa2a1secondstringa2akslakhflkshdflhksdfa1thirdstringa2" i c# function doing following : public list<string> extractfromstring(string text,string start, string end) { list<string> matched = new list<string>(); . . . return matched; } // example of use extractfromstring("a1firststringa2a1secondstringa2akslakhflkshdflhksdfa1thirdstringa2","a1","a2") // return : // firststring // secondstring // th...

email - VB script for send mail adding multiple variable recipients -

i relatively new writing vb scripts. essentially, need functioning vb script send email multiple recipients vary each email. need have subject line, email body, attachment , flexibility add multiple recipients in to, cc , bcc fields without adding individual lines of add.recipient each email address in field. have suggestions or know of resources find information? i have looked myself , coming blank on it.  i have arguments set in seperate.txt file. these vary constantly. trying efficiently possible. i have not had luck add.cc command took out example...below have written out, set args = wscript.arguments arg1 = args.item(0) arg2 = args.item(1) arg3 = args.item(2) toaddress = ""&arg1&"" ccaddress = ""&arg2&"" messagesubject = "your order" messagebody = "please find order attached" messageattachment = ""&arg3&"" set ol = wscript.createobject("outlook.application...

mysql - The insert query in stored procedure is not running -

the insert query in stored procedure not running. no error occurs query fails insert record. may know issue? create definer=`root`@`localhost` procedure `trip`(in trip int, in rate int, in remark varchar(1000)) begin update booking set status = "2" trip= trip; select rate rate, remark remark, t.driver_id = @driver_id trip_offer t t.trip = trip; insert rating(trip_id, u_id, rate, remark, crt_tms) values(trip, @driver_id, rate, remark, now()); end i suspect have several issues. one definite problem mysql cannot distinguish between variables (parameters stored procedure) , columns. should always use prefix variables. second, not clear trying do. best guess: delimiter $$ create definer=`root`@`localhost` procedure `trip`( in p_trip int, in p_rate int, in p_remark varchar(1000)) begin update booking set status = "2" trip = v_trip; insert rating(trip_id, u_id, rate, remark, crt_tms) ...

ZenDesk iOS SDK : How to generate JWT endpoint URL? -

Image
i working on ios app need integrate zendesk sdk. have setup appid, zendeskurl, clientid. [[zdkconfig instance] initializewithappid:@"xxxxxxx" zendeskurl:@"https://xxxxx" andclientid:@"xxxxxx"]; [zdcchat configure:^(zdcconfig *defaults) { defaults.accountkey = @"xxxxx"; defaults.prechatdatarequirements.department = xxxx; defaults.prechatdatarequirements.message = xxxx; }]; when set authentication method anonymous, working fine. [zdkconfig instance].useridentity = [[zdkjwtidentity alloc] initwithjwtuseridentifier:@"xxx@gmail.com"]; but when set jwt authentication method. it's not working. kirti, know little old went through setup , got working might others. setting jwt endpoint authentication method requires have own server endpoint zendesk can go to let verify identity. so in field says jw...

ssl - malformed HTTP response with docker private registry (v2) behind an nginx proxy -

i have setup docker private registry (v2) on centos 7 box following offical documentation: https://docs.docker.com/registry/deploying/ i running docker 1.6.0 on fedora 21 box. the registry running on port 5000, , using ssl key signed trusted ca. set dns record 'docker-registry.example.com' internal ip of server. running 'docker pull docker-registry.example.com:5000/tag/image', works expected. i setup nginx server, running nginx version: nginx/1.8.0, , setup dns record 'nginx-proxy.example.com' pointing nginx server, , setup site. here config: server { listen 443 ssl; server_name nginx-proxy.example.com; add_header docker-distribution-api-version: registry/2.0 always; ssl on; ssl_certificate /etc/ssl/certs/cert.crt; ssl_certificate_key /etc/ssl/certs/key.key; proxy_set_header host $host; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-p...

Typo3 , extbase mapped entity return no results -

first of all, create extension "extension builder". extend "tt_address" extension. what steps do? i create entity adress , map existing table tt_address . in entity address create setter , getter retrieving addressinformations 'city, zip , street'. after step create repository addressrepository extends \typo3\cms\extbase\persistence\repository . the extensionbuilder create typoscript file ext_typoscript_setup.txt content: config.tx_extbase{ persistence{ classes{ mab\oaaddress\domain\model\address { mapping { tablename = tt_address recordtype = tx_oaaddress_address } } } }} i set storagepid in constants.txt in last step retrieve addresses database , show in list view. class addresscontroller extends \typo3\cms\extbase\mvc\controller\actioncontroller { /** * events repository * * @var \mab\oaaddress\domain\repository\addressrep...

go - Rewrite regex without negation -

i have wrote regex me extract links text files: https?:\/\/(?:.(?!https?:\/\/))+$ because using golang/regexp lib, i'm not able use it, due negation (?!.. what it, select text last occurance of http/https till end. sometextsometexhttp://websites.com/path/subpath/#query1sometexthttp://websites.com/path/subpath/#query2 => output: http://websites.com/path/subpath/#query2 can me solution, i've spent several hours trying different ways of reproducing same result no success. try regex: https?:[^:]*$ regex live here.

excel - Immediate Box (Debug window) Display Separately -

i sorry if silly question. display message box similar immediate window sit "always on top" , scroll countdown while not interrupting vba program. i crunching numbers 40,000 rows , each run takes 15 minutes. don't know if it's still running or when current vba code complete. does have suggestions? use status bar: application.statusbar = "row " & rownum & " of " & rowcount at end, clear status bar: application.statusbar = false

javascript - Fetch a user defined name using jQuery -

need fetch element name using jquery , fetching name value, concatenated samp (variable). cant able form name element. there problem concatenation please help. $("input[name^='resource_" + samp + "_']") full code: var samp = $(thisval).attr('name'); //user defined name $("input[name^='resource_" + samp + "_']").each(function(key,val){ alert("calcwk entered"); if ($(this).val() === '') { theval = 0; } else { theval = parseint($(this).val()); } tot = tot + theval; alert("calcwk exit"); }); since cannot sure of format value "samp" contain need make sure value covered right quotes. $('[property=value]'); works have no spaces or anyway selector doesn't instantly know end of property value is, whereas $('[property=my value]'); confuses parser system , such need correctly "escape" or ...

Haskell concat Int -

i having trouble following exercise: i must make function named adddigit, takes 2 int's, second 1 being between 0 , 9, , return int first int followed second one. example: input: adddigit (-123) 4 output: -1234 what have tried following : adddigit :: int -> int -> int adddigit x y = x ++ y i doesn't work because ++ keyword works strings, chars , lists (i think), , supposed solved in simple way without changing int's strings or sort of other variables, have no clue @ on how it. you trying solve problem graphically (thinking of integers strings), want treat numerical problem. positive values, appending digit accomplished following function. adddigitpositive b = 10 * + b this unfortunately not work if a < 0 . under circumstances have subtract b . can incorporate functionality function guards. adddigit b | < 0 = * 10 - b | otherwise = * 10 + b

Android finding all the commands ran on a database using adb -

i have database in android app. creating table in database , adding rows table. on lifetime of table's rows added/modified/deleted. i want debug 1 particular row see if getting set particular value ever or not. is there way can find sequence of commands ran on database beginning of app ? adb shell setprop log.tag.sqlitestatements verbose or you can apply own sqlitedatabase.cursorfactory database. (see opendatabase parameters.) allow create own subclass of cursor, keeps query in accessible field. edit: in fact, may not have subclass cursor. have factory's newcursor() method return standard sqlitecursor, log query before doing so. source: logging sql queries in android

SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.BATTERY_CHANGED -

i trying develop widget showing battery temperature. when registering broadcast receiver android.intent.action.battery_changed it shows error this. java.lang.securityexception: permission denial: not allowed send broadcast android.intent.action.battery_changed pid=-1, uid=10058 as far know there no need of permission broadcast . if in case of activity. working properly. intent intent = new intent(); intent.setaction("android.intent.action.battery"); return pendingintent.getbroadcast(context, 0, intent, pendingintent.flag_update_current); as far know there no need of permission broadcast yes, there is. sending broadcast. and, quoting the documentation action_battery_changed : this protected intent can sent system. you not system; cannot send broadcast. i have no idea why creating pendingintent trying send broadcast, need else instead. if objective trigger broadcastreceiver tap on app widget, receiver also happens listen act...

python - spanning multiple columns, using QTreeView and QAbstractItemModel -

i want make treeview top level entries span columns (e.g. have 1 row), while children span multiple columns (e.g. have multiple rows.) i trying accomplish qtreeview.setfirstcolumnspanned. however, can't figure out where/when call (and maybe i'm going things wrong begin with.) i thought maybe make function in view called after view populated, check items need have spans updated. however, couldn't find signals connect might me (i tried several, none of them ever seemed fire.) i tried reimplementing insertrows in model and/or rowsinserted in view, never seem called. here's extremely simplified version of i'm doing: class mymodel(qtcore.qabstractitemmodel): def __init__(self, top_level_nodes): qtcore.qabstractitemmodel.__init__(self) self.top_level_nodes = top_level_nodes self.columns = 5 def columncount(self, parent): return self.columns def rowcount(self, parent): total = len(self.top_level_nodes) ...

performance - Egrep command hangs when passed a file for Regex patterns -

nb: i'm using cygwin. passing in file egrep command use patterns running incredibly (to point after 4th word match, more 5 minutes before gave up). command i'm trying run is: cat words.txt | egrep ^"[a-z]" | egrep -f words9.txt words.txt dictionary (390k words), , words9.txt file (36,148 words) created contains lowercase 9-letter words word.txt . command should find 10+ letter words contain 9-letter word words9.txt . i new regex , shell commands may file dependency incredibly inefficient method, (having search 36148 words every word in words.txt). there better way of tackling this? if words9.txt doesn't have regexes try using fixed string search ( fgrep or grep -f ) instead of using extended regex search ( egrep ). cat words.txt | egrep "^[a-z]" | fgrep -f words9.txt

How do I add an 'aar' to my existing android project in Android Studio -

i have aar module name of app-debug.aar . need add in existing android project. using android studio 1.2.2. have tried lot of approaches suggested these how manually include external aar package using new gradle android build system when trying use answers in post, come across issue error:execution failed task ':app:processicanpaydebugresources'. > com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command '/users/shaik/library/android/sdk/build-tools/21.1.2/aapt'' finished non-zero exit value 1 and when seacrched came know had add defaultconfig { multidexenabled true } but still same error , not successful in adding aar module project. can let me know how can achieve it. in advance. i think you're looking (works me): http://kevinpelgrims.com/blog/2014/05/18/reference-a-local-aar-in-your-android-project/

c# - WPF Binding to dictionary with classes -

i new wpf programming , not professional in c# coding. so have following problem: have lot of different comboboxes , textboxes. want bind them variable in background, because want fill comboboxes data database. so created following in file liste.xaml.cs : private dictionary<string, filter> _ctrlfilter; public dictionary<string, filter> ctrlfilter { { return _ctrlfilter; } set { _ctrlfilter = value; } } when load liste.xaml initializes ctrlfilter dictionary following code: ctrlfilter = new dictionary<string, filter> { //combobox {"hersteller", new filter("hersteller", typeof(combobox)) }, {"fahrzeugart", new filter("fahrzeugart", typeof(combobox), false) }, //textbox {"baujahr", new filter("baujahr", typeof(textbox), true, typeof(short)) }, {"anschaffungswert", new filter("anschaffungswert", typeof(textbox), true, typeof(decimal)) }, {"finanz_res...

How do I get the amount of the oldest transaction using the transaction date on both SQL Server and Cognos -

Image
i tried getting result 2834.0000 using oldest date 2010-08-31 13:51:02.000 end getting dates , corresponding amount. need 1 row , 1 column. how do in sql server , in cognos report studio using data item? select min([transaction date]) [transaction date], [gwp amt] [amount] dw.amounttable [policy number] = '11eeo7030500' group [transaction date], [gwp amt] for starters, lose [transaction date] in group clause, you're getting min([transaction date]) in select clause , not grouping on it. but if want 1 row min(transactiondate)and row's amount, couple of ways pull off, try 1 first.. select [transaction date], amount dw.amounttable [transaction date] in (select min([transaction date]) dw.amounttable)

php - CakePHP 1.3 Shell can't find AppModel class -

i'm migrating cakephp 1.3 app old server new one, website works fine shells fail following error: php fatal error: class 'appmodel' not found and error points declaration of model extends appmodel class. strangely prints contents of appmodel class stdout. full stack trace below. php fatal error: class 'appmodel' not found in /home/andyburchill/src/site/app/models/account.php on line 3 php stack trace: php 1. {main}() /home/andyburchill/src/site/cake/console/cake.php:0 php 2. shelldispatcher->shelldispatcher() /home/andyburchill/src/site/cake/console/cake.php:665 php 3. shelldispatcher->dispatch() /home/andyburchill/src/site/cake/console/cake.php:139 php 4. shell->initialize() /home/andyburchill/src/site/cake/console/cake.php:337 php 5. shell->_loadmodels() /home/andyburchill/src/site/cake/console/libs/shell.php:180 php 6. classregistry->init() /home/andyburchill/src/site/cake/console/libs/shell.php:257 php 7. app->import()...

MySQL - InnoDB buffer pool, disable/workaround -

i'm working on system incluces exporting large amounts of data csv files. using innodb our tables. innodb buffers previous queries/results in manor. on production enviroment thing while testing performance of export in dev enviroment not. buffer pool size seems around 128mb. couldn't find on google except can change mysql settings when server boots up. anyone knows workaround of maybe there sql statement prevents being put buffer? it's non-problem (since 5.1.41) it impossible prevent innodb activity going through buffer_pool. engrained in design. the buffer_pool caches data , index blocks , not queries/results. query cache plays queries/results. qc should disabled production systems. innodb_old_blocks_pct (default = 37, meaning % of buffer_pool) prevents wiping out buffer pool operations such reads needed 'export'. see http://dev.mysql.com/doc/refman/5.6/en/innodb-parameters.html#sysvar_innodb_old_blocks_pct , links in section.

python - PySide MainWindow doesn't create Menu Bar -

i'm trying create menubar on mainwindow widget, after writing code found on internet, nothing seems happen, menu bar isn't created, though no error message displayed. the code use create ui menu bar follows: def initui(self): qtooltip.setfont(qfont("sansserif", 10)) self.setcentralwidget(qwidget()) #create action use on menu bar exitaction = qaction(qicon("logo.png"), "&exit", self) exitaction.setshortcut("cmd+q") exitaction.setstatustip("close application.") exitaction.triggered.connect(self.close) #create status bar self.statusbar() #attempt create menu bar, nothing happens. menubar = self.menubar() filemenu = menubar.addmenu("&file") filemenu.addaction(exitaction) #set mainwindow properties. self.setgeometry(0, 0, 250, 150) self.setwindowtitle("icon") self.setwindowicon(qicon("logo.png")) self.settoolt...

website - Where is the official documentation on google+ comments? -

i've found few examples how insert google+ comments @ site, cann't find official documentation this. please me find it. need know width settings there isn't any. google+ comments widget not public api , officially supports use within google's own apps (blogger, youtube).

haskell - How do you implement "show" tail-recursively? -

haskell's show implemented recursively as: data tree = node tree tree | leaf show' (node left right) = "(node " ++ show' left ++ " " ++ show' right ++ ")" show' leaf = "leaf" main = putstrln $ show' (node (node leaf leaf) leaf) how can implement show using tail recursion? using cps, mentioned m. shaw. show' :: tree -> string show' = \tree -> go tree id go (node left right) c = go left (\l -> go right (\r -> c ("(node " ++ l ++ " " ++ r ++ ")"))) go leaf c = c "leaf" it's important keep in mind haskell's laziness obviates need tail recursion in many cases. in case, tail recursive version has traverse entire tree before part of input can returned. try showing infinite tree each version. when returning lazy structure such string in lazy language, better corecursive (which original implementation is)...

c# - Write large data with WriteLineAsync in a using block -

can following code cause error, if writelineasync not finished writing, using term tries dispose writer stream? for example: using (var writer = system.io.file.appendtext(filename)) { writer.writelineasync(message); } what happen, if write large data, may takes few seconds? thank you yes, stream disposed of before task has completed. you should either await task returned writelineasync or write file synchronously instead, using writeline .

Transfer from one profile to another - Rails and Stripe -

i write first time , glad if me. i create rails app stripe payment , have 2 type of customers. when customer1 logs system, needs fill payment credentials form(cardholder, cvc, cart number). form information , stripe.js generated card_token use token create customer , save database. when customer2 logs system, use stripe connect connect system customer2 stripe account. how can transfer money customer1 customer2`s account.i use stripe.api_key = platform_secret_key stripe::charge.create({ :amount => 1000, :currency => "usd", :source => {token}, :destination => {connected_stripe_account_id} }) and try curl request: curl https://api.stripe.com/v1/charges \ -u {platform_secret_key}: \ -d customer={stripe_customer_id} \ -d amount=1000 \ -d currency=usd \ -d destination={connected_stripe_account_id} \ -d application_fee=200 but both give me error: "type": "invalid_request_error", "message":...

Possible issues between Meteor datatables packages? -

i'm in need of datatables admin panel i'm creating. i'm looking @ either ephemer:reactive-datatables or aldeed:tabular these 2 seem ones still being actively developed. both lack tutorials how things built scratch. i've looked @ orionjs entire admin panel , cms documentation seriously lacking. know they've put in effort of writing stuff down, there's no tutorial explaining things or why you're doing things , effects have. i'm looking possible issues might run when implementing either of 2 packages above. i know using aldeed's autoform , simpleschema creates powerful, complex , hard understand packages. ephemer datatables seems more simplistic , quicker off ground, lacking major features or limitations? don't want heavily-invested package , realize there's can't do. one of requirements able display multiple datatables on 1 screen. being able style each component on datatable separately amazing, should generate c...

"Lambdifying" scala Function in Java -

using java , apache spark (that has been rewritten in scala), faced old api method ( org.apache.spark.rdd.jdbcrdd constructor), has abstractfunction1 it's argument: abstract class abstractfunction1[@scala.specialized -t1, @scala.specialized +r]() extends scala.anyref scala.function1[t1, r] {} because abstractfunction1 abstract class, cant use java8 lambdas, decided wrap scala.function1 trait same java.util.functions.function does't implements andthen , compose methods. result, create thes interface: import scala.function1; @functionalinterface public interface funct<t, r> extends function1<t, r>, serializable { @override default <a> function1<a, r> compose(function1<a, t> before) { return null; } @override default <a> function1<t, a> andthen(function1<r, a> g) { return null; } } ide has no problems interface, while compiling, get: [error] funct not functional interface...

python - Django manage.py fails with "populate() isn't reentrant locally", but works on heroku -

i've got bit of odd problem django running correctly on remote, failing locally. i'm developing django webapp , attempting use makemigrations add few new fields models. whenever run makemigrations directly on heroku, functions correctly: migrations 'users': 0001_initial.py: - create model customuser - create model corporateuser - create model normaluser but doesn't save. first time using migrations: migrated django 1.6. i know need run makemigrations locally , push remote, whenever try use manage.py locally, following error: traceback (most recent call last): file "manage.py", line 10, in <module> execute_from_command_line(sys.argv) file "/users/bniii/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line utility.execute() file "/users/bniii/anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute dj...