Posts

Showing posts from September, 2012

css - How do I stop Sass adding spaces before units of measurement? -

this question has answer here: adding unit number in sass 1 answer i'm attempting follow this tutorial on responsive layout design, using sass/scss base specification language. to end, have defined following scss: body { font: 100%/1.5; } h1 { $h1_size: 24; font-size: ($h1_size / 16)em; line-height:(28 / $h1_size)em; margin-top: (24 / $h1_size)em; } unfortunately, output sass css format looks this: h1 { font-size: 1.5 em; line-height: 1.167 em; margin-top: 1 em; } — unit separated value space. chrome rejects these values invalid, , uses them if manually go , remove spaces myself. is there way fix problem tweaking scss, or passing option sass ? so far, have tried: placing unit inside calculation: ( font-size: ($h1_size / 16em) ) => syntax error ( font-size: (($h1_size)em / 16) => font-size: 24 em/16; same problem i...

How to cache google app engine -

is possible cache google apps engine static content; far thing have done follow these directions store files http://www.digitalistic.com/2008/06/09/10-easy-steps-to-use-google-app-engine-as-your-own-cdn/ in effort improve end user experience need way able cache content (mostly banners/images) users is there friendly guide doing not keen python? thanks in advance!! have followed instructions configuring static handlers here .? can configure cache expiration static data , appengine serve files headers configured correctly.

java - c14n with Android -

is there way make xml in canonical form on android? the canonicalizers apache projects don't work depend on javax.xml.* packages aren't available on android. ok, found solution: canonizer used in xom project (http://www.xom.nu/) runs on android.

c# - Best Practice for Unit Testing Enum Translator -

what best practice unit testing these kind of methods? public verificationresultcode translate(int value) { verificationresultcode result; if (enum.isdefined(typeof(verificationresultcode), (int)value)) result = (verificationresultcode)((int)value); else throw new unknownresultreturnfromgatewayexception(); return result; } verificationresultcode enum type like: public enum verificationresultcode { bankingnetworkerror = 100, notequal =101, inputformaterror = 102, merchantauthenticationfailed = 103, ... } we should write single test method each of enum members or write one test method lots of assertions ?! the code trivial unit test. should unit test behavior depends on verificationresultcode test translate function. bigger question why need public translation function instead of encapsulating in objects?

tags - Branching and Tagging SVN -

i have school maintenance course , had mingle svn quite lot. i've created branch major refactoring(switched branch too). when done , went on tag branch,instead auto-committed had in branch trunk , tagged final result(the trunk + changes of branch). i don't understand went wrong, thought if tagged branch either copy of branch or of trunk's current revision. instead had branch auto-merged changes , tag created of revision. just wondering if can relate might ave been issue, i'm trying figure out happened or if used svn wrong way. i've used tortoisesvn so, here steps did: create branch of current trunk /branches switch branch make changes code in branch create tag of trunk(then committed branch trunk , tagged). still there confusion told tortoisesvn do. i find copied branch /trunk directory instead of /tags directory -> /trunk identical branch. can rectified reverse merge of particular revision, , commit. generally, log tell happened. can...

.net - How to do wcf routing service using xpath? -

i have wcf project needs routing stuff. 1 scenario there is, service versioning. example if there change or new service needs implemented new client on wcf service breaking, create different service endpoint consumed new client. bu thing old client should still able communicate older version of service(that's how service versioning should work right?). so, decided use wcf routing service using xpath method. two things can xpath method, either check version on data contract using content filtering or looking @ header. want both sake of bench marking. understand how xpath work don't know how implement it. any tutorials or examples appreciated. found few examples on web they're not giving full config. best regards, found article here, video explaining , downloadable source. here: article: http://msdn.microsoft.com/en-us/vs2010trainingcourse_whatsnewinwcf4_topic19 video tutorial: http://channel9.msdn.com/shows/10-4/10-4-episode-40-the-new-wcf-routing-serv...

php - Dynamically adding the values of a checkbox that has been inserted dynamically? -

how dynamically display sum of values of check boxes have been checked in php. its checkout in shopping cart.each item checked, has value , final amount(in same page @ bottom) should sum of rates of items have been checked(without refreshing). i may need use ajax. can give simple sample code please for checkboxes, need make them array, instance: <input type="checkbox" name="items[]" id="items[]" value="25" /><br /> <input type="checkbox" name="items[]" id="items[]" value="40" /><br /> <input type="checkbox" name="items[]" id="items[]" value="12" /><br /> ... <!-- many want --> <input type="checkbox" name="items[]" id="items[]" value="20" /><br /> on php side handle so...(note: come php array) $items = $_post["items"]; //it's array -- feel ...

wpf - bing maps RouteResponse.Results.RoutePath.Points = null? -

i having little problem bing maps service. want draw route in wpf app. everithing working except when read routepath.points result . in field legs there directions in routepath there arent data. this weird. wrong ? i have figured out problem. need define options routerequest bring routepath points. routerequest.options = new routeoptions() { routepathtype = routepathtype.points }; you can close topic....

ios - Custom MAM application -

i wondering if possible code own mam server or application ios platform. maybe can point me in right direction i'm looking way silently push out applications, either through app store or off of server. problem solutions have tried require keep re entering password every application want install pain if user wants update application since don't know account/password. appreciated as stated , quite few times on stack overflow - cannot silently push out applications on ios apple not provide support this. every application installation has approved user.

c++ - copying from a std::string to a char array and null-terminating the result -

i have visual studio 2008 c++03 application want copy std::string char array, need char array null terminated if must truncate string so. this, instance works desired: inline void copyandnullterminate( const std::string& source, char* dest, size_t dest_size ) { source.copy( dest, dest_size ); using std::min; char* end = dest + min( dest_size - 1, source.size() ); *end = '\0'; } int main() { enum{ max_string_size = 15 }; char dest[ max_string_size ]; std::string test = "this test"; copyandnullterminate( test, dest, max_string_size ); assert( strcmp( test.c_str(), dest ) == 0 ); return 0; } example: http://ideone.com/0ebyb is there shorter, more efficient method of doing this? thanks yes, use strncpy , defined in cstring : void copystring(const std::string& input, char *dst, size_t dst_size) { strncpy(dst, input.c_str(), d...

ruby on rails - AWS::S3::NoConnectionEstablished -

i'm writing own amazon s3 uploader following http://amazon.rubyforge.org/ . able make connection in terminal. however, can't establish connection on heroku; keep getting error: #<aws::s3::connection:0x00000004632c @options={:server=>"s3.amazonaws.com", :port=>80, :access_key_id=>"abc", :secret_access_key=>"abc"}, @access_key_id="abc", @secret_access_key="abc", @http=#<net::http s3.amazonaws.com:80 open=false>> i've used paperclip attach images models i've set s3 environment on heroku using heroku config. i have s3.yml file access key , secret key. any advice?

exe - C# content folder path -

i have simple c# application must run console application 1 step. i've seen few posts on including executables embedded resources , running them through memory streams doesn't easiest way. i'm thinking better copy .exe content folder , run ol' process.start there. the question is, how find content folder application? i can done way, seems roundabout: //run executable streamresourceinfo info = application.getcontentstream(new uri("myapp.exe", urikind.relative)); string appname = (info.stream filestream).name; any tips? path.getdirectoryname(application.executablepath); then can use path.combine go contents subdirectory or whatever directory other app in.

debian - Ruby script running standalone on vps -

i have ruby script want run 24/7 on vps( debian squeeze ). now run script have open new ssh session putty , start script console. when close console script process closes. how can make script running standalone? maybe can take @ nohup command: http://uw714doc.sco.com/en/sdk_tools/_using_the_nohup_command.html

cordova - Where is the database file stored in Blackberry OS 7 Simulators? -

i using phonegap develop application on bb os 7 simulator. using sqlite , mounting folder sdcard. not able find database got created in application. although storing dont know where. where stored? your data base saves in sdcard folder itself.if want check data stored or not fallow path "sdcard\databases\" in can find file ,right click on file , select openwith select sqlite ,the database table opens can ckeck inserted fields.

c# - How to check if ID matches another ID and then display them via a foreach -

not sure how phrase question, i'll try anyway. i'm working on project want pull out user's highscore via. highscore id in database this: the user database: |id | username | | 1 | test1 | | 2 | test2 | | 3 | test3 | highscore database: |id |highscore |highscoreid| | 1 | 200 | 1 | | 1 | 230 | 2 | | 1 | 240 | 3 | first, wish check if the user's id matches id in highscore database (highscoreid), when displaying highscores, test1 (whose id 1) displayed in front of highscore id corresponds id in highscoreid. kind of like; if(username.id == 1 && highscore.highscoreid == 1) { //display username + score associated username } i'm not sure how else explain this, when ever wanted display via id websites, have id in address link, , pull out id address link. i hope explained enough, hitting deadline game, hope dont have rewrite question. thanks in advance, guys rock. edit so basicly this: mathandy...

Is there a good way to create and use a 'Template' in Visual Studio 2010 -

our projects in our company built based off thing call 'project scaffold'. it's got base required code sites, basic folder structure , other things similar that. at moment, have repository 'project scaffold' , each time want create new project, copy project new folder, , rename occurrences of name 'projectscaffold' within project. can tell, quite time consuming , can cause errors if miss out single occurrence of 'projectscaffold'. this project need have default dependencies why having full project copy working @ moment. i have looked possibility of creating visual studio template can't seem find way of accomplishing it. we have been thinking if there way possibly implement through nuget package, feel if either extremely difficult or impossible. if possible, usable in visual studio 2011 simply file-->export template :) you can customize generated zip file suit needs. more on over creating project , item templates on ...

python - Adding xsi:type and envelope namespace when using SUDS -

i need interact soap service , having lot of trouble doing so; appreciate pointers on this. original error message was: org.apache.axis2.databinding.adbexception: type element type has not been given after research, turns out disagreement between suds , server has how deal with type="xsd:anytype" on element in question. i've confirmed using soapui , after advice problem can fixed taking these steps: adding xsi:type="xsd:string" each element causes problems adding xmlns:xsd="http://www.w3.org/2001/xmlschema" soap envelope so, suds this: <soap-env:envelope ... xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <ns3:body> <ns0:method> <parameter> <values> <table> <key>email_address</key> <value>example@example.org</value> </table> </values> </parameter> </...

Adding a custom extension to executable made with makefile -

i have basic makefile: cc=gcc cflags=-wall -g -o -pedantic -wformat=2 -wextra -lm and compile foo.c foo. how can add custom extension, example want compile foo.c in foo.run . thank much. add makefile : foo.run : foo.c $(cc) $(cflags) -o $@ $< make sure second line starts tab character, not spaces. check out manual page or other documentation version of make.

asp.net mvc - UpdateModel change MVC1 vs MVC3 -

i'm converting app asp.net mvc 1 mvc 3, ran problems when calling updatemodel() when submitting form. here model class: public class testmodel { public string name { get; set; } public string description { get; set; } public int age { get; set; } public int? subvalue { get; set; } public int agesub { { return subvalue.value - age; } } } and in controller: [acceptverbs(httpverbs.post)] public actionresult testmodelsave() { testmodel tm = new testmodel(); try { updatemodel(tm); if (modelstate.isvalid) { return redirecttoaction("testmodeledit"); } } catch { } return view("testmodeledit", tm); } if leave subvalue null when submit, in mvc 1 works fine. in mvc 3, when call updatemodel(tm) throws exception on line return subvalue.value - age; in testmodel class. i go , change subvalue.value subvalue.getvalueo...

java - How to specify Tomcat logs as home for log4j log file -

my war using log4j fileappender configured via log4j.properties file under classes/ directory inside war. i have configured log4j appender such: # set root logger debug. log4j.rootlogger=debug # monitorlog - used log messages in monitor.log file. log4j.appender.monitorappender=org.apache.log4j.fileappender log4j.appender.monitorappender.file=monitorlog.log log4j.appender.monitorappender.layout=org.apache.log4j.patternlayout log4j.appender.monitorappender.layout.conversionpattern= %-4r [%t] %-5p %c %x - %m%n # use monitorappender log messages. log4j.logger.*=debug,monitorappender with configuration trying achieve following: all log messages debug-level , higher logged (so everything) i want monitorlog.log file located under tomcat's logs/ directory does configuration achieve these items, , if not, needs change? if know war deployed tomcat, can take advantage of system property catalina.base , represents root of tomcat base folder (there cataline.home ...

.net - How can I save to string from linq to xml? -

i want save node output string can things later. how it? when try use stringbuilder() writes whole xml file string instead of chosen node. here code: xdocument xmldoc = xdocument.load("file.xml"); var q = c in xmldoc.descendants("parent") select (string)c.element("child"); foreach (string child in q) { console.writeline("site: " + child); } difficult tell after here. saying above code want, except want store child nodes content local var ? if so... var sb = new stringbuilder(); xdocument xmldoc = xdocument.load("file.xml"); var q = c in xmldoc.descendants("parent") select (string)c.element("child"); foreach (string child in q) { sb.appendline("site: " + child); } var result = sb.tostring();

c# - Logout From LinkedIN using asp.net -

i using openid in asp.net application.for linkedin ,i have used javascript api able login in site want know how logout site automatically logs me out linkedin also. pl suggest solution. thanks the protocol doesn't allow log user out of linkedin. may log users out of own site. design.

android - DevicePolicyManager.getPasswordQuality(null) returns 0 instead of 131072 -

i have password policy admin configured , activated requires password have minimum length , have numeric values. in separate code block, using devicepolicymanager.getpasswordquality check quality of password on deivce. however, when pass null method, password quality of 0(unspecified) regardless of password quality configured/governed active policy admin. on other hand, if explicitly pass device policy admin component name method call, correct value of password quality. this not adequate me need able aggregated password quality if more 1 device admin active/installed, can accomplished passing null method per api docs. any pointers here of great proceed. note using level 14(4.0.4) , on emulator. here code snippet of worked , didn't work: whats not working: devicepolicymanager dpm = (devicepolicymanager)service.getsystemservice(context.device_policy_service); list<componentname> list = dpm.getactiveadmins(); componentname admin = null; stri...

Hibernate: dynamically set table name -

i have entity should dynamically persisted different tables according string property representing table name. hibernate's dynamic models looks want, cannot find how set table name :) can tell me i'm missing? thank's in advance. p.s.another found solution http://java.dzone.com/articles/hibernate-dynamic-table-routin . dislike cause looks dirty hack. if i'll have multiple query parts named substring want replace. if using jpa then can @prepersist . if working plain hibernate take @ event . don't know if work you. it looks namingstrategy tutorial need. @override public string classtotablename(string classname) { // code super.classtotablename() } org.hibernate.cfg.namingstrategy interface. hibernate 3.6 has 4 implementations of interface: org.hibernate.cfg.defaultcomponentsafenamingstrategy org.hibernate.cfg.defaultnamingstrategy org.hibernate.cfg.ejb3namingstrategy org.hibernate.cfg.improvednamingstrategy implement code return t...

properties - How to define a default list of attributes for a Python object? -

i have few objects in program have 10-15 attributes each. these attributes set @ various places in code in various stages in program. absolutely fine set them on objects without having them defined in class in python, there's no authoritative list in program of attributes used. i'd following: class myobject(object): attr1 attr2 i've looked @ property() built-in, it's @ least 6 lines of code per property. there easy way define list of default attributes without initializing them in python? update : forgot mention, of values don't have sensible defaults , equal none before used. like this? class myobject(object): def __init__(self, attr1 = default1, attr2 = default2): self.attr1 = attr1 self.attr2 = attr2 you can instantiate myobject or without specifying attributes myobject1 = myobject() # gets default values myobject2 = myobject(foo, bar) # overrides defaults you use keyword arguments ( kwargs ) if have va...

php - Prevent Facemash cheating through url -

i've been using facemash-like script. problem while rating people when point our cursor towards picture every image there url like: rate.php?winner=xxx&loser=xxxx1 so, if directly type in address bar trick works! hence there chance users hack scores. know can change methods post methods. , i've searched , nothing helped me out. links files(rate.php , index.php) included in comments of question. i'm making own facemash-like engine , here's do. i store 2 challengers' id s in php $_session . before displaying new pair check if $_session set , if display them instead of taking new pair database. prevents cheating refreshing page until photo. did because community i'm making facemash relatively small. so links vote.php?v=left or right . in vote.php id s $_session['right'] , $_session['left'] , unset them. looking forward publish script day.

c# - Prevent a Task Continuation -

i'm using task continuations long running operation on winform project. var task1 = task.factory.startnew(() => dosomework()); var task2 = task1.continuewith(result => dosomemorework(), taskcontinuationoptions.onlyonrantocompletion); var task3 = task2.continuewith(result => dofinalwork(), taskcontinuationoptions.onlyonrantocompletion); i want continue task3 if conditions met on dosomemorework() function executes on task2. how can done? from msdn a user-defined value can passed antecedent continuation in result property, output of antecedent can serve input continuation so 1 way in task3, check result task2 before doing work. var task2 = task1.continuewith(result => dosomemorework(), taskcontinuationoptions.onlyonrantocompletion); var task3 = task2.continuewith(x => dofinalwork(x.result)); where result returned task2 determines happens in task3. edit solution cancel task2 if conditions not met within operation. continuation task ...

prototypejs - JavaScript functions are not working in ajax tabs -

in page have ajax tabs , every tab consists of javascript functions. want load each javascript function when tabs clicked. functions not working in tabs. how can solve this? my codes follows: php: echo "<script type='text/javascript'>"; echo "function check(){"; echo "alert('hello');"; echo "}"; echo "</script>"; echo "<div><a href='javascript:check();'>check</a></div>"; ajax: new ajax.request( test.php, { method:'post', onsuccess: function(data){ var tmp=data.responsetext; $$('.tolga').invoke('insert',tmp); } }); html: <div class="tolga"> </div>

android SOCKS proxy -

i have following code in (test) android project: url u = new url("http://www.google.com"); inetsocketaddress sa = inetsocketaddress.createunresolved("127.0.0.1", 1080); proxy proxy = new proxy(proxy.type.socks, sa); httpurlconnection conn = (httpurlconnection) u.openconnection(proxy); then have implemented socks server listening on port 1080. the problem have in socks4 connection request, destination address , port not "ip google":80 rather 127.0.0.1:1080, i.e. proxy address. if return ok, start getting http data. am doing wrong or there bug in socks-client? i have solution little lower level might useful you: this works me on android 4.3 on rooted nexus 4 sshtunnel running: socketaddress proxyaddr = new inetsocketaddress("127.0.0.1", 1984); socketaddress hostaddr = new inetsocketaddress(address, port); java.net.proxy proxy = new java.net.proxy(java.net.proxy.type.socks, p...

ruby on rails - Getting multiple selected options with javascript from collection_select, RoR -

i have view in ruby on rails application there 2 collect_selects on right side, 1 of list of users , other list of objects has :multiple => true. when user has selected user , @ least 1 object want display chart on right side user , whichever objects have been selected (likely using gem flot). have seen how selected object using selected_index, i'm stumped how can array of of selected objects when multiple selections allowed. hoping in javascript without having submit button or anything, possible? i found own answer. of selected objects in javascript, example in collection_select id "user_id" need use: $("#user_id option:selected").each(function() { // whatever $(this).text() or $(this).val() each option. });

java - pam sharing hash -

i looking @ way pam modules designed guidelines own jaas loginmodule. 1 thing surprised me that, although method used access hashed password orthogonal hash method itself, not able find pam modules make use of property. because of security issue overlooked, or not explored yet? to explain little bit more mean, let's have have 3 different methods access hashed password (ldap, sql, plain files) , 2 hash methods (md5, sha1). there is 1 or more pam modules each access method, each 1 implementing 1 or more of these hash methods. adding new hash method (say bcrypt) means these access method needs modified support new hash type. better design have 1 pam module each access method retrieves hashed password using user name, have separate set of pam modules hash verification, hashed value shared between modules (like password is). if use database store password, , use md5 verify password, configuration this: password required pam_sql.so password required pam_md5.so in conf...

regex - python re.sub with a list of words to find -

i not familiar re trying iterate on list , use re.sub take out multiple items large block of text held in variable first_word . i use re.sub remove tags first , works fine, next want remove strings in exclusionlist variable , not sure how this. thanks help, here code raises exception. exclusionlist = ['+','of','<et>f.','to','the','<l>l.</l>'] in range(0, len(exclusionlist)): first_word = re.sub(exclusionlist[a], '',first_word) and exception : first_word = re.sub(exclusionlist[a], '',first_word) file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/re.py", line 151, in sub return _compile(pattern, flags).sub(repl, string, count) file "/library/frameworks/python.framework/versions/2.7/lib/python2.7/re.py", line 245, in _compile raise error, v # invalid expression error: nothing repeat the plus symbol operator in regex meaning '...

What can I do if I delete Xcode's Info.plist (not the apps plist)? -

recently trying study how run apps in debug mode in real machine without code signing. require me change setting in xcode's plist (not apps' plist). before this, use > sudo cp info.plist info.plist.bk backup info.plist. after fail test, change typing command: > sudo rm info.plist > sudo mv info.plist.bk info.plist there accident, have typing mistake second command line this... > sudo rm info.plist.bk info.plist oh yea... love drink red tea... try restart xcode, cannot identify iphone , iphone simulator... should recover ? if don't have backup of info.plist there ist no alternative reinstalling xcode scratch...

ruby on rails - How to translate attributes of table-less model? -

railscast #326 activeattr explains how create table-less models. how can 1 translate attributes explained table-based attributes in rails docs ? instead of going via activerecord (e.g. de.activerecord.attributes.message.subject: betreff ), activemodel has referenced (e.g. de.activemodel.attributes.message.subject: betreff ). -- outlined stephenmurdoch in comment

asp.net - Cache items corrupt or mixed up -

i have strange problem website several objects cached. have lot of datatables, strings, booleans , other stuff cached quick fetching in later requests. sometimes periodic error looks of cache items have been mixed up. example of how shows when piece of code fetches datatable cache , tries access column of datatable. see yellow screen of death exception "cannot find column [columnname]", "columnname" of course column name supposed in datatable. when inspect cache item little home made tool, see different datatable in cache item. of cache items have been mixed up. does have idea how happens? we not able reproduce error. occurs @ apparently random intervals. whats issue when add items cache, need lock process create them , added cache. first lets clarify cache keep reference data , not clone them, nether knows whats not data ! reference: http://msdn.microsoft.com/en-us/library/6hbbsfk6(vs.71).aspx second clarify default session of page lock pag...

java - coming back to splashscreen in eclipse rcp -

i have rcp program splash screen login. i'd make log out button. clicking button, user should referred splash screen, has log in again.. is possible? thanks in advance. if use org.eclipse.ui.iworkbench.restart() go , run splash screen again.

intellij idea - Where can I find the Android source jars? -

it awesome if had link list of android source jars download, can attach source code android in intellij. don't have time mucking around day doing (why reinvent wheel?), have apps build! i know eclipse has plugin this, don't eclipse, i'm using intellij. ps - need honeycomb+ since there aren't full sources included versions of sdk, have few options: grab aosp , build source jars yourself. here blog post talks ways of accomplishing this. look pre-built jars people have hosted. how eclipse plugin mentioned works, , here link site has jars 2.3.3; grabbed jars have attached sources in intellij. you may have noticed can download sources jars 4.x directly sdk manager now, 3.x set missing pre-built jars. hth

boost - Calculate rolling / moving average in C++ -

i know achievable boost per: using boost::accumulators, how can reset rolling window size, keep history? but avoid using boost. have googled , not found suitable or readable examples. basically want track moving average of ongoing stream of stream of floating point numbers using recent 1000 numbers data sample. what easiest way achieve this? i experimented using circular array, exponential moving average , more simple moving average , found results circular array suited needs best. you need circular array of 1000 elements, add element previous element , store it... becomes increasing sum, can sum between 2 pairs of elements, , divide number of elements between them, yield average.

eclipse - Where exactly on android emulator app goes? Is it case at max 2 app at a time, if that's the case how to remove? -

Image
i have started android dev using eclipse/adt. made couple of apps (hello, android, test) , see them on android (not sure both seem have got install on simulator) what happening whatever app make runs fine not see on emulator. downloaded 2 activity example http://www.mkyong.com/android/android-activity-from-one-screen-to-another-screen/ open project in eclipse , run not see on simulator. first time mobile development might missing obvious. i noticed having following 2 warning while running app. warning: data partition in use. changes not persist! warning: cache partition in use. changes not persist! could reason how resolve it? i've never encountered limit how many different apps can load emulator, can't speak issue. removing app easy (pretty phone work). 1) bring app list 2) hit menu button 3) select "manage apps" 4) click on app 5) click on "uninstall"

javascript - Facebook Video Player API -

i'm trying developing web app involves taking user's facebook videos , allowing them create user/viewer interactivity. in order need sort of facebook player api similar ones youtube , other video servers offer (that offers eventlisteners, play pause, volume functions). not seem have 1 though , i've been looking around while. ideally contact facebook , ask if it's possible couldn't find contact information. the player basic, easy find: it's linked every facebook video page on frontend of facebook.com : and in graph api : http https://graph.facebook.com/2031763147233 : { "id": "2031763147233", "from": { "name": "facebook", "category": "product/service", "id": "20531316728" }, "name": "facebook video calling", "description": "bring conversations life on facebook. face-to-face video "em...

c# - How do I work with MongoDB from ASP.Net web pages and razor? -

i've gotten head around mongodb syntax using json notation , can find c# examples around, more complex i'd , i'm looking simple model follow doing basic work mongo web pages , razor. you don't. data access should done in code behind, or better, repository called code behind. if quick search, you'll see there quite few examples of using mongodb .net. http://www.mongodb.org/display/docs/csharp+language+center http://www.joe-stevens.com/2011/10/02/a-mongodb-tutorial-using-c-and-asp-net-mvc/ http://www.eggheadcafe.com/tutorials/database/3a73c6de-82a1-4690-a7aa-d0eda58203f7/store-aspnet-site-visitor-stats-in-mongodb.aspx

delphi - Sending Email with signature -

i have been using: shellexecute(self.handle, nil, pchar(format('mailto:%s ?subject=assunto: &body=',[_lemails ])), nil, nil, sw_normal); to send emails. no body text users have automatic signatures in emails clients automatically. now want enable users insert text well, if text gets there no signature. there way "force" this. thanks you can use mapi instead (the messaging applications programming interface ), gives better control on email, , allows things attachments. can choose whether show user's email client "compose" window or add directly outbox. (the outbox functionality restricted because of changes windows security, ms outlook concerned.) the quickest, easiest way use jedi code library jclemail . it's wrapper around simplemapi, makes easy (code taken older app, , based on sample jcl demo): email := tjclemail.create; try email.recipients.add(ansistring(ema...

mysql: altered function but stays old function -

i changed column name in table, , needed change function it. changed function. still runs old function! gives me : "error code: 1054 unknown column 'avdoctorid' in 'where clause'" and i'm sure changed function because if see function new one! how can be? i did in mysql workbench, , if see function in other program show new function, gives same error when try run it. this query run it select fnc_createappointment(8,1,"2012-08-06","15:30:00","something"); and function itself: delimiter $$ create definer=`root`@`%` function `fnc_createappointment`(clid int,calid int,appdate date,apptime time,commentaar varchar(3000)) returns tinyint(1) begin declare succeeded boolean; declare id2 int; declare id int; declare dagweek int; declare afwezig int; set afwezig = 0; set dagweek = dayofweek(appdate); set id =0; set id2 = 0; set succeeded = false; select availableid id tbl_available avdays = dagweek , avhours = apptime...

Timer call in C# stops into to a Textbox -

i'm working on chat software in c# 2010 incoming messages being received fixed timer. when type message sending user , during sentence typing if incoming message timer call comes stops few seconds , resume again. is there way make timer , input textbox independent ? instead of system.forms.timer use system.timers.timer. system.forms.timer run in ui thread system.timers.timer runs in different thread.

javascript - Loading data into model by id-Extjs -

im trying use direct store in extjs heres code store ext.define('ide.store.files', { extend: 'ext.data.store', proxy: { type: 'direct', api: { create:files.addnew, read:files.getfile, update:files.update, destroy:files.delete, //load:files.getfile }, paramorder:'path' }, model:'ide.model.file' }) the code model ext.define('ide.model.file', { extend: 'ext.data.model', fields: [ { name: 'path', type: 'string' }, { name: 'name', type: 'string' }, { name: 'extention', type: 'string' }, { name: 'content', type: 'string' } ], idproperty:'path', store:'ide.store.files' }) as can see idproperty path following code segment giving error //this.getstore('ide.store.files').load(path...

how to add figures from multiple worksheets in excel using ranges -

i have multiple worksheets using same template have summary page , have formula works individual sheet =sumproduct(--(sheet1!f4:sheet1!f500>=a1),--(sheet1!f4:sheet1!f500 the formula checks relevant ranges on sheet 1 , returns values in boxes in date range specified in a1 , a2 the problem want multiple sheets , use 3d reference. i have tried =sumproduct(--(sheet1:sheet3!f4:sheet1:sheet3!f500>=a1),--(sheet1:sheet3!f4:sheet1:sheet3!f500 and thrown in brackets safe =sumproduct(--((sheet1:sheet3!f4):(sheet1:sheet3!f500>=a1)),--((sheet1:sheet3!f4):(sheet1:sheet3!f500) neither of these work , getting #name? error any ideas appreciated thanx in advance gary your formulas truncated, trying count dates between a1 , a2 inclusive? can't use 3d references in sumproduct. in excel 2007 use formula =sumproduct(countifs(indirect("'"&g1:g3&"'!f4:f500"),">="&a1,indirect("'"&g1:g3&...

iphone - Set UIBarStyle of UIImagePickerController -

i set bar style of uiimagepickercontroller following, bar still uibarstyleblacktranslucent . possible set bar style of uiimagepickercontroller ? in advance! uiimagepickercontroller *imagepicker = [[uiimagepickercontroller alloc] init]; imagepicker.sourcetype = uiimagepickercontrollersourcetypephotolibrary; imagepicker.navigationbar.barstyle = uibarstyleblack; edit 1 i can set tint color through: imagepicker.navigationbar.tintcolor = uicolorfromrgb(0xcc6600); here's worked me (you need test class of navigationcontroller, not viewcontroller being presented, , need set non-transparent background color seems) - (void)navigationcontroller:(uinavigationcontroller *)navigationcontroller willshowviewcontroller:(uiviewcontroller *)viewcontroller animated:(bool)animated { if ([navigationcontroller iskindofclass:[uiimagepickercontroller class]]) { navigationcontroller.navigationbar.barstyle = uibarstyleblack; na...

android - How to recieve an HTTPS Post request in Grails? -

i writing android app needs pass data grails based web application. want using post request on client side. i'm not sure begin on server side of things. understand should use code looks like: request.getparams() i'm not sure needs go. suggestions? you need create controller . e.g. foocontroller { def index = { if (request.status == 'post') print request.params } } } now send post http://<url context>/foo/index .

How do I get the name of a variable in javascript? -

possible duplicate: determine original name of variable after passed function get reference name of object? not sure how explain this. i'm looking string value of variable name, in object itself. for instance: var myobject = function(){ var = this; that.alertmyname = function(){ var name_of_instance = that.__name__; alert(name_of_instance); //hoping retreive string containing 'var1'? } }; var var1 = new myobject(); var1.alertmyname(); it not possible determine name(s) of variable(s) object referenced from, not in particular example anyway. think of case have many variables referencing same object -- expect returned in case? if no variable references object @ all? (consider expression new myobject().alertmyname() -- should object's name be?) if want give object name, make explicit: var myobject = function(name){ var = this; that.alertmyname = function(){ alert(name); } }; var var1 = new myobject(...

python - How do you check if list is blank? -

possible duplicate: python: best way check if list empty? def cleanwhitespace(thedict): stuff=[] key,value in thedict.items(): d in value: if value != " ": stuff.append(d) print d thedict[key]=stuff if not value[d]: print value stuff=[] return thedict print cleanwhitespace({'a':['1','2'],'b':['3',' '],'c':[]}) i edited because need more help. how check if c blank? c equal [] ? i've tried ==[] , "[]" , getting length , == "" , nothing seems work. in python, empty list evaluates false. if not c: print "the list empty" else: print "the list not empty"

android - unable to get correct path of a video -

i want application pick video gallery. uses following code path. intent = new intent(intent.action_get_content); i.settype("video/*"); startactivityforresult(i,2); and @override protected void onactivityresult(int requestcode, int resultcode, intent data) { // todo auto-generated method stub if(resultcode==result_ok){ str = data.getdata().getpath(); //this.go(); this.ko(); } } str stores path. test run value /external/video/media/10 should /sdcard/dcim/a.mp4 load video using mediametadataretriever . how ? in case, (as understand question) if(resultcode==result_ok){ str = getrealpathfromuri(data.getdata()); //this.go(); this.ko(); } use, function real path uri.. function: public string getrealpathfromuri(uri contenturi) { try { string[] proj = {mediastore.video.media.data}; cursor cursor = managedquery(contenturi, proj, null, null, null); int co...

Eclipse plugin for better JSP support -

i'm looking eclipse plugin can @ least search current jsp included (or path mentioned example in custom "include like" tags or comment or anything). similar doing copy qualified name , file search correct path. in idea it's called analyze backward dependencies , works jsps (at least standard includes). a better 1 show jsps current 1 included , show included jsps recursively tree maybe can navigate in easily. i'm not sure if can done usable (i think slow). another feature if click on variable's name jumps it's declared if it's declared in different jsp. idea can too. i have simple solution first 1 can't add more functionality i'm not familiar eclipse plugin system , rcp , don't have time learn it. and please don't tell me use idea because unfortunately that's not option @ work.

actionscript 3 - Netstream video not playing on iPad -

i building ipad app using flash cs6 compile air 3.3 on pc. one of app requirements video player can overlaid other display element - subtitles. i using netstream play mp4 video (have tried flvplayer same results). works fine when compiled run in emulator, video doesn't play once installed on test device - ipad 3. (i did simple test few months ago , got video playing correctly audio, cs5.5, air 3.1, ipad 2. return setup, need support ipad3...) so, couple of quick questions first... same problems? know if has changed on ios blocks air playing video? i usual netstream / netconnection stuff pass file.url netstream.play() . here guts of code: var nc:netconnection = new netconnection(); var ns:netstream; var vid:video = new video(); var videofile:file; videofile = file.applicationdirectory; videofile = videofile.resolvepath(config.video_directory + 'myvideo.mp4'); nc.connect(null); ns = new netstream(nc); ns.addeventlistener(netstatusevent.net_status, onn...

python - SQLAlchemy(Postgresql) - Race Conditions -

we writing inventory system , have questions sqlalchemy (postgresql) , transactions/sessions. web app using tg2, not sure matters info never bad. how can make sure when changing inventory qty's don't run race conditions. if understand correctly if user on going decrement inventory on item 0 , user 2 trying decrement inventory 0 if user 1s session hasn't been committed yet user 2 starting inventory number going same user 1 resulting in race condition when both commit, 1 overwriting other instead of having compound effect. if wanted use postgresql sequence things order/invoice numbers how can get/set next values sqlalchemy without running race conditions? edit: think found solution need use with_lockmode, using update or share. going leave open more answers or others correct me if mistaken. tia if 2 transactions try set same value @ same time 1 of them fail. 1 loses need error handling. particular example want query number of parts , update number of pa...

java - Error while bulk load in hbase -

i trying hbase - bulkload through java mapreduce program. running program in eclipse. but getting following error: 12/06/14 20:04:28 info jvm.jvmmetrics: initializing jvm metrics processname=jobtracker, sessionid= 12/06/14 20:04:28 warn util.nativecodeloader: unable load native-hadoop library platform... using builtin-java classes applicable 12/06/14 20:04:29 warn mapred.jobclient: use genericoptionsparser parsing arguments. applications should implement tool same. 12/06/14 20:04:29 warn mapred.jobclient: no job jar file set. user classes may not found. see jobconf(class) or jobconf#setjar(string). 12/06/14 20:04:29 info input.fileinputformat: total input paths process : 1 12/06/14 20:04:29 warn snappy.loadsnappy: snappy native library not loaded 12/06/14 20:04:29 info mapred.jobclient: running job: job_local_0001 12/06/14 20:04:29 info mapred.maptask: io.sort.mb = 100 12/06/14 20:04:29 info mapred.maptask: data buffer = 79691776/99614720 12/06/14 20:04:29 info mapred.maptask:...

php - Session issues in codeigniter -

i using codeigniter. can't store values in session because whenever refresh page session id changing. $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_expire_on_close'] = true; $config['sess_encrypt_cookie'] = true; $config['sess_use_database'] = true; $config['sess_table_name'] = 'ci_sessions'; $config['sess_match_ip'] = false; $config['sess_match_useragent'] = true; $config['sess_time_to_update'] = 300;

Assigning scalars from a subroutine which returns an array in Perl -

i have perl subroutine returns array of vaules, , i'd call subroutine , capture values in individual scalar variables. i know how when initializing group of scalars: my ($workbenchid, $woid, $wotrayid, $trayid, $customernumber) = subroutinea(); but i'm not sure how same set of scalars (since can't use 'my' again): ($workbenchid, $woid, $wotrayid, $trayid, $customernumber) = subroutinea(); thanks - i'm new @ perl. alternatively can first define variables , later use them without my : my ($workbenchid, $woid, $wotrayid, $trayid, $customernumber); ... ($workbenchid, $woid, $wotrayid, $trayid, $customernumber) = subroutinea(); ... ($workbenchid, $woid, $wotrayid, $trayid, $customernumber) = subroutinea(); ... ($workbenchid, $woid, $wotrayid, $trayid, $customernumber) = subroutinea();

java ee - Glassfish won't start, how to reset glassfish instance? -

i made change in glassfish jdbc resource pool via admin console, last change realm configuration renamed user table field "tablename" "db"."tablename" attempt jdbcrealm auth working derby db glassfish instance won't start. i've uninstalled , reinstalled netbeans , glassfish , getting error: severe: rar8061: failed load resource-adapter-config or ra [ __ds_jdbc_ra ], com.sun.appserv.connectors.internal.api.connectorruntimeexception: unable active ra module __ds_jdbc_ra severe: rar8060: unable lookup pool [ samplepool ], javax.naming.namingexception: lookup failed '__system/pools/samplepool' in serialcontext[myenv={java.naming.factory.initial=com.sun.enterprise.naming.impl.serialinitcontextfactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.jndistatefactoryimpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [root exception javax.naming.namenotfoundexception: pools] severe: rar6017 : failed connection pool...

haskell - Rebinding do notation for indexed monads -

i following conor mcbride's "kleisli arrows of outrageous fortune" paper , i've posted implementation of code here . briefly, defines following types , classes: type :-> b = forall . -> b class ifunctor f imap :: (a :-> b) -> (f :-> f b) class (ifunctor m) => imonad m skip :: :-> m bind :: (a :-> m b) -> (m :-> m b) data (a := i) j v :: -> (a := i) then defines 2 types of binds, latter of uses (:=) restrict initial index: -- conor mcbride's "demonic bind" (?>=) :: (imonad m) => m -> (a :-> m b) -> m b (?>=) = flip bind -- conor mcbride's "angelic bind" (>>=) :: (imonad m) => m (a := j) -> (a -> m b j) -> m b m >>= f = bind (\(v a) -> f a) m the latter bind works fine rebinding do notation use indexed monads rebindablesyntax extension, using following corresponding definitions return , fail : return :: (imonad m) => -> m ...

Handling Hardware interrupts in Linux -

i working on embedded linux platform running linux 2.6 . love know how following. 1) have hardware interrupt source irq7 shows in /proc/interrupts cat /proc/interrupts | grep irq7 m547x_8x 71: 1916076 pci irq7 2) pci irq7, each time press button, 3rd value value changes m547x_8x 71: 2177862 pci irq7 doesn't mean switch press recognized? now want trigger user program sleep when press button. how write user space program using interrupts or signal? should write driver program this? can suggest resources should into? you should take on gpio key on linux. after exporting interrupt /dev/input/eventxxx, can use evtest tool check user space.

groovy - How can I get IntelliJ IDEA to recognize the GPars DSL? -

according gpars user guide , intellij idea supposed able recognize gpars dsl right out of box gpars jar added project. since groovy 1.8, gpars included in groovy distribution, adding facet idea project doesn't seem help. does know how can activate dsl support? really nice have dsl keywords recognized instead of having little underlines everywhere. note: i'm using intellij idea ultimate v11.1 it seems gpars jar groovy distribution doesn't contain gdsl script teaches idea work gpars dsl. simplest thing add gdsl file in project http://git.codehaus.org/gitweb.cgi?p=gpars.git;a=blob;f=src/main/groovy/groovyx/gpars/definitions.gdsl;h=49f6993221645e3d887e6bf99c3c0fc46afef69e;hb=b0155a809a5c9adf9de816f18121d5a60d4b455d

database - How to update further tables on adding a relationship in propel -

i'm trying work out best place update other related tables when changing foreign-key dependency. to precise, have table called 'flat' , called 'room' contains flat_id: {type: integer, foreigntable:flat, foreignreference: id, required: true } as method room::setflatid(), propel (1.3) has therefore given me room::setflat() but when add room flat, want automatically make changes other related tables, keep consistency @ higher level database definition. thought override flat::addroom(room $room) call parent , make these further changes. but i've run problem because, since 'flat_id' column required, 1 of setflatid() , setflat() called before room object saved. but before room object saved, has no id, , therefore extended addroom cannot work because there no room_id identify related records in other tables. this seems suggest mustn't put code flat::addroom() depends on room having been saved. can put code? obviously, require called ...

api - OAuth 2.0 for distributable web applications -

i'm trying figure out, how use oauth 2.0 access google apis web app. problem is, protocol require developer register redirect_uri (url of page receiving access token). application can distributed many customers , can hosted on endless number of servers. there no way know redirect_uri beforehand. google offers option installed applications, cannot use variant neither. auth server returns access code in window title , information cannot accessed javascript of our page (js cannot access content of window opened using window.open(); if content comes different server). to conclude: cannot use method web applications, because don't know urls our app run in future. cannot use method installed applications, because window title not accessible our javascript code. is there recommendation, how use google's oauth 2.0 distributable web application running on lots of servers? thank you. are sure cannot access window title? if app opening window, should able ac...