Posts

Showing posts from September, 2012

c++ - Access "this" pointer of concrete class from interface -

after writing test, determined this pointer in interface not equal this pointer of concrete class, meaning can't use c-style cast on it. class abstractbase {...}; class aninterface { public: aninterface() {...} // need abstractbase * here ~virtual aninterface() {...} // , here }; class concrete : public abstractbase, public aninterface {}; my interface needs base class pointer concrete class inheriting in constructor , destructor in order handle interface related registration , deregistration. every concrete object inherits interface needs inherit abstract base class first, first in layout. for constructor not hard, can add pointer in interface constructor , pass this concrete class. destructor doesn't have parameters, in dark there. the solutions came far come overhead: 1 - store pointer in interface used in destructor - adds in 1 pointer worth of memory overhead class aninterface { public: aninterface(abstractbase * ap) {...} ~virtual a...

c# - WPF Textbox Binding Is Not Updating When Setting Value -

i have small program test out textbox databinding , works when change value in textbox itself, when try change value code-behind, variable updated textbox not updated. have looked around have not been able find solution, have seen textbox updating variable, opposite of need. here code: xaml: <grid> <textbox text="{binding firstname, mode=twoway, updatesourcetrigger=propertychanged}" horizontalalignment="left" height="23" margin="127,37,0,0" textwrapping="wrap" verticalalignment="top" width="120"/> <textbox text="{binding lastname, mode=twoway, updatesourcetrigger=propertychanged}" horizontalalignment="left" height="23" margin="127,88,0,0" textwrapping="wrap" verticalalignment="top" width="120"/> <textblock horizontalalignment="left" margin="28,40,0,0" textwrapping="wrap" text=...

assembly - Do FMA (fused multiply-add) instructions always produce the same result as a mul then add instruction? -

i have assembly (at&t syntax): mulsd %xmm0, %xmm1 addsd %xmm1, %xmm2 i want replace with: vfmadd231sd %xmm0, %xmm1, %xmm2 will transformation leave equivalent state in involved registers , flags? or result floats differ in someway? (if differ, why that?) (about fma instructions: http://en.wikipedia.org/wiki/fma_instruction_set ) no. in fact, major part of benefit of fused multiply-add not (necessarily) produce same result separate multiply , add. as (somewhat contrived) example, suppose have: double = 1 + 0x1.0p-52 // 1 + 2**-52 double b = 1 - 0x1.0p-52 // 1 - 2**-52 and want compute a*b - 1 . "mathematically exact" value of a*b - 1 is: (1 + 2**-52)(1 - 2**-52) - 1 = 1 + 2**-52 - 2**52 - 2**-104 - 1 = -2**-104 but if first compute a*b using multiplication rounds 1.0, subsequent subtraction of 1.0 produces result of zero. if use fma(a,b,-1) instead, eliminate intermediate rounding of product, allows "real" answer, -1.0p...

python - sklearn: Turning off warnings -

when i'm fitting sklearn 's logisticregression using 1 column python pandas dataframe (not series object), warning: /library/python/2.7/site-packages/sklearn/preprocessing/label.py:125: dataconversionwarning: column-vector y passed when 1d array expected. please change shape of y (n_samples, ), example using ravel(). y = column_or_1d(y, warn=true) i know advert warning in code, how can turn off these warnings? as posted here , with warnings.catch_warnings(): warnings.simplefilter("ignore") # stuff here thanks andreas above posting link.

haskell mod plugin for emacs - REPL not work -

i have installed emacs , haskell-mod, load file emacs star repl c-c c-l, appear prompter(that lambda), when type example 1+2 , hit enter nothing happen. should use other key or why didn't work ? thanks, sorin emacs' shell buffer doesn't along unicode (lambda) prompt. can manually set prompt :set prompt "ghci> " . to automatically run set prompt command when shell starts up, edit .ghci file include above set command.

python - How to alter Fields in Django and Oscar -

i making web application django-oscar, , make user field required in partner model. my first approach override "user" field in partner model, read cannot override fields in django . so, how 1 alter field in oscar if can't override it? thanks! the docs aren't clear, fortunately kind of model overriding well-supported in oscar way it's been engineered. but instead of sub-classing oscar.apps.partner.partner model , overriding field need make own myproject.partner app. the key thing note models in oscar implemented abstract models. oscar checks see if you've overridden of framework apps, if not oscar define concrete model abstract ones. if have overridden framework app though first try load concrete model, fallback it's own models haven't touched. see docs here: https://django-oscar.readthedocs.org/en/releases-1.0/topics/customisation.html#fork-the-oscar-app first run this: $ ./manage.py oscar_fork_app partner myproject/ ...

express - Sails 0.10.5 compress middleware and serving gzipped assets -

in sails 0.10.5 express compression supposed in middleware production mode default according issues on github, none of response headers have appropriate content-encoding suggest have been gzipped. furthermore, sizes of assets match uncompressed assets. after searching other issues related this, found this question theoretically opposite of problem: had gzipped files in place , needed middleware , have middleware (supposedly default) no files. problem (apparently) solved adding middleware config, required compression before 0.10.5. so, npm installed grunt-contrib-compress , set config file. now, have gzipped files being produced successfully, they're not being served. tried manually requesting gzipped version of asset injecting in sails-linker instead of regular js, content-type on response header 'application/octect-stream'. has served gzipped static assets sails app? doing incorrectly? outline of general process appreciated.

google chrome - javascript indexOf with millions of matches -

i'm trying extract few lines representing xml elements file. user provides file using simple <input type="file"> tag, , file read text filereader , , given parameter function: var relevantdelimiters = [{"begin":"<header>","end":"</header>"} ,{"begin":" <someelement>","end":"</someelement>"}]; function dealwithstring(invalidxml) { var validxml = ""; (var i=0; i<relevantdelimiters.length; i++) { delimiter = relevantdelimiters[i]; while (invalidxml.indexof(delimiter.begin) != -1) { //while there relevant elements of kind left: startpos = invalidxml.indexof(delimiter.begin); endpos = invalidxml.indexof(delimiter.end); //append end result: validxml+=invalidxml.substring(startpos,endpos+delimiter.end.length)+"\n"; //take item out of input process next item invalidxml = invalidxml.repl...

android - How to implement universal-image-loader in separate thread? -

in project universal image loader used displaying gridview,viewpager.while need integrate offline mode app, need download , store images on disc in separate thread , when displaying gridview ,viewpager images should load disc. how implement universal-image-loader in separate thread? have tried after time activity exits it's thread , loading universal imageloader exceeds app cache,i mean somethings goes wrong. have seen different discussions need download via uil in separate thread. @override public void run() { int x = 0; while (x < 1) { try { thread.sleep(1500); } catch (interruptedexception e) { e.printstacktrace(); } processbitmaps(); } } public void processbitmaps() { fulls = application.getonthisdevicefulls(); if (fulls != null && fulls.size() > 0) { (int index = 0; index < fulls.size(); index++) { full full= fulls.get(index).getfull(); arrayli...

How to order a set of objects based on association attributes in Ruby on Rails? -

in ruby on rails application, have model has number of one-to-one associations other models. let's each instance belongs region , country , , city . have selected couple of instance using scope , want order them based on name attributes of region , country , , city models not part of instance model itself. the thing want show selected instances on index action of activeadmin page region , country , , city , , accordingly, want have them sorted in order. it's straightforward order collection attributes on 1 or more associations—join on associations , order attributes. verbose way this: instance.joins(:region, :country, :city). order("regions.name desc"). order("countries.name desc"). order("cities.name desc") but recommend writing these conditions scopes on models. can change , reuse them more easily. class instance < activerecord::base scope :ordered, -> joins(:region, :country, :city). merge(region...

xcode - POSIX file works in tell block -

the following works in script editor (or applescript app), not in xcode: tell application "finder" set folder_list items of folder posix file "/users" specifically, @ runtime: finder got error: can’t make «class ocid» id «data optr000000002094230000600000» type integer. (error -1700) if try "double coercion": ...((folder posix file "/users") posix file) i get: can’t make «class cfol» «script» of application "finder" type posix file. (error -1700) i did see similar discussed here, solution did not work me: "posix file" works in applescript editor, not in xcode thanks! //reid p.s. know use "macintosh hd:users"... works, unless renamed hard drive. applescript has "path to" command find paths known folders, user's home folder, desktop, documents folder etc. that's best way access folders. can see locations applescript knows in standard additions applescript dicti...

Read file to one string and separate it in perl -

so have file looks like: name, surname, number name2, surname2, number2 name3, surname3, number3 i want read 1 string in perl, , want like: "name, surname, number, name2, surname2, number2, name3, surname3, number3" but don't have idea how :/ i'm new in perl. know only, open file need do: open($list, "<", $file) my $list = { use autodie; open $fh, '<', $file; chomp(my @lines = <$fh>); join ', ', @lines; };

xcode - IOS Swift defining own app-settings in own class -

im new in swift , x-code. im searching way import own defined class (best case in own document). want store needed settings (text-snippets , app-settings) in file. example: class snippetsandsettings { // e.g translations let t_welcome: string = "welcome app" let t_share: string = "social share buttons" let t_rate: string = "rate" // e.g settings let s_weburl: string = "http://www.mypage.com/webservice.php" let s_slider: bool = false let s_bgcolor: string = "#ff9900" let s_tcolor: string = "#222222" let t_shadow: string? // bool or colorstring! } i want use class on every app-page. can not import for example in viewcontroller.swift my questions: in format have save file (snippetsandsettings)? cocoa class how can import file in viewcontroller.swift is common way store own app-settings in swift? the method store settings via nsuserdefaults ...

c++ - dicom3tools compiles with missing application pbmtoovl -

i've downloaded dicom3tools in ubuntu apt-get install dicom3tools, apps not present. i've downloaded source , compiled according directions on ubuntu without errors. have access of apps in kit, seem missing or not compiling. need working binary copy of pbmtoovl tool kit. can me? know why missing? need compile differently? have copy of pbmtoovl app pre-compiled? there no info on anywhere on web, have else turn. in advance info on this. please please me this..... edited proper file uid. ran imake -i./config -dinstallintopdir -dusemyid , looked fine. make world. make install make install.man, still no rawtodc or pbmtoovl or of dicom creation tools. need these tools. please let me know i'm doing wrong. on ubuntu 14 – i author of dicom3tools debian package. explanation given online here . when install debian package, required read documentation. in case documentation available on system from: $ cat /usr/share/doc/dicom3tools/readme.debian so y...

magento - Search results not showing in dashboard -

when customers search in searchbox (which uses form.mini.phtml), there results won't show in dashboard (magento 1.7). here code: <?php $catalogsearchhelper = $this->helper('catalogsearch'); ?> <div class="search-form"> <form id="search_mini_form" action="<?php echo $this->geturl('search/result') ?>" method="get"> <input id="search" type="text" name="query" value="" maxlength="<?php echo $catalogsearchhelper->getmaxquerylength();?>" /> <button><?php echo $this->__('search') ?></button> </form> <script type="text/javascript"> var searchform = new varien.searchform('search_mini_form', 'search', '<?php echo $this->__('search products , pages...') ?>'); </script> </div> <a href=...

qt - How to make a resizable rectangle in QML? -

Image
i'm looking simple way create rectangle in qquickitem . want resize, , drag borders of rectangle (found @ resizable qrubberband ) has idea? there several ways achieve desired result. since i've considered implementation of similar component cropping tool software of mine, i'm going share toy example uses part of code. differently rubber band in example, rectangle resizable on single axis @ time. i'm confident can build on , customise code meet needs. the basic idea of code exploit drag property of mousearea . can used move around rectangle and, combined mousex , mousey properties, resize it. dragging active inside rectangle whereas resizing active on knobs set on sides of rectangle (no mouse cursor change set sake of brevity). import qtquick 2.4 import qtquick.controls 1.3 applicationwindow { title: qstr("test crop") width: 640 height: 480 visible: true property var selection: undefined image { ...

Access 2007 Filter a Calculated IF Statement Field -

i have query has calculated field: montheligible: iif([5yranniv]>=dateserial(year(date()),month(date())+1,1),[5yranniv],iif([5yranniv]<=dateserial(year(date()),month(date())+1,1),dateserial(year(date()),month(date())+1,1),"")) and have field that's calculate based on this: eligible?: iif(datepart("m",[montheligible])=(datepart("m",date())+1),"yes","no") basically, first 1 calculates month in eligible, , second 1 says "yes" if month next month, or "no" if isn't. from there, want filter second field show yes records. when put "yes" in criteria , click view, access prompts me put in value [montheligible] . how not this? want use existing [montheligible] field works when there's no criteria. you logic makes little sense. after, this: montheligible: iif([5yranniv]>dateserial(year(date()),month(date())+1,1),[5yranniv],dateserial(year(date()),month(date())+1,1)) e...

Excel - Delete rows if formula returns "" -

the forumla i'm using is =if(e7<30,e7,"") edit:more specifically: =if(e7<30,concatenate(a7,b7,c7,"-",text(d7,"hh:mm:ss"),"-",e7),"") this leaves me lot of blank rows out of 288000 of them. able see cells have returned value together. rather having scroll through of them. i've tried using find , replace method, of course cells still contain formula, not actual return value displays. sample. 15 mar 2015 00:23:00 100.024 15 mar 2015 00:24:00 90.033 15 mar 2015 00:25:00 80.142 15 mar 2015 00:26:00 70.577 15 mar 2015 00:27:00 61.508 15 mar 2015 00:28:00 53.056 15 mar 2015 00:29:00 45.312 15 mar 2015 00:30:00 38.368 15 mar 2015 00:31:00 32.347 15 mar 2015 00:32:00 27.443 15mar2015-00:32:00-27.443 15 mar 2015 00:33:00 23.934 15ma...

Is this Google Maps API JavaScript really that bad? -

this code google maps api; works fine, says has lot of errors. runs fine. i have embedded in html file , css stylesheet , works how want, displaying 700+ errors , don't know do. side note if knows how go adding multiple markers please let me know! var map; var uconn = new google.maps.latlng(41.8057, -72.2494); var my_maptype_id = 'uconn_style' function initialize() { var featureopts = [ { stylers: [ {color: 'rgba(255, 255, 255, 0.17)' }, {visibility: 'simplified' }, {weight: 0.5 }] }, { elementtype: 'labels', stylers: [ {visibility: 'on' }] }, { featuretype: 'road', elementtype: 'geometry', stylers: [ {color: '#000000'}, ...

ruby - Saving my rails object from an array of values sourced form a csv -

i'm trying update attributes via csv upload. my method looks this: def upload_csv csv.parse(params[:file].read, headers: true) |row| foo = foo.find_by_id(row.to_hash["id"]) row.to_hash.each |v| if foo.new.has_attribute?(v[0]) && v[0] != "id" foo.update_attributes() end end end end when jumps want update attributes, i'm getting array looks this: ["bar", "22"] how can save value foo object? ok, reading you're code i'm concluding problem have csv may contain fields not in model: def upload_csv excluded = %w/id created_at updated_at/ csv.new( params[:file], headers: true) |row| rh = row.to_hash foo = foo.find_by id: rh['id'] foo.update! rh.slice(*foo.attribute_names).except(*excluded) end end note i'm assuming params[:file] uploaded file form, in case it's io object, , can passed csv.new directly (no need read memory , pass...

java - maven-bundle-plugin Creates unexpected Import-Package content -

i build bundles using maven-bundle-plugin , after tests pax:provision found creating import-package=org.osgi.framework;version="[1.8,0)" on bundles , @ moment of installing bundles in felix bundles unresolved because of org.osgi.framework.bundleexception: unresolved constraint in bundle com.domain.mybundle [55]: unable resolve 55.0: missing requirement [55.0] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0))) . why maven-bundle-plugin creating header if have no direct dependency package. tried add dependency: <dependency> <groupid>org.apache.felix</groupid> <artifactid>org.apache.felix.framework</artifactid> <version>4.6.0</version> </dependency> and still uses version 1.8.0 . idea why? update checking again, bundles use org.osgi.framework in activator. class org.osgi.framework.bundleactivator comes bundle: <dependency> <groupid>...

Chrome extension dropdown not correct size -

Image
i have simple chrome extension. entirely based on sample . when click it works perfectly, drops down minimal amount. this minimal drop amount and working correctly. (when correctly, ignore fact it's totally horrendous, that's stage two) question what need ensure drops down properly? you should add <!doctype html> declaration @ beginning of popup.html file. glad helps!

dcg - how to define (sometimes) recursive prolog trees -

i've got 2 different types of sentences parse, i'll give them simples names now. basically, have 2 parse trees 1. --> , pp --> dv, np 2. --> tv, np i hope makes sense, have no idea how program in prolog without getting lots of loops! great, please let me know if can provide more information (first time using stack overflow)

css - How do you limit the number of items on show in the bootstrap btn-dropdowns -

Image
i making search bar bootstrap , 1 of elements category list. problem @ moment when press category button shows every single category in list @ same time - making ui awful! how can limit number of concurrent options on show? this example of problem: for example might want show first 5 options , have scroll bar rest? this markup used create have far: <form class="navbar-form" role="search" action="/search" method="get"> <div class="input-group"> <input type="text" class="form-control" placeholder="search event" name="q" id="q"> <div class="input-group-btn"> <div class="btn-group" role="group"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> dropdown <span class="caret"...

knockout.js - RequireJS Knockout Amd-Helper -

i'm struggling arranging code using requirejs , appreciate help. i have dashboard.html gets bound 'dashboard' viewmodel in dashboard-init.js. dashboard viewmodel has list of panels shown list in dashboard.html. after render completes, invoke gridlist function convert list dashboard. please note works correctly if include these scripts in html using script src=... etc. but when removed script tags , pushed these dependencies dashboard viewmodel, error: uncaught error: unable process binding "foreach: function (){return { data:panels,afterrender:postrender} }" message: gridlist lib required what need satisfy gridlist lib requirement? here page giving error (dashboard.html): <html> <head> <link rel="stylesheet" href="css/style.css" /> </head> <body> <div class="grid-container"> <ul id="grid" class="grid" data-bind="foreach: { data: panels,...

c# - What did I do wrong here? The only error I get is near the bottom. Use of unassigned local variable 'parts' right after "add tax" -

private decimal taxcharges() { decimal addtax; decimal parts; addtax = parts * 0.06m; taxtxtbx.text = addtax.tostring("c"); return addtax; } unassigned local variable 'parts' right after "addtax = parts the variable parts has never been assigned value. assign value before making use of variable. example: decimal parts = 0;

asynchronous - async in for loop in node.js without using async library helper classes -

this question has answer here: javascript closure inside loops – simple practical example 32 answers i beginner node.js. trying out examples 'learnyounode' tutorial. trying write program takes 3 url parameters , fetches data urls , displays returned data in order in urls provided. var http = require('http'); var bl = require('bl'); var url = []; url[0] = process.argv[2]; url[1] = process.argv[3]; url[2] = process.argv[4]; var data = []; var remaining = url.length; for(var = 0; < url.length; i++){ http.get(url[i], function (response){ response.setencoding('utf8'); response.pipe(bl(function (err, chunk){ if(err){ console.log(err); } else{ data[i] = chunk.tostring(); console.log(data[i]); remaining -= 1; ...

python - Error in the results of a list comprehension -

i have issue list comprehensions. import numpy import random diam=1.5 p=1 a=10 d=0.2 h=0.15 lx = list(numpy.arange(-diam/2,diam/2+0.05,0.05)) loop in range(50): f=random.uniform(0,p/2) l = [k k in lx if (k+(abs(f-(1/(2*p))*(k**2)))*np.tan(a)<-d/2-h/np.tan(np.pi/2-a))] + [k k in lx if (k+(abs(f-(1/(2*p))*(k**2)))*np.tan(a))>(d/2)] but when @ results, there seems errors. a=10 , last value of f , l = [-0.75, -0.69999999999999996, -0.64999999999999991, -0.59999999999999987, -0.54999999999999982, -0.49999999999999978, -0.44999999999999973, -0.39999999999999969, -0.34999999999999964, -0.2999999999999996, -0.24999999999999956, -0.19999999999999951, 0.10000000000000075, 0.1500000000000008, 0.20000000000000084, 0.25000000000000089, 0.30000000000000093, 0.35000000000000098, 0.40000000000000102, 0.45000000000000107, 0.50000000000000111, 0.55000000000000115, 0.6000000000000012, 0.65000000000000124, 0.70000000000000129, 0.75000000000000133] then if type this [k+(abs(...

Generics and Functional programming in Swift -

the 2 variants of sum function below attempt repeat lisp version introduced abelson , sussman in classic "structure , interpretation of computer programs" book in swift. first version used compute sum of integers in range, or sum of squares of integers in range, , second version used compute approximation pi/8. i not able combine versions single func handle types. there clever way use generics or other swift language feature combine variants? func sum(term: (int) -> int, a: int, next: (int) -> int, b: int) -> int { if > b { return 0 } return (term(a) + sum(term, next(a), next, b)) } func sum(term: (int) -> float, a: int, next: (int) -> int, b: int) -> float { if > b { return 0 } return (term(a) + sum(term, next(a), next, b)) } with sum({$0}, 1, {$0 + 1}, 3) 6 result sum({$0 * $0}, 3, {$0 + 1}, 4) 25 result 8.0 * sum({1.0 / float(($0 * ($0 + 2)))}, 1, {$0 + 4}, 2500) 3.14079 result ...

python - ValueError: Error parsing datetime string NumPy -

i trying convert string date date format in numpy array. using datetime64 datatype cast off seconds , receive error. code below. write numpy datatype date type database. import json import jsonpickle import requests import arcpy import numpy np #note import random import timestring fc = "c:\mylatesting.gdb\myla311copy" if arcpy.exists(fc): arcpy.delete_management(fc) f2 = open('c:\users\administrator\desktop\detailview.json', 'r') data2 = jsonpickle.encode( jsonpickle.decode(f2.read()) ) url2 = "myurl" headers2 = {'content-type': 'text/plain', 'accept': '/'} r2 = requests.post(url2, data=data2, headers=headers2) decoded2 = json.loads(r2.text) dt = np.dtype([('sraddress', 'u40'), ('latitudeshape', '<f8'), ('longitudeshape', '<f8'), ('latitude', '<f8'), ('...

php - Postgresql Update a unique column and validate before Update -

scenario: admin user insert new client on db, has 3 uniques columns, postgres id, driver license, , email, later on i'm trying allow admin user update fields when run validation of course returns false, cause exist, read question , same issue ain't running symfony or other php framework, figured try send id within query , check against id , email instance since live validation send input value. solution 1: don't allow admin user update fields , have him delete client , create new 1 (this easy getaway). solution 2? can't think on logic, how can build query validate on issue? something like: select email users.users email=$email , id != $id ??? the problem can't figured out how send id within input field... validation code: email: { trigger: 'blur', message: 'el email no es válido', validators: { remote: { message: 'ya existe un usuario con ese email', ...

c# - How to make multiple directory in asp.net mvc -

how can generate url in asp.net mvc contains more default controller, action, id. , how hyphens put in controller? default url in asp.net mvc is: {controller}/{action}/{id} how url made: stackoverflow.com/questions/28990934/two-models-in-same-view-in-asp-net-mvc or site.com/some-thing/otherthings/more-things/the-things.html you can create customized urls like, long have controller, action , n parameters example http://yourdomain.com/bla/bla/mystuff/ < controller>/< action>/< param1>/< param2>/< param3>, depends on want. maybe http://www.codeproject.com/articles/641783/customizing-routes-in-asp-net-mvc .

objective c - Apple Watch how to trigger a notification or glance from the main app -

i trigger apple watch notification , or glance views main app. i know how run them in xcode , selecting directly, need make them popup inside main app programmatically. in main app have timer today creates popup tell user something. same trigger show notification view on apple watch along dynamic text. keep simple now, suppose have button (ibaction). when button pressed in main app show glance or show notification views on watch. guessing simple havent been able make work, yet. if have sample code great! thank help! while ios automatically shows notification controller when app receives remote or local notification. but during development, can trigger notification or glance changing watch interface in watchkit app schema . ( edit schema -> (under info) change watch interface glance/static notification / dynamic notification ). however, selecting notification requires notification payload (create .apns file , set notification payload while editing sche...

php - form.post_bind is fired twice -

i added form event symfony form. problem event seems fired twice. when debugging, goes twice method , don't know why. i have form type uses form type. have videofiletype form adding field of imagetype. both of these forms need process done once form submitted. imagetype <?php # src/acme/photobundle/form/type/thumbnailtype.php namespace osc\mediabundle\form\type; use osc\mediabundle\manager\imagemanager; use symfony\component\dependencyinjection\container; use symfony\component\form\abstracttype; use symfony\component\form\extension\core\choicelist\objectchoicelist; use symfony\component\form\formbuilderinterface; use symfony\component\form\formevent; use symfony\component\form\formevents; use symfony\component\httpkernel\exception\unsupportedmediatypehttpexception; use symfony\component\optionsresolver\optionsresolverinterface; class imagetype extends abstracttype { private $imagemanager; public function __construct(imagemanager $imagemanager) { $th...

image - How to detect colors under different illumination conditions -

i have bunch of images of clothes of many colors , want detect colors of each image. have blue skirt image in daylight conditions , can correct color through rgb distributions. however, @ night it's difficult tell color , "blue" recognized "black". it's hard make unified standard specify colors through rgb distributions. as such, wondering there way or algorithm detect colors under different illuminations? btw: tried hsv color space , results not good. that's hard problem , it's still trying solved today. gist of find colour quantization using representative set of basic colours of image robust against different external stimuli... lighting, shade, poor illumination etc. unfortunately can't suggest 1 algorithm work cases. however, 1 algorithm has worked me in past when doing work in image retrieval. specifically, work jiebo luo , david crandall kodak research labs: http://vision.soic.indiana.edu/papers/compoundcolor2004cvp...

ios - Progress view is not updating - Swift -

i working on progressview in swift here's code var request = httptask() let downloadtask = request.download(urlm!, parameters: nil, progress: {(complete: double) in println("percent complete: \(float(complete))") self.progress.setprogress(float(complete), animated: true) even though complete gives output percent complete: 0.00480848 percent complete: 0.0089619 percent complete: 0.0132512 percent complete: 0.0175405 percent complete: 0.0221036 percent complete: 0.0264841 percent complete: 0.0308647 percent complete: 0.0350627 percent complete: 0.0392608 percent complete: 0.0434588 percent complete: 0.0513073 percent complete: 0.0555054 percent complete: 0.0598859 percent complete: 0.0642665 percent complete: 0.0688296 percent complete: 0.0731189 percent complete: 0.0774994 percent complete: 0.0817887 percent complete: 0.0861693 percent complete: 0.0908237 percent complete: 0.095478 percent complete: 0.099676 percent...

github - Error in model selection (gamm4) dredge function (MuMIn R package): family not recognised, model skipped -

i trying model selection generalized additive mixed models (made using gamm4 using mumin package in r. trying follow this piece of literature model selection mumin , gamm4. i creating model 9 variables, , random individual effect - looks likes this: library(gamm4) library(mumin) southfull = gamm4(otowidth ~ s(ages) + lagfinfsldat_annests + fsl_months_feb + lagfsldat_annual + lagfsldat_spring + lagfsl_months_oct+ finfsldat_summerdat + finfsldat_autumndat + lagfsl_months_nov , random = ~(1|fishname), data = south) but when try use dredge function, fails error message: (dd <- dredge(global.model=southfull)) error in dredge(global.model = southfull) : result empty in addition: there 50 or more warnings (use warnings() see first 50) > warnings() warning messages: 1: in gamm4::gamm4(...) : family not recognized (model ...