Posts

Showing posts from August, 2014

java - How to check the log4j version in wildfly 10 and upgrade it? -

when go directory {wildfly_home}/modules/system/layers/base/org/apache/log4j/main i see module.xml file inside it, no log4j jar there. so have 2 questions: how can check version of log4j packed wildfly 10 ? is possible upgrade log4j version of wildfly module ?

Dynamically create array of HTML elements with typescript in Angular 2/4 -

i want dynamically add divs using loop typescript in angular. want reproduce following pseudocode in .ts component file: i: number = 4; arrayofhtmlelements: html elements = []; in range (1, i): create div @ index i'm assuming slide array of html elements .html component file using: <li *ngfor="let arrayofhtmlelement of arrayofhtmlelements; let = index">{{i + 1}}: {{arrayofhtmlelements}}</li> you should iterate on objects , create inner html in template this: const heroes = [ { name: 'spiderman' }, { name: 'superman' }, { name: 'superwoman!' } ] template: ` <ul> <li *ngfor="let hero of heroes"> <div>{{hero.name}}</div> </li> </ul> `

mysql - SQL group by months, display empty months -

i got sql fiddle minimal data. database contains on 1000 output columns query couldnt load sqlfiddle. i display months years found. in example car 1 sold in 2003 , display empty months 2003. for car 2 sold in 2003 , 2004. display empty months 03 , 04. i have read lot of similar questions , think simple join month table should trick. dont know how joins properly. me out on one? sql fiddle here: http://sqlfiddle.com/#!9/14b2f5/3 also real query in mysql workbench , output this . can see feb. 2003 missing there. display "1952 alpine renault 1300" - "0" - "february 2003" instead of nothing now.

What is the best practice for a polymer menu? -

i want build polymer app has drawer menu inside goes different pages when different items clicked. so far i've considered 3 options: option 1 using <iron-selector> in starter-kit . option 2 using <paper-button> , add on-click function route desired page. a few of these inside <app-drawer> : <paper-button on-click="gotopage" id="my-page-one">page 1</paper-button> and function in script: gotopage(e){this.set("route.path", "/" + e.srcelement.id);} option 3 using <paper-menu> , <paper-item> inside similare option 2: <paper-item on-click="gotopage" id="my-page-one">page 1</paper-item> which 1 considered best practice? better options?

swing - Manage Java CardLayout JPanels created with different classes -

Image
i need simple example of how manage multiple jpanels (created different classes) in 1 jframe using cardlayout (or else?). illustrative example of need: panel a : panel b : example of file structures: // gui.java public class gui { ... ... ... } // panela.java public class panela { ... ... ... () { jpanel pnl = new jpanel(); pnl.setbackground(color.orange); jbutton btn = new jbuttn("show panel b"); pnl.add(btn); } public void actionperformed(actionevent ae) { ... } } // panelb.java public class panelb { ... ... ... () { jpanel pnl = new jpanel(); pnl.setbackground(color.green); jbutton btn = new jbuttn("show panel a"); pnl.add(btn); } public void actionperformed(actionevent ae) { ... } } i found lot of examples doing this, jpanels created in same class jbuttons fields listener access them. tried edit example...

c++11 - Why does making this virtual destructor inline fix a linker issue? -

if have pure virtual class interfacea consists solely of pure virtual destructor, why have define destructor inline ? i don't error when try link it. below admittedly contrived example, illustrates point. point not compile me using cmake , g++. however, if change interfacea destructor definition follows - inline interfacea::~interfacea(){}; compiles. why this? inline keyword do? // interfacea.h, include guards ommitted clarity class interfacea { public: virtual ~interfacea() = 0; }; interfacea::~interfacea(){}; // a.h, include guards ommitted clarity #include "interfacea.h" class : public interfacea { public: a(int val) : myval(val){}; ~a(){}; int myval; }; // auser.h, include guards ommitted clarity #include "interfacea.h" class auser { public: auser(interfacea& ana) : mya(ana){}; ~auser(){}; int getval() const; private: interfacea...

vba - FOR loop in Excel - find and replace -

Image
i have following code sub cleancat() dim integer = 1 50 columns("a").replace what:="cat" & i, replacement:="category" & i, lookat:=xlpart, searchorder:=xlbyrows, matchcase:=false, searchformat:=false, replaceformat:=false columns("a").replace what:="cat " & i, replacement:="category" & i, lookat:=xlpart, searchorder:=xlbyrows, matchcase:=false, searchformat:=false, replaceformat:=false columns("a").replace what:="category " & i, replacement:="category" & i, lookat:=xlpart, searchorder:=xlbyrows, matchcase:=false, searchformat:=false, replaceformat:=false columns("a").replace what:="category" & i, replacement:="category" & i, lookat:=xlpart, searchorder:=xlbyrows, matchcase:=false, searchformat:=false, replaceformat:=false columns("a").replace what:="cat" & i, replacement:="catego...

c# - How to create a custom selectionmode in winforms listbox -

i have listbox in winforms application give selection behavior different built in options control.if choose multi-extended, accustomed - ability use shift or control select multiple items in list. multi-simple option lets select individually , leave item selected until delect it. i'm trying deal different problem solved combination of 2 options. users want able use shift key highligh long list , don't want accidentally lose selection if mistakenly click on 1 other item in list. thought keep hightlighted until click clear button. kind of think asking not windows meant , should not allowed thought post question see if has done before.

linux - What does "chown nginx:nginx * -R" do? -

i understand command chown nginx:nginx -r does. my question regarding star * wildcard. so i'm asking what difference between these 3 commands: chown nginx:nginx * -r chown nginx:nginx . -r chown nginx:nginx .* -r this 1 changes group/owner permissions on within current working directory, not current working directory itself: chown nginx:nginx * -r the next 1 changes permissions on current directory, , in it: chown nginx:nginx . -r the final 1 same thing second: chown nginx:nginx .* -r

c# - How do I install bower packages using Cake (http://cakebuild.net) -

i working on migrating powershell build script cake script , have run following on collection of directories bower.json files found: foreach ($directory in (get-commonpath $bowerdirs)) { push-location $directory &bower install pop-location } but since there doesn't seem cake alias bower i'm struggling work out how should ( &bower install ) using cake. update based on @garyewanpark's answer tried following task("bowerinstall") .does(() => { var bowerroots = getbowerroots(); foreach (var bowerroot in bowerroots.select(x => x.fullpath)) { try { var exitcodewithargument = startprocess("bower", new processsettings { arguments = "install", workingdirectory = bowerroot }); information("exit code: {0}", exitcodewithargument); } catch (exception ex) { information($"failed on {bowerroot}, {ex.message}"...

c++ - Is there a way to call base class function which is over-rided in its derived class that used private inheritance? -

i'm going through inheritance concepts in c++ , tried such code: class base{ public: void display(int j) { cout<<j<< " base "<<endl; } }; class derived:private base{ public: using base::display; void display(int k) { cout<<k<< " derived "<<endl; } }; int main() { derived obj; obj.display(10); //obj.base::display(46); --> cannot used base privately inherited. conversion derived base cannot happen in case. return 0; } in above case, there way invoke base class display function main using obj in anyway? if base function not over-rided in derived class, using (in case if base functions hidden overloaded functions in derived), declare in derived , invoke derived class obj . in such cases base function over-rided in derived private inheritence, there way invoke base function? as i'm learning c++, i'm curious know if there way thing (irr...

ssh - Unable to pull/push remote Git at work -

i want pull/push remote git repository @ work , doesn't work, work when @ home. following error message: $ git pull origin master password 'https://####@api-###############.oasis.sandstorm.io': remote: missing or invalid authorization header. remote: remote: address serves apis, allow external apps (such phone app) remote: access data on sandstorm server. address not meant opened remote: in regular browser. fatal: authentication failed 'https://###@api-#########.oasis.sandstorm.io/conradchamerski/merakiscripts.git/' the repository hosted on sandstorm , using cogs grain if familiar that. have added proxy settings global configs of git , still doesn't work. tried following combinations: > git config --global http.proxy http://name:port git config --global > http.proxy http://username:password@name:port

Bitpay - notification callback on TEST environment -

does ipn work in test environment? there requirements? (https, with/without port number etc.). i'm providing "normal" http url didn't receive callback. tried manually re-send notification https://test.bitpay.com/invoices/:invoice-id/notifications endpoint, received error: {"error":"this endpoint not support merchant facade"} i'm using fullnotifications parameter too.

python - No module found when using libfreenect in virtual environment with OpenCV on Raspberry Pi 3 -

i managed install opencv on raspberry pi 3 these instructions . now have run source ~/.profile workon cv when start python, can import cv2 without problems, can't import freenect. says importerror: no module named freenect but when start python not in virtual environment cv, can import freenect have same problem cv2: importerror: no module named cv2 can me problem?

c# - unity 5: Flip a gameobject in a certain order -

i able flip gameobject problem flips before attack animation starts. don't know how put in order. hoping can help. // update called once per frame void update () { if(input.getkeydown(keycode.space)) { getcomponent<rigidbody2d>().velocity = new vector2(4f, 0); startcoroutine(enemyreturn()); } } ienumerator enemyreturn() { yield return new waitforseconds(1.1f); getcomponent<animator>().settrigger("slimemelee"); //attack animation getcomponent<rigidbody2d>().velocity = new vector2(0, 0); vector3 thescale = transform.localscale; thescale.x *= -1; transform.localscale = thescale; } one trivial solution yield time before fliping: ienumerator enemyreturn() { yield return new waitforseconds(1.1f); getcomponent<animator>().settrigger("slimemelee"); //attack animation yield return new waitforseconds(0.5f); // setup yield time. getcomponent<rigidbody2d>(...

ruby - rails carrierwave with cloudinary return null imageurl post -

iam using gem cloudinary carrierwave uploading. method post worked got return null on image path url after uploading image this create method def create @multi_images = array.new image_params[:imagepath_data].each.with_index |file, index| @single_image = image.new(:path => file, :user_id => curent_user.id) if @single_image.save @multi_images.push(@single_image) if image_params[:imagepath_data].length == index+1 render json: @multi_images, httpstatus: postsuccess break end else render json: {message: "some file can't saved!", status: postfailed} break end end end can solve :(

gcc - using matlab codegen but output .exe file can not start because .dll is missing from my computer -

i have used matlab 2015a generate .c , .dll files on windows7 follows : codegen -config:dll example_fun.m -args {complex(0,0),0,0,0,0} and want use .dll output file along generated main .c file using gcc on command prompt follows: gcc main.c example_fun.dll -wl,-rpath=$(pwd) the .exe file generated , trying execute on cmd as: a.exe . however, having error message error message : "the program can't start because.dll missing computer. try reinstalling program fix problem" although .dll file in same destination a.exe. the strange issue here same procedure works on linux executing /a.out , output printed fine. i believe whole problem how make generated a.exe sees .dll alhough -as have mentioned before- both of them in same folder. i have tried add folder's path in system variables. however, had same error message. so doing wrong step ? there other way generate .exe file , execute both main.c , accompanying .dll generated matlab codegen? ...

php - Multiple Joins Laravel -

i need make 2 joins many conditionals where, have this $matchthese = [ 'suspended' => 0, 'status' => 1, 'approved' => 1 ]; $matchother = [ 'status' => 1, 'approved' => 0 ]; $deals = listsdeals::where( $matchthese )->where('stock', '>', 0)->orwhere( $matchother )->wheredate('end_date', '>', date('y-m-d'))->limit( 4 )->offset( 0 )->orderby( 'start_date' )->get(); $deals_lists = db::table('deals') ->join( 'list_has_deals', 'deals.id', '=', 'list_has_deals.deal_id' ) ->join( 'lists', 'list_has_deals.list_id', '=', 'lists.id' ) ->paginate( 10 ); i need 1 unique query 2 vars, select deals 'wheres' in first var , later make joins, regards. i think trick : $query = listsdeals::where( $matchthe...

jquery - How to get the text from FormTextBox? -

i have code: <div class="col-left"> @formtextbox("message:", html.textareafor(m => m.message, new { @class = "required-form-control" })) </div> now want modify text save it. added button via ajax call. question how in js side? edit: custom template is: @helper formtextbox(string labeltext, mvchtmlstring input) { // divs } under normal circumstances razor engine generate following html when using @html.textareafor <textarea class="required-form-control" cols="20" id="message" name="message" rows="2"></textarea> you able access value of element in jquery so: var check = $('#message').val(); alert(check); it appear (or team member have created custom display template (@formtextbox) rendered html output may different standard element output text area. if not render id have shown in html edit question include html generated razor ...

c# - Is that possible to have two namespaces in the class XMLTypeAttribute to handle deserialization of 2 soap responses? -

i have class has following declaration: [system.xml.serialization.xmltypeattribute(anonymoustype = true, namespace = "http://schemas.xmlsoap.org/soap/envelope/")] [system.xml.serialization.xmlrootattribute(namespace = "http://schemas.xmlsoap.org/soap/envelope/", isnullable = false)] public partial class envelope { private envelopebody bodyfield; /// <remarks/> public envelopebody body { { return this.bodyfield; } set { this.bodyfield = value; } } } . . code generated here based on response xml... . [system.xml.serialization.xmltypeattribute(anonymoustype = true, namespace = "order")] [system.xml.serialization.xmlrootattribute(namespace = "order", isnullable = false)] public partial class insertresponse { private insertresponseout outfield; /// <remarks/> public insertresponseout @out { { r...

javascript - How to use Chrome developer tools to profile mounting times of React.native components? -

Image
the chrome development tools provide me flame chart showing execution times of various methods being called part of rendering of react.native ios application. although chart displays many mountcomponent calls, not show particular component being rendered. there way attach information chart? this see: one thing thought of logging parameters function calls. give me enough information see components take time. there way this?

android - Why my activity's onStop() is not getting called only onPause() is getting called even when my activity is completely not visible? -

i have activity mainactivity opening activity transactionactivity problem happening me why mainactivity's onstop() method isn't getting called onpause() getting called. have seen post on difference-between-onpause-and-onstop , , here in answers written when part of activity still visible onstop() not gets called onpause called case mainactivity's not visible why it's onstop() not getting called ?? is happening because of activity leak or anything causing activity stay in memory when not visible ?? anyone, please enlighten me happening here ?? my code calling transactionactivity mainactivity intent = new intent(mainactivity.this, transactionactivity.class); bundle b = new bundle(); b.putint("trans_type", 0); i.putextras(b); startactivity(i); overridependingtransition(0, 0); when call activity previous one, placed "beneath" new one. once press, previous activity shown. default bahavior in android. onstop called when...

typescript1.7 - How to group data in Angular 2 ? -

how can group data in angular 2 typescript. aware done using "group by" filter in angular 1.x, not getting how group data in angular 2. have array: import {employee} './employee'; export var employees: employee[]; employees = [ { id: 1, firstname: "john", lastname: "sonmez", department: 1, age: 24, address: "24/7, working hours apartment, cal. us", contactnumber: "+968546215789" }, { id: 2, firstname: "mark", lastname: "seaman", department: 2, age: 25, address: "32-c, happy apartments, block-9c, cal. us", contactnumber: "+968754216984" }, { id: 3, firstname: "jamie", lastname: "king", department: 3, age: 32, address: "54/ii, glorydale apartment, cal. us", contactnumber: "+967421896326" }, { id: 5, firstname: "jacob", lastname: "ridley", department: 5, age: 24,...

loops - Save result of each iteration python -

i'm trying use qpx express. want save airports origin , destination of each loop results. when send json request (origin : ory / designation : lax / solution 2) have 2 flights (perhaps flight connecting). multivol = data['trips']['tripoption'] origine_air = [] destination_air = [] p in multivol : print("") multivol1 = p['slice'] prix = p['saletotal'] print prix q in multivol1 : multivol2 = q['segment'] duree_trip = q['duration'] duree_trip_h = duree_trip // 60 print duree_trip_h s in multivol2 : multivol3 = s['leg'] d in multivol3 : ori = d['origin'] dest = d['destination'] heure_ar = d['arrivaltime'] heure_de = d['departuretime'] vol_entier = ori + dest print vol_entier origine_a...

reactjs - Gradient Background for TabBar? -

i'm trying make background of tabnavigator gradient. documentation @ https://facebook.github.io/react-native/docs/colors.html indicates color properties match how css works on web . went https://developer.mozilla.org/en-us/docs/web/css/linear-gradient , read because s belong data type, can used s can used. reason, linear-gradient() won't work on background-color , other properties use data type. consequently, following won't work: import { tabnavigator, tabbarbottom } 'react-navigation'; export default tabnavigator( { home: { screen: homescreen, }, . . . }, { navigationoptions: ({ navigation }) => ({ tabbaricon: .... tabbarcomponent: tabbarbottom, tabbarposition: 'bottom', animationenabled: false, swipeenabled: false, tabbaroptions: { activetintcolor: 'rgb(111, 111, 111)', labelstyle: { fontsize: 12, }, style: { backgroundcolor: 'linear-gr...

Google Chrome is not prompting the users to enable flash on my site -

google chrome no longer prompting users on site enable flash required play videos users upload. recent change , think it's due chrome disabling flash on year 2017 (i haven't changed anything). works fine on firefox. the best solution convert videos mp4 rather flv, right second need fix problem actively using site. need way force browser prompt user enable flash. know it's possible i've seen on other sites i'm not sure how atm. ideas? here's code plays video: <script type='text/javascript' src='/jwplayer/swfobject.js'>/script> <div id='mediaspacex'>this text replaced</div> <script type='text/javascript'> var = new swfobject('/jwplayer/player.swf','mpl',640,480,'9'); so.addparam('allowfullscreen','true'); so.addparam('allowscriptaccess','always'); so.addparam('wmode','opaque'); so.addvariable('file',es...

javascript - stop div from reopening on click jQuery -

i new jquery/javascript , think don't understand own code. it behaves want when re-click on .projtog , re-toggles .projcontent , don't want that. .projcontent close when re-click on associated .projtog . tried giving .projcontent boolean value, didn't know it. here code: $('div.projcontent').css('height', '0vh'); $('h2.projtog').click(function() { var $dataname_2 = $(this).data("name"); $('div.projcontent').css('height', '0vh'); settimeout(function() { $("#" + $dataname_2).css('height', '100vh'); }, 290); }); #projectsection { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; padding: 1em; padding-top: 0; wi...

java.sql.SQLException when trying to connect to azure database using spring-boot -

i have spring-boot project in try connect azure database. when run application i'm having weird error. java.sql.sqlexception: driver:sqlserverdriver:2 returned null url:jdbc:h2:mem:testdb;db_close_delay=-1;db_close_on_exit=false this application.properties spring.profiles.active=production spring.thymeleaf.cache=false spring.datasource.platform=jdbc:sqlserver://spring-boot-intro.database.windows.net:1433;database=spring-boot-intro;encrypt=true;trustservercertificate=false;hostnameincertificate=*.database.windows.net;logintimeout=30; spring.datasource.username=fabio spring.datasource.password=*my password* spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.sqlserverdriver spring.jpa.hibernate.ddl-auto=create-drop these dependencies <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-data-jpa</artifactid> </dependency> <dependency...

C control flow, memory allocation: Abort trap 6, populate array with characters in string, nested for loops -

this question control flow , possibly memory allocation. given long long number, doing following: converting string iterating through characters of string in prescribed pattern (first layer of for loop) performing operation on each selected character (second layer of for loop) populating array processed data #include <stdio.h> #include <string.h> int main(void) { long long n = 12345678; // given number char str[8]; // initialize string of length 8 sprintf(str, "%2lld", n); // convert n string printf("the string is: %s\n", str); // check n converted string int arr[4]; // initialize array of length 4 (int = 6; >= 0; -= 2) // select every other char in string, starting second-to-last char { (int j = 0; j < 4; j++) // select position of array { arr[j] = (str[i] - '0') * 2; // convert char int, multiply 2, , assign array position ...

Angular 2: loading an external javascript file that requires variables -

here's example of embed code required fora video service (i've simplified considerably because details don't matter): <script> https://videothingexample.com/partner_id/123? entry_id=0_12345&playerid=default_player </script> it appears above url dynamically generates javascript (via php?) , returns passed variables ( entry_id example) included directly script itself. that is, every embedded player requires own script , have assume there unlimited players , loading scripts in .angular-cli.json isn't possible. my first instinct thrown <script> tags view, that's frowned upon angular scrub script tags out it's apparently possible use dom sanitizer end-runs, i'm wondering if that's necessary. what best practice including dynamically generated js this?

javascript - Google Analytics API viewSelector.execute() error -

Image
i having troubles google analytics embeded api. try display basics charts. here following code tried imitate: https://www.raymondcamden.com/2015/06/10/quick-example-of-the-google-analytics-embed-api the beginning ok because logged in. however, error occurs when call "viewselector.execute();". the javascript error 'uncaught exception'. don't know why appears because have followed step step tutorial... here code ( have replaced 'xxxxxxxxx.apps.googleusercontent.com' real client id) : @{ viewbag.title = "progress"; layout = null; } <script> if (typeof window.onerror == "object") { window.onerror = function (err, url, line) { alert('exdescription :' + line + ' |' + err + ' | ' + url); }; } </script> <!doctype html> <html> <head> <title>embed api demo</title> </head> <body> <!-- step 1: create containing elements. --> <p sty...

moq - How to unit test a helper funtion call in a collection in C# using Mock -

i 'm new unit testing , want create unit test following code: public ienumerable<product> createproductlist( ienumerable<int> productsids, ienumerable<product> products) { var productslist = productsids.groupjoin( inner: products, outerkeyselector: x => x, innerkeyselector: y => y.id, resultselector: (x, y) => _productservicehelper. factoryproduct(x, y.firstordefault(k => k.id == x))).tolist(); return productslist; } the unit test have written far trying use mocksequence unsuccessfully: [test, testcasesource(nameof(testcases_createproductlist_somemissingids))] public void createproductlist_somemissingids_returnlistcontainingmissingones (ienumerable<int> listwithrequiredproductsids, ienumerable<product> listmissingids, ienumerable<product> expectedlistcontainingallrequired) { //_mockproductservic...

php - People can edit my form and send a string that is different from an email that mess up my databases -

my form requires email(set via input type) people use inspect element , submit other values not email. 1 of them percent sign , messes databases badly. tried checking percent sign didnt help. here's code, please give me lead or tell me what's wrong? thanks if(strpos($_post['email'], '&#37;') == false) { $curpass = strtoupper(hash("whirlpool", $_post['curpass'])); $passii = $con->prepare("select `password` `playerinfo` `playername` = ?;"); $passii->execute(array($_session["playername"])); while($row = $passii->fetch()) { $curpass1 = $row['password']; } if($curpass == $curpass1) { $email = mysql_escape_string($pemail); echo "<div class='flash_success'>your email has been changed.</div>"; $p_name_settings = $_session['playername']; $updatemail = $con->prepare("update `playerinfo` se...

html - Add a transition after clicking a button that shows a div -

on web page right now, have 8 icons when clicked show div below. how can add transition div, css or html make div gradually ease in instead of showing rapidly? thanks. link page . basic div css: #newspaperbutton { transition: 5s ease; padding: 50px 0; text-align: center; background-color: #afeeee; height: 100px; margin-top:2%; margin-left:2%; margin-right:2%; margin-bottom: 2%; font-family: 'poppins', sans-serif; font-weight: bold; font-size: 32px; -webkit-animation-delay: height 2s; animation-delay: height 2s; html: <section id="interest icons"> <span onclick="myfunction('newspaperbutton')" class="fa-stack fa-lg" id="newspaper"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-newspaper-o fa-stack-1x fa-inverse" aria-hidden="true"></i> </span> ... <div id="newspaperbutton" style="display:none...

python - Can I have pylint warn of suppression lines that would be unnecessary? -

with pylint, possible tell output warnings on lines explicitly disable particular warning, warning doesn't occur? the idea here i'd clean suppression lines added, after refactoring code. now obvious method remove suppression lines , add them 1 one. since pylint knows code , ask of using suppression lines, it'd better equipped point out unnecessary suppression lines. can pylint this? i tried search feature, came empty-handed. picked wrong search terms. i think looking useless-suppression , in pylint --enable=useless-suppression . disabled default.

javascript - How would you call specific CSS stylesheet in a React component on a specific site? -

so i'm working on platform built on react , platform has global css set clients way. a subset of affiliates under common group name want new sticky ad component has change css bit footer not covered up. so normally, i'd check our global variable value is, window.client.group, , if it's group, add css or css stylesheet through javascript in affiliate js file (our old generic platform). the new css needed is: @media (max-width:767px){ #ad201 {width:100%;position:fixed;bottom:0;left:0;z- index:99999;margin:0;border:1px solid rgb(232, 232, 232);background- color:#fff;margin: 0 !important;} .footer .container {padding-bottom:50px;} } in react though, what's best , proper way this? can see it's complicated needing in media query. i have start using group , matchmedia, what's best way bring in css? whole stylesheet? (stickyad.css? other way? , tips on how it?) const group = (window.client.group).tolowercase(); console.log(group); const m...

python - Predict test data using model based on training data set? -

im new data science , analysis. after going through lot of kernels on kaggle, made model predicts price of property. ive tested model using training data, want run on test data. ive got test.csv file , want use it. how do that? did training dataset: #loading train dataset python train = pd.read_csv('/users/sohaib/downloads/test.csv') #factors predict price train_pr = ['overallqual','grlivarea','garagecars','totalbsmtsf','fullbath','yearbuilt'] #set model decisiontree model = decisiontreeregressor() #set prediction data factors predict, , set target saleprice prdata = train[train_pr] target = train.saleprice #fitting model prediction data , telling target model.fit(prdata, target) model.predict(prdata.head()) now tried is, copy whole code, , change "train" "test", , "predate" "testprdata", , thought work, sadly no. know i'm doing wrong this, idk is. as long process ...

javascript - String becomes undefined in mapReduce -

i trying count number of docs per day in collection. using mongodb mapreduce function following map , reduce functions: var tsmapper = function(){ // timestamp , convert date var ts = new date((this.ntimestamp_ms)); var months = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']; var year = ts.getfullyear(); var month = months[ts.getmonth()]; var date = ts.getdate(); var newts = month + ' ' + date + ' ' + year; // emit newts , value 1 emit(string(newts), 1); } and reducer function: var reducer = function(key,values){ return array.sum(values); } then when run code on database: db.test.mapreduce(tsmapper, reducer, {"out" : "ts_count"}) it returns collection 1 document in "_id" of "undefined nan nan" , value equal total number of documents: { "_id...

r - (tcltk) File browser path display -

i need show file path in in window gui built tcltk after file has been selected user. library(tcltk) library(tcltk2) #create main window window <- tktoplevel() #creates tab window$env$nb <- tk2notebook(window, tabs = ("raw data")) tkpack(window$env$nb, fill = "both", expand = true) #renames tab window$env$rawtab<-tk2notetab(window$env$nb, "raw data") #function allows user select file getdata <- function(){ name <- tclvalue(tkgetopenfile( filetypes= "{ {csv files} {.csv} } { {all files} * }")) if (name == "") return(data.frame()) sc_data <- read.table(name, header=t) assign("all_data", all_data, envir = .globalenv) cat("data input sucess\n") } #button assigned function window$env$butbrowse<- tk2button(window$env$rawtab, text ="please select data",width= -6, command= getdata) tkgrid(window$env$butbrowse,pady=10) this basic setup allows user pick file , assigns variable. ...

java - Why I get error "Your security settings have blocked a local application from running”? -

what rid of this? wanted make game accessible browser. error "your security settings have blocked local application running". i changed browser. nothing. added exception in "configure java". nothing. looked internet , looked "medium" security level removed.. honestly, i'm not sure. but, might know what's causing problem. i'll list of them here (you can find full list @ what applets can , cannot do ): applets cannot access local file system. applets cannot connect or retrieve resources third party server. applets cannot load native libraries. applets cannot change securitymanager. applets cannot create classloader. applets cannot read system properties. in summary, don't try make changes user's desktop or client's windows folder. have them upload file instead. don't try access .pngs or .json external servers google or yahoo either, because java can't guarantee them safe too. neither...

c# - What is the best way to create a Utility dll that can be configured by consuming application? -

i have created dll has functionality in shared project project. however, may need adjust settings of dll project referencing it. best way expose configuration settings dll used project in entirely different solution? ways have tried: appsettings import applicationsettings import current setup, consuming solution setting values ignored/not set, why? dll setting public class applicationsettingsretriever : iapplicationsettingsretriever { public string logenvironmentsetting => configurationmanager.appsettings.get("logenvironment"); } consumer solution app.config <?xml version="1.0" encoding="utf-8"?> <configuration> <runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentity name="newtonsoft.json" publickeytoken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingredirect oldversion=...

osx - Script to remove all "non-admin" accounts from OS X Mavericks 10.9 -

i'm looking script or terminal command allow me remove non-admin accounts os x mavericks 10.9 workstations , users/_____ folder associated account. i have 4 computer labs @ high school need have macines can me this? i'm terminal newb.... thanks, todd

mysql - How to covert Innodb table to myisam tables in minimum downtime -

we have 250gb mysql innodb databases, performance reason have convert in myisam on production, optimal solution in minimum downtime i'd imagine like: create myisam copy of table. add/modify triggers on original table "sync" changes copy. incrementally copy old data original table copy; update , delete triggers should keep copied data date. (depending on specific table's structure , how incrementally copying, insert trigger may unnecessary or counter productive). drop foreign keys referencing original table. rename original table , rename copy original table's name. it won't fastest process, can't see having less downtime renaming couple tables.

multithreading - How to set all global variables in a Fortran module to private for OpenMP? -

i know how can set global variables in fortran module call in omp parallel section. know threadprivate can set list of variables private, have many global variables set. there way change default private global variables? there no such way (as far aware of). use threadprivate , list variables need. if have many global variables, rid of them. not sign of code design.

Box Oauth Powershell authorization -

maybe stupid or something. but have not been able make box api work me. i cannot authorization code , refresh token etc. i had wanted write automated powershell script upload box twice day server, without requiring user being signed in box sync. i cant use developer token time since works manually 60 mins, , cannot refreshed. i try follow instructions , try url id , token data etc supposed after hitting "grant access" app. takes me directly folders. what can here? found issue i had make sure redirect uri https:\\localhost , copy authorization code there , proceed use api without developer token

encryption - Java TripleDES PKCS5Padding decryption to C# - bad data / padding error -

i'm trying write c# equivalent following java code: protected static final string des_ecb_pkcs5padding = "desede/ecb/pkcs5padding"; public static string decryptvaluedirect(string value, string key) throws nosuchalgorithmexception, nosuchpaddingexception, generalsecurityexception, illegalblocksizeexception, badpaddingexception { byte[] bytes = base64.decodebase64(value); cipher cipher = cipher.getinstance(des_ecb_pkcs5padding); cipher.init(cipher.decrypt_mode, convertsecretkey(key.getbytes())); byte[] decryptedvalue = cipher.dofinal(bytes); string nstr = new string(decryptedvalue); return nstr; } protected static secretkey convertsecretkey(byte[] encryptionkey) throws generalsecurityexception { if (encryptionkey == null || encryptionkey.length == 0) throw new illegalargumentexception("encryption key must specified"); secretkeyfactory keyf...

Azure Data Factory falling behind schedule silently -

i have number of activities running on adf running every day, hourly , 1 every 15 minutes. i found way set alerts in adf failing activities trigger email. have not found way create more detailed custom alerts. in case task runs every 15 minutes "scheduler": { "frequency": "minute", "interval": 15 } was set run 1 @ time "policy": { "concurrency": 1 }, unfortunately activity became locked indefinitely couple days. on resource lock. caused time slice stay in pending state. waiting on concurrency. since initial activity slice did not fail, got no alert , no warning. does have idea how monitor failures aren't failures in adf if slice misses schedule? one way turn issues failures. you can add timeout property pipeline execution policy: "policy": { "concurrency": 1, "timeout":"00:15:00" } ...

python - How to get the labels of nodes and egdes from read_dot -

i have dot file representing directed graph ( digraph ). want read in networkx digraph object. used networkx.drawing.nx_agraph.read_dot(path) , the nodes in graph function returns simple 'str' types , labels lost in translation . dotfile this: digraph code { graph [bgcolor=white fontname="courier" splines="ortho"]; node [fillcolor=gray style=filled shape=box]; edge [arrowhead="normal"]; "0x000052c0" -> "0x00003a40" [label="section..text" color="red" url="section..text/0x00003a40"]; "0x00003a40" [label="section..text" url="section..text/0x00003a40"]; "0x000052c0" -> "0x0021ee08" [label="reloc.__libc_start_main_8" color="green" url="reloc.__libc_start_main_8/0x0021ee08"]; "0x0021ee08" [label="reloc.__libc_start_main_8" url="reloc.__libc_start_main_8/0x002...

serialization - Getting the "latest" field in a set to serialize in Django Rest Framework -

my current serializer looks so: class bareboneentityserializer(serializers.modelserializer): class meta: model = entity fields = ( 'id', 'label', 'related_yid_count', 'description', ) there 1 set: entityclassification_set now, in other serializer have so: entityclassification_set = entityclassificationserializer(many=true) but after time, realized need "latest" or last element in set, how can add field serializer? adding property way go this? or there way it? right can this @property def classification(self): return entityclassification.objects.filter(entity=self).latest() but way it? entities = entity.objects.order_by('-id')[:5] entityclassification_set = entityclassificationserializer(entities, many=true)

xsd - Customizing Validate Node Error Message in OSB 12c -

when add validate node in osb 12c validating incoming request against xsd, , if validation fails , in fault messages field name causing validation error displayed. decimal values , fault message saying invalid decimal value , no mention field error thrown. can overcome issue i not sure direct solution. there workaround may suit need create xquery validates payload , throws custom error messages eg: xml element should contain decimal value abc if ($a instance of xs:long) () else (fn:error(xs:qname('your error code'), 'your error message')) suitable method if payload small. https://gibaholms.wordpress.com/2013/09/24/osb-throw-exception-in-xquery 1 if payload large identify fields supposed have these type of issues. create xquery validating these fields error messages. use validate node inside stage , use stage error handler validate payload using xquery inside stage error handler

md-grid-list inside md-grid-tile in Angular Material2 is not visible -

i have code given below in angular material 2 <md-grid-list cols="2" rowheight="2:1"> <md-grid-tile>1 <div> <md-grid-list cols="4" rowheight="1:1"> <md-grid-tile colspan="2">5</md-grid-tile> <md-grid-tile >6</md-grid-tile> <md-grid-tile>7</md-grid-tile> <md-grid-tile >8</md-grid-tile> <md-grid-tile >9</md-grid-tile> </md-grid-list> </div> </md-grid-tile> <md-grid-tile >2</md-grid-tile> <md-grid-tile>3</md-grid-tile> <md-grid-tile>4</md-grid-tile> </md-grid-list> now ** div** tag , md-grid-list not visible inside it. updated- solution same <md-grid-list cols="2" rowheight="2:1"> <md-grid-tile class="shap...

sql server - IDENTITY_INSERT issue with sql -

i trying populate azure database, when run query : set identity_insert author on declare @teaser varchar(4000) = 'text..'; declare @body varchar(4000) = 'text...'; insert author(id,first_name,last_name,email) values (1,'dan','vega','danvega@gmail.com'); insert author(id,first_name,last_name,email) values (2,'john','smith','johnsmith@gmail.com'); insert post(id,title,slug,teaser,body,author_id,posted_on) values (1,'spring boot rocks!','spring-boot-rocks',@teaser,@body,1,default); i have error on insert post line : cannot insert explicit value identity column in table 'post' when identity_insert set off. after run authors created not post. if add both set identity_insert author on set identity_insert post on have identity_insert on table 'spring-boot-intro.dbo.author'. cannot perform set operation table 'post' . . if add set identity_insert post on have cannot insert e...

array to xml php issue with the array(s) -

i have created function below: public function arraytoxml(\simplexmlelement $bodyxml, array $arraytobeconverted) { foreach ($arraytobeconverted $element => $value) { $element = ucfirst($element); if (is_array($value)) { $newxmlnode = $bodyxml->addchild($element); $newxmlnode = $this->arraytoxml($newxmlnode, $value); } else { $bodyxml->addchild($element, $value); } } $newxml = $bodyxml; return $newxml; } } which converts array xml. trying create duplicates in xml , seem hit issue when use array inside. the following array... $testarray = [ "pagination" => [ "entriesperpage" => 2, ], ["userid" => "usertest1"], ["userid" => "usertest2"], ]; outputs section of xml <pagination> <entriesperpage>2</entriesperpage> </pagination> “<0...

html - Cluster child elements at bottom of div with flexbox -

Image
using flexbox, want child elements of div sit @ bottom, first element full width , remaining flexing size/position. when try this, however, first element sits in middle rather @ bottom. fiddle here . .container { display: flex; flex-wrap: wrap; height: 300px; align-items: flex-end; box-sizing: border-box; border: 1px solid green; } .full-child { width: 100%; height: 30px; box-sizing: border-box; border: 1px solid blue; } .partial-child { height: 30px; box-sizing: border-box; border: 1px solid red; } .partial-child.one { flex-grow: 1; } <div class="container"> <div class="full-child">a</div> <div class="partial-child one">b</div> <div class="partial-child two">c</div> <div class="partial-child three">d</div> </div> note in screenshot below how blue div sits in middle, rather snug against red ...

geolocation - Melissa Data XML Request not giving latitude and longitude in response -

i have application uses webobjects send xml request melissa in order location data given address. response accurately provides things delivery point code , delivery point check digit. request sent so, using request xml value of s : nsdata requestcontent = new nsdata(s.tostring().getbytes()); worequest request = new worequest("get", "/xml.asp", "http/1.1", null, requestcontent, null); wohttpconnection httpconnection = new wohttpconnection("xml.melissadata.com", 80); httpconnection.setreceivetimeout(1000 * 10); // wait 10 seconds // response if (httpconnection.sendrequest(request)) { as example, can send following xml request address 3510 marvin rd ne, olympia, wa: <?xml version="1.0" ?> <recordset> <customerid>[some id]</customerid> <record><company/> <address>3510 marvin rd ne</address> <address2/> <city>lacey</city> <state>wa</state> <z...

quantitative finance - DiscountCurve is not aware of evaluation date in QuantLib python -

i using quantlib in python. in order construct discountcurve object, need pass vector of dates , corresponding discount factors. problem that, when change evaluation date account settlement days, curve object not shifted/adjusted , npv of bond not change function of evaluation date. is there way around this? have construct different discountcurve shifting dates whenever change number of settlement days? ideally, instead of passing vector of dates, should able pass vector of distances between consecutive dates first date should allowed evaluation date. no, unfortunately there's no way around this. particular class, you'll have recreate instance when settlement date changes. writing version of class takes distances between dates can done, it's not available. if write it, please consider creating pull request inclusion in library.