Posts

Showing posts from August, 2012

push - Difference among Comet servers and XMPP servers -

in next planned project suppose implement online classroom website in want share black board (say simple text area) among tutor , participating online students {these logined through website}. whatever text tutor writes on black board has seen other participants in real-time. i want use java development platform. to implement started googling on push technology. read xmpp implementation servers , xmpp libraries can used implement near-realtime applications collaberative applications/mutiparty games/im applications etc., read blazeds usage real-time , low-lattency web applications. my questions are, what difference among these xmpp java based implementation , blazeds? not both techs final goal achieve low-lattency web apps using push technology? what difference among comet servers , xmpp servers? differ in way implement push technology or thing else? i confused. please explain me these little more know before things , start on next in project. thanks to

innodb - Mysql 'Got error -1 from storage engine' error -

i have myism table 'test' holds out-dated data, want recreate table, columns same except changed storage myism innodb. dumped sql used recreate table like: drop table test; create table test ( ... ) engine=innodb insert test(...) values(...) that's got error "got error -1 storage engine", have googled around, of results focus on corrupted innodb tables. while case don't think it's broken, it's missed @ drop , create statements. another thing is after executed above sql, that's left table test file named file.frm, guess innodb table needs other stuff run on not sure what. how can fix problem? , need more tasks of kind, what's correct procedure drop myism table , recreate them innodb ones? thanks. ok. found solution. issue caused innodb_force_recovery parameter in my.cnf, set 4. to solve problem, set 0 or remove parameter my.cnf if check error log, during query, mysql write in human readable language that: won't

package - Tcl: Interaction of extension loading and threads -

can several instances of tcl_packageinitproc() executing concurrently (in different threads), if tcl configured threads? for reasons of backward compatibility, believe invocations of initialization , unload procedures must serialized. the manual silent on behavior: invocations of these routines serialized, or must extension writers deal synchronization, in particular mutual exclusion, in these routines? tcl not guarantee functions called in serialized way; if code cares, must use suitable mutex. tcl provides portable primitives in c library, use this: #include <tcl.h> // easier have own function static void onetimesetup(void) { static int donesetup; tcl_declare_mutex(mymutex); tcl_mutexlock(&mymutex); if (!donesetup) { // critical once-only setup here donesetup = 1; } tcl_mutexunlock(&mymutex); } int my_init(tcl_interp *interp) { // declare api version we're using, e.g., 8.5... if (tcl_initstubs(in

ios - how to set an animation for all UIImageView instances by default -

i want write a (only one) method or category or else animation, so when setting uiimageview's image property, animation executed automatically. any idea? thanks. you can subclass uiimageview. add animationproperty. create animation block. call animation block setmethod of animationproperty.

typo3 file saving from backen with dynamic path -

i have save posts images. create directory each post , save images there, in backend if edit/save post relation between images , post dies, ideea how can configure saving path backend? anticipated. i guess forgot set directory in file: ext_emconf.php not done when creating dir in extension itself. maybe (or typo3) problem go file: ext_emconf.php: , edit array 'createdirs' => '

java - Multi-page text report with BIRT -

i have report need create birt 2 large sections of text. text come in xml, use xml datasource load text, how create text section span multiple pages, i'm not using tabular data or that. if have xml source 2 elements, each containing large section of text, can use xml data source or scripted data source. drop data set table, , set page break on detail row 1 row , always. break 2 large text elements separate pages.

iphone - Implement velocity in custom UIGestureRecognizer -

i have written custom uigesturerecognizer handles rotations 1 finger. designed work apples uirotationgesturerecognizer , return same values does. now, implement velocity cannot figure out how apple defines , calculates velocity gesture recognizer. have idea how apple implements in uirotationgesturerecognizer? you have keep reference of last touch position , it's timestamp. double last_timestamp; cgpoint last_position; then like: -(void) touchesbegan:(nsset *)touches withevent:(uievent *)event{ last_timestamp = cfabsolutetimegetcurrent(); uitouch *atouch = [touches anyobject]; last_position = [atouch locationinview: self]; } -(void) touchesmoved:(nsset *)touches withevent:(uievent *)event { double current_time = cfabsolutetimegetcurrent(); double elapsed_time = current_time - last_timestamp; last_timestamp = current_time; uitouch *atouch = [touches anyobject]; cgpoint location = [atouch locationinview:self.superview];

ruby on rails - Can't get has_and_belongs_to_many association to create -

this first time creating has_and_belongs_to_many association , being less cooperative. my models are class server < activerecord::base has_and_belongs_to_many :services and class service < activerecord::base has_and_belongs_to_many :services i'm trying create service through server object. i've gotten server object server = server.find_by_name(server_name) works fine. if try create services object, either service = server.services.new or server.services.create(params) following activerecord error: activerecord::hasandbelongstomanyassociationforeignkeyneeded: cannot create self referential has_and_belongs_to_many association on 'service#services'. :association_foreign_key cannot same :foreign_key. i haven't found in way of information error though. doing wrong? simple error: should has_and_belongs_to_many :servers in service class.

python - Use a class before its definition in Django model -

when try syncdb error menu not valid class name. how can resolve relationship case : class menuitem(model.models) title = models.charfield(max_length=200) submenus = models.manytomanyfield(menu, blank=true, null=true) class menu(container): links = models.manytomanyfield(menuitem) one of these models has many many, other 1 uses django's reverse relations (https://docs.djangoproject.com/en/dev/topics/db/queries/#following-relationships-backward) so how set up: class menu(container): links = models.manytomanyfield(menuitem) class menuitem(model.models) title = models.charfield(max_length=200) then when wanted menuitem's menus: menu_item_instance.menu_set.all()

What is an efficient algorithm for simulating purchasing decisions? -

i'm attempting code simple game-like simulation of consumer purchasing products. i'm looking algorithm satisfies following: inputs: an amount of money consumer has spend a collection of want scores, w1...wn (where higher value means consumer wants more) a collection of products, each product has: a collection of want scores, s1...sn (where value corresponds how product satisfies particular want) a price a number in stock output: a set of pairs of form (product, numbertobuy). amount products satisfy wants of consumer subtracted values w1...wn, "perfect" solution 1 resulting sum of w1...wn minimum. the set must satisfy following absolute constraints: numbertobuy less or equal number of product in stock. the sum on entire set of price of product multiplied number of product buy less or equal money consumer has. if there multiple solutions result in w1...wn being @ same minimum, best 1 of sum of price of of products purchase lowest. price

Why is Groovy Eclipse's Organize imports putting the package declaration below imports, making my file uncompileable? -

why organize imports function in groovy eclipse plug-in put imports above package declaration , make file uncompileable? there work-around? the current version of plug-in gets confused when there imbalanced parentheses. editor becomes less helpful finding , fixing kind of error. solution found open file in programming editor (such emacs) find unbalanced pair.

htmlunit - HTML Unit - login to secure website using form - can't connect to page after form -

i'm newbie java htmlunit appreciated - in advance. i'm trying login webpage protected username , password authentication submitting username , password form on webpage using htmlunit mirror actions of web browser. website has form based authorisation. import java.io.bufferedwriter; import java.io.file; import java.io.filewriter; import java.util.iterator; import java.util.set; //import htmlunit classes import com.gargoylesoftware.htmlunit.webclient; import com.gargoylesoftware.htmlunit.html.htmlform; import com.gargoylesoftware.htmlunit.html.htmlpage; import com.gargoylesoftware.htmlunit.html.htmlsubmitinput; import com.gargoylesoftware.htmlunit.html.htmltextinput; import com.gargoylesoftware.htmlunit.util.cookie; //this class attempts submit user , password credentials //and mirrors how login button clicked on webpage: public class submitform { public static void main(string[] args) throws exception { webclient webclient = new webclient();

c# - Telerik Radgrid Can we save a unique value against each column? -

i generating columns dynamically in radgrid, column count , names generated on fly , datatable grid bound to. each column either represents object in system, or empty 1 user create new object. each object identified unique value property. set value column, so, when grid edited, use value , update object. open suggestions. thinking options assigning value property in gridtemplatecolumn (which dont think possible) use hidden field in header of column (how do it?) to more clear, both rows , columns generated dynamically. using datakeynames rows. wondering how should storing unique values columns! any appreciated. thanks! i doubt if official telerik support exists here situation. 1 quirky solution employ row of hidden fields, 1 field per column, each storing unique value column.

Reading a json encoded array in javascript -

this php function returns json encoded object javascript through ajax. create variable json object stringify. var event_id = json.stringify(rdata.event_id); when print variable looks this. [{"0":"e20111129215359"},{"0":"e20120301133826"},{"0":"e20120301184354"},{"0":"e20120301193226"},{"0":"e20120301193505"},{"0":"e20120303182807"},{"0":"e20120303205512"},{"0":"e20120303211019"},{"0":"e20120306182514"},{"0":"e20120307122044"}] how access each element of event_id? don't stringify it. it's valid javascript object, access directly with: rdata.event_id[0]["0"]; // e20111129215359 // or read them in loop (var i=0; i<rdata.event_id.length; i++) { console.log(rdata.event_id[i]["0"]; } the value rdata.event_id array [] containing bunch

Twitter API Authenticate vs Authorize -

hi tell difference between twitter authenticate , authorize $twitterconnect = new twitteroauth(consumer_key, consumer_secret); $twittertoken = $twitterconnect->getrequesttoken(); $redirect_url = $twitterconnect->getauthorizeurl($twittertoken, true); // authenticate $redirect_url = $twitterconnect->getauthorizeurl($twittertoken, false); //authorize with oauth/authenticate if user signed twitter.com , has authorized application access account silently redirected app. with oauth/authorize user allows see allow screen regardless if have authorized app.

Checking hardware acceleration in the Transcoding sample application(Metro UI) -

in sample example provided microsoft(transcoding sample application) need check whether hardware acceleration enabled or not. using code var hardwareaccelerationenabled = mediatranscoder.hardwareaccelerationenabled; mediatranscoder.hardwareaccelerationenabled = hardwareaccelerationenabled; but while compiling showing following error: javascript runtime error: 'mediatranscoder' undefined kindly help. in advance. you need create instance of mediatranscoder object first using "new". example below: var mediatranscoder = new windows.media.transcoding.mediatranscoder(); var hardwareaccelerationenabled = mediatranscoder.hardwareaccelerationenabled;

android - How can i make my bitmap passed to another activity be visible? -

i have 2 activities own gridviews , adapters , want pass data(containg both image (in form of bitmap resources)and text) 1 activity other. problem having image. not display on gridview text , when try add data, overwrites former one. please can tell me doing wrong or need do? (i want application function when adding favourite online radio station preset list). below acitivies (cropped) first activity com_res=getresources(); comm_appslist=new arraylist<appis_infos>(); comm_appslist.add(new appis_infos(bitmapfactory.decoderesource(com_res, r.drawable.skype), "skype","com.skype.raider")); comm_appslist.add(new appis_infos(bitmapfactory.decoderesource(com_res, r.drawable.yahoomessenger),"messenger","com.yahoo.mobile.client.android.im")); public boolean oncontextitemselected(menuitem item) { // todo auto-generated method stub adapterview.adaptercontextmenuinfo info = (adapterview.adaptercontextmenuinfo)item.getmenuin

xamarin.android - Monodroid is able to use any default theme? -

i know if can use android default themes in app avoid create manually, , way invoke. resources in mono android same in standard android applications, including styles , themes. if wanted apply light theme entire application, example, creating application class , specifying theme in attribute: [application(theme = "@android:style/theme.light"] public class myapplication : application { }

php - read individual img src from folder contents into HTML -

i trying write simple code, not sure use, javascript or php. have structured html docs , want insert image folder each img src attribute. need read in contents , insert each one, 1 one. <div class="slideshow"> <div class="wrapper"> <ul> <li> <div class="main"> <a href="product1.html"><img src="images/sample/name1-1.jpg" alt="" width="630" height="400" /></a> </div> <div class="second"> <img src="images/sample/name1-2.jpg" alt="" width="310" height="190" /> </div> <div class="third"> <img src="images/sample/name1-3.jpg" alt="" width="3

flash - Using Stage 3D inside a Direct3D or OpenGL application -

before there stage 3d, capture output of flash rendering engine in-place site , use texture. now, there stage 3d seems can't rendered windowless... is there way capture output of flash control running in direct mode? or there way let them render supplied surface? you can capture stage3d buffer bitmapdata try method context3d.drawtobitmapdata() var renderedbitmapdata:bitmapdata = new bitmapdata(viewwidth, viewheight, true); rendercontext.drawtobitmapdata(renderedbitmapdata); rendercontext.present(); //add stage bitmap = new bitmap(renderedbitmapdata); this.addchild(bitmap);

java - access to another XML file -

i want have access xml file in inner class can't reference other xml components, inner class code: class itemsclass extends arrayadapter<string> { public itemsclass () { super(listactivity.this, r.layout.itemslist); } public view getview (final int position, view convertview, viewgroup parent) { //setcontentview(r.layout.itemslist); final string s = this.getitem(position); layoutinflater inflater= getlayoutinflater(); view row= inflater.inflate(r.layout.itemslist, parent, false); // ref each component in itemlist.xml textview itemname= (textview) row.findviewbyid(r.id.textview1);// here can't access textview in itemslist.xml } } view row= inflator.inflate(r.layout.itemslist, null); read http://www.vogella.de/articles/androidlistview/article.html

Windows version outside the registry? -

i need take old software built in 4d 2004 (you never heard 4d doesn't matter) , make compatible windows 7 fooling , making him believe he's running under windows xp. i thought application getting version number of windows hkey_local_machine\software\microsoft\windows nt\currentversion , change value wrong… if change values in registry, version number of windows returned application same: 498139398 windows 7 170393861 windows xp those value contains windows version (this link explain how extract version number) don’t know taken from. if google numbers, you’ll find out other applications referring same version number. i tried find registry used application process monitor none of registry accessed application seems related windows version. does have clue of values might coming from? outside registry / hardcoded somewhere? windows has tools this. have tried right-clicking on program, selecting properties , looking @ compatibility tab? for more compl

objective c - "Failed to unarchive element named UITableViewController" -

i've been following "build second ios app" tutorial step step , have run error after tutorial promised errors go away, error didn't show until after other errors corrected , tried compile it. the error: the document "mainstoryboard_iphone.storyboard" not opened. failed unarchive element named "uitableviewcontroller". here link tutorial . here storyboard in xml format <?xml version="1.0" encoding="utf-8" standalone="no"?> <document type="com.apple.interfacebuilder3.cocoatouch.storyboard.xib" version="1.1" toolsversion="2182" systemversion="11d50" targetruntime="ios.cocoatouch" propertyaccesscontrol="none" initialviewcontroller="3"> <dependencies> <deployment defaultversion="1296" identifier="ios"/> <development defaultversion="4200" identifier="xcode"/> <

apache - Any way to make the Magento home page use a static HTML page? -

is there way have magento home page static html page? under heavy load situations magento (even varnish, apc, fooman, block caching, etc) can slow. however, home page fast possible. 1 way use static html page. is possible? dropping in simple mod_rewrite rule before main index.php bootstrap capture should want want rewriteengine on rewriterule ^$ static-html.html [l]

c++ - Linker error LNK1104 with 'libboost_filesystem-vc100-mt-s-1_49.lib' -

during process of linking program boost::filesystem module in release mode next error: error lnk1104: cannot open file 'libboost_filesystem-vc100-mt-s-1_49.lib' however, in boost\stage\lib directory have next libraries referred filesystem module: libboost_filesystem-vc100-mt-1_49.lib libboost_filesystem-vc100-mt-gd-1_49.lib my questions are: why vc++ asking 'libboost_filesystem-vc100-mt-s-1_49.lib? which compiler/linking properties should change compiler ask libboost_filesystem-vc100-mt-1_49.lib? update: vc2010++ solution has 2 projects include previous boost library: x library , y (the main program) invokes x. 1) when build x configuration type=static library , runtimelibrary=multi-threaded (/mt), ok. 2) when build y configuration type=application (.exe) , runtimelibrary=multi-threaded (/mt), issues error indicated, if change configuration type=static library builds ok, main program has .lib extension , not expected .exe. thanks attentio

php - both IF and ELSE are executed -- needs some help to spot the mistakes -

i made question in if else display 2 views on 1 function called thread , have tried fix suggested problem remains. hope me...it both of has inside "if" , has inside "else" ? i have got little problem redirect function, have controller function named "someview" , created view file of same name (someview.ctp) controller function stuff(query data model). can described follows function someview() { $result=$this->user->getdatafrommodel(); if(!empty($result)) { //do sendmail(.....); } else { $this->redirect(array('action'=>'usernotexist')); } } function usernotexist() { $this->loadskin(); } i created page named "usernotexist.ctp" display information when specified user doesn't exist in database system. however, previous function (someview) execute "if" , "else" both after called. if eliminate "else" part in

Spring RESTful web service - How to get WSDL out of it? -

i have simple controller class required annotations @requestmapping expose rest services. it works fine. input , output model have been annotated @xmlrootelement , @xmlelement . configuration, how wsdl generated? wsdl more of soap concept. in spring world, implemented using spring web services framework. rest services in spring built using spring mvc. these 2 separate frameworks. to wsdl in spring, should using spring web services project. it has support pox (plain old xml) if need that.

python - Select outgoing IP from django? -

if we're running on host can have multiple ip addresses (it's ec2 elastic ips), possible select django outgoing ip address use? even if random choice it'd fine. edit: apologies, not clear above. requests new outgoing calls made within python, not response client request - happy go down whatever pipe came in on. i guess webapp responses, server going use 1 connection socket, if request came ip address x, response sent in same tcp connection , originate same address x, though host has addresses y , z. on other hand, if application creates tcp connection during operation, possible bind socket on of host's ip addresses want. if you're using python's socket module, can specifying source_address argument in socket.create_connection() call. unfortunately, not higher-level libraries may allow level of control.

performance - Can I allocate objects contiguously in java? -

assume have large array of relatively small objects, need iterate frequently. i optimize iteration improving cache performance, allocate the objects [and not reference] contiguously on memory, i'll fewer cache misses, , overall performance segnificantly better. in c++, allocate array of objects, , allocate them wanted, in java - when allocating array, allocate reference, , allocation being done 1 object @ time. i aware if allocate objects "at once" [one after other], jvm most likely allocate objects contiguous can, might not enough if memory fragmented. my questions: is there way tell jvm defrag memory before start allocating objects? enough ensure [as possible] objects allocated continiously? is there different solution issue? new objects creating in eden space. eden space never fragmented. empty after gc. the problem have when gc performed, object can arranged randomly in memory or surprisingly in reverse order referenced. a work around s

php - MySQL Query - select distinct showing wrong results -

im wondering if me. i have hundreds of people uploading images site, each upload has own row in database data created, user id, images name etc etc etc. what want display last 3 users upload images problem being if user uploads more pics, row added database users id can show last 3 rows. i have following statement, doesnt seem working properly select distinct * kicks group uid order created desc limit 3 i wondering if point me out im going wrong. cheers sorry, should have added sample data, ok id | uid | created | 195 | 33 | 2012-03-06 12:32:54 196 | 33 | 2012-03-06 12:35:23 197 | 34 | 2012-03-06 13:09:31 198 | 19 | 2012-03-08 10:37:21 199 | 33 | 2012-03-09 21:04:04 select distinct uid kicks order created desc limit 3 want.

project - Handle a Timeline (MySQL) -

i'm on pseudo-social app. have 3 tables: users: _id_, username, password, email movies: _id_, title, synopsis followers: __(#user_id1, #user_id2)__, timestamp u_movies: __(#user_id, #movie_id)__, rating, timestamp we want add timeline our app, simple timeline, recent activities. don't want custom timeline (no messages), activities. what best way "create" timeline ? be, creating "timeline" table activities written (doing insert timeline when there insert followers , u_movies ?), or getting mysql , join on latest followers activities (with timestamp, think heavy if there many many entries , users), , advice ? thank ! i've done similar thing recently. first idea best, add data new table (either trigger or insert) presuming not doing , updates or deletes on table should scale quite well. partition table in mysql based on date range. keep performance going after few years (my first version of has 140million rows on 4 years , still

css - selectbox selection color -

is there possiblity change selection color in box? can find answears how change color on hover, want change background-color of selected items. i tried selectors: option[selected]{ background-color: red; } option:checked{ background-color: red; } but had no luck if u want custom colored/styled checkbox ,the best way cross browser compatibility , version compatibility designing own checkbox button image. create hidden checkbox , trigger properties via custom checkbox. events onmouseover, onmouseout, onkeydown, onkeyup, onclick etc u exaxtly simulate functions , behaviour of regular checkbox, customizable.

location - android - how to limit a proccess by time -

i'm trying search user's location, problem want limit time search time. is, if enough location not found after ten seconds or so, return best location found until time. i have asynctask activates location listener. i'm trying limit time android.os.process.getelapsedcputime() works when location location listener has arrived after time set. what want keep running time passed, regaredless of location listener. how can so? why cant u run timer (java.util.timer) can create timertask. start both asynctask , timer @ time scheduling interval of 10 seconds. after 10 seconds check status of asynctask. if still in running or pending state cancel asynctask. think helpful you.

charts - Master - Detail Char in Sencha ExtJS 4.0 -

it possible have master-detail chart in highcharts: http://www.highcharts.com/demo/dynamic-master-detail/dark-blue and cool. has ever seen same in sencha extjs 4.0 or has example of that? it's not difficult. have @ http://docs.sencha.com/ext-js/4-0/#!/api/ext.chart.mask in first code chunk explains how zooming functionality. bit of workaround can reset newly select zoom level.

ruby on rails - Not getting debug output for view errors in development mode -

Image
this odd. @ moment, have kind of error in view, can't see is. also, no debug output in web server trace. the rails 3.2.2 app upgrade 2.7.10, , i'm using "thin" development server. normal debug output when error occurs in other places. edit: i'm running development, can see here: => booting thin => rails 3.2.2 application starting in development on http://0.0.0.0:3000 => call -d detach => ctrl-c shutdown server >> thin web server (v1.3.1 codename triple espresso) >> maximum connections set 1024 >> listening on 0.0.0.0:3000, ctrl+c stop edit: can duplicate behavior raising exception in controller. please check development.rb , ensure that config.consider_all_requests_local = true otherwise exceptions , stack traces not shown.

r - How to install the knitr-module in Lyx 2.0.3? -

Image
i installed lyx 2.0.3 on imac , macbook air. when trying open *.lyx document on imac following error-message: "the module knitr has been requested document has not been found in list of available modules. if installed it, need reconfigure lyx." on macbook air runs fine without errors. any ideas how install knitr-module manually? thanks the requirement of knitr module in lyx r: have make sure executable rscript in path; can test by: which rscript if see path rscript , ready go (tools-->reconfigure); otherwise have tell lyx rscript (add path path prefix ): then reconfigure lyx. you can path rscript executing in r: r.home('bin')

.net - The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine in VB.net project -

getting 'microsoft.jet.oledb.4.0' provider not registered on local machine on windows7 64-bit os, when i'm running vb.net project. tried this link , no luck.!! please me. !! you trying use component became obsolete ten years ago. there no 64-bit version of provider , there never be, you'll need force application running in 32-bit mode. right-click exe project, properties, compile tab, scroll down, advanced compile options property. change target cpu setting "x86". forward looking solutions ace provider, replacement jet. not available in 64-bit either. sql server mainstream microsoft solution, express , compact editions free. plenty of 3rd party solutions sqllite or mysql. whether of them applicable unclear question, didn't explain why need use such old provider.

java - Explicit animations for setAnimationStyle(), what are my choices? -

i try out different animation styles popup window using setanimationstyle(), struggling understand documentation. developer.android.com, says: "animation style use when popup appears , disappears. set -1 default animation, 0 no animation, or resource identifier explicit animation." it not give examples, or tell me choices of resource available. suspect best animation purposes sliding in right... exist option? these things can select list or have somehow create own? edit: current code making popup window (simplified): public void completed_dialog() { runonuithread(new runnable() { public void run() { view layout = inflater.inflate(r.layout.endofgame, null, false); button b1 = (button) layout.findviewbyid(r.id.pu_menu); button b2 = (button) layout.findviewbyid(r.id.pu_repeat); button b3 = (button) layout.findviewbyid(r.id.pu_next); b1.setbackgroundresource(r.drawable.custom_menu_but); b2.setbackgroundresource(r.dra

r - Dependency matrix -

i need build dependency matrix 91 variables of data-set. i tried use codes, didn't succeed. here part of important codes: p<- length(dati) chisquare <- matrix(dati, nrow=(p-1), ncol=p) it should create squared-matrix variables system.time({for(i in 1:p){ for(j in 1:p){ <- dati[, rn[i+1]] b <- dati[, cn[j]] chisquare[i, (1:(p-1))] <- chisq.test(dati[,i], dati[, i+1])$statistic chisquare[i, p] <- chisq.test(dati[,i], dati, i+1])$p.value }} }) it should relate "p" variables analyze whether dependent each other error in `[.data.frame`(dati, , rn[i + 1]) : not defined columns selected moreover: there 50 , more alerts (use warnings() read first 50) timing stopped at: 32.23 0.11 32.69 warnings() #let's check >: in chisq.test(dati[, i], dati[, + 1]) : chi-squared approximation may incorrect chisquare #all cells (unless in last column seems have p-values) have same values row i tried

javascript - JQuery Validation Weird Behavior on Validating Dropdown List -

i'm using jquery validation validate dropdown list follows: here javascript part: $.ready(function(){ $.validator.addmethod("dropdown", function (value, element) { return validatedropdowns(this, value, element); }); $('#form1').validate({ onsubmit: false, focusinvalid: true, highlight: function (element, errorclass, validclass) { $(element).toggleclass('invalid'); $(element.form).find("label[for=" + element.id + "]").toggleclass(errorclass); }, unhighlight: function (element, errorclass, validclass) { $(element).toggleclass('invalid'); $(element.form).find("label[for=" + element.id + "]").toggleclass(errorclass); } }); }); function validatedropdowns(objcontext, value, element) { return objcontext.optional(element) || value != "-1"; } and here markup part: <asp:dropdownl

ruby on rails - Error when removing '::Base' from ActionController -

i'm writing rails application, , in 1 controller need specify layout render due inheriting actioncontroller::base . in of other controllers have actioncontroller , automatically uses application layout. whenever remove ::base , following message when accessing page superclass must class (module given) . why inheriting actioncontroller::base in controller matter, not in others? to directly answer question actioncontroller not controller class, it's namespacing module powers entire controller stack. not interact actioncontroller module during typical rails development. actioncontroller::base class controllers inherit from. why can't inherit actioncontroller . but think there 2 controllers in play here. actioncontroller::base , applicationcontroller . think might mistaking applicationcontroller being actioncontroller without ::base . actioncontroller::base main controller class of rails functionality comes from. applicationcontroller generalized

Resize images in PHP without using third-party libraries? -

in 1 of applications, i'm using code snippet below copy uploaded images directory. works fine copying large images (> 2mb) takes more time ideal , don't need images big, so, i'm looking way resize images. how achieve using php? <?php $uploaddirectory = 'images/0001/'; $randomnumber = rand(0, 99999); $filename = basename($_files['userfile']['name']); $filepath = $uploaddirectory.md5($randomnumber.$filename); // check if file sent through http post. if (is_uploaded_file($_files['userfile']['tmp_name']) == true) { // validate file size, accept files under 5 mb (~5e+6 bytes). if ($_files['userfile']['size'] <= 5000000) { // move file path specified. if (move_uploaded_file($_files['userfile']['tmp_name'], $filepath) == true) { // ... } } } ?> finally, i've discovered way fit needs. following snippet resize image speci

jquery - cycle.js pager issues -

im trying make pager image cycling using plugin: http://jquery.malsup.com/cycle/pager3.html but tho looks im doing right, pager wont work. here code: ///////////// // pager on left side of slideshow ///////////// <ul class="imagelist"> <?php foreach ($imgs $img) : ?> <li> <a href="#"> <img src="<?php echo $img[0]; ?>" height="64" width ="64" alt="<?php echo $title; ?>" /> </a> </li> <?php endforeach; ?> </ul> ///////////// /// here slider ///////////// <?php $imgs = get_post_images(get_the_id(), 'full'); ?> <div class="imagecycler nextimage"> <?php foreach ($imgs $title => $img) : ?> <div> <img src = "<?php echo $img[0]; ?&g