Posts

Showing posts from May, 2013

symfony - Symfony2 - Share Entity Between Bundles with different relationships -

how share entity between multiple bundles different relationships? for example both zooanimalbundle , farmanimalbundle need user entity. third bundle accountuserbundle has user entity. in both zoo , farm animalbundles create user entity so: use account\userbundle\entity\user baseuser; class user extends baseuser { } i have hospital entity in zoo: class hospital { /** * @orm\manytomany(targetentity="zoo\anaimalbundle\entity\user") * @orm\jointable(name="users_zoo_animals") */ protected $users; and room entity in farm: class room { /** * @orm\manytomany(targetentity="farm\anaimalbundle\entity\user") * @orm\jointable(name="users_farm_animals") */ protected $users; everything works far in can call zoo.room->getusers() or farm.hospital->getusers() however problem i'm not sure on how set inverse relationship in respective user entities. if example update farmanimal user entity , run doctrine:generate:entitie

Python: Rename duplicates in list with progressive numbers without sorting list -

given list this: mylist = ["name", "state", "name", "city", "name", "zip", "zip"] i rename duplicates appending number following result: mylist = ["name1", "state", "name2", "city", "name3", "zip1", "zip2"] i not want change order of original list. solutions suggested related stack overflow question sorts list, not want do. this how it. mylist = ["name", "state", "name", "city", "name", "zip", "zip"] collections import counter # counter counts number of occurrences of each item counts = counter(mylist) # have: {'name':3, 'state':1, 'city':1, 'zip':2} s,num in counts.items(): if num > 1: # ignore strings appear once suffix in range(1, num + 1): # suffix starts @ 1 , increases 1 each time mylist[my

php - WP Adminer - instead Modify field appeared a strange field with text. MySQL database editing -

Image
i got problem database on adminer plugin page. somehow, suddenly, instead modify field appeared strange field text. on example text where%5bd%5d=y&where%5bbarcode%5d=9780753827666&where%5basin%5d=0753827662&where%5bauthor%5d=flynn%2c+gillian&where%5btitle%5d=gone+girl&where%5bsku%5d=m456b14-09-10-15-55&where%5bsalesrank%5d=74&where%5blowestprice%5d=2.71&where%5bprice%5d=2.70&where%5bminprice1%5d=0.00&where%5bminprice2%5d=2.68&where%5bmaxprice1%5d=2.80&where%5bmaxprice2%5d=40.00&where%5bout%5d=false&where%5bsale%5d=true&where%5bforsale%5d=n&where%5bkeep%5d=false&where%5bfees%5d=0.00&where%5bcurrentprice%5d=2.80&where%5bfnsku%5d=x000ac2vo9&where%5bcondition%5d=&where%5bquantity%5d=9 also, instead of button select whole result appeared field number 1. happened tables. on phpmyadmin in order. however, on plugin page can't use sql command, not mention can't check/select rows. i\'ve

Using old java EE in Eclipse -

i have project utilizes many different apis , frameworks , struggling running. basic idea access informations database , provide different options visualization of data. i’m not familiar many of tools used in project, such apache tomcat, hibernate , spring frameworks. initially, didn’t have java ee installed (only had jse). installed via eclipse (help -> install new software). have installed spring ide , sts, apache tomcat , xampp. project still has many errors , doesn’t run. student passed me project told me must use java ee 5 library. i don’t know how once have newer version of java (1.8) , java ee. tried search topics this, don’t understand dependencies , class path configurations. using eclipse luna in mac yosemite. i don't think you'll answer on question, abstract. it's realy difficult understand problem whis project is. try learn error's, find apropriate jar's @ http://www.findjar.com , add project lib folder , add jars dependency project

java - JPA handle merge() of relationship -

i have unidirectional relation project -> projecttype : @entity public class project extends namedentity { @manytoone(optional = false) @joincolumn(name = "type_id") private projecttype type; } @entity public class projecttype extends lookup { @min(0) private int progressive = 1; } note there's no cascade. now, when insert new project need increment type progressive. this i'm doing inside ejb, i'm not sure it's best approach: public void create(project project) { em.persist(project); /* necessary merge type? */ projecttype type = em.merge(project.gettype()); /* necessary set type again? */ project.settype(type); int progressive = type.getprogressive(); type.setprogressive(progressive + 1); project.setcode(type.getprefix() + progressive); } i'm using eclipselink 2.6.0, i'd know if there's implementation independent best practice and/or if there behavioral differences between

php - Bypass Geo Redirect for specific directories -

i'm trying bypass redirect specific url within site. wondering if might able help. the code below code use, original urls replaces example.com i'd able access http://example.com/admin without redirect occuring. is there way this, , there way using own ip? function country_geo_redirect() { $country = getenv('http_geoip_country_code'); if ($country == "us" ) { wp_redirect("http://usa.example.com/"); exit; } else if ($country == "gb" ) { wp_redirect("http://uk.example.com/"); exit; } } add_action('init', 'country_geo_redirect'); you can bypass redirection code if server found ip address. if ip address == <my ip address> ' nothing here else country_georedirect() end if

ruby on rails - How to detect and display Javascript error from AJAX call in Chrome DevTools -

Image
i have rails app receives form data , renders javascript. here example of such response: the rails app generates javascript without error , serves correct content-type , status code of 200. on tab in devtools there no apparent error. however, there error in javascript itself , namely undefined function: as can see, have "log xmlhttprequests" turned on in devtool settings. javascript errors triggered page events appear in console expected, javascript errors ajax calls don't. way can discover there error in returned javascript copy/paste code response console. this seems pretty critical feature doesn't exist. missing or not possible chrome devtools? if so, there workaround problem fit workflow?

java - Handle unexpected exceptions that silently kill a thread -

i've thread dies silently , want surround operation try/catch block find out going on without killing thread. i surrounded operations within run try / catch (exception e) block concern may overlook checked exception getting thrown dependency of run() , not handled properly. on other hand, i'm worried (unchecked) errors getting swallowed well. someone suggested short-term defense, should rename current run() method runinternal(), no checked exceptions declared, , put catch/log throwable in run() around call runinternal(). i don't understand how help. i want surround operation try/catch block find out going on without killing thread. quick answer: can't save thread. once exception thrown, can outsider stack trace. the wrapping runinternal technique log stack trace of error, instead of having thread die silently. however, want here, attach debugger, eclipse, , set pause on caught , uncaught exception until find 1 you're looking for. pause

java - Can a class call another function in a class without the firstclass needing to know the class that is it -

so might have worded question badly try explain mean. have game server interfaces unity written in java , wandering if there better way of handling received tcp stream data. suggested use dynamic packet handling improvement still requires handler have specific handle code each of different packet types. so wandering possible have received data object has code in has method name of handle packet , have handler not need know type of packet/class received , have call handle packet method. advice appreciated. if has been answered before sorry didn't know called google searched not helping. i use polymorphism. need create base type called packet , have other packet types inherit packet. packet class have method called handle of inherited classes too. way can call handle types of packets , different types of packets can handle differently. see this article oracle more information on inheritance in java.

osx - how to use the macdeployqt -codesign option with Qt 5.4.1 -

according this qt blog post : the -deep option signs app bundle recursively, including contained frameworks. while convenient use, –deep documented “emergency repairs , temporary adjustments only“. of qt 5.4 macdeployqt has -codesign option recursively signs app bundle without using –deep. but on qt documentation page qt os x - deployment , list of supported options macdeployqt (at bottom of page) not include -codesign . so, macdeployqt have -codesign option qt 5.4.1? if so, how use it? as blog post references code: - macdeployqt foo.app -codesign=mycertificate it appear support -codesign option qt5.4 , looks they've not updated docs accordingly. to see options tool, type following in terminal window: - macdeployqt --help you shoud see 1 of options listed is -codesign= : run codesing given identity on executables assuming have appropriate certificate in keychain , using qt 5.4.x, should able codesign -codesign option macdeploy

asp.net mvc - MVC Controller.File returns blank pdf -

i lost lot of time on issue go straight topic. receiving empty pdf correct number of (blank)pages. action is: public fileresult downloaddoc() { //authorization //initialising filename //getting content return file(convert.frombase64string(content), "application/pdf", filename); } content base64 string , correct. know because when use system.io.file.writeallbytes make document i'm getting correct one. tried return file on response , result same. there no (i hope) razor syntax errors. this part of code used work, , stopped despite no 1 made no change. maybe iis restarted. if can tell me else try ... tnx p.s. looking way without saving doc on server side. sorry, error in javascript saves file after returning server. if have similar issues check inner properties of blob object!

oracle11g - OBIEE and ODI on the same Weblogic Server -

can run obiee , odi (all 11g) on same weblogic server on different domains same domain, different managed servers. if yes, please give me pointers/start. thanks angad it technically possible, using 2 managed servers. obi apps uses setup. however, wouldn't recommend it. might upgrade each product @ different times supported versions of weblogic might not aligned @ point. you might have licensing issue, weblogic license comes obiee restricted use of obiee.

c# - ModelState not validating nested models after editing in controller -

i have nested viewmodels these two: public class firstviewmodel { public secondviewmodel secondviewmodel { get; set; } } public class secondviewmodel { [range(1, 12)] public int month { get; set; } } if put month = 13; , call modelstate.isvalid (in controller) validation true . edit: this controller: public actionresult create() { return partialview(new firstviewmodel); } public httpstatuscoderesult create (firstviewmodel viewmodel){ viewmodel.secondviewmodel = new secondviewmodel(); viewmodel.secondviewmodel.month = 13; if (modelstate.isvalid) { return new httpstatuscoderesult(200); } else { return new httpstatuscoderesult(304); } } i'm making abstraction of problem, aren't real variables. your question states "call modelstate.validate" in controller. there no such method, assume mean if (modelstate.isvalid) . the first step in model binding process parameters of met

javascript - Listing all posts with Blogger API -

i'm trying list blog posts blogger api v3: <script type="text/javascript"> function handleresponse(response) { var post_number = object.keys(response.items).length; //number of posts (i=0; i<post_number; i++) { $('#content').append('<div id="post' + (i+1) + '" class="post"><p></p></div>'); $('.post p').html(object.keys(response.items[i].title)); } } </script> <script src="https://www.googleapis.com/blogger/v3/blogs/1961645108677548855/posts?callback=handleresponse&key=aizasyajesqb3ddltucdbzif3lunx-gzr18tbrg"></script> this append 3 divs (because of 3 posts) content div. content of each of divs is: <p> "1" "2" "3" "4" "5" </p> i have no clue why, though assume title attribute of items[] . solutions or clues? thanks answers! you should removed o

loops - out of memory in matlab run time -

Image
i wrote code in matlab r2014a predicting target user rate target item. in method assign weight items computing item similarity between target item , each of corated items between target user , user. after computing items similarities (isim) , catch memory should compute user similarities base on isim. face out of memory error. have 1206 user , 1508 item in dataset. traindata = 1206x1508 isim = 1508x1508 isim , user similarity formulas below: (isim) (user similarity respect isim) and code below load('isim.mat'); isim2 = isim.^2; = 1 : size(traindata,1) target_user = traindata(i,:); mean_target_user = repmat(mean(target_user),length(target_user),1); k = i+1 : size(traindata,1) second_user = traindata(k,:); mean_second_user = repmat(mean(second_user),length(second_user),1); z = 1 : size(isim , 1) pearson{i,k}{z} = sum(isim(z,:) .*(target_user - (mean

windows - Extracting specific registry key from REG QUERY based on search string -

i trying extract key value of registry entry. want key have been trying concatenate using /f, had no luck. eg: command reg query hkey_local_machine\software\microsoft\windows\currentversion\uninstall /s /f chrome returns hkey_local_machine\software\microsoft\windows\currentversion\uninstall{157f97df-a001-36fb-a90c-55949fa130ca} displayname reg_sz google chrome end of search: 1 match(es) found. all want result 157f97df-a001-36fb-a90c-55949fa130ca how can using /f or other similar methods? many thanks!! you can try split lines using {} delimiters @echo off setlocal enableextensions disabledelayedexpansion /f "tokens=2 delims={}" %%a in (' reg query hkey_local_machine\software\microsoft\windows\currentversion\uninstall /s /f chrome ') set "value=%%a" echo %value%

python - Finding roots with scipy.optimize.root -

i trying find root y of function called f using python. here code: def f(y): w,p1,p2,p3,p4,p5,p6,p7 = y[:8] t1 = w - 0.500371726*(p1**0.92894164) - (-0.998515304)*((1-p1)**1.1376649) t2 = w - 8.095873128*(p2**0.92894164) - (-0.998515304)*((1-p2)**1.1376649) t3 = w - 220.2054377*(p3**0.92894164) - (-0.998515304)*((1-p3)**1.1376649) t4 = w - 12.52760758*(p4**0.92894164) - (-0.998515304)*((1-p4)**1.1376649) t5 = w - 8.710859537*(p5**0.92894164) - (-0.998515304)*((1-p5)**1.1376649) t6 = w - 36.66350261*(p6**0.92894164) - (-0.998515304)*((1-p6)**1.1376649) t7 = w - 3.922692207*(p7**0.92894164) - (-0.998515304)*((1-p7)**1.1376649) t8 = p1 + p2 + p3 + p4 + p5 + p6 + p7 - 1 return [t1,t2,t3,t4,t5,t6,t7,t8] x0 = np.array([-0.01,0.3,0.1,0.2,0.1,0.1,0.1,0.1]) sol = scipy.optimize.root(f, x0, method='lm') print sol print 'solution', sol.x print 'success', sol.success python not find root whatever method try in s

javascript - Updating a PDF Barcode Field in iOS and Android Device -

i have created 1 acrobat form using of radiobutton, text field, button,checkbox , barcode in adobe acrobat pro. after had opened form in adobe reader , updation of barcode , added javascript working in our deskstop on updating of data in our pdf created through "adobe acrobat pro" . but on trying same thing in our "android mobile" , "ios" not working. any suggestion regarding this? you cannot generate barcode today's software. the way barcodes might work on android if used text field barcode font (usually applicable 3-of-9 symbology), instead of barcode field.

api - How to correctly use HAL (Hypermedia Application Language) _embedded? -

i building rest api exposes information online courses users. here general structure of course: course > units > lessons > activities i'm trying make json response structure hal compliant, i'm unsure if i'm doing correctly. which of following correct: { “kind”: “clms#course”, “id”: long, “course-name”: string, “course-icon”: string, “product-name”: string, “product-icon”: string, “_links”: { “self”: {“href” : string}, “unitlist”: {“href” : string} // link list of units course. } } or link list of units _embedded resource? { “kind”: “clms#course”, “id”: long, “course-name”: string, “course-icon”: string, “product-name”: string, “product-icon”: string, “_links”: { “self”: {“href” : string}, } "_embedded": { “unitlist”: {“href” : string} // link list of units course. } } or both wrong!? appreciated. cheers, ollie few things.

Libraries overview in Android Studio -

i have use few *.aar libraries in android project. i have added definition of folder contains libraries build.gradle , wokrs fine. but thing have problem find out libraries using in project. so, questions are: is possible find out libraries referenced in project in android studio? is there place can manage libraries referenced in project? in android studio file -- >project structure --> select module -- > select "dependencies" tab

c# - Remove DataTable From DataSet doesn't work -

i have problem "undeletable" datatable. step 1: create datatable datatable dt = dtprogpoints_template.clone(); //create table dt.tablename = "program points 0"; //rename dsprogpoints.tables.add(dt); //add dataset dsprogpoints.acceptchanges(); //i found in forum, tried step 2: display in datagridview dtgprogpoints.datasource = dsprogpoints; //dtgprogpoints datagridview dtgprogpoints.datamember = "program points 0"; step 3: remove datatable dsprogpoints.tables.remove("program points 0"); //remove datatable dataset ds.acceptchanges();//i found in forum, tried and now, mystery coming. if check dsprogpoints.tables.count; , table removed, number of tables smaller before removing. when try delete again, exception occurs. but when try dtgprogpoints.datamember = "program points 0"; , data displayed in datagridview. table still not member of table collection in dataset, because if try read dsprogpoints.tables["program

javascript - Why did the model Array here not update in the DOM after updating in the Controller? -

http://plnkr.co/edit/7onkagvvnxwlwn5fzqju?p=preview i'm setting question related infinite scroll , noticed when update $scope.tags array have once tags have been scrolled way up, tags don't update. in project use service grab new data, in example i'm resetting values inside of tags array. why did not update in dom? markup: <section id="tags-col" class="tag-column column"> <ul id="tags-panel-list"> <li ng-repeat="tag in tags"> <div class="tag">{{tag.term}}</div> </li> </ul> </section> <div>{{tags}}</div> controller: // tags panel controller: tagspanelctrl.$inject = ['$scope', '$timeout']; function tagspanelctrl($scope, $timeout) { var tagscol = document.getelementbyid("tags-col"); $scope.tags = [ { term: "tag1" }, { term: "tag2" }, { term: "ta

c# - Url Routing using ASP.NET -

i have: <a href='news.aspx?id=<%#eval("id") %>'>read more</a> and querystring setup this: sqlconnection con = new sqlconnection(strcon); sqlcommand cmd = new sqlcommand("select * zaebancii id=@id", con); sqldataadapter apd = new sqldataadapter(cmd); dataset ds = new dataset(); cmd.parameters.addwithvalue("@id", page.request.querystring["id"].tostring()); con.open(); apd.fill(ds, "zaebancii"); cmd.executenonquery(); con.close(); formview1.datasource = ds; formview1.databind(); how can url rewrite link news/{id} e.g. news/4/ shows post of id of 4 thank you place these codes in global.asax protected void application_start(object sender, eventargs e) { registerroutes(routetable.routes); } public static void registerroutes(routecollection routes) { routes.mappageroute("", "news/{id}", "~/news.aspx"); } and can id this; routedata.values["id&qu

java - UnsatisfiedLinkError when running JAR from outside directory -

i have javafx application deploy jar. application loads , uses native library (a jni interface). the dll expected in same directory jar. how load library. have verified path correct dll. string jarpath = classloader.getsystemclassloader().getresource(".").getpath(); system.out.println(jarpath); system.load(jarpath + "_jni.dll"); here issue: when execute java run jar same directory jar, works fine. when execute java run jar outside directory, throws: java.lang.unsatisfiedlinkerror: c:/test/_jni.dll: %1 not valid win32 application @ java.lang.classloader$nativelibrary.load(native method) for example: ::this works. dll loads , executes successfully. cd c:/test java -jar pdwin.jar ::this not work. unsatisifedlinkerror java -jar "c:/test/pdwin.jar" my thoughts there bitness differences in components, or jni method signatures wrong, not true, have verified jvm 64 bit, , dll 64 bit. the fact dll wor

c# - Collection was modified; enumeration operation might not execute on Except operation -

i trying remove rows datatable dt in loop above exception: while (dt.rows.count > 0 && retry < globals.pushretrylimit) { var query = dt.asenumerable().except(successbatch.asenumerable(), datarowcomparer.default) .asenumerable().except(failbatch.asenumerable(), datarowcomparer.default); if (dt.asenumerable().any()) dt = query.copytodatatable(); } successbatch , failbatch both datatable clones of dt . in other questions error has been asked, dealing foreach loop. why error occur? stacktrace: @ system.data.datatableextensions.loadtablefromenumerable[t](ienumerable`1 source, datatable table, nullable`1 options, fillerroreventhandler errorhandler) @ system.data.datatableextensions.copytodatatable[t](ienumerable`1 source) you changing elements in collection (your datatable) while looping on foreach. foreach queries enumerator , asks next element. if remove item enumerator's state becomes invalid. enumerator ha

javascript - How to remove all values from a dropdown than selected value -

i have dropdown. want remove options dropdown. data.record.categoryid data.record.categoryid here got value ( data.record.categoryid ) 3. want remove options other value 3 remove dropdown using jquery. how can this? value of data.record.categoryid change each time. want remove other options value of data.record.categoryid try code $("#your_dropdown_id").children().not(":selected").remove();

javascript - Image preview before posting -

Image
the upload button in picture below allows user choose photo. image should display , next button used post request. i doing in following way: <form class="form-horizontal" role="form" method="post" action='{{url::route('postimage')}}' runat="server"> <div class="form-group"> <label class='col-md-4 control-label'>profile picture</label> <div class='col-md-6'> <img src='/images/default.jpg' id='image' class="img-responsive img-circle img-thumbnail img_profile pull-left"> <input type="file" name='profile_picture' id="file_id" class='hidden' > <a href='#' class="btn btn-primary" onclick="document.getelementbyid('file_id').click(); return false;"><span class='glyphicon glyphicon-camer

css - appear and disappear effect for div by clicking on it -

i can't understand how make in site: __smashingmagazine.com if u resize window, search button. so... try click on search icon... new div appear search input. , pay attention behavior of it: no matter u gonna next div won't hide self, if click on 'x' appear instead of search icon... , pure css, right?! how possible... found article: click here but behavior very, different... , don't @ all. any idea how make work in site above? may help! thanks! the example smashing magazine uses :target psuedo class change css of elements when anchor clicked. here's simplified breakdown of how they've achieved behaviour. the anchor configured set fragment identifier in url, in case of smashing magazine #ms . have anchor this: <a href="#ms">search</a> when clicked fragment identifier set #ms , use make search appear using :target psuedo class. #ms { display: none; } #ms:target { display: block; } when fragment i

OWIN OpenIdConnect middleware - set RedirectUri dynamically -

is there way how can set redirecturi property openidconnectmessage based on request scope, not application scope? my app serving multiple domains (myapp.com, myapp.fr, ..) , based on domain, determine default language content. need user taken same domain after login thru idp need find way how redirecturi set per request scope rather app scope done configuring middleware options in startup.cs . this can done via notification event redirecttoidentityprovider . this: notifications = new openidconnectauthenticationnotifications { redirecttoidentityprovider = async n => { n.protocolmessage.redirecturi = n.owincontext.request.uri.host; n.protocolmessage.postlogoutredirecturi = n.owincontext.request.uri.host; }, //other notification events... } `

Change button color using keyboard shortcut C# WPF -

i'm getting c# wpf, , creating simple word processor convert normal text wiki markup. new wpf , having trouble seemingly minuscule, , easy fix. i have bold button on main form. when pressed need do, turn selected text bold , vice versa when pressed again. bold button changes pretty light blue color when pressed, gray when pressed again. sweet works... //make bold main method static bool isbold = false; public static void boldtext() { if (isbold == false) { textselection ts = mainwindow.thisform.rtbmain.selection; mainwindow.thisform.btnbold.background = brushes.lightblue; if (!ts.isempty) { ts.applypropertyvalue(textelement.fontweightproperty, fontweights.bold); } isbold = !isbold; } else { mainwindow.thisform.btnbold.background = brushes.lightgray; textselection ts = mainwindow.thisform.rtbmain.selection;

How to redirect STDOUT of subscript into variable in ruby 2.1.6 -

here full code far: if argv.size == 0 print "set library name parameter" else dir = argv[0] begin dir.chdir "#{dir}" rescue print "no such library" else filelist = dir.glob "*.rb" outfile = "result" = 0 while < filelist.size filename = filelist[i] output = load "./#{filename}" if output == 1 file.open(outfile, 'a+') { |file| file.write("#{filename}")} end += 1 end end end the subscripts i'm trying run can either contain this: print "1" or this: print "0" . i want write "result" file filename :: ok if print "1" , , filename :: wrong if print "2" . my problem output equals true instead of 1 or 0 . how redirect subscript's stdout output variable? this shoul

Displaying nested association in view in Rails 4 -

i have 3 models below: class kick < activerecord::base has_many :offs has_many :retailers, :through => :off end class retailer < activerecord::base has_many :offs has_many :kicks, :through => :off end class off < activerecord::base belongs_to :kicks belongs_to :retailers end and i'm trying display name of retailer in 'show kick view' below: <% @kick.off.each do|off| %> <%= off.name %> <%= off.retailers.name %> <% end %> off.name displays fine cannot seem index retailer's name view. missing? error: undefined method `name' nil:nilclass class kick < activerecord::base has_many :offs has_many :retailers, :through => :offs end class retailer < activerecord::base has_many :offs has_many :kicks, :through => :offs end class off < activerecord::base belongs_to :kick belongs_to :retailer end also make sure indexed models in db

Gitlab redirecting loop -

yesterday installed gitlab on vm of mine , configured work it. gitlab listens on port 8081 of domain (e.g. domain:8081). i have apache instance listens port 80 , 443, did forward there (e.g. domain/git). everything worked fine (except css theme of domain/git, thats no problem), changed root url (i think, don't know how settings called) in admin section directly in gitlab http://domain/git let gitlab show me directly url if want copy url clone. now can't access gitlab instance, because have redirection loop. i can't find setting done gitlab itself, guess it's stored in database , not file. can me figure out how change particular configuration default? thanks in advance! you changed 'homepage url' used redirecting logged out users. instead of hitting domain mainpage, hit /users/sign_in , should able sign in admin user. go admin section, , clear out setting. you instead need go config/gitlab.yml (source install) or /etc/gitlab/gitlab.r

sql - Join a subquery of record count with main query - Avoid redundant query -

i have 2 tables, namely sequence table , work table. have join them , fetch p_key , l_key work table each tn_id in sequence table. now, want attach count of {p_key,l_key} each tn_id each tn_id of sequence table. had write join of sequence table , work table 2 times. want avoid that. how can achieve this?       select distinct     a.tm_id, rtrim(a.tn_id) tn_id,       w.p_key, w.l_key     sequence_table left outer join work_table w     on a.tm_id=w.tm_id , rtrim(a.tn_id)=rtrim(w.tn_id)              join          (select a.tm_id tm_id_c, a.tn_id tn_id_c, count(*) count_     sequence_table left outer join work_table w     on a.tm_id=w.tm_id , rtrim (a.tn_id) = rtrim (w.tn_id)     group a.tm_id, a.tn_id) c                                          on a.tm_id = c.tm_id_c , a.tn_id = c.tn_id_c   ps: solutions oracle sql , not pl/sql prefered. use with clause factor subquery, see with clause : subquery factoring using more readable , in cases faster queries.

sql - Looking list of duplicate for columns -

i have table data name, id, alt, col 4, col 5, col6 etc.. i want list name, id, , alt duplicate other cols can different. dont want distinct want know dupes i think want use group by , having clause, follows: select name, id, alt, count(*) mytable group name, id, alt having count(*) > 1

formatting - OpenOffice Calc displays only 9 numbers after decimal points, how to show more -

i in situation of dealing numbers when there need display numbers on excel sheet. 37.6172080480001 is being displayed 37.617208048 seems sheet default displays 9 digits after decimal points. how can updated show more digits after decimal points? currently number formatting option when applied whole sheet adds unwanted 000 numbers not have many digits beyond it. need solution increase system default without adding unneeded 0's thanks. you can increase shown numbers after decimal point this: tools -> options -> openoffice.org calc -> calculate set flag " limit decimals general number format " , set maximum number in input box (for me it's 20).

javascript - Prevent Incrementing until ui Slider val > 200 -

i have taken script net , need little push understand how achieve following: commission should begin increment after #yw0 val > 200. when under 200 commission stay 0 credit amount change normal. also reason if change comission 0 total still 51.6 , dont know why? current code: jquery(function($) { jquery('#yw0').slider({ 'range': 'max', 'min': 0, 'max': 130, 'slide': function(event, ui) { $("#credit_amount").val(ui.value); $("#amountsdiv").text(getamount(ui.value)); generateadditionalprecents(ui.value); refreshvalues(); if (parseint($("#amountsdiv").text()) > "200") { $('#t2').removeclass('not-active'); } else { $('#t2').addclass('not-active'); }; }, 'value': 0 }); jquery('#yw1').slider({ 'range': &

ruby - How to use prepend in a refine -

i'm trying make work following code : require 'ostruct' module interactorsrefine module openstructprepend def delete_field(name) super(name) if self.__send__(name) end end refine openstruct prepend openstructprepend end end module testy include interactorsrefine person = openstruct.new('name' => 'john smith', 'age' => 70) person.delete_field('namedddd') end you can execute code here : https://repl.it/qvk/2 the purpose overide delete_field of openstruct using both prepend , refine. but execution return nameerror: method `namedddd' not defined in class. what's wrong in code? if want use refinement s, should use using instead of include : module testy using interactorsrefine person = openstruct.new('name' => 'john smith', 'age' => 70) person.delete_field('namedddd') end hope helps!

jquery mobile 1.2.0 blank screen in chrome Version 43.0.2357.81 -

jquery mobile 1.2.0 version blank screen while slide in chrome version 43.0.2357.81 m. in other browsers ok. already has answer. check out answer here animation end webkitend bug you're better off moving latest version. edit to fix - add somewhere before loading jquerymobile.js - // override of $.fn.animationcomplete must called before initialise jquery mobile js $(document).bind('mobileinit', function() { $.fn.animationcomplete = function(callback) { if ($.support.csstransitions) { var superfy= "webkittransitionevent" in window ? "webkitanimationend" : "animationend"; return $(this).one(superfy, callback); } else { settimeout(callback, 0); return $(this); } }; })

delphi - How get the special-use attributes for IMAP mailboxes using Indy? -

rfc 6154, "imap list extension special-use mailboxes", states results of list command should contain special-use attributes each listed mailbox. in indy's tidmailboxattributes , however, don't find them. ought /all , /archived , /draft , etc., see noinferiors , noselect , etc. obviously these different attributes. how access these special-use attributes? update after bit of source-diving: assume achieved expanding mailboxattributes constant in idmailbox unit , consequently altering idimap4.parsemailboxattributestring method in idimap4 ? indy's tidimap4 , tidimap4server components not support special-use attributes yet. there open tickets feature in indy's issue trackers: add support imap list extension special-use mailboxes http://code.google.com/p/indyproject/issues/detail?id=257 http://indy.codeplex.com/workitem/24462

javascript - Uncaught exception onReject callback Promise -

Image
since yesterday , try understand behavior did not know onreject promise callback. in fact, work api (return json data) , superagent make request. have class: class api { constructor(uri) { ... } // simple http request get(...) { var url = this.buildurl(...); this.requestpending = request.get(url); return new promise((resolve, reject) => { this.requestpending.end((err, res) => { if (err) { reject(res.body.error); } else { resolve(res.body); } }); }); } } what not understand that: reject(res.body.error); throw exception (res.body.error contains simple string). indeed, firebug display error: uncaught exception: ... could explain behavior ? ps: work babel transpile js. edit i tested when librairie have same result. however, when write: reject(new error("foo")); the onreject

javascript - Angular - unable to get selected ng-repeated radio button using ng-submit -

i might missing simple here - if use ng-repeat create bunch of radio buttons - cannot selected 1 using ng-submit. the controller attaches array of options scope. the markup creates bunch of radio buttons ng-repeat within form. uses ng-submit capture submit event. click 'run code snippet' below see issue. angular.module('myapp', []) .controller('mycontroller', ['$scope', function($scope) { $scope.selectedoption = ""; $scope.submitcalled = ""; $scope.options=[]; $scope.options[0]={id: "option1", name: "option 1"} $scope.options[1]={id: "option2", name: "option 2"} $scope.options[2]={id: "option3", name: "option 3"} $scope.options[3]={id: "option4", name: "option 4"} $scope.submitform = function() { console.log($scope.selectedoption); $scop

python - What should do to fix my scikit-learn program? -

a snippet of code involving randomforestclassifier using python machine learning library scikit-learn. i trying give weight different classes using class_weight opition in scikit's randomforestclassifier.below code snippet , error getting print 'training...' forest = randomforestclassifier(n_estimators=500,class_weight= {0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:4}) forest = forest.fit( train_data[0::,1::], train_data[0::,0] ) print 'predicting...' output = forest.predict(test_data).astype(int) predictions_file = open("myfirstforest.csv", "wb") open_file_object = csv.writer(predictions_file) open_file_object.writerow(["passengerid","survived"]) open_file_object.writerows(zip(ids, output)) predictions_file.close() print 'done.' and getting following error: training... indexerror traceback (most recent call last) <ipython-input-20-122f2e5a0d3b> in <module>() 84 print '

java - How to execute Multiple commands -

i want to: log in putty using hostname, username, password , port number. have achieved. once logged in, want connect server1. in putty connect using ssh command (ssh user@server1). once connected server.i need run multiple commands like: df -kh ps -ef|grep www and after executing above commands, need log out server1 , need log in server2. how can in jsch? jsch jsch=new jsch(); session session=jsch.getsession(remotehostusername, remotehostname, remotehostportno); session.setpassword(remotehostpassword); properties config = new properties(); config.put("stricthostkeychecking", "no"); session.setconfig(config); system.out.println("please wait..."); session.connect(); system.out.println("connected "+remotehostusername+"@"+remotehostname); channelexec channel=(channelexec) session.openchannel("shell"); bufferedreader in=new bufferedreader(new inputstreamreader(channel.getinputstream())); channel.setc

vb.net - Combobox Datasource assign to Datatable -

how convert datasource of combobox datatable in vb.net? know how assign datatable combobox . in case need opposite way. like: dim dt datatable = combobox1.datasource is possible? i use trycast job done. dim dt datatable = trycast(combobox1.datasource, datatable) if dt nothing ' didn't work because it's not datatable ' editors: did not reduce expression ' emphasize need check 'nothing' ' , handle appropriately. else ' yay it's datatable end if

ruby on rails - Debian adding user -

i want add new user debian server. the user should have access rights ruby / rails / rvm / gem / git / , folder /var/www/ how add user correctly? the user should able start webrick server , install gems. a standard user should able single-user installation of rvm . just follow instructions on https://rvm.io in order check if user has rights on /var/www : check user's groups : groups #{username} check permissions on /var/www : ls -al /var | grep www you should : drwxr-xr-x 15 www-data www-data 4096 #{timestamp} www let's review character character : d directory ( - regular file, l links, etc...) next 3 characters permissions owner of file ( rwx here, meaning full access r reading, w writing, x executing) next 3 define permisssions group file belongs ( r-x means writing disabled) next 3 define permissions (other) user on machine. the 15 link count (how many links item). varies between platforms. first name ( www-data ) next o