Posts

Showing posts from June, 2015

ios - Problems saving values in NSUserDefaults -

i have viewdidload : - (void)viewdidload { [super viewdidload]; if (defaults == [cells objectatindex:0]) { nsstring * myfile = [[nsbundle mainbundle]pathforresource:@"cells" oftype:@"plist"]; cells = [[nsmutablearray alloc]initwithcontentsoffile:myfile]; } else { [defaults stringforkey:@"string1"]; } } and viewwilldisappear have: -(void)viewwilldisappear:(bool)animated { string1 = [cells objectatindex:0]; [defaults setobject:string1 forkey:@"string1"]; } but cannot data saved. know i'm doing wrong? are setting defaults [nsuserdefaults standarduserdefaults] somewhere? also, why comparing first object in cells array? seems strange. you've otherwise got idea correct. make sure viewwilldisappear method getting called. can call [nsuserdefaults synchronize] save changes immediately. one last thing, aren't doing in else {} block. need assign value of

objective c - Change UIImageView mode iPhone/iPad -

Image
if have uiimageview mode set center example how can change else such aspect fit code? imageview.contentmode = uiviewcontentmodescaleaspectfit;

javascript - How can I load a new page when the iPhone/Android browser is reopened? -

okay, don't know how word question can tell. hence couldn't find solution on google, came here. basically, process unfolds this: 1.) user logs site. 2.) user uses site, leaves browser , whatever else, without killing browser. 3.) user opens browser again check site again. when 3.) triggers, want site detect , forward browser other page. does make sense? if need clarification, let me know. believe there has way jquery or maybe plain js. thanks! function onblur() { document.body.classname = 'blurred'; }; function onfocus(){ document.body.classname = 'focused'; }; if (/*@cc_on!@*/false) { // check internet explorer document.onfocusin = onfocus; document.onfocusout = onblur; } else { window.onfocus = onfocus; window.onblur = onblur; } reference: is there way detect if browser window not active?

There's cit, dit, yit (change, delete, yank inside tag) on vim... is there something like pit (paste inside tag?) -

using vim i'm used motion command cit , dit , yit when editing html/xml files. . more after using commands because can repeat did 1 keystroke. i know if theres pit (paste inside tag) available, deletes inside tag , paste wanted (from + register example) , make . available cit , or if i'll need create mapping that. no, can select visually , put text: vitp

java - Applet - Servlet Communication -

i have abandoned earlier quest make applet communicate directly database, though users , webpages have said it's possible. trying applet pass information (string , boolean format) entered in textfields or indicated checkboxes, , give servlet, stores appropriately in database. i've got applet front end - gui - built, , servlet - database connection built. problem link between two, applet , servlet. how 1 pass string data applet servlet? thanks, joseph g. first up, have acknowledge can communicate server applet downloaded from, includes port number, unless want mess around permissions, applet signing , malarky. isn't applet restriction, same applies flash , javascript (though in case of javascript there tricks around it). using either "getcodebase()" or "getdocumentbase()" method on applet url can component parts required build new url let call servlet. thus, applet must being served same server servlet hosted on. e.g. if applet in fo

encoding - How windows notepad interpret characters -

i wondering how windows interpret characters, instance: i maked file hexeditor 3 bytes e3 81 81 . bytes "ぁ" character encoded utf-8. i open notepad , display "ぁ" i dont specified encoding of file, created bytes. , notepad interpret correctly. is notepad guessing encoding is? or hex editor saving bytes specific encoding. if file contains these 3 bytes, there no information @ encoding use. a byte byte, , there no way include encoding information in it. besides, hex editor doesn't know intended decode data text. notepad uses ansi encoding, if reads file utf-8 has guess encoding based on data in file. if save file utf-8, notepad put bom (byte order mark) ef bb bf @ beginning of file.

scala - Returning a path-dependent type -

how can design method returns path dependent type? in following example, deliberately want vertex path dependent on tree such forbidden mix vertices across trees (and example): trait tree { trait vertex def root: vertex def addchild(parent: vertex): vertex } trait treefactory { def make: tree } now following cannot constructed: def test(f: treefactory): (tree, map[tree#vertex, tree#vertex]) = { val t = f.make var sq = indexedseq(t.root) var m = map.empty[t.vertex, t.vertex] for( <- 1 100) { val p = sq(util.random.nextint(sq.size)) val c = t.addchild(p) m += c -> p sq :+= c } (t, m) } because map return should not have keys , values of type tree#vertex of path dependent vertex... error: type mismatch; found : scala.collection.immutable.map[t.vertex,t.vertex] required: map[tree#vertex,tree#vertex] note: t.vertex <: tree#vertex, trait map invariant in type a. may wish investigate wildcard type such `_ <: tree#vertex

Which menu/status icons' guidelines should I follow for an app that will support Android 2.2 and later? -

in guidelines found in http://developer.android.com/guide/practices/ui_guidelines/index.html menu , status icons, have distinctive design approach android 2.2 , earlier , android 2.3 , later. app going support android 2.2 , later. thinking should follow 2.3 , later guidelines. agree? you can follow multiple styles creating subfolders correct android version specifiers inside res/ folder (e.g. drawable-v11 api 11 - check official documentation here ). suggest supporting multiple styles. this bit more work. make easy standard icons notifications, check out the android asset studio . small webapp creates these icons specifications , builds zip multiple styles, sorted different res/ subfolders.

iphone - Trying to Concatenate Object names in Objective-C -

i know can concatenate variable name using stringwithformat, possible concatenate object name? i'm not having luck working around one. image+1.hidden = yes; example. if wanted loop through that, 10 times, how create 'image+1' part? thanks help. i don't think possible concatenate object names in objective c, create array of images, , reference each image like image[0].hidden = yes; that fit loop. add images (i assume uiimages) nsarray, loop through so: nsarray* arrayofimages; for(uiimage* image in arrayofimages) { image.hidden = yes; }

struts2 - how to get property value from java bean in javascript without replacing the special characters -

i have struts2 application , trying show kml layer on top of google earth using google earth plug-in. using: ge.parsekml(kmlstring) if put kml string in script section such var kmlstring ='<?xml version=\"1.0\" encoding=\"utf-8\"?> <kml xmlns=\"http://www.opengis.net/kml/2.2\"> <document> <camera> <longitude>-122.444633</longitude> <latitude>37.801899</latitude> <altitude>139.629438</altitude> <heading>-70.0</heading> <tilt>75</tilt> </camera> <placemark> <name>placemark kml string</name> <point> <coordinates>-122.448425,37.802907,0</coordinates> </point> </placemark> </document> </kml>'; then marker shows on globe. problem kml string not fixed, generated after user selects values. getting kml string java bean class property "kmlstr" this: var kmlstring='<s:pro

ruby - Organizing the Controller Directory in Rails (3) -

i'm developing application api gateway. in expectation we'll developing multiple versions of api on time , interest of having backward compatibility, looking have along lines of: http://host.domain.com/apiv1/:token/:module(/:id(:method )) given this, looking have sub-routing system of own within each api. i'd have in terms of file structure in controller directory akin following: /app/controllers/apiv1_controller.rb /app/controllers/apiv1/module_controller.rb /app/controllers/apiv1/response_controller.rb and have: /app/controllers/apiv2_controller.rb /app/controllers/apiv2/module_controller.rb /app/controllers/apiv2/response_controller.rb what breaks down unsure how call methods within controllers in subdirectories, using like: return apiv1::responsecontroller.index gives me: undefined method `index' apiv1::responsecontroller:class any leads? setup require explicitly "require" requisite file manually? pasted here in response question:

github - Git telling me to pull, then commit, then pull? -

i trying push new changes, have conflicted file. after trying push, following error: merge remote changes (e.g. 'git pull') before pushing again. see 'note fast-forwards' section of 'git push --help' details. ok, need use git pull. try use git pull , error: error: local changes following files overwritten merge: db/profile_edit.php please, commit changes or stash them before can merge. but, when try commit, go first error. should do? changes on remote repo newer ones on local machine. so, how open diff tool , make changes , tell git have made changes let me push changes? try do $ git pull --rebase to pull remote changes before yours, , commit. , see if works. if not work, try instead: $ git stash $ git pull --rebase $ git stash pop to save changes on stash , apply remote commits inside work-repository, , apply changes (saved stash ) inside work-repository again.

c++ - How do files get into the External Dependencies in MSVC++2010? -

i wonder why 1 of projects has vdserr.h listed under "external dependencies" , hasn't , gives me "undefined symbol" compiler error symbol defined in there. how can include file in other project well? (probably drag&drop, i'd know exact setting here.) the external dependencies folder populated intellisense: contents of folder not affect build @ (you can in fact disable folder in ui). you need include header (using #include directive) use it. depending on header is, may need add containing folder "additional include directories" property , may need add additional libraries , library folders linker options; can set of these in project properties (right click project, select properties). should compare properties of project build determine need add.

git - Integrating Assembla (or similars) with AppHarbor (or similars, like heroku) -

i'm working in project being hosted in appharbor (like heroku .net). use git push upload code (my first time ever working such environment). the thing miss features of classic git or svn repository, seeing code in web site, tickets, etc. my question is: can integrate example assembla appharbor in way let me send code once, , have in both plataforms? you can push projects 1 command. git remote set-url --add --push url = heroku:path/proj.git then each additional repo want push to: git remote add github:path/proj.git git remote add github:path/proj2.git then when git push heroku update of repos , heroku.

c# - Convert bitmaps to one multipage TIFF image in .NET 2.0 -

how can convert array of bitmaps brand new image of tiff format, adding bitmaps frames in new tiff image? using .net 2.0. start first bitmap putting image object bitmap bitmap = (bitmap)image.fromfile(file); save bitmap memory tiff memorystream bytestream = new memorystream(); bitmap.save(bytestream, imageformat.tiff); put tiff image object image tiff = image.fromstream(bytestream) prepare encoders: imagecodecinfo encoderinfo = getencoderinfo("image/tiff"); encoderparameters encoderparams = new encoderparameters(2); encoderparameter parameter = new encoderparameter( encoder.compression, (long)encodervalue.compressionccitt4); encoderparams.param[0] = parameter; parameter = new encoderparameter(encoder.saveflag, (long)encodervalue.multiframe); encoderparams.param[1] = parameter; save file: tiff.save(soutfilepath, encoderinfo, encoderparams); for subsequent pages, prepare encoders: encoderparameters encoderparams = new encoderparame

java - How to search YouTube with HtmlUnit -

i wonder if youtube searched htmlunit . started write code, here is: import java.io.ioexception; import java.net.malformedurlexception; import com.gargoylesoftware.htmlunit.failinghttpstatuscodeexception; import com.gargoylesoftware.htmlunit.webclient; import com.gargoylesoftware.htmlunit.html.htmlform; import com.gargoylesoftware.htmlunit.html.htmlpage; import com.gargoylesoftware.htmlunit.html.htmlsubmitinput; public class htmlunitexampletestbase { private static final string youtube = "http://www.youtube.com"; public static void main(string[] args) throws failinghttpstatuscodeexception, malformedurlexception, ioexception { webclient webclient = new webclient(); webclient.setthrowexceptiononscripterror(false); //this equivalent typing youtube.com adress bar of browser htmlpage currentpage = webclient.getpage("http://www.youtube.com"); //get form submit button located htmlform searchform = (htmlform)

mysql - I can't tell in which DB a row is located from just the global identifier -

if have user table (with global id primary key) sharded across 10 databases ( db1 - db10 ) based on username , , table tries refer user table using user table row's global id , there no way me know db (1-10) user located in. what solution problem? either: change sharding scheme shard based on key use data. if it's id, id, , shard id (db = id % 10) make primary key of user table username . enforce uniqueness , use username foreign key in other tables, not synthetic identifier. create lookup table can reference maps id s shards.

Upload a video to Youtube using the python API and set it as unlisted -

i'm using python client library upload videos youtube. i need set it's privacy unlisted, api page shows examples of how set them private. anyone knows how change privacy control of these videos? thanks! the xml element need described in http://code.google.com/apis/youtube/2.0/reference.html#youtube_data_api_tag_yt:accesscontrol following api documentation, can build element follows: from gdata.media import youtube_namespace atom import extensionelement # set video unlisted kwargs = { "namespace": youtube_namespace, "attributes": {'action': 'list', 'permission': 'denied'}, } extension = ([extensionelement('accesscontrol', **kwargs)]) # create gdata.youtube.youtubevideoentry video_entry = gdata.youtube.youtubevideoentry(media=my_media_group, geo=where, extension_elements=extension)

python - Organizing XML data into dictionaries -

i'm trying organize data dictionary format xml data. used run monte carlo simulations. here example of couple of entries in xml like: <retirement> <item> <low>-0.34</low> <high>-0.32</high> <freq>0.0294117647058824</freq> <variable>stock</variable> <type>historic</type> </item> <item> <low>-0.32</low> <high>-0.29</high> <freq>0</freq> <variable>stock</variable> <type>historic</type> </item> </retirement> my current data sets have 2 variables , type can 1 of 3 or possible 4 discrete types. hard coding 2 variables isn't problem, start working data has many more variables , automate process. goal automatically import xml data dictionary able further manipulate later without having hard code in array titles , variables. he

animation - Animating UIView from right to left direction, iPhone -

i working on iphone application. having memoryviewcontroller page on have display questions user particular time period. have reload same view new question again , again. here have apply view animation in form of right left move. , new view contain new question. have take 2 different views on same parent view? or can implemented same view. any code help, please. thanks. i make them in 2 different views, end like: newquestionview.frame=cgrectmake(360.0,0.0,newquestionview.frame.size.width,newquestionview.frame.size.height); [uiview animatewithduration:1 animations:^{ oldquestion.frame=cgrectmake(-360.0, 0.0, oldquestion.frame.size.width, oldquestion.frame.size.height); newquestionview.frame=cgrectmake(0.0, 0.0, newquestionview.frame.size.width, newquestionview.frame.size.height); }]; what happen is: you first position new question in right side of screen, can see coming

c# - Sorting second level of TreeView and seeing changes... possible? -

this first post here, have been trying few techniques found in other questions can't seem working want... making changes existing application (.net 3.5 wpf , c#, , entity framework sqlserver2008). new both efdm , wpf. new version needs compatible existing databases previous version, without modification existing databases, quite reluctant changing datamodel , objects generated it. anyway, here's question: have objects "staffincentive" , "staffincentivelines" edm, each staffincentive having 0 many staffincentiveline attached. display treeview, , need able dynamically add or remove staffincentiveline. <treeview itemssource="{binding}" name="maintree"> <treeview.itemtemplate> <hierarchicaldatatemplate itemssource="{binding staffincentiveline}"> <textbox text="{binding name}"/> <button tag="{binding}" click="addline" content="add line&q

html - Adding Html2Xhtml library to project -

i trying use html2xhtml how can include project? i using vs2008 , put dlls bin folder of project , add html2xhtml refs, still not recognize "using corsis.html2xhtml;" declaration. gives missing assembly compile time error. i included following dll in refs: html2xhtml.dll i added libiconv-2.dll bin folder. xml file think required. can tell me going wrong? how add library project?

use jquery to fade in button with hovering and the fadeout after hovering out -

i need jquery fade in button when hover on image disappear after hover off...i've been looking alot , can't disappear. im using hover() function , button class "goto" (#goto). use combination of fadein , fadeout? is this want? $("img").hover( function(){$(".goto").fadein()} ,function(){$(".goto").fadeout()} ); the jquery .hover() can take 2 functions, first being when hover on, second when hover off http://api.jquery.com/hover/

Error while trying to download a file via ftp on android -

i amateur in android coding. trying setup android app ability download file ftp server. while running code on android 2.2 emulator, able connect ftp server downloading part showing error. logcat gives "download failed". package com.ftconnect.down; import java.io.fileoutputstream; import android.app.activity; import android.os.bundle; import android.util.log; import org.apache.commons.net.ftp.*; public class ftpconnectactivity extends activity { /** called when activity first created. */ public ftpclient mftpclient = null; public boolean mconnect; public boolean mdownload; public boolean mdisconnected; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); mconnect = ftpconnect("xxx.xxx.xxx.xxx", "admin", "123456", 21); mdownload = ftpdownload("xxx.xxx.xxx.xxx/ftp.mp3", "/sdcard"); mdisconnected = ftpdisconnect(); } publi

jquery - How should i get some value from javascript object and check for null -

i getting element as var minpriceperinputfield = $("input#a"+indexnr); the element can present or not also. getting [object object] thing. have no idea this. receiving [object object] when element not there. use if( $(minpriceperinputfield).length === 0); means null. no element selector.

constructor - How to force deletion of a python object? -

i curious details of __del__ in python, when , why should used , shouldn't used for. i've learned hard way not 1 naively expected destructor, in not opposite of __new__ / __init__ . class foo(object): def __init__(self): self.bar = none def open(self): if self.bar != 'open': print 'opening bar' self.bar = 'open' def close(self): if self.bar != 'closed': print 'closing bar' self.bar = 'close' def __del__(self): self.close() if __name__ == '__main__': foo = foo() foo.open() del foo import gc gc.collect() i saw in documentation not guaranteed __del__() methods called objects still exist when interpreter exits. how can guaranteed foo instances existing when interpreter exits, bar closed? in code snippet above bar closed on del foo or on gc.collect() ... or neither? if want finer control

SSIS 2008 lookup -

i use lookup component. when no match output, insert rows target table. update target table rows when lookup matched. how can that? thx!! in lookup transformation, map lookup match output ole db command transformation . in ole db command transformation use update statement or stored procedure , map columns accordingly. here link describes how use ole db command transformation. please note if have many rows update, ole db command transformation might slow down things. there couple of options: you can use second lookup transformation between first lookup transformation , ole db command. in second lookup, map columns between source , destination updating including key column , redirect output ole db command if there not matching records. split output lookup match output multiple outputs using sequence number , have multiple old db command transformations. please find answer in this stack overflow question split output 1 transformation multiple output before re

android - onDestroy gets called each time the screen goes on -

my application gets killed each time comes screen-off-state. fetch information app does, can't find out why calls ondestroy. it's first time i'm seeing behavior in applications. my main activity extends tabactivity because contains tabhost. i've read has extend or fc. i'm not sure if issue related this?! oh , implements observer should no problem. here logs: 07-21 09:57:53.247: verbose/###(13180): onresume 07-21 09:57:53.267: verbose/###(13180): onpause 07-21 09:57:59.967: verbose/###(13180): onresume 07-21 09:58:00.597: verbose/###(13180): onpause 07-21 09:58:00.597: verbose/###(13180): ondestroy 07-21 09:58:00.637: verbose/###(13180): oncreate the crazy thing calls ondestroy times after screen goes on again, , has enough time before screen goes off. after goes on again same again... i hope has tip me or information on how resolve issue. i'm not sure if important, use android 2.1-update1 sdk application. edit: the application gets tested o

C# generic cast -

i have interface called ieditor public interface ieditor<t> t: specialobject specialobject abstract class. here´s problem: i have class inherits specialobject , view implements ieditor interface public class view : ieditor<person> now, have check whether view implements ieditor<specialobject> boolean iseditor = view ieditor<specialobject> but ieditor false is there possibility check if view ieditor<specialobject> ? edit i have method called when closing event raised. views passed method can implement ieditor, can implement interface. in example iview void closing(object sender, myeventargs e) { if(e.item iview) { // closing tasks if(e.item ieditor<specialobject>) // false { // special tasks var editor = e.item ieditor<specialobject>; var storededitobect = editor.storedobject; // more tasks

orchardcms - Orchard s3slider -

does orchard cms have similar http://www.serie3.info/s3slider/ ? have had cant find anyhything quite it. regards ben orchard may/may not have that, can still use s3slider within orchard project jquery.

arrays - Unable to query [adsisearcher] for trusted domains (PowerShell) -

i wanted query [adsisearcher] me ou info few servers servers in trusted & non trusted domains. $session = new-pssession -computername icvmm02 invoke-command -session $session -scriptblock { $compname= (get-wmiobject "win32_computersystem" -namespace "root\cimv2" -computername $comp).name $searcher = [adsisearcher]"(&(objectcategory=computer)(name=$compname))" $ou= $searcher.findone() | select-object path $serverou = $ou.path } $adou= (invoke-command -session $session -scriptblock { $serverou }) get-pssession | remove-pssession for servers in trusted domains im passing $cred = credentials while creating pssession, when run $compname= (get-wmiobject "win32_computersystem" -namespace "root\cimv2" -computername $comp).name $searcher = [adsisearcher]"(&(objectcategory=computer)(name=$compname))" $ou= $searcher.findone() | select-object path it gives me error exception calling "findone" "0&

jquery - Find text in a string and prependTo somewhere else -

i trying find text regex /\w*http:[/][/]bit.ly[/]\w*/ig find string , pull out, moving <span> tag, or @ end of <p> tag? <p class="regex">text before http://bit.ly/wtgahsu sometext here, doesn't matter how long is.... <span></span></p> $("p:regex('(\w*http:[/][/]bit.ly[/]\w*)')").addclass('active'); above have far (just selecting p), i've tried .highlight() im not sure grab text , move it, appreciated. thanks you use this: $("p.regex").each ( function () { var jthis = $(this); var newsrc = jthis.text ().replace (/^(.*)(https?\:\/\/bit\.ly\/\w+)(.*)$/i, '$1$3<span>$2</span>'); jthis.html (newsrc); } ); note version assumes 1 link, max, per paragraph. see in action @ jsfiddle.

Drop multiple databases in SQl Azure -

i run script drop multiple databases sql azure finish using it. when tried following, declare @dbname varchar(100); declare @stmt nvarchar(3000); set @dbname = '6a732e0b'; select @stmt = (select 'drop database [' + name + ']; ' sys.databases name '%' +@dbname +'%'); exec sp_executesql @stmt; sql azure throws error message “the drop database statement must statement in batch” can me on this? this known limitation in sql azure - statements need in batch executed. includes create/alter database, alter database , few more. to solve problem, can create loop in application iterate on databases , drop them issuing drop database statements in separate batches.

How to build an efficient maven/jenkins build queue -

we use jenkins our ci system , maven our build tool. have svn repository our code , artifactory our artefacts. the source code organized multi-module maven project. modules contribute actual application, modules applications tht need during build , test process. we have multiple jobs for: a quick set of commit tests more extensive integration tests code coverage , static code analysis deployment test environment smoke tests test environment one weakness of our build process compile different parts of project in different jobs, of parts on , on again. instead prefer build once deploy artifactory , use these artifacts else. but don't know how make sure that: the size of artifactory doesn't explode, because dump hundreds of jars every day in it downstream builds use exact set of artifacts produced last upstream build job not weird mixture of version, because runs concurrently next build job, might have deployed new version of artifact not of artifact b.

modeshape - jcr node detach: using JcrNode properties outside of session scope (like some kind of DTO) -

currently doing test-app jcr (modeshape). the abstracted flow follows: session.open, repository fetches on or more nodes related query, session.close. the resulting nodes contain properties, etc. need present view. have naive setup of letting view take properties jcrnode directly. gives error like: "the session id of 'e2881d98-56fd-4a57-9cce-1a7d087a11e8' has been closed", makes sense. i believe general approach (please correct if otherwise) create sort of nodedto populated jcrnode when session still active. view free use nodedto wants. now, perfect structure such nodedto mimic structure of jcrnode 1-to-1 why not use jcrnode dto itself? accomplished akin hibernate detach/attach. realize jcrnode (with children) can contain lots of data, there should parameters determine depth of detachment, etc. another approach have opensessioninview-pattern, although mvc-framework specific. so can see several approaches this, best approach first (imo): detach/a

sql - How to get Database name of sqlserver -

this question has answer here: how can query name of current sql server database instance? 7 answers how database name of specific database in stored procedure. to current database name use select db_name() . db_name(transact-sql)

nhibernate: how to setup entity validation that uses data from database? -

i've setup nhibernate have problems validating entity before actual save , commit database. load , change persistent entity, validation goes after accessing database , doing commiting transaction, saving entity in database before actual validation result known. i use repository pattern in .net mvc web app , goes this: public actionresult edit(int id, entity entity) { var repository = new entityrepository(); // persistent entity nhibernate var entityoriginal = repository.getbyid(id); // copy data input entity persistent entity entity.copydatatoentity(entityoriginal); // if validation ok save database // validations problematic becouse needs info database , uses transaction validationresult validationresult = entityoriginal.validate(); if (validationresult.isvalid()) { repository.save(entityoriginal); // ok, redirect view entity page return redirecttoaction("view"); } else { repo

windows - inetinfo.exe always appears on Task Manager -

i realized have process inetinfo.exe running on pc. seems part of iis. if kill it, starts again different port id. how can see in windows xp application triggers process start? there tool process explorer can explore process , resource used.... inetinfo.exe (iis 6.0) when iis 6.0 runs in worker process isolation mode, inetinfo.exe user-mode component hosts iis metabase , hosts non-web services of iis 6.0, including ftp service, smtp service, , nntp service. inetinfo.exe depends on iis admin service host metabase. when iis 6.0 runs in iis 5.0 isolation mode, inetinfo.exe functions did in iis 5.0. in iis 5.0 isolation mode, however, inetinfo.exe hosts worker process, runs isapi filters, low-isolation isapi extensions, , other web applications. in iis6.0, regardless of application isolation mode used, services run in inetinfo.exe run dynamic-link libraries (dlls) under local system account. because local system account allow

objective c - NSNotification arrived with broken object -

i'm posting notification in manner: ... ivsession *newsession = [[[ivsession alloc] initwithdictionary:propertydict] autorelease]; nsdictionary *notifparams = [nsdictionary dictionarywithobject:newsession forkey:@"session"]; nsnotification *newsessionnotif = [nsnotification notificationwithname:ivnewsessionnotificaiton object:self userinfo:notifparams]; ... ivsession interface: @interface ivsession : ivmappableobject { nsstring *_ssid; nsnumber *_uid; } @property (nonatomic,retain) nsstring *sessionid; @property (nonatomic,retain) nsnumber *userid; and init method: - (id)initwithdictionary:(nsdictionary*)dict { if ((self = [super init])) { nsdictionary *mapping = [self elementtopropertymappings]; (nsstring *key in mapping) [self setvalue:[dict objectforkey:key] forkey:[mapping objectforkey:key]]; } return self; } but @ method, called notification, i'm receiving broken newsessi

c# - How do I convert a string to a decimal, and format it for pretty output? -

i want convert "372551.40" decimal. need see after converting format 372.551,40. to convert decimal, can use: decimal decimalvalue = 0.0; decimalvalue = decimal.parse("372551.40"); or decimal.tryparse("372551.40", out decimalvalue); to display in specific format can do: cultureinfo tr = new cultureinfo("tr-tr"); string formattedvalue = decimalvalue.tostring("c", tr); //result 372.551,40 ytl formattedvalue = decimalvalue.tostring("0,0.00", tr); //result 372.551,40

Android, how fix the max character length/size of EditText -

please guide me, want fix size of edittext.. i want can enter 10 character in edittext, after not type more 10 character... any method there? thanks in advance.. add attribute edittext android:maxlength="10"

how to make a Facebook application in java using eclipse and jboss? -

i trying develop facebook application using java. can please me out? i have used code provided in http://www.developer.com/java/article.php/10922_3733751_7/writing-facebook-applications-using-java-ee.htm here giving 2 servlets , 1 jsp file , 1 xml file got above mentioned site. abstractfacebookservlet public class abstractfacebookservlet extends javax.servlet.http.httpservlet implements javax.servlet.servlet { protected static final string fb_app_url = "http://apps.facebook.com/myfacebookapp/"; protected static final string fb_app_add_url = "http://www.facebook.com/add.php?api_key="; protected static final string fb_api_key = "fb_api_key"; private static final string fb_secret_key = "fb_secret_key"; public abstractfacebookservlet() { super(); } /* * method used of application's servlets (or web * framework actions) authenticate app facebook. */ protected facebookr

php - How to get the result separated by ,? -

$getmusiclist =explode(',', $event[0]['even_music']); print_r($getmusiclist); this line gives array ( [0] => 3 [1] => 12 [2] => 5 ) $exegetmusic1 = array(); foreach ($getmusiclist $kk => $musiclist) { $getmusic = "select event_music_nam et_mc eventmusic_id='".$musiclist."'"; $exegetmusic = execute_query($getmusic, false, "select"); $exegetmusic1[] = $exegetmusic; } print_r($exegetmusic1); this line gives array ( [0] => array ( [event_music_nam] => alternative ) [1] => array ( [event_music_nam] => classics ) [2] => array ( [event_music_nam] => country/folk ) ) but want final ans should alternative,classics,country/folk plz help. thanks when there 1 item

Android - how can I dynamically load drawables (pictures)? Names not known until run-time -

i've searched google , website many times, can not find solution question. first, understand, can load images using like: int image = r.drawable.icon; (assuming there's file called 'icon.png') and i've read about, , tried using: getresources().getidentifier("resname", "restype", com.example.whatever); but, here's i'm unable do: want able have pictures in /res/drawable folder (i believe that's correct folder), without knowing of names of files, , load them dynamically - @ run-time. one (of many) things i've tried (something like): int[] images = new int[numberofimages]; for( 0 numberofimages ) { images[i] = getresources().getidentifier("resname", "restype", com.example.whatever); } this returns 0 every time, it's not going work i'd name , integer identifier every picture in /res/drawables folder. can done without knowing file names? ----------------------------------

My Android spinner works without an ArrayAdapter...why? -

will come heaven or hell? had populate 5 spinners, tried compact code. didn´t understand why should use arrayadapter, dropped out, in spite tutorials use it. surpraised, worked. code showing 1 spinner: spinner s2_height = (spinner)findviewbyid(r.id.s2_height); s2_height.setonitemselectedlistener(new onitemselectedlistener() { //register callback invoked when item in adapterview has been selected. public void onitemselected(adapterview<?> arg0, view arg1, //callback method invoked when item in view has been selected int arg2, long arg3) { mycalc();} public void onnothingselected(adapterview<?> arg0) { // todo auto-generated method stub } }); this location in .java, dropped out arrayadapter section, normaly being in tutorials recomanded as: arrayadapter<charsequence> adapter = arrayadapter.createfromresource( this, r.array.height_array_id, android.r.layout.simple_spinner_item);

c# - naudio waveProvider.AddSamples causing a crash -

private unsafe static void audiostreamcallback(intptr buff, int32 size) { byte[] samples = new byte[size]; marshal.copy(buff, samples, 0, size); waveprovider.addsamples(samples, 0, size); bytes_played += size; } in above code, buff returned native dll written in c . logging, have printed number of bytes added sample. based on log, getting below mentioned error after playing 2.4 mb samples. unhandled exception: system.invalidoperationexception: buffer full @ naudio.wave.bufferedwaveprovider.addsamples(byte[] buffer, int32 offset, int32 count) do need free buffer or make sure flush old entries before adding new samples? looked @ source code, didn't find related buffer size. missing thing. thanks help. bufferedwaveprovider backed fixed size circular buffer. once full throws exception (newer versions of naudio allow configure whether exception thrown or whether audio silently discarded). latest code allows set bufferduration before first ca

PHP Server responded "Forbidden" when trying to upload file from android -

i try run code site http://stunningco.de/2010/04/25/uploading-files-to-http-server-using-post-android-sdk/ have problem, when try send file server “forbidden” response server , on server nothing. know wrong it? maybe need change somethig in php config? every help. excuse me in advance bad english. problem seems server related. configuration forbid upload file. maybe should check server file permissions. check out link step-stone in order solve issue : http://mysql-apache-php.com/fileupload-security.htm

scala - Problem install lift framework on Fedora -

i'm trying start lift_basic project latest version of lift (2.4-m1). i'm following docs - untarred tarball, changed scala_29/lift_basic , ran ./sbt update fails with: getting scala 2.7.7 ... :: retrieving :: org.scala-tools.sbt#boot-scala confs: [default] 2 artifacts copied, 0 retrieved (9911kb/112ms) getting org.scala-tools.sbt sbt_2.7.7 0.7.5 ... :: retrieving :: org.scala-tools.sbt#boot-app confs: [default] 16 artifacts copied, 0 retrieved (4271kb/107ms) [info] recompiling project definition... [info] source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed. sbt.undefinedvalue: value property '<unnamed>' /var/www/html/projects/lift/lift-lift_24_sbt-14a1743/scala_29/lift_basic/project/build.properties undefined. @ sbt.basicenvironment$userproperty.sbt$basicenvironment$userproperty$$inheritedvalue(environment.scala:155) @ sbt.basicenvironment$userproperty$$anonfun$resolvedefaultfirst$1.apply(environment.scala:135) @ sbt.basicenvironment$u