Posts

Showing posts from March, 2014

Ruby on rails Best IDE for Windows -

i working on linux in our office development on ruby on rails in home have windows xp installed. has different ide installed .net , php development. don't want rid of stuff kindly guide best ide ruby on rails develpment on windows mysql database.. i'm working on linux , netbeans. netbeans supports windows , can have php well. unfortunately netbeans has discontinued ror support version 7.0. long terms might problem another 1 redcar (http://redcareditor.com/) good. also aptana radrails (http://www.aptana.com/products/radrails) can used (they offer eclipse plugin also) and if looking paid 1 go rubymine (http://www.jetbrains.com/ruby/) but final note. have setup dual boot in home laptop , development except (.net) in linux coz u know linux rox :d thanks , regards, sameera

c# - Identify my dotnet version -

how can check c# application itself, version of dotnet being used application? use environment.version - gives exact version of .net running application. gets version object describes major, minor, build, , revision numbers of common language runtime. to find out version of framework installed, see this question , answers. in nut shell, need dig registry.

java - thread doesn't execute -

i'm new in java, guess it's simple problem. in event listener have method declares variables , i'm trying use variables in thread use in same event. although not work, here code: import javax.swing.*; import java.awt.*; import java.awt.event.*; public class gui extends frame implements windowlistener,actionlistener { cpwindow window1 = new cpwindow(); cmwindow window2 = new cmwindow(); solarsystem system = new solarsystem(300,300); planet planetarium; /** * frame general window. */ public void createframe0(){ jframe f0 = new jframe("choose want do"); f0.setdefaultcloseoperation(jframe.exit_on_close); f0.addwindowlistener(this); f0.setlayout(new gridlayout(3,1)); jbutton cp = new jbutton("create planet"); jbutton cm = new jbutton("create moon"); jbutton delete = new jbutton("delete planet or moon"); f0.add(cp); f0.add(cm); f0.add(delete); cp.addactionlistener(this); cm.addactionlistener(this); delete.addactionlistener(this); cp.

php - Handling Array field post data -

i searched forum , couldn't find appropriate answer question, array post handling quite new me. have html form array fields, <input type="text" name="title[]" /> <input type="text" name="desc[]" /> <input type="text" name="cate[]" /> fields generated php , not know how many similar array fields there be. when output post following multidimensional array. array ( [title] => array ( [0] => title 1 [1] => title 2 [2] => title 3 ) [desc] => array ( [0] => description 1 [1] => description 2 [2] => description 3 ) [cate] => array ( [0] => cat 1 [1] => cat 2 [2] => cat 3 )) now problem want insert them in db using php foreach. like..: foreach($_post arraydata) { insert sometable(title,desc,

jqgrid load specific rows from xml string -

i have grid load it's content xml string (editurl: "clientarray",datatype: 'xmlstring'). is possible select rows want grid load according value inside xml string? (for example: <root> <row> <number>1</number> <test>546</test> <i_u>1</i_u> </row> <row> <number>2</number> <test>543</test> <i_u>2</i_u> </row> <row> <number>4</number> <test>544</test> <i_u>2</i_u> </row> <row> <number>5</number> <test>545</test> <i_u>1</i_u> </row> i want grid show rows "i_u" tag value of 1. if possible , how can done? thank's in advance. you don't included jqgrid definition in question, context not clear use it. in text of question use "load", "select" , "show" ver

c++ - Performance tuning -

i have following code segment . vector of size 176000 loop takes upto 8 minutes execute . not sure taking time xepcombstr bstrsetwithidsasstring; //wrapper class bstr std::vector<__int64>::const_iterator it; for(it = vecids.begin(); != vecids.end(); it++) { __int64 i64id = (*it); __int64 i64oid = xptfunctions::getoid(i64id); // set ',' between 2 set members if (it != vecids.begin()) bstrsetwithidsasstring.append(xepcombstr(l",")); wchar_t buf[20]; _i64tow_s(i64oid, buf, 20, 10); bstrsetwithidsasstring.append(buf); } __int64 getoid( const __int64 &i64id) { __int64 numid = i64id; numid <<= 16; numid >>= 16; return numid; } i think bottleneck append function. see, string has allocated memory inside, , when try append won't fit, reallocate

flex - Invalid BitmapData randomness -

i started converting flex application run on android using new flex hero sdk. replaced mobile-incompatible components , got running few times succesfully. when use same libraries running original webapplication works perfectly. the big problem these random invalid bitmapdata errors while starting mobile application. here's whole output. argumenterror: error #2015: invalid bitmapdata. @ flash.display::bitmapdata/ctor() @ flash.display::bitmapdata() @ spark.primitives::bitmapimage/http://www.adobe.com/2006/flex/mx/internal::applysource()[e:\dev\hero_private_beta\frameworks\projects\spark\src\spark\primitives\bitmapimage.as:1337] @ spark.primitives::bitmapimage/http://www.adobe.com/2006/flex/mx/internal::validatesource()[e:\dev\hero_private_beta\frameworks\projects\spark\src\spark\primitives\bitmapimage.as:1652] @ spark.primitives::bitmapimage/commitproperties()[e:\dev\hero_private_beta\frameworks\projects\spark\src\spark\primitives\bitmapimage.as:902] @ spark.primitives.su

change the default encoding for notepad++ -

that's . want open files in once (to make replacements). notepad++ opens them in ansi , have go through each file , change encoding utf-8. in notepad++ 5.9 there option in settings -> preferences -> new document/default directory automatically convert ansi files utf-8 without bom on open

ruby on rails - accepts_nested_attributes_for building form -

i getting error: undefined method build nil:nilclass when trying build empty child object form. class patientscontroller < applicationcontroller def index end def new @patient = patient.new # causes error (undefined method `build' nil:nilclass) @patient.user.build end end class patient < activerecord::base belongs_to :user accepts_nested_attributes_for :user attr_accessible :user_id, :user_attributes end # == schema information # # table name: patients # # id :integer not null, primary key # user_id :integer # created_at :datetime # updated_at :datetime # since patient belongs user need build patient user. @user.patients.build(params[:patient]) patient.new used create blank instance of patient can render on new form, when posting create need build user.

push notification - Windows Phone 7 - how to send files from/to the app? -

i'm trying write basic application windows phone 7 , want able send files (specifically xml in case changes anything) app. have wcf service setup can send push notifications through it. problem there limit on amount of raw data can send via push notification. my solution send initial push notification (either tile or raw) alert application want send file , make app somehow communicate server (everything on personal computer btw - i'm trying figure out how things work) - app recieve/download files. what easiest way accomplish this? note i'm not concerned security or that. clarification - question essentialy: how transfer files from/to server to/from phone? assume else handled - app , running , user has given or give permissions every possible thing may give permission to. unfortunately, total size of push notification (including http headers) 1kb. means can't used send large amounts of data. instead of sending whole file, send notification (raw or

c# - App.config replacements for unit tests -

my continuous integration server (teamcity) configured run unit tests in our app on build. prior running tests, need change of appsettings make them valid our ci server. i'm achieving similar web project using deployment project provided visual studio. can same test project? thanks, gonzalo it's possible use web.config transformations app.config files through workaround. you have invoke appropriate msbuild tasks @ right stage in build process. add code snippet project file: <usingtask taskname="transformxml" assemblyfile="$(msbuildextensionspath32)\microsoft\visualstudio\v10.0\web\microsoft.web.publishing.tasks.dll" /> <target name="aftercompile" condition="exists('app.$(configuration).config')"> <!-- generates transformed app.config in intermediate directory --> <transformxml source="app.config" destination="$(intermediateoutputpath)$(targetf

objective c - Cannot find output .a of Cocoa Static Library (in xcode 4) -

i have project 2 targets, 1 cocoa static library, other accompanying test project. despite building main project in different ways on , on again, i cannot find .a file expect produce. in fact, cannot find build folder associated project. need link library in app, cannot if can't find file link to. these properties correctly set: (build products path) symroot = build (intermediate build files path) objroot = $(symroot) all tests pass (which means code must building right?) breaking code causes build break - again suggesting building. also, "products > libproject.a" file red in xcode project navigation i checked deriveddata directory, seems created objects fot ocunit stuff. still no .a file against can link. where .a file? any appreciated. it's in ~/library/developer/xcode/deriveddata/ somewhere.

Wrong exception after calling .net4.0 com server from delphi application -

we migrating our codebase bds2006 rad studio xe, , found strange behavior: if make invalid floating point operation (ie. division zero) after creating object com server implemented in .net4.0, don't normal exception (ie. edivisionbyzero), estackoverflow. we managed prepare simple example: comerrorexample there .net 4.0 assembly, com interface (one function returning string) , simple delphi application: var a, b: double; stored8087cw: word; begin coinitialize(nil); try b := 0; := 1 / b; except on e: exception writeln(e.classname, ': ', e.message, ' (expected type of exception)'); end; stored8087cw := get8087cw; writeln('code .net com: ', coexampleofcom.create.dosomething); set8087cw(stored8087cw); //it's show 8087 control word doesn't change try b := 0; := 1 / b; except on e: exception writeln(e.classname, ': ', e.message, ' (unexpected type of exception! why stack ove

c++ - Most basic working vbo example -

i want know simplest method using vbo's in opengl... have tried running few examples work clouded other information thats making confusing me... @ moment have gluint vboid = 0; const int trisize = (m_tris.size()/2)*3;//m_tris index array verts , normals glfloat* vertices = new glfloat[trisize]; glfloat* normals = new glfloat[trisize]; int j=0; (int i=0; i<m_tris.size(); i+=2) { normals[j] = m_normals[m_tris[i+1]*3]; vertices[j++] = m_vertices[m_tris[i]*3]; normals[j] = m_normals[m_tris[i+1]*3+1]; vertices[j++] = m_vertices[m_tris[i]*3+1]; normals[j] = m_normals[m_tris[i+1]*3+2]; vertices[j++] = m_vertices[m_tris[i]*3+2]; } //im pretty sure loop right used before display mesh correctly without vbo's using glvertex3f glgenbuffersarb(1, &vboid); glbindbufferarb(gl_array_buffer_arb, vboid); glbufferdataarb(gl_array_buffer_arb, sizeof(vertices)+sizeof(normals), 0, gl_static_draw_arb); glbuffersubdataarb(gl_array_buffer_arb, 0, sizeof(vertices)

iphone - Check if delegate still exists before calling respondsToSelector -

i have made uiview sub class deal iads , admob. view controller sub class delegate , works ok. however, view controller disappears before ad has been fetched. resolve set delegate nil in view controller's dealloc implementation. the problem have respondstoselector: method ran @ same time view controller getting deallocated. causes crash. know how may rearrange this? the ad view on 10 different view controllers 1 place create ad code. many thanks one easy way retaining view until had chance set delegate nil, , release it. can ensure object still alive , prevent crashes.

automapper - simplest option to only write to destination property if the source property is different? -

note: scenario using 2 entity framework models sync data between 2 databases, i'd imagine applicable other scenarios. 1 try tackling on ef side (like in this question ) wanted see if automapper handle out-of-the-box i'm trying figure out if automapper can (easily :) compare source , dest values (when using sync existing object) , copy if values different (based on equals default, potentially passing in func, if decided string.equals stringcomparison.ordinalignorecase particular pair of values). @ least scenario, i'm fine if it's restricted tsource == tdest case (i'll syncing on int's, string's, etc, don't think i'll need type converters involved) looking through samples , tests, closest thing seems conditional mapping (src\unittests\conditionalmapping.cs), , use condition overload takes func (since other overload isn't sufficient, need dest information too). looks on surface work fine (i haven't used yet), end specifying every memb

asp.net - The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'Negotiate,NTLM' -

i have wcf service being called web application. wcf service call made on ssl port 443. when application makes call, recieve following error message in log file: http request unauthorized client authentication scheme 'ntlm'. authentication header received server 'negotiate,ntlm' i checked iis authentication headers on machine(iis 5.1) , machine wcf service deployed(iis 6.0) using cscript command: for iis 5.1 adsutil set w3svc/1/ntauthenticationproviders "negotiate,ntlm" simlilarly, header has been set on server machine iis 6.0 using command: adsutil set w3svc/1/root/ntauthenticationproviders "negotiate,ntlm" i have repeatedly checked headers , have same value of "negotiate,ntlm" @ both ends, yet service call failing. kindly help. with ntlm authentication, user executing on calling server must verifiable within domain within headers. mean iis 5.1 machine have have iis instance (application pool) running under domain

android - How i should integrate twitter in my app? -

i want integrate twitter in android app. i have used twitter4j,jtwitter think might went wrong somewhere. if having sample demo created them plz upload it. thnx 4 help.... you can add share functionality app. final intent intent = new intent(intent.action_send); intent.putextra(intent.extra_text, "something share"); startactivity(intent.createchooser(intent, "share")); this create chooser user can select activity can handle intent.action_send intent. includes sms app, gmail, facebook, twitter, etc.

Set property of vba class with object reference -

i have class module, named normal , in vba following code: private mline lineelement public property line() lineelement line = mline end property public property set line(byref vline lineelement) mline = vline end property this class used following code: sub run dim line lineelement set line = new lineelement dim norm normal set norm = new normal set norm.line = line 'fails here "object variable or block variable not set"' end sub also, if change code in normal class module to: private mline lineelement public property line() lineelement line = mline end property public sub setline(byref vline lineelement) 'changed property sub' mline = vline end property and failing line norm.setline( line ) i "object not support property or method" error. doing wrong in both of these cases? try this: private mline lineelement public property line() lineelement set line = mline end proper

winapi - escaping string on Windows command line -

i'm trying pass string win32 program command line printed without changes. why have escape "aaa <bbb@pobox.com>" """aaa <bbb@pobox.com>""" but "aaa <bbb@pobox.com>", (comma included) "\"aaa ^<bbb@pobox.com^>\"," i see no consistency in escaping rules windows command line p.s. i'm trying generate .cmd file update: i'm using simple c program testing compiled gcc, no additional object files linked. if replace perl, rules remain same. i'm trying create general escaping algorithm. generate .cmd file call perl output redirect. have problem if string contains odd number of double quotes escaped backslash, output redirect not function. same problem described in last comment http://blogs.msdn.com/b/oldnewthing/archive/2010/09/17/10063629.aspx . if use "" escape ", splits on space, result 2 parameters instead of one. "" has artifacts.

html lists - CSS using images instead of bullets -

i want use 3 different images instead of bullets create lisli>t example: <ul> <li>the dog big</li> <li>the dog small</li> <li>the dog medium sized</li> </ul> so instead of bullets before each of above phrases there different image before each. live demo this makes use of css property list-style-image . html: <ul> <li class="b1">the dog big</li> <li class="b2">the dog small</li> <li class="b3">the dog medium sized</li> </ul> css: ul { margin: 0 0 0 32px; line-height: 1.5 } .b1 { list-style-image: url(http://upload.wikimedia.org/wikipedia/commons/1/19/icons-mini-icon_attachment.gif); } .b2 { list-style-image: url(http://upload.wikimedia.org/wikipedia/commons/6/61/icons-mini-icon_security.gif); } .b3 { list-style-image: url(http://upload.wikimedia.org/wikipedia/commons/a/ab/icons-mini-icon_

entity framework - Map two different entities to the same table? -

i have table in database lot of fields. most of time need fields . there 1 scenario, however, need few of fields, , loading ton of rows. what i'd add in entity manually, , map original table, delete columns don't need. set up, rather self-explanatory error of: problem in mapping fragments ...entitysets 'fmvhistorytrimmed' , 'fmvhistories' both mapped table 'fmvhistory'. primary keys may collide. is there other way should go this? again, of time of columns used, don't want trim down original entity , put "extra" fields complex type. you can't map 2 regular entities same table. have several choices: use table splitting. use custom query projection non entity type (as @aducci proposed) use queryview use database view or directly definingquery table splitting table splitting allows map table 2 entities in 1:1 relation. first entity contain pk , subset of fields need always. second entity contain

windows - Looking for a simple audio playback library for C++ -

i'm working on simple audio player, going quite well, using qt , everything. i'm in need of solid simple audio library. don't need fancy such 3d sound , know else these things got nowadays. i'm looking simple , efficient. a list of features i'm looking for: audio playback files .ogg, .mp3 , .flac should supported @ least. should able pause playback. i planning use in c++ see. nothing huge or anything, @ same time having hard time finding suitable. platform i'm targeting windows 7. anyone out there knows might looking for? the best possible choice in opinion bass audio library, not open source, free non-commercial use. it used aimp2 audio player, can use check sound quality, natively supports lot of formats including mp3 , ogg, , uses plugins support more, including flac.

objective c - How to convert Obj-C code into a library -

i have 3 apps written in obj-c want modify , convert libraries, can use them in monotouch app. where find docs tell me how take obj-c code , turn libraries? imagine have file called lib1.m you first have compile object code. instance: gcc -wall -framework cocoa -o lib1.o lib1.m that create lib1.o then you'll have decide wether want static or dynamic library. to build static library, you'll need library object first: glibtool --quiet --mode=compile gcc -o lib1.lo -c lib1.c then can create static library library archive: glibtool --quiet --mode=link gcc -o lib1.la -c lib1.lo to build dynamic library: libtool -dynamic -flat_namespace -lsystem -undefined suppress -macosx_version_min 10.6 -install_name /usr/local/lib/lib1.dylib -o lib1.dylib lib1.o note dynamic libraries, must provide install path when creating library.

html - Internet explorer hangs while loading a website -

when loading website ( censored ), hangs couple of seconds before loading page (up minute on older ones of internet explorer) in other browsers works fine. it's basic wordpress website couple of javascript , stylesheets, nothing fancy. firebug doesn't show weird in net-panel, files exist. also other sites using same plugin (for properties), same problem exists. should plugin related, can't find why. any suggestions? i loaded ie9 , loads quick. however, if turn on ie9 dev tools, go network, switch ie8 standards mode , start capturing, see lot of 404s on images not occur when using ie9 standards. may issue. luck. – matt feb 23 @ 16:55 just question answered, @matt

javascript - Monitoring DOM changes on the server side with node.js -

Image
i'm wondering if possible load website twitter search results page using node.js jsdom , still able detect changes in dom after initial render. example: initial page modified page thanks help. if want detect changed in dom tree need understand minified twitter's javascript code , intercept events or callbacks. don't suggest approach because js code works in browser may break when using jsdom. instance, when trying server side scrapping jquery got stuck bug in browsers not issue. for time being, recommend consume search api directly twitter more straightforward approach. hope helps!

Can the container background image be inherited in a child container using CSS? -

if have body using background image , div inside body using set background , color, how can override div's style use body's background image? don't want set background of div image positioning of image off. i don't want set background of div image positioning of image off. you mean want body's actual background image visible (not url being inherited) though div has background color defined? not possible. you have give div background-color: transparent make body's background image shine through.

database - How do I sort events created by different clients based on a global clock? -

i have newsfeed program, , i've got many client applications (about 70) across few timezones generate events, example when secretary schedules meeting adds list on server. list served every client wants view it. each record has following metadata: random unique id local timestamp (yyyy:mm:dd:h:m:s:ms) how sort these events on server, such appear in correct order submitted in? mixed since local timing doesn't match. don't have utc timestamps (can calculate these locally?), i'm wondering if can make-do information got... or should getting more information each client? noticed clients in same timezone events mixed because system time not synchronized (is possible know exact global time, or synchronize system time server on windows?) i'm not asking code, need pointer in right direction. when storing temporal values essential use utc. else , you're screwed. should store related timezone along utc.

c - Is there something wrong in #define and && -

i wonder if bad idea makes such defines in c: #define , && #define or || #define not ! it bad idea yourself. if want names and instead of symbols && , can include <iso646.h> c standard library header, defines several named operators, including 3 mention. in c++, alternative representations (like and , or ) operators built language, don't need include header use them, , isn't possible define them macros (a macro name must identifier, , alternative representations operators, not identifiers, during preprocessing).

php - Login system concept & logic? -

i want know process web apps follow maintain login between multiple requests , how manage things using cookies. in login form providing "remember me" feature. when user login check username , password validity database. if valid check if "remember me" selected, if yes storing username , password in session, encrypted format. , storing username , password in session. when user navigates form 1 page another, first run login check script checks if there value in cookies, validates username , password database, check validity. if there no value in cookie , there value in session, fetching session value dnot checking db. i not checking session value form db not hit db unnecessarily, speed things. in case of cookies, can modified, check needed. this concept, right? way go , website slike so, , other works on kind of method? or websites check login authenticity on each page load, no matters in session or in cookies? please check , give thoughts , concepts

Spring, Hibernate - many-to-many - LazyInitializationException -

i have 2 models. user: @entity public class user implements serializable { long id; string name; list<car> cars; public user() { } public long getid() { return id; } public void setid(long id) { this.id = id; } public string getname() { return name; } public void setname(string name) { this.name = name; } public list<car> getcars() { return cars; } public void setcars(list<car> cars) { this.cars = cars; } } car: @entity public class car implements serializable { long id; string mark; public car() { } public long getid() { return id; } public void setid(long id) { this.id = id; } public string getmark() { return mark; } public void setmark(string mark) { this.mark = mark; } } mapping fies: user: <hibernate-mapping> <class name="com.bontade.phone_book.mvc.spring.models.user" table="users&q

visual studio - "Add SSIS Connection Manager" Dialog Doesn't Contain Custom Connection Manager -

i attempting create custom connection manager performing sftp operations within ssis. have completed implementation, strong-named assembly , installed in both gac , c:\program files\microsoft sql server\90\dts\connections folder. problem "add ssis connection manager" dialog doesn't show new connection type , i'm @ loss how diagnose issue. far have ensured has full control c:\program files\microsoft sql server\90\dts\connections folder. possibly related issue cannot see assembly when browse gac, though gacutil program reports success when run add assembly. what steps follow diagnose root cause of issue? there else need check make possible add add custom connection manager? edit: should note custom connection manager compiled using .net 4.0. why cannot see assembly in gac after installing believe, assembly being placed in %windir%\microsoft.net\assembly folder rather %windir%\assembly folder. using .net 4.0 because of this issue . edit #2: turns out if cre

Has anyone gotten the Liferay portal to deploy onto an Eclipse Virgo Web Server? -

i trying deploy liferay portal onto eclipse virgo web server , haven't had luck. have @ least solved 2 of problems involved in process: 1) portal.jar part of liferay dependencies has malformed manifest. bundle-symbolicname incorrectly sets value "jsr 286" when should "jsr286" (no space). also, import-package has bunch of spaces/tabs , removed those. took care of problem 1. 2) virgo web server wasn't finding liferay dependency jars (at least not putting them), stuck dependencies main liferay.war , has gotten rid of error messages. unfortunately, didn't solve overall problem. perhaps there other issues, virgo not reporting errors. i've looked on both liferay , virgo forums, no 1 seems have answer this, i'm hoping here has had more success me. if so, please let me know tried work. a little more detail: used liferay-portal-6.0.5 war not bundled app server. and, i'm using virgo 2.1.0. thanks, david i got it! http

Why does Git remember and use a conflict resolution from an aborted rebase without asking me? -

i did rebase on branch foo git rebase master did conflict resolutions, decided didn't want it, , aborted. git rebase --abort all branch log histories normal. want start same process again. git rebase master when git hits first conflict hit first time, lists files in conflict did before. instead of marking conflict <<<<< etc, shows file in state after resolved conflict first time. interesting has feature… want resolve 1 of conflicts differently, don't want remember , re-apply. what going on here, , can turn off? you can use rerere's "forget" function erase remembered conflict resolution.

c - Why are executables in machine code operating system dependent? -

in windows, when compile simple 'c' program, final executable machine code .exe . same thing using gcc in unix yields .out machine code file. what's difference between these? my basic question is, .exe , .out being machine codes, why operating system dependent? as in, in unix cannot execute .exe directly , in windows, can't execute .out of unix. why so? it has how program loaded. windows , linux have different formats how want program define itself. in linux, elf format used. windows pe . these formats define different data program needed execute machine instructions. also, operating system interfaces different, different libraries need used , different system calls need made. for simple program, can recompile on other operating system have work on both, not able use single file on both.

c# - What is a good SDK for GIS on Windows Mobile? -

i'm looking suggestions gis sdk on windows mobile. needs able display esri shapefiles efficiently. have looked @ esri one? or talking older windows mobile? http://www.esri.com/software/arcgis/smartphones/index.html

android - Can someone explain RemoteViews GC behavior? -

i have download task reports progress notification periodically. awhile using 1 removeview private member update each time. for example: private remoteviews mremoteview; protected void oncreate(){ mremoteview = new remoteviews( getpackagename(), r.layout.custom_layout ) contentview.setimageviewresource(r.id.notification_icon, r.drawable.downloads); contentview.settextviewtext(r.id.notification_text, "downloading file " + (int)( (double)progress/(double)max * 100 ) + "%"); contentview.setprogressbar(r.id.mprogress, max, progress, false); notification.contentview = contentview; mnotificationmanager.notify(hello_id, notification); } protected void onprogressupdate(integer... prog) { contentview.setprogressbar(r.id.mprogress, max, progress, false); mnotificationmanager.notify(hello_id, notification); } however, found gc clearing out space , slowing app down crawl long time. tried creating new remoteviews each time updated, , w

weird devise/rails issue not sending username -

i have added username devise authentication setup, , reason, it's not inserting username database. database puts null in username field. i have included code migration, , form, production log shows sent actual username. here did: so added migration add username, successful: class addusernametousers < activerecord::migration def self.up add_column :users, :username, :string end def self.down remove_column :users, :username end end i edited app/views/devise/registrations/new.html.erb include text field username: <h2>sign up</h2> <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) |f| %> <%= devise_error_messages! %> <p><%= f.label :username %><br /> <%= f.text_field :username %></p> <p><%= f.label :email %><br /> <%= f.text_field :email %></p> <p><%= f.label :password %><br /> <%= f.pass

javascript - Is document.referrer cross browser compatable? -

i'd use document.referrer informal referrer check. element cross brower compatible? browser throw error when trying reference document object? the document.referrer property described in dom spec: http://www.w3.org/tr/dom-level-2-html/html.html#id-95229140 so should supported cross-browser. however, can detect if implementation support property like if( 'referrer' in document ) { console.log(document.referrer); }

image processing - How to align two different pictures in such a way, that they match as close as possible? -

i need automatically align image b on top of image a in such way, contents of image match possible. the images can shifted in x/y directions , rotated 5 degrees on z, won't distorted (i.e. scaled or keystoned). maybe can recommend links or books on topic, or share thoughts how such alignment of images done. if there wasn't rotation problem, try compare rows of pixels brute-force method until find match, , know offset , can align image. do need ai this? i'm having hard time finding resources on image processing go detail how these alignment-algorithms work. so people in case first find points in images match compute best transformation matrix least squares. point matching not particularly simple , times use human input task, have time calibrating cameras. anyway, if want automate process can use feature extraction techniques find matching points, there volumes of research papers written on topic , standard computer vision text have chapter on thi

c - What is the scope of yacc/bison actions? -

i'm attempting write (relatively) simple config file parser in flex / bison . basic idea bison grammar uses c functions organize parsed data series of c structs. i'd happy post code if thinks necessary answer question, comment. the issue i'm running involves scope of procedures within bison actions. example, if have like: set : ntok name { section *sec init_s(sec, $2); add_s(cf, sec); } shouldn't sec available in later rule of grammar use? i'm getting error: 'sec' undeclared when try call argument again later on. can enlighten me? all code generated actions in bison in own scope (iirc, generated code wraps in curly-braces enforce this). if want make data globally available other actions, you'll need explicitly declare global variable somewhere (perhaps @ top of flex or bison script?), write variable. rationale be

c# - How can I programmatically check-out an item for edit in TFS? -

i'm working on utility processing files being under source control using tfs 2010. if item not yet checked-out edit, i'm getting exception, predictable because file in read-only mode. what ways exist check-out file? p.s. want programmatic rather process.start("tf.exe", "..."); if that's applicable. some of other approaches mentioned here work versions of tfs or make use of obsolete methods. if receiving 404, approach using not compatible server version. this approach works on 2005, 2008, , 2010. don't use tfs longer, haven't tested 2013. var workspaceinfo = workstation.current.getlocalworkspaceinfo(filename); using (var server = new tfsteamprojectcollection(workspaceinfo.serveruri)) { var workspace = workspaceinfo.getworkspace(server); workspace.pendedit(filename); }

iphone - How do I populate an NSMutableArray in one class with another object? -

i know simple answer, can't seem find solution. created object in own class , trying populate data class. simple data types nsstring, have no problem, when trying make nsmutablearray equal nsmutablearray or when try populate nsmutablearray objects (like strings), keep getting exception errors... here object trying populate: #import <foundation/foundation.h> @interface rssfeedlist : nsobject { nsstring *subject; nsmutablearray *rssfeeddetail; } @property (nonatomic, retain) nsstring *subject; @property (nonatomic, retain) nsmutablearray *rssfeeddetail; @end this how able populate nsstring 'subject' in class: rssfeedlist.subject = @"test"; however, if follow similar convention within same class respect array, throws exception: rssfeedlist.rssfeeddetail = rssitemdetailarray; where rssitemdetailarray nsmutablearray have built in same class. i have tried add items (i tried strings testing) nsmutablearray directly no avail: [rssfeedli

flash - AS2 Nested Child MC gotoAndPlay Another Child Movie Clip -

how gotoandplay frame number of child mc child mc? i have movieclip has 4 nested child movieclips. mca - mcb - mcc - mcd inside mcc @ end of movie clip trying gotoandplay specific frame inside mcb. i have tried: movieclip(_root).mcb.gotoandplay(181); and mcb.gotoandplay(181); but no luck. any appreciated. in advance! if understand coorectly, , mcc child of mcb , need on last frame of mcc is: _parent.gotoandplay(181);

github - git accidental inclusion of password..how do I fix it? -

on commit accidentally included password. how remove commit repository? the push went github it's important commit removed history. see here: http://help.github.com/removing-sensitive-data/

Any faster way of copying arrays in C#? -

i have 3 arrays need combined in 1 three-dimension array. following code shows slow performance in performance explorer. there faster solution? for (int = 0; < sortedindex.length; i++) { if (i < num_in_left) { // add instance left child leftnode[i, 0] = sortedindex[i]; leftnode[i, 1] = sortedinstances[i]; leftnode[i, 2] = sortedlabels[i]; } else { // add instance right child rightnode[i-num_in_left, 0] = sortedindex[i]; rightnode[i-num_in_left, 1] = sortedinstances[i]; rightnode[i-num_in_left, 2] = sortedlabels[i]; } } update: i'm trying following: //given 3 1d arrays double[] sortedindex, sortedinstances, sortedlabels; // copy them on 3d array (forget rightnode now) double[] leftnode = new double[sortedindex.length, 3]; // magic happens here leftnode = {sortedindex, sortedinstances, sortedlabels}; use buffer.blockcopy . entire purpose perform

arrays - How to bind mysqli bind_param arguments dynamically in PHP? -

i have been learning use prepared , bound statements sql queries, , have come out far, works ok not dynamic @ when comes multiple parameters or when there no parameter needed, public function get_result($sql,$parameter) { # create prepared statement $stmt = $this->mysqli->prepare($sql); # bind parameters markers # not dynamic enough... $stmt->bind_param("s", $parameter); # execute query $stmt->execute(); # these lines of code below return 1 dimentional array, similar mysqli::fetch_assoc() $meta = $stmt->result_metadata(); while ($field = $meta->fetch_field()) { $var = $field->name; $$var = null; $parameters[$field->name] = &$$var; } call_user_func_array(array($stmt, 'bind_result'), $parameters); while($stmt->fetch()) { return $parameters; //print_r($parame

GWT RequestFactory: implementing InstanceRequest methods in separate services -

i using class separate dao handle access requests, don't know how implement instancerequest methods: public class service { public static dao finddao(long id); } @service(service.class) public interface daorequestcontext extends requestcontext { request<proxyfordao> finddao(long id); instancerequest<proxyfordao, long> persist(); } i define public long persist() in dao implementation, because gwt docs say , "on server, instance methods must implemented non-static methods in entity type," request factory can't seem find it: severe: not find methods named persist in com.activegrade.server.data.service feb 23, 2011 10:03:02 pm com.google.gwt.requestfactory.server.servicelayerdecorator die how implement instance method in service ? don't know how transform instancerequest . need connect dao class service way, code generator knows in service methods skip on dao instancerequest calls? asaik it's not possible beca

javascript - Drop down menu not dropping -

i attempting simple drop down menu using javascript when hover on link should display drop down menu nothing happens. think wrong javascript? javascript: function onhover( divid ) { var div = document.getelementbyid( divid ); if (div) { div.classname = "unhidden"; } } function onleave( divid ) { var div = document.getelementbyid( divid ); if (div) { div.classname = "hidden"; } } my css: .hidden { visibility: hidden; } .unhidden { visibility: visible; z-index: 30; } and html: <li> <a onmouseover="onhover('otherlinks)" onmouseout="onleave('otherlinks')">other links</a> <div class="hidden" id="otherlinks" onmouseover="onhover('otherlinks)" onmouseout="onleave('otherlinks')"> <ul> <li><a href="events.html"

For MediaWiki Skin Setting HTML Title to "[Site Name]" instead of "Main Page - [Site Name]" -

i'm using custom version of monobook skin. how set html title "[site name]" instead of "main page - [site name]"? you should able put following in common.js, , execute on main page. if {{{{pagename}}=="main page" { document.title = "{{sitename}}"; } it's not totally correct because don't know javascript.

How to embed and display Google Calendar in Zotonic the Erlang CMS -

i'd able save iframe of google calendar media item , attach resource. haven't been able working. i saved iframe code media item, selecting embedded code , choosing 'other' created rsc , attached media item it. i'm either not referring correctly in template or item not being stored properly. can shed light on how this. apologize if simple thing, can't seem figure 1 out. much appreciation. jeff solved: i getting confused on how save media item , reference in template. i'm open suggestions or comments solution. from google calender settings, copied embed code (this private or public calendar) in zotonic created category called calendar i added new media item. selected "embed code", entered title, selected other "from site" , pasted code. assigned id 387. i changed category of media item media->document , save item. i added rsc page , selected category calendar. page's id 388 , slug "building-pro