Posts

Showing posts from August, 2011

Android - add fragment with custom dimensions -

Image
currently, adding fragment using following code. private void addfragment(fragment fragment, string fragmentname) { log.i("adder", "adding fragment " + fragmentname); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); fragmenttransaction.add(r.id.fragment_container, fragment, fragmentname); fragmenttransaction.commit(); } following code resizing added fragment. private boolean readjustfragment(fragment fragmenttobeadjusted, fragmentcoordinates fragmentcoordinates) { if (fragmenttobeadjusted != null) { view view = fragmenttobeadjusted.getview(); relativelayout.layoutparams params = new relativelayout.layoutparams(fragmentcoordinates.getwidth(), fragmentcoordinates.getheight()); params.leftmargin = fragmentcoordinates.getx0(); params.bottommargin = fragmentcoordinates.gety0(); view.setlayoutparams(params); view.requestlayout(); return true; } return

r - Names Argument Plotly Barplot -

so using plotly in shiny create bar chart. x labels not unique example (dog twice): let df be: x y 1 dog 2 cat 3 dog 3 ant 4 bee i rows plotted won't work because of repeated variable dog in x column: p = plot_ly(df, x = df[,2], y = df[,1], type = "bar", marker = list(color = torgb("blue"))) p so thinking of getting past doing like: able plot 5 rows removing x argument. want able modify these names separately fill in x column variables. p = plot_ly(df, y = x, type = "bar", marker = list(color = torgb("blue"))) p how manually change x labels in plotly barplot? thank you straightforward official method: use tickmode , tickvals , , ticktext arguments in layout xaxis : library(plotly) plot_ly(df, y = x, type = "bar", marker = list(color = torgb("blue"))) %>% layout(xaxis = list(tickmode = "array", tickvals

javascript - How can I pass variable from one function to another in angularJS? -

$scope.openmodal = function (page, size) { console.log(page); // working $uibmodal.open({ animation: true, templateurl: 'app/pages/servers/newrole.html', size: size, resolve: { items: function () { return $scope.items; } } }); }; $scope.hello = function() { console.log(page); // need value of page above function var btn = document.createelement("button"); var t = document.createtextnode("abc"); btn.classlist.add("btn-primary", 'btn-xs', 'btn'); btn.appendchild(t); document.getelementbyid('id1').appendchild(btn); } i have tried using global variable , assigning page saying undefined . i can access variable calling hello(page) inside openmodal , won't work call hello() when it's not needed. i have 2 buttons , calling openmodal function on click of 'btn1', , passing page

filepath - Is it possible to get physical path of uploaded file using js/jquery? -

i trying getting uploaded files actual physical path using js or jquery. tried var tmppath = url.createobjecturl(file); proving temp path blob: http://fiddle.jshell.net/b298c63f-9501-4b09-b62e-c5eb01d4aaf3

javascript - Additional Navigation bar on click -

Image
i have navigation bar section "contracts" , wondering if possible, , how go adding additional navigation bar expand underneath when button tagged, (for example, on apple store site, when click product, adds bar) i can provide entire css style sheet if needed! think require javascript i'm trying keep pure css now! all appreciated! html code: navigation html <header> <div class="title"> <img src="img/logo2.png"/> </div> <div class="navbar"> <ul> <li style="float: left"><a href="#home">home</a></li> <li><a href="#contact">contracts</a></li> <li><a href="#about">about us</a></li> <li><a href="#other">other</a></li> <li> <a href="#release">rele

python - Why is no result in this code? -

emp.csv index empno ename job mgr hiredate sal comm deptno 0, 7839, king, president, 0, 1981-11-17, 5000, 0, 10 1, 7698, blake, manager, 7839, 1981-05-01, 2850, 0, 30 2, 7782, clark, manager, 7839, 1981-05-09, 2450, 0, 10 3, 7566, jones, manager, 7839, 1981-04-01, 2975, 0, 20 4, 7654, martin, salesman, 7698, 1981-09-10, 1250, 1400, 30 5, 7499, allen, salesman, 7698, 1981-02-11, 1600 300, 30 6, 7844, turner, salesman, 7698, 1981-08-21, 1500, 0, 30 7, 7900, james, clerk, 7698, 1981-12-11, 950, 0, 30 8, 7521, ward, salesman, 7698, 1981-02-23, 1250, 500, 30 9, 7902, ford, analyst, 7566, 1981-12-11, 3000, 0, 20 10, 7369, smith, clerk, 7902, 1980-12-09, 800, 0, 20 11, 7788, scott, analyst, 7566 1982-12-22, 3000, 0, 20 12, 7876, ada

Bootstrap v4 offsets within sass/scss -

how use offsets within own sass file using bootstrap v4? i using: @extend .col-sm-offset-2; after updated bootstrap v4 git, it's not working anymore. according documentation , work : @include make-col-offset(2) i suppose sm if column small already

wpf - CloseCommand implementation, multiple views, single model -

i have closecommand implementation closing views viewmodels (as discussed in several posts/blogs) working perfectly, puzzled (unable understand logic) behavior. (i have removed original lengthy code , replaced simplified version should able convey question trying ask) in model (model1) have following parameters , properties private action _closeaction; private icommand _closecommand; ..... public action closeaction { set { setproperty(ref _closeaction, value); } } public icommand closecommand { { return _closecommand; } } setproperty implemented in base class following.. protected bool setproperty<t>(ref t storage, t value, [callermembername] string propertyname = null) { if(equals(storage, value)) return false; storage = value; this.onpropertychanged(propertyname); return true; } in model constructor have initialized closecommand following _closecommand = new relaycommand(param=>this._closeaction()); i have multiple command implementa

Android Studio: Gradle - build fails -- Execution failed for task ':dexDebug' -

Image
error: gradle: execution failed task ':vertretungsplan:dexdebug'. > failed run command: p:\android-studio\sdk\build-tools\18.0.1\dx.bat --dex --output p:\projekte\vertretungsplanproject\vertretungsplan\build\libs\vertretungsplan-debug.dex p:\projekte\vertretungsplanproject\vertretungsplan\build\classes\debug p:\projekte\vertretungsplanproject\vertretungsplan\build\dependency-cache\debug p:\android-studio\sdk\extras\android\m2repository\com\android\support\support-v4\18.0.0\support-v4-18.0.0.jar p:\projekte\vertretungsplanproject\vertretungsplan\libs\commons-io-2.4.jar p:\projekte\vertretungsplanproject\vertretungsplan\build\exploded-bundles\vertretungsplanprojectlibrariesactionbarsherlockunspecified.aar\classes.jar error code: 2 output: trouble processing: bad class file magic (cafebabe) or version (0033.0000) ...while parsing de/mayerhofersimon/vertretungsplan/loginactivity$2.class ...while processing de/mayerhofersimon/vertretungsplan/loginact

webpack - Typescript: How to use bowser typings? -

i'm updating angularjs project typescript using webpack. because using bowser in our codebase installed , referenced related typings. but still after done compiler keeps complaining bowser name unknown. does know how use bowser typings? worked out of box other libraries. in separate *.d.ts file (i have 1 miscellaneous shims since many typings terrible), need add line: declare var bowser: bowsermodule.ibowser; for reason typing doesn't include actual instantiated object.

java - Can we have Tree Grid in GWT? -

can have tree grid : link tree grid in gxt in gwt pure ? if not can create same component ? thanks. you can pure gwt. there simple example in gwt showcase page: http://samples.gwtproject.org/samples/showcase/showcase.html#!cwcustomdatagrid in case "show friends" should replaced "+" button or similiar gxt. have extends abstractcelltablebuilder , user daragrid: grid.settablebuilder(tablebuilder); basic example can find here , not generic solution, works. i've used subrows in datagrid before, , okay, want editable subrows problems...

python - Efficient way to extract data within double quotes -

i need extract data within double quotes string. input: <a href="networking-denial-of-service.aspx">next page →</a> output: networking-denial-of-service.aspx currently, using following method , running fine. atag = '<a href="networking-denial-of-service.aspx">next page →</a>' start = 0 end = 0 in range(len(atag)): if atag[i] == '"' , start==0: start = elif atag[i] == '"' , end==0: end = nxtlink = atag[start+1:end] so, question is there other efficient way task. thankyou. you tagged beautifulsoup don't see why want regex, if want href anchors can use css select 'a[href]' find anchor tags have href attributes: h = '''<a href="networking-denial-of-service.aspx">next page →</a>''' soup = beautifulsoup(h) print(soup.select_one('a[href]')["href"]) or find: print(soup.find(

reactjs - React components with shared state that are far away -

Image
i new react please excuse me if noob question not find answer in docs or elsewhere. let's have 2 buttons counter share state far away each other in terms of placement in ui. the documentation says common owner component both buttons should own state. makes sense if components next each other in example if buttons each part of different ui group , far away in terms of nesting? state holder root of document , have pass handler function down through many layers. , if need add new component somewhere else needs know state? have modify parent components in way pass state down? tremendously impractical. without react have global subscribe/publish pattern jquery observer , ui elements subscribe/publish regardless of nesting position. how react solve this? related question: if need load/save state db, how pass reference of controller (or whatever) each react component stores state? 1 global state may use redux redux predictable state container javascript ap

mysql - Sql Join Three table -

this question has answer here: joining 3 tables using mysql 8 answers here table ..and want output: pid | pname | custname | quantity | total base price | sale price | profit schema: create table customers ( cid int, cname varchar(1000), cg varchar(1000) ) create table prod ( pid int, pname varchar(1000), baseprice int, saleprice int ) create table orders ( oid int, custid int, pid int, quantity int, odate date ) how write query this? --pid | pname | custname | quantity | total base price | sale price | profit select o.pid, p.pname, c.cname custname, sum(o.quantity) quantity, sum(p.baseprice) 'total base price', sum(p.saleprice) 'sale price', sum(p.baseprice) - sum(p.saleprice) profit -- change math need orders o join prod p on o.pid = p.pid join customers c on o.custid = c.cid group

android: make notifications deletable even from locked screen -

i discovered notification of of apps can deleted(by swiping them left or right) while screen locked. how can achieve app? if hide content in notifications, cannot removed lock screen(if have password) on devices. there exceptions device-vise if phone password/-code protected notifications cannot removed.

python - Creating new matrix from dataframe and matrix in pandas -

i have dataframe df looks this: id1 id2 weights 0 2a 144.0 1 2b 52.5 2 2c 2.0 3 2d 1.0 4 2e 1.0 5 b 2a 2.0 6 b 2e 1.0 7 b 2f 1.0 8 b 2b 1.0 9 b 2c 0.008 and similarity matrix mat between elements of id2 column: 2a 2b 2c 2d 2e 2f 2a 1 0.5 0.7 0.2 0.1 0.3 2b 0.5 1 0.6 0.4 0.3 0.4 2c 0.7 0.6 1 0.1 0.4 0.2 2d 0.2 0.4 0.1 1 0.8 0.7 2e 0.1 0.3 0.4 0.8 1 0.8 2f 0.3 0.4 0.2 0.7 0.8 1 now create similarity matrix between elements of id1 , elements id2 . consider elements of id1 barycentres of corresponding elements of id2 ind dataframe df (with corresponding weights ). my first attempt loops (aouch): ids = df.id1.unique() output = pd.dataframe(columns = mat.columns,index = ids) id in ids: df_slice = df.loc[df.id1 == id] to_normalize = df_slice.weights.sum() temp = mat.loc[df_slice.id2] art in df_slice.id2: t

asp.net - Razor doesn't take the value from the view model for Input of Date type -

in model have field date, in view use following edit it: @html.textboxfor(m => m.date, new { type = "date"}) while proper value in controller when form submitted, initial value not set in view (it's empty) my view model: [datatype(datatype.date)] public datetime date { get; set; } i cannot find missing here...

Meaning of json object bundle in Twitter Analytics script -

i trying use script written ashleycoxley https://github.com/ashleycoxley/twitter-analytics-export/blob/master/twitter-analytics-export.py scrape data twitter analytics however, not understand 1 part of code. meaning of these 2 lines export_url = "https://analytics.twitter.com/user/" + analytics_account + "/tweets/export.json" bundle_url = "https://analytics.twitter.com/user/" + analytics_account + "/tweets/bundle" i've tried access these urls no avail. may kindly explain what's going on here? i've read trying retrieve json object still dont have clear idea how goes about thank you as per comment author of script on page https://github.com/ashleycoxley/twitter-analytics-export/issues/2 , seems script blocked. i created python alternative works day: https://github.com/philippe2803/twitter-analytics-wrapper

virtuoso - Is it possible to do a SPARQL DELETE{} WHERE{} with a FILTER(COUNT(DISTINCT ?obj) > x) in the WHERE clause? -

i want achieve delete deletes triples there less x distinct objects per subject. the intended query should after feeling: delete { ?sub ?pred ?obj . } { {select ?sub ?pred ?obj (count(?obj) ?count) { ?sub ?pred ?obj . } group ?sub } filter(?count < 14) } the above not work. also group by necessary achieve ?obj per ?sub part, can't figure how this. can push me in right direction solve task? note subquery isn't legal query. if try validate subquery on sparql.org's query validator , output: syntax error: non-group key variable in select: ?pred strangely enough, though, whole query does validate update validator . it's not clear attempted query you're trying delete, , statement: i want achieve delete deletes triples there less x distinct objects per subject. doesn't make clear either. if you're trying delete triples subject related less 10 distinct objects on all predicates used subjec

Excel VBA: Repeatedly Add Outside Borders -

i need add outside borders ranges in multiple worksheets, have written following test code (which works): sub testfun() dim wb workbook dim ws worksheet set wb = workbooks("testbook.xlsm") wb.worksheets("sheet1").select range("b2:d10").select addoutsideborders wb.worksheets("sheet2").select range("b2:d10").select addoutsideborders wb.worksheets("sheet3").select range("b2:d10").select addoutsideborders end sub sub addoutsideborders() selection .borders(xledgeleft).linestyle = xlcontinuous .borders(xledgetop).linestyle = xlcontinuous .borders(xledgebottom).linestyle = xlcontinuous .borders(xledgeright).linestyle = xlcontinuous end end sub however, real workbook contains many more sheets , need perform more complicated tasks. question is, how add borders without selecting range first ? example want neat (it doesn't work):

android - Notifications tracking when using FCM -

is possible track notification status, whether opened or canceled user, when send push notification without using firebase services dashboard? i using advanced rest client , record data notifications status when sending payload https://fcm.googleapis.com/fcm/send conversion tracking built firebase notifications. don't think have public api feed charts. but if send messages through firebase cloud messaging, could: record conversion events in app calling firebase analytics explicitly record more details converting user in firebase database you accomplish same type of functionality way.

How to make pycharm open files without replacing currently open file? -

i using pychram. every time try open new file, instead of opening along previous opened file. how can make pycharm open source file on different tabs? make sure have tabs enabled (editor | general | editor tabs | tab appearance | placement).

jquery - Apend multiple variables -

i have got table: <table> <tr> <th>name</th> <td>paul stevenson</td> </tr> <tr> <th>date</th> <td>28. 09. 1978</td> </tr> </table> and want add functions table: var toolbar = $("<div />").css({ "padding": "5px", "background" : "#f8f8f8", "position" : "absolute", "borderradius" : "5px", }) var link = $("<a />").css({ "display" : "block", "height" : "17px", "width" : "17px", "position" : "relative"}).on("click", function() { $(this).animate({bottom: "-2px"}, 20 ).animate({bottom: "0"}, 20 ); }); here toolbar , link. toolbar should append on mouse enter , has link inside it. $('th').on("mouseenter mouseleav

php - Severity: Notice Message: Undefined index: range_a -

this question has answer here: php: “notice: undefined variable”, “notice: undefined index”, , “notice: undefined offset” 23 answers array format--> array([0] => array( [qus] => 1 [y_n] => 0 [range_a] => 0 [desc] => [range_b] => [highriskcomm] => )); controller --> foreach($sup_qus $riskdata){ if($riskdata['range_a']==10){ // enter code here } } php error: severity: notice message: undefined index: range_a how can fix this? it's multidimensional array. echo $riskdata[0]['range_a']; look @ array format posted array [0] => ...

How to create an executable C file for Windows -

i know question has been asked several times , took @ many of them like running linux gcc-compiled program under windows how can compile c files executable (.exe) file? unfortunately, none of them worked me. my situation i've installed ubuntu , windows on notebook. let's developed simple "hello,world!" program using text editor in c. in ubuntu, i've compiled using gcc $ gcc -o hello.out -g -wall -pedantic hello.c i executed './output.out' and got result hello, world! what tried so kind of cross-developed here. switched windows , kept going. now, try make executable file in order run on windows. know windows can't handle '$ ./output.out' , alright, let's make executable then. under windows, i've installed cygwin in cygwin, compiled using gcc $ gcc -o hello.exe -g -wall -pedantic hello.c note: wrote hello.exe instead of hello.out or hello.c in cygwin, executed '$ ./output.exe' and got

r - Implenting multiple colors on axis line based on axis values in ggplot2 -

i know if possible create plot using ggplot2 e.g. x axis line black 0 5 , white 5 8? i working on plot there column of text on right side of plot. currently, x axis goes 8. using plot + scale_x_continuous(limits=c(0, 8)) if change upper limit in above 5, lose text on right side. therefore, thinking coloring x axis white 5 8 easiest solution. something this? library(ggplot2) df = data.frame( x = runif(10), y = runif(10) ) ggplot(df) + geom_point(aes(x = x, y = y)) + geom_segment(aes(y = 0, yend = 0, x = 0, xend = 0.5), color = 'blue') + geom_segment(aes(y = 0, yend = 0, x = 0.5, xend = 1), color = 'red')

decrease cassandra bootstrap time -

environment: rf=3,consistency_level=local_quorum. there lots of data in cluster,and need take long time bootstrap new node. , new node must join cluster, want decrease time.i have thought idea solve problem. when bootstraping node,seperate "stream data old node" stage bootstrap stage. join node token ring.and new node responsible range key.it can serve new write request.and status "un",not "uj". , "stream data old node" background task,or use enable/disable data stream switch.if client request old data,because there other 2 replication,so there no problem new node not data responsible for.

python - Decreasing value in dictionary -

i learning python , have simple problem program. have 2 dictionaries keys string , values connected them. lets it's shop fruits , prices. shopping_list = ["banana", "orange", "apple"] stock = { "banana": 6, "apple": 0, "orange": 32, "pear": 15 } prices = { "banana": 4, "apple": 2, "orange": 1.5, "pear": 3 } # function calculate bill def compute_bill(food): total = 0 number in food: if (stock[number]>0): total += prices[number] stock[number] -= 1 return total print compute_bill(shopping_list) if fruit in stock add price bill , reduce amount in stock. if not, don't anything. error message: calling compute_bill list containing 1 apple, 1 pear , 1 banana resulted in 0 instead of correct 7 i don't know why code not working properly. there 2 things wrong here:

c# - How in Xamarin Forms project use different sizes of BackgroundImage property for Page? -

Image
i've added types of image in resources - 320 x 480 login-background.png - 640 x 960 login-background@2x.png - 640 x 1136 login-background-568h@2x.png - 750 x 1334 login-background-667h@2x.png then i've filled backgroundimage property in xaml "image/login-background" but still not work. both device andthe simulator render 320 x 480. xaml not recognize -568h or @2x e.t.c ios. chooses image matches exact name without extension. works in android because images have same name , resolution folders different. as workaround can set images c# code behind looking @ height/width overriding onsizeallocated method. protected override void onsizeallocated(double width, double height) { base.onsizeallocated(width, height); string backgroundimgname = "myimage"; device.onplatform(ios: () => { if (width >= 414) // iphone 6 plus this.backgroundimage = backgroundimgname + "-736h@3x.png&quo

android - Zoom issue on mobile device though that works fine on desktop -

my front-end works bootrstrap3. firstable had responsive issues on mobile device fixed adding meta below: <meta name="viewport" content="width=device-width, initial-scale=1"> that works have still strange issue. of times, landing on page on mobile device, zoom lower 100%. actually, note when issue happening, whole page displayed on viewport, zoom adapted total height , width of page. if has solution fix issue great. try adding following head-tag: <meta name="viewport" content="width=device-width, user-scalable=no" /> mobile safari in ios 4.2. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> we disabling zoom on mobile web based application. can't zoom in native ios apps , it's not required in our web application. if site or app mobile optimised users won't need zoom. there use cases disabling zoom. doesn

ios - How to download a deprecated pod -

i using pod file in previous ios project want include in new project well. has been deprecated , unable include using pod install in terminal. how it? edit1: there way manually include pod existing project instead of "pod installing" it? if want install deprecated pods, include version of pod when declare in podfile. for example, in order install version 2.6.3 of afnetworking via cocoapods, here's how declare in podfile: pod ‘afnetworking’, ‘2.6.3’ doing pod install installs correctly.

c++ - Adding member field for 3rd library type -

i dealing library contain type (let rectangle) follow: namespace some_lib{ struct rectangle{ int x; int y; int width; int height; }; } i have vector of rectangles (very huge vector maybe 10^9 rectangle) , want compute area of rectangles , use in many places of program. i want compute once of course. should store somewhere. can not edit struct. suggested solution: namespace my_own_program{ struct rectangle_wrapper{ some_lib::rectangle rect; int area; operator some_lib::rectangle() const { return rect; } }; } now can store area in structure , if want pass vector library process on it, have casting while copying vector. i feel method rubbish. solved problem of computing areas casting in each time need process in library seems horrible. my question: how can achieve in more better way? well, if stuck using library , have pass vector many times, i'd suggest creating "shadow vector&qu

html - C# Headless browsing trough proxy -

i need add action program, makes following, using headless action, i.e. without starting browser or this: connects remote web server trough proxy server uses logged user authentication (active directory). loads page server , selects item drop-down list, page has lot of js coda populates data based on selected item. parses populated data extract needed information. i totally lost in net, there many ways achieve of goals, not in same time. appreciated :) edit : the page source select looks (guess .net page): <div class="rddlslide" id="ctl00_maincontent_dropdowngamemode_dropdown" style="display:none;"> <div class="rddlpopup rddlpopup_black"> <ul class="rddllist"> <li class="rddlitem">team league</li><li class="rddlitem rddlitemselected">hero league</li><li class="rddlitem">quick match</li> &

sql - Where is the right place for beautifying values from the DB for the user view? -

what mean question : lets have web app (spring, angularjs, oracle/mysql). select db 2 columns represant interval example : "age_from" , "age_to". purpose display thouse 2 values lets "18" , "21" in client view "18 - 21". so there many ways wonder between thouse two: select them db : "select (age_from|| ' - ' || age_to) age_interval, ..." , store string value backend object attribute : string ageinterval; , after pass object(which contains field) client side can use "ageinterval" display interval client. i can select 2 columns db , store values different fields object : double agefrom; double ageto; (i store double values in case 1 also) , after pass object client side there can use js logic create string " agefrom - ageto " or directly display them html : <div> {{myobject.agefrom}} - {{myobject.ageto}} </div> . so main question shoud logic creating beautify view (st

ruby on rails - Changing URL for devise_token_auth sign_in -

i use devise_token_auth , trying change users sign_in url. have sessions_controller in api/v2/ folder , devise_token_auth routes below: routes: namespace :api namespace :v2 mount_devise_token_auth_for 'user', at: 'users', :controllers => { :registrations => 'api/v2/registrations', :confirmations => 'api/v2/confirmations', :passwords => 'api/v2/passwords', :sessions => 'api/v2/sessions'} post 'users/sign-in', to: 'sessions#create' end end when rake routes the route wish: api_v2_users_sign_in post /api/v2/users/sign-in(.:format) api/v2/sessions#create but, when try hit url following error: abstractcontroller::actionnotfound (could not find devise mapping path "/api/v2/users/sign-in". may happen 2 reasons: 1) forgot wrap route inside scope block. example: devise_scope :user "/some/route" => &qu

C# REST wcf service with https cannot be reached on localhost -

i struggling https rest server running on localhost testing purposes ms visual studio 2015. regular http rest wcf server runs fine, when trying access localhost through https, seems down (site can't reached). have read instructions on the hanselman website try working, feel missing crucial step. possible missing (few) settings? i assuming creation of certificate handled when enabling ssl in wcfservice project properties, correct? here follows web.config file: <?xml version="1.0"?> <configuration> <appsettings> <add key="aspnet:usetaskfriendlysynchronizationcontext" value="true"/> </appsettings> <system.web> <compilation debug="true" targetframework="4.5.2"/> <httpruntime targetframework="4.5.2"/> <httpmodules> <add name="applicationinsightswebtracking" type="microsoft.applicationinsights.web.applicationinsights

delphi - cxgrid highlight (or color) changed cell on form closequery -

on closequery of form have : if messagedlg('close program ?', mtconfirmation, [mbyes,mbcancel],0) <> mryes canclose := false else if datamodule2.mytable.state in [dsedit,dsinsert] if messagedlg('save changes ?', mtconfirmation, [mbyes,mbno],0) = mryes datamodule2.mytable.post; is there way can highlight (or color) changed cell in cxgrid when trigger onclosequery event ? i don't need know changed know cell changed user can see can decide weather save changes or not. it simple cxgrid draw cell (or row) highlighted in way using cxgrid1dbtableview1customdrawcell event. , having flag indicates onclosequery event in progress, can restrict action inside event. update code posted answer not mark more 1 cell in current grid row changed. updated code below can however; note comments in 2 procedures. type tform1 = class(tform) [...] public queryingclose : boolean; end; procedure tf

javascript - How to send table value with form, radio button? -

example html code in table <table> <tr> <td> <input type='text' value='example 1' name='text1' /></td> <td> <input type='radio' value='example 1' name='radio1' /></td> </tr> <tr> <td> <input type='text' value='example 2' name='text2' /></td> <td> <input type='radio' value='example 2' name='radio2' /></td> </tr> <tr> <td> <input type='text' value='example 3' name='text3' /></td> <td> <input type='radio' value='example 3' name='radio3' /></td> </tr> </table> i want send clicked value when if radio button clicked button 1 clicked -> send radio 1 value 2 clicked -> send radio 2 value 3 clicked -> sens radio 3 v

How to specify CMAKE RUNTIME_OUTPUT_DIRECTORY correctly? -

i have following directory structure cmake_test ├── bin ├── cmakelists.txt ├── src │   └── func.cxx └── subproj ├── cmakelists.txt └── src └── main.cxx cmakelists.txt : cmake_minimum_required(version 2.8) project(main) set(cmake_runtime_output_directory ${cmake_home_directory}/bin/) set(cmake_library_output_directory ${cmake_home_directory}/bin/lib/) set(cmake_cxx_flags_debug "-std=c++11 -wall -g3 -o0") set(cmake_cxx_flags "-std=c++11 -wall -wextra") set(meta_src_dir ${cmake_home_directory}/src) aux_source_directory(${meta_src_dir}/ meta_src_list) add_subdirectory(subproj) subproj/cmakelists.txt : cmake_minimum_required(version 2.8) project(subproj) aux_source_directory(${project_source_dir}/src src_list) #include_directories(${project_source_dir}/include) add_executable(${project_name} ${src_list}) when build project ( cd bin; cmake ..; make ) face following error: scanning dependencies of target subproj [ 50%]

python - creating a class of functions with pandas -

im going make program functions regularly use , thought make classes (my first time making classes) need i need class reads dataframe , prints tail of dataframe start, write functions class output regression , fourier transform on having trouble printing tail... here code: class my_data: def __init__(self, the_data): self.the_data = pd.dataframe(the_data) def print_tail(self, the_data): return pd.tail(the_data) = my_data(the_data = pd.read_csv('training_x.csv')) print(a.print_tail()) i thought creating class , passing pd.dataframe through it, inherits functions of pandas if wrap in own function within class? guys im bit lost

IcCube - OLAP Time Dimension with range only linked on start date -

in iccube there time wizard option index range. can link dimension fact table start field , end field. but unfortunately have fact table start dates , link them in way, entry valid, until have entry same keys. possible, or have add end date every entry? if understood correctly, you've fact table following structrue dim1, dimtime, amount 1 , 1 feb 2014, 2.4 2 , 8 feb 2014, 1.4 3 , 3 feb 2014, 3.4 you bind first line [1 feb,3 feb), third line [3 feb, 8 feb) , on. if case, there no easy way. ideally calculate to) part in data source or use iccube's etl layer solve there (javascript cache). note last not approach large tables. if can order time column algorithms lot easier without need cache whole table. you can find schema example in link using javascript view described here . hope helps

Call a method in ui-sref in angularJS -

i have below code in nggrid: celltemplate: '<div class="padding-t-5 padding-l-5"><a ui-sref="editcamera({id:row.entity.id})" ><i class="fa fa-edit margin-r-10"></i></a>\n\ <button ng-click="confirmclick() && grid.appscope.deleterow(row)" confirm-click><i class="fa fa-trash"></i></button></div>' i wondering how define editcamera method mentioned in ui-sref controller. if add ng-click how pass id (passed on ui-sref) i tried define using $scope.editcamera, dint worked. ****update****** what need perform add , edit operations in same controller, need different method edit operation. ui-sref treat editcamera() state angular routing when compiled converts ng-href . if define editcamera() in controller wont called routing state , params pass i.e id act routes parameter . call function need use ng-click instead . or if goin

c# - How can I make images drag and drop-able to reorder them? -

i'm building application in i'd user able reorder pictures in form in 2 columns. i've got flowlayoutpanel of set width, , pictures added via openfiledialog , scaled half width (minus allowance scroll bar) of flow layout panel. this i'm stuck - i've tried adding images labels, buttons, , pictureboxes , can't work out how move them around. gave on labels because canselect false - although didn't know if have made difference - , moved on buttons because realised picture boxes existed. i'm open switching out controls use images need in 2 columns. here's code have dragenter , dragdrop events: private void flowlayoutpanel_6_cards_dragenter(object sender, drageventargs e) { e.effect = dragdropeffects.all; } private void flowlayoutpanel_6_cards_dragdrop(object sender, drageventargs e) { messagebox.show("dropped"); } how can implement this? controls should use , properties should looking @ make possible? so @taw's c

java - How can I query a specific column value in a Parse.com class and set it to a string? -

how can query specific value of object in parse class , set string? given have object specific objectid, want value "position" column, , want set string. parsequery<parseobject> query = new parsequery<parseobject>("nativead"); query.whereequalto("objectid", "fybeufqdot"); query.findinbackground(new findcallback() { @override public void done(list objects, parseexception e) { if (e == null) { log.d("nativead", "retrieved " + objects.size()); (parseobject adposition : objects) { string n = adposition.get("position").tostring(); system.out.println(n); } } else { log.d("nativead", "error: " + e.getmessage()); } } }); i think work @override public int getviewtype(int position) { parsequery<pa