Posts

Showing posts from February, 2013

python - Pandas Row Date Conditional Filter Prior to Groupby - MAXIFS/MINIFS -

i trying maxifs style calculations in pandas i trying add column containing next (if exists) & last (if exists) flagged date each unique id sample table: (trying next flag & last flag columns) edit: form more generic case, if wanted perform function e.g ditinctcount on period <= row the idea able apply custom functions applied filtered subset each id = row id , date <= row date (i have created pandas compatible row functions way slow) table: id date flag next flag last flag flag2 uniqueflags 1 21-aug 0 nan 18-aug 1 1 20-aug 0 nan 18-aug 1 1 19-aug 0 nan 18-aug 1 1 18-aug 1 nan 18-aug 1 1 17-aug 0 18-aug 15-aug 1 1 16-aug 0 18-aug 15-aug 1 1 15-aug 1 18-aug 15-aug 1 1 14-aug 0

asp.net - Can I send file from one project folder to an other project folder in C# web -

i have 2 projects in 1 solution. know how copy files client server file system. how can copy files client system using admin project , send client project file system. in solution explorer 'ctrl'-drag file name of client project. if intend keep same code in both projects, suggest creating class library 3rd project, putting file there, , adding reference class library in both admin- , client-project. wiki

visual c++ - How to inspect MSVC's c++ object layout? -

when compiling c++ code clang, can inspect memory layout generates passing -xclang -fdump-record-layouts on command line . is there similar way inspect memory layout msvc generates, ideally 1 works on command line , can used on godbolt.org? wiki

c++ - Heap allocation failing in user DLL/EXE -

properly linked dlls , exes supposed have 1 freestore can allocate heap-based objects. here chis becke’s answer in who allocates heap dll? : … c++ runtime responsible creating freestore , deciding how allocate it. specifically, if use dll runtime option, single dll - msvcrtxx.dll - manages single freestore shared between dll's, , exe, linked against dll since true, should able new objects in dll/exes defined in other dll/exes. according chris, msvcrtxx.dll , compile-time/runtime linker take care of joint freestore dll/exes can obtained. that not working me. to test this, have generated 2 mfc dialog programs: newfailmfc1 , newfailmfc2 . running newfailmfc2 accesses newfailmfc1 ’s www function fails when doing new . // code in newfailmfc1. void www() { char* ch { nullptr }; ch = new char[ 100 ]; // error: attempts allocate memory somewhere else in prescribed joint dll/exe freestore ch[ 0 ] = '\0'; } // calling code in newfailmfc2. www();

language agnostic - Does a for loop create two scopes? -

imagine following statement (from imaginary c-like language) gets desugared more simple form: 1| (int = 0; < 10; ++i) 2| { 3| // work 4| } of course, sticking point int = 0 in initializer, beacuse suppose: after loop done, i out of scope , can't reference it. upon reaching line 2, new scope pushed on stack , popped on line 4. this mean specific for-loop desugar to: { int = 0; while (i < 10) { // work ++i; } } leading creation of scope sole purpose of containing incrementer variable. i understand specifics implementation defined language permits declarations inside classic-style loops. i'm curious if how work under covers, @ least when creating initial ast. i think thats compiler your. can see if try compile both codes on llvm e.g. clang -s -emit-llvm , compare results. wiki

amazon web services - Best way to check whether a cloud formation stack exists using AWS Java SDK? -

what best way check whether stack exists using aws java sdk, given stack name? i've tried below code based on - https://github.com/aws/aws-sdk-java/blob/master/src/samples/awscloudformation/cloudformationsample.java describestacksrequest wait = new describestacksrequest(); wait.setstackname(stackname); list<stack> stacks = awscftclient.describestacks(wait).getstacks(); if (stacks.isempty()) { logger.log("no_such_stack"); return true; } however, getting: amazonserviceexception:com.amazonaws.services.cloudformation.model.amazoncloudformationexception: stack id "stackname" not exist. thanks in advance! in case else looking quick , dirty solution, works, //returns true if stack exists public boolean stackexists(amazoncloudformation awscftclient, string stackname) throws exception{ describestacksrequest describe = new describestacksrequest(); describe.setstackname(stackname); //if

swift3 - How to set the first day of current week to Tuesday in Swift? -

Image
how set first day of current week tuesday in swift 3? schedule update every tuesday first day have start tuesday. and display on label : thisweekdate.text! = "\(first day of current week) - \(last day of current week)" full code. let today = nsdate() let nexttue = calendar.current.date(byadding: .day, value: 6, to: today date) let formatter = dateformatter() formatter.dateformat = "yyyy-mm-dd" let todaystring = formatter.string(from: today date) let nextstring = formatter.string(from: nexttue!) formatter.dateformat = "dd-mmm-yyyy" let calendar = nscalendar(calendaridentifier: nscalendar.identifier.gregorian) let components = calendar!.components([.weekday], from: today date) //label code thisweekdate.text! = "\(first day of current week) - \(last day of current week)" //if can change first day of current week weekly update code can deleted if components.weekday == 3 { print(

sqlite - Warning: SQLite3::exec(): near &quot;http&quot;: syntax error when I am Updating field with <link src>? -

i error in updating field in sqlite3 database: $txt_font = str_replace( "'" , "\'" , $_post['txt_font'] ); which stored in database enter image description here field name: text font value : http://fonts.googleapis.com/css?family=arial\' rel=\'stylesheet\' type=\'text/css\'> dont know why? wiki

Storing result of AJAX in pure Javascript -

this question has answer here: how return response asynchronous call? 21 answers i learning basics of ajax, , trying store result of call in variable. have data.txt file object: [ { "id": "5688","name": " jorge luis borges"}, { "id": "5799","name": " lewis carroll"} ] and calling call: var object = "no object"; function requestfunction(url){ var request = new xmlhttprequest(); request.open("get", url, true); request.addeventlistener("load", function() { object = this.response; }); request.send(null); return object; }; console.log(requestfunction("data.txt")); i don't know why, result = this.response doesn't affect variable want store result, , console outputs original value: no object . any idea w

vb.net - Repeatonnewpage tablix property already set to true but tables is still cut -

here's output enter image description here , here's report design enter image description here im working reportviewer reports.i have report consist of table, problem have 2 rows static in table , have set minimum number of rows table since minimum number of rows have set table exceeds page need repeat 2 static rows next page set set repeatonnewpage =true , keep group = after table still cut. thank help probably changed options in tablix properties. try this: click in "advanced options" advanced options change static label properties of header repeatonnewpage = true propeties wiki

videoview - Android E/ExtMediaPlayer-JNI: env->IsInstanceOf fails E/MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0 -

i trying play video song in app video-view. nothing except black screen, , display error 'can't play video'.it seems there no errors such in code except log cat errors have never heard of. videoview videoview =(videoview)findviewbyid(r.id.video_view_ex); mediacontroller mediacontroller= new mediacontroller(this); mediacontroller.setanchorview(videoview); uri uri= uri.parse(environment.getexternalstoragedirectory().getpath()+"/memory card/video/na na na na -dj 9dip.mp4"); videoview.setmediacontroller(mediacontroller); videoview.setvideouri(uri); videoview.requestfocus(); videoview.start(); wiki

asp.net core - User.Claims is null after deploying application while users are still logged in -

i have aspnet core web application uses identity claims (w/ jwt token authorization). have expiration token set 2 days. the normal process of logging in, authenticating credentials, , receiving / sending tokens works well. the problem i'm having when deploy application iis , users still logged in, user.claims property null . user object has no value. gets refreshed if log out , log in. the idea can think of detecting if claims null , redirecting login, isn't ideal may continuing update information day before, have fail on submission. edit (code sample): applicationuser appuser = _usermanager.findbynameasync(login).result; var displayname = appuser.todisplayname(); var claimsidentity = new claimsidentity(userclaims, "bearer"); claimsidentity.addclaim(new claim("displayname", displayname)); await _usermanager.addclaimasync(appuser, new claim("id", appuser.id)); // server c

xml - customized of android switch -

Image
greetings dear fellow developers, working on android application in have use switch view little bit customized view, switch working fine, supposed view getting on device screen not, here switch code <switch android:id="@+id/addrecordrandomfasting" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerinparent="true" android:checked="false" android:showtext="true" android:textoff="random" android:texton="fasting" android:textsize="@dimen/activity_text_size" android:thumb="@drawable/switch_thumb" android:thumbtextpadding="50dp" android:track="@drawable/switch_track" /> and switch_thumb <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true">

contextmenu - Add Windows Context Menu file command for "git difftool %1" -

i trying add file context menu option execute git difftool %1 (which configured use beyond compare 4). i've got context menu showing icon want can't beyond compare pop file diff. i've tried setting default string value following didn't work. hkey_classes_root\allfilesystemobjects\shell\beyondcompare.diff\command (default) = "c:/program files (x86)/beyond compare 4/bcomp.exe" "$local" "$remote" = cmd /c git difftool %1 = "c:\program files\git\git-bash.exe" /dir %v. git difftool %1 and here registry key show above command in file context menu. hkey_classes_root\allfilesystemobjects\shell\beyondcompare.diff (default) = git diff icon = c:\program files\beyond compare 4\bcompare.exe what should set command string works? instead of trying create custom context menu entry, might easier use tortoisegit provide context menu access git, configure tortoisegit use beyond compare external diff , merge tool.

c++ - Dereferencing a variable in python -

i moving program c++ python (for educational purposes) , had large amount of success. however, 1 particular issue appear having replicating following code in python: float* myvar[x]; where x integer. having tried: myvar = id([0.0 in range(x)]) with no success, there method within python replicate c++ behaviour? as part of project in moving code between 2 languages, using existing library written original author of code. function within library has function structure: obj.function(float* myvar, float* myvar2,...) where myvar defined above. whilst using: myvar = [0.0 in range(x)] i error: typeerror: int_t obj.function(float* myvar, float* myvar2,...) => not convert argument 1 as not experienced in c++, not know begin in solving problem. wiki

java - Button Image Icon Not Showing -

take note newbie. in programming book "samteachyourself java (in 24 hrs) 7th edition", says on page 252 (just in case if has them right now) can add image icon on button doing did on line 7, 8 , 9. when ran program, buttons showed up, without picture. reason, before added icon, had text on button. when ran icons, text still on button, when removed text icons. need serious help! package thing; import java.awt.flowlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.*; public class thing extends jframe implements actionlistener { imageicon = new imageicon("desktop\\oof.png"); jbutton firetorpedos = new jbutton(a); jbutton notorpedos = new jbutton(a); jbutton reset = new jbutton("reset"); jlabel txt = new jlabel("sir, should fire torpedos?"); jlabel output = new jlabel(""); public void actionperformed(actionevent event) { string cmd = event.getaction

html - How to over-ride CSS in content management system -

i'm building page on company's intranet, runs on sharepoint 2007. i'm trying use tables better organize page, appears there style sheet defines tables having borders , grey backgrounds. i'd change formatting of table, cannot find way around style sheet. when enter html editor, have tried updating html within table, no luck. tried adding css in editor well, no dice. i'm amateur @ kind of thing, not sure how best proceed. there way over-ride css , style of table want? how table accessed? if selected table tag in css, can't unless give tables class. if selected class, can change class 1 table want change. if want keep of attributes, make table have different id, create selector in css id, , add attributes want keep. example... <table class = 'table'> <tr> <td>example<td> </tr> <tr> <td>example2<td> </tr> </table> <table class = 'table'> <tr> <td>example&l

eclipse - when my system changed maven project giving error Error: Could not find or load main class -

i check out svn project , run on system things working fine. give laptop department make ethernet port working after when run project showing error: not find or load main class my laptop body changed os , other software remain same shift hard-disk other body. other simple java program running fine except svn maven project. just press alt+f5 or right click on project go maven tab , click on update project. somehow works me :) wonder if can explain. target folder project add first go run configuration ->select class -> classpath tab->click user entries ->advance ->add external folder-> navigate target folder of project. wiki

MYSQL: product - attribute relations -

i'm trying figure out relations between products , product attributes. have product table , product_attributes table. product can have multiple attributes. need query finding products have 1 specific attribute , 1 of ones. e.g. product attribute_value_id "1" , product must have attribute_value_id in (2, 3, 4) i thought it, not: select distinct p.product_id `product` p join `product_attribute` pa on (p.product_id = pa.product_id) pa.attribute_value_id = 1 , pa.attribute_value_id in(2, 3, 4) product product_id product_attribute product_id | attribute_id | attribute_value_id attribute_id attribute group (e.g. color, gender) attribute_value_id specific value (e.g. blue, men, women) in words need prodcuts men blue or red. any suggestions? thank in advance. appreciated. wiki

java - I want to print amount like 2523525252.025 when I using double data type it's changed in 2.523525252025E9 how can fix? -

this question has answer here: how print double value without scientific notation using java? 10 answers i want print amount 2523525252.025 when using double data type it's changed in 2.523525252025e9 how can fix? example - double saleprice=145236.12; int itemqountity=1500; double totalamount= saleprice*itemqountity; log.e("totalamount",""+totalamount); output- e/totalamount: 2.1785418e8 please use decimalformat print value without scientific notation here example. double test = 12345678; decimalformat df = new decimalformat("#"); df.setmaximumfractiondigits(0); system.out.println(df.format(test)); //12345678 wiki

Issue with restoring the database in MS SQL server -

when try restore db in sql server getting following error message: backup mediaset not complete. family count:2. missing family sequence number :1 i googled error , found backup of database wrote data 2 files. but how can find files? have dropped database. have abackup copy of particular db. you can information in msdb database after dropping database. please run below query list of backup performed on sql instance- select bs.name,bs.backup_size, bs.database_name , bs.backup_start_date , bm.physical_device_name msdb.dbo.backupset bs join msdb.dbo.backupmediafamily bm on bs.media_set_id = bs.media_set_id order bs.backup_start_date desc wiki

javascript - Access response headers of new redirected URL using document.location.href -

i have created iframe like: document.body.insertadjacenthtml("beforeend", '<iframe src="' + geteservicecontext() + '/web/blank.htm" style="width:20%; height:20%;" role="presentation" name=' + 'testframe' + 'id=' + 'testframe'+ 'frameborder=1 scrolling=yes></iframe> '); now assigning new url iframe like: document.frames['testframe'].location = url (any http url); is possible access response headers returned part of accessing above url? wiki

node.js - node ncp filter not working -

i trying filter files through node ncp library filter not working. once filter gets false return breaks whole copying process ncp(source, destination, options, function (err) { if (err) { console.error("backup error:", err); } console.log("backup of done!'); }); var options = { filter: function (file) { console.log("copying file:", file); var res = file.tostring().indexof("\\testdrive") !== -1; console.log("res:", res); return !res; }, //filter: new regexp("\\testdrive"),//or regex intance }; so once filter function or regex instance gets false result whole copy break options.filter - regexp instance, against each file name tested determine whether copy or not, or function taking single parameter: copied file name, returning true or false

quickbooks - I am creating TimeTrackingAddRq XML and getting error? -

error: "quickbooks found error when parsing provided xml text stream." not able find out actual error. here xml: <?xml version="1.0" encoding="utf-8"?> <?qbxml version="13.0"?> <qbxml> <qbxmlmsgsrq onerror="stoponerror"> <timetrackingaddrq requestid="1"> <timetrackingadd> <txndate>2017-08-23</txndate> <entityref> <fullname>tarun enest</fullname> </entityref> <customerref> <fullname>bunn-o-matic corporation</fullname> </customerref> <itemserviceref> <fullname>lrmt</fullname> </itemserviceref> <duration>0.3</duration> <payrollitemwageref> <fullname>hourly techs</fullname> </payrollitemwageref> <classref> <fullname/> </classref> <billablestatus>billable</billablestatus> </timetrackingadd> </timetrackingaddrq> <timetracking

c# - Rebus RabbitMQ Object serialization -

how come when send message rabbitmq through rebus adding object data below, $type. {"$type":"threesquared.vtgpam.objects.wagon, threesquared.vtgpam.objects","wagonid":"a98a06ab-33b9-4a11-9de2-df0b8787b713","wamosid":12324,"description":"test","yearbuilt":1982,"token":"3cce443c-249f-4fd2-9882-5830fb308b6b"} we have client using java rabbitmq library no rebus. approach believe send json without type declarations. therefore doesn't work when try , read in simple json object. how can make work doesn't define $type in message? it's because rebus default uses newtonsoft json.net typenamehandling.all , means $type field included in every serialized object containing full .net type name of type serialized. the benefit can serialize anything, though may contain instances referenced (possibly abstract) supertypes, , interfaces. e.g. command message type public c

css - Angular 2 Material: Sidenav how to remove backdrop -

so using angular cli material design. trying rid of backdrop sidenav , thought simple .mat-sidenav-backdrop.mat-sidenav-shown{ background-color: transparent !important; } however isn't having affect. have tried display none, visibility hidden, etc. seems style backdrop being put out inline tag , have thought important override it. isn't working... have ideas don't involve me stripping out backdrop tag/ altering styles via javascript during rendering? ::ng-deep works great in case, maybe depreciated going forward. recommended way use viewencapsulation . in component, add following encapsulation: import { viewencapsulation } from '@angular/core'; @component({ .... encapsulation: viewencapsulation.none }) then css work , override styles custom styles. .mat-sidenav-backdrop.mat-sidenav-shown{ background-color: transparent !important; } wiki

java - Unable to open sd folder -

i list folders in external card push of button (currently hard coding location ball rolling) public void onclickbtn(view v) { file f = new file("/storage"); file[] files = f.listfiles(); (file infile : files) { if (infile.isdirectory()) { log.i("is directory", "here: " + infile); } } } this outputs logcat: i/is directory: here: /storage/3164-6330 i/is directory: here: /storage/emulated i/is directory: here: /storage/private i/is directory: here: /storage/enc_emulated i/is directory: here: /storage/self now want repeat same process change path "/storage/3164-6330" because know that's sd card stores things public void onclickbtn(view v) { file f = new file("/storage/3164-6330"); file[] files = f.listfiles(); //will cause error here (file infile : files) { if (infile.isdirectory()) { log.i("is directory", "here: " + infile);

how to find the equivalent delphi function of the c++ functions in msdn -

the microsoft developer network msdn full of useful documented functions necessity learn , stay updated windows app developer. for example shellexecute function in here documented (translated below embarcadero technologies). function shellexecute; external shell32 name 'shellexecutew'; however language used explain functions c/c++ (not complaining or thing). to find equivalent these functions (if exist or not question) can hard. for example i'm looking equivalent of function : dword createipnetentry( _in_ pmib_ipnetrow parpentry ); now pointless come , ask here can find equivalent each time stuck.so question is: is there way know if there equivalent/translation c++ functions @ msdn in delphi , find them(the unit)? you can find whether or not particular api function has been translated searching delphi source folder it. any search in files tool serve necessary purpose, including built-in find in files . wiki

html - Aligning a set of labels and values -

Image
i new in html , css hard how can align semicolon screenshot? psd like: here html markup <ul> <li>name <span>: john doe</span></li> <li>age <span>: 30.30.30</span></li> </ul> and css li span { padding-left: 20px; } and result screeshot: what appropriate markup , css this? use display:table-row li , display:table-cell label s. li { padding-left: 20px; display: table-row; } li label { display: table-cell; } li label:not(:first-child) { padding-left: 40px; } <ul> <li><label>name</label><label>: john doe</label></li> <li><label>age</label><label>: 30.30.30</label></li> </ul> wiki

python - Obtain EC2 instance IP from AWS lambda function and use requests library -

writing lambda function on amazon aws lambda. accesses url of ec2 instance, on running web rest api. lambda function triggered alexa , coded in python language (python3.x). currently, have hard coded url of ec2 instance in lambda function , ran alexa skill. want lambda function automatically obtain ip ec2 instance, keeps changing whenever start instance. ensure don't have go code , hard code url each time start ec2 instance. stumbled upon similar question on so, unanswered. however, there reply indicated updating iam roles. have created iam roles other purposes before, still not used it. possible? require managing of security groups of ec2 instance? need set permissions/configurations/settings? how can lambda code achieve this? additionally, pip installed requests library on system, , tried uploading '.zip' file structure : rest.zip/ requests library folder index.py

pygtk - pygtk3 checking does signal exist -

how can learn before connecting anything. example does_signal_exist(widget, signal): pass button = gtk.button() does_signal_exist(button, "clicked") # returns true does_signal_exist(button, "hello") # returns false does_signal_exist(button, "unboxed") # returns false does_signal_exist(button, "button-press-event") # returns true there's wondrous tool called 'manual' or 'reference' . gtk-3.0 manual, , click on classes , , gtk.button . signals . if not there can same signals inherited previous objects. using help(button or help(gtk.button) (inside python3, either in interactive or in program), have access methods, , lots of other information class , instance. using manual mentioned above, check out girepository module - these functions can use inside gtk, classes , properties. and can check if works: use try:/except: check if can connect signal/event interested in. wiki

vb6 - I can't add a data date value to firebird when the day portion is greater than 12 -

Image
i have odd problem vb6.0 programming when add value database firebird dtpicker or calendar. when add date day 1 12 can add database, when try add date day 13th or above shows error message run-time error '-2147467259'(80004005)': [odbc firebird driver][firebird]conversion error string "13/08/2017" the type in database "date", when turn type in database "varchar" fine, "varchar" cannot function date. wiki

javascript - Difference between Object.assign and using [...] syntax? -

i have code here , wondering if same thing or different. pretty sure these both suppose same wasnt sure if doing right. let zonecomment = updatedmap[action.comment.zone] ? [...updatedmap[action.comment.zone]] : []; let zonecomment = updatedmap[action.comment.zone] ? object.assign([], updatedmap[action.comment.zone]) : []; if these same should use or matter? want use best practice if opinion of better please state so. in particular case not same. the reason have array, not object. doing ... on array spread out elements in array (but not properties) doing object.assign expects object treat array object , copy enumerable own properties it, not elements: const = [1, 2, 3] a.test = 'example' const 1 = [...a] // [1, 2, 3] const 2 = object.assign([], a) // { '0': 1, '1': 2, '2': 3, 'test': 'example' } console.log('\none'); (let prop in one) { console.log(prop); } cons

python - Retrieve all values in a column that are not present in another column -

in pandas, used able take dataframe column, compare against second dataframe column, , items missing second column so: notyetincluded = notyetincluded.loc[~notyetincluded["id"].isin(df_o["id"])] however, no longer works in updated pandas (i error valueerror: buffer dtype mismatch, expected 'python object' got 'long long' ). how do that? the part seems cause breakage this: notyetincluded["id"].isin(df_o["id"]) i don't know if helps, these columns store numbers 4150 , 5808 , etc. they're 4 digits or less long. for example: notyetincluded: 0 5747 1 5746 2 5725 3 5722 4 5720 5 5707 name: id, dtype: object df_o: 24 5365 4 5720 15 5599 name: id, dtype: int64 use df.astype(str) cast columns string , compare. n = notyetincluded notyetincluded = n[~n["id"].astype(str).isin(df_o["id"].astype(str))] wiki

html5 - How to save or download PrimeNg chart images - Angular 4 -

i'm using primeng chart module (p-chart) display charts inside cards. requirement is, should able save images (of charts/graphs) clicking download icon. have used ngfor iterate on json object , have displayed chart inside card successfully. here html: ... <div class="card-media-block" id="chart-{{rcard.id}}"> <p-chart [type]="rcard.typeofreport" [data]="rcard.content"></p-chart> </div> ... i found p-chart converted canvas in runtime , doesn't have dedicated id . i've used nearest div element's id reach canvas element using .childnodes property, unfortunately not able save/download image this. here runtime html generated above block (found inspecting element): <div _ngcontent-c3="" class="card-media-description" id="chart-reportcard1"> <p-chart _ngcontent-c3="" class="ng-tns-c3-2" ng-reflect-type="bar" ng-refl

javascript - Vue.js template concatenate props -

js: vue.component('profile', { template: `<a v-bind:href="id"></a>`, props: ['id'] }); var app = new vue({ el: '.app', data: { user: userobject } }); html: <profile :id="user.id"></profile> expected result: <a href="/profile/2"> question: how concatenate "/profile/" user.id equal 2? you can write javascript inline in vue templates this: template: `<a v-bind:href="'/profile/' + id"></a>`, alternately, bind computed property: vue.component('profile', { template: `<a v-bind:href="url"></a>`, props: ['id'], computed: { url() { return '/profile/' + this.id; } } }); wiki

wordpress - iis server blocking access to .webp files -

so i'm trying add .webp image support wordpress site, run on iis. now image exists on server , file name correct when try load image via url address in browser 404 error. 404 - file or directory not found. resource looking might have been removed, had name changed, or temporarily unavailable. anyone know how might resolve issue? i tried added <add extension=".webp" policy="cacheuntilchange" kernelcachepolicy="dontcache" /> doesn't work it's caching. is there somewhere can allow access file types? do maybe need allow filetype through firewall? i'm still new working iis i'm little lost. cheers ok figured out. i had allow mime type in iis manager. https://technet.microsoft.com/en-us/library/cc725608(v=ws.10).aspx wiki

Android Studio does not work with read-only shared Android Sdk -

with android studio 2.3 seems impossible use shared , therefore read-only sdk installation. # pwd /opt # chmod -r a+r android android-studio # find android -type d -exec chmod 755 {} + # find android-studio -type d -exec chmod 755 {} + # su other $ export android_sdk_root=/opt/android/sdk $ touch /opt/android/sdk/test touch: cannot touch '/opt/android/sdk/test': permission denied /opt/android-studio/bin/studio.sh studio starts nicely wants download sdk (android_sdk_root) ignored. anyway, can try set in sdk-manager, not work location read-only (i can understand "manager" not want read-only location). there possibility "configure, project defaults, project structure" , there entry "android sdk location /opt/android/sdk accepted. , works existing projects. when starting new project see wizzard abort message sdk location not writable. copying empty project , starting there works. ubuntu 16.04.3, oracle jdk 1.8. fresh android studio 2.3.3.

r - loop_apply.o: file not recognized: File format not recognized -

i trying install r ’s plyr package. here error message: * installing *source* package ‘plyr’ ... ** package ‘plyr’ unpacked , md5 sums checked ** libs clang++ -i/opt/r-3.4.1/include -dndebug -i"/home/isomorphismes/r/i686-pc-linux-gnu-library/3.4/rcpp/include" -i/usr/local/include -fpic -i/opt/boost_1_61_0/boost -c rcppexports.cpp -o rcppexports.o clang -i/opt/r-3.4.1/include -dndebug -i"/home/cd/r/i686-pc-linux-gnu-library/3.4/rcpp/include" -i/usr/local/include -fpic -g -o2 -flto -c loop_apply.c -o loop_apply.o clang++ -i/opt/r-3.4.1/include -dndebug -i"/home/isomorphismes/r/i686-pc-linux-gnu-library/3.4/rcpp/include" -i/usr/local/include -fpic -i/opt/boost_1_61_0/boost -c split-numeric.cpp -o split-numeric.o clang++ -shared -l/usr/local/lib -o plyr.so rcppexports.o loop_apply.o split-numeric.o loop_apply.o: file not recognized: file format not recognized clang: error: linker command failed exit code 1 (use -v see invocation) /opt/r-3.

TDD vs Defensive Programming -

uncle bob says: "defensive programming, in non-public apis, smell, , symptom, of teams don't tdd." i wondering how tdd can avoid (internal) function used in unintended way? think tdd can´t avoid it. merely shows function used correctly because calling function covered it´s passing unit tests. when developing new feature using (undefensive) function feature developed tdd. unintended use of function fail new features tests. so using tdd drive new features force correcty use (internal) functions. do think meant uncle bob´s tweet? so using tdd drive new features force correctly use (internal) functions. exactly. keep in mind subtle "gap" here: should use tdd write (unit) tests test contract of public methods. not care implementation of these methods - internal implementation detail. therefore: if "new" code uses existing method in unintended way "told" because exception thrown or receive unexpected result. that

javascript - ESLint error use Object.keys instead of for..in -

i'm working on below code works fine. but, eslint suggest use object.keys instead of for..in loop. tried iterate keys , search if match found return object. works for..in not object.keys. tried replace foreach filter didn't work me. suggestions. function searchobj (obj, query) { // object.keys(obj).foreach(function(key){ (var key in obj) { var value = obj[key]; if (typeof value === 'object') { return searchobj(value, query); } if (typeof value === 'string' && value.tolowercase().indexof(query.tolowercase()) > -1) { return obj; } } } var demodata=[ {id:1,desc:{original:'trans1'},date:'2017-07-16'}, {id:2,desc:{original:'trans2'},date:'2017-07-12'}, {id:3,desc:{original:'trans3'},date:'2017-07-11'}, {id:4,desc:{original:'trans4'},date:'2017-07-15'} ]; var searchfilter = demodata.filter(function(obj){ return searchobj(obj, &#

python - How to keep column MultiIndex values when merging pandas DataFrames -

i have 2 pandas dataframes, below: df1 = pd.dataframe({('q1', 'subq1'):[1, 2, 3], ('q1', 'subq2'):[1, 2, 3], ('q2', 'subq1'):[1, 2, 3]}) df1['id'] = ['a', 'b', 'c'] df2 = pd.dataframe({'item_id': ['a', 'b', 'c'], 'url':['a.com', 'blah.com', 'company.com']}) df1 : q1 q2 id subq1 subq2 subq1 0 1 1 1 1 2 2 2 b 2 3 3 3 c df2 : item_id url 0 a.com 1 b blah.com 2 c company.com note df1 has columns hierarchical indexing (eg. ('q1', 'subq1') ) , normal indexing (eg. id ). i want merge these 2 data frames on id , item_id fields. using: result = pd.merge(df1, df2, left_on='id', right_on='item_id') gives: (q1, subq1) (q1, subq2) (q2, subq1) (id, ) item_id url 0 1

db2 - IEI Notes Direct Transfer Activity -

Image
i using notes connector direct transfer activity send data db2 luw table. data in notes database text , decimal(7,2) in external datasource. have added this, , notes connector , tried several variations of , each time same error, ,. appreciated. my other option transfer data new database, run agent convert data using formulas included, , direct transfer activity using new database. transfer data separate database activity deletes , creates each time based off existing template, run agent in new database set new fields of proper type needed data converted, , transfer new fields, proper format, db2 table. tested , worked. although solution work our organization has policy of not creating new databases went route of using db2 luw stored procedures delete documents , insert new records both being called iei (fka lei) direct transfer activities. wiki

Azure GraphAPI getMemberGroups Bad Request error -

Image
i attempting make azure graph api call getmembergroups, getting "400 bad request" error in response. according documentation [ https://msdn.microsoft.com/en-us/library/azure/ad/graph/api/functions-and-actions#getmembergroups] , following request should : i using postman make request keep getting "request_badrequest" error code. my post request is: red bar tenant id , blue bar object id of user. my headers are: my body is: i keep getting error message: { "odata.error": { "code": "request_badrequest", "message": { "lang": "en", "value": "invalid json. value '------' not valid number." } } } i not sure why happening, have clues? since posting json data, shouldn't use form-data . application/json type data, should use raw option send data. wiki

windows - How to make AppVeyor use different versions of Emacs? -

i want use different versions of emacs. think have build matrix feature. have searched around , cannot find how done. i going use choco install packages. default version emacs24. emacs25 available via unofficial package. i want install different versions of same software , run simultaneous builds. here wishful attempt of (this doesn't work way): matrix: - emacs: "24" - emacs: "25" install: - ps : switch($emacs){ "24" {choco install emacs} "25" {choco install emacs64} default {echo "emacs install fail"}} - refreshenv build_script: - script thanks in advance. emacs environment variable ( not local one). yaml syntax require environment tag before matrix . can create configuration in ui , press export yaml button if not sure. , not space between ps , : . other config good. here fixed one: environment: matrix: - emacs: 24 - emacs: 25 install: - ps: switch($env:emacs){ 24 {choco install

java - maven-shade-plugin add application version to manifest -

i can't figure out how maven-shade-plugin include application version pom file manifest file. found examples maven-jar-plugin suggests including <archive> <manifest> <adddefaultimplementationentries>true</adddefaultimplementationentries> <adddefaultspecificationentries>true</adddefaultspecificationentries> </manifest> </archive> within plugis configuration section ( http://blog.soebes.de/blog/2014/01/02/version-information-into-your-appas-with-maven/ ). tried maven-shade-plugin, doesn't work. tried find information if org.apache.maven.plugins.shade.resource.manifestresourcetransformer can not find in docs. has idea how this? thanks! wiki

c# - LINQ Join with multiple or conditions -

my question similar question linq join multiple conditions in on clause , other similar question either talk having properties map respective conditions or writing query without join from t1 in projects t2 in tasks.where(x => t1.projectid == x.projectid && x.completed == true) .defaultifempty() select new { t1.projectname, t2.taskname } suppose if go first way of writing i.e. on new { t1.projectid, secondproperty = true } equals new { t2.projectid, secondproperty = t2.completed } j1 that gets converted , (&&). want or (||) in join form (2nd way of writing). thanks in advance. if want perform join projectid , have || on secondproperty must join 1 field , add where clause: from t1 in projects join t2 in tasks on t1.projectid equals t2.projectid t1.secondproperty || t1.secondproperty == t2.completed select new { t1, t2 } wiki

nao robot - How to add a dialog to the default dialogs -

Image
i having dialog in behavior. setting behavior default , way dialog available on start. i found default topics basic channel ( http://doc.aldebaran.com/2-1/nao/basic_channel_conversation.html ) initialized 'run_dialog_dev/.' (i guess basic channel or part of factory state of robot). so there way put dialog(topic) part of default ones without putting in behavior, adding topic robot. , topic auto included in 'run_dialog_dev/.'. to have dialog topic initialized 'run_dialog_dev/.' alongside basic channel should declare 'collaborative dialog' (see choregraphe documentation ). when creating topic, make sure tick checkbox @ bottom of window. your choregraphe project won't have contain behavior, can have contain dialog. wiki

angularjs - Moment js counter -

Image
hello every 1 i'm working on task uses moment js want make counter count min,sec , hours toggl.com counter have input field called start , 1 called end want subtract finish start , replace counter value , counter continue current value ex counter 0:00:10 , start is: 01:15 pm , end : 01:30 pm want subtract start end result value 00:15 value replaces current value of counter 0:00:10 0:15:00 counter start value , add seconds normal counter 0:15:01 , on please check toggl.com understand mean 2/ want if changed value of start value number 10 , if time pm consider 10 pm not 10 am code here can't that validate(val:string) { let temp =this.starttime; let parsedtime = moment(val, "hh:mm a"); if(parsedtime.isvalid()) { this.starttime = parsedtime.format('hh:mm a') } else { this.starttime = "temp"; console.log("no"); } } where val enterd value in start input field want if entered unexpected format r

Where to check the tomcat logs in google app engine flex environment via SSH (Putty) -

i using google app engine flexible (auto scale) deploy spring boot application via intellij ide. app engine crashes (returns 502) whenever increase number of concurrent requests client. checking logs console confusing , check logs manually via ssh (using putty) in relevant instance troubleshoot issue. see nginx logs under /var/log/nginx/, not able see tomcat logs are. is there way login instance , check tomcat logs, if in location can find same? also, in location can find default dockerfile configuration or spring boot app files in instance? also, please suggest if there way check logs apart console , logging instance via ssh. thanks in advance. wiki

osx - How to launch app by Automator from mounted disk in MacOS? -

Image
i have .dmg package mounts disk. create launch program automator execute sh-script disk. there way this? disk , script highlighted: in automator needs following: /volumes/irule/start-irule-client.sh wiki

electron - Use node-gyp to crosscompile node module for Windows from Linux -

i'm developing electron app requires raw-socket node module. works fine when try package electron app windows faced raw-socket needs compiled before. so i'm trying understand how compile linux module @ packaging time. for package app i'm using electron-packager , thing think work write gulp task compile windows module before packaging, don't know if good. thanks lot! wiki

performance - getting perf sample data at process context -

i'm writing linux kernel module samples linux kernel using perf interface perf_event_create_kernel_counter . 1 issue associated instruction pointer(ip) , call chain(perf_callchain) of kernel samples belongs nmi context rather process context. how can collect information associated process context rather nmi context? wiki

python - Remove space between buttons in tkinter -

Image
i'm making calculator in tkinter , i'm trying buttons right next each other this: this code buttons far: entry(root).grid(row=0, column=0, columnspan=5) button(root, text='c').grid(row=1, column=0, sticky='w') button(root, text='ce').grid(row=1, column=1, sticky='w') button(root, text='0').grid(row=5, column=0) columncount = 0 x in range(1, 4): button(root, text=str()).grid(row=4, column=columncount) columncount += 1 columncount = 0 x in range(4, 7): button(root, text=str(x)).grid(row=3, column=columncount) columncount += 1 columncount = 0 x in range(7, 10): button(root, text=str(x)).grid(row=2, column=columncount) columncount += 1 how remove space? you need request widgets expand fill space given them. grid geometry manager can control sticky attribute. give string containing 1 or more of "n", "s", "e", , "w", representing points of compass (no

ios - Merging multiple UIViews -

i using following method merge multiple uiview 's: targetimageview.addsubview(view1) targetimageview.addsubview(view2) uigraphicsbeginimagecontextwithoptions(targetimageview.bounds.size, false, uiscreen.main.scale) targetimageview.layer.render(in: uigraphicsgetcurrentcontext()!) let combinedimage = uigraphicsgetimagefromcurrentimagecontext()! uigraphicsendimagecontext() this method works if views static. however, if 1 of views have animated content, video, animation, or gif ... method not work because think takes snapshot of views inside frame of targetimageview . what way combine multiple views if 1 of views has non-static content? let cgrect = cgrect(x: 0, y: 0, width: desirewidthofuiview, height: desireheightofuiview); let view1 = uiview(frame: cgrect) let view2 = uiview(frame: cgrect) i hope help. :) wiki

login - How to add confirm password field in angular 2 form (Tried many examples) -

please me angular 2 form. want add confirm password field can verify password. here code. export class signupcomponent implements oninit { signupform: any; result: any; constructor( private formbuilder: formbuilder, private accountservice: accountservice, private router: router ) {} ngoninit() { this.signupform = this.formbuilder.group({ username: ['', [validators.required]], password: ['', [validators.required]], fullname: ['', [validators.required]], email: ['', [validators.required]] }); } save(event: any) { this.accountservice.create(this.signupform.value).subscribe(data => { if(data.count == 0) { this.router.navigate(['/login']); } else { this.result = data } }); } write custom validation import {abstractcon

bash - how to change directory from inside unix shell -

change(){ read -p "enter username" q sudo su $q cd /home/$q pwd } change without using sudo able change directory, when sudo su, cd not work ? possible reason behind , solution when run sudo su $q , logging in $q. then, script waits until sudo su command exits, before continuing execute. rest of script execute after type exit -- including change of directories. if wish su end in different directory, first change directory, , then run sudo su command. wiki

angular - How to use firebase auth in my own chrome extension -

i create simple chrome extension using angular. create homepage, user can login google account. easy, because used angularfire2. problem occured, when wanted use firebase in context menu of own extension: f.e: context-menu.js var clickedfunc = function(info, tab) { console.log(info, tab) alert('click'); }; var parent = chrome.contextmenus .create( { "title": "check click", "contexts": ["selection"], "onclick": function(info, tab) { clickedfunc(info); } } ); these code work fine, if trying using firebase in context menu in way: context-menu.js var firebase = require('firebase/app'); var config = { apikey: 'secret', authdomain: 'secret', // know mean }; var app = firebase.initializeapp(config); var clickedfunc = function(info, tab) { console.log(info, tab) alert(firebase.app().name); }; var parent = chrome.contextmenus .crea