Posts

Need to Replace properties of single sql file using bat file -

Image
how replace values/properties of .sql file using input .bat file. when calling batch file, use %1, %2, etc. pass parameters. can use same passed parameters in stored procedure. so, in batch file, call command line version of database (which version?) , run stored proc. here example. %1 in batch file replaced "sam" passed @ command line.

android - Sharing selected text -

i have book-like application , suppose have option of selecting text , sharing it. to make text selectable use edittexts instead of textviews , how can share part of text? i know how text string variable, problem when select text - have standart edittext dialog @ top of screen has options "select all","copy" etc hides action bar, there no way can select text , click "share" on actionbar because it's hidden "copy-select all" panel. what can suggest? you override function "performlongclick".

ios - Push notification not supporting existing app Id? -

Image
hi have 1 ios app in app store,so when create app id didnt checked "push notification" (didnt selected option).its 3 months ,but want add push notification in new version 1.4 .but not able enable pushnotiication now.?? there way fix this? bundle identifies in form of company.exampleapp or need upload new app? please help. you need go edit app id , follow steps enable push notifications. afterwards, need profile again , create ipa updated profile. if using urban airship need change flag value yes "inproduction" in airshipconfig.plist file.

javascript - Nav Sidebar like on Google and Twitch -

i'm trying recreate sidebar: http://www.twitch.tv/directory there's 1 on youtube: http://www.youtube.com/ when window height small scrollbar appears in sidebar, , no matter how large window height it's stuck bottom. content go on right side (the same youtube). there online tutorial or recommendations can follow recreate this? i'm trying find 1 haven't had luck. many thanks. i think you're after might j panelmenu: http://jpanelmenu.com/ completely customisable. have used few businesses such as: http://www.kapowinteractive.com.au/ if bring width in, can see icon pop in top left corner. click , navigation opens up. think may starting point you.

python 2.7 - Chat Solution for Mobile App -

i looking chat solution can integrate mobile app. far, have been looking python solutions , have come across "chat demo in tornado" library. there more advanced solutions can ? chat demo link : https://github.com/facebook/tornado/tree/master/demos/chat there play2 (java) app has been developed example heroku makes use of redis , websockets: https://github.com/heroku-examples/play-websockets-chat-sample it helpful.

jquery - Detect current Section with javascript -

i'm working on onepage website. have fixed menu in pure html, here's code : <header class="header-menu"> <div class="header-menu-inside"> <h1>wm flying</h1> <nav class="menu menustandard"> <a class="target-section1 current" href="#section1">home</a> <a class="target-section2" href="#section2">about</a> <a class="target-section3" href="#section3">portfolio</a> <a class="target-section4" href="#section4">the team</a> <a class="target-section5" href="#section5">contact</a> </nav> </div> </header> <div class="main" id="main"> <section id="section1" class="home"> </section> <secti...

internationalization - Translating Views Exposed filters Label -

i'm trying translate views exposed filters labels on site. manage have exposed filters translated internationalization views module. tried string override module translate exposed filters labels far no luck. please point me in right direction? thanks

avahi - Where multicast packets could be filtered? -

i installed openwrt distro on router , enable support of avahi in it. goal discover network services in network. i plugged pc lan port announced services. on router run tcpdump on bridge interface : tcpdump -i br0 -vvn udp port 5353 during avahi browse execution receive output: root@localhost:~# avahi-browse -art 21:55:22.995004 ip (tos 0x0, ttl 255, id 0, offset 0, flags [df], proto udp (17), length 74) 192.168.1.1.5353 > 224.0.0.251.5353: [udp sum ok] 0 ptr (qm)? _services._dns-sd._udp.local. (46) but on pc wireshark didn't show multicast queries during call, hence no services found. does mean router filter multicast packets somehow? way know filter in ebtables, shows nothing filtering of mdns addresses: root@localhost:~# ebtables -l bridge table: filter bridge chain: input, entries: 1, policy: accept -j ro_input bridge chain: forward, entries: 1, policy: accept -j ro bridge chain: output, entries: 1, policy: accept -j igmpproxy bridge chain: ro, entr...

ios - UITextView Fixed Size and Stop Auto Resizing -

Image
i'm trying add editable text block uiscrollview (so text blocks scroll when keyboard shows up) buttons can change. problem creating uitextview programmatically , adding uiscrollview 's subview prevents buttons being able access uitextview.text . added uitextview in scrollview in storyboard , uitextview autoresized 1 character since starts no text. i've tried using cgrectmake , uitextview won't keep width fixed. user won't able see texting 1 character visible @ time. suggestions on how have fixed width, editable textview , added scrollview keyboard can show, doesn't automatically resize? here code: @interface inventoryviewcontroller () @property (weak, nonatomic) iboutlet uitextfield *texttitle; @end @implementation inventoryviewcontroller @synthesize texttitle; -(void) createviewwithtitle { uiview *whiteview = [[uiview alloc] initwithframe:cgrectmake(0.0f, 0.0f, 320.0f, 400.0f)]; whiteview.backgroundcolor = [uicolor redcolo...

Join five array values into a single array where all the array variable is same and the array contents are different javascript -

here have written javascript array (var a=[""]) consists of different values in each if condition, want array values stored in single array seperated comma(,). can me?? here javascript <script> function colorchange(id) { var background = document.getelementbyid(id).style.backgroundcolor; if (background == "rgb(255, 145, 0)") { document.getelementbyid(id).style.background = "rgb(26,255,0)"; } else { document.getelementbyid(id).style.background = "rgb(255, 145, 0)"; } var elem = document.getelementbyid(id); if (id == "select") { if (elem.innerhtml == "ignore select") { elem.innerhtml = "enable select"; var = ["select"]; //array returns select } else { elem.innerhtml = "ignore select"; } } if (id == "select1") { if (elem.innerhtml == "ignore delete...

Magento add wysiwyg to custom frontend form -

i'm writing module, , i'm searching how add build-in wysiwyg editor textarea in frontend. possible? knows, how implement that? so, keeping final solution in case need : 1) put code in .phtml file want editor appear directly. 2) in 6th line of code can see elements: "short_description" . can change "short_description" element id want. can add more 1 element id separated comma , without spaces. example: put code in app/design/adminhtml/default/default/template/catalog/product/edit.phtml because want editor appear directly when edit product's description, short description etc. the code: <script type="text/javascript"> window.onload=function() { tinymce.init({ mode : "exact", elements: "short_description", theme : "advanced", plugins : "inlinepopups,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,con...

deployment - Deploy Grails 2.3.0 to Glassfish Server -

i have application build grails 2.3.0 , type command 'grails war' generate war file. type following command deploy application : asadmin deploy app_path/target/myapp.war but following error: remote failure: error occurred during deployment: exception while deploying app [myapp] : org.xml.sax.saxparseexception; linenumber: 137; columnnumber: 15; deployment descriptor file web-inf/web.xml in archive [myapp]. cvc-complex-type.2.4.a: 從元素 'init-param' found invalid content。expect '{"http://java.sun.com/xml/ns/javaee":run-as, "http://java.sun.com/xml/ns/javaee":security-role-ref, "http://java.sun.com/xml/ns/javaee":multipart-config}'。. please see server.log more details. i use grails 2.3.0 , same error on both glassfish 3.1.2.2 , glassfish 4. how can fix error ? appreciate. -- update i use grails command "grails install-templates" generate web.xml, , move web.xml web-app/web-inf, still got same error message...

sd card - Android Open External Storage directory(sdcard) for storing file -

Image
i want open external storage directory path saving file programatically.i tried not getting sdcard path. how can this?is there solution this?? private file path = new file(environment.getexternalstoragepublicdirectory(environment.directory_pictures) + ""); or private file path = new file(environment.getexternalstoragedirectory() + ""); i tried getting path above both methods both pointing internal memory. when open storage memory if sdcard peresent shows below- device storage & sd memory card. i want sd memory path through coding. have given permissions in manifest- <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.storage" /> <uses-permission android:name="android.permission.read_external_storage" /> i had been having exact same problem! to internal sd card can use string extstore = system.gete...

java - How to copy header and footer from one pdf to another -

i need create report in pdf in java. report being created in 2 steps. 1. create textual part of report on first page (with header/footer) 2. create graphic part of report in next page. (using itext pdf) graphics part, need copy header/footer first page , add other pages. can guide me how can achieve in itext or other similar library.

android - Why AVCodecContext extradata is NULL? -

i trying decode h264 video using ffmpeg , stagefright library. i'm using this example. the example shows how decode mp4 files, want decode h264 video. here piece of code.. avformatsource::avformatsource(const char *videopath) { av_register_all(); mdatasource = avformat_alloc_context(); avformat_open_input(&mdatasource, videopath, null, null); (int = 0; < mdatasource->nb_streams; i++) { if (mdatasource->streams[i]->codec->codec_type == avmedia_type_video) { mvideoindex = i; break; } } mvideotrack = mdatasource->streams[mvideoindex]->codec; size_t buffersize = (mvideotrack->width * mvideotrack->height * 3) / 2; mgroup.add_buffer(new mediabuffer(buffersize)); mformat = new metadata; switch (mvideotrack->codec_id == codec_id_h264) { mconverter = av_...

android - Nested retained FragmentTabHost doesn't attach tabs to new Activity -

i have been playing around fragmenttabhost android v4 support library while , came upon serious issue couldn't resolve. target requirements follows. 1) fragment include tabs built fragments include nested fragments well, hierarchy this: android.support.v4.app.fragment (hostfragment) android.support.v4.app.fragmenttabhost (tabhost) android.support.v4.app.fragment (tab1fragment) android.support.v4.app.fragment (tab1fragment1) android.support.v4.app.fragment (tab1fragment2) android.support.v4.app.fragment (tab1fragment3) android.support.v4.app.fragment (tab2fragment) android.support.v4.app.fragment (tab2fragment1) android.support.v4.app.fragment (tab2fragment2) hostfragment + tabhost setup done according says in documentation here . 2) upon screen rotation retain status of hostfragment recreation of setup resources consuming operation , besides layout order nothing changes on screen no work needed display screen. return d...

android - Export signed app without "optimizing" png images -

when export apk eclipse, compresses of png images. example, 1 4.6 kb png became 2.15 kb inside apk. prefer optimize png files using tinypng before apk built, makes smaller files. same 4.6 kb png became 746 b using tinypng. when building apk, compression ran on 746 b png making 1.6 kb. is there way disable optimization future builds? in project build.xml ant file can override -crunch task of sdk, avoiding png compression, compressed them: <target name="-crunch"> <echo message="skipping png optimization"/> </target>

jquery - Query if class is already shown -

hello need able identify if given class "faded in": private void fadein() { // todo: check first if class shown! otherwise, don't run fade's out when run on faded in class $(".hopscotch-bubble").fadein(new com.google.gwt.query.client.function() { @override public void f() { jsnihelper.infonotify("info", "fade in method invoked."); } }); } how do that? gwtquery fadein finishes showing hidden element $(selector).visible() should return whether element visible. but normally, if want take care of not running 2 animations, normal way in gquery , jquery stop pending animations. $(selector).stop(true).fadein(...);

.htaccess - mod_rewrite issues with URL if page title has dashes -

i have page this: http://www.url.com/folder/content.php?name=this-is-the-page-title&item_id=129 as can see, title of page included in url, separated dashes. so, i'd convert following mod_rewrite: http://www.url.com/this-is-the-page-title-129.html for this, use mod_rewrite rule like: rewriterule ^([^-]*)-([^-]*)\.html$ /folder/content.php?name=$1&item_id=$2 [l] unfortunately, using rule, 404 error. think problem because title separated dashes (-) , separator dash well, can't tell variables each other or that. when change rule dash (-) slash (/) works fine: rewriterule ^([^-]*)/([^-]*)\.html$ /folder/content.php?name=$1&item_id=$2 [l] but url becomes: http://www.url.com/this-is-the-page-title/129.html ...which don't want i'd have rewrite entire structure of page. is there way working http://www.url.com/this-is-the-page-title-129.html even page title being separated dashes? thank :) the problem is, specify ([^-]*) m...

bash - Sorting in unix while other field doesn't change -

i have file 1 4 2 1 2 1 1 2 4 5 1 2 4 5 9 2 3 4 5 1 1 0 2 1 5 2 2 2 1 1 sort -k1 file gives 1 0 2 1 5 1 1 2 4 5 1 2 4 5 9 1 4 2 1 2 2 2 2 1 1 2 3 4 5 1 i want first field sorted, others remains should at, e.g. sorted file should give: 1 4 2 1 2 1 1 2 4 5 1 2 4 5 9 1 0 2 1 5 2 3 4 5 1 2 2 2 1 1 similarly sort -k1r testsort gives 2 3 4 5 1 2 2 2 1 1 1 4 2 1 2 1 2 4 5 9 1 1 2 4 5 1 0 2 1 5 when want 2 3 4 5 1 2 2 2 1 1 1 4 2 1 2 1 1 2 4 5 1 2 4 5 9 1 0 2 1 5 how can in unix? try this: sort -s -n -k 1,1 this work, , learn more can see here