Posts

Showing posts from September, 2010

javascript - Website not working properly because of jquery not loading -

Image
this website not mine . use guest. recently stoped working , owners doesn't seem take care of it. there way fix using console or plugin ? looks there error loading jquery. you can try inject obsolete version of jquery in browser, try (in console): (function(){ $.noconflict(); // turns off namespace $ newer jq var script = document.createelement('script') script.src="https://code.jquery.com/jquery-1.6.4.min.js" document.body.appendchild(script) })()

java - Server response doesn't match the list size -

i have server developped in spring framework. when try control response browser web pasting url, seems list (response.java's field) has right size (that same of list returned method getfourmyobject() ), i've tried print in server's console size , it's not equal 1. but when response android application, doesn't recognize other myobject first. so in controller's server response's list has different size received size client. my server's code: @requestmapping("/") public class routecontroller extends restgatewaysupport { @requestmapping(value = "/",method = requestmethod.get) public string index (){ return "index"; } @requestmapping(value = "/objectize",method = requestmethod.get) public @responsebody response objectize(@requestparam(value="time", defaultvalue="-1") string time, @requestparam(value="id", defaultvalue=&quo

c# - Telegram client updates and API requests over same session -

i'm coding custom c# telegram client starting tlsharp , modified in order support layer 54. i want handle both receiving updates telegram servers , using api without opening separate session this. the problem multithreaded access socket connected telegram server. here scheme: telegramclient <------- socket_1[(session_1)] --------> telegramserver the problem in order receive updates telegram server use while(true) cycle schematized as: while(true){ data_cipher = await socket_1.receive() // listen new stuff socket_1 data_plain = decrypt(data_cipher) // decrypt processupdate(data_plain) // process update } now if want ,for example, query telegram servers list of chats in registered, have access socket_1 in order send request, , wait answer, socket_1 in listening , can't access it. one solution use vector of request processed after update has been received, idea this: list<request> pending_requests = new list<request>() // l

javascript - Toggle checkboxes on PHP table -

i have table checkbox in table header, used toggle checkboxes below it. i've add javascript function checkbox in header, far selects top checkbox (one checkbox) instead of of them. suggestions or advice on i've done wrong or research? html table header code: <thead> <tr> <th><center><input type="checkbox" value="" id="cbgroup1_master" onchange="togglecheckboxes(this,'cbgroup1')"></center></th> <th>sender</th> <th>receiver</th> <th>subject</th> <th>date</th> </tr> </thead> php table code: $table .= ' <tr> <td><center><input type="checkbox" id="cb1_1" class="cbgroup1"></center></td> <td><a href="pm_message.php?u='.$log_username.'&pmid='.$pmid.'" onclick=&qu

inheritance - C# How to add a property setter in derived class? -

i have requirement have number of classes derived single base class. base class contains lists of child classes derived same base class. all classes need able obtain specific values may obtained class -or- it's parent depending on derived class is. i looked @ using methods rather properties want make values available .net reporting component directly accesses exposed public properties in reporting engine excludes use of methods. my question 'best practices' method of implementing setter in derivedclass without having publicly available setter in baseclass public class baseclass { private baseclass _parent; public virtual decimal result { { return ((_parent != null) ? _parent.result : -1); } } } public class derivedclass : baseclass { private decimal _result; public override decimal result { { return _result; } // can't use setter here because there no set method in base class throws build error //set { _result = value;

c# - Check if an array exists in a BsonValue type -

i have bsonvalue abc , looking way check if contains array or not. structure below: "abc":[ "key1": "value1", "key2": "value2", . . "mno":{ "pqr":[ "valuefirst", "valuesecond" ] }, . . ] in c# code when try check if array pqr exists if(abc["mno"]["pqr"] != null) , keynotfoundexception. wrong on part index abc pqr or mno when doesn't exist. so, how can abc stored bsonvalue checked existence of these , overcome exception? thought of using filter . works bsondocument (please correct me if wrong). work around this?

javascript - HTML page reloads automatically -

i have html page given below: $(document).ready(function() { var showchar = 380; var ellipsestext = "..."; var moretext = "read more"; var lesstext = "read less"; var lesshtml=""; var morehtml=""; var content = $(".more").html(); if(content.length > showchar) { var lastchar = content.charat(showchar); if(lastchar == '/'){ showchar = showchar+1; } var c = content.substr(0, showchar); var h = content.substr(showchar-1, content.length - showchar); var lesshtml = c + '<span class="moreelipses">'+ellipsestext+' <a href="" class="morelink">'+moretext+'</a></span>'; var morehtml = content + '<span><a href="" class="morelink">'+lesstext+'</a></span>'; $(".more").html(lesshtml); } $(&qu

java - Elements change after logging into account in Selenium -

i facing difficulty finding elements using xpath in selenium. have payment page , field enter credit card number. when write script enter credit card number using id working. problem comes when log wallet before entering cc details. after logging wallet, there 2 id's same name. script works when use absolute xpath changes when give script else. html before before wallet <form autocomplete="off" name="creditcard-form" method="post" action="submittransaction?mid=oivsok48659529909784&order_id=parcel675442&route=" id="card" class="cc-form validated"> <input type="hidden" name="txnmode" value="cc" /> <input type="hidden" name="txn_mode" value="cc" /> <input type="hidden" name="channelid" value="web" /> <input type="hidden" name="auth_mode" value=

php - Form collection data after handleRequest() is swapping -

i have embed collection of forms symfony tutorial . works, except existing entity removal. initial data: +----+-------+ | id | value | +----+-------+ | 1 | | +----+-------+ | 2 | b | +----+-------+ | 3 | c | +----+-------+ then in collection form remove a value form. after submitting , handlerequest(), data became: +----+-------+ | id | value | +----+-------+ | 1 | b | +----+-------+ | 2 | c | +----+-------+ looks handlerequest() overriding array collection values , removing diffs. expected result should be: +----+-------+ | id | value | +----+-------+ | 2 | b | +----+-------+ | 3 | c | +----+-------+ so why happening? controller: public function indexaction(request $request, agreement $agreement) { $form = $this ->createform(costgroupscollectiontype::class, $agreement) ->add('submit', submittype::class, ['label' => 'button.save']); $form->handlerequest($request);

java - how can i call Android hide Handler(boolean b) constructor? -

android.os.handler class has hide constructor --> void handler(boolean async), i want call method reflection,but in vain... here code: class clazz = class.forname("android.os.handler"); constructor construct = clazz.getconstructor(boolean.class); //constructor construct = clazz.getdeclaredconstructor(boolean.class); construct.setaccessible(true); boolean[] ailments = new boolean[]{true}; handler handler = (handler) construct.newinstance(ailments); the error message is: java.lang.nosuchmethodexception: android.os.handler.<init>(boolean) @ java.lang.class.getconstructor0(class.java:3082) @ java.lang.class.getconstructor(class.java:1825).... i try iterate clazz.getconstructors() returns constructor array, , log paramstype, find looper,callback ... why can't log out 'boolean'? public more ...handler(boolean async) { this(null, async); } i have resolved problem importing framework.jar instead of androi

javascript - function openDialog() set width and set height Google Spreadsheets -

i need set width of dialog in google spreadsheet . so far code is: // use code google docs, forms, or new sheets. function onopen() { spreadsheetapp.getui() // or documentapp or formapp. .createmenu('cadastro') .additem('open', 'opendialog') .addtoui(); } function opendialog() { var html = htmlservice.createhtmloutputfromfile('index'); spreadsheetapp.getui() // or documentapp or formapp. .showmodaldialog(html, 'dialog title'); }`enter code here` this set height , width. function opendialog() { var html = htmlservice.createhtmloutputfromfile('index') .setheight(100) .setwidth(100); spreadsheetapp.getui() // or documentapp or formapp .showmodaldialog(html, 'dialog title') }//`enter code here` of course need add index.html file script editor like: hello, world! <input type="button" value="close" onclick="google.script.host.close()" />

asp.net - Debugger moving randomly -

my solution contains many project , debugging that. few days working fine when debug moving randomly, means when press f10 not going next line random line. i not using multithreading. i tried cleaning solution. tried re-starting vs. tried re-starting computer. ensured application not running optimized code. tried checking/unchecking "skip on property/operator" checkbox under tools > debugging. confirm current project (one being debugged using configuration: active(debug) , platform: active(any cpu)) ensured 1 instance of application running. now reason?

PHP OOP - private variable accessible from outside class with var_dump? -

i have class user variable: private $upass; i noticed when creating instance of user , run var_dump on instance lists private variables? there way turn off? class user { private $uid; private $uname; private $upass; private $upowers; $teammembers[$count] = new user(); foreach ($teammembers $teammember) { var_dump($teammember); } and output shows everything, including passwords ... ofcourse they're encrypted, still don't want them accessible this!? what's correct way solve this? it's doing says does: all public, private , protected properties of objects returned in output unless object implements __debuginfo() method (implemented in php 5.6.0). so can implement custom __debuginfo method, or alternatively, stop worrying it. security risk if has access source code, or serialized copy of object, both of signs of wider security issue.

ios - TableViewCell image is not shown -

Image
i using xcode 8.0 , swift 3 development environment. designing storyboard below, don't know why image in tableviewcell shown on runtime not on storyboard. does have clue? looks bug. try changing device 6s plus or else in view as: option in storyboard. might trick.

ios - Swift deleting text files: Are these files actually deleted? -

Image
i use following code delete file documents store: class func removefile(_ itemname:string, fileextension: string) { let filemanager = filemanager.default let nsdocumentdirectory = filemanager.searchpathdirectory.documentdirectory let nsuserdomainmask = filemanager.searchpathdomainmask.userdomainmask let paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, true) guard let dirpath = paths.first else { return } let filepath = "\(dirpath)/\(itemname)" { try filemanager.removeitem(atpath: filepath) print("remove done") } catch let error nserror { print(error.debugdescription) } } everything works fine, file removed document directory(i downloaded , checked container), the problem occurs when checking app settings on device, see app size not shrinking when delete these txt files(they quite big, 4,5 mb each, 11.7 mb in documents in data comes them) my questio

clojure - get combinations of vector elements -

i wander if there reducer in clojure can give same result below function without using recursion the function should take vector , returns combinations of items (e.g. giving [1 2 3] , returns ((1 2 3) (1 2) (1 3) (1) (2 3) (2) (3) [])) (def combinations "creates combinations of items example [1 2 3] generate ((1 2 3) (1 2) (1 3) (1) (2 3) (2) (3) [])" (memoize (fn[items] (if (empty? items) [[]] (let [els (combinations (rest items))] (concat (map #(cons (first items) %)els) els)))))) an alternative approach use clojure math lib. for leiningen project.clj add this- [org.clojure/math.combinatorics "0.1.3"] to use- (ns example.core (:require [clojure.math.combinatorics :as c])) (c/subsets [1 2 3]) ;;=> (() (1) (2) (3) (1 2) (1 3) (2 3) (1 2 3)) you can see source code here recursion-less solution if don't want lib.

mobile - How to identify device uniquely? -

firstly , know duplicates. we're not talking ios/android/kindofdevice-only, others & cookies not way want go. so want bypass need of password or "binding" my service (which idea now) device used. e-mail , stuff needed of course, keep devices bundled. what approaches be? my thoughts far my first idea using mac-adress, because heard they're unique. quick google told me that's not true. on phones use phone number or imei, don't want restricted phones, should usable web, too. i guess when talk web-solution, stuff more tricky because browsers won't let service go deep system , stuff? of course guess there needs combination of 2 or more things. 2 not-so-unique things combine 99%-unique-thing? i need how go on problem, direction, because if google terms "unique device identification" medicine-thing.. in project use var secureudid = (uidevice.current.identifierforvendor?.uuidstring)! which - returns string created uui

OBIEE 12C changing default font size -

i'm on project using obiee 12c , customer wants change default font size, don't know how this. we've found link: https://biskills.wordpress.com/2013/04/27/increasing-the-font-size-of-the-dashboard-pagetab-in-obiee/ have multiple items of file talking about. solution this? what need deploy custom skin, can customise. authoritative instruction in application documentation, under customizing oracle bi web user interface . the approach in page have linked of changing skins in-place not recommended future patches may overwrite changes – 12c moving ear based skins. off top of head location of files doesn't right either, may wrong.

jquery - Multiple Bootstrap datepickers in one page -

i have little problem boostrap datepickers. $('#date1,#date2,#date3,#date4,#date5,#date6').datetimepicker({ language: 'es', weekstart: 1, todaybtn: 1, autoclose: 1, todayhighlight: 1, startview: 2, minview: 2, forceparse: 0 }); the problem date2 date6 created jquery when users clicks buttom , datetimepicker not working, date1.how can solve this? thanks adding answer clarify class comment. use class on newly added elements, create datepicker attaching body or document such as: <div class='input-group date datepicker-me-class' id='date2'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> now attach document: $(document).on('focus', ".datepicker-me-class", function() { $(this).datepic

php - Running composer locally vs from VM -

i wondering pros , cons regarding different ways in can run composer tool. i used running composer directly vagrant vm, great because don't need install php , composer locally. benefit see in approach don't have worry different php versions between local machine , vm. that's important because packages can define requirement on php version, have acceptable version inside vm, older version on machine, stop me installing package. the benefit in having composer installed locally, can find, when don't use separate development environment , want fast access composer. main reason why asking question, because noticed people regularly using local composer installation in combination vagrant machine, don't find acceptable reasons mentioned above. so, thoughts on ? i prefer docker on vm , i've prepared lightweight docker image containing php7-cli , few extensions, additionally phpunit, , composer , use automation of building php based projects. here chun

ios - Swift : Programatically Create a UIButton with Some Specific Font And Size -

i want create basic uibutton programmatically. example, in view controller 5 uibutton s created dynamically in same row , layout or properties set color, font, , size. and need add action method specific button. if wanted programmatically, might think along following lines: create buttons in for... loop in viewdidload() (or elsewhere, depending on requirements): let buttonwidth : cgfloat = self.view.frame.width / 10 let buttonheight : cgfloat = 50 count in 0..<10 { let newbutton = uibutton(frame: cgrect(origin: cgpoint(x: cgfloat(count) * buttonwidth, y: 50), size: cgsize(width: buttonwidth, height: buttonheight))) newbutton.backgroundcolor = uicolor.red newbutton.settitle("button #\(count)", for: uicontrolstate.normal) newbutton.settitlecolor(uicolor.white, for: uicontrolstate.normal) newbutton.addtarget(self, action: #selector(self.buttontapped(sender:)), for: uicontrolevents.touchupinside)

mysql - Sequelize join multiples fields - multiples tables -

can convert query below sequelize? set simple example illustrate idea, compare same table more 1 table. tablec.field_4 = tableb.field_4 , tablec.field_1 = tablea.field_1 , ( tablea.field_8 = 1 or tablec.field_4 not null ) var tablea = sequelize.define('tablea', field_1 : { type : sequelize.bigint, primarykey : true, autoincrement : true }, field_2 : { type : sequelize.bigint, }, field_3 : { type : sequelize.bigint(4), references : { model : 'tabled', key : 'field_3' } }, field_8 : { type : sequelize.boolean, allownull : false, defaultvalue : true }, { tablename : 'tablea' } ); var tableb = sequelize.define('tableb', { field_4 : { type : sequelize.bigint(4), primarykey : true, autoincrement : true }, field_3 : { type : sequelize.bigint(4), references : { model : 'tabled', key : 'field_3' }, allownul

scikit learn - python logistic regression - patsy design matrix and categorical data -

quite new python , machine learning. i trying build logistic regression model. have worked in r gain lambda , used cross-validation find best model , moving python. here have created design matrix , made sparse. ran logistic regression. seems working. my question is, since have stated term item_number category how know has become dummy variable? , how know coefficient goes each category name? from patsy import dmatrices sklearn.linear_model import logisticregression sklearn import preprocessing def train_model (data, frm, rlambda): y, x = dmatrices(frm , data, return_type="matrix") y = np.ravel(y) scaler = sklearn.preprocessing.maxabsscaler(copy=false) x_trans = scaler.fit_transform(x) model = logisticregression(penalty ='l2', c=1/rlambda) model = model.fit(x_trans, y) frm = 'purchase ~ price + c(item_number)' rlambda = 0.01 model, train_score = train_model(data1,frm,rlambda) first fix error code , answer ques

Most reliable way to do ~200 ms work in Android onStop -

i see frequent posts stating file writing should done in background thread, when app shutting down ( onstop ) -- if work critical app. i'm puzzled this. surely onstop 1 ui call android should , perhaps must , lenient in giving app time complete critical work. i concerned performing critical work on background thread, not inform os the work critical , , needs completed. there several related aspects this: ----- bothering me; reason wrote question ----- is reliable critical work on background thread, after allowing onstop return? doesn't return of onstop signal android app has finished critical, , app function correctly when resumed even if android kills it ? (in other words, seems me advice [to critical work in background thread] wrong. i'm trying find evidence 1 way or other. why wrote question.) ----- existence of evidence favors background approach? ----- evidence if follow advice, , work in background thread, android takes existence of

gradle - Android - The package conflicts with an existing package by the same name -

i´ve default config on gradle. defaultconfig { applicationid "com.my.application" minsdkversion 16 targetsdkversion 22 versioncode 190011 versionname "2.2.1" } and flavors productflavors { dev { applicationidsuffix ".dev" versioncode 333333 buildconfigfield "string", "anvil_base_url", "debug_url" resvalue "string", "app_name", "app name dev" signingconfig signingconfigs.releasesign } prod { buildconfigfield "string", "anvil_base_url", "prod_url" resvalue "string", "app_name", "app name" signingconfig signingconfigs.releasesign } } i´ve got app released on play store default application id "com.my.application" when i´ve play store version installed , want install "dev" flavored application pop message says thi

python - How do I run two processes in Procfile? -

i have flask app have embedded bokeh server graph , not being able have them both working on heroku. trying deploy on heorku , can either start bokeh app or flask app procfile, not both @ same time. consequently, either content served flask show, or bokeh graph. when deploy following line in procfile, bokeh content shows on webpage, not nothing flask: web: bokeh serve --port=$port --host=bokehapp.herokuapp.com --host=* --address=0.0.0.0 --use-xheaders bokeh_script.py if deploy following, flask content, not bokeh graph: web: gunicorn app:app in second case, starting bokeh inside app.py flask script using subprocess: bokeh_process = subprocess.popen( ['bokeh', 'serve','--allow-websocket-origin=bokehapp.herokuapp.com','--log-level=debug','standard_way_with_curdoc.py'], stdout=subprocess.pipe) the heroku logs don't show errors. i tried third alternative: web: bokeh serve --port=$port --host=bokehapp.herokuapp.com --host=

python - Upload CSV file in django admin list view, replacing add object button -

i want replace add object button in listview of admin page. underlying idea administrator can download data on models in db, use tool edit data, , reupload csv file. in list view struggling override form, setting class somemodelform(forms.form): csv_file = forms.filefield(required=false, label="please select file") class meta: model = mymodel fields = '__all__' class somemodel(admin.modeladmin): change_list_template = 'admin/my_app/somemodel/change_list.html' form = somemodelform other stuff the admin change_list.html overridden follows: {% extends "admin/change_list.html" %} {% load i18n admin_urls admin_static admin_list %} {% block object-tools-items %} <form action="{% url 'admin:custom_submit_row' %}" method="post" enctype="multipart/form-data"> {% csrf_token %} <p> {{ form.as_p }} </p> <p><in

java - Entry cannot be cast to javax.xml.bind.JAXBElement -

i keep getting jaxb cast error. i'm not sure correct @ point. the unmarshalling: try{ client client = client.create(); client.addfilter(new httpbasicauthfilter(api_key, "")); webresource webresource = client.resource("https://url.entries.xml"); webresource.setproperty("", api_key); clientresponse response = webresource.accept("application/xml").get(clientresponse.class); if(response.getstatus() != 200){ throw new runtimeexception("failed : http error code : " + response.getstatus()); } string output = response.getentity(string.class); system.out.println("\n============getftocresponse============"); system.out.println(output); jaxbcontext jaxbcontext = jaxbcontext.newinstance(entries.class); unmarshaller unmarshaller = jaxbcontext.createunmarshaller(); entries itsentries = (entries)((jaxbelement

angular - Protractor @types throwing a lot of errors -

i using angular2 webpack starter angularclass , have started running errors protractor , im not sure coming from. when try build errors: module 'webdriver' has no exported member 'ibutton' , module 'webdriver' has no exported member 'ikey' , module 'webdriver' has no exported member 'locator' (about 30 times), , same message members ierrorcode , itype , ilevelvalues , ilevel , , few other members. i errors: property 'error' not exist on type 'typeof error' and property 'stacktrace' not exist on type 'typeof webdriver' just whole list of errors , im not sure why popping or coming from. has ran or know how solve this? thanks! had same error, change version of webdriver 2.44.28 . "@types/selenium-webdriver": "2.44.28", , npm install or npm --save-dev @types/selenium-webdriver@2.44.28

use function in stored procedure in mysql -

i have created stored procedure in mysql: create definer=`root`@`localhost` procedure `get_publicationsbydate`(in _dates date, in _datef date) begin select concat(extract(year filed_date), " q", extract(quarter filed_date)) date, count(concat(extract(year filed_date), " q", extract(quarter filed_date))) count applications filed_date between _dates , _datef group concat(extract(year filed_date), " q", extract(quarter filed_date)) order concat(extract(year filed_date), " q", extract(quarter filed_date)); end i want replace long code concat(extract(year filed_date), " q", extract(quarter filed_date)) of function call (еxample in pseudo c ++ convenience): char* func(char* date) { return concat(extract(year date), " q", extract(quarter date)) } because these long expressions may vary depending on external parameter (pseudo code): declare f fu

javafx - How to create runnable jar with images and sounds in Eclipse? -

Image
i'm trying create jar in eclipse. project contains images , sounds. have resources folder more folders, when run jar without images. the project structure: example: btserver.setgraphic(new imageview(new image("file:resources/buttonimages/server.png",100,100,false,false))); make sure when exporting runnable jar file, selecting 'extracting required libraries generated jar'. the other workaround put resources folder workspace in same file location jar file. hope helps

postgresql - How to query the data in a join table by two sets of joined records? -

i've got 3 tables: users , courses , , grades , latter of joins users , courses metadata user 's score course . i've created sqlfiddle , though site doesn't appear working @ moment. schema looks this: create table users( id int, name varchar, primary key (id) ); insert users values (1, 'beth'), (2, 'alice'), (3, 'charles'), (4, 'dave'); create table courses( id int, title varchar, primary key (id) ); insert courses values (1, 'biology'), (2, 'algebra'), (3, 'chemistry'), (4, 'data science'); create table grades( id int, user_id int, course_id int, score int, primary key (id) ); insert grades values (1, 2, 2, 89), (2, 2, 1, 92), (3, 1, 1, 93), (4, 1, 3, 88); i'd know how (if possible) construct query specifies users.id values (1, 2, 3) , courses.id values (1, 2, 3) , returns users' grades.score values courses | name | algebra | biolog

node.js - Sox cannot determine type of file -

i'm using node js , express sox node bindings. have temporary uploaded file need identify, since file not have extension, sox gives me error: sox.identify(file, function(err, info) { if (err) { console.log(err) throw(err) } }); sox fail formats: can't determine type of file c:\users\user\documents\project\media\temp\riqdeq15151sf14fwa i'm using multer saving uploaded file temporarily. there anyway have sox identify file though doesn't have extension? sox file type not determined extension of file. review file check whether having appropriate format or whether file downloaded correctly. review page developers on sox format support - http://sox.sourceforge.net/soxformat.html

apache spark - Does Kryo Automatically Register Classes Used in Fields? -

using spark, decided use kryo since recommended de/serializer. say have: public class1 { private class2 field1; } do need register both class1 & class2 or registering class1 automatically register class2? i tested this, , in fact class2 need registered.

regex - How to match foreign wods in BBEdit -

i've been researching way find , replace foreign words in bbedit i'm having issue it. after research ran across regex - regex matching foreign characters? led me regular-expressions.info , text block indicated: matching single grapheme, whether it's encoded single code point, or multiple code points using combining marks, easy in perl, pcre, php, ruby 2.0, , great software applications: use \x. and when have word (yes made testing) ōallaōallaēēalla cannot use [a-za-z]* entire word instead works in segments , solution i've been able come ([a-za-z]*\x{1,10}) . there alternative approach wouldn't greedy , pull entire word instead of pulling in segments? you use word boundary \b match between boundaries. might not everything, contrived example works. /\b(.+)\b/ if want words @ beginning of line, need include those. /(?:\b|^)(.+)\b/ try @ regex101.com . cannot test if works in bbedit though.

Microfacets Theory: A CDF for normal distribution given incident direction -

Image
the paper microfacet models refraction through rough surfaces , page 3 section 3.1, describes ndf. the problem: given incident ray v i'd generate cdf f given angle θ gives probability normals distributed @ or less θ v , i.e. dot(v,m)<=cos(θ) w.p. f(θ) . for v = n n macrosurface normal simple (assuming isotropic ndf): which easy compute common ggx or beckmann ndfs. the paper gives formula harder integrate , still not useful. any appreciated.

Stupid Android Layout Tricks -

android layouts have changed bit since i've been away topic , never had deep before, forgive hope relatively simple question. say developing card game human player , 3 computer or remote opponents (not quite accurate, close enough purposes). plan there 4 children layouts representing each of player's "hands". ones on left , right display images in top down order. ones on top , bottom display images in left-to right order. it's reasonable assume left , right layouts have identical (gravity, right?) behavior (if different start , end pixels). same goes top , bottom. if matters, usage restricted landscape mode. what correct method of getting said childlayouts correct locations? what's correct top level layout(s) use this? should player's children layouts be? (i have assumed gridlayouts, seemsa host of others might work -- nothing hold number of dynamically generated imageviews) once i've got layouts in right location, i'm good...i think.

user interface - writing a gui application that acts a cash register in Qt -

please me answer following question: write gui acts cash register. in other words, client brings basket of items, bar-codes scanned, , total calculated. main window should have menu bar 2 menus: "sale" , "item". sale menu should have following options: "new", "cancel", "finalise" , "exit". item menu should have following options: "add" , "remove". main window should have toolbar (at bottom of window) toolbar button each of these options. when program starts, "cancel", "finalise", "add" , "remove" options should displayed (on menus , toolbar). i using qt. supposed code gui manually. not supposed use qt designer create user interface. have read relevant material not know how start tackling question. this doesn't sound bad, know can it. what want start out main function looking this... #include <qapplication> #include <qpushbutton>