Posts

php - Redirect file upload -

i'm building website in php have split project in 2 parts, api , "web application". api accessed @ http://api.localhost , other part @ http://localhost . now on http://localhost i've added dropzone form want handle request @ http://api.localhost/upload . since it's different domains, dropzone doesn't seem allow out of box. can upload file http://localhost , somehow redirect file http://api.localhost/upload ? or there else can try?

Rails delete table row via migration -

i'm trying delete several rows in table actionable_items via following migration. have debugged , can confirm variables store table row not nil. migration runs successfully, doesn't delete row table. also, know why can debug migration when run rake db:migrate:redo not when run rake db:migrate ? class removeactionableitems < activerecord::migration class actionableitem < activerecord::base attr_accessible :actionable_item, :name, :sequence, :type end class menuitemtemp < actionableitem self.table_name = "actionable_items" end class insightreportmenuitemtemp < actionableitem self.table_name = "actionable_items" end def validation_settings = menuitem.find_by_name("validation settings") identifier_lookup = menuitem.find_by_name("identifier lookup") compliance = insightreportmenuitem.find_by_name("compliance") debugger validation_settings.destroy! #unless validation...

active directory - Is Microsoft AD based on an LDAP Spec? -

ldap protocol connecting , querying directory services. when microsoft created ad did design upon ldap specification? im trying understand if ad based on ldap in form compatible ldap? or can ldap integrate backend (within reason) , configuration of ldap contains logic in how ldap connects backend directory service db/data store, ldap can used query data stored within it? i can never seem find definitive answer question when read ad/ldap based articles online. yes, if want query adsi using ldap port (in backend program) can without problem . also if want view in ldap type context can download , install "softerra ldap browser 4.5 " on windows system uses adsi , display ldap "cn=users,dc=demo,dc=com" etc if need sample code, create question specification users happy you. more ever connecting ldap doesn't require external libraries if using java. while connecting adsi may require com components

java - Accessing private members for unit testing -

usually when i'm writing unit test in c++, declare test class friend tesee. way can inspect results of operation directly inspecting member variables. java not have friends, how achieve same behavior? i'm not talking simple getters , setters here testing trivial, situations results of operation stored internally in class , it's not exposed outside world. if don't want use frameworks can java reflections accessing value of private field using reflection in java person privateryan = new person("john" , "8989736353"); field privatefield = person.getdeclaredfield("phone"); //this call allows private fields accessed via reflection privatefield.setaccessible(true); //getting value of private field using reflection string value = (string) privatefield.get(privateryan); accessing private method using reflection method privatemethod = person.getdeclaredmethod("call"); //making private method accessible using reflect...

javascript - Uncaught TypeError: Cannot set property '1' of undefined -

now wierd, calling function "sorttiles()" twice, first time, loops through, , returns beautiful array, it's supposed do. second time call it, doesn't work, , throws error stated in title specific line: tiles[y][x] = tile; . the first time around, returned array "sorttiles()" put global array called "solution". second time function called, tiles x , y coordinate solution array. what i'm doing here scans sliding puzzle, of html5 canvas , prnt_scrn+paste website. , said, first time it, take screenshot of solution, paste in, , marks out coordinates fine. second time, throws error :( function gettile(x, y) { var id = 0; (i = 0; < 2; i++) { (i2 = 0; i2 < 2; i2++) { var data = context.getimagedata(x + * 48 + 5 - (i * 10), y + i2 * 48 + 5 - (i2 * 10), 1, 1).data; id += data[0] + data[1] + data[2]; } } return id; } function findtile(number) { (y = 0; y < 5; y++) { (...

c++ - Cannot open type library file: 'msxml.dll': No such file or directory -

i'm trying reverse engineering old .net tool written c++. problem begins in line: import "msxml.dll" named_guids i understand old system dll file replaced msxml3.dll or msxml6.dll. found both msxml3.dll , msxml6.dll in system32 folder , mange import error appears: error c2653: 'msxml' : not class or namespace name please advice , spread light on issue. thank you. solution: change msxml msxml3 , change msxml msxml2

Django: Save multiple Prefetch() objects in a variable or method -

the documentation displays how save prefetch() object in variable: >>> prefetch = prefetch('choice_set', queryset=voted_choices, to_attr='voted_choices') >>> question.objects.prefetch_related(prefetch).get().voted_choices [<choice: sky>] however, prefetch_related accepts many prefetch() objects separated comma: >>> question.objects.prefetch_related(prefetch('choice_set'), prefetch('foo')).get().voted_choices how prefetch() sequence saved in variable -or better in method- in order reusable? i prefer add these prefetch related clauses in custom queryset , access created lists through model properties, if exist. usage: post.objects.filter(...).prefetch_comments()... class postqueryset(models.queryset): def prefetch_comments(self): inner_qs = comment.objects.order_by('-date') return self.prefetch_related(prefetch("comments", queryset=inner_qs, to_attr="comme...