Posts

Showing posts from January, 2010

How to hit a breakpoint in classic ASP script running in Visual Studio 2015? -

Image
i trying debug classic asp application (written in vbscript) using visual studio 2015. the page throwing error structured follows : <% : : class myfile : : 899 someobj.open ssql, connect : : %> the page throws error @ line above. com error number : -2147217900 (0x80040e14) file name : /includes/myfile.class.asp line number : 899 brief description : invalid column name 'column'. but cannot debug this. tried following putting "stop" before line -> not work. not stop ! debug breakpoint not hit -> tried running within visual studio debug breakpoint not hit -> tried running page separately , attaching vs debugger iisexpress. any suggestions ? inline script debugging (this not within javascript) supported @ ? select site in iis management tool, doubleclick "asp" in main window. set "send errors browser" true, enable client-side , server-side debugging well. if have visual studio installed, ,

php - Access to a server process after start command -

i want create php server. made command start server asynchronously. place order stop server. can not process after running start command. run command $server = new server(); $pid = pcntl_fork(); if ($pid > 0) { echo "server runned"; return; } $server->run(); server class class server { private $_loop; private $_socket; public function __construct() { $this->_loop = factory::create(); $this->_socket = new reactserver($this->_loop ); $this->_socket->on( 'connection',function ($conn) { echo "connection"; } ); } public static function stop () { $this->_loop-> stop(); } public function run () { $this->_loop->run(); } } thanks ! i have solved problems. when launch server, create file in tmp directory of system. in loop, tcheck if file present. if removed, stop loop. so, stop s

android - RadioGroup retrieve is null -

i try retrieve radiogroup check radio button checked. this, use code in oncreate() : /** * @param savedinstancestate */ @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); radiogroup_langue = (radiogroup) findviewbyid(r.id.radiogroup_langue); radiogroup_mode = (radiogroup) findviewbyid(r.id.rgroup_modeconnexion); ... } but use debug, , androidstudio tell me radiogroup_langue null. nullpointer exception . in alertdialog, when user click on ok button : .setnegativebutton("ok", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { // if button clicked, close // dialog box , nothing radiogroup_langue.setoncheckedchangelistener(new radiogroup.oncheckedchangelistener() { public void oncheckedchanged(radiogroup radiogroup_langue, int checkedid) {

php - fc-time not showing 'am' or 'pm' fully in events - missing final character -

my fullcalendar having trouble showing full time, inclusive of 'am' or 'pm' bit. it's cutting off final character, example, fc-time shown as: "9:45a" instead of "9:45am", or "10:24p" instead of "10.24pm". what need change shows final character fc-time items? thanks in advance. by default, fullcalendar shows timed event in format 9:45a,12a this not problem actually , check demo fullcalendar , example events:[ {title:'event1',start:new date(2016,05,02),end:new date(2016,05,04),color:'green'}, {title:'event12',start:new date(2016,05,02),end:new date(2016,05,04),color:'red'}, {title:'event13',start:new date(2016,05,02),end:new date(2016,05,04)} ]

c - Nested Stencil - OpenGL ES -

i have 2d node scene graph i'm trying 'nest' stencil clipping in. i thinking when drawing stencil, increment pixel writes 1, , keep track of current 'layer' i'm on. then when drawing, write pixel data color buffer if value of stencil @ pixel >= current layer #. this code have now. doesn't quite work. messing up? first call setupstencilformask(). draw stencil primitives. next, call setupstencilfordraw(). draw actual imagery when done layer, call disablestencil(). edit: updated solution. doesn't work individual items on same layer, otherwise fine. found great article on how pull off, although it's limited. http://cranialburnout.blogspot.com/2014/03/nesting-and-overlapping-translucent.html // glclear(gl_stenicl_bit) @ start of each draw frame static int stencillayer = 0; void setupstencilformask(void) { if (stencillayer == 0) glenable(gl_stencil_test); glcolormask(gl_false, gl_false, gl_false, gl_false); glstenci

css - Bootstrap row within nested column, responsive height -

Image
i trying have gray text fill rest of available space in column while growing/shrinking window size (the remaining 100px or so). bottom of gray text area should large image on left. i thinking there flexbox solution, nothing seems work well. maybe solution remove bs classes entire right column? , write section more css? img {width:100%} .content-text {background:gray; margin-top:15px;} <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/> <div class="container-fluid"> <div class="row"> <div class="col-md-6"> <div class="content-box"> <div class="item"> <a href="#"> <img class="content-img" src="http://c7.staticflickr.com/9/8192/8086114606_c8b71f3277_b.jpg" alt="" />

python - Count frequency of a number in a column while equals to text in another column -

this sample csv roughly looks 5 columns clipboard: year course modul q1 q2 2015 physics cs1203 4 2 2015 physics cs1203 4 3 2015 physics cs1203 3 1 2015 physics cs1203 4 4 2015 english ir0001 2 5 2015 english ir0001 1 2 2015 english ir0001 3 1 2015 english ir0001 5 3 2015 english ir0001 4 3 code: df = pd.read_clipboard() i grouped modules, want count number of 4s in module cs1203. new @ this, sorry in advance if stupid question. appreciate help. thank you i think need boolean indexing : print (df[(df.module == 'cs1203') & (df.q1 == 4)]) year course module q1 q2 0 2015 physics cs1203 4 2 1 2015 physics cs1203 4 3 3 2015 physics cs1203 4 4 print (len(df[(df.module == 'cs1203') & (df.q1 == 4)])) 3 if need count in q columns first use melt : df = pd.melt(df, id_vars=['year','course','module'], value_name='q') year course module q1 q2 0

azure subscription coadmin cannot create resources in subscription -

we (all co-admins) have been having problem not being able create resources on our azure subscriptions unless sign in account administrator, though we've been assigned co-administrator rights subscriptions. we're part of active directory such subscriptions trust assigned global admin credentials there also. when we, co-admins, sign of subscriptions in question , check properties of them, can see have administrator's rights there. any regarding appreciated. thanks, jesant

javascript - Conditional Alert in HTML Table -

this question has answer here: how number of days between 2 dates in javascript? 31 answers i have managed automatically build html table based on output erp system, , managed use css format easily. last step conditional formatting in date field. if date < make field red if it's between 4 <> 7 days make yellow else "no formatting. i have gotten far on dozens of examples site, , hoping can me basic date math reason can't head around. right date field in td:nth-child(4) , want compaire current date. <script> $(document).ready(function() { $('table td:nth-child(4)').each(function() { var d1 = $(this).text(); var d2 = new date(); if ((d1 - d2) < 4) { $(this).css('backgroundcolor', 'red'); }

how to derive a tree from freemarker ftl includes -

i have ftl including ftl b , ftl c. , ftl b , c has few more includes. there tool show graph/tree of includes? there's no such tool yet. though note #include -s evaluated on runtime, furthermore included template name can dynamic (i.e., can contain variables), , chosen templatetookupstrategy can complicate things further, it's not in general possible come inclusion tree without executing template , capturing templatecache calls.

html - Bootstrap material design input field doesn't animate -

i using material design bootstrap 3: http://fezvrasta.github.io/bootstrap-material-design/ so far, have navbar , looks "search" input field doesn't animate when click inside it. nor give me splash effect when click on dropdown menu. any idea i'm missing? <!-- fonts --> <link rel="stylesheet" href="{{ asset('assets/css/font-awesome.min.css') }}"> <!-- styles --> <link rel="stylesheet" href="{{ asset('assets/css/bootstrap.min.css') }}"> <link rel="stylesheet" href="{{ asset('assets/css/bootstrap-material-design.min.css') }}"> <link rel="stylesheet" href="{{ asset('assets/css/ripples.min.css') }}"> <body id="app-layout"> <div class="bs-component"> <div class="navbar navbar-default"> <div class="container-fluid"> <div class

android - Getting notifications with accessibilty service if device is muted? -

the problem is: accessibility service doesn't called on new notification, if device muted (i guess on android 5+). found nothing on internet. there way enable accessibility service muted devices? i need app "autoresponder whatsapp" notifications no matter phone state. this interesting tidbit you've found here. feel not intended behavior, none less think best solution use notificationmanager , setinterruptionfilter interruption_filter_all . notificationmanager mnotificationmanager = (notificationmanager) getsystemservice(context.notification_service); mnotificationmanager.setinterruptionfilter(notificationmanager.interruption_filter_all); this disable dnd mode , accessibilityservice should start receiving events again without restarting app or anything.

wordpress - Incorrect Buddypress Links -

i installed buddypress on new wordpress site. i'm having problem getting buddypress links work. site's permalinks set 'post-name' ( http://mysite.com/index.php/sample-post/ ) when click 'register' example (a buddypress link) goes http://mysite.com/register . anyone know how can change buddypress link structure? there should not index.php/ in permalinks. go permalinks admin page , remove using input. , check have .htaccess file in root of wp install. this codex article useful well.

Selecting columns in SQL Server with different font size -

select col1, col2 table_name here need set font size of col1 10 , col2 12. is possible in sql server? no, not possible directly through sql server. sql server works data, doesn't lot (and isn't meant lot) formatting display. however, mentioned in comments, there sql add-ons , tools offer functionality. without though, application requesting information database have to: make request receive results (assuming no error) loop through result set, formatting (setting size, font, color, etc...) , outputting returned values needed

r - How do I select a value based on two conditions from a data frame and then paste it into a cell in another data frame? -

i have 2 data frames. 1 has trials in 2 objects appeared. has information on how 2 objects relate (visual similarity). each row (trial) in first data frame, pull names of objects , use them specific rows in second data frame. this: trial probepic target_pic vissim 1 1 robot1 robot6 na 2 2 robot1 robot3 na 3 3 robot5 robot6 na 4 4 robot2 robot1 na 5 5 robot3 robot9 na 6 6 robot14 robot9 na rob1 rob2 sim 1 robot1 robot1 na 2 robot2 robot1 2.88 3 robot3 robot1 3.75 4 robot4 robot1 1.63 5 robot5 robot1 3.63 6 robot6 robot1 2.50 etc. want use probepic , target_pic variables select value of sim second data frame , paste vissim in first data frame. i've been playing around subset , can correct value using code: subset(vissim, rob1=="robot1" & rob2=="robot2")$sim but want use probepic , target_pic variables each row instead of "robot1" , "robot2." , a

web - How can I use a "For" loop to map multiple polygons with the leaflet within shiny in R? -

i struggling map multiple polygons in shiny app. purpose of shiny app take data pertaining disease spread in number of states , map areas of highest risk. app must able map multiple states @ click of "start!" button. (note: app large (6000+ lines in total) relevant code shown here, don't want burden ones trying me) excerpts from: server.r #the purpose of col_inputs , col_names create two-dimensional array of input parameters function. done maintain compatibility legacy code. catted_states on other hand combines states selected list. (example: c("az","fl","va") output$gm <- renderleaflet({ global_map(arg_1, arg_2, arg_3) }) global_map.r the real concerns code 'm' isn't being drawn @ after loop finishes. global_map <- function(col_names, col_inputs, catted_states) { user_para <- array(0, dim = c(16, 2)) for( in 1:length(states) { if (state_num > 10) { read.csv(loop specific file) }

android - Change NumberPicker fading edge value or change alpha of top/bottom text -

Image
is there way increase fading edge or change top/bottom text alpha of number picker? able extend numberpicker class , change alpha of number picker wheel once start scrolling alpha gets applied center text well. can see, picked hour value , alpha got applied text. want alpha top , bottom number. there way can accomplish this. ? private void updatetextattributes(string fontname) { (int = 0; < getchildcount(); i++) { view child = getchildat(i); if (child instanceof edittext) { try { field selectorwheelpaintfield = numberpicker.class.getdeclaredfield("mselectorwheelpaint"); selectorwheelpaintfield.setaccessible(true); typeface typeface = typeface.createfromasset(getcontext().getassets(), "fonts/sfuidisplay-" + fontname + ".ttf"); paint wheelpaint = ((paint) selectorwheelpaintfield.get(this)); wheelpaint.settextsize(mtextsize);

javascript - Webpack Hot Module Reload specify different path to bundle -

i'm writing single page app @ moment , using webpack. i want start using hot module replacement plugin because looks handy. i have come in problem though. seems can't specify want bundle.js file be. in index.html file, load bundle.js script following <script type="text/javascript" src="/static/assets/script/app.bundle.js"></script> once build complete, can deploy application server , everything's fine. however, when use hot module replacement plugin, app.bundle.js on root of application. following works <script type="text/javascript" src="/app.bundle.js"></script> for production configuration, without hmr, have following : // production entry: [ './src/project/scripts/entry.js' ], output: { path: path.join(__dirname, '/public/static/assets/script'), filename: 'app.bundle.js', }, and dev hmr, have following entry: [ './src/project/scripts/entry.js&#

ios - For completely programmatically created UIView/UIViewController, what should be in loadView vs viewDidLoad? -

for experimentation purposes, trying in code. i have custom root uiview / uiviewcontroller subclass pair called rootview , rootviewcontroller respectively. i have glkview / glkviewcontroller subclass pair called renderview , renderviewcontroller. both uiviewcontroller subclasses create managed views in loadview overrides. setting main rootviewcontroller/rootview simple. in appdelegate subclass, create main window , assign rootviewcontroller proeprty so... #import "appdelegate.h" #import "rootviewcontroller.h" @implementation appdelegate - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { cgrect screenbounds = [[uiscreen mainscreen] bounds]; // set window uiwindow* mainwindow = [[uiwindow alloc] initwithframe:screenbounds]; mainwindow.rootviewcontroller = [rootviewcontroller new]; self.window = mainwindow; [mainwindow makekeyandvisible

linux - Directory does not exist, but clearly does -

i working on old coldfusion 11 application company , error stumping me. there following check inside .cfm : <cffunction name="init"> <cfargument name="searchdir" required="yes" default="#replace(getdirectoryfrompath(getcurrenttemplatepath()),'/services','')#xml/"> <cfargument name="checkoutmode" required="no" default="protect"> <!--- library variables initialization ---> <cfset variables.libbasedir = arguments.searchdir> <cfset variables.libcheckoutmode = arguments.checkoutmode> <cfif not directoryexists(variables.libbasedir)> <cfthrow message="the base document directory '#variables.libbasedir#' not exist!"> </cfif> .... </cffunction> variable.libbasedir printed in error message as: /opt/app/coldfusion/coldfusion11/cfusion/wwwroot/<some-app>/xml/ but directory follow

Syntax error message starting Jupyter iPython Notebook from PyCharm -

trying ipython notebook started jetbrains pycharm console produces syntax error. have anaconda 3.4.0.0. , python 3.5 installed. i don't know if appropriate question forum , happy erase or provide more details, depending on feedback. this error message: in[3]: ipython notebook file "<ipython-input-3-c5fb5fabe56c>", line 1 ipython notebook ^ syntaxerror: invalid syntax this printed out on console when start pycharm: c:\anaconda3\python.exe "c:\program files (x86)\jetbrains\pycharm community edition 2016.1\helpers\pydev\pydevconsole.py" 49754 49755 python 3.5.1 |anaconda 4.0.0 (64-bit)| (default, feb 16 2016, 09:49:46) [msc v.1900 64 bit (amd64)] type "copyright", "credits" or "license" more information. ipython 4.1.2 -- enhanced interactive python. ? -> introduction , overview of ipython's features. %quickref -> quick reference. -> python's own system. object?

bash - Shell script: Whitespace in file names -

i have shell script processes files. problem there might white spaces in file names, did: #!/bin/sh file=`echo $file | sed -e 's/[[:space:]]/\\ /g'` cat $file so variable file file name passed in other program. may contain white spaces. used sed escape white space \ in order make command line utilities able process it. the problem doesn't work. echo $file | sed -e 's/[[:space:]]/\\ /g' works expected, when assigned file , escape char \ disappeared again. result, cat interpret more 1 arguments. wonder why behaves this? there anyway avoid it? , if there're multiple white spaces, some terrible file.txt , should replaced some\ \ \ terrible\ \ file.txt . thanks. don’t make more complicated is. cat "$file" that’s need. note quotes around variable. prevent variable being expanded , split @ whitespace. should write shell programs that. put quotes around variables, unless want shell expand them. for in $pattern; that o

sql server - Cube process incremental 1 partition vs multiple -

i have large cube processing times have become long. want change cube partitioning , processing options. understand process incremental pull new records cube. question is, there advantage of having multiple partitions , performing process incremental rather having 1 partition , performing process incremental? not expect large volume of new records each time process. the advantage of having multiple partitions can load each in parallel. if volume of new records isn't large, , processing time quick away 1 partition. the problem having multiple partitions have manage data exposed each partition. if same data processed multiple partitions, you'll duplicates in cube.

java - How can I insert data between 2 nodes? -

don't know how it, need that, rest of code ok have insert number between numbers 8 , 10 class arra{ private arraylist<integer> lista; arra(){ lista = new arraylist<integer>(); } public void cargar(int i){ lista.add(i); } public arraylist <integer> traer(){ return lista; } public void insertarinicio(int i){ lista.add(0,i); } } public class trabclase { public static void main(string[] args) { // todo code application logic here arraylist<integer> li = new arraylist<integer>(); arra obj = new arra(); int i=0; for(i=2;i<=10;i=i+2){ obj.cargar(i); } li = obj.traer(); system.out.println("lista: "); system.out.println(li); obj.cargar(14); system.out.println("lista adicionando el 14 al final "); system.out.println(li); system.out.println("lista adicionando un valor al inicio"); obj.insertarinicio(0); system.out.println(li); }

osx - Excel VBA Macro works in Windows but not on Mac -

as in title: using ms office 2013 on pc , 2011 on mac. here code: sub import_rekordow() dim tbl listobject call czyszczenie_kreatora2 set tbl = sheets("temp_1").listobjects("tabela8") tbl.databodyrange if .rows.count > 1 .offset(1, 0).resize(.rows.count - 1, .columns.count).rows.delete end if end sheets("temp_1").range("tabela8").clearcontents sheets("baza_danych").range("tabela7").copy sheets("temp_1").range("tabela8[data kontroli]").pastespecial _ paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false sheets("temp_1").listobjects("tabela8").range.autofilter field:=20, criteria1:= _ "0" application.cutcopymode = false sheets("temp_1").range("tabela8[data kontroli]").entirerow.delete sheets("temp_1").listobjects("tabela8").range

optaplanner - Putting breaks within a shift -

i solving problem close nurse rostering 1 examples. besides default shiftassignment (planning entity) -> employee(planning variable) have small assignments within shift divide shift in n equal parts. shiftassignment connected n different smallassignment planning entity instances have planning variable “skill” because part of planning must skill employee assigned smallassignment instances not having option unassigned , there must skill or break. so thing needs planned breaks can take place of m different small assignments m between 1 , number smaller n. break not fixed starting time , length that’s why needs planned. what best way deal problem? creating custom move set value of variable “skill” in m different small assignment instances special value part of valuerange . make break fixed creating n different shiftassignment instances there can break possibilities 1 each break possibility , not creating connected smallassignment instances span time break is. making break

Where do I place the 'assets' folder in Android Studio? -

i confused assets folder. doesn't come auto-created in android studio, , forums in discussed talk eclipse. how can assets directory configured in android studio? since android studio uses the new gradle-based build system , should putting assets/ inside of source sets (e.g., src/main/assets/ ). in typical android studio project, have app/ module, main/ sourceset ( app/src/main/ off of project root), , primary assets go in app/src/main/assets/ . however: if need assets specific build, such debug versus release , can create sourcesets roles (e.g,. app/src/release/assets/ ) your product flavors can have sourcesets assets (e.g., app/src/googleplay/assets/ ) your instrumentation tests can have androidtest sourceset custom assets (e.g., app/src/androidtest/assets/ ), though sure ask instrumentationregistry getcontext() , not gettargetcontext() , access assets also, quick reminder: assets read-only @ runtime. use internal storage , external storage , or t

How to use decorator in rails correctly? -

i'm newbie in using decorators , need understand how use right , doing wrong. book_decorator.rb class bookdecorator < applicationdecorator delegate_all def in_users_list?(user) if user.books.exists? true end end end views/books/index.html.slim - if book.in_users_list?(current_user) - button_text = 'i've read book' ... #depict buttons , links books_controller.rb class bookscontroller < applicationcontroller expose(:book, attributes: :book_params, finder_parameter: :id) expose_decorated(:book, decorator: bookdecorator) ... i've followed these tutorials ( https://github.com/netguru/decent_decoration https://github.com/drapergem/draper#decorating-objects ) , seems fine, when i'm on books index page, says undefined method `in_users_list?' book:0x007f6f4a0a4a18 i suppose still doesn't know should use method decorator, how fix it? can't understand i've done wrong, please find , fix problem! th

AlertDialog Title textsize , Title textColor change on android -

i want show stacktrace in dialog. here dialog: alertdialog dialog = new alertdialog.builder(this) .settitle(title) .setcancelable(false) .setmessage("occur exception, please click me") .show(); textview textview = (textview)dialog.findviewbyid(android.r.id.message); textview.settextsize(30); it's working, want change title textsize , title textcolor. tried: textview titleview = (textview)dialog.findviewbyid(android.r.id.title); titleview.settextsize(40); it did not work. perhaps, impossible change title color , text size?

math - Algorithm for ordered set of partitions -

given input set of tokens (e.g. {a,b,c}), searching algorithm gives me set of partitions respects order of input elements. other words searching possibilities put brackets around tokens without changing order. for {a,b,c} (ab)c , a(bc) , for {a,b,c,d} (ab)cd , a(bc)d , ab(cd) , (abc)d , a(bcd) , ((ab)c)d , (a(bc))d , a((bc)d) , a(b(cd)) (i hope got them all). i figure has somehow bell number , although large since considering partitions (ac)b well. i heard rumors problem might solvable derivation of cyk-algorithm although not understand how should work, since cyk designed parse cnf grammars. suppose partition @ top level, means set {a,b,c,d} have following partitions: (ab)cd a(bc)d ab(cd) (abc)d a(bcd) you can generate these 2 loops, outer loop being number of items inside brackets (from 2 number of items in set minus 1), , inner loop being number of items before opening bracket (from 0 number of items in set minus number inside brackets). in example abov

Map Bounds Undefined Javascript -

i'm new javascript in general, , i'm setting map , need bounds of map set up. thing keep getting message i'm unable getnortheast() undefined value, meaning map.getbounds() failed return map's bounds. however, documentation says: returns lat/lng bounds of current viewport. if more 1 copy of world visible, bounds range in longitude -180 180 degrees inclusive. if map not yet initialized (i.e. maptype still null), or center , zoom have not been set result null or undefined. the map's center , zoom defined, don't know wrong. map = new google.maps.map(document.getelementbyid('map'), { center: { lat: -34.397, lng: 150.644 }, zoom: 8 }); var bounds = map.getbounds(); var origne = bounds.getnortheast(); var origsw = bounds.getsouthwest();

c# - Converting TextBox number to the integer -

i'm new c# , i'm doing practice (this isn't homework) okay need convert text box text (called numbers) integer tried like: int number1; number1 = int.parse(numbers.text); then check if it's right: label1.text = number1.tostring(); messagebox.show(number1.tostring()); but integer doesn't hold anything. no message , label doesn't change. additional question: why doesn't message box doesn't show? there no if statements either switches. i have verified code, , have posted fine. i assume problem code isn't being ran. make sure method being called. if can't fix still, add new button on form. double click on button, , add code method automatically created. test clicking on button @ runtime.

python - Filter blank CharField in Django Haystack's SearchQuerySet -

i need return entries in searchqueryset charfield blank i.e. empty string. in search_indexes.py have: sometext = indexes.charfield(model_attr='sometext') i've tried filtering using usual sqs syntax: searchqueryset().filter(sometext__exact='') searchqueryset().filter(sometext__in=['', none]) neither return blank entries. first returns entries, second returns none @ all. am missing in searchindex definitions? there way can done in haystack using whoosh backend? try this, works me: from haystack.inputs import raw r = searchqueryset() r.exclude(sometext=raw('*'))

python - WTForm: Update user information without adding the blank fields? -

i trying add update profile information section website. , whenever update information deletes previous information when field left blank, , replaces none value. not want when people update profiles. this form: class editform(form): displayname = stringfield('displayname', validators=[optional(),length(min=3, max=25)], filters = [lambda x: x or none]) status = stringfield('status', validators=[optional(),length(min=1, max=64)], filters = [lambda x: x or none]) gender = stringfield('gender', validators=[optional(),length(min=3, max=25)], filters = [lambda x: x or none]) age = integerfield('age', validators=[optional(),numberrange(min=1, max=2)], filters = [lambda x: x or none]) pref = textareafield('pref', validators = [optional()], filters = [lambda x: x or none]) = textareafield('pref', validators = [optional()], filters = [lambda x: x or none]) img =stringfield('image url', validators = [optio

How to structure a Django website -

after creating reusable django apps 1 make app glue them create website? correct make each menu item , section app in django? source code of https://www.djangoproject.com/ best example of how correctly structure django websites if available. how organise project , depends on project's specific needs, yes using "main" app glue pieces common , working pattern. don't have try , make project's apps reusable - start project requires , if find out parts solve recurring problems time factor them out more generic apps. wrt/ menus have match site features not it's implementation "one app 1 menu" thing seldom makes sense. , since it's "glue" part belongs project's main app (even if delegates parts of job other apps).

javascript - drag and drop get ids of multiple image in droppable -

i'm new jquery, there no question on this, wanted submit button able ids of multiple images in droppable, can help? please me or guide me along... need ids of image dragged inside droppable , when submit button pressed.. display image inside droppable.. jsfiddle https://jsfiddle.net/xinfinityming/azvvhxvl/ javascript $(function() { $("#dragicons img").draggable({ revert: "invalid", refreshpositions: true, cursor: "move", cursorat: { top: 56, left: 56 }, drag: function(event, ui) { ui.helper.removeclass("end-draggable"); ui.helper.addclass("draggable"); }, stop: function(event, ui) { ui.helper.addclass("end-draggable"); ui.helper.removeclass("draggable"); } }); $("#briefcase-full").droppable({ greedy: true, tolerance: 'touch', drop: function(event, ui) { var id = ui.draggable.attr("id"); alert(id); if ($("#bri

javascript - How to change options of bootstrap datetimepicker after initialization? -

i using bootstrap date time picker jquery plugin eonasdan: https://eonasdan.github.io/bootstrap-datetimepicker/ i initalize so: $('#datetimepicker').datetimepicker({ format: 'mm dd yyyy', inline: true, daysofweekdisabled: [0,6] }); after initializing calendar, want able change contents of daysofweekdisabled array (an option) based on user input html form dynamically. wondering whether there possible solution this, have scoured docs , google wasn't able find adequate answer. beginner in javascript. would solution entail modifying js file of plugin or there simple javascript code can write this? , appreciated. thank all as doc mention: https://eonasdan.github.io/bootstrap-datetimepicker/functions/ all functions accessed via data attribute e.g. $('#datetimepicker').data("datetimepicker").function() so can change daysofweekdisabled using following colde: $('#datetimepicker').data(&#

clojure - How do I choose/switch Leiningen profiles with Emacs nREPL? -

i have :dev profile set in leiningen project file. defines :init , :init-ns setting repl session. if launch nrepl in emacs (m-x nrepl-jack-in) cursor on :dev keyword in project.clj, repl launches , :init , :init-ns settings used. if have cursor elsewhere, initial namespace different (a test ns, not user), , :init hasn't been evaluated. i'm guessing it's feature of sort , (i'm more inclined think it's random buggy behaviour now) can explain or point me @ docs so? also, there way change profile once repl's been launched? thanks contrary commenter @user7610 said, there no cider-jack-in-with-profile function in cider. cider pull-request #544 bit misleading in regard. if want cider load own special-snowflake profile in emacs: m-x set-variable cider-lein-parameters e.g. with-profile +my-special-snowflake repl :headless or set variable interactively (so can see it's current value before changing it): c-h, v cider-lein-parameters

javascript - Qml: Trying JS global "header" file that can be accessed/updated by each qml file in qt project but each file creates its own instance of JS library? -

first off, i've ever coded in c , qml feels both coolest , damn frustrating language. also, having written c, not entirely fluent in qml terminology please bear me. i have project main qml file has different states bring different "pages". "page" defined in separate qml file, instance of page created in main.qml , instance visible depending on state of main.qml. global variables can shared/updated between these pages because 1 page displays dependent on variables change in page (eg. button press). first page have multiple buttons different options, , second page display same formatting, information corresponds option selected. have been trying achieve using javascript library as discussed here , able maipulate , reference variable within individual files changes not seem transfer other files. suspect each file importing unique "instance" of library. how can make library function c header file in qml? some simple sample code: var.js //var.j

excel vba - fetch substring from string between two special character like ^abc^ in VBA -

i have form 2 textboxes , command button. want in vba copy part of text text1 text3 when cmd button pressed. example part of string #&!4848484848484 ^totot/euhen^ gjrlsmdkkkd in text1 copied text3 totot/euhen , there no fixed numbers or places before, somehow has predicated on ^ symbol. i.e. text3 = whatever between ^ , ^ . the easiest way use split function, add below code user form: private sub commandbutton1_click() dim atmp atmp = split(textbox1.value, "^", 3) if ubound(atmp) = 2 textbox3.value = atmp(1) end sub that code splits source text ^ character , puts parts in array. array length limited 3 elements, having indexes 0..2. sample string #&!4848484848484 ^totot/euhen^ gjrlsmdkkkd splited #&!4848484848484 , totot/euhen , gjrlsmdkkkd array. array checked if has 3 elements, means 2 ^ chars found, text capture located in 2nd element.

android - Add res/raw folder content file (video) to external SD folder -

the idea want put content/s of res/raw folder external sd folder named "myfolder". my way used uri access video file in res/raw , used fileoutputstream , not working, way possible? *i have permissions needed read , write external sd, , placed correclty in manifest. code below, thank you string extstoragedirectory = environment.getexternalstoragedirectory().tostring(); string basepath = extstoragedirectory + "/myfolder/"; uri uripath=uri.parse ("android.resource://com.example.videoplayer.videoplayer/" + r.raw.video1); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_videoplayer); file videodir= new file(basepath); if (!videodir.exists()) { videodir.mkdirs(); toast.maketext(getapplicationcontext(), "directory created!", toast.length_long) .show(); }else{ toas

php - Conversion of nested stdclassobject to a double dimensional array -

how convert double std class object i.e (stdclass object having again stdclass object in it) array? i have user type; casting converted single object object inside remained same. data: array ( [activities] => array ( ) [goals] => stdclass object ( [activeminutes] => 30 [caloriesout] => 3355 [distance] => 8.05 [steps] => 10000 ) [summary] => stdclass object ( [activescore] => -1 [activitycalories] => 1472 [caloriesbmr] => 2074 [caloriesout] => 3308 [distances] => array ( [0] => stdclass object ( [activity] => total [distance] => 8.46 ) [1] => stdclass object ( [activity] => tracker [distance] => 8.46 ) [2] => stdclass object ( [activity] => loggedactivities [distance] => 0 ) [3] => stdclass object ( [activity] => veryactive [distance] => 2.35 ) [4] => stdclass object ( [activity] => moderatelyactive [distance] => 1.63 ) [5] => stdclass object ( [

C++ OpenGL Shaders not working -

i've started learning c++ , i'm trying make program shaders draws triangle colors. this vertex shader: const glchar* vertexsource = "#version 150 core\n" "in vec4 position;" "in vec4 color;" "out vec4 color;" "out vec4 gl_position;" "void main(){" " gl_position = position;" " color = color;" "}"; and fragment shader: const glchar* fragmentsource = "#version 150 core\n" "in vec4 color;" "out vec4 gl_fragcolor" "void main(){" " gl_fragcolor = color;" "}"; i have list of values co-ords , colors respectively: float vertices[]{ -1.0f, -1.0f, 0.0f,1.0f, 1.0f,0.0f,0.0f,1.0f, 1.0f, -1.0f, 0.0f,1.0f, 0.0f,1.0f,0.0f,1.0f, 0.0f, 1.0f, 0.0f,1.0f, 0.0f,0.0f,1.0f,1.0f, }; i initialise 'vertex buffer object' , 'vertex array object' gluint vao; //initialise vertex array object glgenv

javascript - Radio button holds only one value in table? -

i have table in html form dynamically generated database.so,here used loop.now what's problem in entire table radio button holds 1 value.but want hold 1 value in each row , unable find solution.for in advance. <table class="table" id="attendancetableid" style="width: 500px;"> <% for(int i=0;i<=se.size()-1;i++) { %> <tr> <td><input type="textbox" name="studentname" value="<%=se.get(i)%>" style="background-color: #a7c5c2" readonly></td> <td><input type="radio" name="status" value="present" style="width: 15px; height: 15px;" />present <input type="radio" name="status" value="absent" style="width: 15px; height: 15px;">absent</td> </tr> <% } %> </table>