Posts

Showing posts from July, 2010

c# - Envers NHibernate - Create alias in query -

c# - Envers NHibernate - Create alias in query - is there way create alias envers nhibernate similar ones can old school nhibernate expression? i able like: reader.add(auditentity.property("dog.name").eq("fido")); where classic nhibernate expressions like: session.createcriteria(typeof(dogowner)) .createalias("dog", "dog") .add(expression.eqproperty("dog.name", "fido") ) you can't today. from docs "the main limitation of current queries implementation cannot traverse relations. can specify constraints on ids of related entities, , on "owning" side of relation. changed in future releases." you need bring together "manually" using multipe queries. c# nhibernate alias criteria nhibernate-envers

Is functional programming affordable in scala? -

Is functional programming affordable in scala? - is functional programming affordable in scala? mean affordability copying immutable info construction list when passed value pure function without worrying memory. not inefficient without clojure persistent info construction implementation in place? if pure functional programming affordable in scala, there high performance open source projects used pure scala functional programming? scala provides persistent info structures create utilize of structural sharing, yes, "affordable". take @ akka , play. apart that, big parts of twitter based on scala, can read here. what mean affordability copying immutable info construction list when passed value pure function without worrying memory not sure if want passing objects functions not re-create reference object. still same object working on within of function. scala functional-programming

c++ - GCC and Include File Troubles -

c++ - GCC and Include File Troubles - i've been having difficulty compiling piece of c++ code physics engine bullet physics, , hoping advice. this first time using gcc compiler, , including directories compiling in general, i'm going give whole process of problem-solving because i'm not sure went wrong or pertinent info is. when first tried compile code got fatal error "no such error or directory", decided add together directory -i alternative (1). fixed first error, popped up. again, able create error go away -i alternative directory needed(2). then got whole long list of errors following: main.cpp:(.text+0x33): undefined reference 'ragdolldemo::initphysics()' main.cpp:(.text+0x84): undefined reference 'glutmain(int, char**, int, int, char const*, demoapplication*)' /tmp/cc4mqhhm.o: in function '__static_initialization_and_destruction_0(int, int)': main.cpp:(.text+0xe7): undefined reference `std::ios...

java - Getting a fatal exception: main error -

java - Getting a fatal exception: main error - i've been designing login , signup screen of app. , after changing actionbar settings in main activity can't seem login app. login , signup screens load perfectly. says "unfortunately, ____ has stopped" error get, i've included loginactivity.java says that's error is. don't know other file reference, if need file allow me know , i'll update it. thanks! 1493-1493/com.example.aalok.chirp e/androidruntime﹕ fatal exception: main process: com.example.aalok.chirp, pid: 1493 java.lang.nullpointerexception @ com.example.aalok.chirp.loginactivity$2.onclick(loginactivity.java:58) @ android.view.view.performclick(view.java:4438) @ android.view.view$performclick.run(view.java:18422) @ android.os.handler.handlecallback(handler.java:733) @ android.os.handler.dispatchmessage(handler.java:95) @ android.os.looper.loop(looper.java:136) @ android.app.activityt...

C# code to get list item to send to email? -

C# code to get list item to send to email? - i can send emails using this: mail.to.add("sample@test.com"); however, i'd send out emails getting sharepoint list, far have this. list<string> = new list<string> {"test@sample.com"}; foreach(string address in to) { mail.to.add("to"); } i'm getting error. the specified string not in form required e-mail address. try: list<string> = new list<string> {"test@sample.com"}; foreach(string address in to) { mail.to.add(address); } c# list email sharepoint

python - server side identification using facebook acces token -

python - server side identification using facebook acces token - i developing server-side in python mobile application integrated facebook. mobile application sends me user's facebook acces token. safe plenty check if token belongs facebook application (app id token matches app id) or should implement more advanced form of authorization/security? its first facebook integrated app sorry basic question. you can enable app secret proof in app settings , add together appsecret_proof parameter every phone call on server: https://developers.facebook.com/docs/graph-api/securing-requests after that, every phone call has add together parameter, , since generated app secret (which used on server), should pretty safe. python facebook facebook-graph-api authorization access-token

php - How to find and replace intervals in array? -

php - How to find and replace intervals in array? - i have function returns arrays of month intervals this: array("feb","mar","apr","oct","nov"); and needs changed this: array("feb-apr","oct-nov"); how accomplish this? below have illustration code i've tried, throws 'undefined offset: 13' notice. $months = array("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"); $feature_values = array("feb","mar","apr","oct","nov"); $result = $feature_values[0]; $start_index = array_search($result, $months); $value_count = count($feature_values); ($i = 0; $i < $value_count; $i++) { if ($months[$start_index + $i] !== $feature_values[$i]) { $result .= ' - ' . $featu...

javascript - jqGrid Does Not Show The Returned JSON Data -

javascript - jqGrid Does Not Show The Returned JSON Data - i utilize jqgrid in asp.net page. in .aspx page, have - <div id="divmy" style="width: 100%; overflow: auto;"> <div id="divmytable" style="width: 97%; display: none;"> <table id="mytable"> <tr> <td></td> </tr> </table> <div id="divmytablepager"></div> </div> </div> in .js file, have - var casortinfo = { sortname: $('#mytable').jqgrid('getgridparam', 'sortname'), sortorder: $('#mytable').jqgrid('getgridparam', 'sortorder'), page: $('#mytable').jqgrid('getgridparam', 'page'), rows: $('#mytable').jqgrid('getgridparam', 'rows') }; $("#mytable").jqgrid({ url: "../services/my.asmx...

program php and alert javascript on form html -

program php and alert javascript on form html - i have problem simple programme in php include alert javascript. code: <?php function iva(){ $country='it'; $vatnum=$_post['n']; $a="work"; $b="notwork"; $url='http://isvat.appspot.com/'.$country.'/'.$vatnum.'/'; $response = file_get_contents($url); //global $a, $b; if( $response == 'true' ){ echo $a; } if ($response != 'true'){ echo $b; } } ?> <script> function ivaz(){ alert("<?php iva() ?>"); } </script> <form method="post"> <input name="n" type="textarea" > <input onclick="ivaz();" value="validate" type="submit"> </input> </form> my programme take value input text box , pass value php script homecoming true or false in javascript alert. programme work, homecoming previous value passed in input box. can help me sol...

php - Amazon ElasticBeanstalk configuration not working -

php - Amazon ElasticBeanstalk configuration not working - i have able deploy php application using git in elastic beanstalk, configuration files doesnot work. created .ebextensions folder on root application folder , created config file next command: container_commands: 00_make_assets: command: "sudo mkdir /var/app/current/assets" i next error message on dashboard command failed on instance. homecoming code: 1 output: [cmd-appdeploy/appdeploystage0/ebextensionpostbuild] command failed error code 1: error occurred during build: command 00_make_assets failed. all want create folder , give 777 permission it. the output in log file (/var/log/eb-commandprocessor.log) shows: [2014-10-17t11:01:43.487z] error [2341] : command cmd-appdeploy failed! [2014-10-17t11:01:43.488z] info [2341] : command processor returning results: {"status":"failure","api_version":"1.0","truncated":"false",...

javascript - Phantomjs using a local file with page.includeJs? -

javascript - Phantomjs using a local file with page.includeJs? - i using phantomjs screenshot webpage. library calls hosted jquery file inject jquery functionality in page dom allow manipulations. seen here: http://phantomjs.org/api/webpage/method/include-js.html the code looks this: if ( loaded ) { page.includejs("http://code.jquery.com/jquery-1.8.3.min.js", function() { . . . i don't want create external phone call js because (a) it's slower , (b) not reliable. utilize local re-create , set path such not loading in. page.includejs("assets/javascript/jquery.min.js", function() { . . . what problem here? why path not working expect to? function page.includejs not allow relative paths? according documentation function includes script given url needs accessible hosted page. local path not accessible on remote host (relative nor absolute) need inject script injectjs instead. edit: here code used testing: var page = req...

python - AttributeError: 'int' object has no attribute 'rindex' -

python - AttributeError: 'int' object has no attribute 'rindex' - setup i'm using scrapy 0.24.4 , scrapy-elasticsearch 0.5 scrape website , store results in elasticsearch instance have running. i've used this blog post set up, minor modification documented here. settings.py bot_name = 'blah' spider_modules = ['blah.spiders'] newspider_module = 'blah.spiders' item_pipelines = [ 'scrapyelasticsearch.scrapyelasticsearch.elasticsearchpipeline', 100 ] elasticsearch_server = 'localhost' elasticsearch_port = 9200 elasticsearch_index = 'scrapy' elasticsearch_type = 'items' problem if run next command scrape website: scrapy crawl wiki -o wiki.json with item_pipelines commented out - works correctly , exports results wiki.json file. with item_pipelines uncommented (e.g. set enable piping results elasticsearch) - next error: file "/usr/local/lib/python2.7/dist-packages/scrap...

android - How to get a value in a string list? -

android - How to get a value in a string list? - i have list containing following: string list[]={"team 1,apple,mango,kiwi","team 2,mango,kiwi,pineapple","team 3,kiwi,pineapple,apple"}; my question is, how know each team has? how team name? i have output: team 1,team 3(apple,kiwi) team 1,team 2(mango,kiwi) team 2,team 3(pineapple,kiwi) can tell me can done or do? in order values of first string in list of strings can split string "," , set in list following: string s1 [] = list[0].split(","); , s1[0] team1 s1[1] apple etc.. android

html select not show selected even after set selected -

html select not show selected even after set selected - i have country dropdown , set selected attribute us. can see select="selected" select alternative having value in firebug. neither firefox or chrome shown selected. have code populate & selected country follows. var countrydata = getcountrydata(); var html = '<option value="">select country</option>'; $.each(countrydata, function(key,value) { if(defaultvalue == value.id) { html = html + '<option value="'+value.id+'" selected="selected">'+value.name+'</option>'; } else { html = html + '<option value="'+value.id+'">'+value.name+'</option>'; } }); countryfield.html(html); if possible reason browser not shown selected set attribute selected. update : ok guys, expecting must conflicted other code. , case . using bootstrapvalidator , spec...

html5 - Blur overlay over video -

html5 - Blur overlay over video - i'm trying set blurred overlay layer on video. i recreated effect in jsfiddle: http://jsfiddle.net/zswcctc7/1/ this situation more or less. <div class="overlay-wrapper"> <div class="video"> <iframe width="560" height="315" src="//www.youtube.com/embed/vdcgnuccrv0?rel=0" frameborder="0" allowfullscreen></iframe> </div> <div class="overlay"></div> </div> so instead of white layer have blurred layer, ios style-ish. tried lot of things blurjs, nil find seems work video's. html5 css3

python - Django template hyperlink don't showing up -

python - Django template hyperlink don't showing up - i trying create hyperlink in template. here how: <a {% url 'favourited' tweet.id%}>{{tweet.favourite.count }}</a> howerver, renders {{tweet.favourite.count }} part. intrestingly, without hyperlink {% url 'favourited' tweet.id%} returns right link: favourited/1 so problem? are meaning do: <a href="{% url 'favourited' tweet.id%}">{{tweet.favourite.count}} </a> python django

php - login form using session and pdo -

php - login form using session and pdo - i have started convert old sql code pdo having difficulties in doing so, have tried convert login script pdo form, here conversion <?php session_start(); // starting session if (isset($_post['submit'])) { seek { // define $email , $password $email = $_post['email']; $password = $_post['password']; //etablishing connection server $dbhost = "qwe.com"; $dbname = "qwe"; $dbuser = "qwe"; $dbpass = "qwe"; $conn = new pdo("mysql:host=$dbhost;dbname=$dbname", $dbuser, $dbpass); $stmt = $conn->prepare("select * register where `email` = :email , `password` = :password "); $stmt->execute(array(':email' => $_post['ema...

javascript - html table sort function is not working properly -

javascript - html table sort function is not working properly - html table sorting not working properly, have demo on below link. please focus columns names - row count , sl.no. jsfiddle demo html: <table> <thead> <tr height=50> <th>sl.no</th> <th>database name</th> <th>table name</th> <th>table size in mb</th> <th>table size in gb</th> <th>unused space in mb</th> <th>engine type</th> <th>row count</th> <th>time</th> </tr></thead> <tbody> <tr height=30><td align='center' valign='middle'>1</td><td align='center' valign='middle'>holidayindia</td><td align='center' valign='middle'>attractions</td><td align='center' valign='middle'>0.42</td><td align='center' valign='middle'>0.00041015625</td>...

SQL server Pivot Table issue -

SQL server Pivot Table issue - i have table columns , values like: records status custname amount 71 blocked customer_1 132171 11 booked customer_1 19974 3 cancelled customer_1 3900 i want write query info : custname blocked_recs blocked_amount booked_recs booked_amount cancelled_recs cancelled_amount customer_1 71 132171 11 19974 3 3900 the problem pertains sql server 2008 r2 what should query exactly? here how this: select r1.c, r1.[blocked], r2.[blocked], r1.[booked], r2.[booked], r1.[cancelled], r2.[cancelled] from(select * (select r, c, s t) t pivot(max(r) s in([blocked],[booked],[cancelled]))p) r1 bring together (select * (select a, c, s t) t pivot(max(a) s in([blocked],[booked],[cancelled]))p) r2 on r1.c = r2.c here fiddle http://sqlfiddle.com/#!6/acf78 sql-server pivo...

php - Dyanamic URLS Caching in Wordpress -

php - Dyanamic URLS Caching in Wordpress - i trying implement form on standard wordpress page , create dynamic pages based on form inputs. urls generated example.com/form/value. not sure how in wordpress. problem caching of generated page. using wp super cache, there way cache these dyanmic pages , set custom expiry dates? php wordpress caching

c++ - Intel Compiler Warning with MIC - missing Libraries -

c++ - Intel Compiler Warning with MIC - missing Libraries - while compiling+linking mic (intel xeon phi coprocessor) code, got warnings. x86_64-k1om-linux-ld: warning: libimf.so, needed /usr/local/intel/parallel_studio_xe_2013_sp1/composer_xe_2015.0.090/compiler/lib/mic/liboffload.so.5, not found (try using -rpath or -rpath-link) x86_64-k1om-linux-ld: warning: libsvml.so, needed /usr/local/intel/parallel_studio_xe_2013_sp1/composer_xe_2015.0.090/compiler/lib/mic/liboffload.so.5, not found (try using -rpath or -rpath-link) x86_64-k1om-linux-ld: warning: libirng.so, needed /usr/local/intel/parallel_studio_xe_2013_sp1/composer_xe_2015.0.090/compiler/lib/mic/liboffload.so.5, not found (try using -rpath or -rpath-link) x86_64-k1om-linux-ld: warning: libintlc.so.5, needed /usr/local/intel/parallel_studio_xe_2013_sp1/composer_xe_2015.0.090/compiler/lib/mic/liboffload.so.5, not found (try using -rpath or -rpath-link) but these libraries existing , code compiling+linking , executable...

c# - Reading settings from app.config in .net 4.5 -

c# - Reading settings from app.config in .net 4.5 - i've added reference system.configuration. i've created app1.config in project , populated next code: class="lang-xml prettyprint-override"> <?xml version="1.0" encoding="utf-8" ?> <configuration> <appsettings> <add key="resistancea" value="0.04"/> <add key="resistanceb" value="0.04"/> <add key="resistancec" value="0.01"/> <add key="tempbattlow" value="40"/> <add key="tempbatthigh" value="45"/> <add key="tempload" value="40"/> </appsettings> </configuration> then seek read values using next code, using system.configuration; string str = configurationmanager.appsettings.get("resistancea"); however not data. thought doing wrong? thanks. make sure (app name ...

Make PHP includes print their file location while in `dev` mode -

Make PHP includes print their file location while in `dev` mode - we've seen websites code this: <!-- begin /a4/includes/nav_include.php --> <div ... > <!-- end /a4/includes/nav_include.php --> this sloppy , annoying, understand need able figure out file responsible source code you're seeing. i'd prefer way create include d , require d files automatically spit info out, when in toggleable dev mode. obviously, this: <?php if($devmode){ echo "<!-- begin /a4/include/snav_include.php -->"; } include("/a4/includesnav_include.php"); if($devmode){ echo "<!-- end /a4/includes/nav_include.php -->"; } ?> but becomes annoying , sloppy on whole other level. i'd prefer best of both worlds, have functionality of above can still write includes this: <?php include("/a4/includes/nav_include.php"); ?> is there way this? php include require require-once php-include...

Facebook share not using updated OG meta -

Facebook share not using updated OG meta - i'm sharing posts on facebook , it's not using updated og , meta tags. how long take changes create affect. you can refresh og tags in facebook debugger: https://developers.facebook.com/tools/debug/ you can take @ thread same question: share cache timeout answer like button docs: why , when facebook scrape page? facebook needs scrape page know how display around site. happens every 24 hours ensure properties date. page scraped when url entered debugger tool. btw, there nice way update many pages @ 1 time in thread: facebook open graph not clearing cache facebook facebook-graph-api meta facebook-sharer facebook-share

android - R.java is not generating due to appcompat v7? -

android - R.java is not generating due to appcompat v7? - i using eclipse, added appcompat lib project ands r.java file not generating. in console showing whenever clean project. [2014-11-02 18:50:16 - client] g:\programz\workspace\android-support-v7-appcompat\res\values-v21\styles_base.xml:79: error: error retrieving parent item: no resource found matches given name 'android:widget.material.actionbutton.closemode'. [2014-11-02 18:50:16 - client] [2014-11-02 18:50:16 - client] g:\programz\workspace\android-support-v7-appcompat\res\values-v21\styles_base.xml:83: error: error retrieving parent item: no resource found matches given name 'android:widget.material.actionbutton.overflow'. [2014-11-02 18:50:16 - client] [2014-11-02 18:50:16 - client] g:\programz\workspace\android-support-v7-appcompat\res\values-v21\styles_base.xml:25: error: error retrieving parent item: no resource found matches given name 'android:widget.material.actionbar.tabview'. [2014-11...

ios - NSMutableArray to NSString to UIImageView CODE CRASHES -

ios - NSMutableArray to NSString to UIImageView CODE CRASHES - any thought why code crash? taking nsmutablearray converting nsstring , using string url uiimageview . crashes @ nsurl line. nsstring *imgstring = [imageone componentsjoinedbystring:@""]; nsurl *imageurl = [nsurl urlwithstring:imgstring]; dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_background, 0), ^{ nsdata *imagedata = [nsdata datawithcontentsofurl:imageurl]; dispatch_async(dispatch_get_main_queue(), ^{ // update ui self.imageview.image = [uiimage imagewithdata:imagedata]; }); }); from apple documentation, urlstring: url string initialize nsurl object. must url conforms rfc 2396. method parses urlstring according rfcs 1738 , 1808. in os x v10.7 , later or ios 5 , later, method returns nil if url string nil. in before versions, method throws exception if url string nil. ios objective-c iphone nsstring nsmutablearray

MATLAB error: input argument "x" undefined -

MATLAB error: input argument "x" undefined - i've got little matlab function i'm attempting run calling command line, follows: ??? input argument "x" undefined. for reference, "main" function: function f = dsr(x) x(1); x(2); x(3); rho=1.2041; mu=1.81625e-5; re=30; pref=[10,10,10]; leakagearea=[x(1) x(2) x(3)]; i=1:3; turb(i)=2^0.5*0.6*leakagearea(1,i)*pref(1,i)^((1-2*0.65)/2); ftrans=mu*re*leakagearea(1,i)^0.5; ptrans=(ftrans/(turb(i)*rho^0.5))^(1/0.65); lam(i)=mu*ftrans/(rho*ptrans); end; input1=[lam(1,1) turb(1,1) 0.65 0.611 10 x(1) 0 0 2 2 2 0]; input2=[lam(1,2) turb(1,2) 0.65 0.611 10 x(2) 0 0 2 2 2 0]; input3=[lam(1,3) turb(1,3) 0.65 0.611 10 x(3) 0 0 2 2 2 0]; airflow=fopen('130109ex1.prj','rt+'); if(airflow==-1); errordlg('airflow open error','error'); end; i=1:11614; fid=fgetl(airflow); if(strcmp(upper(fid),upper('1 23 plr_leak1 double_door'))==1); ...

syntax - How to find VARIABLES with nothing but missing value? -

syntax - How to find VARIABLES with nothing but missing value? - i know possible find cases nil missing values help of "select if nmss(v)=x" but should if want find varibales missing values? say have dataset else on hundert variables, variables finish missing values (in case, questions/varibales not asked durning interview), how can find thoses varibales in efficient way? if have info preparation option, can utilize info > validation > validate info screen variables. if not, there function in spssaux2.py module (available spss community website - www.ibm.com/developerworks/spssdevcentral) called findemptyvariables this. requires python essentials. here how utilize it. begin program. import spssaux2 print spssaux2.findemptyvars() end program. syntax spss

android - NPE when blurring layout Bitmap -

android - NPE when blurring layout Bitmap - i have managed turn layout bitmap. want blurr bitmap renderscript blur method have set up, maintain getting nullpointerexception when trying blur bitmap. when pass renderscripy blurr method other bitmaps, works, it's not working when pass created bitmap layout. would know doing wrong here? driving me crazy. relativelayout blurlayout; blurlayout = (relativelayout) view.findviewbyid(r.id.blurcontainer); blurlayout.setdrawingcacheenabled(true); blurlayout.builddrawingcache(); bitmap bluredlayout = blurlayout.getdrawingcache(); //this returns null bitmap finalblur = bitmap.createbitmap(fastblur16(bluredlayout, 25, getactivity())); drawable d = new bitmapdrawable(getresources(), finalblur); private static bitmap fastblur16(bitmap source, int radius, context ctx) { bitmap bitmap = source.copy(source.getconfig(), true); renderscript rs = renderscript.create(ctx); allocation input = allocation.createfrombitmap(rs, s...

datastax - Cassandra production Monitoring -

datastax - Cassandra production Monitoring - i new cassandra , trying setup monitoring cassandra production cluster. apart monitoring using nodetool commands in crontab else recommended? general practice utilize ganglia monitoring? can direct me resource on setting monitoring in production. using apache cassandra opscenter not useful. the free version of opscenter works oss cassandra , monitoring capabilities available. miss amount of cluster management capabilities if don't have dse: http://www.datastax.com/what-we-offer/products-services/datastax-opscenter/compare cassandra datastax ganglia

Generate FxCop Results xml in teamcity -

Generate FxCop Results xml in teamcity - i need set build step in teamcity fxcop. need generate fxcop results in xml file. please help me. new teamcity. appreciate if post screenshots also. did google, not able understand properly. to fxcop running in teamcity, need follow these steps: install fxcop on agent (or of agents if have more). download here: https://fxcopinstaller.codeplex.com/ edit file buildagent.properties , add together info fxcop instalation folder. add line: system.fxcoproot=c:\program files (x86)\microsoft fxcop 10.0 create build step. easy now. interesting settings are: runnert type: fxcop fxcop version: 10.0 assembiles: illustration bin*.dll report xslt file: %system.fxcoproot%/xml/fxcopreport.xsl additional fxcopcmd options: illustration /ruleset:"=%teamcity.build.workingdir%\core\projectrules.ruleset" . utilize specify custom rules settings the xml generated path can found in build log. alter path can utilize mor...

Run parameters in a Powershell script from a batch file -

Run parameters in a Powershell script from a batch file - i'm trying specify parameters in powershell script, batch file. the script looks likes this: param( [parameter(mandatory=$true,helpmessage="application switch")] [string[]]$apps, [validaterange(3,9999)] [int]$switchdelay = 30 $apppids = @() $windows = get-process | ? { $_.mainwindowtitle -ne "" } $wsh = new-object -com wscript.shell foreach ($app in $apps) { foreach ($window in $windows) { if ($window.mainwindowtitle -like $app) { write-verbose "vindusfilter ""$app"" found nail on ""$($window.mainwindowtitle)"" med pid ""$($window.id)""" $apppids += $window.id } } } { foreach ($id in $apppids) { # hides text... $wsh.appactivate($id) | out-null start-sleep -seconds $switchdelay write-verbose "changed window pid ...