Posts

Showing posts from April, 2013

angular - display ngFor with json object return from service -

this service: https://api.myjson.com/bins/quv59 im trying display in html *ngfor="let item of bookslist; let = index" my ts file ngoninit() { this.booksdataservice.getbooks().subscribe( function(response) { this.bookslist = response.books; }, );} thanks in advance <li *ngfor="let item of bookslist; let = index"> {{ item.author }} </li>

ruby on rails - Cannot play MP4 video on LAN in iOS through asset pipeline, but can from WAN -

i'm trying embed <video> on site , show in dialog box. thought there javascript problem, narrowed down fact ios mobile safari on iphone not play mp4 file local network, direct link. link looks http://localhost:3000/assets/introduction-0cf920e06b4224f8f83f59d02f878b7d5733b09590a14147d1580cbfb5081f18.mp4 except changed localhost ip of desktop server. load black screen same color first frame of video 2 dashes in middle. if load hotlink of mp4 staging, plays fine. plays fine in chrome on desktop. i tried play in ipad ios 9.3.5 , failed play, did display whole play button, did nothing. if copy video /public folder, play on ios safari. seems fail when goes through asset pipeline, in development (same file in staging). how play mp4 video on iphone safari in development environment? i funneled iphone through fiddler4 proxy , reloaded page. made 2 consecutive requests: get /assets/introduction-0cf920e06b4224f8f83f59d02f878b7d5733b09590a14147d1580cbfb5081f18.mp4 htt

shell - How to delete docker after use in Jenkins -

i want delete remains of docker-operations within jenkins. but somehow following line not work... the issue seems parenthesis. any advice? if [ docker images -f dangling=true -q|wc -l > 0 ]; docker rmi --force $(docker images -f dangling=true -q);fi i store output of docker images command , use it: images=$(docker images -f dangling=true -q); if [[ ${images} ]]; docker rmi --force ${images}; fi

How to print the next line of a match in Perl? -

so, wrote script calculates factorials of 4^(0) 4^(10) wanted test run-times, , wanted compare stirling's approximation with actual number of digits of respective factorials. so have file data called factorials.txt contains following data example: the factorial of 1 1 factorial of 4 24 factorial of 16 20922789888000 factorial of 64 126886932185884164103433389335161480802865516174545192198801894375214704230400000000000000 i output of factorials following: factorial 1: 1 digits. factorial 4: 2 digits. factorial 16: 14 digits. factorial 64: 90 digits i able write script these values, after statement factorial of ___ ... on next line value of factorial. wasn't able select next line after match, wrote using while loop through file matching nonexistence of letters, , printing length of characters on line. works, don't think it's efficient. #!/usr/bin/env perl use strict; use warnings; use feature 'say'; $file = 'factorials.txt'; $filehandl

sql server - How do I map java.util.Date to sys.datetime -

i upgrading our jdbc driver mssql-jdbc-6.2.1 can move sql server 2016. works fine new driver except our reports. have 6000+ reports use java.util.date . previous driver these treated datetime in sql new driver treats them date . reports failing on code "dateadd(minute, ..." since not supported date. i tried java.util.map map = conn.gettypemap(); map.put("sys.datetime", java.util.date.class); conn.settypemap(map); but apparently settypemap not implemented in ms driver. rewriting reports not option. there anyway override mapping?

ngcomponentrouter - AngularJs to keep query string on refresh -

i'm using angularjs 1.6 , ngcomponentrouter. want query string maintained after refresh. for example, if go localhost:8080/something?foo=bar&bar=foo , hit refresh want go same url including query sting. currently when refresh go base route ( localhost:8080/something ).

php - Facebook destroy session on logout -

i doing site client , using facebook login.. when login , log out of facebook works fine. when login shortly after log out, automatically logs in previous person logged in. question how destroy (i assume session or cookies) storing info or need expire access token? either way wandering if had solution has worked them quick fix turning long problem because of this. session_start(); session_unset(); $_session['fbid'] = null; $_session['fullname'] = null; $_session['email'] = null; $_session['valid'] = null; header("location: " ."http://www.muchogusto.net"); from session_destroy() man page in order kill session altogether, session id must unset. if cookie used propagate session id (default behavior), session cookie must deleted. setcookie() may used that. edit this use: session_start(); session_destroy(); setcookie('phpsessid','',time()-864000,'/'); // persistent cookie setc

ruby on rails - How to scope has_many through association that uses custom key names? -

trying learn how navigate has_many through association i'm working , i'm hitting brick wall. i've abstracted classes here they're easier relate to. a book has many characters. character has many books. makes different typical hmt association when character associated book, added either "good guy" or "bad guy", example: book.bad_guys << character i'm able pull results book.good_guys fine. what's throwing me loop whenever want go other way, take character , find out books associated with, returns book::activerecord_associations_collectionproxy rather actual result list. if character.books.first outputs (notice how attempts find "good_guy" attribute rather go off of book , character columns part of join table) document load (1.1ms) select "books".* "books" inner join "book_characters" on "books"."id" = "book_characters"."good_guy" "book_cha

html - CSS works as localhost but not by server address -

Image
after having couple issues css, downloaded menu code http://responsivemultimenu.com . the code works great on local machine in both ie , ff when calling localhost. when copied on our intranet server (windows 2003, iis 6) , call page it's server address, css fails load in ie, works in firefox. tried on second server (windows 2008, iis 7.5) same result. see if browser, had couple other people call page on server computer same result. i have not changed of html, css or js code download. it seems of css loads not of it. stumped. here screen shot of in firefox , supposed like. here screenshot of in internet explorer. it's not working. i need figure out of why css not loading. blocking it? need change either in browser or on server? check on browser console in developer mode, in chrome can open crtl + shift + j , don't use firefox. once opened, reload page, , check errors while loading website. maybe need update route/location of css file within file, e

html - How to highlight in-text citations and endnote references after linking to them within a page -

i link citations endnotes , endnotes bibliography in following manner: <h1>title</h1> <hr /> <p>this citation "[1]" links "&uarr;" in endnotes , vice-versa.<a id="citation1" href="#endnote1"><sup>[1]</sup></a></p> <h1>endnotes</h1> <hr /> <ol> <li><a id="endnote1" href="#citation1">&uarr;</a>this endnote <a href="#short title of reference"><i>short title of reference</i></a> links entire <i>reference</i> in bibliography.</li> </ol> <h1>bibliography</h1> <hr /> <ul> <li><a id="short title of reference">here goes entire <i>reference</i>.</a></li> </ul> which yields: title this citation "[1]" links "↑" in endnotes , vice-versa. [1] endnotes ↑this e

python - string number average returned in string format -

here tests: input: "zero 9 5 two" output: "four" input: "four 6 2 three" ouput: "three" here code, works until last step need inverse lookup key value, dont know how do. advice? def average_string(s): num_dic = {'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9} str_split = s.split() int_values = [] key, val in num_dic.items(): if key in str_split: int_values.append(val) int_avg = int(sum(int_values) / len(int_values)) return int_avg you can try this: num_dic = {'zero': 0, 'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6, 'seven': 7, 'eight': 8, 'nine': 9} s = "zero 9 5 two" new_dict = {b:a a, b in num_dic.items()} averag

reporting services - Send Email with Attachement using SSRS Action Property -

for customized reason, developed report reporting on sharepoint document lists , far it's good. by using action property, linked original sharepoint path ssrs , user can open document using link report easily. new requirements business wants a link in report send email. when user clicks on new link , document should emailed directly specified email address. is there way such thing using action property in ssrs? i'm using ssrs 2008r2 note: i want explore options ssrs before going out of domain. thanks in advance. no, asking about, or attempting make happen action property not possible. best bet run report, export report excel, or word, , email report within application. action properties allow few things happen: go report go bookmark within current report go url the go url can mailto: protocol, open end users default email client; there no attachment, or report results in email body.

regex - What exactly do the flags do in the re library for python 3? -

i unable find explanations flags due operations within re library. https://docs.python.org/3.6/library/re.html for example, have following bit of python code: nestedpar = re.findall(r"\([^\(\)]*\)", s, 0) but unsure happening when change 0 1, since results in crash. can explain flag means exactly? the third argument options bit mask, , bit masks defined (this, technically, may vary version version): sre_flag_template = 1 # template mode (disable backtracking) sre_flag_ignorecase = 2 # case insensitive sre_flag_locale = 4 # honour system locale sre_flag_multiline = 8 # treat target multiline string sre_flag_dotall = 16 # treat target single string sre_flag_unicode = 32 # use unicode locale sre_flag_verbose = 64 # ignore whitespace , comments sre_flag_debug = 128 # debugging using simple bitwise or (or regular + ) can combine multiple flags (e.g. re.multiline | re.dotall ). shouldn't fail on 1 please don't use numbers directly, assigned meani

powershell - How can I see variable values within an inlinescript script block executed within an Azure runbook? -

this has obvious if forgive me. have dug through posts, articles, etc better part of day , hoping can shed light this. the problem dataset fill failing within inlinescript script block. have been looking see how view contents of $connectionstring, $query, , $cmd variables within inlinescript script block.   have defined connection string , query variable.  can a $conn.open() , doesn't fail.  have passed connection , query variables sqlcommand object:       $cmd = new-object system.data.sqlclient.sqlcommand($query, $conn) i create dataset , dataadaptor objects:         $ds = new-object system.data.dataset        $da = new-object system.data.sqlclient.sqldataadapter($cmd) when executing following: try {     [void]$da.fill($ds) } catch {     write-error "not able fill dataset list of customers!"   } the catch/error branch taken. my belief there no results being returned $cmd empty resulting in fill error.  being in runbook none of command

node.js - What's the difference between depenencies and devDependencies with NPM 5 -

the below question refers project i'm not publishing npm . in npm 3, if had package in devdependencies , ran shrinkwrap (without --development ) npm-shrinkwrap.json not include packages in devdependencies . but npm 5, packages in dependencies , devdependencies added package-lock.json , devdependencies having "dev": true . so, if i'm using npm install x add packages , npm install install on, say, build server, package listed in dependencies treated differently package listed in devdependencies ? it make sense on production. when you'll need install packages, except dev. npm --production from npmjs.org: with --production flag (or when node_env environment variable set production), npm not install modules listed in devdependencies.

asp.net mvc - I want to open a new window or tab on click of button using MVC -

[httppost] public actionresult index(debuggerindexformholder holder) { var result = _debuggerindexformprocessor.process(holder.debuggerindexform, modelstate); if (result.issuccess) { return redirecttoaction("item", new { id = result.sessionid }); } } [httpget] public actionresult item(string id, string inputid) { var model = _debuggersessionviewmodelbuilder.build(id, inputid); return view(model); // opens required view in same window } html code <button id="submit" type="submit" data-loading-text="loading..." class="btn btn-primary">debug it!</button> actionresult "index" called , in turns calls actionresult "item" , passing session id action result "item", fills model on session id basis calls view , need open view in different window using same session id. can please me ? tha

java - REST endpoints in Spring Integration make messaging channels multithreaded -

i have simple spring boot application, provides couple of restful endpoints , supposed drive sftp file being uploaded sftp server. requirement if there more 1 file, files should queued. expected achieve default behaviour of sftp spring integration workflow, read directchannel automatically queues files. test behaviour following: send big file, blocking channel while calling endpoint. send smaller file calling endpoint. expected result: smaller file queued onto channel , processed after uploading of bigger file finished. actual result: new connection sftp server opened , smaller file uploaded there without being queued, while bigger file continues transmission. there 2 files in application: demoapplication.java @springbootapplication @integrationcomponentscan @enableautoconfiguration(exclude={datasourceautoconfiguration.class}) public class demoapplication { public static void main(string[] args) { springapplication.run(demoapplication.class, args); }

javascript - Vue is not detected when JSP is loaded through struts -

example jsp : <!doctype html> <html lang="en-us" > <head> <script src="vue.min.js"></script> </head> <body> sample heading <div class="container" id="maindiv"> {{firstname}} </div> </body> <script type="text/javascript"> vue.config.devtools = true; var app = new vue({ el: '#maindiv', data: { firstname: 'name', lastname: 'lname', description: 'desc' } }); </script> </html> the following options tried : if above file executed using .html, works expected. chrome dev tools detects vue application if above file executed using .jsp, works expected. chrome dev tools detects vue application( http://localhost:8080/example.jsp ) if above file executed using .jsp , jsp loaded through form submission ht

c# - Create Save And Load Functionality For A Winform -

i have winform 5 text boxes , 2 data grids. need way of being able press button (or adding menu @ top file button , select save there) , save of values file user selects location/name for. need button (or again menu option) load file saved , values "save" generated on screen looks if input values. how achieved in vs2017? you describe problem , answer already. can straight forward implement that: save data file, when press button 2 , load data file form. other approach, can have global variable, when press button 1 , save data variable, when button 2 pressed, load variable's value form. public class userdata { public string location { get; set; } public string name { get; set; } } then in form: public partial class form1 : form { static list<userdata> saveddata; public form1() { initializecomponent(); saveddata = new list<userdata>(); }

c# - DataTable field datatype not updating in crystal report -

i'm using asp.net. i trying change datatype of field in data set created string int32 . data set being used in crystal report. verified database in database fields multiple times, tried logging on , off , closing visualstudio multiple times, when field being used in parameter find in formulas datatype of field still of type string (and not int32 ). why datatype of field in crystal report not updating?

.net - C# Cleanly assign every method parameter a single value -

i created function(shown below) assign text of 9 buttons " "(i try use " " instead of assigning variable null out of illogical assumption, appreciate pointed out if i'm incorrect), feel could've assigned every parameter blank string in cleaner way. public void resettext(ref string buttontext1, ref string buttontext2, ref string buttontext3, ref string buttontext4, ref string buttontext5, ref string buttontext6, ref string buttontext7, ref string buttontext8, ref string buttontext9) { buttontext1 = ""; buttontext2 = ""; buttontext3 = ""; buttontext4 = ""; buttontext5 = ""; buttontext6 = ""; buttontext7 = ""; buttontext8 = ""; buttontext9 = ""; } is there cleaner/shorter way reassign every parameter. pretty bad if have assign 50 variables new value in function(i used buttons example.)

typescript enum default value -

i starting learn typescript aurelia framework. have implemented matthew davis's blog typescript enums in aurelia templates using viewenginehooks http://davismj.me/blog/template-constants/ aurelia's todo app. i please set default enum value 2nd value in list , setting default 1st value in list. also please know if {todo, priority} or {todo} needs importing shown in todo-list.ts todo.ts // pro tip: starting our enum @ 1, ensure values in enum truthy. export enum priority { high = 1, medium, low } export class todo { @observable done; //*** setting priority: priority = 2 or priority: priority = priority.medium - not change default high / 1 *** //constructor(public list: todolist, public description: string, public priority: priority = 2, public editing: boolean = false) { constructor(public list: todolist, public description: string, public priority: priority = priority.medium, public editing: boolean = false) { this.list = list;

javascript - JSTree Proton theme Change icon to folder open and close -

Image
i have 1 demo application in jstree proton theme used. i want change icon when node open folder open , when node closed folder closed. same following. proton cms admin panel check documentation node in there changes icon folder open , closed. now when trying change icon found using css sprites , when checked style.css found using base64 url load images. here sprites has used. how can use directory open , close icon in node? what names or css class use icon? when having sprite how can find icon name , load it? apart want use filled square leaf node icon. i able render image using following sprite code. .jstree-folder-open { background: url('32px.png') no-repeat -531px -23px !important; } but still unable display icon in correct size , correct way. there particular way? finally able render image changing background position in css. here tool found css code render image sprite. sprite cow open image , select portion. after created se

python - What is the Linux equivalent of the pywin32 module? -

i trying port python code windows ubuntu, 1 of modules uses pywin32. know won't run on linux machine, module install replace pywin32 if wanted run python script on linux? import pyhook, pythoncom, sys, logging file_log = 'c:/keyloggeroutput.txt' def onkeyboardevent(event): logging.basicconfig(filename=file_log, level=logging.debug, format='%(message)s') chr(event.ascii) logging.log(10,chr(event.ascii)) return true hooks_manager = pyhook.hookmanager() hooks_manager.keydown = onkeyboardevent hooks_manager.hookkeyboard() pythoncom.pumpmessages() there isn't one. need either port python code platform-independent code or find equivalent replacement provides specific functionality required pywin32.

yii2 - Cannot install Kartik Dialog -

this composer .json file { "minimum-stability": "stable", "require": { "php": ">=5.4.0", "yiisoft/yii2": "*", "yiisoft/yii2-bootstrap": "*", "yiisoft/yii2-swiftmailer": "*", "kartik-v/yii2-nav-x": "*", "johnitvn/yii2-ajaxcrud": "*", "kartik-v/yii2-grid": "@dev", "kartik-v/yii2-widget-timepicker": "*", "kartik-v/yii2-widget-colorinput": "*", "kartik-v/yii2-widget-datepicker": "@dev", "kartik-v/yii2-widget-select2": "@dev", "kartik-v/yii2-date-range": "dev-master", "kartik-v/yii2-field-range": "dev-master", "kartik-v/yii2-helpers": "dev-master", "kartik-v/yii2-widget-datetimepicker": "*", &qu

Trying to parse large xml file in Python - Memory Errors -

so i'm beginner 'scraper' not whole truckload of programming experience. i'm using python, in canopy environment, scrape downloaded xml files , using xml.dom parser so. i'm trying scrape tags first us-bibliographic-patent-grant (which why i'm using [0] ) see how want parse , store entire dataset; rather doing @ once. excerpt xml looks this: <?xml version="1.0" encoding="utf-8"?> <!doctype us-patent-grant system "us-patent-grant-v42-2006-08-23.dtd" [ ]> <us-patent-grant lang="en" dtd-version="v4.2 2006-08-23" file="usd0606726-20091229.xml" status="production" id="us-patent-grant" country="us" date-produced="20091214" date-publ="20091229"> <us-bibliographic-data-grant> <publication-reference> <document-id> <country>us</country> <doc-number>d0606726</doc-number> <kind>s1</kind>

node.js - Nodejs - My post request doesn't save all my data in my schema -

my problem i'm facing right post request suppose save doc in mongodb doesn't save docs. doesn't save fields multiple values. there way save those? this post request. router.post('/register',function(req,res,next){ let newdoc = new doc({ patientinfo:{ name:{ fname:req.body.fname, lname:req.body.lname, mname:req.body.mname }, age:req.body.age, address:{ barangay:req.body.barangay, cc:req.body.cc, city:req.body.city }, birthday:req.body.birtday, complaint:req.body.complaint, vitalsign:{ time:req.body.time, pulse:req.body.pulse, bp:req.body.bp, resp:req.body.resp, temp:req.body.temp, sao:req.body.sao, levelofconsciousness:req.body.levelofconsciousness, airway:req.body.airway, o2supply:

ios - Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1 -

apple llvm 8.1 error group every time build,xcode show error,and error different ,this time maybe vc , next time other vcs! help? in xcode > project > target > build phase> compile sources check if file duplicated or files show red color if delete them , clean build. also try, deleting derived data : ~/library/developer/xcode/deriveddata

Delete folders/files that are not listed in a textfile -

i need batch file read list of paths text file. if list not include path of subfolders/files in windows explorer, removed. for example, in d:\test contains: hi <directory> bye <directory> hello.txt cya.txt checklist.txt so in my checklist.txt :(this list containing folders/files shouldn't deleted) d:\test\hi d:\test\hello.txt d:\test\checklist.txt as result, after running batch file, bye folder , cya.txt removed. stack overflow not write-code-for-me site! you should add code before ask, otherwise, question closed "unclear asking". anyways here code. @echo off setlocal enabledelayedexpansion /f %%g in (checklist.txt) ( set "str=%%~g !str!" ) /f %%g in ('dir /b ^| findstr /v /i "%str%"') ( echo del "%%~g" rem remove echo statement when shows correct result ) pause loops through files in checklist.txt , remove them unnecessary files. remove

auth0 - Disable passwordless - User should login with email and password -

when log out of auth0 can click on email log in again. making passwordless. how make flow user has input email , password log in instead of having passwordless? i couldn't find docs on this. thank in advance. it sounds have live sso session - auth0 lock widget detect this, , therefore offer abbreviated login whereby password re-entry not required. instead, when log user out, ensure not expunging local session, auth0 sso session. can calling https://{{your_tenant}}.auth0.com/v2/logout if using auth0.js library, should find equivalent function eg. logout achieves same thing.

powershell - How to loop through arrays in hash table - passing parameters based on values read from a CSV file -

curious how loop through hash table each value array. example: $test = @{ = "a","1"; b = "b","2"; c = "c","3"; } then like: foreach ($t in $test) { write-output $t } expected result like: name value b b c c 1 b 2 c 3 that's not happens , use case pass hash of parameters function in loop. approach might wrong, figured ask , see if anyone's tried this? edit** bit more clarification. i'm trying pass lot of array values function , loop through in hash table prior passing nested function. example: first like: $parameters = import-csv .\newcomputers.csv then like $parameters | new-labvm lab vm code below: function new-labvm { [cmdletbinding()] param ( # param1 description [parameter(mandatory=$true, position=0, valuefrompipeline=$true, valuefrompipelinebypropertyname=$true)] [alias("p1")] [strin

python - Difference between a range of values of txt files -

so have 10 txt files named a_1,a_2,......a_10 , working txt file named a. in each column of these txt files, there 4320 values. goal compare first 1440 values of column of txt file other 10 txt files(a_1,a_2,.....a_10) , find sum of square of differences. approach gives me difference of 4320 values, stuck @ how manipluate code find difference of first 1440 values: import numpy np filelist=[] in range(1,11): filelist.append("/users/hrihaan/desktop/a_%s.txt" %i) fname in filelist: data=np.loadtxt(fname) data1=np.loadtxt('/users/hrihaan/desktop/a.txt') x=data[:,1] x1=data1[:,1] x2=(x-x1)**2 x3=sum(x2) print(fname) print(x3) adding slice below should trick. np.loadtxt(fname)[:1440] it causes data include rows indexed 0 not including 1440... since python zero-based indexing, gives 1440 rows total. for fname in filelist: data=np.loadtxt(fname)[:1440] data1=np.loadtxt('/users/hrihaan/desktop/a.txt')

firebase - Adding Ionic notificacions when a new chat msg arrives -

i have chat app made ionic , firebase, similar whatsapp or facebook messenger. i looking way send notification everytime sends new message. far i’ve seen ionic.io following tutorial in spanish https://www.ion-book.com/blog/ionic2/ionic-push-notifications/ in tutorial, says in order notification need put code in app.components.ts private getnotifications(){ this.push.rx.notification() .subscribe((msg) => { alert(msg.title + ': ' + msg.text); }); } and send notification using ionic.io dashboard. cool, let's want send notification every time receives new message: there way put code in list view of chats or maybe in firebase function every time new node chat added db sends notification? thanks!

java - Why this circle didn't get smeared -

Image
import javax.swing.*; import java.awt.*; public class test1 { int x = 70; int y = 70; public static void main (string[] args) { test1 gui = new test1 (); gui.go(); } public void go() { jframe frame = new jframe(); frame.setdefaultcloseoperation(jframe.exit_on_close); mydrawpanel drawpanel = new mydrawpanel(); frame.getcontentpane().add(drawpanel); frame.setsize(300,300); frame.setvisible(true); (int = 0; < 130; i++) { x++; y++; drawpanel.repaint(); try { thread.sleep(50); } catch(exception ex) { } } }// close go() method class mydrawpanel extends jpanel { public void paintcomponent(graphics g) { g.setcolor(color.green); g.filloval(x,y,40,40); } } // close inner class } // close outer class page1 page2 according page 2, circle should smeared in frame... actually, when ran it, moved without smearing. why that? btw, if these codes not able make smearing circle, how make smearing one? c

Storing Configuration parameter in Netsuite -

i putting question discussion, hoping answer. planning add configuration variable in system. can used various scenario. may configure ftp connection or jdbc connection or xml service parameter. this may configuring global variable (tibco) or property file (java).i thinking of adding customrecord. not sure if option. or can caching or record type. tia look script parameters. can add script parameters scripts, fields store value can access within script. if want access parameter script can make company parameter , set going into: setup>company>general preferences> custom preferences you go custom record route or saving/loading json object in file in filing cabinet.

openerp - Passing recordset to object in template from controller Odoo -

i have form in odoo website has country , state selection fields. form populated controller pass recordset of states , countries values in dict states , countries keys. selection field, looped using t-foreach through states provide option , values. upon selection of country, need able filter out states of particular country. possible , if yes how? here of code have attempted: following controller loads form , second method filter out states @http.route('/admission_applications', type='http', auth="public", website=true) def application_form(self): cr, uid, context, registry = request.cr, request.uid, request.context, request.registry classes=[('lkg',"lkg"),('ukg',"ukg"),('1', "1st"), ('2', "2nd"),('3', "3rd"),('4', "4th"),('5', "5th"),('6', "6th"),('7', "7th"),('8', "8th&quo

python - Column formatters in Flask Admin interface -

hi have created flask admin interface. in 1 of field(column), include hyperlink. class workout(db.model): equipment = db.column(db.string(100)) place = db.column(db.string(100)) image = db.column(db.text) or using jinja2 macro in template: i have create view should include above columns have format image column in view. i not sure of how create view above mentioned custom class model. from flask_admin.model.template import macro class workoutview(modelview): in _macros.html file. {% macro render_image() %} <a href="#" id="upload_widget_opener">upload images</a> <script src="https://widget.cloudinary.com/global/all.js" type="text/javascript"></script> <script type="text/javascript"> document.getelementbyid("upload_widget_opener").addeventlistener("click", function() { cloudinary.openuploadwidget({ cloud_name: 'mycloudname', sources: [ '

powershell - Get-ADGroup with -recursive is not working? -

i using get-adgroupmember command fetch users in ad group. -recursive helping me fetch members child groups if in parent group well. however, get-adgroupmember has upper limit of 5000 entries only. to tackle if use: get-adgroup -identity "dept_120_sa" -server "a" -properties * | select-object -expandproperty members |get-aduser this doesnt work parent ad has child ads , -recursive not accepted get-adgroup . error: get-adgroup : parameter cannot found matches parameter name 'recursive'. @ line:2 char:79 + get-adgroup -identity "dept_120_sa" -server "mhf.mhc" -properties * -recursive <<<< | select-object -expandproperty members + categoryinfo : invalidargument: (:) [get-adgroup], parameterbindingexception + fullyqualifiederrorid : namedparameternotfound,microsoft.activedirectory.management.commands.getadgroup my aim display username , mail ids , works me: get-adgroupmember -s

java - How can i stop the CountDowntimer when the user already finish the game -

i want stop timer when activity finish or leave. im trying when user answer jumble words timer stop. , if user didnt answer time , score post on next activity. dont know how it. please me thanks! anagram.java package com.example.child.fragments; import android.app.activity; import android.app.fragment; import android.content.intent; import android.os.bundle; import android.os.countdowntimer; import android.support.annotation.nullable; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.button; import android.widget.edittext; import android.widget.relativelayout; import android.widget.textview; import com.example.child.sidenavigation.guessthepic; import com.example.child.sidenavigation.fade; import com.plattysoft.leonids.particlesystem; import com.plattysoft.leonids.modifiers.scalemodifier; import com.example.child.sidenavigation.r; import org.w3c.dom.text; import java.util.arraylist;

DOM breaks on loading lots of data in dialogue popup window in Excel? -

i facing issue table rendering. table contains 3 columns auto-complete dropdown, in each dropdown contains more 50 data. hence if response gets more 100 rows dom crashes. is there optimal way render data in dropdowns resolve issue? for each keyboard enter 1 can hit server, don't think that's way.

html - Up triangle, adjusting the y position in CSS -

hey have triangle in css created so: .triangleup { width: 0; height: 0; border-style: solid; border-width: 0 7.5px 10px 7.5px; border-color: transparent transparent #58be23 transparent; display: inline-block; } <h1>here triangle<i class="triangleup"></i></h1> i change y position of triangle , move top of triangle aligns top of text. how go doing this? try this: .triangleup { vertical-align: top;<----------added //more code......... } .triangleup { width: 0; height: 0; border-style: solid; border-width: 0 7.5px 10px 7.5px; border-color: transparent transparent #58be23 transparent; display: inline-block; vertical-align: top; } <h1>here triangle<i class="triangleup"></i></h1>

textbox - MFC Edit control - WM_DROPFILES message register for drag and drop -

according this article , allow drop on target, have use subclassdlgitem() re-route 1 message dialog object of handling can done there. mr. danrollins (the author of article) provides example class ceditdropnotif : public cedit { virtual bool pretranslatemessage(msg* pmsg) { if ( pmsg->message == wm_dropfiles ) { getparent()->sendmessage(wm_dropfiles, pmsg->wparam, pmsg->lparam); return true; // eat } return false; // allow default processing } }; bool cmydlg::oninitdialog() { ... static ceditdropnotif ced; // must persist (usually dlg member) ced.subclassdlgitem( idc_edit1, ); ::dragacceptfiles( ced.m_hwnd, true ); // editbox, not dialog ... but don't understand why edit control (cedit) has accept files in properties window (visual studio resource view), can't register message wm_dropfiles without having create inherited class (or can haven't known yet). i see can register

PHP Image rotation while uploading file from android -

i need image rotation while uploading android phone (can't test iphones because don't have one) so, post code below, not working @ least when upload image not in correct rotation appears sideways. this php code: $imgid = $_post['postid']; $newname = "$imgid.jpg"; $filename = $_files['filefield']['name']; $filepath = $_files['filefield']['tmp_name']; $exif = exif_read_data($_files['filefield']['tmp_name']); if (!empty($exif['orientation'])) { $imageresource = imagecreatefromjpeg($filepath); // provided image jpeg. use relevant function otherwise switch ($exif['orientation']) { case 3: $image = imagerotate($imageresource, 180, 0); break; case 6: $image = imagerotate($imageresource, -90, 0); break; case 8: $image = imagerotate($imageresource, 90, 0); break; default: $image = $imageresource; }