Posts

Showing posts from April, 2011

Ruby - Merge an Array into a Hash -

i have array looks this: array = [[:foo, :bar], [:foo, :baz], [:baz, {a: 1, b: 2}], [:baz, {c: 1, d:2}]] and need turn hash looks this: {:foo =>[:bar, :baz], :baz => {a: 1, b: 2, c: 1, d: 2}} this code have far: def flatten(array) h = {} array.each_with_object({}) |(k, v), memo| if v.is_a?(hash) memo[k] = h.merge!(v) else # goes here? end end end when used so: flatten(array) outputs: {baz => {:a => 1, :b => 2, :c => 1, :d => 2}} may please point me in right direction? appreciated. def convert(arr) arr.each_with_object({}) |a,h| h[a.first] = case a.last when hash (h[a.first] || {}).update(a.last) else (h[a.first] || []) << a.last end end end convert array #=> {:foo=>[:bar, :baz], :baz=>{:a=>1, :b=>2, :c=>1, :d=>2}}

javascript - Jquery Autocomplete Suggestion after first character -

i'm trying jquery autocomplete populate , display menu after first character, current code doesn't this. works after second character entered , works when delete entered characters. thoughts? $("#resource").keyup(function(){ var s = $("#resource").val(); $( "#resource" ).autocomplete({ minlength: 0 }); $.post("url_to_php_script_json_data_returned", {search:s}, function(data,status){ if (status == 'success') { var obj = json.parse(data); var availabletags = []; if (obj.length > 0) { var tags = []; (var = 0; < obj.length; i++) { var name = obj[i]['last_name']+', '+obj[i]['first_name']; var u_id = obj[i]['user_id']; availabletags.push( {value:name,label:name,rid:u_id} ); }...

What is a good duration between two garbage collections on production JVMs? -

Image
i trying figure out duration between 2 garbage collections on jvm 8 in production. i can tune memory available on jvm , side effect increase duration between 2 garbage collections how distinguish between normal situation or 1 not have enough memory allocated machine. this problem applies systems jira , confluence, can have @ screenshot. garbage collection take places every 3 hours. /usr/lib/jvm/java-8-oracle/bin/java -djava.util.logging.manager=org.apache.juli. classloaderlogmanager -xms15000m -xmx15000m -xx:+printgcdatestamps -xx:-omitstacktraceinfastthrow ... org.apache.catalina.startup.bootstrap start gcs running in not indicator of anything. minor gcs can run several times per second on workloads without signifying bad. , concurrent (cms)/mixed (g1) gc phases running once minute or can normal on workloads. two better measures following: how heap freed old gen gc. if utilization barely goes down @ either extremely tuned application or you're appr...

bash - sftp avoid exit when file is not found -

i have script: filepattern='sor.log*' filepattern2='sor.sor.log*' mylocation=/opt/tradertools/omer clientlocation=/opt/tradertools/omer/sor/from clientname=vmonitorlmpa clientuser=root clientpass=triltest export sshpass=$clientpass sshpass -e sftp -ostricthostkeychecking=no -obatchmode=no -b - $clientuser@$clientname << ! $clientlocation/$filepattern2 $mylocation $clientlocation/$filepattern $mylocation bye ! but if filepattern2 isn't found, exit. how avoid using 2 sftp connections? quoting sftp man page : sftp abort if of following commands fail: get , put , reget , reput , rename , ln , rm , mkdir , chdir , ls , lchdir , chmod , chown , chgrp , lpwd , df , symlink , , lmkdir . termination on error can suppressed on command command basis by prefixing command - character (for example, -rm /tmp/blah* ). so use: -get $clientlocation/$filepattern2 $mylocation

maven - how can set both classpathPrefix and mainClass in pom? -

i have pom.xml this: <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <version>2.6</version> <configuration> <archive> <manifest> <addclasspath>true</addclasspath> <mainclass>package.mainclass</mainclass> <classpathprefix>lib/</classpathprefix> </manifest> </archive> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.2</version> <configuration...

Why in “:normal”command ^[ seems doesn't work with A? (vim) -

today, learnt bit of vim normal command, , below experiment: :normal insert ^[ yyp :normal append ^[ yyp # result of execute first command several times insert insert insert insert insert insert insert insert insert insert insert insert insert insert insert insert insert insert insert # result of execute second command several times append append append append append append why second command ignored yyp part? how fix it? just remove space between ^[ , yyp

ios - How to track down which operation is low down the launching process? -

Image
it takes long duration of time app launched. how can track down operation causes trouble? your best option use time profiler part of instruments. you can press cmd + i start profiling application. select time profiler. this tool records how long each call takes , can use narrow down parts of code causing biggest problems. double clicking entry show calls within method , how long each take i find useful select these options in "call tree"

c# - how to dynamically generate HTML code using .NET's WebBrowser or mshtml.HTMLDocument? -

most of answers have read concerning subject point either system.windows.forms.webbrowser class or com interface mshtml.htmldocument microsoft html object library assembly. the webbrowser class did not lead me anywhere. following code fails retrieve html code rendered web browser: [stathread] public static void main() { webbrowser wb = new webbrowser(); wb.navigate("https://www.google.com/#q=where+am+i"); wb.documentcompleted += delegate(object sender, webbrowserdocumentcompletedeventargs e) { mshtml.ihtmldocument2 doc = (mshtml.ihtmldocument2)wb.document.domdocument; foreach (ihtmlelement element in doc.all) { system.diagnostics.debug.writeline(element.outerhtml); } }; form f = new form(); f.controls.add(wb); application.run(f); } the above example. i'm not interested in finding workaround figuring out name of town located. need understand how retrieve kind of dynamically...

internationalization - How to internationalize a PHP Web Application? -

we have php application designed work particular country, normal characters. application has normal modules found in of applications, such register/login module, text editor, post texts, read/write database, search module... i did in past, can't remember steps transform application international one, supporting kind of characters (chinese, japanese, russian, etc). i have developed scripts in order to: change codification of files utf-8 change codification of database (database itself, tables , text/varchar fields) set database utf-8 everytime make instance of ( set names utf8 ) change string functions multibyte (e.g.: substr() mb_substr() ) get templates , setting encoding utf-8 ( <meta http-equiv="content-type" content="text/html; charset=utf-8" /> ) edit unit testing (thanks marcel djaman) add accept-charset="utf-8" forms (thanks jason spicer) use iconv (thanks robert pounder) is there other step should take? how...

javascript - Backbone : Detect the moment after a view is removed -

what best way detect moment after backbone view, extended other object or not, has been removed? jsfiddle added : http://jsfiddle.net/simmoniz/m5j8q/1917/ how make line #32 working without altering views... <h2>the container</h2> <div id="container"></div> <script> var someextendedview = marionette.itemview.extend({ events: { 'click button.remove':'remove', }, }); var johnview = someextendedview.extend({ template: _.template('<div><p>i\'m <em>john view</em> <button class="remove">remove me</button></p></div>'), }); var doeview = someextendedview.extend({ template: _.template('<div><p>i\'m <strong>doe view</strong> <button class="remove">remove me</button>'), }); var simpleview = backbone.view.extend({ initialize: function(){ backbone.view.prototype.initializ...

django - Why this object is not showing in my template? -

i'm creating gantt chart , can see tasks in table - if task.end_date lower or equal last element of list of dates . if higher django doesn't display specific task on table. """ dates = [ datetime.date(2015, 8, 5), datetime.date(2015, 8, 6), datetime.date(2015, 8, 7), datetime.date(2015, 8, 8), datetime.date(2015, 8, 9), datetime.date(2015, 8, 10), datetime.date(2015, 8, 11), datetime.date(2015, 8, 12), datetime.date(2015, 8, 13), datetime.date(2015, 8, 14) ] """ {% date in dates %} <td> {% task in person.tasks %} {% if task.start_date <= date , date <= task.end_date %} #if task.end_date higher datetime.date(2015, 8, 14) task won't show in table {{ task.task.name }} {% endif %} {% endfor %} </td> {% endfor %}

ios - Cannot create ad hoc app in xcode -

i'm trying create ipa in xcode 6 publish app on app store giving certificate validation error , not allowing me proceed. please guide me this. for publishing app store make sure the certificate using ios distribution certificate. the provisioning profile assosiated certificate app store provisioning profile. the bundle id of app must match 1 define in provisioning profile. the status of app in itunes connect should ""waiting upload". the version number of app defined in itunes connect must same defined in xcode.

Nested it in Protractor/Jasmine -

can create nested in protractor/jasmine. it("outer it", function () { it("inner it", function () { expect(1).tobe(1); }); }); i trying execute test cases inside loop, , in every iteration want run test, example: it("outer it", function () { for(var i=0;i<10;i++){ it("inner it", function () { expect(1).tobe(1); }); } }); the reason want want initialize array , in dynamically way loop trough element , run number of "it", example: describe ("[components]", function() { var grid = new grid(); it("initialize grid history window", function () { grid.init(); }); for(var i=0;i<grid.length;i++){ it("test 1", function () { expect(1).tobe(1); }); } }); the grid.length equal 0 when loop execute, want loop execute after initialize "it". answering question, no cannot nest it ...

angularjs - is it possible to connect mysql db using angular js without php code -

is possible connect mysql db using angularjs without php code? based on client side scripting can't connect mysql db. other way connection? if wish use angular accessing database, discard php together, , switch firebase . allow angular application (not saying should way, could). angularjs front-end framework, , should used in combination server side language: java/c#/nodejs/php... but answer question directly: no, can't access mysql angular.

java - My Eclipse Mars won't refresh -

i updated eclipse mars few weeks ago , went well. have single non-eclipse plug-in subclipse. today added few (java) files, , removed few others, directories of eclipse project (note: didn't use eclipse this). when done refreshed project , gets stuck @ 98% solid few minutes. i able cancel refresh tried clean build , sure enough reported errors of missing files won't recognize added files. tried fresh again , still hangs @ 98%. i've retried 5 times now, , restarted eclipse several times, , every time hangs @ 98%. is there kind of cache can clear or can clean? maybe else can try? edit/update: opened project in old luna eclipse , refreshed fine. note uses entirely different workspace if matters. i had problems using subclipse too. changed subversive , worked fine.

javascript - Multiple HTML pages with different display time in same iFrame -

i have 5 html pages , iframe. i need display html pages in iframe specific display time each page. delay should include time loading iframe container. first page has display time of 10 seconds, second page display time of 20 seconds, third page display time of 30 seconds , on. how display these pages bound display time? i have tried many ways add load time including iframe.load in code causes weird recursions alters display time. i suggest loading first source after iframe.load page initialization finished. code uses jquery. the logs of course making sure timing want be, minimal offsets (one-digit milliseconds when tested it.) <iframe id="myiframe"></iframe> <script> var currentframeid = 0; var framelengths = [0,10000,20000,30000,40000];//the first page should displayed ready var frameurls = ["http://example.com/page1", "http://example.com/page2", "http://example.com/page3", "http://example...

php - Only The First Cookie Is Set While Setting Multiple Cookies -

i experiencing frustrating cookies. cookies set in php works in browsers. tried signing hosted site using google chrome android , firefox android , discovered these 2 browsers not receive cookies set in php. set 2 cookies using php chrome , firefox receives first cookie , not both. here format how set cookies: setcookie('gfhfk', 'content1', time()+6000, '/'); setcookie('hfgfh', 'content2', time()+6000, '/'); but 2 browser mentioned above first cookie , ignore second one. if swap positions of set cookies in php script browsers mentioned first 1 @ top. other browsers cookies. please problem chrome , firefox android receiving first cookie , not both? i experienced same problem in js. 1 cookie worked. see 1 solution - packing data 1 cookie or using of localstorage/sessionstorage.

android - Implementing swipe tabs with action bar giving me an exception -

i trying implement tabs action bar in activity. getting exception. reason? code: mainactivity.java public class mainactivity extends fragmentactivity implements actionbar.tablistener { sectionspageradapter msectionspageradapter; viewpager mviewpager; string arr[]=new string[]{"vegetables","drinks","fruits","chai","eatables"}; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); final actionbar actionbar = getactionbar(); actionbar.setnavigationmode(actionbar.navigation_mode_tabs); msectionspageradapter = new sectionspageradapter( getsupportfragmentmanager()); // set viewpager sections adapter. mviewpager = (viewpager) findviewbyid(r.id.pager); mviewpager.setadapter(msectionspageradapter); mviewpager .setonpagechangeli...

android - Get an arraylist from Parse.com in a new Activity -

i wish array parse cloud. after tapping on item in list (which contains parseobject reference), item open new activity , want array list stored in latlngpoints key in parse. have googled , found following solution not work: arraylist<parsegeopoint> parselist = (arraylist<parsegeopoint>) getintent().getextras().getparcelablearraylist("latlngpoints"); is possible way, or have create parse object , create request information need? parseobjects not parcelable. can pass array list of longs represent lat , long

c# - Text Object is repeated along with every value of database field in details section -

Image
am new crystal reports. may seem simple question of you. i have added crystal report file asp project in vs 2012 , in details section added 1 text object , database field. this database field belongs stored procedure. in report viewer text inside textobject repeated along every value of database field. how can solve this. appreciated when place field in details (either database or text field) repeats records retrived database.. functionality of crystal reports. if don't need can place in page header or report header prints once page , once report respectively.

rdf - Retrieving object and predicate for a subject without sparql -

i retrieved subject through model using getsubject() , subject want create relation respective object , predicate. how retrieve object , predicate particular subject through jena , without sparql? to predicates , objects of particular subject given model m: // resource had: resource subject; // = m.getresource(namespace + "subject"); // creates 'list' (iterator) on satements containing subject stmtiterator stmtiterator = m.liststatements(subject, null, (rdfnode) null); // while have not processed these statements: while (stmtiterator.hasnext()){ // grab next statement statement s = stmtiterator.next(); // retrieve predicate(property) , object statement property predicate = s.getpredicate(); resource object = s.getobject(); // predicate // object } however if mean want grab predicate , subject model add subject retrieved: property property = m.getproperty(namespace + "propertyname"); resource object ...

concurrency - Scala ProcessLogger & Future: How can I make sure all line callbacks are called BEFORE the onComplete block? -

import scala.sys.process._ import scala.concurrent._ // (future) import executioncontext.implicits.global // (future) /* run "ls /opt" * outputs 2 lines: * - "x11" * - "local" */ val command = process(seq("ls", "/opt"), none, "lang" -> "") val process = command.run(processlogger(line => { thread.sleep(1000) // slow execution down println(thread.currentthread) println(line) println("") })) future { process.exitvalue // blocks until process exits }.oncomplete { results => println(thread.currentthread) println("process exited: after last line callback finished?") println("done") } output (order as expected , case?): thread[thread-47,5,run-main-group-0] line x11 thread[thread-47,5,run-main-group-0] line local thread[forkjoinpool-1-worker-3,5,run-main-group-0] process exited: after last line callback finished? done it seems o.k. because oncomplete...

Logstash Configuration for CloudFoundry Loggregator -

i facing issues in setting logstash cloud foundry ever sources have seen have directed me following configuration input { tcp { port => 5000 type => syslog } udp { port => 5000 type => syslog } } filter { if [@type] in ["syslog", "relp"] { # parse cloud foundry logs loggregator (syslog) # see https://github.com/cloudfoundry/loggregator/blob/master/src/loggregator/sinks/syslogwriter/syslog_writer.go#l156 grok { match => { "syslog_procid" => "\[(?<log_source>[^/\]]+)(?:/(?<log_source_id>[^\]]+))?\]" } tag_on_failure => [ "fail/logsearch-for-cloudfoundry/loggregator/_grokparsefailure" ] } if !("fail/logsearch-for-cloudfoundry/loggregator/_grokparsefailure" in [tags]) { #if looks json, must json... if [syslog_message] =~ /^\s*{".*}\s*$/ { json { source => "syslog_message" ...

maven - Drools-spring xsd Failed to read schema document -

we trying deploy web application doesn't have access internet. there issue accessing spring-drools.xsd. context xml: <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:drools="http://drools.org/schema/drools-spring" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd http://drools.org/schema/drools-spring org/drools/container/spring/drools-spring-...

javascript - Truncate text preserving keywords -

Image
i have text retrieved search result contains words match string that's been searched. i need truncate text in similar way google does: the keywords highlighted, of text not containing keywords truncated , ellipsis added, if keywords appear more once in whole text part still included. how structure regex in javascript this? thanks jsbin demo , quick on basic code: var string = "lorem ipsum dummy book text of printing , text book long..."; var querystring = "book"; // want highlighted var rgxp = new regexp("(\\s*.{0,10})?("+ querystring +")(.{0,10}\\s*)?", "ig"); // if want account newlines, replace dots `.` `[\\s\\s]` var results = []; string.replace(rgxp, function(match, $1, $2, $3){ results.push( ($1?"…"+$1:"") +"<b>"+ $2 +"</b>"+ ($3?$3+"…":"") ); }); // ways use/test above: // // console.log( results.join("\n") ); // som...

c# - Why is my List.GetUserEffectivePermissions() method not working? -

i'm developing process in c# sharepoint 2013 client side object model. need retrieve sharepoint list permissions of given user, different user executing code. using sp = microsoft.sharepoint.client; sp.clientcontext spcontext = new sp.clientcontext("siteurl"); sp.web siteweb = spcontext.web; sp.list lst = spcontext.web.lists.getbytitle("list"); var clientusereffperms = lst.getusereffectivepermissions(@"<domain>\<username>"); spcontext.load(siteweb, s => s.effectivebasepermissions); spcontext.load(lst, l => l.effectivebasepermissions); spcontext.executequery(); after code executes, clientusereffperms.value (basepermissions) object not represent permissions of given user correctly. object isn't null, represents user having no permissions. user has @ minimum view , edit permissions , can confirm viewing/editing list items using web browser user. the code executing user has permission enumerate permissions @ both web , l...

java - How to set the Play framework local dependencies of a WSDL generated JAR? -

i have created jar file using saleforce's wsc . want use jar file in play framework app (v.1.2.*). local file, put jar file in special jar folder, , set in dependencies.yml following lines: - provided: type: local artifact: ${application.path}/jar/sfpartner.jar contains: - provided -> * unfortunately doesn't seem work. suspect it's because jar file doesn't have revision number. idea how fix it? the lines you've added dependencies.yml define repository: tell play framework packages group "provided" under location specified. you still need tell play actual dependency. add line under require: section of file looks this: - provided -> sfpartner 1.0 the format of these lines group -> package version , since repository contains 1 artifact, package , version write won't matter. usually, parameterize artifact element, this: artifact: ${application.path}/jar/[module].jar this ...

Yii2 activeDropDownList fundamentals -

i'm new yii2 not mvc (trying move focus ms yii2). i've scaffolded app db using gii. have table called track have table called music_category. there's n:n relationship via link table called track_has_music_category. track model (as scaffolded gii) has function public function getmusiccategories() { return $this->hasmany(musiccategory::classname(), ['id' => 'music_category_id'])->viatable('track_has_music_category', ['track_id' => 'id']); } but retrieving categories have been 'link'ed track. guess need like <?= html::activedropdownlist(thecategorymodel (syntax here??), 'id', arrayhelper::map(thecategorymodel->findall(),'id', ''description)) ?> well, that. feel though online reference few worked examples. any appreciated. cheers mark let's want attach categories track model ($model): echo html::activecheckboxlist($model, 'musiccategorie...

Can I get jre package for AIX without installing java? -

i need jre package aix . possible download ibm site without installing on aix. current state when untar downloaded package prodiced file *.jre yes, possible download ibm's site different versions of jdk , jre, both 32 , 64 bit. requires free registration. the downloaded files in 'backup format', can installed 'installp', eg: installp -ayd . java71.sdk

java - Getting Null point exception when Clicking Button(Android) -

i'm getting null point exception whenever click aws button in front page, have brained stormed alot, i'm not able understand why. m going paste few lines of code relevant, please @ it, , let me know m going wrong. thanks manifest file <activity android:name=".front" android:label="@string/title_activity_front" > <intent-filter> <action android:name="com.example.getit.front" /> <category android:name="android.intent.category.default" /> </intent-filter> </activity> <activity android:name=".awsstartact" android:label="@string/title_activity_aws_start" > <intent-filter> <action android:name="com.example.getit.awsstartact" /> <category android:name="android.intent.category.default" /> </intent-filter> ...

datatables - Meteor: How to dynamically update source of aldeed tabular -

i using meteor aldeed tabular package , able data it. can use server side selector restrict want need contents change depending on click elsewhere on client side. can client pass value server, parent id, , change server side children shown in tabular?

r - "Error in if (abs(x - oldx) < ftol)" when using "lognormal" distribution in mixed logit -

i have question how use mlogit package in r analysis of discrete choice survey data. our survey asking people choose different insurance policies(with 2 attributes of deductible , premium). the code used fit mixed logit is: [1] ml <- mlogit.data (mydata, choice="choice", shape = "wide", id = "individual", opposite =c ('deductible', 'premium'),varying = 5:10) [2] ml.w5 <- mlogit (choice~deductible+premium|0, ml, panel = true, rpar = c(deductible='ln', premium='ln'), r = 100, halton = na, print.level=0) i try use lognormal because hope coefficients both deductible , premium negative. , use "opposite" in [1] reverse sign because lognormal positive. but error warning: "error in if (abs(x - oldx) < ftol) { : missing value true/false needed in addition: warning message: in log(start[ln]) : nans produced" i double check data , sure there isn...

amazon web services - AWS Lambda w/ API Gateway for Angular back-end? -

i'm still trying wrap mind around limitations of aws lambda, aws api gateway opens lot of options serving rest requests lambda. i'm considering building web app in angular lambda serving back-end. for simple crud stuff seems straightforward enough, authentication? able use passport within lambda user authentication? yes, can pretty anything, store session on aws hosted database (rds, dynamo, etc). aware exactly buying lambda. has lot of trade-offs. price: ec2 server costs fixed price per month, lambda has cost per call. cheaper depends on usage patterns. lambda cheaper when nobody using product, ec2 most likely cheaper usage increases. scale: ec2 can scale (in many ways), it's more "manual" , "chunky" (you can run 1 server or 2, not 1.5). lambda has fine-grained scaling. don't worry it, have less control on it. performance: lambda speed, , have little control. may have huge latencies in cases, spin new containers handle tr...

html - What does '\ ' mean in javascript? -

Image
i got javascript code contains html code inside strings. strings start '\ ' (backslash, space). sequence do? this weird because strings aren't highlighted html code after '\ ' in intellij idea v14.1.4. here's screenshot of sample-code. those backslashes escapes space character follows. "\ " same thing " " . in javascript string can escape character, doesn't need escaping. spaces doesn't need escaping, backslashes doesn't serve purpose in case.

angularjs - Nothing is shown in table using ng-grid -

code ng-grid: var app = angular.module('myapp', []); app.controller('myctrl', function($scope) { $scope.mydata=[]; $scope.queryresponse =[{ name: "name1", city:"city1" }, { name: "name2", city:"city2" }, { name: "name3", city:"city3" }, { name: "name4", city:"city4" }, { name: "name5", city:"city5" }, { name: "name6", city:"city6" }, { name: "name7", city:"city7" } ]; $scope.coldefs = [{ field: "name" }, { field: "city" }]; $scope.filteroptions = { filtertext: "" }; $scope.pagingoptions = { pagesizes: [5, 10, 25], pagesize: 5, totalserveritems: 0, currentpage: 1 }; $scope.setpagingdata = function(data, page, pagesize) { var pageddata...

c# - Redirection loop in identity authentication -

i using identity authenticate users, keep getting redirection loop (url long) when entering home page. http error 404.15 - not found request filtering module configured deny request query string long. detailed error information: module requestfilteringmodule notification beginrequest handler extensionlessurl-integrated-4.0 error code 0x00000000 physical path c:\...\auth\login logon method not yet determined logon user not yet determined request tracing directory c:\...\iisexpress\tracelogfiles\budgetingmanager i use visual studio 2013, , have done here- http://benfoster.io/blog/aspnet-identity-stripped-bare-mvc-part-1 i found solutions problem, none works. i've tried: 1) enabling anonymous authentication 2) disabling windows authentication in config.web: <windowsauthentication enabled="false" /> <system.web> <authorization> <windowsauthentication enabled="false" /> ...

ios - Calling pushViewController after a presentViewController does not work -

i presenting view controller - [self.navigationcontroller presentviewcontroller:self.thingcontainerviewcontroller animated:yes completion:nil]; //self.navigationcontroller not nil here this shows uitableview. want push vc on navigation stack here. self.navigationcontroller nil @ point. idea how make work? [self.navigationcontroller pushviewcontroller:othercontainer animated:yes]; //self.navigationcontroller nil @ point you need wrap view controller presenting in navigation controller in order able use push , pop methods. so first step: uinavigationcontroller *navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:self.thingcontainerviewcontroller]; then: [self.navigationcontroller presentviewcontroller:navigationcontroller animated:yes completion:nil]; if that, code work.

iframe - Rails app (production) interfacing with another rails app on same machine -

i created small application generates reports (mainly pdfs) sqlite3 database exported gnucash. separated app possibility of sharing other vfw posts using gnucash or stuck paper general ledger. call quasi api in reports can generated in both html , pdf or can send data. before separated it, had tried multiple database approach, adding sqlite3 database database.yaml along main postgresql database. worked made possibility of sharing difficult , little skeptical approach. all fine pdfs (prawn generated). use restclient reports pdf server running on same machine on different port. example, generate general ledger controller action called: def ledger_pdf resp = restclient.get "http://localhost:8600/ledgers/#{params[:id]}/ledger_pdf" send_data resp.body, filename: "ledger#{params[:id]}", type: "application/pdf", disposition: "inline" end on pdf server, action responds def ledger_pdf pdf = pdf::ledger.new(view_context,params) ...

maven - No test coverage in sonar -

i have multimodule maven project. have 2 tests in it. tests run during build , sonarqube shows 100% tests (2) passed. coverage empty. why it? other simple maven project uploads coverage in sonarqube. made test in same way in both projects. there more ways it, best way found use jacoco maven plugin, configure add it's agent surefire execution (and, optionally, if use integration tests, failsafe) , add these files sonarqube config. a explanation i've found here . basic stuff quite (here surefire): <plugin> <groupid>org.jacoco</groupid> <artifactid>jacoco-maven-plugin</artifactid> <version>0.7.5.201505241946</version> <executions> <!-- prepares property pointing jacoco runtime agent passed vm argument when maven surefire plugin executed. --> <execution> <id>pre-unit-test</id> <goals> ...

java - Hibernate : ORA-00907: missing right parenthesis -

i error : ora-00907: missing right parenthesis with hql : select new map(r,count(pt)) role r inner join r.portfolioteams pt inner join pt.teamstatustransitions ptst inner join ptst.teamstatus tst pt.id.bankid = :bankid , pt.id.networkdistributorid = :networkdistributorid , ptst.id.startdate <= :startdate , (ptst.enddate null or ptst.enddate > :enddate) , tst.id.teamstatusid in (:statusid) , (r.id.cpmroleid in (:roles) or r.id.cpmroleid in (:roles1) ) i checked, there no missing parenthesis, i'm pretty sure comes count(pt). any idea ? thanks maybe not variables (:bankid, :networkdistributorid, :startdate, :enddate, :statusid, :roles, :roles1) bound when executing query?

r - How to change id of nodes in igraph? -

Image
i have tree such as: library(igraph) tree<- graph.empty(15) tree <- tree + path(5,4,3,1,2) tree <- tree + path(8,7,6,5) tree <- tree + path(15,14,13,12,11,10,9,5) root <- v(tree)[igraph::degree(tree, mode="out")==0] plot(tree, vertex.size=6, edge.arrow.size=0.1, layout=layout.reingold.tilford(tree, mode="in", root=root)) vertex ids given input order: v(tree) vertex sequence: [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 i re-number ids root 1. using name attribute get: # label root 1, , rest 2...n root <- v(tree)[igraph::degree(tree, mode="out")==0] v(tree)$name[v(tree) != root] <- 2:vcount(tree) v(tree)$name[v(tree) == root] <- 1 root <- v(tree)[igraph::degree(tree, mode="out")==0] plot(tree, vertex.size=6, edge.arrow.size=0.1, layout=layout.reingold.tilford(tree, mode="in", root=root)) but ids unchanged: v(tree) vertex sequence: [1] 2 1 3 4 5 6 7 8 9 10 11 12 ...