Posts

Showing posts from April, 2011

html - Create a margin between two columns without effecting grid layout -

in body of page have split 12 columns body 8 columns wide , sidebar 4 columns wide. these 2 areas different colour background, want them appear if on top of background. problem when set margin between 2 areas in order make them appear 2 separate areas effects layout of website have 8 columns, 4 columns , margin, sidebar pushed below content. how add in margin separate 2 areas without destroying bootstrap's grid layout? edit: know nest them , add in column between 2 areas, want margin of 15px between 2 areas. code: <div class="container"> <div class="row"> <div id="content" class="main-content-inner col-sm-12 col-md-8 bg"> </div> <div class="sidebar col-sm-12 col-md-4 bg"> </div> </div> </div> .bg { background-color: #fff; } .sidebar { padding-top: 40px; border-left: 15px solid transparent; } you can change width o

c# - Problems with dropdown list in template field in gridview -

Image
okay have gridview following html shows: <asp:gridview id="griddetaljinarudzbe" autogeneratecolumns="false" allowpaging="true" pagesize="10" runat="server" onrowcommand="griddetaljinarudzbe_rowcommand" onpageindexchanging="griddetaljinarudzbe_pageindexchanging" onrowdatabound="griddetaljinarudzbe_rowdatabound"> <columns> <asp:boundfield datafield="naziv" headertext="naziv" /> <asp:boundfield datafield="sifra" headertext="Šifra" /> <asp:boundfield datafield="cijena" headertext="cijena" /> <asp:boundfield datafield="kolicina" headertext="količina" /> <asp:templatefield headertext="ocjena"> <itemtemplate> <asp:dropdownlist id="dropdownlist1" runat="

Using a Stored Procedure parameter within the From of another -

i have stored procedure outputs totals eform table. want use stored procedure pull out data other eform tables , want replace eform table name in clause parameter. i've read other questions, can't find 1 helps using parameter in from. code stored procedure looks - if object_id ('sp_selecteformmonthlytotals') not null drop procedure sp_selecteformmonthlytotals go create procedure sp_selecteformmonthlytotals @eformname varchar (200) = '' create table #temp (eformname varchar (200)) insert #temp exec sp_updateeform @eformname select .... @eformname t1 inner join flods_case_enquiry_f00 t2 on t1.eform_case_enquiry_id = t2.case_enquiry_id t2.created_dt >= '2012-04-02' group month(t2.created_dt), year(t2.created_dt)) t3 order year, month_number drop table #temp this latest attempt of many , includes second stored procedure called sp_updateeform - if object_id ('sp_updateeform') not null drop procedure sp_updateeform go cr

python - Twisted RevereProxy altering response headers -

i'm trying write reverse proxy adds headers , remove headers backend response. i've looked documentation , saw there reverseproxyrequest . can't see reverseproxyrespone , not clear if methods headerreceived request or response. help? pointers documentation? thanks, miki i don't see headerreceived method in the api documentation . however, older, more ambiguous names, headers , have been deprecated - should using more clearly-named requestheaders , responseheaders .

symfony - Get request with route / trigger problems -

i have routing issue in symfony2.3, , found nothing fix problem. strange i'm 1 has trouble. first of show routes. homepage: pattern: / defaults: { _controller: appuserbundle:default:profile, id: null } user_list: path: /user/list defaults: { _controller: appuserbundle:default:index } after successfull login user see following url "domain.com/app_dev.php/". now if user click url example "list of users" url change "domain.com/app_dev.php//user/list" , request trigger error, because route not exists. trailing slash after app_dev.php, trigger problem. i'm using default htaccess symfony 2.3. my host configuration this: <virtualhost *:80> servername app.dev-local proxypassmatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/app/trunk/web/$1 documentroot /var/www/app/trunk/web <directory /var/www/app/trunk/web> # enable .htaccess rewrites allowoverride require

php - How to make website accessible to non-mobile devices only? -

is there method disable hosted webpage mobile phones. website host must accessible through laptop or pc . user accesses hosted website must message open website windows browser. there php or script this have @ https://github.com/dmolsen/detector detector simple, php- , javascript-based browser- , feature-detection library can adapt new devices & browsers on own without need pull central database of browser information.

android - How to make a LayerImageDrawable with different types of gravity -

i trying build image view has 2 images inside of it; photo in background small indicator on top of it. however, i'm stuck in trying indicator appear in bottom-right of image, while photo in background supposed centered , scaled fit main image. playing gravity property of various elements not seem accomplish anything. below code tried use set gravity inside drawable, , xml element contains layerdrawable own gravity set, neither seems anything. resources r = fragment.getactivity().getresources(); drawable[] layers = new drawable[2]; layers[0] = r.getdrawable(r.drawable.addcoverphoto); layers[1] = r.getdrawable(r.drawable.project_active); // user-content instead ((bitmapdrawable)layers[1]).setgravity(gravity.right); layerdrawable layerdrawable = new layerdrawable(layers); image.setimagedrawable(layerdrawable); <imageview android:layout_width="100dp" android:layout_height="0dp" android:i

javascript - JS doesnt work in Chrome Extension -

my javascript doesn't work in google chrome extension. never worked google chrome extensions before , don't know how handle problem. want embed js in html, doesn't work. see calculator, buttons anything. if type in numbers , press enter, numbers deleted , nothing happens. here html , js: home html <html> <head> <title>afmo</title> <style> body { min-width:200; min-height:400; overflow-x: hidden; } </style> </head> <body> <a href="calculator.html">calculator</a> <p> <id="links"> <a href="calculator.html" target="_calculator2"><img src="icon/twitter.png" width="64" height="64"/></a> <a href="https://twitter.com/" target="_twitter"><

javascript - AngularJS $http.post inside function -

i using angularjs , inside service have this: var fn = { test: function() { $http.post(...) .success(function(response) { console.log(response); return response; }) } } this.testpostcall = function (id) { console.log(fn.test()); }; in controller testpostcall undefined, in fact in console first output undefined , second 1 correct json response. do know why undefined inside controller ? this because doing asynchronous procedure not synchronous one . indicated in $http documentation : the $http api based on deferred/promise apis exposed $q service your code showing correct behaviour, because fn.test() function not return , therefore evaluates undefined . if want access data received test function, have return $http.post() itself. it should this: var fn = { test: function() { return $http.post(...); } }; fn.test().success(function(data) { console.log(data); }); example

How to export varchar(max) columns from table to Excel 2007 in SSIS -

i have package creates staging tables on production , populates data in it. later need export tables data excel 2007 files. here, 1 column in table of datatype: nvarchar(max). when trying export table excel using [data flow task] [oledb source] table , [excel destination] excel, giving me error below. error: cannot create ole db accessor. verify column metadata valid. please me out. first try setting setting "validate external metadata" false if doesnt work , instead of using oledb source use .net source, bug doesn't happen.

javascript - Update HighCharts every 5 seconds -

i using code render highchart: <script> var chart = new highcharts.chart({ chart: { renderto: 'container1', title: '', type: 'column' }, xaxis: { categories: ["<?php echo join($data0, '","') ?>"], title: { text: 'month' } }, yaxis: { title: { text: 'orders' } }, series: [{ name: '<?php echo date("y",strtotime("-1 year")); ?>', color: '#666666', data: [<?php echo join($data1, ',') ?>] }, { name: '<?php echo date("y"); ?>', color: '#2196f3', data: [<?php echo join($data2, ',') ?>] }], credits: { enabled: false

objective c - OS X app menubar greyed out -

Image
i'm running app code on 1 computer , works should, menubar intractable. however, when run on computer menubar greyed out. both computers have os x 10.10 , xcode 6. might error be? local setting or something? turns out computer caused issues not running latest version of xcode (6.1) not set deployment target 10.10. set 10.9 , caused compatibility issues. silly

html - UI-select dropdown option not show above panel body -

i have panel fixed height overflow set auto. inside panel using ui-select. on-clicking/opening select box getting hidden behind panel footer , user has scroll down view. possible ui-select display outside of box having fixed height overflow set. <div class="panel-body" style="height:100px;overflow:auto;"> <div class="col-md-12"> <ui-select ng-model="person.selected" theme="select2" ng-disabled="disabled" style="min-width: 300px;"> <ui-select-match placeholder="select person in list or search name/age...">{{$select.selected.name}}</ui-select-match> <ui-select-choices repeat="person in people | propsfilter: {name: $select.search, age: $select.search}"> <div ng-bind-html="person.name | highlight: $select.search"></div> <small>

python - send remote shell command and retrieve its output -

because unable find library following started heading out write own. i'm unable find solution problems, though, , hope here maybe has suggestion. what want this. send normal shell command ls -al <some path> , want output (stdout , stderr) in same fashion , order appear in terminal emulator when writing command. catch is, don't want run shell command on computer i'm using, remotely via ssh or serial connection. put way, when calling ls -al <some path> 2>&1 >/tmp/out want remotely receive contents of /tmp/out without interruption or changes. the problem is, serial connection always, ssh connection depending on choice of library, terminal command chars \x1b[k mixed output. unable find creating these commands, why nothing consuming them already, , don't know how go consuming of them myself (there lot, naive approaches won't work). why problem special characters in output? want compare in python code if output has string ala if expecte

scanf not working well in C -

if (a % 5) goto ask; else goto main; ask:printf("do want exit ? y \\ n . . . \n"); scanf("%c", &yn); getch(); if (yn == 'y') { y: system("cls"); yn = 1; goto sign; } else if (yn == 'y') goto y; else if (yn == 'n') { n: system("cls"); yn = 0; goto sign; } else if (yn == 'n') { goto n; } else { printf("sorry ..didn't catch ... "); goto ask; } someone me understand problem somereason output code "do u want exit y\n ?" getchar ... "sorry didnt catch u want exit y\n ? " it looks jumped on scanf() first time , program went directly else ==> "sorry didnt that" , in second time fiugres o

caching - Is it safe to truncate these table (cache_hash, cache_pages, index_rel, ...) in Typo3 4.4 / 4.5 -

i wonder if it's safe truncate following tables. cache_hash cache_pages index_rel index_fulltext index_phash sys_log tx_realurl_chashcache tx_realurl_errorlog i can't seem find reliable info on web. lowlevel cleaner didn't find clean. thanks advice! yes, remind clearing indexsearch , realurl cache leads higher pageload on each page @ first hit.

xml - link .AI file intp SVG < image > element using a local resource -

i want link ai file svg file, here code. <image xlink:href="31218_1.ai" style="stroke: none; stroke-width: 1; stroke-dasharray: ; fill: 000000; opacity: 1;" transform="translate(-466 -390)" width="932" height="780"></image> but while opening file illustrator asking replacement, can't recognize, doing wrong, ai file in same dir svg file lays if file 31218_1.ai adobe illustrator file out of luck. can't link old filetype svg <image> . svg <image> elements work common bitmap forms (jpeg, gif etc) , svg files. export file illustrator svg, link instead.

delete or override const variables in javascript Harmony / ECMAScript 6 -

reading , tinkering new features offered ecmascript 6. the new 'const' statement writing constant variables nifty feature, adds features interesting update. the variable created read-only, , once stated can't overridden. edit: consequent problem arise, example, when testing code on console. running script containing const definition twice, lead error, breaking execution. what if want release keyword? there way unset or delete variable? i've read in this post problem affects var statement well, because environments variables created different on many level of abstraction. how ecmascript 6 intend address issue? it not possible redefine variables declared using const . however, const block-scoped. address issue describe, when testing code in console have wrap script in { , } : { const x = 1; } { const x = 2; } note many browsers support const keyword not yet support block-scoped constants example above fail in chrome , firefox (see kang

apache - Rewrite old mediawiki URL pattern to short URL format -

we have been running mediawiki installation years now. during upgrade newer version, decided switch short url pattern wikipedia uses. working fine. so our config file looks # enable rewrite engine rewriteengine on # short url wiki pages rewritecond %{document_root}%{request_uri} !-f rewritecond %{document_root}%{request_uri} !-d rewriterule ^(.*)$ %{document_root}/index.php [nc] as specified in documentation mediawiki. but have old urls floating around other places, support still. the old url this: wiki.domain.com/wiki/index.php/articlename now url looks this: wiki.domain.com/wiki/articlename but using old url, gives page not found. we have tried using online htaccess tester find correct rewriterule. , work there. not when using in on our apache server config. tried rule, right after rewriteengine on: rewriterule ^(.*?)index\.php(/|$) /$1 [r=301,nc,ne] which supposed redirect user new url. still page not found error, , url still looks same.

How can I do a Trigger in SQL? -

i trying learn triggers, know how basic ones, can't wrap head around this. have 2 tables services(master) , sales. services(serviceid,servicecost,salestotal) sales(transactionid,transactiondate,amount,serviceid) i trying write trigger update,delete,insert. when ever enter new sale in sales table, salestotal updated in services table according serviceid. ex: insert sales(transactionid,transactiondate,amount,serviceid) values ('16','2014-11-19','50','101'); so if salestotal transactionid '101' 1000, after insert 1050 , opposite if deleted/updated. i think have use join tables, stumped. use trigger, or split insert / dalete / update: code: create trigger [dbo].[t_update_services] on sales after update,insert, delete as begin update set salestotal = salestotal - b.amount services join deleted b on a.serviceid = b.serviceid update set salestotal = salestotal + b.amount services join inserted b on a.

scala - Slick Create Table -

i use next code create simple table in tutorial: import scala.slick.driver.h2driver.simple._ import scala.slick._ import scala.slick.lifted.{provenshape, tablequery} object mymodels { case class person(id: option[long], name: string) class persons(tag: tag) extends table[person](tag, "persons") { def id = column[long]("id", o.primarykey, o.autoinc) def name = column[string]("name") def * = (id.?, name) <> (person.tupled, person.unapply) } lazy val sources = tablequery[persons] } but when try compile get: [error] bad symbolic reference. signature in package.class refers type compiletimeonly [error] in package scala.annotation not available. [error] may missing current classpath, or version on [error] classpath might incompatible version used when compiling package.class. [error] /home/user/example/src/main/scala/example/mymodels/mymodels.scala:16: reference method anytotoshapedvalue in trait implicits shou

html - get iframe query string with javaScript -

this question has answer here: how implement cross domain url access iframe using javascript? 6 answers i have iframe. when page loads, page makes querystring. i need access query string generated after page loaded but code can access src without query string alert(document.getelementbyid('myframe').src); try: document.getelementbyid("myframe").contentwindow.location.href where myframe id of frame

Android: Multiple Sceen layout API -

i want make sure i'm understanding method setup multiple screen. i want make app runnable api 8-21. so far, implemented smallest-width differentiate multiple screen. works in emulator when use api 17, crashes when use api 8. realized smallest-width works api 13 , above. so now, think next step create layout-small, layout-normal, etc. , adjust them. is correct way tackle problem? edit*********** here's logcat error filter, let me know if need post other: 11-19 05:28:37.769: e/androidruntime(276): fatal exception: main 11-19 05:28:37.769: e/androidruntime(276): java.lang.runtimeexception: unable start activity componentinfo{com.nah.ace/com.nah.ace.mainactivity}: android.content.res.resources$notfoundexception: resource id #0x7f030018 11-19 05:28:37.769: e/androidruntime(276): @ android.app.activitythread.performlaunchactivity(activitythread.java:2663) 11-19 05:28:37.769: e/androidruntime(276): @ android.app.activitythread.handlelaunchactivity(activitythread.ja

xcode - Strange execution order when stepping through Swift code -

when stepping through debug swift code in xcode, see execution order strange things e.g. jumping end of if statements , back. it's compiler optimisations enabled, not - i've confirmed project settings debug builds "none[-o0]". does know why happens? there funky going on behind scenes? or straight forward lack of maturity of swift compiler/ui/debugger?

javascript - Facebook FB.UI feed dialog too wide on Android -

Image
i notice fb feed dialog large on android devices. how fix it? tried setting width using fb.canvas.setsize() did not change ... fb.ui({ method: 'feed', name: "...", link: ..., picture: ..., message: '', description: '...', redirect_uri: ..., caption: " " }, function(response) { ... });

android - EditText in ListView loses content on scroll in ListView -

i'm working on app users fill reports , polls. in activity have listview children contain edittexts, checkbox , textview. the problem edittexts , checkbox when scrolling, content have lost. able fix checkbox problem saving check status in array, can't fix problem edittexts. know there questions particular issue solutions provided doesn't seem work. here adapter: public class diveprofileadapter extends arrayadapter<diveprofile> { private context mcontext; private list<diveprofile> mtasks; viewholder holder; private arraylist<boolean> itemchecked = new arraylist<>(); //for saving checkbox values public diveprofileadapter(context context, list<diveprofile> objects) { super(context, r.layout.row_dive_profile_divers_list_item, objects); this.mcontext = context; this.mtasks = objects; (int = 0; < this.getcount(); i++) { itemchecked.add(i, false); // initializes items value

ios - Xcode wont load dylib when running on device -

im having annoying problem when running on device. i added mapkit framework , after has crashed every single time saying: dyld: library not loaded: @rpath/libswiftcore.dylib ... ive tried everything, ive added in embedded binaries, ive deleted derived data, cleared cache, clean, ive tried remove mapkit project , use of in code, ive checked embedded content contains swift code. ive tried still crashing, please me!

cryptography - Include 'timestamp' into hash signature with C# and Compact Framework -

i want create hash , sign xml file in c# , compact framework 3.5. obtain signature of success. now, now, want signature "trusted timestamp" it's generated cmssigner , pkcs9signingtime . my code obtain , sign hash: sha1 sha1 = new sha1cryptoserviceprovider(); byte[] hash = sha1.computehash(file.readallbytes("myfile.xml")); rsacryptoserviceprovider rsaprov = (rsacryptoserviceprovider)mycert.privatekey; byte[] signature = rsaprov.signdata(hash, cryptoconfig.mapnametooid("sha1")); is possible include pkcs9signingtime in signature compact framework? probably easiest integrate cms library such bouncy castle application.

vb.net - How to add an application to startup using builder and stub -

i want application added startup registry of windows... hard code: have load .exe in "builder". builder needs load stub etc, , new application output? dont it. does has experience , maybe has simple example? i have tried: try dim regkey microsoft.win32.registrykey dim keyname object = "software\microsoft\windows\currentversion\run" dim valuename string = "regname" dim value string = filepath.text '"registrydescription" regkey = microsoft.win32.registry.currentuser.opensubkey(keyname, true) regkey.setvalue(valuename, value, registryvaluekind.string) catch ex exception end try i'm not sure problem you're having. take @ this video , hope clarify few things.

java.lang.NullPointerException at android.webkit.ZoomManager.setupZoomOverviewWidth(ZoomManager.java:1195) -

i have error in app , think error caused admob. got stacktrace. want know if error produced admob or not. me please? stack_trace = java.lang.nullpointerexception @ android.webkit.zoommanager.setupzoomoverviewwidth(zoommanager.java:1195) @ android.webkit.zoommanager.onnewpicture(zoommanager.java:1136) @ android.webkit.webviewclassic.setnewpicture(webviewclassic.java:9021) @ android.webkit.webviewclassic$privatehandler.handlemessage(webviewclassic.java:8273) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:5041) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:511) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:793) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:560) @ dalvik.system.nativestart.main(native method) phone_model = k00f android_version = 4.2.2 i want kn

meteor - OnscreenDiv error while using tinytest -

i following discover meteor example create tinytest errors. there problem in errors_tests.js file in block: //render template onscreendiv(spark.render(function() { return template.meteorerrors(); })); when run test fails message "onscreendiv not defined". i know meteor uses blaze templating engine. question custom defined function, or old example? correct way this? i got same problem. old example. when run meteor 1.1.x, change block with: ui.insert(ui.render(template.meteorerrors), document.body); and work.

java - How to check the data type exchanged over UDP connection -

is there way determine data type being exchanged client server? here code example of how think answer should like: byte[] databook = new byte[1024]; datagrampacket packetr = new datagrampacket(databook, databook.length); ds.receive(packetr); // following psuedo code if (packetr.getdata() off data type string) { // code here } if (packetr.getdata() off data type file) { // diff code here } packet.getdata() returns array of bytes. interpret it. basically, server needs know method client uses encode data bytes. example (not best option), use java serialization protocol: on client: bytearrayoutputstream bytes = new bytearrayoutputstream(); objectoutputstream os = new objectoutputstream(bytes); os.writeobject(messagetosend); os.close(); datagrampacket.setdata(bytes.tobytearray()); socket.send(datagrampacket); then, on server: byte bytes[] = datagrampacket.getdata(); objectinputstream = new objectinputstream(new bytearrayinputstream(bytes)); serializabl

java - Is that possible to create a Eclipse plug-in UI (just like a button/menu in Eclipse) to trigger a OSGi platform? -

my problem ..... i have osgi software , try combine eclipse plug-in. is possible create eclipse plug-in ui (just button/menu in eclipse) trigger osgi platform? thanks. an eclipse plug-in allow insert button feature. here have tutorial, however... eclipse itfself built on top of osgi framework: equinox . of course, embed osgi platform such knopflerfish or apache felix inside, doubtful architecture. an eclipse plug-in osgi bundle, defined in standard way manifest.mf file. in order complete standard modularity management feature explicit dependency management, eclipse has own system relying on plugin.xml file (a kind of glue). should able load existing osgi bundle (non-plug-in) if these plugins. if not mistaken, plugin.xml file not required plug-in. here exchange in eclipse forum on topic.

ios - How can I take a snapshot of a view that is out of the visible bounds? -

here's setup: main view: (0, 0, 320, 548) subview 1: (100, 200, 100, 300); subview 2: (320, 0, 320, 548); as can guess subview 2 not visible still inside main view. i'm using code taking snapshot: [subview snapshotviewafterscreenupdates:yes]; what i'm trying take snapshot of subview 2 (that out of visible bounds) , add subview 1 (that visible). imagine if subview 1 thumbnail of subview 2. when hover on window , shows preview. the problem snapshot view returns black if subview 2 not drawn @ all. there way can solve this? the snapshot method has been extensively tested , works fine. edit: can force subview 2 draw itself? try – better? uigraphicsbeginimagecontext(yoursubview.frame.size); cgcontextref context = uigraphicsgetcurrentcontext(); [[yoursubview layer] renderincontext: context]; uiimage *screenshot = uigraphicsgetimagefromcurrentimagecontext();

how to get Extjs Store last insert id? -

i use rest proxy, want know last 'id' of last insert record, server side respond should be: before saving: id:-1 save: var values = this.getfrmreciept().getvalues(); var record = this.getfrmreciept().getrecord(); var store = ext.getstore('recstore'); record.set(values); record.save(); store.add(record); alert(record.data.id);//result '-1' respond server: {"success":true,"reciept":[{"id":"366","c_id":"57","crdt_auth":"test","typ":"2","clerk_id":"1"}]} after saving use same record new ' id ': alert(record.data.id);//result '-1' how can new 'id' returned server? thank in advice var newid = -1; record.save({ success: function (rec, op) { newid = rec.getid(); alert(newid); } }); look fiddle example

how to insert the output of php query into mysql -

i want insert data database outout is <?php echo ''.pq('#giro_0 td[align="right"]')->html();?> how into $sql = "insert ing(aaa,bbb,ccc) values(curdate(),'bbb', xxx )"; where xxx can put value database. you put in variable instead of echoing it. $html = pq('#giro_0 td[align="right"]')->html(); then stick placeholder in sql: $sql = "insert ing(aaa,bbb,ccc) values(curdate(),'bbb', ? )"; then use whatever function database api uses populate placeholders . $stmt->bind_param('s', $html);

python 2.7 - Write EXIF-data from TIF (read with exifread) to JPEG-file using PIL (Pillow) -

i'm writing function specialized image manipulation , saves image in jpeg format. naturally, metadata should preserved as possible. i'm using pil (pillow) , succeeded jpeg files input data, since pil able read exif-data in case. however, tif images info-dictionary not contain 'exif'-key. using module exifread, reading exif data works fine, so import exifread f = open('tifimage.tif') img_exif = exifread.process_file(f) f.close() now i'd pass exif-data pil when saving, e.g. img.save(filename, "jpeg", exif = img_exif) but cannot find out how format exif data properly, since come in dict type exifread, need in raw-string format or read-only-buffer pil. any highly appreciated! what looking pyxif: https://pypi.python.org/pypi/pyxif the library doing that. you can grab current exif information from: im = image.open(file_path) exif_data = im.info['exif'] then can convert in dictionary pyxif using: zeroth_ifd, exif

mysql - ERROR 1046 (3D000): No database selected while creating user -

when create admin user with: grant on * my_name@localhost identified 'my_passwd' grant option i received error message " error 1046 (3d000): no database selected ". you should saying below qualifying database name. check mysql documentation more information. grant on db_name.* so case, grant on db1.* my_name@localhost identified 'my_passwd' grant option;

scala - What is the purpose of the annotation after equal sign? -

there val in scala written this: val todo = action { notimplemented[play.twirl.api.html](views.html.defaultpages.todo()) } what purpose of action after equal sign? that's alternative syntax for val todo = action(notimplemented[play.twirl.api.html](views.html.defaultpages.todo())) which in turn syntactic sugar for val todo = action.apply(notimplemented[play.twirl.api.html](views.html.defaultpages.todo()))

html - Custom button to mute audio play -

i have code below , using html based game making. delays playing of call in background while player uses iframe continue play game without interrupting call. <audio onloadeddata="var audioplayer = this; settimeout(function() { audioplayer.play(); }, 1500)"> <source src="call1.mp3" type="audio/mp3" /> my question is, how can make custom mute button can placed within iframe, when player clicks it, mutes call , hides button? found answer. used following code: the html <a href="#" id="mutebutton"><img src="mutecall.png"></a> <div id="sounddiv"> <audio id="background_audio" onloadeddata="var audioplayer = this; settimeout(function() { audioplayer.play(); }, 1500)"> <source src="call1.mp3" type="audio/mp3" /> </audio> </div> the javascript: <script language="javascript"> $("#mu

jquery - Draggable and droppable position -

please on jsfiddle the problem when drop element not position well. know problem because of left: 12px; in css cant figure out how solve. $('.b').droppable({ drop:function(event, ui) { ui.draggable.detach().appendto($(this)); } }); $('.b').selectable(); $('.c').draggable({ helper:"clone", revert: 'invalid', opacity: 0.5, grid: [30,36], }); just use ui.draggable.detach().appendto($(this).prev()) instead fiddle

r - txtProgressBar for parallel bootstrap not displaying properly -

below mwe of problem: have programmed progress bar function using bootstrap (via boot function boot package). this works fine long don't use parallel processing ( res_1core below). if want use parallel processing setting parallel = "multicore" , ncpus = 2 , progress bar isn't displayed ( res_2core below). library(boot) rsq <- function(formula, data, r, parallel = c("no", "multicore", "snow"), ncpus = 1) { env <- environment() counter <- 0 progbar <- txtprogressbar(min = 0, max = r, style = 3) bootfun <- function(formula, data, indices) { d <- data[indices,] fit <- lm(formula, data = d) curval <- get("counter", envir = env) assign("counter", curval + 1, envir = env) settxtprogressbar(get("progbar", envir = env), curval + 1) return(summary(fit)$r.square) } res <- boot(data = data, statistic = bootfun, r = r, formula = formula, parallel =

c# - How to get values from Class -

i building c# wpf app. app contains listview multiple column. added column , binding in listview xaml <listview x:name="receiptlist" horizontalalignment="left" height="209.987" verticalalignment="top" width="645" margin="111,135.748,0,0" isenabled="false" > <listview.view> <gridview> <gridviewcolumn header="receiptid" width="60" displaymemberbinding="{binding receiptid}"/> <gridviewcolumn header="itemno" width="50" displaymemberbinding="{binding itemno}"/> <gridviewcolumn header="itemname" width="240" displaymemberbinding="{binding itemname}"/> <gridviewcolumn header="packingsize" width="100" displaymemberbinding="{binding packingsize}"/> <gridviewcolumn header="quantity&q

java - Spring dependency injection from webapp to external jars -

i integrating java plugin framework within spring based web application (xml-free). everything fine, except dependency injection in plugin context for instance have data source use in plugin without having go property files using @autowired rest of application i cannot find way except using getbean, read not best practise on subject. i had @ logicaldoc project resorts properties reloading not correct solution me want beans attributes modifications available without further glue. does know of existing open source project both these environment used ? not being able inject dependencies in plugins, added following methods mother class of plugins public void setcontext(applicationcontextprovider a_ctx) { m_thecontext = a_ctx; } public applicationcontext getapplicationcontext() { return m_thecontext.getapplicationcontext(); } and retreive beans within plugin getapplicationcontext().getbean(*classtype*)

bash - SSH in Shell to populate array with system information from remote host -

ssh $remote '( df -k )' > $remote_space (( i=0; i<no_dest; i++ )) ssh $remote "( aux_free_space[i]=$( du -sk ${aux_dest[${i}]} | cut -f 1 ) )" done all work ok apart populating array aux_free_space[]; think du runs on local host. ssh $remote works fine aux_free_space initialised @ beginning aux_dest populated ssh $remote df -k > $remote_space ((i = 0; < no_dest; i++)); aux_free_space[i]=$(ssh $remote du -sk ${aux_dest[i]} | cut -f 1) done the array assignment has pulled out local shell, du must done remotely. cut can done on either side, cut down on levels of quoting can locally. (if du returned lot of output might choose cut remotely cut down on network traffic.)

apache - How to configure SVN to show a collection of Repositories -

i want show collection of repositories using mod_authz_svn. when access it, 403 error (forbidden). i found out works fine, when not specifying authzsvnaccessfile /etc/apache2/dav_svn.authz , seeing repos, permissions (of course) don't work anymore. is possible show collection of repos while using authzsvnaccessfile ? this dav_svn.authz : [groups] admin = me users = you,others [/] * = r @admin = rw [repo:/subfolder] @users = rw this worked me. on ubuntu 14.04 server, added following line /etc/apache2/mods-enabled/dav_svn.conf svnlistparentpath on be sure restart apache: $ sudo /etc/init.d/apache2 restart

javascript - Nodejs app stuck -

i have application must load lot of data database. a lot of objects in database has child objects. , works lot of async loops. async.eachseries(....., function (item, cb) { .... }); it's works fine, have around 1000 objects in processing each second. this functional works in background. app stuck , http server not response. i think maybe need add delay background data processing fix it? i think problem caused doing jobs in series , when job1 not done, job2 won't start , app stuck here. try doing time consuming jobs in parallel way instead.

Semantics of identifier line in Python -

what semantics of python 2.7 line containing identifier. i.e. simply a or something ? if know exact place in reference, i'd pleased. tnx. an identifier valid expression . expression on line valid statement . the full semantic chain little more involved. in order have nice operator precedence, classify things "a , b" technically both and_test , or_test . result, simple identifier technically qualifies on dozen grammar items stmt: simple_stmt | compound_stmt simple_stmt: small_stmt (';' small_stmt)* [';'] newline small_stmt: (expr_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | nonlocal_stmt | assert_stmt) expr_stmt: testlist_star_expr (augassign (yield_expr|testlist) | ('=' (yield_expr|testlist_star_expr))*) testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [','] test: or_test ['if' or_test 'else' test] | lambdef or_test: an

Android Expansion File. How can I put library in expansion file -

i working on app using lots of libraries provide funtionalities reading pdf,docx,ppt etc have youtube player , many more other libraries. due design of our app, using lots of resources design ui(resources 22 mb). using these images in layouts (which lot if ask). i checked see whether can go down on using background images, more strip them, our client asks more features integrate in app again increases size more 50 mb (google play limitation mentioned here google play expansion file setup link ) . i looking solution can somehow remove libraries while compiling app keep size under limit of 50 mb , put in expansion file (i know seems problem, cuz don't know how compile app without libraries) , load on run time . i confused here, can 1 me here ??

java - Foursquare Api for venue search not working -

i new foursquare api. trying learn doing simple program print venues in given latitude , longitude. getting null pointer exception. import fi.foyt.foursquare.api.foursquareapi; import fi.foyt.foursquare.api.foursquareapiexception; import fi.foyt.foursquare.api.result; import fi.foyt.foursquare.api.entities.compactvenue; import fi.foyt.foursquare.api.entities.venuessearchresult; public class sample { public venues venueslist = new venues(); public static void main(string[] args) { // todo auto-generated method stub try { foursquareapi foursquareapi = new foursquareapi("f3bnuxlwufgtwkstwxq4mntyvf4csrmtdvqxzkfqub1xwbt0", "kkuwa3wsqozj2k1mpbbik3eqolota3kzjhvfppfzpr0vih4e", "http://www.eatin.com/redirect_uri"); string latitude = "+40.689060"; string longitude = "-74.044636"; searchvenues(latitude+","+longitude,foursquareapi );

How to use Slim directly in ruby -

i create basic ruby script renders slim templates html (this part of larger project). ideally use html produced within script. i understand possible using tilt (as shown in slim readme ) says following: slim uses tilt compile generated code. if want use slim template directly, can use tilt interface. tilt.new['template.slim'].render(scope) slim::template.new('template.slim', optional_option_hash).render(scope) slim::template.new(optional_option_hash) { source }.render(scope) the optional option hash can have options documented in section above. scope object in template code executed. however, i'm still unable run this. therefore, wondering if me producing working example. edit (this has been edited further ): i have played code quite bit keep on getting following error: undefined local variable or method `source' main:object (nameerror) this i'm running: require 'slim' # i'm not sure next 2 lines... optional_opti

angularjs - Angular UI router default parameters wind up with URL http://example.com/#/deliverables////. A way to avoid consecutive slashes? -

here couple states app: angular.module("app").config([ '$stateprovider', '$urlrouterprovider', '$httpprovider', function ($stateprovider, $urlrouterprovider, $httpprovider) { 'use strict'; $httpprovider.defaults.withcredentials = true; //#region routing $urlrouterprovider.otherwise("/login"); $stateprovider.state('client1', { onenter: function () { }, views: { "index": { templateurl: 'indexview.html' } } }).state('client1.deliverables', { url: '/deliverables/:taxyear/:entity/:deliverable/:status', onenter: function () { }, views: { "nav": { templateurl: 'nav/nav.html', controller: 'navcontroller' }, "content": { templateurl: 'deliverables/deliverables.h

javascript - jQuery menu not collapsing in Safari -

i need this. i’ve created menu bar using combination of jquery , css , it's not collapsing or hiding way should in safari (i'm using 6.1.6). i'll start code first css code #menuholder { width:200px; height:30px; background:#ccc; position:fixed; top:10px; border: thin ridge #333; } #menuitem1 { margin:0.15em; display:table; float:left; width:150px; height:25px; background:#666; } #menudiv { background-color:#fff; height:100px; width:150px; opacity:1; visibility:hidden; -webkit-transition: 0.5s ease-out-out; -moz-transition: 0.5s ease-in-out; -o-transition: 0.5s ease-in-out; transition: 0.5s ease-in-out; position:absolute; top:34px; margin-left:.1em; } #menuitem1:hover { background:#06f; } #menuitem1:hover #menudiv { opacity:1; visibility:visible; background-color:#f00; -webkit-transition: 0.5s ease-in-out; -moz-transiti