Posts

c++ - Opengl obj object loader with textures -

i using object loader load obj model exported blender. can load model none of textures loaded , don't know why. should loaded when render model in main class or need load textures rendering model? objloader.cpp /************************************************************ *loads obj file - limited vertices, faces, normals, texture maps *loads object structure defined in .h file ************************************************************/ #include <stdio.h> #include <iostream> #include <io.h> #include <stdlib.h> #include "glut.h" #include "objloader.h" using namespace std; void object_type::render() { glbegin(gl_triangles); // glbegin , glend delimit vertices define primitive (in our case triangles) (int j=0;j<polygons_qty;j++) { //----------------- first vertex ----------------- //normal coordinates of first vertex glnormal3f( normcoord[ polygon[j].n[0] - 1 ].i, normcoor...

python - Incorrect Output While Comparing Two Lists -

i'm trying compare 2 lists generate buy/sell signals. first list list of prices, while second list simple moving average prices. result = [590.0, 600.0, 590.0, 580.0, 570.0, 560.0, 570.0] avrg = [580.0, 590.0, 593.33, 590.0, 580.0, 570.0, 566.67] signal = '' prices in range(len(result)): averages in range(len(avrg)): if result[prices] > avrg[averages]: signal = 'buy' elif result[prices] < avrg[averages]: signal = 'sell' lst.append(signal) output is ['buy', 'buy', 'buy', 'buy', 'buy', 'sell', 'buy'] the output should be ['buy', 'buy', 'sell', 'sell', 'sell', 'sell', 'buy'] result = [590.0, 600.0, 590.0, 580.0, 570.0, 560.0, 570.0] avrg = [580.0, 590.0, 593.33, 590.0, 580.0, 570.0, 566.67] signal = [] in range(len(result)): if (result[i] > avrg[i]): signal.append(...

How to develop and run app for office 2013? -

i want develop app office 2013. problem when searched microsoft developer tools office 2013 find link officedevtoolsforvs2012 . link on blogs on microsoft site msdn.microsoft . downloaded file run web platform api tells me can't find product(i don't know how microsoft link). want know how develop app office using vs2012. update**: i found exe file called officetools_bundle.exe installed required tools when run online samples error unable load 1 or more of requested types. retrieve loaderexceptions property more information. any help. this issue solved not, still don't know what's reason behind it. all did installed fresh windows 7 64bit on machine , every thing working charm.

Adding an array of doubles to an array list gives me weird (hex?) values - java -

i'm getting problems when try add array of doubles arraylist. arraylist<double[]> vok = new arraylist<double[]>(); and method i'm having issues is: public void onsensorchanged(sensorevent e) { if(e.sensor.gettype()==sensor.type_magnetic_field){ double[] temp = new double[3] ; double x = e.values[0]; temp[0]=x; double y = e.values[1]; temp[1]=y; double z = e.values[2]; temp[2]=z; vok.add(temp); system.out.println(vok); } when hover on temp in debug, displays correct values e.g. temp = [40.55999755859375, -20.100000381469727, -28.260000228881836] i in array when added "vok" end symbols [d@419aeb28] in array (hex?). have tried changing method in add elements vok = arrays.aslist(temp) , changing corresponding types i'm still having same problem. i'm not sure if there better method 1 i'm using i've been working on day , closest i've got....

xml - Using XPath - How do I select/count immediate siblings? -

i trying compound immediate following siblings same values together. having trouble select immediate siblings. input: <rows> <row> <month>1</month> <start_date>15/04/2013</start_date> <rate_amount>10</rate_amount> <discount>-2</discount> </row> <row> <month>2</month> <start_date>15/05/2013</start_date> <rate_amount>10</rate_amount> <discount>-2</discount> </row> <row> <month>3</month> <start_date>15/06/2013</start_date> <rate_amount>10</rate_amount> <discount>-5</discount> </row> <row> <month>4</month> <start_date>15/07/2013</start_date> <rate_amount>10</rate_amount> <discount>-2</discount...

xml - Can't get XSL to Display Correctly with XSL Variables and XPATH -

i'm making basic contact list web app 3 pages - contact list page displays contacts in db (stored in xml file), contact view page (that read-only page displays contact information), , new contact page (that allows make new contact or edit information of existing contact). my issue contact view page. each contact has id, , id passed through url (i.e. contactviewer?id=mk). using id, hoping using simple xsl for-each checks url request (saved in xsl variable) pick contact db display work. unfortunately, after adding "for-each" nothing displays on page , can't figure out it's going wrong. this xsl page contactview. <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:param name="url"/> <xsl:variable name="currentid" select="substring-after($url, 'id=')"/> <xsl:template ...

android - Use onChildClickListener with ExpendableListView -

how use onclicklistener expendable list view in such way clicking child item creates new activity? i did guy made don't have idea how make child item create new activity. explained bit in comments don't know go after expandlistchild ch = explistitems.get(groupposition).getitems().get(childposition); i included expandlist.setonchildclicklistener(expandlist_itemclicked); on oncreate method. know have 'ch' variable, don't know values corresponding clicked item are. can please help? onchildclick (expandablelistview parent, view v, int groupposition, int childposition, long id) when childclick listener called information need, ch not needed.