Posts

Showing posts from April, 2011

javascript - Glitches with Triangulation + Linear Interpolation + 3D projection -

intro hey! some weeks ago, did small demo js challenge. demo displaying landscape based on procedurally-generated heightmap . display 3d surface, evaluating interpolated height of random points ( monte-carlo rendering ) projecting them. at time, aware of glitches in method, waiting challenge on seek help. i'm counting on you. :) problem so main error can seen in following screenshot: screenshot - interpolation error? http://code.aldream.net/img/interpolation-error.jpg as can see in center, points seem floating above peninsula, forming less-dense relief . obvious sea behind, because of color difference, though problem seems global. current method surface interpolation to evaluate height of each point of surface, i'm using triangulation + linear interpolation barycentric coordinates, ie: i find in square abcd point (x, y) is , a = (x,y), b = (x+1, y), c = (x, y+1) , d = (x+1, y+1) , x , y being truncated value of x, y . (each point mapped heig

iphone - I get the Malformed access token for Facebook in ios 6 -

i want fetch facebook friends profile picture.i give access_token it. i search lot on net didn't got solution. my code follow: - (ibaction)advancedbuttonpressed:(id)sender { self.accountstore = [[acaccountstore alloc]init]; acaccounttype *fbaccounttype= [self.accountstore accounttypewithaccounttypeidentifier:acaccounttypeidentifierfacebook]; //nsstring *key = @"xxxxxx"; nsstring *key = @"xxxxxx"; nsdictionary *dictfb = [nsdictionary dictionarywithobjectsandkeys:key,acfacebookappidkey,@[@"email"],acfacebookpermissionskey, nil]; [self.accountstore requestaccesstoaccountswithtype:fbaccounttype options:dictfb completion: ^(bool granted, nserror *e) { if (granted) { nsarray *accounts = [self.accountstore accountswithaccounttype:fbaccounttype]; //it last object single sign on self.facebookaccount = [accounts lastobject]; nsl

selection.MergeCells property changes the original selection in excel -

i want check if selection contains mergecells , if not want process selection in excel. whenever call selection.mergecells original selection changes , wraps areas bounded mergecells not want. have checked below msdn link, tell limitation/bug , can not solved , can please me? http://social.msdn.microsoft.com/forums/en-us/exceldev/thread/63920347-c731-4046-b96f-3f3e7eabddd8 the problem in case different link point (because in selectionchanged event). in case, problem using selection.mergecells in vba code. don't that. you should avoid using select-related actions in own vba code (because slow , worse, has tons of unintended side-effects, this). instead, use range objects. because selection range closely bound selection object, may need disassociate it, so: dim rng range, ws worksheet 'get current worksheet set ws = activesheet 'get selection-range set rng = selection 'get same range, disassociated selection '(i think works?) set rng = ws.range

jQuery prepopulate and format a text field -

this confusing me. i have php app text field, client wants field prepopulated 896- , followed user input of 5 numeric values, 896-12569. i i in jquery, possible, if how? i'd suggest doing using css, here jquery solution: $('input').on('keyup', function() { var prefix = '896-'; var value = this.value.replace(prefix, '').replace(/[^\d]/, '').substr(0, 5); this.value = prefix + value; }).keyup(); // trigger keyup event, field populated @ load obviously swap input relevant selector, , add events necessary (this example works on keyup event). edit having looked @ code again, noticed there's small bug (press backspace once), ths prefix gets added again (this because isn't removed input because no longer matches), quick fix replace first 4 characters of input: var value = this.value.replace(this.value.substr(0, 4), '').replace(/[^\d]/, '').substr(0, 5);

Installation of latest MySql server -

i have downloaded mysql 5.6.11 win32 version. facing problem in installing downloaded version. i cant find setup file. i new please me install mysql server on windows 7 machine. download link : here thanks in advance. i think question may lots of -1 s. don’t understand why question exist. anyway link mysql 5.6.11 windows msi installer . download big sized(170.6m) installer offline installing save bandwidth. if have problem after downloading msi file windows installer or other configuration may have problem.

powershell - Alternative to Get-WindowsFeature -

i need list windows features on windows server 2008. on windows server 2008 r2 get-windowsfeature command available after importing module servermanager . on windows server 2008 not. does know alternative get-windowsfeature? found it: servermanagercmd.exe -query

.net - C#/Native: Reading HDD Serial Using SCSI PassThrough -

i have written 3 different methods make use of native createfile , deviceiocontrol calls in order retrieve hdd serial number (not model number). first 1 uses s.m.a.r.t. , second 1 uses storage query , third 1 uses scsi passthrough . of code based on content of this thread (with fixes , improvements). here results using diskid32 utility : trying read drive ids using physical access admin rights drive model number________________: [st975xxxxx] drive serial number_______________: [ 6ws2xxxx] trying read drive ids using physical access 0 rights product id = [st975xxxxx] serial number = [6ws2xxxx] trying read drive ids using smart drive model number________________: [st975xxxxx] drive serial number_______________: [ 6ws2xxxx] now, here results using methods: s.m.a.r.t. = 6ws2xxxx storage query = 6ws2xxxx scsi passthrough = st975xxxxx well... houston have problem here. first 2 methods correct serial number. last 1 model number bad. now, here code:

android - Efficient way to release bitmaps from ArrayList -

i store few bitmaps in arraylist, since bitmaps expensive resource know if there efficient way release bitmaps, when no longer need arraylist or calling clear on arraylist enough ? you have call recycle() on every bitmap arraylist holding. can call clear()

Spring ContentNegotiatingViewResolver - How to use bean name for jsp view not full url with path parameters -

my servlet-context file has <beans:bean class="org.springframework.web.servlet.view.contentnegotiatingviewresolver"> <beans:property name="usenotacceptablestatuscode" value="false" /> <beans:property name="contentnegotiationmanager"> <beans:bean class="org.springframework.web.accept.contentnegotiationmanager"> <beans:constructor-arg> <beans:bean class="org.springframework.web.accept.pathextensioncontentnegotiationstrategy"> <beans:constructor-arg> <beans:map> <beans:entry key="html" value="text/html" /> <beans:entry key="json" value="application/json" /> </beans:map> </beans:constructor-arg

list - Unexpectedly short Perl slices -

the following snippet of perl supposed print first 5 items of array referenced hash value, or fewer if array shorter. while ( ($key,$value) = each %groups ) { print "$key: \n"; @list = grep defined, @{$value}; @slice = grep defined, @list[0..4]; foreach $item ( @slice ) { print " $item \n"; } print " (", scalar @slice, " of ", scalar @list, ")\n"; } i don't think first grep defined necessary, can't harm, , should guarantee there no undefined array members before slice. second grep defined remove undefined array members in result of slice when @list shorter 5. %groups has been populated repeated invocations of: $groups{$key} = () unless defined $groups{$key}; push @{$groups{$key}}, $value; most of time works fine: key1: value1 value2 value3 value4 value5 (5 of 100) but -- , haven't worked out under circumstances -- see: key2: value1 (1 of 5)

Sunspot Solr Rails geosearch is failing with undefined method error -

i'm new using sunspot gem. have installed , correctly indexing , querying. however, trying bound search parameters including geo search. database table indexed solr has latitude , longitude fields i'm unable geo-search working. here's have in model: searchable . . . double :latitude, :as => "lat" double :longitude, :as => "lon" location (:location) { sunspot::util::coordinates.new(lat, lon) } end however when run rake task reindex fails following: undefined method `lat' #<product:0x1076e6650> i've tried: latlon(:location){ sunspot::util::coordinates.new(lat, lon) } and location(:location){ sunspot::util::coordinates.new(:latitude, :longitude) } i've tried various different options such passing in :latitude , :longitude rather lat, lon seem running different errors each time. i've got following gems installed: sunspot (2.0.0, 1.3.3, 1.2.1) sunspot_rails (1.3.3, 1.2.1) sunspot

ServiceStack Ormlite SqlExpressionVisitor null check in Where extension -

i write method querying table 1 method null cheking parameters using sqlexpressionvisitor of ormlite here method : public static list<userchatsdto> getuserchats(int startrow, int rowcount, datetime? startdate, datetime? enddate, string operatorname, short? rating, string visitorname) { using (idbconnection db = dbfactory.opendbconnection()) { sqlexpressionvisitor<userchatsdto> ev = ormliteconfig.dialectprovider.expressionvisitor<userchatsdto>(); ev.where(q => (startdate.hasvalue && q.dated >= startdate) && (enddate.hasvalue && q.dated <= enddate) && (!string.isnullorempty(operatorname) && q.takenbyuser.contains(operatorname)) && (rating.hasvalue && q.rating == (short)rating) && (!string.isnullorempty(visitorname) && q.v

c# - Need help accessing webbrowser control from form1 -

i need know 1 thing stuck.. i have form1 main form. have panel in , created form2. i added form2 panel below form2 frm = new form2(); frm.toplevel = false; frm.show(); panel1.controls.add(frm); my form 2 has webbrowser control in it. need access webbrowser control form1. how can it?? change protection of webbrowser control public, or create public property returns webbrowser control. then can reference with frm.mywebbrowsercontrol

How can I access the automagically-created CLOUD_STORAGE_ACCOUNT connection string in Azure? -

Image
when associate website storage account, connection string automatically created in configuration: however, can't figure out how connection string @ runtime. old-school configurationmanager.connectionstrings["cloud_storage_account"] returns null , , tried (out of desperation) cloudconfigurationmanager.getsetting("cloud_storage_account"); which, of course, didn't work it's not application setting . examples i've found have people reproducing configuration string new connection string (which can accessed first method) or app setting (accessed second). this seems stupid. created azure, , guaranteed more correct create. so how can aholt of "cloud_storage_account" connection string @ runtime? edit: i'm configuring website via portal. linked storage account under linked resources . details configuring (including connection strings) here: https://www.windowsazure.com/en-us/manage/services/web-sit

HTML5 Article LIst -

i have coded html5 list of articles. have been searching if correct way use new html5 semantic tags, still unsure. markup correct in terms of using semantics? <section> <article> <h2>article</h2> <p>description of article</p> </article> <article> <h2>article</h2> <p>description of article</p> </article> <article> <h2>article</h2> <p>description of article</p> </article> </section> yes that's fine, although better if <section> had heading, e.g. <section> <h1>article list</h1> <article> <h2>article</h2> <p>description of article</p> </article> ... </section>

wpf - TextBlock Text Binding an ObservableCollection.Count property -

i have observablecollection<sportisti> starts out 0 elements (but initialized new object @ creation of window). wanted bind count property textbox . unfortunately, causes application crash whenever try open window in question. now, since have listview on same page, showing elements of collection in question, thought extract number of rows there, lead crash. <textbox text="{binding elementname=lvtabela, path=items.count}" grid.row="4" grid.column="1" margin="0,3,60,3" dockpanel.dock="top" isreadonly="true" /> note in .xaml file can see content of textbox 0. any idea why happening? my mistake, forgot add mode=oneway binding. problem that, though textbox wasn't editable, system recognized potential way of changing listview.itemcount attribute, read-only.

javascript - Why does Ajax post data to localhost rather than the provided URL? -

so using ajax post form server, however, instead of sending form url, sends itself. here code $("#psignup").click(function() { $.ajax({ type: "post", url: "example/default/mobile_user_register", data: $("#patientsignup").serialize(), // serializes form's elements. success: function(data) { alert(data); // show response php script. } }); return false; // avoid execute actual submit of form. }); in browser, appears send http://localhost:8080/?email=asdfa%40asd.com&password=asd&repeatpassword=&firstname=asd&username=&lastname=asd what looking is, of course, " http://example.com/default/mobile_user_register?xxxxxxxxxxxxxx ". can me understand why isn't working? use jsonp $.ajax({ url: "http://example.com/default/mobile_user_register?xxxxxxxxxxxxxx", datatype: 'jsonp',

osx - How do I pipe only certain results from a command to another or an If statement? -

i trying find way build cron job log out idle users in osx based on last time actively moved mouse. osx's built in functionality logs out , if entire machine idle. way have been able find out idle using 'w' gives me few columns , 1 has idle time in it. how can pipe numbers field , ignore rest? there easier way it? how write this: 1.issue command w 2.check username see if time idle greater 30 mins , if issue command ps -ajc | grep loginwindow , find username , pid loginwindow user exceeded idle time , issue sudo kill -9 "whatever pid user's login window" and exclude "whateverusernamehere" script (so way stay logged in). i know asked pipes. standard way is: consider using tmout variable. add login profile: declare -r tmout=14400 this logs out inactive interactive users after 14400 seconds, 4 hours of inactivity. you solution, kill -9, kind of harsh , can cause problems. user can have file open, method not detect that, , k

php - How can I make a session start on the index page if that is where the login form is? -

when load index.php, there no session started. there login form uses login class created, , when user logged in, taken index.php, @ time session should start. what need ensure session starts on index page when successful login has occurred? session , authentication not synonymous. can start session without logging it. can set session specific variable , check determine if user logged in. just start session @ top of page, whether user logged in or not.

linux - Unknown symbol dentry_path -

i'm using method dentry_path in kernel module, compilation work fine when loading kernel module go error message: error: not insert module my_mod.ko: unknown symbol in module and in /var/log/kern.log may 8 19:45:10 zubuntu kernel: [ 1173.105984] my_mod: unknown symbol dentry_path (err 0) this method declared following : extern char *dentry_path(struct dentry *, char *, int); could please explain me why can't link module using method ? i think need use dentry_path_raw instead of dentry_path, cause dentry_path isn't exported. also, dentry_path_raw safer version between these two, it's protected writelock.

symfony - In symfony2 is there a single variable or methode like 'hasError' to check if a form returns any errors? -

in symfony can link validation both field or input errors returned in form.vars.error , form.fielname.vars.errors in template had these checks fuigure out if form return error on of fields {% set oneormorefieldsempty = form.title.vars.value == '' or form.location.vars.value == '' or form.zip.vars.value == '' or form.city.vars.value == '' or form.address.vars.value == '' or form.description.vars.value == '' or form.type.vars.value == '' or form.dresscode.vars.value == '' or (form.registrationtypemember.vars.value == 2 , form.costmember.vars.value == '') or (form.guestallowed.vars.value == 1 , form.guestperparticipant.vars.value empty ) or (form.targetagegroup.vars.value == 1 , (form.agemin.vars.value == '' or form.agemax.vars.value == '')) or (form.numberofplaceslimited.vars.value == 1 , form.maxtotalpa

Jquery kill un-needed timeouts -

so have 2 buttons. button a: button. (#button1) button b: fake submit button. (#right_r) button c: submit button. (#right) by default, button show, , preventdefault() on click , show error message. when click on button a, set timeout 8000, in 8 seconds, replace button b button c. but problem is: when user clicks on button multiple times, sets lot of timeouts. what want is, kill previous timeout before setting new one, like stop it. my code: $(document).ready(function() { $("#right_r").click(function(event) { event.preventdefault(); $("#error").slidedown("slow"); settimeout(function() { $("#error").slideup("slow"); }, 1000); }); $("#button1").click(function() { settimeout(function() { $("#right_r").hide(); $("#right").show(); }, 8000); }); }); thanks. try this var righ

How to get json object from android to php -

i trying build web service android app. having problem sending parametres php. using these code blocks http-post. public string requestjson(string method, jsonobject parameters) { try { int timeout_millisec = 10000; httpparams httpparams = new basichttpparams(); httpconnectionparams.setconnectiontimeout(httpparams, timeout_millisec); httpconnectionparams.setsotimeout(httpparams, timeout_millisec); httpclient client = new defaulthttpclient(httpparams); string tmpurl = serviceurl.trim() + (serviceurl.trim().endswith("/") ? method : "/" + method); httppost request = new httppost(tmpurl); request.setheader(http.content_type, "application/json; charset=utf-8"); if (parameters != null) { request.setentity(new stringentity(parameters.tostring(), http.utf_8)); } httpresponse

javascript - Novice Menu/SubMenu issue -

i still new asp.net web programming can me out. have horizontal mainmenu , horizontal submenu directly under it. i loading these database menucollection session variable dictionary of submenu , it's parentid. when user clicks mainmenu item want swap in , display correct submenu. when mainmenu.menuitemclick event happens postback occurs , try put correct menu dictionary submenu doesn't show. do need postback submenu load or need javascript? or going wrong way? below code. thanks. imports system.data imports system.data.sqlclient imports system.collections.generic public class rootmaster inherits system.web.ui.masterpage private readonly connection string = system.configuration.configurationmanager.connectionstrings("connectionstring").connectionstring protected sub page_load(byval sender object, byval e system.eventargs) handles me.load if not ispostback session("menudata") = getmenudata() addtopmenuitems(session(&qu

linux - awk - how to delete first column with field separator -

i have csv file data presented follows 87540221|1356438283301|1356438284971|1356438292151697 87540258|1356438283301|1356438284971|1356438292151697 87549647|1356438283301|1356438284971|1356438292151697 i'm trying save first column new file (without field separator , , delete first column main csv file along first field separator. any ideas? this have tried far awk 'begin{fs=ofs="|"}{$1="";sub("|,"")}1' but doesn't work this simple cut : $ cut -d'|' -f1 infile 87540221 87540258 87549647 $ cut -d'|' -f2- infile 1356438283301|1356438284971|1356438292151697 1356438283301|1356438284971|1356438292151697 1356438283301|1356438284971|1356438292151697 just redirect file want: $ cut -d'|' -f1 infile > outfile1 $ cut -d'|' -f2- infile > outfile2 && mv outfile2 file

main - javadoc for String[] args -

i want make documentation program. function main receives parameters command-line: login, password etc(there 9 parameters). /** * command-line interface. * @param args login - login of user password - password, row splitter - symbol after each row in text file */ public static void main(string[] args){ } but person read html-documentation it's not convenient find decription every parameter. better way make javadoc each parameter(like @param login, @param password @param rowsplitter)? thanks. you use commons cli, make life easier when documenting expected input , when extending functionality of program. http://commons.apache.org/proper/commons-cli/

Rails form validation does not work if form is initially hidden -

i having weird issue rails form validation. validation works fine if form visible when page loads nothing happens if form hidden , displayed upon user interaction page. model class pushnotification < activerecord::base belongs_to :application, foreign_key: :appid, primary_key: :appid validates :message, :presence => true, :length => { maximum: 75 } validates :max_message_frequency, :presence => true, :numericality => {:only_integer => true, :greater_than => 0} validates :appid, :presence => true end html form <div id="push-message-tab" class="tab-section"> <%= form_for(pushnotification.new, url: messaging_messaging_cohort_create_push_path(@application, @cohort), remote: true, validate: true, html: { id: :push_notification_create_form, class: 'new_push_notification_create ' + (@cohor

c - For loop with printf as 3rd argument -

studying computer science final...... i cannot figure example out..... i understand leaving first argument blank makes act true.... but don't understand leaving variable in second argument accomplishes.... what don't understand how printf statement "updates" variable condition... #include<stdio.h> int main() { int x=1, y=1; for(; y; printf("%d %d\n", x, y)) { y = x++ <= 5; } printf("\n"); return 0; } the output is: 2 1 3 1 4 1 5 1 6 1 7 0 edit: i understand for-loop structure part..... thanks answers - insightful thanks! a for loop can thought of for (initialization; condition; afterthought) the first part of loop initialisation. leaving empty fine, indicates have initialised variables required loop. the y in second expression (or condition) of for loop equivalent y!=0 . keeps for loop running until y==0 . the printf in afterthought run @ end of each iterat

Convert a SQL query in Java Persistence Query Language (JPQL) -

i'm having little problem convert sql query jpql: select max(datepurchase) purchases userid = id , date_trunc('day',datepurchase) in (select distinct (date_trunc('day',datepurchase)) day purchases userid = id , datepurchase < initialdate , datepurchase > finaldate) group date_trunc('day',datepurchase) this sql working well, returns de last purchase per day made user. tried same, in jpql: query query = em.createquery("select u max(u.datepurchase) purchases u u.userid.id = :id , func('day',u.datepurchase)" + "in (select distinct (func('day',u.datepurchase)) day purchases u.userid.id = :id , u.datepurchase < :finaldate , u.datepurchase > :inicialdate) group func('day',u.datepurchase)"); query.setparameter("id", idusuario); query.setparameter("datainicial", datainicial); query.setparameter("datafinal", datafinal); list<movsaldo> saldos = (list&l

C# Windows Forms switching -

i got form1 , creates form when button clicked: private void toolstripmenuitem_click(object sender, eventargs e) { form f5 = new form5(); f5.show(); } when happens, need determine if form f5 exists,so if exists,when button pressed,it switches existing form instead of making new one.if doesn't exist,then has create new form. how do this,if can't check whether objects exist or not until declare them? how check f5 existence before declare it,so can create when there no such form , needed? the correct way of doing maintain reference form5 object when create it. can by, example, declaring class-level variable. public class myform : form { private form5 m_frm5 = null; // ...other code... private void toolstripmenuitem_click(object sender, eventargs e) { if (m_frm5 == null) { m_frm5 = new form5(); } m_frm5.show(); } } obviously need choose scope appropriately, depending on need access

Get MAC Address of System in Java -

this question has answer here: get mac address on local machine java 6 answers i need mac address of system running program. not able that. i writing following code: public class app{ public static void main(string[] args){ inetaddress ip; try { ip = inetaddress.getlocalhost(); system.out.println("current ip address : " + ip.gethostaddress()); networkinterface network = networkinterface.getbyinetaddress(ip); byte[] mac = network.gethardwareaddress(); system.out.print("current mac address : "); stringbuilder sb = new stringbuilder(); (int = 0; < mac.length; i++) { sb.append(string.format("%02x%s", mac[i], (i < mac.length - 1) ? "-" : "")); } system.o

cocos2d iphone - EXC_BAD_ACCESS issue with contact listener -

i getting exc_bad_access error in contact listener code. below code: main object class (gameobjects) through objects subclassed: gameobjects.h: #import "cocos2d.h" #import "ccnode.h" #import "ccphysicssprite.h" #import "box2d.h" #include <math.h> @interface gameobjects : ccnode { //b2body* objectbody_; } -(b2body*)getobjectbody; -(void)objectstouched:(gameobjects*)otherobject; @end gameobjects.mm (for want cclog tell if it's working): #import "gameobjects.h" @implementation gameobjects -(b2body*)getobjectbody { } -(void)objectstouched:(gameobjects*)otherobject { cclog(@"it's working"); } @end contactlistenertest.h: #import <foundation/foundation.h> #import "cocos2d.h" #import "box2d.h" #import "enemy.h" #import "sprite.h" #import "gameobjects.h" class contactlistenertest : public b2contactlistener { public: b2wor

java - How to make jar files that draw from a source folder -

i've been wanting make executable jar files java lately. when executing code eclipse works perfectly. when use eclipse export same code runnable jar, of jars work except ones draw separate source folders. the jar made when launched try , open , check console possible errors. try , run jar through console command "java -jar test.jar". , says cannot access jar. ideas? btw im on macbook pro osx. thank you!! picture of files within eclipse if have file want store in jar , access there, don't have java file more. @ class.getresourceasstream() , class.getresource() - first can give inputstream (used-to-be) file, second returns url , can used things images. note file being accessed can accessed relative package/folder location of class or relative classpath root (by putting "/" @ front of resource name ("/resource/funny.jpg")). when execute jar command line, aware have thing called "default directory"; folder in commands execu

mysql - php defined constant in if/else shorthand -

this question has answer here: ternary operators , variable reassignment in php 4 answers i've been working on php course, , 1 of exercises has create config.php file wherein define database constants. i know standard way of doing this, is: define("name", "value"); however, exercise has written differently. it's in if/else shorthand. know it's correct, because works. don't understand why works. it's simple answer more experienced devs: defined('db_server') ? null : define('db_server', 'localhost'); the way read it, it's checking see if db_server defined. if it's true, sets null ? why null out value of constant if it's defined? if it's defined, runs expression null , noop (does nothing). otherwise, runs define . write defined('db_server') ?: define('

javascript - JQuery - get attr/text from HTML string in a variable -

i have html string i'm passing through function , want able perform jquery methods on variable inside function - such .attr('href') or .text() . i'm sure there simple solution , more elegant temporarily appending dom. html <div class="here"></div> javascript link = '<a href="http://www.google.com">google</a>'; // works $('.here').html(link); works = $('.here').text(); console.log(works); // doesn't not = link.text(); console.log(not); http://jsfiddle.net/dfgyk/ you need create jquery object link in order use jquery methods on it. try: not = $(link).text(); demo: http://jsfiddle.net/dfgyk/1/ depending on you're doing link , might beneficial earlier in code can use like: var $link = $(link); console.log(link.text());

python - Using PyTables from a cython module -

i solving set of coupled odes , facing 2 problems: speed , memory storage. such use cython_gsl create module solves odes. until had written data .txt file think more useful use pytables . as such define in .pyx file from cython_gsl cimport * tables import * def main (parameters run ): class vector(isdescription): name= stringcol(16) # 16-character string = int32col() # 32-bit integer j = int32col() # 32-bit integer k = int32col() # 32-bit integer h5file = tables.openfile("tutorial1.h5", mode = "r", title = "test file") group = h5file.creategroup("/", 'spin_vectors',"spin vectors of crust , core") table = h5file.createtable(group, 'shellvector', vector, " ") ... setup odes ... while (t < t1): status = gsl_odeiv_evolve_apply (e, c, s, &sys, &t, t1, &h, y) if (status != gsl_success): bre

android - Animation on ImageView width changed -

i'm changing width of imageview programmatically , there way adding animation width change ? first state, width of imageview 200dp second state width of imageview 400dp have @ answer: resizing layouts programmatically animation . have pass view , other parameters class.

How to troubleshoot slow performance on URL with Rails + Mongo -

we use advice on scaling/ops issue. we have simple mobile app runs on rails 3.2.12 , uses mongomapper instead of activerecord. there 1 database call sporadically performs poorly, causing users write in , complain. isn't clear why. can't install newrelic because of mongomapper, , data returned mongo isn't lot (< 200kb). there isn't logic being executed in controller, either. the problem seems exacerbated more users. server runs on vps, 1 shared 30 nodes. hosting company says average i/o utilization @ 12%, below critical threshold. since can't use newrelic, what's best approach troubleshooting problem? here's output explain : user.collection.find({:username_downcase => 'banana2006'}).explain => {"cursor"=>"btreecursor username_downcase", "ismultikey"=>false, "n"=>1, "nscannedobjects"=>1, "nscanned"=>1, "nscannedobjectsallplans

Joining Three Tables in MySQL database -

i want join 3 tables. first table (result) has got result of games , contains date, team a, team b , final score. second table (line up) has detail of line i.e list of players played team on given date i.e. date, team, player1, player2, player3 etc. third table (players) contain information each player i.e name, height, weight date of birth etc. want take out information 3 tables using join. want final value date, team, player1, player1_height, player1_weight, player2, player2_height, player2_weight,and on. structure of 3 tables under please : result table, date varchar(50), team varchar(50), team_score int(11) lineup table, date varchar(50), team varchar(50), player1 varchar(50), player2 varchar(50), player3 varchar(50), player4 varchar(50), player5 varchar(50) player table, firstname varchar(50), height int(11), weight int(11),birthdate varchar(256), i joining first 2 tables date, team, player1,player2, etc using following query . sele

python - Conundrum : Not Sorting Objects With SQLAlchemy -

i have feeling sqlalchemy checking first digit when orders groups id, how check digits of id ? groups = theorganization.groups.order_by(group.id.asc()) ^this gets groups in particular instance of organization called "theorganization" models organization id groups group id organization basically, each organization has many groups within it this simplified form of responseobject via nslogging xcode where keys ids of groups in 1 particular organization 17 = "some group info" 21 = "some group info" 22 = "some group info" 3 = "some group info" 5 = "some group info" 7 = "some group info" 9 = "some group info" why isn't sorting working? how groups ordered via id? i have tried sorting other group attributes, , not working either. i have tried ordering dictionaries, first created, using method listed on how can sort dictionary key

python - Trying to parse twitter json from a text file -

i new python , trying parse "tweets' text file analysis. my test file has number of tweets, here example of one: {"created_at":"mon may 06 17:39:59 +0000 2013","id":331463367074148352,"id_str":"331463367074148352","text":"extra\u00f1o el trabajo en las aulas !! * se jala los cabellos","source":"\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003etwitter iphone\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":276765971,"id_str":"276765971","name":"shiro","screen_name":"_shira3mmanuel_","location":"","url":null,"descrip

Google Forms to Fusion Table with New API -

i set google form input data fusion table below tutorial. http://kh-samples.googlecode.com/svn/trunk/code/instructions.html now old fusion tables api shut down, i'm getting below error message through google forms script editor: returned code 403. server response: { "error": { "errors": [ { "domain": "usagelimits", "reason": "dailylimitexceededunreg", "message": "daily limit unauthenticated use exceeded. continued use requires signup.", "extendedhelp": "https://code.google.com/apis/console" } ], "code": 403, "message": "daily limit unauthenticated use exceeded. continued use requires signup." } } i've turned on fusion tables service through api console i'm not sure how link api key in apps script code. /** * url fusion tables api * @type {string} */ var fusion_url = 'https://www.googleapis.com/