Posts

Showing posts from April, 2012

angular - Resolve id in pipe with a service -

i resolve id pipe. i think isn't best way call service/api every time? is better store countries before? how return country name within pipe? service: getcountry(id:number) { return this._http.get(this.apiurl + "/country/" + id).map(res => res.json()); } pipe: export class resolvepipe implements pipetransform { constructor(public _formdataservice: formdataservice) {} transform(value: number, args: any[]): { this._formdataservice.getcountry(value).subscribe( data => console.log(data[0].name) ) } } edit: <tr (click)="showprofile(customer)" *ngfor="let customer of (customers | search:term)"> <td>...</td><td>{{customer.country_id | resolve | async}}</td> </tr> first need return observable . when call subscribe() subscription returned. need return transform() hence added return export class resolvepipe implements pipetransform { constructor(public _form

html - How to use sass (scss) compared to css -

so start off, let me introduce myself complete beginner. want startet scss, i'm confused how works in regards css file. after having set of sass, , compiled css sass, should link html sass file instead of css? , delete css file ftp , instead upload sass file? thanks, jonas newbie. scss or sass files improved syntax write css, remember browsers can understand css files. can write file sass or scss syntax, compile css file, , link css file in html file. no, never upload else css file ftp.

ios - Swift - Google Firebase Authentication with Email -

Image
i trying run example of google firebase authentication email. tried email example of https://github.com/firebase/quickstart-ios/blob/master/authentication/authenticationexampleswift/emailviewcontroller.swift errors in project. my code looks this: @ibaction func loginbuttontapped(_ sender: anyobject) { if let email = self.useremailtextfield.text, let password = self.userpasswordtextfield.text { showspinner({ // [start headless_email_auth] firauth.auth()?.signin(withemail: email, password: password) { (user, error) in // [start_exclude] self.hidespinner({ if let error = error { self.showmessageprompt(error.localizeddescription) return } self.navigationcontroller!.popviewcontroller(animated: true) }) // [end_exclude] } // [end headless_email_auth]

android - Change shape color -

i have imagebutton: <imagebutton android:layout_width="100dp" android:layout_height="100dp" app:srccompat="@drawable/round_color" android:layout_below="@+id/lamps_list_room" android:layout_alignstart="@+id/lamps_list_room" android:layout_marginstart="69dp" android:layout_margintop="62dp" android:id="@+id/color_picker_button" android:background="@color/colorprimarydark"/> and shape: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#ffffff" /> <corners android:radius="100dp" /> <stroke android:color="#ffffff" android:width="2px"> </stroke> </shape> what best way change solid color of shape? imagebutton imagebutton = (imagebut

gretl - append within loop: Skipping non-existing files -

this question related to: import timeseries via loop (pot. generic) i want import arbitrary number of files posited in same directory, not continuously labelled, e.g.: file_1,file_4,file_3001 i have small import script works consecutive files similar following: scalar first = 1 #the first file file_1.tsv scalar last = 5000 #the last file base_path = "c:/results/file_" sprintf temp_path "%s%d.tsv",base_path,first open @temp_path --preserve setobs 1 1 --special-time-series loop (i=first+1;i<=last;i+=1) --quiet sprintf temp_path "%s%d",base_path,i append @temp_path endloop now, when use on setting above (with missing files) error , script stops: couldn't open ... is possible somehow proceed / catch error , "continue" ? i think "catch" command can need. take @ following code: # creating files open australia.gdt store 0.gdt pau store 1.gdt pus store 2.gdt e store 4.gdt iau store 8.gdt ius st

java - Explicitly add binder dependency when binding to Guice provider instance -

say want create general provider returns first item in collection. like: class p extends provider<t> { private final provider<collection<t>> provider; firstitemprovider(provider<collection<t>> provider) { this.provider = provider; } @override public t get() { collection<t> input = provider.get(); iterator<t> iter = input.iterator(); return iter.hasnext() ? iter.next() : null; } } now have various such collections different annotations , want add bindings provider, but, want able traverse bindings using defaultbindingtargetvisitor , getdependencies(). i've tried like: bind(key.get(type, annotation)) .toprovider(new p( getprovider( key.get(types.collectionof(type.gettype()), annotation) ) )); this works fine in terms of binding, traversal doesn't wok guice doesn't detect dependency. i couldn't figure out other way bind annotated producer since doesn't have anno

numpy - Python method changing all key value pairs in dictionary -

i in process of building little python script learns play tic tac toe. process store each move made in game , score move based on whether lead winning outcome. attempt train on many rounds of play. my problem lies update_weights() method . expect take stored moves (accessed board object , represented list [row,col]) , iterate through list of moves. method should reference board's stored weights (a dictionary of (3,3) numpy arrays) , update corresponding weight appropriate move. e.g. assume win occurred. in winning sequence move #2 @ board position [0,1]. method should access dictionary of weights (keys move #) , multiply position of array [0,1] factor of 1.05. the problem method changing arrays in weight dictionary , not 1 associated correct move # key. can't figure out how happening. import numpy np import random class ttt_board(): def __init__(self): self.board_state = np.array([[0,0,0],[0,0,0],[0,0,0]]) self.board_wei

ajax - bootstrap tab('show') not work on dynimcally loaded 'tab-content' -

i using asp.net mvc , boostrap 3 i using bootstrap tabs, main view this <div class="row"> <div class="tabs-container"> <ul class="nav nav-tabs" id="test"> <li class="active"><a data-toggle="tab" href="#tab-operations">operations</a></li> <li class=""><a data-toggle="tab" href="#tab-categories">categories</a></li> </ul> @html.partial("_ordering", model) </div> </div> the partial view _ordering this <div class="tab-content" id="orddiv"> <div id="tab-operations" class="tab-pane active"> // content not important </div> <div id="tab-categories" class="tab-pane"> // content not important </div> &

.net core - dotnet run attempts to run from a nonexistent path -

trying run project on ubuntu 16.04 server, error: $ dotnet -v run telemetry is: enabled project twitchbotcommons (.netcoreapp,version=v1.1) compiled. skipping compilation. project ohbot-core (.netcoreapp,version=v1.1) compiled. skipping compilation. running /home/ventic/ohbot-core/ohbot-core/bin/debug/netcoreapp1.1/ubuntu.16.04-x64/ohbot-core --additionalprobingpath /home/ventic/.nuget/packages no such file or directory files under bin after project compiled. $ tree bin bin └── debug └── netcoreapp1.1 ├── ohbot-core.deps.json ├── ohbot-core.dll ├── ohbot-core.pdb ├── twitchbotcommons.dll └── twitchbotcommons.pdb $ dotnet --version 1.0.0-preview2-1-003177 project.json { "dependencies": { "newtonsoft.json": "9.0.1", "system.collections.specialized": "4.3.0", "microsoft.netcore.app": "1.1.0", "microsoft.aspnetcore.websock

html - Custom form select for date in Rails -

i'm trying set custom date select in rails. rails provides form helper called date_select. (<%= f.date_select %> in practice) however html gives is: (showing month brevity.) <select id="event_starttime_2i" name="event[starttime(2i)]"> <option value="1">january</option> <option value="2">february</option> <option value="3">march</option> <option value="4">april</option> <option value="5">may</option> <option value="6">june</option> <option value="7">july</option> <option value="8">august</option> <option value="9">september</option> <option value="10">october</option> <option value="11">november</option> <option value="12" selected="selected">december</option>

Excel: Can custom units for be defined for the CONVERT function? -

in excel, can convert inches feet =convert(a1,"in","ft") (where a1 contains number converted), or bytes bits =convert(a1,"byte","bit) . convert function works excel's predefined units. is there way define custom units such "piece" or "dozen" or "tub"? i've been using excel's "bit" unit in place of "piece". i'd conversions such =convert(3,"dozen","piece") (the result of evaluation should 36). of course, 1 maintain table of custom units conversions standard units (e.g. 1 piece = 1 bit, 1 dozen = 12 bits). conversion taken care of using modified convert function =myconvert(3,"dozen","piece") custom units table. there elegant way make original convert function work, avoiding workarounds adding excel's list of predefined units? warning: doesn't answer exact question, seek provide potential solution . i don't know o

java - Hibernate unable to save child objects using cascade all -

i have following 2 classes. class 'type' has object of class 'content'. want save referenced objects of class 'type' using hibernate.save() method. have specified cascade type in class 'content'. following error face: object references unsaved transient instance - save transient instance before flushing. can please me identify problem is? public class type { @onetoone @joincolumn(name = "content_id") private content content; } public class content { @onetoone(mappedby = "content", cascade = cascadetype.all) private type type; } public class test { public void createtype() { type type = new type(); content content = somemethodtogetcontent(); type.setcontent(content); save(type); } public void save(object domainobj) { getentitymanager().persist(domainobj); getentitymanager().flush();

objective c - only for IOS 9, MKPlacemark initWithCoordinate:]: unrecognized selector -

only ios 9 -(void)getroutedirections{ mkdirectionsrequest *request = [[mkdirectionsrequest alloc] init]; [request setsource:[mkmapitem mapitemforcurrentlocation]]; crash line: mkplacemark * placemark = [[mkplacemark alloc]initwithcoordinate:_location.coordinate]; } exception: -[mkplacemark initwithcoordinate:]: unrecognized selector sent instance answer larme comments: - (instancetype)initwithcoordinate:(cllocationcoordinate2d)coordinate; available since ios10. for ios 9 or earlier, initwithcoordinate:addressdictionary: available since ios 3.

testing - How to fix Fitnesse Php Invalid Slim Header Error -

i followed phpslim installation guide ( http://ggramlich.github.io/phpslim/installation.html ) when running first test following error: "unable start test system 'slim': fitnesse.slim.slimerror: got invalid slim header client. read following:" i did notice when following installation steps, under "install phpslim", when clicking "phpslim.phar" download link, doesn't download phar file opens contents inside of browser instead. saved made me wonder if save in correct format. i'm using ubuntu 16.04 lts, java ("1.8.0_111) , latest fitnesse standalone jar file.

Using Regex to delete strings in a string -

i have following string: m_var.a2345_dischrg_reason_code m_var.a2611a_dischrg_reason_code.trimstart("0"c) i need find of these , make it: m_var.a2345 m_var.a2611a.trimstart("0"c) how can using regular expression? yes, used "dischrg_reason_code" example. codes: m_var.a2345_xxx_xxxx_xxx m_var.a2611a_dischrg_reason_code.trimstart("0"c) .a2111e_yuiu_uiouuoiu and want string after period (including period) , before first "_" just find _dischrg_reason_code , replace empty string. assumes code appears once in data. if appear multiple times, should update question , show sample data.

java - How to deliberately make incomplete POST requests using curl or a similar tool? -

currently, trying handle following exception using resteasy exceptionmapper: error [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-23) resteasy002005: failed executing post /apiv1/submit: org.jboss.resteasy.spi.readerexception: java.io.ioexception: ut000128: remote peer closed connection before data read in order test handler, i'd make post requests endpoint supposed fail - in same way fail due clients network connection getting lost, client crashing while request incomplete , on. manually interrupting request doesn't work reliably because request payload small , hence request complete before can pull plug. tried using curl --max-time low value doesn't work reliably either. so looking curl --max-bytes option - make request fail after given number of bytes have been sent, opposed amount of time having passed. is there way achieve using curl or there tool curl features similar option? many thanks, toastor

javascript - combine date and time into a single datetime -

i have date , time control, concatenate var startdate = jquery('#startdatepicker').find("input").val(); var starttime = jquery('#starttimepicker').find("input").val(); i have var field has data below: var targettime = new date().setminutes(-5).valueof(); startdatepicker has value : 02/06/2017 starttimepicker, currenttime has value : 05:17 am targettime has value as: 1486374940591 i want concatenate startdate , starttime in format of targettime. how concatenate start date , start time? thanks pass date , time function. return date object. use gettime() on desired result. codepen example. function getasdate(day, time) { var hours = number(time.match(/^(\d+)/)[1]); var minutes = number(time.match(/:(\d+)/)[1]); var ampm = time.match(/\s(.*)$/)[1]; if(ampm == "pm" && hours<12) hours = hours+12; if(ampm == "am" && hours==12) hours = hours-12; var shours = hours.tostring(); var sm

types - Possible to access the 'TypeId' of a struct member? -

is there way access typeid ( std::any::typeid::of::<t> ) of struct member name? if have basic struct: mystruct { value: i64, } and know mystruct , value , there way access typeid::of::<i64> - i64 depends on type of value ? main () { assert_eq!( typeid::of::<i64>, // ^^^ works type_id_of!(mystruct, value), // ^^^ i'm looking ); } see related question: is possible access type of struct member function signatures or declarations? you can use type detection deduce typeid of field of value have, long it's 'static (other typeid::of doesn't work): fn type_id<t: 'static + ?sized>(_: &t) -> typeid { typeid::of::<t>() } fn main() { let m = mystruct { value: 4 }; println!("{:?} {:?}", typeid::of::<i64>(), type_id(&m.value)); } then, leveraging strategy in offsetof question asked, can make macro type without having instance: ma

asp.net web api - ssl with webapi published using IIS. chrome warning - connection not secure due to self signed -

i trying use ssl webapi published using iis. i've enabled ssl in webapi project setting ssl enabled true. on local pc i've created self signed certificate, gets issued mypcnamehere/mycompanydomainhere. (not sure if matters) now if browse webpage in chrome/mozilla warning... connection not secure. mozilla's error certificate not trusted because self signed. what options here handling this? (when warning connection not secure? or purely warning certificate self signed?) i don't mind getting third party certificate, when tried wanted me verify own domain. mypc/mydomain inside company firewall don't see how obtain certificate. any suggestions? you error (warning actually) because you're using self signed certificate, browser doesn't recognize. your options are: obtain certificate issued trusted provider (the root certificate of issuer present in trusted root certificates store of browser/system make browser trust self signed cert

Laravel 5: 404 Not Found on all routes except home, /index.php extension does not resolve -

development system: debian "jessie" virtual box, php 7.0, postgresql 9.x, laravel 5.4, testing done on laravel built-in server production system: ubuntu 16.10 digitalocean droplet, php 7.0, postgresql 9.x, laravel 5.4, nginx 1.10.3 just resolved 500 error followed 502 error app both permissions problems. can see main page of application, other routes produce 404 error. common suggestion seems .htaccess error diagnosed attempting access other routes prefixing them index.php/, doesn't resolve issue me. these routes function on development environment. here's server block: server { listen 80; listen [::]:80; root /home/user/var/www/mydomain.com/public; index index.php index.html index.htm; server_name mydomain.com www.mydomain.com; location / { try_files $uri $uri/ /index.php?query_string =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass 127.0.0.1:9000; } location ~ /\.ht { deny all; } }

r - Subset a Data Frame Based on All Combinations and Sub-combinations of Factor Variables -

i need subset data.frame based on combinations sub-combinations of multiple columns of factor variables. additionally number of columns factor variables may change method needs flexible in accepting different numbers of attributes. can figure out how create combinations of variables in simple example don't have way subset data.frame efficiently. thoughts? #setup example data.frame <- c("a", "b", "b", "b", "e") b <- c("b", "c", "b", "b", "f") c <- c("c", "d", "b", "b", "g") df <- data.table(a = a, b = b, c = c) #build data.frame of unique combos subset on df_unique <- df[!duplicated(df), ] df_combos <- data.table() for(i in 1:ncol(df_unique)){ for(x in 1:ncol(df_unique)){ df_sub <- df_unique[,i:x, = f] df_combos <- rbind(df_combos, df_sub, fill = t) } } df_combos <- df_combos[!duplicated

javascript - simpleCart.js send form input and cart item to EMAIL using PHP script. - cannot sent form input -

the cart items sent email not input form. here code: html: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta content="text/html;charset=utf-8" http-equiv="content-type"> <meta content="utf-8" http-equiv="encoding"> <title>atelier k - trimite comanda</title> <link rel="icon" href="images/iconak.ico"/> <!-- bootstrap --> <link rel="stylesheet" href="css/bootstrap.css"> <script src="js/simplecart.js"></script> <script src="js/simplecart.min.js"></script> <script src="js/qunit.js"></script> <script src="js/jquery.min.js"></script> <

c++ - espeak_Initialize error messages with AUDIO_OUTPUT_SYNCH_PLAYBACK but not with AUDIO_OUTPUT_PLAYBACK -

i'm making c++ program using espeak_lib , don't know why when initialize with espeak_initialize(audio_output_synch_playback,0,nullptr,espeakinitialize_phoneme_events); i got next error lines alsa lib pcm.c:2266:(snd_pcm_open_noupdate) unknown pcm cards.pcm.rear alsa lib pcm.c:2266:(snd_pcm_open_noupdate) unknown pcm cards.pcm.center_lfe alsa lib pcm.c:2266:(snd_pcm_open_noupdate) unknown pcm cards.pcm.side alsa lib pcm_route.c:867:(find_matching_chmap) found no matching channel map cannot connect server socket err = no such file or directory cannot connect server request channel jack server not running or cannot started jackshmreadwriteptr::~jackshmreadwriteptr - init not done 4294967295, skipping unlock jackshmreadwriteptr::~jackshmreadwriteptr - init not done 4294967295, skipping unlock but if initilize code with espeak_initialize(audio_output_playback,0,nullptr,espeakinitialize_phoneme_events); it not give m

RegEx in Dreamweaver -

i know possible because used before... can't remember how! i have lot of text , paragraphs wrap in <p></p> tags know can using find/replace feature using regex. can refresh memory? i'm using dreamweaver. the best way in dreamweaver think use "edit > paste special" menu, past word processor formatting. if doesn't work reason, can use dreamweaver search , replace "use regular expressions" option enabled, , search , replace for: \r|\n and replace </p><p> then that's needed add outer paragraph tag if it's not there.

PHP CUrl wont login -

<?php $username = 'myuser'; $password = 'mypass'; $loginurl = 'https://www.cbs.com/user/signup/'; //init curl $ch = curl_init(); //set url work curl_setopt($ch, curlopt_url, $loginurl); // enable http post curl_setopt($ch, curlopt_post, 1); //set post parameters curl_setopt($ch, curlopt_postfields, 'j_username='.$username.'&j_password='.$password); //handle cookies login curl_setopt($ch, curlopt_cookiejar, 'cookie.txt'); //setting curlopt_returntransfer variable 1 force curl //not print out results of query. //instead, return results string return value //from curl_exec() instead of usual true/false. curl_setopt($ch, curlopt_returntransfer, 1); //execute request (the login) $store = curl_exec($ch); //the login done , can continue //protected content. //set url protected file curl_setopt($ch, curlopt_url, 'urliwannagrab'); //execute request $content = curl_exec($ch); //save data disk file_put_contents('con

python - GET method has taken by Django -

i beginner in django , creating django forms getting input , processing. created app called 'artists' , have coded files follows. error in picture urls.py in server folder """mysite url configuration `urlpatterns` list routes urls views. more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ examples: function views 1. add import: my_app import views 2. add url urlpatterns: url(r'^$', views.home, name='home') class-based views 1. add import: other_app.views import home 2. add url urlpatterns: url(r'^$', home.as_view(), name='home') including urlconf 1. import include() function: django.conf.urls import url, include 2. add url urlpatterns: url(r'^blog/', include('blog.urls')) """ django.conf.urls import url, include django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^artists/

mysql-connector-java update from 5 to 6 causes a timeshift -

in our java(1.8) / hibernate(4.3.2) / mysql (5.6.29-76.2) application using mysql-connector-java 5.1.40 . timezones servers(java, mysql) utc. when in application inserting datetimes '2016-10-26 08:00:00 ' db, saved correctly '2016-10-26 08:00:00 '. after upgrading mysql-connector-java 6.0.4 , following behavior: in java code insert '2016-10-26 08:00:00 ', in db '2016-10-26 13:00:00 ', when select values in java app correct '2016-10-26 08:00:00 ' value. however, saved values shifted past. so far, have no idea, causing shift. ideas? update after running multiple tests time zones, have noticed following: timezones servers(java, mysql) utc. wrong, , in fact bst(british summer time) other time zones (cest, utc, gmt+6, asia/almaty, gmt-6 etc.. ) working fine, bst causes shifts. so, make conclusion there's bug related bst time-zone in mysql-connector. workaround - switching other time zones.

android - Fragment starts loading on the second click and is null on the first click -

i hosting fragment in main activity , i'm refreshing fragment using updateuifragment() in asynctask . on selecting fragment mainactivity , fragment should refresh, trigger updateuifragment() method , display contents. the issue is, fragment null on first click , on second click, fragment starts updating , displays contents. once data loads after second click, fragment works on next clicks. @override public void onresume() { super.onresume(); updateuifragment(); } // ensures fragment updates when invisible @override public void onhiddenchanged(boolean hidden) { super.onhiddenchanged(hidden); if (!hidden) { updateuifragment(); } } this in mainactivity, private final datafragment datafragment = new datafragment(); why fragment showing data on second click , not on first click? tried using isadded() didn't work.

c# - How to get the Microsoft SQLCLR Stored Procedure Example to work -

i'm new clr , struggling microsoft tutorial already. tutorial: how to: create , run clr sql server stored procedure there example stored procedure insert_currency_cs , test.sql using system; using system.data; using system.data.sqlclient; using system.data.sqltypes; using microsoft.sqlserver.server; public partial class storedprocedures { [sqlprocedure()] public static void insertcurrency_cs( sqlstring currencycode, sqlstring name) { using (sqlconnection conn = new sqlconnection("context connection=true")) { sqlcommand insertcurrencycommand = new sqlcommand(); sqlparameter currencycodeparam = new sqlparameter("@currencycode", sqldbtype.nvarchar); sqlparameter nameparam = new sqlparameter("@name", sqldbtype.nvarchar); currencycodeparam.value = currencycode; nameparam.value = name; insertcurrencycommand.parameters.add(currencycodepar

Annualization in MDX -

Image
introduction i'm doing maintenance job on measure annualizes (ytd) measure. granularity of measures month. annualization works fine on month level, when use parents in date hierachy calculation not work. it should work this: measureannualized = ytdmeasure * (currentmonth / 12) currentmonth implemented closingperiod([date].[datehierarchy].[month], [date].[datehierarchy]).membervalue on month level works fine: month measureytd measureannualized closingperiod july -50 -85,71 7 august -60 -90,00 8 september (null) (null) 9 but on higher level in datehierarchy not work. instance on quarter level: quarter measureytd measureannualized closingperiod 3 -60 -80,00 (should : -90,00) 9 (should be: 8) as can see, picks closingperiod of quarter 3 (=9) whereas should last "non-empty" closingperiod (=8). same applies year level: year meas

android - Recursion open DetailActivity contain Images which load from http/https appear ANR -

Image
detailactivity 1.activity contain images load http/https . 2 type of images: a)detail image b)thumbnail click thumbnail imageview open detailacitivy itself,what changed thumbnail become detail image, , load associative thumbnails. 2.press button can return previous detailactivity recursion open several times. monitors show memory group linear, device anr . there effective solution ?

html - creating game with javascript error in a nested array -

i trying create game javascript doesn't works. in developers tools error following: "uncaught typeerror: cannot read property 'x' of undefined". suppose error involve nested array "circles". this code: <!doctype html> <html> <head> <title>canvas tutorial</title> <script type="text/javascript"> window.onload = draw; var circles = [{x:200,y:150,r:40,direction:1,speedx:1,speedy:2},{x:200,y:150,r:70,direction:1,speedx:2,speedy:1}]; (var i=0; i<circles.length; i++) { function bottomright() { circles[i].x += circles[i].speedx; circles[i].y += circles[i].speedy; } function upleft() { circles[i].x -= circles[i].speedx; circles[i].y -= circles[i].speedy; } function upright() { circles[i].x += circles[i].speedx; c

android - Xamarin Forms Toolbar Icon Left Side -

i trying put 2 icons in left side of toolbar in xamarin forms. have been searching in internet in ios no problem in android possible if custom menu in droid project (main activity , resources etc). is way it? , if project of xamarin forms not maybe best choice, perhaps xamarin (if have specific ui item on left of toolbar). thanks in advance.

css - Border radius of complex shape -

Image
i trying following shape css. me kind of tutorial or code snippet of how having king of shape css? you'll need few elements 2 create thingies on left , right. note: works on solid background (in case white background used on .ws_left:before , .ws_right:before body { margin: 5em; } .ws { position: relative; width: 15em; height: 15em; background: gray; border-radius: 0 0 1em 1em; } .ws_left { position: absolute; top: 0; left: -4em; right: 100%; height: 2.5em; background: gray; border-radius: 1em 0 0 1em; } .ws_left:before, .ws_left:after, .ws_right:before, .ws_right:after { content: ''; position: absolute; background: red; width: 1em; height: 1em; top: 100%; right: 0; z-index: 1; } .ws_left:before { border-top-right-radius: 1em; background: white; z-index: 2; } .ws_left:after { background: gray; } .ws_right:before, .ws_right:aft

python - change rows in pandas -

i have matrix in pandas data frame print dfmatrix 0 1 2 3 4 0 10000 10 8 11 10 1 10 100000 13 9 10 2 8 13 10000 9 11 3 11 9 9 10000 12 4 10 10 11 12 100000 i need change row values reducing each row value minimum row(row row) here code try: def matrixreduction(matrix): minrowvalues = matrix.min(axis=1) in xrange(matrix.shape[1]): matrix[i][:] = matrix[i][:] - minrowvalues[i] return matrix and expect output like: 0 1 2 3 4 0 9992 2 0 3 2 1 1 99991 4 0 1 2 0 5 9992 1 3 3 2 0 0 9991 3 4 0 0 1 2 99990 but such output: 0 1 2 3 4 0 9992 1 0 2 0 1 2 99991 5 0 0 2 0 4 9992 0 1 3 3 0 1 9991 2 4 2 1 3 3 99990 so

css - skewed background image animation -

Image
i'm working on http://mijnwebsitebestellen.be/index.php . when hover on 'event location' can see width of first black & white band changes, background image not skewed during animation. here snippet of code use animation: $( document ).ready(function() { $('.deel1-link').mouseover(function(){ $('.deel1').animate({width:"600px"},400); $('.delen .col-sm-4:nth-child(1)').animate({width:"600px"},400); }); $('.deel1-link').mouseleave(function(){ $('.deel1').animate({width:"50px"},400); $('.delen .col-sm-4:nth-child(1)').animate({width:"50px"},400); }); }); i added screenshot of problem. is there fix this? thanks

osgi - Eclipse Equinox + Gemini Web + Libra - com.sun.faces.config.ConfigureListener not found -

i try develop dynamich web application given tools: eclipse libra (newest) eclipse equinox gemini web server 2.2.7 i follow given video tutorials on [ https://dev.eclipse.org/mhonarc/lists/libra-dev/msg00096.html][1] but when try start general dynamic web application osgi bundles , jsf 2.2.0 support following 2 errors on console (configurelistener not found , bundle org.eclipse.equinox.console not found: okt 25, 2016 9:16:02 pm org.apache.catalina.core.standardhost setappbase warnung: using empty string appbase on host [localhost] set catalina_base, bad idea okt 25, 2016 9:16:02 pm org.apache.catalina.core.aprlifecyclelistener lifecycleevent information: apr based apache tomcat native library allows optimal performance in production environments not found on java.library.path: c:\program files\java\jre1.8.0_101\bin ;c:\windows\sun\java\bin;c:\windows\system32;c:\windows;c:/program files/java/jre1.8.0_101/bin/server;c:/program files/java/jre1.8.0_101/bin

Is there a Boolean data type in Microsoft SQL Server like there is in MySQL? -

is there boolean data type in microsoft sql server there in mysql? if so, alternative in ms sql server? you use bit datatype represent boolean data. bit field's value either 1 or 0.

How to allow DELETE request in the list-view of Django REST framework ? Is it possible? -

is possible delete list of objects django rest framework list-view ? passing list of ids of objects [1,2] in delete request , showing {u'detail': u'method "delete" not allowed.'}. allowed methods @ list-view :get, post, head, options i want add delete allowed reuqest. out of box, django rest framework not support bulk operations. you have write custom code that. there third party package django rest framework bulk might starting point.

python - Insert into Odoo db with a specific id using cursor.commit and psycopg2 -

i'm trying migrate models openerp 7 odoo 8 code. want insert objects new table maintaining original id number, doesn't it. i want insert new object including id number. my code: import openerp openerp import api, modules openerp.cli import command import psycopg2 class importcategory(command): """import categories source db""" def process_item(self, model, data): if not data: return # model structure model.create({ 'id': data['id'], 'parent_id': none, 'type': data['type'], 'name': data['name'] }) def run(self, cmdargs): # connection source database src_db = psycopg2.connect( host="127.0.0.1", port="5432", database="db_name", user="db_user", password="db_password") src_cr = src_db