Posts

Showing posts from July, 2012

python - PyCharm logging output colours -

Image
i'm using pycharm develop gae app in mac os x. there way display colours in run console of pycharm? i've set handler output colours in ansi format. then, i've added handler: log = logging.getlogger() log.setlevel(logging.debug) handler in log.handlers: log.removehandler(handler) log.addhandler(colorhandler()) log.info('hello!') log.warning('hello!') log.debug('hello!') log.error('hello!') but colour same. edit: a response jetbrains issue tracker : change line 55 of snippet sys.stderr sys.stdout. stderr stream colored red color while stdout not. now colours displayed. pycharm doesn't support feature natively, can download grep console plugin: http://plugins.jetbrains.com/plugin/7125?pr=pycharm , set colors like here's screenshot: http://plugins.jetbrains.com/files/7125/screenshot_14104.png (link dead) i hope helps :) although doesn't provide colorized console, step towards

why I can use the string function length() when the <string> isn't included in C++? -

this question has answer here: why omission of “#include <string>” cause compilation failures? 5 answers the code shown following, string library has been commented, program still work well #include<iostream> //#include<string> // string library has been commented using namespace std; int main(){ int n; cin>>n; for(int i=0; i<n; i++){ string str; int num = 0; cin>>str; int len = str.length(); //the function length used here! (int j =0; j< len; j++){ if (str[j] >='0' && str[j] <='9') num ++; } cout<<num<<endl; } return 0; } because internally iostream includes string . includes transitive, , of dependencies might compiler dependent, while others same on platforms (one such ...

php - Nginx Laravel Route as Codeigniter -

i have laravel 5 project, staffs information can access testing.com/staffs, want change url testing.com/test/index.php/staffs, have tried laravel route group using "test/index.php/", laravel did not support "dot" in route, how can that? the following part of nginx.conf location / { try_files $uri $uri/ /index.php?$args; location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ { expires max; } location ~ [^/]\.php(/|$) { fastcgi_param script_filename $document_root$fastcgi_script_name; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_pass 127.0.0.1:9006; fastcgi_index index.php; include /etc/nginx/fastcgi_params; } } i think rickard smith might right!! following code location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fast...

Updating the namespace automatically in Visual Studio 2015/ C# -

Image
i doing clean up/ restructuring on code (c#) move classes in tree structure. looking way update namespaces default ones (like projectname.rootfolder.childfolder). i know there ways 1 one in old post looking clean simple update way. wish there "right clicking on folder , clicking on update namespace!" there not. anyone knows add-on/ easy way it? resharper tool work on legacy code. try use tool. right click on folder> go refactor , select adjust namespaces

sonarqube5.1 - How do i Disable "Remember me on this Computer" checkbox from sonarqube -

i wanted disable checkbox sonarqube login page, says "remember me on computer" there isn't built way configure it. however, can change default value removing "checked" html in ruby file under: web-inf/app/views/sessions/_form.html.erb or can comment out checkbox/label entirely hide it. text file in sonar install directory editable. note: location in sonar 5. since internal file, move around. can rgrep find if on different version.

python - pylint 1.6.3 reports E1101(no-member) for xml -

we using elementtree library in our project. comes standard library, reason pylint chokes on it. reports e1101 on reference on elementtree object. here sample bit of code demonstrate this: import xml.etree.elementtree et test = et.parse('test.xml') config = test.find('.//configuration') print(config) role in config.findall('.//role'): print(role) the output pylint throws e1101: $ pylint --rcfile=pylint.cfg -e test.py ************* module orion-scripts.test e: 7,12: instance of 'int' has no 'findall' member (no-member) but program runs fine: $ python test.py <element 'role' @ 0x1052dfe50> <element 'configuration' @ 0x1052dfe10> i found number of solutions similar problems, far none have worked one. i've tried: setting ignored class ignored-classes=xml.etree.elementtree setting generated member generated-members=et allowing extension run unsafe-load-any-extension=yes nothing has worked...

asp.net - Automatically load model on each request -

note : not sure if following right way of doing want. background: have forum (php) , creating asp.net mvc web application sort of independent forum, except login data. user registers , logins through forum app needs check login status reading session hash cookie , comparing forum's database of logged in users. objective: include usermodel class on every request see if user has permissions he's requesting do. views display user related data. do need manually add every controller's action in application? public actionresult index() { userrepository userrep = new userrepository(); usermodel user = userrep.getuserbysession(request.cookies["userhash"].value); //do stuff user ... return view(myviewmodel); } look @ validationattribute . can roll own, , have own custom logic in it: public class customattribute : validationattribute { protected override validationresult isvalid(object value...

c# - WinForms -> toolbox for fast display of data -

i'm new c# , winforms, , i'm developing application, allow me read data serial port , display on display tool (listview,...). now, got serial communication , other functionalities working, i'm having problem displaying data. need able display incoming data fast (every 1ms). display data (for now), i'm using datagridview, problem datagridview not fast enough. so question is: there way display data fast? know human eye can't see data in interval, still... prefered display data in datagridview-like display, since it's easy organize data. best regards, nejc you not going succeed displaying data every 1 ms. should buffer incoming data on 1 thread, every n incoming data, call on method display data (i.e. adding n rows @ time). note need use invoke() calling on gui different thread (the thread receives data, not thread created gui).

mongodb - Sort by subdocuments fields in mongo -

given following collection: [ { name: user1 metadata: [ {k:"score", v: 5}, {k:"other", v: 10} ] }, { name: user2 metadata: [ {k:"score", v: 1}, {k:"other", v: 1} ] }, { name: user3 metadata: [ {k:"score", v: 2}, {k:"other", v: 0} ] } ] how can sort these items "score"? can sort metadata.v field, not sure how consider "v" values subdocuments match "k":"score" the expected output be: [ { name: user2 metadata: [ {k:"score", v: 1}, {k:"other", v: 1} ] }, { name: user3 metadata: [ {k:"score", v: 2}, {k:"other", v: 0} ] }, { name: user1 metadata: [...

html - Span background image across 2 table rows but have different background colors -

doesn't have table div's. my image has transparent parts blend in. top part needs blend different background color bottom half. so in mind table 2 rows 1 row has 1 background color , other has background color image spans on both rows. is possible in html/css. avoid me cutting image two. are image or rows fixed size? play background positioning &/or sizing. .row { height: 100px; background-image: url(http://www.fillmurray.com/1000/200); border: 1px solid red; width: 500px; margin: auto; } .one { background-position: top center; margin-top: 1em; } .two { background-position: bottom center; margin-bottom: 1em; } <div class="row one"></div> <div class="row two"></div> or , logically, though easier wrap "rows" in div , put bg image on that. .row { height: 100px; background-image: url(http://www.fillmurray.com/1000/200); border:1px solid red;...

c# - Entity Framework migration insert default value from function -

i using entity framework 6.1.1 code-first. i trying add new property object (with migration , existing db values) unique this object: public class { public int id { get; set; } public string name { get; set; } } and after edit: public class { public int id { get; set; } public string name { get; set; } public string newuniquevalue { get; set; } } and fluent api: modelbuilder.entity<a>().haskey(x => x.id); modelbuilder.entity<a>().property(x => x.id).hasdatabasegeneratedoption(databasegeneratedoption.identity); // after added new property modelbuilder.entity<a>().property(x => x.newuniquevalue).hasmaxlength(20).hascolumnannotation("index", new indexannotation(new indexattribute() { isunique = true })); but when try run update-database , error duplicate key value (null) (obviously...) so question is: there way call function (from code) generate such key? to call function generation: public static ...

c# - Unable to use Emgucv CUDA -

does know why unable use cuda, have nvidia graphics card installed has cuda enabled, gtx 660, , have cuda driver , toolkit installed. however, when try use "hascuda" function, returns false. when try compile program without checking cuda, error. have instructions on how install emgucv cuda in visual studio 2015, way, got emgucv nuget package. using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; using emgu.cv.cuda; namespace windowsformsapplication1 { public partial class form1 : form { public form1() { initializecomponent(); } public void cudacheck() { if (cudainvoke.hascuda) { messagebox.show("cuda on"); } else { messagebox.show("cuda off"); ...

http - Would setting script-src 'self' and frame-src 'unsafe-inline' conflict with each other? -

if have content-security-policy looks this: default-src 'self' script-src 'self' frame-src 'unsafe-inline' and have web page has frame inside it, frame points external source. frame runs script comes same origin else in frame. i don't understand how these interact each other. script , frame settings conflict each other in way, or case of frame-src allowed run script? you can set 'unsafe-inline' in default-src , script-src or style-src directives in csp. not valid in frame-src , or child-src frame-src deprecated. when loading frame can't set csp restrictions on honour it's own csp set host if present.

c# - How do I use string manipulation to convert xml comments to dgv? -

i working on small project convert xml comments page build in visual studio. 80% there, stuck when comes selecting multiple parameters. able return single parameter name , description, returning multiple parameters having problem. here example(after several hours of frustration , retrying, code may more sloppy normal): <member name="m:evalservicelibrary.evalservice.submiteval(evalservicelibrary.eval)"> <summary> submit new evaluation </summary> <param name="eval">instance of eval object without id</param> <param name="fake">fake paramter testing</param> </member> public list<string> assignparamdata(list<string> allmemberdata, string startstring, string endstring) { list<string> matched = new list<string>(); int indexstart = 0, indexend = 0, indexfinal = 0; (int = 0; < allmemberdata.count(...

stringtokenizer - trying to print out the array in java -

system.out.println("please input elements , seperate each comma."); e = dk.nextline(); string[] elems = new string[e.length()]; st = new stringtokenizer(e,","); (int = 0; i<e.length(); i++) { elems[i] = st.nexttoken().tostring(); } (int i=0; i<e.length(); i++){ system.out.println(elems[i]); } i trying print out array elems[] wont work error java.util.nosuchelementexception @ java.util.stringtokenizer.nexttoken(stringtokenizer.java:349 seems @ line: elems[i] = st.nexttoken().tostring(); can me identify , understand problem? a correct version: string[] elems = e.split(","); for(string elem : elems) { system.out.println(elem); } the mistake made e.length() returns size of string (its number of characters) ended calling st.nexttoken() more times there actual tokens separated "," . hence exception.

javascript - Larger checkboxes on mobile browser -

i have looked through many q&a here on stackoverflow , other sources how make larger checkbox. solutions provided not show simple checkbox bigger. there many solutions. many several years ago. different. i interested in creating checkboxes 2x or 3x larger on mobile device. in fact if larger on desktop browsers fine also. what best way larger checkbox in 2016? i don't want "weird" checkboxes there funny looking check mark, or "alternative checkmark". just normal checkbox... larger. also... text describing checkbox should align properly. thanks you can scale html element transform scale... checkbox html element, can scaled , can specify different scales relative different viewports in order make scaling compatible device views on.. input[type=checkbox] { -ms-transform: scale(2); /* ie */ -moz-transform: scale(2); /* ff */ -webkit-transform: scale(2); /* safari , chrome */ -o-transform: scale(2); /* opera */ }

regex - Add certain number of line breaks in Notepad++ -

i try add given number of line breaks in notepad++. searching \r\n , replacing [\r\n]{10} doesn't work me. regular expressions interpretation on. how should add number of line breaks? note replacement pattern not accepting regular expression. regex can used inside find what field, not in replace with . use extended mode , replace \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n replace 1 linebreak 10. a regex match line break \r (be \r\n , or \n or \r ), way. to make more "dynamic", may use pythonscript like editor.rereplace(r'\r\n', '\r\n'*10)

python - pandas plot time-series with minimized gaps -

Image
i started explore depths of pandas , visualize time-series data contains gaps, of them rather large. example mydf : timestamp val 0 2016-07-25 00:00:00 0.740442 1 2016-07-25 01:00:00 0.842911 2 2016-07-25 02:00:00 -0.873992 3 2016-07-25 07:00:00 -0.474993 4 2016-07-25 08:00:00 -0.983963 5 2016-07-25 09:00:00 0.597011 6 2016-07-25 10:00:00 -2.043023 7 2016-07-25 12:00:00 0.304668 8 2016-07-25 13:00:00 1.185997 9 2016-07-25 14:00:00 0.920850 10 2016-07-25 15:00:00 0.201423 11 2016-07-25 16:00:00 0.842970 12 2016-07-25 21:00:00 1.061207 13 2016-07-25 22:00:00 0.232180 14 2016-07-25 23:00:00 0.453964 now plot dataframe through df1.plot(x='timestamp').get_figure().show() , data along x-axis interpolated (appearing 1 line): what have instead is: visible gaps between sections data a consistent gap-width differing gaps-legths perhaps form of marker in axis helps clarify fact jumps in time performed. researching in matter i'...

c# - Asp.Net Core 1.0 Error "Failed to make the following project runnable" -

i'm coming for problem have. i posted problem in cli of dotnet it's been 10 days+ of moment of writing , have no answer. i have project dependencies on .net 4.5 , worked in rc1 , rc2. trying move rtm (1.0), have error project can't made runnable because runner can't find specific dll. project compiles fine. doing dotnet run fails it looks dll in library app (site) uses, xxx.v15.4, version=15.4.0.0, culture=neutral, publickeytoken=b881323kd82k.dll not exist. however, xxx.v15.4.dll exists fine. copying xxx.v15.4.dll xxx.v15.4, version=15.4.0.0, culture=neutral, publickeytoken=b881323kd82k.dll makes project run. the dll it's trying load third party library used in library app (site) uses. any idea of how make project runnable? thank you! i faced same problem, , thought problem lied in project.fragment.lock.json or in project.json , in case problem incorrect project.lock.json files. it seems after addition of new nuget packages these...

Java Android - How I decode BASE64URL body data message to UTF-8 -

i have json ouptup gmail api: message body parts (get message gmail api) text/plain sgvsbg8gahr0cdovl3n0ywnrb3zlcmzsb3cuy29tlybhbmqgdghhbmsgew91igzvcib5b3vyighlbhahlg0k text/html pgrpdibkaxi9imx0cii-pgrpdibjbgfzcz0iz21hawxfzgvmyxvsdcigc3r5bgu9imzvbnqtzmftawx5onzlcmrhbmesc2fucy1zzxjpzii-sgvsbg_codxhighyzwy9imh0dha6ly9zdgfja292zxjmbg93lmnvbs8ipmh0dha6ly9zdgfja292zxjmbg93lmnvbs88l2e-igfuzcb0agfuayb5b3ugzm9yihlvdxigagvscceupc9kaxy-pgrpdibjbgfzcz0iz21hawxfzgvmyxvsdcigc3r5bgu9imzvbnqtzmftawx5onzlcmrhbmesc2fucy1zzxjpzii-pgjypjwvzgl2pjxkaxy-pgjypjwvzgl2pjxkaxygy2xhc3m9imdtywlsx3npz25hdhvyzsigzgf0ys1zbwfydg1haww9imdtywlsx3npz25hdhvyzsi-pgrpdibkaxi9imx0cii-pgrpdj48zgl2igrpcj0ibhryij48zgl2pjxkaxygzglypsjsdhiipjxkaxy-pgrpdibkaxi9imx0cii-pc9kaxy-pc9kaxy-pc9kaxy-pc9kaxy-pc9kaxy-pc9kaxy-pc9kaxy-pc9kaxy-dqo8l2rpdj4ncg== i can't decode message, text/plain or text/html. tried many ways, didn't work. //result can text/plain or text/html string above import android.util.base64; str...

qt - expose C++ class to QML -

i have code. class pet { public: pet(const qstring& nm) : name(nm) {} const qstring& name() const { return nm; } private: qstring nm; } class dog : public qobject, public pet { q_object public: dog(qobject* prnt) : qbject(prnt), pet("tommy") {} } exposing qml qqmlapplicationengine engine; engine.rootcontext()->setproperty("petdog", new dog(&engine)); // qml item console.log(petdog.name()) // typeerror: property 'name' of object dog(0x0xxxxx) not function what solution expose methods of c++ class qml? thanks the methods must known meta-object system in order invokable qml. means method must either: a signal ( q_signal ), or a slot ( q_slot ), or invokable ( q_invokable ). in qt 5 difference between slot , invokable method of whether method listed among slots when iterate metaobject data. other that, slots , invokable methods equivalent. in qt 5 can connect c+...

javascript - passively tween a property with tweenlite -

i'd able passively tween property on object, during tween can update object , tweenlite carry on. for example, following code tween coordinates in object 0 15 on 15 seconds. whilst happening, want update x , y variables of target.position , , cannot tweenlite seems "hog" object until it's done (as in, until 15 seconds have passed). // target.position starts @ { x:0, y: 0 } tweenlite.to(target.position, 15, { x: 15, y: 15, ease: power4.easeout }) // examples sake i'd following, yet not have effect settimeout(function(){ target.position.x += 10 }, 1000) settimeout(function(){ target.position.y += 15 }, 2500) settimeout(function(){ target.position.x -= 17 }, 7500) i solved question using modifiersplugin tahir ahmed recommended. the modifiersplugin gives 2 values in callback, it's current value , running total of tween, have named cx , rt . returned in callback used tweenlite in next call, , given again rt . handy can let modi...

html - How to set two MediaWiki tables to each be the width of half of the page? -

Image
so i'm trying achieve 2 tables side side in total cover full width of page , each table half width of page. have 2 tables within borderless 2 column 1 row table align them side side. my code looks this: and yields: i them mediawiki site have 3 tables next each other take full page width , same width regardless of window size except 2 tables. (sorry not linking site, joined stackoverflow , don't have enough reputation post more 2 links unfortunately) i realize make them set width , sort of achieve i'm looking useless far users different screen sizes wouldn't it? what have 2 inner tables wrapped inside outer table. adding attribute width="50%" outer table cells should trick. keep headings aligned, may want use valign="top" , this: {| | width="50%" valign="top" | {| class="wikitable" ! table 1 |- | {{lipsum}} {{lipsum}} |} | width="50%" valign="top" | {| class="wikit...

visual studio - VS Code - Search for text in all files in a directory -

is there way search text in files in directory using vs code? i.e., if type "find this" in search, search through files in current directory , return files matched. if did grep. coworker told me sublime has this. you can edit , find in files (or ctrl+shift+f - default key binding) search open folder. there ellipsis on dialog can include/exclude files, , options in search box matching case/word , using regex.

javascript - display loading animation while slow algorithm work AngularJS -

i want display loading animation @ page while algorithm works. how can using angular promises? example : <div ng-hide='algended' > content hide while alg. works</div> <div ng-hide='!algended' > <img href='img/loading.svg'> </div> in every project use angular-loading-bar plugin. you add dependency module , automatically add interceptor xhr requests. you can check examples here: https://chieffancypants.github.io/angular-loading-bar/

iis - Active Directory authorization -

i have windows authentication. when user access application need check username windows , compare active directory group username , if username exists should show landing page else should redirect error page through web.config only. can me this. , impersonate in web.config? worked after couple of trails. to allow users under active directory groups should given within authorization tag. <authentication mode="windows"/> <authorization> <allow roles="activedirectory1"/> <allow roles="activedirectory2"/> <deny users="*"/> </authorization>

postgresql - How can I get an hstore query that searches multiple terms to use indexes? -

i have query underperforming, data hstore column: select "vouchers".* "vouchers" "vouchers"."type" in ('vouchertype') , ((data -> 'giver_id')::integer = 1) , ((data -> 'recipient_email') null) i've tried adding following indexes: create index free_boxes_recipient on vouchers using gin ((data->'recipient_email')) ((data->'recipient_email') null); create index voucher_type_giver on vouchers using gin ((data->'giver_id')::int) as overall index: create index voucher_type_data on vouchers using gin (data) here's current query plan: seq scan on vouchers (cost=0.00..15158.70 rows=5 width=125) (actual time=122.818..122.818 rows=0 loops=1) filter: (((data -> 'recipient_email'::text) null) , ((type)::text = 'vouchertype'::text) , (((data -> 'giver_id'::text))::integer = 1)) rows removed filter: 335148 planning time: 0.196 ms executi...

xQuery XML tokenize a string -

i'm new xquery , can't seem following work: <measinfo measinfoid="1542455297"> <meastypes>1542455297 1542455298 1542455299 1542455300 1542455301 1542455302 1542455303 1542455304 1542455305 1542455306 1542455307 1542460296 1542460297 </meastypes> <measvalue measobjldn="lthab0113422/ethport:cabinet no.=0, subrack no.=1, slot no.=7, port no.=0, subboard type=base_board"> <measresults>116967973 585560 496041572 682500 0 12583680 72080 520454 46670568 73432 2205837 1000000 1000000 </measresults> </measvalue> <measvalue measobjldn="lthab0113422/ethport:cabinet no.=0, subrack no.=1, slot no.=7, port no.=1, subboard type=base_board"> <measresults>0 0 0 0 0 0 0 0 0 0 0 0 0 </measresults> </measvalue> </measinfo> i'm using //measinfo/meastypes/fn:tokenize(text(),'\s+'). hoping return record each space delimited value, return same //measinfo/meastyp...

python - Text file manipulation - insert a newline character after the first two characters in a line -

i have text file looks this: xx number number number xy number number number ... xn number number number xx, xy etc have either 1 or 2 characters , numbers can either positive or negative, doesn't matter. figure out (but can't, life of me) how insert newline after xx, xy etc file this: xx number number number xy number number number ... xn number number number what i'd want remove whitespaces after every xx, xy not ones between numbers. i've tried until introduces newline characters after every 2 characters. i'm super-beginner in python appreciated. str.replace() seems choice, espcially if want modify every single line. with open('input.txt') input_file: open('output.txt', 'w') output_file: line in input_file: line = line.replace(' ', '\n', 1) output_file.write(line) re.sub() choice if want modify of lines, , choice of lines modify can made regular expression: ...

sql server - If I have two tables I want to use join operation and if I have left join then what is the use of right join? -

if have 2 tables want use join operation , if have left join use of right join? i have 2 tables , b i use select * left outer join b on a.id=b.id if want b table outer select * b left outer join on b.id=a.id then use of right outer join? having both joins helps 1 write intuitive scripts easier understand. similar why programming languages have less comparison operator greater comparison operator. in theory, (if not all) code rewritten use 1 of them, code more difficult understand , maintain.

jquery - React Form onSubmit doesn't get triggered when pressing enter instead of the submit button -

the problem when press submit button executes should(ajax request ), when press enter form gets execute redirect. here formpage: import react 'react'; import jquery 'jquery'; $ = jquery; import header '../stateless/header'; import input '../stateless/input'; import form '../stateless/form'; import linkbox '../stateless/linkbox'; import '../../public/styles/login-register.css'; class loginpage extends react.component { constructor() { super(); this.state = {username: "", password: ""}; this.handlechange = this.handlechange.bind(this); } componentdidmount() { $('.ui.form') .form({ fields: { password: { identifier : 'password', rules: [ { type : 'empty', ...

powershell - Azure S2S VNet VPN Gateway -

Image
we have setup 1 vnet site site vpn gateway between: vm azure vnet <-> on premise site. at end of azure gateway configuration obtain preshared key used in vpn on premise device configuration. these device not in our control, have asked other preshared key want set on azure gateway. it's possible web portal? , power-shell? how? thanks in advance, regards p.s.: can found complete guide of powershell commands manipulate vpn gateway? for "classic" asm stack ("classic" vnet) i'm not aware of api allow modify pre-shared key on azure gateway. for arm, hint in step 8 ( -sharedkey parameter) https://azure.microsoft.com/en-in/documentation/articles/vpn-gateway-create-site-to-site-rm-powershell/ create vpn connection next, you'll create site-to-site vpn connection between virtual network gateway , vpn device. sure replace values own. shared key must match value used vpn device configuration. note -connectiontyp...

android - how do i disable YouTube video from playing in my webview appwhen the power button or home button is pressed? -

this mainactivity.java file code should input? public class mainactivity extends actionbaractivity { final string tag = this.getclass().getname(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); webview view = (webview) this.findviewbyid(r.id.webview); view.getsettings().setjavascriptenabled(true); view.getsettings().setbuiltinzoomcontrols( true ); view.getsettings().setsupportzoom( true ); view.setwebviewclient(new mybrowser()); view.loadurl("http://roestauto.com"); } private class mybrowser extends webviewclient { @override public boolean shouldoverrideurlloading(webview view, string url) { view.loadurl(url); return true; } } boolean twice = false; @override public void onbackpressed() { log.d(tag, "click"...

sql server - MS SQL - Display Last Name & First name without changing record -

i have following query uses 2 tables. 1 contact, other email. contact has following columns: contactid, firstname, lastname. email has following columns: emailid, contactid, emailaddress. i have query runs basic duplicate check. return numeric value , email (i.e., 2 - abc@yahoo.com = 2 contacts have email abc@yahoo.com). i'm trying display first name , last name associated email, when so, changes amount of data being produced. because it's grabbing emails have first , last names attached them well. here's query; when try input select contact.lastname , contact. firstname, group by, change amount of data outputed; more columns created (expected), there more rows , data less relevant (more nulls returned). what's causing this, , how can fix it? select count(contact.contactid) [duplicatecount], email.address [emailaddress] contact inner join email on email.contactid = contact.contactid group email.address having count (contact.contactid) > 1 order [duplicateco...

php - Javascript parse JSON data from from input -

i stuck on last step of data flow. right working on building app takes input html form input field , through ajax returns data associated user inputs. i'll try , explain better below. step 1: user fills out form asks website url: <form action="return.php" class="url-performance" method="post" accept-charset="utf-8"> <input type="text" name="target_url" value="" placeholder="yourwebsite.com" /> <input type="submit" name="submit" value="submit form" /> </form> <div class="the-return"></div> step 2: after data submitted return.php ajax function in main js file: $(".url-performance").submit(function(){ var data = { "action": "test" }; data = $(this).serialize() + "&" + $.param(data); $.ajax({ type: "post", datatype: "...

c++ - Error using CImg library in Code::Blocks, fseeki64 undeclared -

i don't know how around issue, every time run code stops compiling , jumps cimg.h header file. in function int cimg_library::cimg::fseek(), fseeki64 undeclared. similar error appears ftelli64 function. did not have issue while using dev-c++. know causes this? thanks in advance!

python - py2exe converted script does not run win32com.client correctly -

i have seen couple posts related issue on other sites, nothing worked. make long story short, program importa win32com.client access microsoft word. create standalone executable using py2exe , every time user selects option open ms word keyerror. below code compiler claims error is: # call ms word app ms_word = win32com.client.gencache.ensuredispatch('word.application') and below result when program run particular line: exception in tkinter callback traceback (most recent call last): file "tkinter.pyc", line 1536, in __call__ file "prototype_pce.py", line 46, in scan file "win32com\client\gencache.pyc", line 544, in ensuredispatch file "win32com\client\clsidtoclass.pyc", line 46, in getclass keyerror: '{00020970-0000-0000-c000-000000000046}' i using tkinter well, not source of issue. opening ms word program new feature have added , fails when create standalone application. have tried pyinstaller , line of errors increa...

ios - NSFetchedResultsController and WebService -

i using core data local cache web service. while fetching data, want first check if data exists in core data , if does, show it(and save network call) , if not ,request web service it, , add core data. nsfetchedresults controller, out of box , directly talks core data. possible kind of check ? i have set of data entities either synced, or unsynced( plan store sync/unsync flag in nsuserdefaults). when view loaded,say list view, if flag synced, web request not required. if flag false, web service should called. nsfetchedresultscontroller won't this. talks core data, , there's no option have automatically checks. you'll have checks somewhere else, , call web service there.

postfix mta - global procmailrc and sendmail execution rights -

i setting procmail on debian jessie mail server following global procmail config file (/etc/procmailrc): shell="/bin/bash" deliver="/usr/lib/dovecot/deliver" logfile="$home/.procmail.log" default="$home/maildir/" maildir="$home/maildir/" orgmail="$home/maildir/" # verbose=on # invoke spambayes :0 fw | sb_filter -d /home/shared_directories/spambayes # if mail contains dangerous file, send admin. :0 wb * ^((content-disposition:.*(|$)[ ]*filename)|(content-type:.*(|$)[ ]*name))=.*\.(0|000|386|3gr|7z|7z\.001|7z\.002|9|a00|a01|a02|ace|add|ade|aepl|agg|ain|alz|apz|ar|arc|archiver|arh|ari|arj|ark|aru|asp|asr|atm|aut|b1|b64|ba|bas|bat|bh|bhx|bin|bkd|blf|bll|bmw|bndl|boo|bps|bqf|buk|bundle|bup|bxz|bz|bz2|bza|bzip|bzip2|c00|c01|c02|c10|car|cb7|cba|cbr|cbt|cbz|cc|cdz|ce0|ceo|cfxxe|chm|cih|cla|class|cmd|com|comppkg_hauptwerk_rar|comppkg\.hauptwerk\.rar|cp9|cpgz|cpl|cpt|crt|ctbl|cxarchive|cxq|cyw|czip|dar|dbd|dbx|dd|deb|delf|...

ios - UIGestureRecognizerState.Cancelled vs UIGestureRecognizerState.Failed -

what difference between .cancelled , .failed states? how setting gesture recognizer's state .cancelled or .failed affect gesture recognizer itself? when gesture recognizer's state become .cancelled , .failed ? at point gesture recognizer marked 'recognized'? after transition .began ? when yes, can gesture's state set .began in touchesmoved also? for example @ stage pinching gesture recognized uipinchgesturerecognizer? guess in touchesmoved because pinching continuos gesture. actually there no difference between .cancelled , .failed states. both leading gesture recognizer failing handle gesture. guess naming convention. though, difference how both states affect gesture handling. it depends of previous state of gesture recognizer was. if gesture recognizer transitioned .possible .began in touchesbegan(touches: set<uitouch>, withevent event: uievent) ( uitouchphase.began phase of touch), in same method .failed or .cancel...

assembly - Weird Macros (TASM) -

Image
consider following macros: pixelfast macro ; macro draws pixel, assuming coordinates loaded in cx&dx , color in al. xor bh, bh mov ah, 0ch int 10h endm drawrect macro x1, y1, x2, y2, color local @@loop, @@row_loop xor cx, cx mov dx, y1 mov al, byte ptr [color] @@loop: mov cx, x1 @@row_loop: pixelfast inc cx cmp cx, x2 jna @@row_loop inc dx cmp dx, y2 jna @@loop endm rendtoolbar macro drawrect colordisp_x1, colordisp_y1, colordisp_x2, colordisp_y2, foreground_color mov temp_color, 36h drawrect colorbtn1_x1, colorbtn1_y1, colorbtn1_x2, colorbtn1_y2, temp_color mov temp_color, 2eh drawrect colorbtn2_x1, colorbtn2_y1, colorbtn2_x2, colorbtn2_y2, temp_color mov temp_color, 4h drawrect colorbtn3_x1, colorbtn3_y1, colorbtn3_x2, colorbtn3_y2, temp_color mov temp_color, 2bh drawrect colorbtn4_x1, colorbtn4_y1, colorbtn4_x2...

javascript - ES6 promise settled callback? -

i want run same action whether promise resolved or not. don't want bind same function both args of .then . isn't there .always jquery has? if not, how achieve this? isn't there .always jquery has? no, there's not (yet) . though there active proposal , maybe es2018. if not, how achieve this? you can implement finally method this: promise.prototype.finally = function(cb) { const res = () => const fin = () => promise.resolve(cb()).then(res) return this.then(fin, fin); }; or more extensively, passing resolution information callback: promise.prototype.finally = function(cb) { const res = () => return this.then(value => promise.resolve(cb({state:"fulfilled", value})).then(res) , reason => promise.resolve(cb({state:"rejected", reason})).then(res) ); }; both ensure original resolution sustained (when there no exception in callback) , promises awaited.

oracle - Unknown "SP2-0552: Bind variable "NEW" not declared" message on trigger -

i have trigger in 1 of scripts: create or replace trigger ms_db.db_tr_incrementtrialnumber before insert on ms_db.db_summary each row begin update ms_db.db_summary set ms_db.db_summary.timesgenerated = (select coalesce(max(timesgenerated),0)+1 ms_db.db_summary ms_db.db_summary.stepid = :new.stepid , ms_db.db_summary.validationid = :new.validationid , ms_db.db_summary.summarydate = :new.summarydate); ms_db.db_summary.id = :new.id; end; / i use toad executing the script. when use 'execute script' button works fine. when run in sqlplus window line : sp2-0552: bind variable "new" not declared any ideas why getting this? thanks by default sql*plus treats blank line end of statement. first line, create , never executed. rest executed anonymous block, , no longer part of trigger statement new isn't recognised. you can either remove blank line before begin , or set sqlblanklines off bef...

Broadcast receiver and Service don't work when applicaton close (android) -

sory everyone. firstly receiver doesnt work when application closed on devices because of auto start manager. feel stupid... , learned important things when trying solve it. firstly android 6.0 permission request broadcast receivers not working in android 6.0 marshmallow secondly: android - duplicated phone state broadcast on lollipop http://www.skoumal.net/en/android-duplicated-phone-state-broadcast-on-lollipop/ thanks... i'm new on android , want learn broadcastreceiver&service. codes broadcastreceiver listen offhook , idle state phone , send intent service something. while application running normal. after close application broadcastreceiver , service don't work. update: notice while application run , everythng normal, sevice started twice , stopped twice. i see messages while service starting: toast.maketext(context, "" +phonestate +" " +record, toast.length_short).show(); toast.maketext(getapplicationcontext(), "service wo...

can't seem to get right php regex quantifier -

i have string looks this: msg": "log domain jl.lab.test.net server lab-jl-ppr-web" i'm trying extract "jl.lab.test.net" , "lab-jl-ppr" "lab-jl-ppr-web" using following regular expression: preg_match("/\"msg\"\: \"log domain\s([\w*\.]*) server ([\w*\.\-]*)/i",$line,$matches); the second group matches entire "lab-jl-ppr-web" string. have been trying specify proper quantifier far haven't gotten right one. i've tried following: preg_match("/\"msg\"\: \"log domain\s([\w*\.]*) server ([\w*\.\-]*){3}/i",$line,$matches); i'm continuing play if have tips, i'd appreciate it. thanks. why not just /..snip.. server ([\w*\.\-]*)-web/i ? keep -web outside of capture group.

Mongodb $sample after filtering -

let's want person find people they're not connected with, do: user.find({ _id: { $nin: req.user.connections }) however, want retrieve @ 10 random documents return. in mongodb, there $sample: { $sample: { size: <positive integer> } } i've never used mongo before, i'm unsure of how chain these 2 in order me retrieve 10 random people current user unconnected to. $sample aggregation operator, need create aggregate pipeline chains 2 operations together: user.aggregate([ { $match: { _id: { $nin: req.user.connections } } }, { $sample: { size: 10 } } ])

Android Hide keayboard on Done button click inside a webview in actvity -

i have activity webview inside. when click inside text input in html page displayed, keyboard shows. there real time search/filter when typing inside text input. then wand hide keyboard, when done button or arrow tapped. i've tryed add : public boolean onkeydown (int keycode, keyevent event) {..} or mwebview.setonkeylistener(new view.onkeylistener(){ @override public boolean onkey(view v, int keycode, keyevent event) {..} but none of function works. how can implement ? maybe should try override onkey , try this: public boolean onkey(view v, int keycode, keyevent event) { if (keycode == keyevent.keycode_enter && event.getaction() == keyevent.action_down){ //todo } return false; } dont forgett implement view.onkeylistener