Posts

Showing posts from September, 2010

HTML5 datalist - always show unfiltered options -

i have textfield input datalist of e.g. 10 fixed options. instead of usual autocomplete behavior, dropdown show complete list. especially, if input has pre-filled value, , user clicks, dropdown open , show unfiltered list of options, user can use select element. any idea how that?

i need to write data to a file in c# but somehow it shows success but the file is empty -

this question has answer here: how add new line txt file 4 answers hello code trying : if file existes , append file else create new 1 . need write data line line fileexists = file.exists(newfilename); if (fileexists = false) { using (fs =new filestream(newfilename, filemode.create)) { sw = new streamwriter(fs); messagebox.show(record); sw.writeline(record); fs.close(); } } else { using (fd = new filestream(newfilename, filemode.append)) { sw = new streamwriter(fd);

cocos2d iphone - Box2D How to transfer remaining impulse from one body to another -

after applying box2d body: b2vec2 force = b2vec2(velocity.x/ptm_ratio, velocity.y/ptm_ratio); _body->applylinearimpulse(force,_body->getposition()); i'm trying in many game (like doodle jump) stop moving hero body once reaches distance top of screen , start scrolling stage feel hero still climbing higher. need move hero in first place , move stage. how can achieved correctly ? idea? thats quite odd thinking solve problem. never stop character or of environment objects. let them behave intended box2d. have added 1 root node of sort, environment , character. create sort of "camera controller" , give characters ccsprite, or wrapping objects if have one, target. in update function call each frame change root nodes position in way centres screen on character. can implement follow delays, smooth scrolling , other nice features need them. unfortunately don't use cocos2d @ all, can't give sample code. given solution work cocos2d not far

android - Classcastexception achartengine -

i trying run achartengine example following link getting classcastexception. unable find source of problem. have added mainactivity.java , manifest.xml. appreciated. 08-09 04:08:10.370: e/androidruntime(3350): fatal exception: main 08-09 04:08:10.370: e/androidruntime(3350): java.lang.classcastexception: org.achartengine.renderer.simpleseriesrenderer cannot cast org.achartengine.renderer.xyseriesrenderer mainactivity.java public class mainactivity extends activity { private static final int series_nr = 2; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); xymultipleseriesrenderer renderer = gettruitonbarrenderer(); mychartsettings(renderer); intent intent = chartfactory.getbarchartintent(this, gettruitonbardataset(), renderer, type.default); startactivity(intent); } private xymultipleseriesdataset gettr

ios - how do I set the orientation of a UIWindow with UINavigation -

i'm adding following code application in order navigate , forth quicklook view. window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; [self rotateview]; nav = [[uinavigationcontroller alloc] initwithrootviewcontroller:self]; [window addsubview:[nav view]]; [window makekeyandvisible]; [[self navigationcontroller] setnavigationbarhidden:yes]; this code run in main viewcontroller viewdidload function. application runs in landscape window , navigation bar loads in portrait mode. application doesn't have statusbar code i've found doesn't work. error if try check , listen status bar orientation notifications. i'm looking way allow navigation view set it's orientation based on apps current orientation. if understand question above code should placed in didfinishlaunchingwithoptions not in viewdidload in appdelegate , initialization of mainviewcontroller should there also. - (bool)application:(uiapplication *)application di

iphone - How to run an app after running an xcode clean and clean build folder where the app now crashes -

i'm trying run app after running xcode clean , clean build folder , i'm getting error , crash: fyi: there file called detailviewcontroller deleted because didn't need anymore. it's after running clean , clean build folder crash has been occurring. terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'could not load nib in bundle: 'nsbundle </users/username/library/application support/iphone simulator/6.1/applications/4e0db510-4107-4f8d-a08c-ecfddb1db506/1000 appname.app> (loaded)' name 'detailviewcontroller' i tried deleting contents of /users/username/library/application support/iphone simulator/6.1/applications/ remove apps on simulator. i reset simulator. closed , re-ran program still getting error. thanks help first, files cached 'clean build folder', simulator. files (especially derived nibs , images) can left have been deleted in project. command-option-shift-k clea

visual c++ - FMOD API - Can't load sound from memory -

int main(int arg, char *args[]) { fmod::system *system; fmod::sound *sound; fmod::channel *channel = 0; fmod_createsoundexinfo exinfo; fmod_result result; void *buffer = 0; int key; zipentry ze; hzip hz = openzip("c:\\users\\lukas\\desktop\\music.pak", ""); findzipitem(hz, "recording 1.mp3", true, null, &ze); buffer = malloc(ze.unc_size); unzipitem(hz, ze.index, buffer, ze.unc_size); closezip(hz); zeromemory(&exinfo, sizeof(fmod_createsoundexinfo)); exinfo.cbsize = sizeof(fmod_createsoundexinfo); exinfo.length = ze.unc_size; result = fmod::system_create(&system); result = system->init(32, fmod_init_normal, 0); result = system->createsound((const char*)buffer, fmod_hardware | fmod_openmemory, &exinfo, &sound); result = system->playsound(fmod_channel_free, sound, false, &channel); while(true) { if(_kbhit()) { key = _getch(); if(key == 27)break; } } sound->release(); system->close(); syst

regex - get string in between with python -

looking way items in between tabs \t_e\t1\t_ i need 1 in other cases longer string. re.search("\t_e\t(.*)\t_", string).group(1) 9 times out of 10 line returns string/value want not always, clear after underscore letter white space. try making regex lazy adding ? character after * , so: re.search("\t_e\t(.*?)\t_", string).group(1) ^ this makes .* match little possible until next \t (and prevents . eat \t ).

php - Display when the last visitor upvoted or downvoted next to the vote buttons -

i have php based cms website. people have ability or down vote piece of content. previously inquired how add time stamp vote buttons person can see how else has voted on content. i have following table: <table class="rating-table" cellspacing="0" cellpadding="0" border="0"> <tr> <td><?php echo kohana::lang('ui_main.credibility');?>:</td> <td><a onclick="myfunction()" href="javascript:rating('<?php echo $incident_id; ?>','add','original','oloader_<?php echo $incident_id; ?>')"><img id="oup_<?php echo $incident_id; ?>" src="<?php echo url::file_loc('img'); ?>media/img/up.png" alt="up" title="up" border="0" /></a></td> <td><a onclick="myfunction()" href="javascript:rating('<?php ech

Get an eventbrite event ID -

i'm trying figure out how eventbrite event id event not include in url. i'm not event owner, can't use technique go "manage events" page, eventbrite tells me. also, can't find consistently way use event search api method find specific event want... it seems though should pretty easy thing do! thanks in advance! the quickest way grab event id (just quick trick without using api) in event's footer @ "contact organizer" -- opening link in new tab display eid in url. for problem around /event_search, try using keywords , narrowing search location parameters: http://developer.eventbrite.com/doc/events/event_search/ hope answers questions!

haskell - Using Gloss to run a simulation while using SDL to play a sound -

i have simulation that's tied data gleaned sound file. run simulation , play sound file @ same time see how data matches up. the problem seem unable play sound via sdl.mixer , run gloss simulation @ same time. both of these functions work fine on own. the window simulation gets created, nothing drawn , wav file plays. data make model simulation ( onsets ) extremely computationally expensive? doesn't seem evaluated @ all. {-# language scopedtypevariables #-} module main import ghc.float import debug.trace import control.concurrent import control.monad.fix import control.monad import graphics.gloss import graphics.gloss.interface.pure.simulate import graphics.gloss.data.color import qualified sound.file.sndfile snd import qualified sound.file.sndfile.buffer.vector b import qualified graphics.ui.sdl sdl import qualified graphics.ui.sdl.mixer mix --my own libraries import sound.analysis.spectrum import sound.analysis.spectralflux import sound.analysis.onset impor

linux - Old Fortran Program: ld returned 1 exit status -

i have old fortran 77 program having trouble compiling / building normal with: gfortran -wall -o "filename" filename.f it keeps giving me linker error: $ gfortran -wall ljewald.f /usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o: in function `_start': (.text+0x18): undefined reference `main' collect2: error: ld returned 1 exit status eventually, tried: gfortran -wall -c -o "filename" filename.f gives me compiled binary file. ok great, man page gfortran sketching me out. here material -c option makes seem work: -c not discard comments. comments passed through output file, except comments in processed directives, deleted along directive. should prepared side effects when using -c; causes preprocessor treat comments tokens in own right. example, comments appearing @ start of directive line have effect of turning line ordinary source line, since first token on line no longer '#'. warn

r - How to specify a validation holdout set to caret -

i using caret @ least stages of modeling, it's easy use resampling methods. however, i'm working on model training set has fair number of cases added via semi-supervised self-training , cross-validation results skewed because of it. solution using validation set measure model performance can't see way use validation set directly within caret - missing or not supported? know can write own wrappers caret m, nice if there work-around without having that. here trivial example of experiencing: > library(caret) > set.seed(1) > > #training/validation sets > <- sample(150,50) > train <- iris[-i,] > valid <- iris[i,] > > #make model > tc <- traincontrol(method="cv") > model.rf <- train(species ~ ., data=train,method="rf",trcontrol=tc) > > #model parameters selected using cv results... > model.rf 100 samples 4 predictors 3 classes: 'setosa', 'versicolor', 'virginica'

mongodb - Mongorestore "auth fails" at deployed app at meteor.com -

i received information deployed app using command meteor mongo -url bhedir.meteor.com i took response , used info mongorestore -u client -p meteorinfo - h meteorinfo -d bhedir_meteor_com meteordump/meteor however, keep getting following error: assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" } i should note have several meteorite packages included don't see how affect this. also, i've done before, granted not many times, did not run issues. advice appreciated. i assume 'meteorinfo' placeholder hostname , password out? if when auth info meteor mongo -url bhedir.meteor.com have quick mongorestore auth data lasts 1 minute, expires , have meteor mongo --url bhedir.meteor.com call again

c - HFONT I am getting from my dialog box is not the one I sent -

i playing raw windows api here. trying pass font dialog during wm_initdialog message , keep using font whenever new child window created inside dialog. not want keep passing hfont created, want retrieve dialog window instead, whenever need it. so when enter wm_initdialog handler, create font , send dialog using sendmessage(wm_setfont). then, whenever wanted create new child window, thought needed retrieve dialog font, using sendmessage(wm_getfont). handle receive dialog not 1 created, no surprise when use new handle set new control font wrong font. i destroying font handle when application terminates. bet invalid handle not problem otherwise, in example below, control explicit pass font handle not displaying correct one. any ideas? #include <windows.h> #include <commctrl.h> static int_ptr callback dialogproc( _in_ hwnd hwnddlg, _in_ uint umsg, _in_ wparam wparam, _in_ lparam lparam) { static hfont hfont = null; switch(umsg)

configuration - What is the Tomcat equivalent of IIS's web.config file? -

i'd have environment-specific application settings in java/tomcat web app. when developed in .net on iis had old web.config file me out this. tomcat have equivalent iis's web.config file? web.config application's config file. in tomcat/java ee it's web.xml part of webapp.

Use snpStats with R version 3.0.1 -

i trying use package snpstats r version 3.0.1. when use command, error warning message: package ‘snpstats’ not available (for r version 3.0.1) however, when on snpstats documentation, under details, see information: details package: snpstats version: 1.5.6 date: 2012-03-27 depends: r(>= 2.10.0), survival, methods, matrix imports: graphics, grdevices, methods, stats, survival, utils, matrix suggests: hexbin license: gpl-3 url: http://www-gene.cimr.cam.ac.uk/clayton collate: ss.r contingency.table.r convert.r compare.r glm-test.r imputation.r indata.r long.r misc.r ld.r mvtests.r pedfile.r outdata.r plink.r qc.r qq-chisq.r single.r tdt-single.r structure.r xstuff.r zzz.r lazyload: yes biocviews: microarray, snp, geneticvariability packaged: 2012-03-27 built: r 2.14.1; i686-pc-linux-gnu; 2012-03-27 13:27:08 utc; unix doesn't depends: r(>= 2.10.0), survival, methods, matrix mean should run on r x64 on windows 7 looks may using install.packages() ? or trying

html - Keep div displayed when input inside of it has focus -

<div> <input type="text"/> </div> i have div element input inside of it. now, div has display: none property on it. now, when display div (by hovering @ element on site, not important here), can put text in input element. when have focus on input , , accidentally move mouse out of div element, div element disappears. there chance can keep div element displayed when input has focus no matter mouse is? edit: after editing sergio's example, here problem facing: http://jsfiddle.net/2thmq/1/ (try typing in input field , move mouse away) use input:focus { display:block; } demo only css div:hover input { display:block; } input:focus { display:block; } input { display:none; } if want style parent div possible in css4. far here javascript solution this: var inp = document.getelementsbytagname('input'); (var = 0; < inp.length; i++) { inp[i].onfocus = function(){ this.parentnode.style.display='

How to convert backward slash command in python to run on Linux -

i error on line when run code in linux: dst_file_path = "%s\%s" % (dst,loc[1]) how can using module. in advance. os.path.join automatically include correct directory separator based on platform being used. import os dst_file_path = os.path.join(dst, loc[1])

JPA-Hibernate Lazy Fetching -

i trying understand behaviour of jpa-hibernate in below situation. i have 2 entities, department , employee have 1 many relationship. trying implement using jpa-hibernate. here department entity: @entity @table(name="department") public class department { @id @generatedvalue @column(name="department_id") private long departmentid; @column(name="dept_name") private string departmentname; @onetomany(mappedby="department") private set<employee> employees; } here employee entity: @entity @table(name="employee") public class employee { @id @generatedvalue @column(name="employee_id") private long employeeid; @column(name="firstname") private string firstname; @column(name="lastname") private string lastname; @manytoone(fetch = fetchtype.lazy) @joincolumn(name="department_id") private department d

xsd - JAXB generated Java classes has the namespace issue on the rootelment -

i have single xsd file created below no errors in eclipse: <?xml version="1.0"?> <xs:schema id="build-summaries" xmlns:xs="http://www.w3.org/2001/xmlschema" elementformdefault="qualified"> <xs:element name="build-summaries" > <xs:complextype> <xs:choice minoccurs="0" maxoccurs="unbounded"> <xs:element name="build"> <xs:complextype> <xs:sequence> <xs:element name="project-name" type="xs:string" minoccurs="0" /> <xs:element name="label" type="xs:string" minoccurs="0" /> <xs:element name="build-date" type="xs:s

javascript - Restricting an input box to only numbers 0-9 -

this question has answer here: html text input allows numeric input 53 answers how can 1 restrict inputbox use numbers only. so if user type in a-z, not work in inputbox. to may seem easy me, sounds rocket science. no jquery please. <!doctype html> <html> <head> </head> <body> <input type="text" id="numbersonly" /> </body> </html> you use input html5 number type <input type="number" /> or javascript, input number type doesn't really limit input numbers : document.getelementbyid('numbersonly').addeventlistener('keydown', function(e) { var key = e.keycode ? e.keycode : e.which; if (!( [8, 9, 13, 27, 46, 110, 190].indexof(key) !== -1 || (key == 65 && ( e.ctrlkey || e.metakey ) ) || (key >= 35 &

Java synchronized blocks -- lock objects -

in sample code public class mslunch { private long c1 = 0; private long c2 = 0; private object lock1 = new object(); private object lock2 = new object(); public void inc1() { synchronized(lock1) { c1++; } } public void inc2() { synchronized(lock2) { c2++; } } } on this page, lock1 , lock2 controlling updates on c1 , c2 resply. however, synchronized(lock2) is acquiring lock of object lock1 , releasing when synchronized block synchronized(lock1) { c1++; } is executed. while block being executed, there may update on member c1 of this object still-- , don't see how update being prevented synchronizing on lock1 in code. it object lock1 there exclusive access on-- , nothing else(?) so, how implementation public void inc1() { synchronized(lock1) { c1++; } } in above code different public void synchronized inc1() { c1++; } or public void inc1() { synchronize

html - How can I center my menu in the middle? -

i want display css horizontal menu in middle of header element , make sure stays in middle when resizing browser window. of course tried margin: auto; , did not work me. jsfiddle code header .center { background: url(../images/header-center.png) no-repeat; width: 510px; height: 100%; /*margin: auto;*/ } beyond margin: 0 auto; need change #navigation removing position: absolute; , left: 260px; please notice giving bigger size menu #navigation , smaller size header contains .center class. complete fix issue: header .center { background: url("https://dl.dropbox.com/sh/1mp20mw7izrycq2/fubloqubn0/pingdom-theme/images/header-center.png") no-repeat; width: 510px; height: 100%; margin: 0 auto; } #navigation { width: 705px; height: 50px; overflow: visible; } the reason code not working because doing margin: auto should technically work because it's giving your: top, right, bottom , left sides margin of auto , while fine, #nav

html - List-style goes away with inline-block - but I want my list decorators to stay -

how them stay? i have following list - moment add list li display: inline-block; custom list decorators designated disappear. is there css way of keeping list decorators when list horizontal, or list decorators ever supposed appear vertical lists? of course have image next every list entry, simplicity's sake i'd rather deal in css. .first-page-menu-list { list-style-image: url('../graphics/list-style-image.png'); list-style-position: inside; text-transform: uppercase; } an alternate method consists of floating li elements. <ul> <li>the item</li> <li>the item</li> <li>the item</li> </ul> ul { overflow: auto; /* similar clearing floats... */ border: 1px solid gray; } ul li { float: left; border: 1px solid blue; padding: 10px; margin: 0 20px; } demo fiddle: http://jsfiddle.net/audetwebdesign/kbnvz/

d3.js - add a drag behaviour on a cubism graph -

cubism.js meant realtime vizualizations, not interaction, yet trying able visualize large dataset (for example >> 1000points) on page, without increasing step or chunking data example: http://jsfiddle.net/b2wjm/4/ (the first 500 points of 4000 points dataset drawn) var context = cubism.context() .step(6e4) .size(500) .stop(); so idea drag, or zoom graph using d3 https://github.com/mbostock/d3/wiki/zoom-behavior , hoping there's nice solution possible changing dynamically start , stop attributes i wanted show stock data described here 3 pieces. split graph 3 , added carousel-like left/right button toggle between them. i think can split data 5 pieces of 800 px each can move using left/right buttons.

java - Return the result of swapping the two lower-order bytes of X -

problem , solution: /** return result of swapping 2 lower-order bytes of x. * example, if x 0x12345678, swap(x) 0x12347856. */ static int swaplower(int x) { /* solution */ int lower = x & 0x0000ffff; int upper = x & 0xffff0000; return upper | (0xffff & ((lower << 8) | (lower >> 8))); } i confused how understand solution. tried working through logic did not understand. also, don't know how come solution in first place! edit: properties: x & 1 = x x & 0 = 0 x | 1 = 1 x | 0 = x int lower = x & 0x0000ffff = x & 0b00000000000000001111111111111111 = 0b0000000000000000x 15 ... x 0 int upper = x & 0xffff0000 = x & 0b11111111111111110000000000000000 = 0bx 31 ... x 16 0000000000000000 lower << 8 = 0b0000000000000000x 15 ... x 0 << 8 = 0b00000000x 15 ... x 0 00000000 lower >> 8 = 0b0000000000000000x 15 ... x 0 >> 8 = 0bssssssss00000000x 15 ... x 8 (assuming x signed n

objective c - UITableViewCell Space between Title and Subtitle -iOS -

Image
how can increase space between title , subtitle in uitableviewcell? you can add 2 labels in cell content view instead of setting cell label. adjust y origin per need. adding heightforrowatindexpath increase cell height.

Node.js Readable file stream not getting data -

i'm attempting create readable file stream can read individual bytes from. i'm using code below. var rs = fs.createreadstream(file).on('open', function() { var buff = rs.read(8); //read first 8 bytes console.log(buff); }); given file existing file of @ least 8 bytes, why getting 'null' output this? event open means stream has been initialized, not mean can read stream. have listen either readable or data events. var rs = fs.createreadstream(file); rs.once('readable', function() { var buff = rs.read(8); //read first 8 bytes once console.log(buff.tostring()); });

json - JQuery radio button filters not working -

i doing simple filter using radio buttons, have 3 radio buttons in group. want append different data in unordered list(ul) based on radio button selection.i using 3 buttons filter between veg,non-veg , both(none).the code using $(document).ready(function(){ $(".getmenu").click(function(){ $.getjson("data.json",function(result){ $.each(result, function(i, field){ var cat=field.category; var t=field.type; //putting case //radio filter 1 if($('.veg').checked) { if(t=="veg"){ switch(cat){ case "soups": $(".soup").append(field.menu_item + "<br />"); break; case "main course": $(".main").append(field.menu_item + "<br />"); break; case "starters": $(".starter").append(field.menu_item + "<br />"); break; } } } ////radio filter 2 else if($('

How to change search result page from 3 to 1 columns in magento? -

i have change catalog search result page layout 3 1 columns layout. have tried in catalogsearch.xml, not getting proper result. can tell me how can fix it? thank you. changing layout in catalogsearch.xml should trick, done way: before: <action method="settemplate"><template>page/3columns.phtml</template></action> after: <action method="settemplate"><template>page/1column.phtml</template></action> you should clear magento cache in admin>system>cache management. hope helps.

c# - To create textboxes in cshtml for List<string> in my model -

am new mvc, web form developer happened involved in project developed using mvc. my view looks this, 5 textboxes enter values (stored list), when added displayed in grid on same view, gird has edit , delete button. when user clicks on edit button list of values appear in each textboxes user edit values. my model has list values. please shed insight on how achieve scenario. thank you,

ios - CADObjectGetRelatedObjects failed with error Error Domain=NSMachErrorDomain Code=268435459 " -

i download apple's official example code simpleekdemo, calendar relation project. run iphone, , when create event , edite it, add notes .in end, delete ,at time, console log error: simpleekdemo[1335:907] cadobjectgetrelatedobjects failed error error domain=nsmacherrordomain code=268435459 "the operation couldn’t completed. (mach error 268435459 - (ipc/send) invalid destination port)" i have question: no matter how operate it, function - (ekcalendar *)eventeditviewcontrollerdefaultcalendarfornewevents:(ekeventeditviewcontroller *)controller not called. why? when function called、

Use of auto increment in JavaScript and jquery -

i have code if( !mobilecheck() ) { this.menu.addeventlistener( 'mouseover', function(ev) { self._openmenu(); document.addeventlistener( self.eventtype, self.bodyclickfn ); } ); this.submenu1.addeventlistener( 'mouseover', function(ev) { self._opensubmenu1(); document.addeventlistener( self.eventtype, self.bodyclickfn ); } ); this.submenu2.addeventlistener( 'mouseover', function(ev) { self._opensubmenu2(); document.addeventlistener( self.eventtype, self.bodyclickfn ); } ); } i want able replace this.submenu1.addeventlistener( 'mouseover', function(ev) { self._opensubmenu1(); document.addeventlistener( self.eventtype, self.bodyclickfn ); } ); with this.submenu[i].addeventlistener( 'mouseover', func

Grails: how to set data binding to use load method instead of get one? -

if have form such bellow <input type="text" name="somecollection[0].someassociation.id"/> <input type="text" name="somecollection[1].someassociation.id"/> <input type="text" name="somecollection[2].someassociation.id"/> because grails provides automatic data binding when encounters .id suffix, seems grails uses get method instead of load 1 implies 3 queries follows select * someassociationclass id = ? select * someassociationclass id = ? select * someassociationclass id = ? i need load method because not hit database unless use other getid() (not applied). so, how can customize data binding uses load method ? you can use command object bind data when submit form. @validateable class exampleco { string username // here field name use on view ,both name same in domain class. static constraints = { username nullable: false // here can provide same constraints define in domain class

meteor - How to install atmosphere packages without meteorite? -

mrt has bug spaces in volume names on mac https://github.com/oortcloud/meteorite/issues/172 . until fixed, how can manually install packages atmosphere? you can create directory called /packages in project & manually install each package , dependencies. e.g 'meteor router' in /packages git clone https://github.com/tmeasday/meteor-router.git mv meteor-router router git clone --recursive https://github.com/tmeasday/meteor-page-js-ie-support.git mv meteor-page-js-ie-support page-js-ie-support the second dependency on meteor router can see on package's atmosphere page . it's recursive make sure submodule pages-js git cloned in. meteor 0.65+ as pointed out thatjuan: once this, need add main 1 project. don't have add dependencies. meteor add router

categories - PHP Parsing json decoded result from wikipedia api MediaWiki -

i trying use wikipedia mediawiki api page data. query url : http://en.wikipedia.org/w/api.php?action=parse&format=json&page=nirnayam_%281991_film%29 one of properties returned categories: "categories":[{"sortkey":"","*":"telugu-language_films"},{"sortkey":"","*":"1991_films"},{"sortkey":"","*":"indian_films"}] a var_dump after json_decode : foreach($wiki_page_data_json->parse->categories $cat) { var_dump($cat); } gives me : object(stdclass)[21] public 'sortkey' => string '' (length=0) public '*' => string 'telugu-language_films' (length=21) object(stdclass)[22] public 'sortkey' => string '' (length=0) public '*' => string '1991_films' (length=10) object(stdclass)[23] public 'sortkey' => string '' (leng

android - ViewPager doesn't update ImageView even when i finish its activity and start it again with different values -

i'm using viewpager make scrollable photos gallery take photos urls sqlite database depending on intent value passed previous activity. my problem : when start photo gallery first time , works correctly when close , start again different urls images ,viewpager doesn't update imageview , page title. this code : import java.util.arraylist; import java.util.locale; import android.content.intent; import android.database.cursor; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteexception; import android.os.bundle; import android.support.v4.app.fragment; import android.support.v4.app.fragmentactivity; import android.support.v4.app.fragmentmanager; import android.support.v4.app.fragmentpageradapter; import android.support.v4.view.viewpager; import android.view.layoutinflater; import android.view.menu; import android.view.view; import android.view.viewgroup;

linux - Deduce type of void in pure C -

well, have callback arisen when http response on http request. prototype of callback following (async programming, arised @ time): // use ecore_con_url library efl framework eina_bool _pt_url_data_cb(void *data, int type, void *event_info) and callback can contains data in event_info in json format, or pure data. depends on in void* data . well, there 2 ways avoid of pure design: use 2 callbacks. if expect pure data - register callback _pt_url_pure_cb , if expect data in json format register _pt_url_json_cb . lack of method have register/unregister callbacks @ runtime. , arised when http response data, doesn't matter in form are. think big problems solution. for example: // expect http response pure data ecore_event_handler_add(ecore_con_event_url_data, _pt_url_pure_cb, data); return; // _pt_url_pure_cb wasn't yet called // expect http response in json format ecore_event_handler_add(ecore_con_event_url_data, _pt_url_json_cb, data); ... // called pure data _pt

outlook fails pop3 ssl auth with courier and postfix -

first off, works fine kontacts, outlook being pain. fresh server new build following method https://wiki.gentoo.org/wiki/complete_virtual_mail_server when using outlook , running test get: aug 10 09:47:19 emailer1 pop3d-ssl: couriertls: /etc/ssl/certs/48ef30f1.0: no such file or directory ^c emailer1 ~ # updatedb emailer1 ~ # locate 48ef30f1 /etc/ssl/certs/48ef30f1.0 emailer1 ~ # ls -l /etc/ssl/ total 44 drwxr-xr-x 2 root root 4096 aug 8 07:46 apache2 drwxr-xr-x 2 vmail vmail 12288 aug 8 12:06 certs drwxr-xr-x 2 root root 4096 aug 9 04:01 courier-imap drwxr-xr-x 2 root root 4096 aug 8 12:05 misc -rw-r--r-- 1 root root 10835 aug 8 12:03 openssl.cnf drwxr-xr-x 2 root root 4096 aug 10 09:15 postfix drwx------ 2 root root 4096 aug 8 12:05 private emailer1 ~ # emailer1 ~ # postconf -n broken_sasl_auth_clients = no command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer

database - MS Access - sql expression for allow null? -

i use ms access (2003) database. once create column set not null using sql statement: alter table table1 alter column mycolumn integer not null is there way change allow null values? tried: alter table table1 alter column mycolumn integer null but nothing... you cant specify null in alter table (although not null allowed) see below documentation , discussion on toppic syntax alter table table {add {column field type[(size)] [not null] [constraint index] | alter column field type[(size)] | constraint multifieldindex} | drop {column field constraint indexname} } old school solution :- create new temporray field null same datatype update new temporary field existing not null field drop old not null field create droped column same datatype again without not null update existing field temporary field if there have been indices on existing field, recreate these drop temporary field

jQuery/PHP - detect which button is pressed -

i'm making app (admin page), loaded users in <table> , have option activate , deactivate each user. problem don't know how detect 'activate' or 'deactivate' button pressed, code works first user in list. code: adminpage.php: <?php $getdata = $mysqli->query("select * login"); while($row = $getdata->fetch_assoc()): ?> <tr id="datarows"> <td id="firsttd"><?php echo $row['user_id']; ?></td> <td><?php echo $row['username']; ?></td> <td><?php echo $row['email']; ?></td> <td><?php echo $row['name']; ?></td> <td><?php echo $row['lastname']; ?></td> <td><?php echo $row['active']; ?></td> <?php if($row['active'] == 1){ ?> <td><label id="userid" hidden><?php echo $row['user_id']; ?>

mysql - Select fields from table with DISTINCT field -

i have table of type | user | parents | sons | with parents , sons columuns can null. user column can contains duplicated i write query: select user, coalesce(parents, 0) parentsed, coalesce(sons, 0) sonsed my_table order (parentsed + sonsed) desc and works! give result duplicated users. how can have distinc users using (parentsed + sonsed) desc order ? use group by before order clause , if want order results first group them use subselect select `user`, coalesce(parents, 0) parentsed, coalesce(sons, 0) sonsed my_table group `user` order (parentsed + sonsed) desc select distinct `user`, coalesce(parents, 0) parentsed, coalesce(sons, 0) sonsed my_table order (parentsed + sonsed) desc select a.* ( select distinct `user`, coalesce(parents, 0) parentsed, coalesce(sons, 0) sonsed my_table order (parentsed + sonsed) desc ) group a.`user`