Posts

Showing posts from January, 2015

c# - Entity Framework Designer First get navigation property as Tasks -

the task pattern says in order consistent has async or not async. by using entity framework designer first can achieve quite var course = await db.courses.findasync(courseid); courses dbset generated entity framework , therefore has async methods. problem if add navigation property class, latter not dbset , not contain async method definition. as example, if add navigation property students table, created virtual icollection students means cannot use async methods. want having entity framework automatically generate task<> in order able await navigation properties. is possible? goal achieve this: var course = await db.courses.findasync(courseid); var student = await course.students.findasync(studentid); while @ moment options mixing async/notasync code: var course = await db.courses.findasync(courseid); var student = course.students.first(p => p.id = studentid); or not using navigation property @ all: var course = await db.courses.findasync(courseid); v

javascript - "TypeError: $(...).dialog is not a function" is showing when I am trying to open the map using markicon method -

why getting error?when trying open map not showing , getting above error. please me. when not adding "jquery.min.js" working fine.but when adding map not opening @ time.when map showing "quicksearch" method not working. <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" /> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8./jquery.min.js"> </script> <script type="text/javascript" src="scripts/jquery.quicksearch.js">&

sql - Complex query with WP_Query -

i still learning wordpress , trying perform query of posts wp_query, meta_query precise, thing after trying different possible ways , finding out can't nest arrays relations dont know if next possible way make sql query directly. to better explain do, next array help: 'meta_query' => array( 'relation' => 'and', array( 'key' => 'meta_geo', 'value' => '46', 'compare' => '=', ), array( 'key' => 'meta_dest', 'value' => 'si', 'compare' => '=', ), array( 'relation' => 'or', array( array( 'key' => 'meta_1', 'value' => '10', 'compare' => '<=', ), array( 'key' =>

Is it safe to send Android certificate key along with source code? -

i sold 1 of android apps via apptopia. selling process requires send buyer android certificate key, used sign app. i have several other apps i'm not selling, signed using same certificate. is safe send key buyer? there way mess other apps? thanks i not safe, but. given getting access key, technically makes them possible generate packages can 'uploaded' in place of other applications, still not have acces developer console (i assuming transferring app out of account), gives degree of safety. know late, practice sign apps separate certificates in future (which has own drawbacks too, in cases). see this.

php - Replace word when stand alone -

i have query: select last_name lastname table and want change "as" keyword capital (for rest of script run properly), when alone. when use script: $toupper = str_replace(array("select","from","where","order by", "group by", "as"), array("select","from","where","order by", "group by","as"),$query); it change other strings have "as". becomes this: select last_name lastname table how can replace stand alone keyword "as" "as"? you can use exact code have. since as statement has space before , after it, modify str_replace have space before , after as , as , so: $toupper = str_replace(array("select","from","where","order by", "group by", " ",),array("select","from","where","order by",

asp.net mvc - how return multiple column in join result to view model -

i want return multiple column in join result , fill in view model( vmfoodfoodmeal ). example want fill vmfoodfoodmeal join result thanks ienumerable<vmfoodfoodmeal> _fmt = (from e in db.foodprogrammealfood join j in db.foods on e.foodid equals j.id select new { id = e.id, name = j.name, }); it hard understand want, example can here @ group join section. here example code there: public void linq103() { string[] categories = new string[]{ "beverages", "condiments", "vegetables", "dairy products", "seafood" }; list<product> products = getproductlist(); var q = c in categories join p in products on c equals p.category ps select new { category = c, products = ps }; foreach (var v in q) {

python - Django log queries with long execution time -

is there way log db queries long execution time django app? here's middleware logs queries execution time longer 1 second: from django.db import connection import logging long_query_time_sec = 1 class longquerylogmiddleware: def process_response ( self, request, response ): q in connection.queries: if float(q['time']) >= long_query_time_sec: logging.warning("found long query (%s sec): %s", q['time'], q['sql']) return response notice because connection.queries process-wide, queries can logged twice. can solved running following after @ end of function: from django.db import reset_queries reset_queries()

html - Rotate (3d cube) in IE.10 & IE.11 -

good day readers. today struggling display 3d object in internet explorer 10 , 11 (chrome works intended). make simple created fiddle current status: - http://tiny.cc/844ylx i browsed comments on website , others , got feedback ie.10 , ie.11 requires perspective setting in each face definition. i made fiddle trying this, yet base rotation problem still remains in 2 browsers: - http://tiny.cc/554ylx both tries have problem in 90deg turn, getting displayed white in ie.10 , ie.11. what need change or improve on first example running correctly in ie.10 , ie.11?

sql - Find IDs of differing values grouped by foreign key in MySQL -

i have table process fileds id , fk_object , status . example id| fk_object | status ---------------------- 1 | 3 | true 2 | 3 | true 3 | 9 | false 4 | 9 | true 5 | 9 | true 6 | 8 | false 7 | 8 | false i want find id s of rows different status exists grouped fk_object . in example should return id s 3, 4, 5 , because fk_object 9 there existing status true , false , other have 1 of it. the stock response follows... select ... ... ... in ('true','false')... group ... having count(distinct status) = 2; where '2' equal number of arguments in in()

ruby - Rails button_to parameter confusion -

i'm trying shove many parameters button_to method, no avail. i'm using rails docs see parameters can support -- i'm having trouble. link api docs <%= button_to 'my title.',{:action => "update", :answer => "!!===@@@", :method => :patch, :data => {:confirm => "are sure?"}}, {:class => "btn btn-danger"}%> i'm looking add html classes button, redefine http method, , call javascript prompt box (through :data, :confirm) , add :answer parameter submission content. i'm having trouble getting rails parse correctly. "as explains on page http://api.rubyonrails.org/classes/actionview/helpers/urlhelper.html , params (such :answer in case) can passed :params option. the second argument needs can resolved full path, "/foos/123/update". can {:action => "update", :id => foo.id} : in case rails use current controller work out controller use in url. think it

security - C# appdomain permission no thread -

i create appdomains dynamically load dll's - supposed. however did not manage stop unhandled exception terminating whole thing - seems not possible. however not have if forbid creation of new threads in 3rd party dll. is there way forbid thread creation (and maybe task creation) in custom appdomain , if yes: how? p.s.: learned system.addin. take @ if no 1 has positive answer.

java - Gson deserialize json of embedded member -

i have following sample json: { "birds":[ { "id":"sampleid", "istest":true, "externalid":{ "main":[ "123abc" ], "sub":[ "456" ] }, "dinos":[ ], "rhinos":[ { "id":"super100id", "istest":true, "externalid":{ "famousid":[ "23|45" ] }, "dinos":[ ], "pelicans":[ { "id":"d4clik", "istest":true, "bird":null, "crazyarray":[ ] }, { "id":"did123", "ty

c# - get xml node value from xml string -

i have xml contain xml namespace. need value xml node <personxml:person xmlns:personxml="http://www.your.example.com/xml/person" xmlns:cityxml="http://www.my.example.com/xml/cities"> <personxml:name>rob</personxml:name> <personxml:age>37</personxml:age> <cityxml:homecity> <cityxml:name>london</cityxml:name> <cityxml:lat>123.000</cityxml:lat> <cityxml:long>0.00</cityxml:long> </cityxml:homecity> now want value of tag <cityxml:lat> 123.00 code : string xml = "<personxml:person xmlns:personxml='http://www.your.example.com/xml/person' xmlns:cityxml='http://www.my.example.com/xml/cities'><personxml:name>rob</personxml:name><personxml:age>37</personxml:age><cityxml:homecity><cityxml:name>london</cityxml:name><cityxml:lat>123.000</cityxml:lat><cityxml:long>0.00</cityxml:long&

api - Django - Tastypie - How can I get query string parameters in my ModelResource Meta class? -

i have django application writing api using tastypie . have endpoint created calls code: class collectionmodelresource(modelresource): """api retireve objincollection specific collection """ class meta: allowed_methods = ['get', 'put'] authentication = apikeyauthentication() authorization = authorization() queryset = objincollection.objects.filter(collection__collection='mycollection1') resource_name = 'objects' this works return database records collection='mycollection1' . however, pass mycollection1 value in via querystring of request. yet can't seem find exposed request object within meta class. is there way request object meta class inside modelresource of tastypie??? tastypie not allow this, can solve problem in way. should create custom build_filters() method allows filter queryset before processing request see [docs][1].

How can I match the outer bracket with grep -

i want extract lines file in form of t[0-9]-[0-9][.* eg: t1-3[1: 139343400 -- 81586290 --> 220929690] i tried grep t[0-9]-[0-9]\\[.* i'm getting following output. grep: unmatched [ or [^ any suggestions/comments regarding extracting above type of line appreciated. are sure tried grep t[0-9]-[0-9]\\[.* that should fine. if do grep t[0-9]-[0-9]\[.* then you'll "unmatched [" because "[" converted shell "[". you can do grep 't[0-9]-[0-9]\[.*'

Creating arrays from csv columns in PHP -

i've never worked csv files before , i'm hoping create arrays in php columns. so example csv this: name, address, dob john doe, 22 grove street, 06,06,2006 i'd each of columns array named column headings. time parse file(test.csv) arrays of table rows instead. following code work you. , can see real working script of exactcode @ url: http://sugunan.net/demo/csv1.php $i=0; $filename = 'data1.csv'; $contents = file($filename); foreach($contents $line) { $line = preg_replace( "/\r|\n/", "", $line ); $line_array = explode(",",$line); if($i==0) { foreach($line_array $key=>$val) { $csv_heading[$key] = trim($val); } } else { foreach($line_array $key=>$val) { $csv_array[$i][$csv_heading[$key]] = $val; } } $i++; } print_r($csv_array); data file url: http://sugunan.net/demo/data1.csv

amazon s3 - Spark execution occasionally gets stuck at mapPartitions at Exchange.scala:44 -

i running spark job on 2 node standalone cluster (v 1.0.1). spark execution gets stuck @ task mappartitions @ exchange.scala:44. happens @ final stage of job in call saveastextfile (as expect spark's lazy execution). hard diagnose problem because (1) never experience in local mode local io paths, , job on cluster complete expected correct output (same output local mode). seems possibly related reading s3 (of ~170mb file) prior, see following logging in console: debug natives3filesystem - getfilestatus returning 'file' key '[path_removed].avro' info fileinputformat - total input paths process : 1 debug fileinputformat - total # of splits: 3 ... info dagscheduler - submitting 3 missing tasks stage 32 (mappartitionsrdd[96] @ mappartitions @ exchange.scala:44) debug dagscheduler - new pending tasks: set(shufflemaptask(32, 0), shufflemaptask(32, 1), shufflemaptask(32, 2)) the last logging see before task apparently hangs/gets stuck is: info natives3fi

MULE ESB: Saving result from Sql query in Session Variable -

Image
i have created sample mule application fetches 1 row database. fetches user_name , user_id database. when convert result json or xml output [{"user_id":"u001","user_name":"dharmin"}] now want save user_id , user_name in session variables . can guide me ? edit: updated basic flow image after converting json add :- <json:json-to-object-transformer returnclass="java.util.hashmap" doc:name="json object"/> and after put value session variable using following :- <set-session-variable doc:name="session variable" value="message.payload.user_id" variablename="user_id"/> and <set-session-variable doc:name="session variable" value="message.payload.user_name" variablename="user_name"/>

security - Symfony2 - Can I give an anonymous user a 'ROLE_SOMETHING' -

i'm using symfony framework fos user bundle. i'm using security context determine menu items , other items display. $securitycontext = $this->get('security.context'); if ($securitycontext->isgranted($report['permission'])){ //add menu item... } is there way give anonymous user security context of 'role_user'? i've got logged in users working properly. i tried adding line: role_hierarchy: is_authenticated_anonymously: role_user to security.yml hoping it, apparently not. i've googled around little bit , read documentation. i imagine that: if ($securitycontext->isgranted($report['permission']) || ($report['permission'] === 'role_user' && $securitycontext->is_anonymous())) would work, feels kind of hack (and not dry) edit: intranet site. i've got table contains names of reports. reports should able seen everyone, regardless of if logged in or not. reports require

ios - How is Apple showing more in the Messages app in portrait on the iPhone 6 Plus? -

Image
with new iphone 6 plus, in landscape phone can show more content normal iphone 6 or predecessors. makes sense, in landscape phone identifies having "regular width" size class. however, in portrait its' still compact width, regular height size class, regardless of iphone. how apple showing more on iphone 6 plus in portrait when there's no size class identifying it? are hard-coding based on device's width? doesn't go against whole philosophy of size classes? they using auto layout force labels adopt width of screen. there's description of how achieve this in answer . apple have used adaptive layout implement landscape view on mail 6+.

java - Trying to create an ADT that pairs two objects -

this question has answer here: does equals method work objects? if so, how? 3 answers i'm working on abstract data type called pair in java. it's supposed take 2 objects , group them in data type. supposed take less 30 minutes, have been working @ 3 , half hours. believe have first 2 methods right, cannot figure out reverse or equals. can see attempted in code: public class pair<t1,t2> implements pairinterface<t1,t2> { // do: instance variables here. public t1 first; public t2 second; public pair(t1 afirst, t2 asecond) { first = afirst; second = asecond; } /* gets first element of pair. * @return first element of pair. */ public t1 fst() { return this.first; } /* gets second element of pair. * @return second element of pair. */ public t2 snd() {

c# - Why does the expanded nested GridView automatically closes after opening it -

i have following gridview inside updatepanel: <asp:gridview showheaderwhenempty="false" alternatingrowstyle-backcolor="#ebe9e9" autogeneratecolumns="false" onsorting="yourtasksgv_sorting" allowsorting="true" id="yourtasksgv" runat="server" clientidmode="static" emptydatatext="you have no tasks assigned you" onrowdatabound="yourtasksgv_rowdatabound" onrowcreated="yourtasksgv_rowcreated"> <columns> <asp:templatefield> <itemtemplate> <asp:imagebutton id="imgexpcol" imageurl="~/theimages/subtaskplus.png" runat="server" clientidmode="static" cssclass="imgexpcol" alternatetext="plus" commandargument='<%#eval("object") %>' oncommand="imgexpcol_command" /> <asp:panel id="pnlsubtasks" runat=

Python how to compare data like in PHP arrays -

i have compare different operations results on 2 data sources using python. for each datasource, tables names. each table, columns. each column, 'operations' getting count(column), sum(column). example, in php, have given type of array: ---------------------------------------------------- [table1][col1][operation1][value] [table1][col1][operation2][value] [table1][col1][operation3][value] ---------------------------------------------------- [table1][col2][operation1][value] [table1][col2][operation2][value] [table1][col2][operation3][value] ---------------------------------------------------- [table2][col1][operation1][value] [table2][col1][operation2][value] [table2][col1][operation3][value] ---------------------------------------------------- [table2][col2][operation1][value] [table2][col2][operation2][value] [table2][col2][operation3][value] ---------------------------------------------------- i need compare results of operations between 2 data sources, means ve

c# - Skip all items after first one with same id -

assume have list<customobject> list . customobject has next structure : public class customobject { public int coid{get;set;} public list<subcustobj> sublist{get;set;} public datetime datepublish{get;set;} } public class subcustobj { public int id{get;set;} public region rregion{get;set;} } // region : it's important know has regionid if in list exists customobject 's same coid in region need leave 1 element recent datepublish . in other words, 1 coid - 1 region . how can it? //list it's list<customobject> var todelete = ist.selectmany(r => r.sublist.where(m => r.sublist.count() > 2) .select(rm => rm.rregion.regionid)); this code select ids of region repeated, todo next don't know. some new idea : can group elements regionid , after select first element in group? you can select pairs (region, customobject) , order da

angular promise - Angularjs Implemet async task queue -

i have fiddle example, in i'm making 3 consecutive calls service function (emulating $http request interceptor function) returning promise, code below. want second , next calls wait until previous finishes, because second , next ones depend on previous response. im getting message 1: value returned 6000, message 2: value returned 600 message 3: value returned 30 but want get message 1: value returned 10 message 2: value returned 200 message 3: value returned 6000 var myapp = angular.module('myapp', []); myapp.factory('interceptor',['$q','$timeout',function($q,$timeout){ var _fact ={}; var asyntimeout; var _intvalue = 1; var _asynctask = function(time, value){ var deferred = $q.defer(); asyntimeout = $timeout(function(){ _intvalue = _intvalue*value deferred.resolve(_intvalue);},time) return deferred.promise; }; _fact.asynctask = _asynctask; return _fact; }]); myapp.controller(&#

visual studio 2012 - How does SQL Server Database Project: Publish decide when to recreate a table? -

i have sql server database project in i've made several changes schema i've changed column data types numeric (18,0) int . we're trying normalize data type used primary keys, it's 50/50 mix. when generate publish script, of tables recreated in script: create table [dbo].[tmp_xyz] insert table [dbo].[tmp_xyz] select ... [dbo].[xyz] drop table [dbo].[xyz] sp_rename n'[dbo].[tmp_xyz]', n'xyz'; but other tables updated via alter statements alter table [dbo].[abc] alter column [abcid] int null; is there rule dictates when table recreated, , when it's altered in place ? probably best way right click on object name , choose script ... have options create or alter if couldn't find alter ,you can go design view, right click , choose generate change script ... find alter statement.

objective c - iOS 8 UITableView separator inset 0 not working -

Image
i have app uitableview 's separator inset set custom values - right 0 , left 0 . works in ios 7.x , in ios 8.0 see separator inset set default of 15 on right. though in xib files set 0 , still shows incorrectly. how remove uitableviewcell separator margins? ios 8.0 introduces layoutmargins property on cells , table views. this property isn't available on ios 7.0 need make sure check before assigning it! additionally, apple has added property cell prevent inheriting table view's margin settings. when property set, cells allowed configure own margins independently of table view. think of override. this property called preservessuperviewlayoutmargins , , setting no allow cell's layoutmargin setting override whatever layoutmargin set on tableview. both saves time ( you don't have modify table view's settings ), , more concise. please refer mike abdullah's answer detailed explanation. note: follows clean implementation cell-level mar

webdriver - While executing appium test on android device, is it possible to type text using the android keyboard -

i testing android device using appium mac machine. sendkeys failing on particular page. following description of issue posted. sendkeys fails on android appium driver . want know there other possibilites resolve issue. spent hours in searching answer it. can find pressing back, home buttons. want type characters 'k' , 's' using android keyboard. suggestions? you can use virtual keyboard on simulator. if use genymotion emulator, can choose set use or not use virtual keyboard. , if use send_keys function failed, can try element.set_text('your text') instead(python client) in case, when run test on real device, default call out android keyboard. maybe can provide more details, paste scripts etc.

html - Changing Image and Text Dynamically Javascript -

currently have translation script built website. my problem activating , changing image , text selected language. this current code: <div class="btn-group"> <button type="button" class="btn dropdown-toggle" data-toggle="dropdown"> <img src="images/flag/united-kingdom.png" alt=""> english <span class="fa fa-bars"></span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="#"><img src="images/flag/germany.png" alt=""> deutsch</a></li> <li><a href="#"><img src="images/flag/france.png" alt=""> français</a></li> <li><a href="#"><img src="images/flag/spain.png" alt=""> español</a></li> <li><a href="

java - Hibernate: foreign key partially used as primary key -

i have been working hours trying solve problem, seems quite simple database point of view hard figure out hibernate. i have got 2 tables: vehiclecategory, , vehicle. a vehicle has 1 vehiclecategory, vehicule references vehiculecategory using foreign key. vehiclecategory : string attr1 string attr2 integer attr3 string attr4 primary key (attr1, attr2, attr3, attr4) vehicle string name string attr1 string attr2 integer attr3 string attr4 foreign key (attr1, attr2, attr3, attr4) references vehiclecategory primary key (name, attr1, attr2, attr3) here point: do not want use attr4 primary key, want use other foreign attributes in primary key. this mapping did: <class name="vehicle" table="vehicle"> <composite-id> <key-property name="name" column="name"/> <key-many-to-one name="vehiclecategory" class="vehiclecategory"> <column name="a

c# - Executing Process.Kill code when WCF service is being disposed -

i have wcf service hosted on iis, references legacy tool, via com interface. legacy tool black box me, can't change code or fix bugs in it. when restart wcf service, or stop via iis management tool, referenced legacy tool should shut down well, along other unmanaged data uses, , start again on first call restarted wcf service. everything works fine, except 1 function call on legacy tool. if call specific function, there bug inside tool, prevents going down, if stop wcf service. i thought workaround in i'll call process.kill function every time wcf service app being disposed. difficulty can't find suitable place call it. first tried make service behavior class inherit idisposable , , implement dispose method. problem dispose called every time function finished it's flow, can't kill legacy tool every call of course. my wcf service communicates client app via net pipe channel , understand, can't use global.asax file. my question - suitable place cal

Android Studio Null pointer exception when rendering xml layouts -

yesterday making changes app, specificly actionbar colors, worked perfectly, able preview on android studio without problems , run on device works perfectly, morning when opened android studio, wont preview , throwing exception: java.lang.nullpointerexception @ android.graphics.bitmap_delegate.createbitmap(bitmap_delegate.java:599) @ android.graphics.bitmap_delegate.createbitmap(bitmap_delegate.java:120) @ android.graphics.bitmap_delegate.createbitmap(bitmap_delegate.java:102) @ com.android.layoutlib.bridge.impl.resourcehelper.getdrawable(resourcehelper.java:236) @ com.android.layoutlib.bridge.bars.actionbarlayout.getdrawable(actionbarlayout.java:222) @ com.android.layoutlib.bridge.bars.actionbarlayout.setupactionbar(actionbarlayout.java:160) @ com.android.layoutlib.bridge.bars.actionbarlayout.<init>(actionbarlayout.java:127) @ com.android.layoutlib.bridge.impl.rendersessionimpl.createactionbar(rendersessionimpl.java:1627) @ com.android.l

ajax - scope variable does not get updated after adding data to it (on view page) -

im building cart in angular js. works user clicks on item function addtocart adds database then on te page have cart wich displays cart contents. in addtocart method update cart.. , want show data. the strange thing $scope.cart shows objects in console... works fine... on view page {{cart}} var shows [] , not updated... normaly every var updates automaticly reason 1 not: controller (stripped down) c2app.controller('makeordercontroller', function($scope, $rootscope, $http, $location, $routeparams, sharedata, ngdialog) { //there more cvars here ... not important $scope.cart = []; $scope.addtocart = function() { $http({ url: "http://localhost/c2api/addtocart", method: 'post', data: { 'sessionid' : $rootscope.sessionid, 'menuid' : $scope.menuid, 'catid' : $scope.catid, 'resid' : $scope.resid, '

MATLAB: Toolbar pushbutton not receiving updated strings from figure handles. -

i have gui edit box , push button on tool bar (well, more things that, things matter!) anyway, have when press push button tool variable set equal string in edit box. simple var = get(handles.edit1, 'string') . however, when go straight entering value in box clicking pushbutton (without clicking anywhere else or pressing return), var assigned previous value in edit box. why this? there way make sure push button tool pick out correct value? the gui made using guide, if matters. this happening because uipushtool callback executing before text box has time 'validate'. there surely more elegant way trick works: you can use waitfor command tell uipushtool callback wait editable box validate input. unfortunately is not enough we'll have to: 1) pass focus dummy control (i created dummy pushbutton named pushbutton1 nothing. focus send other dummy control. 2) wait text box validate content. 3) when text box done, retrieve content traditional way.

php - I access past data by parameter in a Moodle mForm? -

i need value of parameter of "mform" moodle form , not know how. i should add static field "date created" editing section of course , not show unix timestamp. to had following: $fecha_creacion = date('m/d/y', xxxxxxxxx); $mform->addelement('static', 'desc' , 'fecha de creación'); $mform->setdefault('desc', $fecha_creacion); where "xxxxxxxxx" integer value obtained bd in "mdl_couse" table ('timecreated'). therefore need integer value, same parameter passed in: $mform->addelement('static', 'timecreated' , 'fecha de creación'); i'm new moodle. thank much. moodle uses html_quickform should able consult documentation @ http://pear.php.net/package/html_quickform/docs/latest/ . if understand correctly, in case need along lines of: $mform->getelementvalue('timecreated'); hope helps.

c++ - Creating OpenGL texture from SDL2 surface - strange pixel values -

i'm trying use sdl2 load texture opengl rendering of wavefront objects (currently i'm testing fixed pipeline, plan move shaders). problem loaded texture applied quad (and model uses small part in bottom right of texture) looks that: a sample of effect http://image-upload.de/image/dakaef/e433b140c9.png this texture used the image loads fine , looks normal when drawn sdl functions, it's conversion ogl texture that's broken. note have alpha blending enabled , texture still opaque - values not random, , not uninitialized memory. code converting surface (cobbled various tutorials , questions on site here): gluint glmaketexture(bool mipmap = false, int request_size = 0) { // works on 32 bit surfaces gluint texture = 0; if ((bool)_surface) { int w,h; if (request_size) { // npot , rectangular textures supported since @ least decade now; should never need this... w = h = request_size; if (w<_surface->w || h<_sur

assert - Java 8 ClassFormatException for interface with static methods, but only when using assertions -

i started classformatexceptions couldn't explain relating interfaces static methods. pruned down test case: public interface modifiertest { public static final int delta = 10; public static int increment(int value) { assert value > 0; // problem line return value + delta; } } public class modifierexec { public static void main(string[] args) { system.out.println(modifiertest.class); } } without assertion in increment() method, fine. assertion, exception @ run time (compilation fine): exception in thread "main" java.lang.classformaterror: illegal field modifiers in class modifiertest: 0x1018 @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(unknown source) @ java.security.secureclassloader.defineclass(unknown source) @ java.net.urlclassloader.defineclass(unknown source) @ java.net.urlclassloader.access$100(unknown source) @ java.net.urlclassloa

javascript - How to inject $http in ng-route templateUrl funcion? -

this question has answer here: use $http inside custom provider in app config, angular.js 4 answers my web application has many views(templates) , there no static pattern composed templateurl route parameters. considering flexibility update routes, stores routing table in sql server , create restful web service retrieve&update route-template records. however, find no way call $http , $rootscope in angularjs during configuration phrase. i understand .config happens before .run in angularjs. in configuration, can access constant , providers. since i'm using templateurl function, function body called @ run time. wondering if there's way inject $http , $rootscope in templateurl function executed @ run phrase... angular.module('app', ['ngroute']).config(['$routeprovider', function ($routeprovider) { $routeprov

javascript - NoUIslider - Update range on demand -

i have 2 sliders , update range of 1 slider based on movement of other. for instance; slider_1 , slider_2 both have range of 1-10. when move slider_1 position 1 2, slider_2's range changes 1-10 1-20. if move slider_1 position 2 3, slider_3 has range 1-30, , on. i initialize slider so: function slider() { $(".slider").nouislider({ orientation: "horizontal", start: [0], range: { min: 0, max: 10, }, connect: 'lower', direction: "ltr", step: 1, }); }; the best way can come implementing far deconstruct whole slider, , re-initialize new range each time. unsure of how deconstruct slider. any ideas on how should done? nouislider offers update feature, keep settings, save new ones pass it. running following code on existing slider, example: $('#slider').nouislider({ range: {

Executing Case Structure Once in While Loop LABVIEW -

Image
i'm trying run vi in such when time has been elapsed in while-loop structure, pop out 3 button dialogue box in front panel letting me choose 3 different options yes, no , cancel. "yes" button proceed elapsed time count in while-loop, "no" button stop vi operation , "cancel" button close dialogue box , continue running vi. trying let dialogue box pop-out once when elapsed time reached 3 seconds, somehow pop-ing out because it's been meeting condition in while-loop. in labview me configuration? i'm using 2013 version of labview. appreciated help. my labview vi structure: this code not want. while loop have stop before popup. popup outside of loop after popup vi stopped. insert popup loop, put there case , put popup inside case. connect time has elapsed boolean case conditional terminal. make sure run vi using arrow not continuous run option.