Posts

Showing posts from 2015

errorPlacement in jQuery Validation plugin with other options -

i want show form errors on top of form along name of field. right if 14 fields there, it's writing 14 errors along "this field required" 14 times. want show field name. second issue group of checkboxes. want @ least 2 of them checked. array of 7 elements 2 checkboxes required. i want add border red error element , remove same time when correct. my html <form method="post" class="regular_form bookingform" id="apptbookingform"> <div id="error" class="error"><span>&nbsp;</span></div> <div id="summary" class="error"><span>&nbsp;</span></div> <div class="clr"></div> <div style="width:475px;"> <div> <label>select doctor <span class="mandatory">*</span></label> <select name="doctor" class="req...

Android FM Radio using OmapZoom source code Error -

i downloaded code git://git.omapzoom.org/platform/hardware/ti/wpan.git fmradio in android. while importing app fmrxapp showing compilation errors. can 1 me how import app worked on fm radio app. thanks & regards tiru check http://forum.xda-developers.com/showthread.php?s=54fdb869bb59f8f7150a94f032d11554&t=2198686&page=48 made same files me

css - Align horizontally and vertically in a circle -

following example found on @ css tricks, i'm trying center align content inside circle container responsive. example doesn't seem able handle content, , breaks enter more few lines of text. code pen example inside circle need have header , paragraph. there way set max width of content isn't placed outside circle when doesn't fit? you can set top value accordingly in .content code pen edit do changes: .content { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: table; } .content span{ display: table-cell; vertical-align: middle; text-align: center; } now short text or long text centered now. check this

.net - Insert RTF-Data without using clipboard or insertFile in C# -

i've question inserting rtf data word.range objects. implemented program fills word bookmarks using values db. currently implemented 2 ways fill rtf data word bookmarks. save rtf value temporary file , use insertfile method of range object. copy rtf value clipboard. select range of word bookmark , use paste method. both methods have disadvantages can not handle: i can't use first way, because writes file on harddisk , adds newline character @ end of rtf value/file. second way erases stored clipboard data. is there possibility insert data without using clipboard or insertfile method?

Bash script global redirection with exec and write to screen -

i have large bash script , want globally redirect stdout/stderr file, except progress indicators such specific echo messages. example, consider following script #!/bin/bash # stdout , stderr go out.log exec &> out.log special_echo "starting" # many other commands go here # output both stdout , stderr # special_echo commands in here, # example echo "msg1" special_echo "middle" echo "msg2" >&2 special_echo "finished" when run output should be $ ./script starting middle finished $ but, out.log should contain msg1 msg2 how implement special_echo functionality? i've tried using file descriptor , echoing can't display on screen. is there way achieve without appending redirection every line or doing in answer ? yes, using file descriptor way go: #!/bin/bash exec 3>&1 special_echo () { echo "$@" >&3 } exec &> out.log special_echo "starting"...

postgresql - How to select all tuples determined id and newest timestamp -

given table: id | timestmap | ..otherstuff.. with primary key (id,timestmap). id of type integer , timestamp timestamp. how can extract tupes of timestamp newest tuple? e.g. if current data: 1 | 1999-05-23 0:00 | ... 2 | 2000-05-23 0:00 | ... 1 | 2000-06-22 0:00 | ... i want result (though order bonus not care for) 1 | 2000-06-22 0:00 | ... 2 | 2000-05-23 0:00 | ... for cases use window functions . as example assuming table called foo, query work: with tmp ( select id, timestmap, rank() on (partition id order timestmap desc) foo ) select id, timestmap tmp rank=1;

libavcodec - How can I use the RTP capabilities of libav? -

i have own media engine rtp audio streaming , recording in sip platform. need implement rtp video streamig , recording support. plan use libav. i have searched documentation , code snippets of video streaming , recording using libav. , have gone through http://libav.org/documentation.html didn't clue. most of code snippet (examples) found @ other places related libav outdated. i not want use rtsp capabilities , interested in rtp interface. there docs refer ? any or pointer appreciated ... thanks, amar. documentation/mail list talk there no difference in sending file or url. succeeded send rtp packets not playable player

php - Yii - updating fields within CListView -

is possible update individual fields within clistview? looking solution lets users edit records in view of table records. an example user has list of associated appointments. might want mark appointment priority low/high without going update view itself. are there widgets other clistview sort of function? sorry, ran bit of dead end researching this, may have missed blindingly obvious. there no miracle solution, depend on task want accomplish; if want have buttons change task priority, can use ajax link ( http://www.yiiframework.com/doc/api/1.1/chtml#ajaxlink-detail ). if want edit text inline, can use combination of jeditable ( http://www.appelsiini.net/projects/jeditable ) , ajax edit text, update content of item. by way, quick reminder can partially render view string (a php variable, is) renderpartial method . render updated clistview item , return ajax callback update content. happy coding!

sharepoint - SP2010: How to display a lookup column in a .aspx displayform -

i have 2 lists articles(a) , serial inspections(s). the article-list has columns: article-#, name, descriptionde, descriptionen, somemore... the serial inspections: inspection-#, inspector, values , lookup column refers article-#. in addition in sp2010 can choose more columns displayed in serial inspections list named like: article-#:name. now took sharepoint designer2010 , made myself printable form of single listitem in serial inspections. took displayform.aspx , made changes. accessing link /printform.aspx?id=1234 show entry id 1234. i can select lookup column article-# itself. important me show additional lookup column article-#:name cant choose x-path list. good approach: got hiddenid of lookup column artikel-#: "artikel_x002d_ x0023 " , additional lookup column artikel-#:name 's id is: "artikel_x002d_ x0023 _x003a_arti" tried: <xsl:value-of select="@artikel_x002d__x0023__x003a_arti" /> sadly doesnt show anything... ...

performance - Comparison of JSON and User-Defined types in Postgres 9.3 -

i wonder why there fuss json support in postgres 9.3. advantages of json on user-defined types (udts)? pitfalls in using udts? access tables udts inefficient? alter type add attribute slow? how udts physically stored postgres? please, explain , give links additional information. as roman pekar mentioned in 1 of previous answers, json support offer more flexibility , offers possibility kinda mimic nosql behavior on relational one. furthermore, makes easier in client-server applications store json values sent client directly database. one can use 30% of fields client of application, 30% another, , on, not having define multiple tables or tables large set of columns. thus, 1 can store large chunks of heterogeneous information 1 place. last not least, json standard , it's supported many of big programming languages. (we using feature in our project (and have been using since in beta); furthermore, main reason chose postgres our application, needed big db de...

C# with HTML Tags -

i have website read in particular xml style file php , display content. people updating website aren't techincally minded , hoping create program coverting powerpoint type of xml i'm looking for. i convert powerpoint -> rtf -> html. sample output below: <p style="text-align:center;"><span style="background-color:#ffffff;font-family:calibri font-size:44pt;">title 1</span></p> <p><span style="background-color:#ffffff;font-family:calibri;font-size:32pt;">data in here.</span></p> <p>&nbsp;</p> <p><span style="background-color:#ffffff;font-family:calibri;font-size:32pt;">more data.</span></p> <p>&nbsp;</p> i wish read html line-by-line, interpreting tags , creating own file out of data. i.e: every tag particular tag classed title, particular tag classed data. example ouptut: <file> <item> <ti...

java - How to populate a large sqlite database on first run -

i'm working on dictionary app based on sqlite database on 300,000 rows. the problem database file in final form consists of full-text indexed tables , weighs on 150mb . i've managed bring .db file size minimum creating contentless fts4 tables. the database cannot smaller . managed put pre-populated database in app , works fine. the problem can't keep final .db file in /assets , copy sdcard on first run because it's big. don't want download on first run. bulk insert ing data, transactions , sqlite optimized , no indexes @ start takes forever it's not option. the thing raw data used build database, in csv format , compressed, 30mb , sqlite's command line .import option fast (100,000 rows in ~1s) but... can't accessed app without root permissions. i love bundle app compressed csv files in /assets, decompress them, create database on sdcard , import csv seems me impossible. although there many dictionary apps appear doing this. (the downl...

How to resolve Unable to find file.cpp in path(s) in Marmalade? -

i'm trying begin develop game in marmalade (6.3). when have made new sources (.cpp, , .h) , added them mkb, , trying run program, got error says unable find file.cpp in path(s). it's of files except files (game.h, game.cpp, main.cpp) made marmalade when have chosen new 2d game project. should add .cpp , .h files anywhere else? thanks it difficult give categorical answer without more info. guess you've copied , pasted example , not understood syntax of files section. basically: files { (foo) humbug.cpp ) the "(foo)" might innocent, says humbug.cpp in directory foo - relative mkb file. common practice use "(source)" , put source files in directory of name - making source layout bit neater. naturally if have (source) , don't put files in directory source, won't found. guess is seeing.

angularjs - Angular, testing none-persistent data storage locally -

i'm pretty new angularjs, , i'm looking way (which might remind ember fixture ) store none-persistent data testing purposes, before integration server-side. i try store data in 2 ways 1 regular copy , the other using post . my code - jsbin index.html : <body ng-controller="phonelistctrl"> <p>phone list</p> <ul> <li ng-repeat="phone in phones"> {{phone.name}} <p>{{phone.snippet}}</p> </li> </ul> <p>add new</p> <form> name: <input type="text" ng-model="phone.name" /><br /> snippet:<input type="text" ng-model="phone.snippet" /><br /> <button ng-click="add(phone)">save regular</button> <br /> <button ng-click="addrest(phone)">save rest</button> <br /> </form> </body> javas...

Bash: How to avoid warning: here-document at line XX delimited by end-of-file (wanted `EOM') -

this question has answer here: here-document gives 'unexpected end of file' error 4 answers i running bash script fine on 1 of linux host(bash version version 3.2.25(1)), since have moved script host (bash verison version 4.2.25(1)) throwing warning as line 36: warning: here-document @ line 30 delimited end-of-file (wanted `eom') (wanted `eom') the code in question is:-(not sure how eom works) usage=$(cat <<eom usage:${basename} [-h] [-n] [-q] -h, --help usage message -n, --dry-run -q, --quiet -d, --destination eom) } i have made sure there no space, tab or special symbols before , after eom cause of error find during research on google. bash (bash -x) debugged output looks like:- + source /test/test1/script.sh ./test.sh: line 36: warning: here-document @ line 30 delimited end-of-file (wanted `eom') ++...

java - How to remove elements of one map from another map? -

hashmap<string, string> foo = new hashmap<string, string>(); hashmap<string, string> baar = new hashmap<string, string>(); how remove items found in baar foo ? you can try: foo.keyset().removeall(baar.keyset()) changes map 's keyset() reflected in map itself. if want remove exact mappings (not based on keys), can use same approach entryset() instead: foo.entryset().removeall(baar.entryset());

Windows: CouchDB crashes during reinstallation -

i have couchdb installed on windows machine sometime ago working fine , version 1.1.0. (after few months of first installation) tried uninstalling existing couchdb 1.1.0 , went has left folders '/etc' , '/var' in installation directory. trying re-install using setup-couchdb-1.2.0_otp_r15b.exe without deleting above folders. after re-install when trying connect db below error in log. please on issue... [thu, 08 aug 2013 09:36:53 gmt] [error] [<0.108.0>] {error_report,<0.34.0>, {<0.108.0>,crash_report, [[{initial_call,{couch_db_updater,init,['argument__1']}}, {pid,<0.108.0>}, {registered_name,[]}, {error_info, {exit,snappy_nif_not_loaded, [{gen_server,init_it,6, [{file,"gen_server.erl"},{line,321}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"},{line,227}]}]}}, {ancestors,[<0.107.0>,<0.105.0>]}, {messages,[]}, {links,[<0.107.0>]}, {dictionary,[]}, {trap_exit,true}, {status,running}, {heap_s...

java - Why does my date parsing return a weird date? -

here code using: string string = "08/07/2013".replace('/', '-'); date date = new simpledateformat("yyyy-mm-dd").parse(string); why date return: "wen jan 3 00:00:00 est 14"? not @ date format told use. edit: need format because database using requires format. the format use parse date string, not match it. using yyyy 08 . use following format: new simpledateformat("dd-mm-yyyy") and why @ replacing / - ? can build pattern original string only: string string = "08/07/2013" date date = new simpledateformat("dd/mm/yyyy").parse(string); and if want date string in yyyy-mm-dd format, can format date using dateformat#format(date) method: string formatteddate = new simpledateformat("yyyy-mm-dd").format(date); see also: change date format in java string simpledateformat java doc

android - Invite new users for my app using app notifications facebook -

my app logs in via facebook , friends of facebook user logged listed invited download app. want guests advised via facebook through notification. i've done test via "graph api explore" follows: post/{recipient_userid}/notifications? access_token = ... & template = john inviting learn new app. & href = ... " but noticed notification comes have application installed. {return: "(#200) cannot send notifications user has not installed app"} how send notifications facebook users still not have application installed? thks! because notifications not meant used invite friends. they're used notify app users of events happening in app (e.g. if high score beaten in game example). if want let user invite friends use app, i'd suggest use request & invite features of facebook sdk: https://developers.facebook.com/docs/tutorials/ios-sdk-games/requests/ that tutorial shows how user can select list of friends invite , write...

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

Image
i've plotted data points , fitted exponential curve between them using 'fit' in matlab. problem fit-function got fitted line wanted plot, markers on top of regular markers. solved problem plotting wanted markers on top of unwanted couldn't seen. problem. when want show legends dots in there. how can remove markers legend without removing fitted line since both of them hidden inside fit-function? can stop 'fit' plotting unwanted markers? so, want remove blue dot called 'hoff' in picture below. you can leave out legend-entries manually leaving out handles of lines, dont want in legend. try this: %if plot something, want showing in legend, save handle: h_line = plot(x,y) %you dont want show line? dont anything, plot it: plot(mymarker) %then set legend-> can add text legend-entries %a cell-array containing strings want show up: legend([h_line another_line],{'text1' 'text2'}) with example (see comments) came solution: ...

Jruby converted ruby app problems -

i'm trying deploy ruby app our webserver , fit in other apps running there. this, need toss in war , run jetty. the app has been sitting on machine sometime gems out of date, in process of getting updated , transitioned jruby resolved number of old dependencies warbler bundle it. warbler bundling fine, deployed app dying unknown method. this the stack trace get: --- system jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on openjdk 64-bit server vm 1.6.0_27-b27 [linux-amd64] time: 2013-08-07 09:13:33 -0400 server: jetty/8.1.11.v20130520 jruby.home: file:/tmp/jetty-0.0.0.0-8085-webstat.war-_webstat-any-/webapp/web-inf/lib/jruby-stdlib-1.7.4.jar!/meta-inf/jruby.home --- context init parameters: public.root = / rails.env = production --- backtrace nomethoderror: undefined method `set_table_name' lockablestate(table doesn't exist):class method_missing @ org/jruby/rubybasicobject.java:1696 method_missing @ /tmp/jetty-0.0....

html - CSS: Combine Texture and Color -

Image
someone how combine texture use background-image , background-color above texture ? here texture : i want body background page : i'm struggling backroung-image , background-color : http://jsfiddle.net/87k72/ body{ background: #6db3f2 url('http://s13.postimg.org/j0qiscsw3/cream.png'); } you can use overlay div alpha channel on top of body under other elements. jsfiddle example <h1>i want blue color above texture</h1> <div id="cover"></div> body { background: url('http://i.stack.imgur.com/oslrb.png'); } h1{ position:relative; z-index:2; } #cover { position:absolute; top:0; bottom:0; left:0; right:0; background-color:rgba(109,179,242,0.5); z-index:1; }

Need help in packaging app using TideSDK on Windows -

i developed application using tidesdk on windows , when click launchapp works fine. moved package , installed imagemagick , wix 3.0 required packaging on windows. clicked on package runtime , cannot guess packaged app is? found file 'installer' in workspace when click on it says installer not find application path . think application not being packaged properly. here log see in tidesdk: preparing package desktop app runtime. 1 moment... staging trial -> copying contents d:\lab\tidesdk\trial d:\lab\tidesdk\trial\packages\win32\bundle\trial -> copying installer c:\programdata\tidesdk\sdk\win32\1.3.1-beta\installer d:\lab\tidesdk\trial\packages\win32\bundle\trial -> copying runtime d:\lab\tidesdk\trial\packages\win32\bundle\trial -> date: d:\lab\tidesdk\trial\packages\win32\bundle\trial\modules\app\1.3.1-beta -> date: d:\lab\tidesdk\trial\packages\win32\bundle\trial\modules\codec\1.3.1-beta -> date: d:\lab\tidesdk\trial\packages\win32\bundle\trial\mod...

testing - How do I test Angularjs factory stubbing $http? -

i have factory called songs fetches songs each second api: angular.module('pearljam') .factory('songs', function($http, $timeout, config){ var response = {list: []}; var onsuccess = function(result){ response.list = result.data.data; $timeout(poller, config.pollingtimeout); }; var poller = function(){ $http.get('api/songs.json', config.httpoptions).then(onsuccess); }; poller(); return {all: response}; }); i test it, , tried shown bellow think inject service in wrong way. when try run test outputs error: no pending request flush ! .it it's not making http calls. describe('songs', function(){ var httpstub, localservice; beforeeach(module('pearljam')); beforeeach(inject(function(_$httpbackend_, songs){ httpstub = _$httpbackend_; localservice = songs; })); it('lists songs', function(){ var httpresponse = { data: [1]...

Kendo UI ASP.Net MVC ForeignKey column DataSource in InCell Edit mode -

i have kendo grid , foreignkey column on page. foreignkey column populated using viewdata described below. column.foreignkey(x => x.productid, (list<product>)viewdata["products"], "id", "prodname"); the grid editable in batch(incell) mode show below... .editable(editable => editable.mode(grideditmode.incell) i want modify collection of productid column in grid after page loaded based on value selected on other drop-down defined outside of grid. how can achieve that? can using jquery? similar example found here... http://www.telerik.com/community/forums/aspnet-mvc/grid/cascading-dropdowns-in-grid-edit---foreignkey-columns.aspx thanks. i figure out on how filter product drop-down using editortemplate foreign key column. here column definition product. c.foreignkey(x => x.productid, (list<product>)viewdata["products"], "id", "prodname").editortemplatename("productideditor...

Python/Pyside: Own QFileIconProvider implementation fails with no exceptions thrown -

i tried create own qfileiconprovider class, want use qfilesystemmodel . ended code: class seiconprovider(qtgui.qfileiconprovider): def __init__(self): qtgui.qfileiconprovider.__init__(self) self.rsfileicon = qtgui.qicon(':images/rs-file.png') self.otherfileicon = qtgui.qicon(':images/newfile.png') self.foldericon = qtgui.qicon(':images/openfolder.png') def icon(self, type): if type == self.file: return self.rsfileicon if type == self.folder: return self.foldericon return self.otherfileicon def icon(self, info): if info.isfile(): return self.otherfileicon if info.isdir(): return self.foldericon return self.otherfileicon def type(self, info): if info.isdir(): return 'directory' return 'file' class folderview(qtgui.qtreeview): def __init__(self): qtgui.qtreeview.__init__(self) self.createcomponents() self.createlayout(...

sql - Echo HTML within PHP where to place quotes -

i'm doing wrong first line, quotes: <td><? echo"<a href='edit.php?id=" . "$row['adminuser_id']" . "'>edit</a>";?></td> should work works echo '<td><a href="edit.php?id=' . $row['adminuser_id'] . '">edit</a></td>'; as requested author, post answer. in of cases don't need echo html tags. better not. echo part, dynamically, in case - variable. as of php 5.5, shorthand echo tag <?= enabled default standalone tag, has nothing short tags <? disabled, can use without worries short echo achieve this: <td><a href="edit.php?id=<?=$row['adminuser_id'];?>">edit</a></td> of course, can use time way: <td><a href="edit.php?id=<?php echo $row['adminuser_id'];?>">edit</a></td> but in both cases, echo variable.

c# - Export Images in excel using OpenXml SDK? -

i facing problem while exporting multiple images in excel cell. doing in simple button click in page . using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; using system.data; using = documentformat.openxml.drawing; using xdr = documentformat.openxml.drawing.spreadsheet; using a14 = documentformat.openxml.office2010.drawing; using system.io; using documentformat.openxml.spreadsheet; using documentformat.openxml; namespace openxmlexport { public partial class _default : system.web.ui.page { public static string imagefile = httpcontext.current.server.mappath(@"~\data\sunset.jpg"); protected void page_load(object sender, eventargs e) { } protected void button1_click(object sender, eventargs e) { datatable table = gettable(); dataset ds = new dataset(); ds.tables.add(table); exportdata...