Posts

Showing posts from September, 2011

c++ - What is the best practice of using itoa() -

c++ - What is the best practice of using itoa() - when utilize itoa() needs char* _dstbuff, best practice here? #include "stdafx.h" #include <iostream> using namespace std; int main() { int num = 100; // i'm sure here no memory leak, needs know length. char a[10]; // causue memory leak? if yes, how avoid it? // , why can itoa(num, b, 10); excuted correctly since b // has allocated 1 char. char *b = new char; // difference between char *c , char *b // both can used correctly in itoa() function char *c = new char[10]; itoa(num, a, 10); itoa(num, b, 10); itoa(num, c, 10); cout << << endl; cout << b << endl; cout << c << endl; homecoming 0; } the output is: 100 100 100 so explain differenct between char *b = new char; , char *c = new char[10]; here? i know char *c dynamiclly allocate 10 chars, means char *b dynamically allocate 1 char, if i'm right this, why output...

sql - Alter CONSTRAINT or stored procedure only to check when insert not on update -

sql - Alter CONSTRAINT or stored procedure only to check when insert not on update - i want alter constraint starts stored procedure both when insert or update table. what want stored procedure activates on insert , not on update. is there way this? kind regards. --edit constraint not trigger...sorry that. sure create trigger insert trigger only, if show create trigger statement can show how so instead of create trigger test on table after insert, update .... you do alter trigger test on table after insert ....... sql sql-server stored-procedures

php - Creating a rich-text editor interface -

php - Creating a rich-text editor interface - i new html forms. trying create textarea has html interface (rich text editor interface). not have thought on how begin. using php , javascript on site. can please give me hint? you need javascript have rich text area. read link more details: http://superdit.com/2011/05/21/12-jquery-based-rich-text-editor/ php javascript html

linux - How to pass new messages to the thread function on run time? -

linux - How to pass new messages to the thread function on run time? - in pthread_create can specify 1 message, on run time may new messages need passed thread printing. one way may create global vector, , maintain on adding messages it. thread fetch vector , scan new messages. in way n vectors have created n threads! or 1 construction threadid, message, , print status. what possible practical ways out? edit 1: is next design fine or needs improvements? the next code written in normal function called main(). check if thread (responsible grabbing message) there. if yes, force message in thread's queue, wake thread (pthread_cond_signal()). if no, create thread, create queue, force message in queue. when thread finishes reading messages in queue, allow sleep (pthread_cond_wait()). google 'pthreads producer consumer queue'. should not need scan new entries - producer/s signal consumer thread new entries available. linux multithreading...

iphone - Objective-C NSMutableArray mutated while being enumerated? -

iphone - Objective-C NSMutableArray mutated while being enumerated? - i kinda stumbled error seek remove objects nsmutablearray while other objects beingness added elsewhere. maintain simple, have no clue on how prepare it. here i'm doing: i have 4 timers calling 4 different methods adds object same array. now, when press button, need remove objects in array (or @ to the lowest degree some). tried first invalidate 4 timers, , work want array, , fire timers. thought would've worked since not using timers anymore enumerate through array, seemingly doesn't work. any suggestions here? it's nil timers. because (i assume) timers working on same thread modifying method don't need stop , start them. ios doesn't utilize interrupt model timer callbacks, have wait turn other event :) you're doing like for (id object in myarray) if (somecondition) [myarray removeobject:object]; you can't edit mutable array while you're go...

How can I permanently enable in a firewall ruby packed in exe by ocra? -

How can I permanently enable in a firewall ruby packed in exe by ocra? - i wrote utility, sends messages on net , packed in exe file ocra. each time run exe firewall asks me whether should block or enable exe. it happens because when exe starts unpacks ruby.exe each time different tmp directory, firewall percieves ruby unknown program. how can manage ocra utilize same tmp path extracts ruby? there ruby way that? thank in advance. you seek using innosetup ocra create windows installer. ruby firewall

firefox - I am unable to access docShell for my browser element in xul? -

firefox - I am unable to access docShell for my browser element in xul? - <browser id="search" type="content-targetable" src="www.google.com"> </browser> javascript code // using script set property of browser element var x=document.getelementbyid('search'); x.docshell.allowauth="false" // code stops here x.docshell.allowplugin="false" //this not work as many xul tags, <browser> tag isn't inherently "special" - "special" functionality added xbl. of import thing xbl bindings added via css rules , these css rules apply element has inserted document. of import insert element first , access special properties after that. of course, in case asynchronous initialization might required improve like: class="lang-js prettyprint-override"> var browser = document.createelement(browser); parent.appendchild(browser); window.settimeout(initbrowser, 0); ...

javascript - How do I implement COMET on Azure with Node.JS? -

javascript - How do I implement COMET on Azure with Node.JS? - now microsoft ported node.js azure next thing need enable comet on platform? also, proper way host server? var sys = require('util'), http = require('http'); http.createserver(function (req, res) { settimeout(function () { res.setheader("200", {'content-type': 'text/plain'}); res.write('hello world'); res.end(); }, 2000); }).listen(8000); sys.puts('server running @ http://127.0.0.1:8000/'); you can utilize socket.io module. both long polling , websocket bindings work in azure worker role. in web role you're restricted long polls. javascript node.js azure comet

android - How to Display a picture from gallery -

android - How to Display a picture from gallery - i have gallery (this gallery mixed embedded component in linerlayout) presenting thumbnails. want , whenever user clicks on of image picture should displayed in total screen. please help me regarding this. you pass in image gallery , have display image. looking @ gallery manifest: <activity android:name="com.android.camera.imagegallery" android:label="@string/gallery_label" android:configchanges="orientation|keyboardhidden" android:icon="@drawable/ic_launcher_gallery"> <intent-filter> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <data android:mimetype="vnd.android.cursor.dir/image" /> </intent-filter> </activity> with i...

mono - System.Data.Sqlite (C#) vs. Sqlite (C) performance -

mono - System.Data.Sqlite (C#) vs. Sqlite (C) performance - situation: .net client app (c#, mono) downloads info web service (soap) , stores sqlite db. db interface system.data.sqlite under hood uses sqlite3.dll. the db (130 mb) has few dozens of tables. 1 table particularly big , takes 90% of db size - 10000 of records blob columns. (largest blob has 260k.) download on ipad takes 22 min. when commented out actual writing db, took 11 min, looks db takes 11 min, too. "db" mean layer above system.data.sqlite. don't know details yet. know db commands in transaction , there few transactions involved. (in other words transactions not problem.) when dumped db using sqlite shell , measured c code calls sqlite3_exec() dumped string (this code far beingness optimal), got 50 secs (ipad). means sqlite c code can create db fast. another interesting problem: download organized table table. tables (some of them having few mb) work ok. except largest table, download had...

html - w3 validator says all entities are invalid after final validation is corrected -

html - w3 validator says all entities are invalid after final validation is corrected - i going through corrections pages validate. got downwards 1 error left on page. after correcting error, next run of validator gave 29 errors, 1 each entity on page. illustration &nbsp; considered invalid. here 1 of error messages: line 67, column 12: entity 'nbsp' not defined. <h1>&nbsp;<a href="search-by-keyword.php?usertype=pri">m ... in add-on 1 other error following: line 1, column 6: xml declaration allowed @ start of document <?xml version="1.0" encoding="utf-8"?> but declaration. so test, reverted final error correction. after doing that, validator 1 time 1 time again says there 1 validation error in file. as side note, did find posting on web 2007 seeming study same situation. see http://lists.w3.org/archives/public/www-validator/2007jul/0140.html what's going on? the solution issue...

java - Hibernate JBoss eclipse(Helios) error getting the Hibernate Configuration Tool? -

java - Hibernate JBoss eclipse(Helios) error getting the Hibernate Configuration Tool? - using eclipse market install jboss hibernate configuration tools , receiving error? update site: http://download.jboss.org/jbosstools/updates/stable/helios i have found 32-bit jboss site though wont need. sorry couldn't include actual error using hibernate 3.0.5 using jdk 1.4 java.sql.timestamp handling configuring resource: /hibernate.cfg.xml configuration resource: /hibernate.cfg.xml datasourceconnectionprovider error any suggestions ways of sessionfactory (as mock object), help appreciated. thanks. do not select components, take much longer time download many unnecessary components. want hibernate tools only, select necessary related components only. from jboss tool can select those, all jboss tools -> hibernate tools application developmet -> hibernate tools data services -> hibernate tools maven back upwards -> jboss maven hibernate c...

python - Class inheritance: should constructors be compatible? case of multiple inheritance? -

python - Class inheritance: should constructors be compatible? case of multiple inheritance? - this question has reply here: should constructors comply liskov substitution principle? [closed] 3 answers one of recommended principles of object-oriented programming liskov substitution principle: subclass should behave in same way base of operations class(es) (warning: not right description of liskov principle: see ps). is recommended apply constructors? have python in mind, , __init__() methods, question applies object-oriented language inheritance. i asking question because useful have subclass inherit 1 or more classes provide nice default behavior (like inheriting dictionary, in python, obj['key'] works objects of new class). however, not natural or simple allow subclass used dictionary: nicer constructor parameters relate specific user subclass (for i...

android - how to get my arraylist string value? -

android - how to get my arraylist string value? - hi created xml based android app, used sax parser. have 1 doubt, uncertainty how parse arraylist value 1 activity activity. 1st explain project, first screen display 2spinner , 1 gird view. the 2 spinner , grid view display xml tag strings values, spinner display string values , gridview display images in spinner bottom. main screen. if select 1st spinner value automatically sec spinner , grid view change.... my doubts if click grid view images open 1 tab layout. add together 3 tab in tab layout. tab display empty screen, wish show text in 1st tab view. have stored strings value in arraylist arraylist name mspec_list. seek parse value 1 activity activity? if click images want show arraylist text in 1st tab that's please help me........ this main activity total source: public class parxmlactivity extends activity { private string array_spinner[]; private cursor cursor; private int columnindex; ...

dynamics crm 2011 - using CRM web service with HTML and javascript -

dynamics crm 2011 - using CRM web service with HTML and javascript - i found sample code in microsoft dynamics crm 4.0 sdk asking me next test soap call paste next code event detail properties dialog box. save form , click create form on preview menu. the web service can used after user authenticated. soap request contains crmauthenticationtoken passed in header. since cannot anonymous think service can consumed within "crm" is possible consume crm web services self hosted html file? html pages can consume web services uploading webresource. this link talks relative paths , simulating directories crm 2011 web resources: simulating directories , importance of relative paths this link talks using jquery consume web services using jquery in crm 2011 dynamics-crm-2011

c++ - Is the address of the first element of a vector fixed? -

c++ - Is the address of the first element of a vector fixed? - for illustration if this: vector<int> myvector; myvector.push_back(100); int * ptr = &(myvector[0]); myvector.clear(); myvector.push_back(10); will ptr still valid? or pointing garbage? 23.2.3 §4 says: a.clear() [...] invalidates references, pointers, , iterators referring elements of a , may invalidate past-the-end iterator. since there no such thing "un-invalidation", using ptr after clear results in undefined behavior. on side note, parenthesis in &(myvector[0]) not needed. postfix operators have higher precedence prefix operators in c++, writing &myvector[0] fine. c++ pointers stl vector

android - add TableRow (containing LinearLayout) to Table -

android - add TableRow (containing LinearLayout) to Table - i have complicated table, create 1 row little more flexible adding button or text view, have next code adding tablerow table. trying set linearlayout tablerow programmatically, row not show when run it. i'd appreciated if can point problem is. tablerow tr = new tablerow(this); tr.setlayoutparams(new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content)); final checkbox checkbox = new checkbox(this); checkbox.setpadding(10, 5, 0, 0); checkbox.settextsize(typedvalue.complex_unit_px, 15); checkbox.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { string item_clicked_on = (string) ((textview) view).gettext(); toast.maketext(getapplicationcontext(), item_clicked_on, toast.length_short).show(); } }); textview tv = new textview(this...

javascript - Vimeo JS API Issue // Fading/moving a div according to differerent video events and player_IDs -

javascript - Vimeo JS API Issue // Fading/moving a div according to differerent video events and player_IDs - what want to is: autoplay first movie, fadeout div "logo" , move div "menu" downwards (bottom:0 bottom:-56, horizontal reddish line @ viewable @ bottom) while playing -->works fadein div "logo" , move div "menu" when paused-->works when first video finishes, fade out, fade in div "logo", fade in sec video, (auto)play sec video, move div "menu" downwards 1 time again --> lastly 2 dont work :( , if video playing, hovering/clicking "collapsed"/moved viewable rest of div "menu" (the reddish line), should "uncollapse" or move 1 time again --> havent started that, sigh! these iframes, embedded in div: <iframe id="player_1" class="vimeo" src="http://player.vimeo.com/video/34799219?api=1&amp;player_id=player_1&amp;?title=0...

python - Converting a QTreeWidge in PyQt to a Table in ReportLab -

python - Converting a QTreeWidge in PyQt to a Table in ReportLab - as tables seem overly complicated in reportlab, i'm trying determine means add together (preferably through paragraph class, if possible) 2 separate texts, 1 on left side of page , other on right. much net find no seeming explanation of how accomplish this. if possible, how do it? at end i'm trying pull off converting info qtreewidget in pyqt pdf similar , feel. thanks in advance! it appear accomplishing best done through tables. though convoluted, learning construction of table info nested lists way go. key converting qtreewidget info goes along lines of codes below, in have dynamically append both info , cell styling work way through table data. assuming qtreewidget's composition items 2 columns of text (0, , 1), below works. from reportlab.lib.units import inch reportlab.lib.pagesizes import letter reportlab.platypus import simpledoctemplate, table, tablestyle pdf = simple...

javascript - opening a specific section on an accordion from another page link -

javascript - opening a specific section on an accordion from another page link - i have homepage has 2 titles on. these titles link page (news.aspx). news articles on news.aspx stored in accordion style. what want is: when title of news article clicked on homepage, redirect news.aspx page , accordion section relating title open. is there way can done please? i know need create function () im not sure how go it. put on load if (convert.toint32(request.querystring["lb"]) == 0) { myaccordion.selectedindex = 0; } else if (convert.toint32(request.querystring["lb"]) == 1) { myaccordion.selectedindex = 1; } here accordian <asp:accordion id="myaccordion" runat="server" selectedindex="0" head send index querystring of page redirecting. javascript jquery asp.net

hibernate - ID auto generation for MySQL on JBoss AS 7 -

hibernate - ID auto generation for MySQL on JBoss AS 7 - i need help resolve such problem. application needs back upwards several db (mysql, oracle). after migration jboss 7 entity id auto generation broken. etity example: @entity @table(name="foo") public class foo { private integer id; private string model; @id @sequencegenerator(name="foo_seq_gen", sequencename="foo_0", initialvalue=1, allocationsize=1) @column(name="id", updatable=false) @generatedvalue(generator = "foo_seq_gen") public integer getid() { homecoming id; } public void setid(integer id) { this.id = id; } @column(name="model", length=64, updatable=false) public string getmodel() { homecoming model; } public void setmodel(string model) { this.model = model; } } for oracle works fine. when trying perform create operation on mysql next error occures: ...

windows phone 7 - How to add monospaced text? -

windows phone 7 - How to add monospaced text? - i need monospace font in textblock windows phone 7 app working on. tried ones available , none of them seem monospace. how can this? i realized courier new monospaced , seems work pretty fine. windows-phone-7 textblock monospace

java - How to do Indian currency format in jstl format? -

java - How to do Indian currency format in jstl format? - how format numbers in jstl foramtnumber option. tried apply format pattern in <fmt:setlocale value="en_in" scope="request"/> <fmt:formatnumber type="currency" pattern="#,##,##0.00" groupingused="true" > <s:property value="%{#attr.total.column10}" /> </fmt:formatnumber> but displays value 23,233,400.00.. want 2,32,33,400.00. ho apply pattern. java struts2

android - RelativeLayout -> match_parent is not the same size with parent view -

android - RelativeLayout -> match_parent is not the same size with parent view - i've made simple application illustrate problem. brief explanation: app contains 1 activity. it's root view tablelayout. latter filled tablerow elements are, in turn, inflated "row.xml". here code: testactivity.java public class testactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); layoutinflater inflater=getlayoutinflater(); tablelayout table=new tablelayout(this); setcontentview(table); tablerow row; for(int i=0;i<3;i++){ row=(tablerow)inflater.inflate(r.layout.row, null, true); table.addview(row); } } } in row.xml tablerow root element, has kid - relativelayout. pay attending relativelayout's property android:layout_width="match_parent". row.xml: <?xml version="1.0" encoding="utf-8"?> <tablerow xmln...

iis 7 - ASP.net web services (.asmx) and parallel processing -

iis 7 - ASP.net web services (.asmx) and parallel processing - we have written web service method returns graphic images generated using microsoft wpf (hence sta model). working absolutely fine apart load balancing. when multiple user seek access @ same time, of users gets error message ( error 503). anybody knows how can improve handle multiple client requests (>1000)? can utilize parallel processing technique run threads on different cpu processor (64bit server 4 core processes) iis-7 asmx parallel-processing

java - How to display xml with two parent nodes -

java - How to display xml with two parent nodes - how generate xml using dom parser in java , shown below <result> <schma_index> <id>8</id> <name>raja</name> <schma_index> </result> above should display <massage>no privilege</mesaage> <result> <schma_index> <id>8</id> <name>raja</name> <schma_index> </result> you can't have 2 root elements in xml. read well-formed xml. can generate message , result xml's separately , concatenate them. however, parser's can't parse result xml. java xml

asp.net - AjaxControlToolkit Accordion: catching SelectedIndexChanged event with C# (CodeBehind) -

asp.net - AjaxControlToolkit Accordion: catching SelectedIndexChanged event with C# (CodeBehind) - i have accordion command 2 accordionpane (each 1 1 label testing) want grab event raised when new pane clicked on open (my thought testing is, when pane open, label within him alter text property --to like: "i catched event pane index : {}"). is there way grab event? (i read on js, need in c#(codebehind)) c# asp.net events ajaxcontroltoolkit accordion

c# - Unable to load level data in WP7 -

c# - Unable to load level data in WP7 - i discovered problem getting levels load in wp7. issue has isolated storage , how wrote data. i have level editor wrote windows pc game. levels saved directory specify. read on how wp7 deals reading/writing files, , it's turning out big issue, because there's no way wp7 can search directory containing levels. basically, hoping create levels using 1 program, , utilize separate programme (the actual game) load these files. these questions: -how can go getting wp7 game locate levels? seek isolated storage path name, it's not guaranteed same every time, it? -do have re-write editor windows phone game create work properly? if issue transfering files desktop level editor phone, can add together files straight visual studio solution, , set compile type embedded resource. can list them , load them dynamically code. how can list of embedded resources defined in application? c# windows-phone-7 xna

c++ - Reading formatted input from an istream -

c++ - Reading formatted input from an istream - the problem below has been simplified real requirements. consider next program: #include <iostream> #include <iterator> #include <string> #include <set> #include <algorithm> using namespace std; typedef string t; // simplify, consider t string template<typename input_iterator> void do_something(const input_iterator& first, const input_iterator& last) { const ostream_iterator<t> os(cout, "\n"); const set<t> words(first, last); copy(words.begin(), words.end(), os); } int main(int argc, char** argv) { const istream_iterator<t> is(cin), eof; do_something(is, eof); homecoming 0; } the programme extracts words istream ( cin ) , them. each word seperated white space default. logic behind formatted extraction within istream_iterator . what need pass do_something() 2 iterators extracted words separated punctuation character inst...

java - Android Multitouch - Second Finger ACTION.MOVE Ignored -

java - Android Multitouch - Second Finger ACTION.MOVE Ignored - the next code i've been trying utilize multitouch. finger 1 set correctly , moves around when drag finger. finger 2 shows , disappears when touch , release finger, never moves around. thought what's wrong? i have read developers blog still not understand issues are. @override public boolean ontouchevent(motionevent event) { int action = event.getaction() & motionevent.action_mask; int pointerindex = (event.getaction() & motionevent.action_pointer_id_mask) >> motionevent.action_pointer_id_shift; int pointerid = event.getpointerid(pointerindex); switch (action) { case motionevent.action_down: case motionevent.action_pointer_down: if (pointerid == 0) { fingeronedown = 1; fingeronex = event.getx(pointerindex); fingeroney = event.gety(pointerindex); } ...

Visual Studio 2010 keyboard shortcut to open context menu on document tab -

Visual Studio 2010 keyboard shortcut to open context menu on document tab - is there keyboard shortcut show context menu document tab - same document tab right click? note: not same shift + f10 brings main context menu. thanks i looking thing quite time , accidently opened menu today using keyboard. command "window.showdockmenu". default key binding (at to the lowest degree in vs 2012) "alt + -". visual-studio-2010

tsql - T-SQL multiple order by clauses -

tsql - T-SQL multiple order by clauses - is possible have multiple order clauses in select statement? can this? select top(5) * [db].[dbo].[schedules] (datepart(hour, [arrival]) >= datepart(hour, getdate())) order abs( (datepart(hour, [arrival]) - datepart(hour, getdate()))*60 + datepart(minute, [arrival]) - datepart(minute, getdate())) order [arrival] reason need sec order ensure records returned in increasing arrival times. tia. use comma separated list: select top(5) * [db].[dbo].[schedules] (datepart(hour, [arrival]) >= datepart(hour, getdate())) order abs( (datepart(hour, [arrival]) - datepart(hour, getdate()))*60 + datepart(minute, [arrival]) - datepart(minute, getdate()) ), [arrival] tsql sql-order-by

How to structure my Android timer app with thread? -

How to structure my Android timer app with thread? - i'm trying create simple workout timer android. user creates workoutplan containing info such total duration, total rest time, etc, app display timer updates every second. pretty simple begin with, i'm trying build app possible, i.e. separation of concern, right techniques, responsive ui, ensure timer accurate, etc. here's simplification of have far: workoutplan , user can load/save different workout plans timer public class workoutplan { public long duration; } timerthread , class implements runnable , takes in workoutplan in constructor, start/stop, shows elapsed time. public class timerthread implements runnable { public boolean running = false; private long laststarttime; private long savedtime; private workoutplan plan; private handler handler; public timerthread(workoutplan p, handler h) { plan = p; handler = h; } public synchronized void ...

haskell - State Monad ExampleProblem -

haskell - State Monad ExampleProblem - i working on problem , had asked related question. implementation of state monad farther refine code tried implement using 1 increment function. module stateexample import control.monad.state info globstate = globstate { c1 :: int, c2:: int, c3:: int} deriving (show) newglobstate:: globstate newglobstate = globstate { c1=0,c2=0,c3=0 } incr :: string-> state globstate () incr x = modify(\g -> g {x =x g + 1}) main:: io() main = allow a1= flip execstate newglobstate $ incr c1 incr c2 incr c1 print but here getting error `x' not (visible) constructor field name how can remove error? you have nail weakness in haskell: records not first class values! indeed, nice write have done, not possible. however, can utilize different libraries accomplish desired effect. how looks if utilize fclabels: {-# language templatehaskell, typeoperators #-} module stateexample import c...

c# - Matrix / coordinate transformation order -

c# - Matrix / coordinate transformation order - i have 2 array of points: point [] original; , point [] transformed; these transformed array re-create of original transformations applied. example: matrix.rotate(5f); matrix.scale(.8f, 1.1f); matrix.translate(30f, 18f); matrix.transformpoints(transformed); the original points are known. the transformation values are known. the order in transformations applied not known. how can calculate / infer order of transformations? edit there 1 round of transformation. a round contain @ 3 transformations below. the transformations applied combination on rotate, scale , translate. to give real-world context, consider having image known points of interest. print image, scan , seek read again. image contains orientation markers allow me calculate transformations applied during scanning process. now, brute forcefulness approach be: read scanned image. calculate rotation on scanned image. apply rotation on scanned...

mercurial - hg diff calling kdfif3 instead of outputting text -

mercurial - hg diff calling kdfif3 instead of outputting text - is possible run kdiff3 instead of outputting text when run hg diff ? can either switch or setup allows hookup kdiff3. you should extdiff extension. allows create new diff commands can launch external diff tools, such kdiff3. you configure like: [extdiff] cmd.vdiff = kdiff3 and can utilize hg vdiff graphical diff using kdiff3. strangely, extension doesn't allow overload normal hg diff command — lets add together new commands. mercurial

java - generic return object -

java - generic return object - recently reading next piece of code oracle collection tutorial when came across piece of code. public static <e> set<e> removedups(collection<e> c) { homecoming new linkedhashset<e>(c); } i not able understand why returned value <e> set<e> , not set<e> ? the homecoming type is, in fact, set<e> . the other <e> there indicate generic method, , state e parameter generic. without <e> , compiler assume e existing class, , seek locate (producing error if no class named e in scope). java collections

jquery - How to namespace methods that do not belong in the actual plugin? -

jquery - How to namespace methods that do not belong in the actual plugin? - i got extension points in plugin provide default implementations for. objects not belong in methods object should still namespaced properly. how namespace extensions? i tried this: (function ($) { var pagemanagers = {}; var thememanagers = { }; thememanagers.notheme = { some: function() { } // , more. } var methods = { // of methods } $.fn.griffintable = function (method) { if (methods[method]) { homecoming methods[method].apply(this, array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { homecoming methods.init.apply(this, arguments); } else { $.error('method ' + method + ' not exist on jquery.griffintable'); } homecoming this; }; })(jquery); but can't figure out how access pagemanagers...

iOS - How to create views from Core Data entities -

iOS - How to create views from Core Data entities - i have implemented core info in app, , i'm trying figure out best way create views model objects. my cat model object has these properties: @property (nonatomic, retain) nsstring * image; @property (nonatomic, retain) nsstring * title; @property (nonatomic, retain) nsstring * desc; i want create cat view displays image uiimage, , displays title , description labels. need utilize model proxy? think kvo involved well. know of tutorial this? seems mutual task tutorials can find core info , not explain how create view objects data. one way create catviewcontroller (extending uiviewcontroller, of course) , define custom init method takes "cat" object parameter. save "cat" object property. then, in "viewdidload" method, set views labels , image using info in cat object. @synthesize cat, titlelabel, desclabel, imageview; - (id)initwithcat:(cat *)acat { self = [super init];...

android - Java: calling outer class method in anonymous inner class -

android - Java: calling outer class method in anonymous inner class - recently, ran mysterious problem in android project, described here. somehow solved problem, still don't know exact reason behind it. let's want phone call function foo() in inner class. question is, what's difference between calling straight like foo(); or calling outer class instance outerclass.this.foo(); besides, appreciate if can check lastly question related this, , give me clue why error occurs. many thanks. ps: read somewhere non-static inner class hold instance of outer class. phone call outer function using instance if utilize foo()? the latter more explicit , allow phone call outer class method if 1 exists in inner class same name. class outerclass { void foo() { system.out.println("outer foo"); } view.onclicklistener mlistener1 = new view.onclicklistener() { void foo() { system.out.println("inner foo"); } @overr...

iphone - twitter ios5 integration autorize with custom login and password -

iphone - twitter ios5 integration autorize with custom login and password - i want ios5 application post tweets. i'm using standard code reywenderlich's tutorials: -(void)postontwitter:(id)sender { nslog(@"postontwitter: called"); if ([twtweetcomposeviewcontroller cansendtweet]) { twtweetcomposeviewcontroller *tweetsheet = [[twtweetcomposeviewcontroller alloc] init]; [tweetsheet setinitialtext:@"tweeting ios 5 tutorials! :)"]; [self presentmodalviewcontroller:tweetsheet animated:yes]; } else { uialertview *alertview = [[uialertview alloc] initwithtitle:@"sorry" message:@"you can't send tweet right now, create sure device has net connection , have @ to the lowest degree 1 twitter business relationship setup" delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil]; [alertview show]; }; } everything fine, code work if have twitter busin...

How to check if current time falls within a specific range on a week day using jquery/javascript? -

How to check if current time falls within a specific range on a week day using jquery/javascript? - when user visits page need check if current time falls between 9:00 , 5:30pm on weekday , display using jquery/javascript.but not sure how can check that. could please help? thanks this should help: function checktime() { var d = new date(); // current time var hours = d.gethours(), var mins = d.getminutes(); var day = d.getday(); homecoming day >= 1 && day <= 5 && hours >= 9 && (hours < 17 || hours === 17 && mins <= 30); } javascript jquery datetime weekday

c# - Synchronize row heights in custom wpf datagrid -

c# - Synchronize row heights in custom wpf datagrid - i want visually represent info in columns, rather row representation of datagrid. think of info list<column> column contains list<cell> . reason not transpose info , utilize datagrid want have ability add/remove columns dynamically, without having process of data. +--------------------------------------------+ | | col header | col header | ... | | row header | cell | cell | ... | | ... | ... | ... | ... | +--------------------------------------------+ i have sample of xaml pretty much want: <stackpanel orientation="horizontal"> <stackpanel orientation="vertical" verticalalignment="top"> <textbox text="" isreadonly="true" borderthickness="0" horizontalalignment="stretch"/> <textbox text="" isreadonly="true" borderthickness="0,...

java - How to get bounds of Google Map? -

java - How to get bounds of Google Map? - i need next task: there google map widget , user can move/zoom map. when user click button application should show latitude & longitude of bounds of gmap (north-east corner , south-west corner). don't know how can it. hope can help me. give thanks for, anyway. this should it actually meant geopoint tlgpt; // top left (nw) geopoint geopoint brgpt; // bottom right (se) geopoint geopoint trgpt; // top right (ne) geopoint geopoint blgpt; // bottom left (sw) geopoint tlgpt = mapview.getprojection().frompixels(0, 0); brgpt = mapview.getprojection().frompixels(mapview.getwidth(), mapview.getheight()); trgpt = mapview.getprojection().frompixels(mapview.getwidth(), 0); blgpt = mapview.getprojection().frompixels(0, mapview.getheight()); first post gave nw , se - gives 4 corners java android

unicode - how i can import font in my android? -

unicode - how i can import font in my android? - i want utilize unicode characters in textview.how import x.ttf? , x? typeface face=typeface.createfromasset(getassets(), "fonts/x.ttf"); getinput.settypeface(face); ttf font format. x name of file. how import specific font in android app exist lot of tutorials on internet. example android unicode special-characters android-textview

eclipse - Mylyn Trac connector does not show "Severity" attribute in query editor -

eclipse - Mylyn Trac connector does not show "Severity" attribute in query editor - we decided start using severity field in our trac project. however, can't figure out way create field appear in query editor mylyn plugin eclipse - whatever try, field not there. it show in web interface, , if open task in mylyn can set severity there (so @ point mylyn does understand attribute beingness used) doesn't appear in query dialog. i have made sure tasks have severity set. restarted eclipse synchronized repository hit "update attributes repository" several times reinstalled mylyn without success. more there try? clarification: not editing tickets. it's querying tickets repository, using right-click in task list -> "new query...". this form see looks like: i want field severity in there somewhere too. you have obtain source tracquerypage.java , add together list "severity". http://grepcode.com/file/reposi...

Gnuplot xrange not really a range? -

Gnuplot xrange not really a range? - i seek create plot on gnuplot has no real range order on x-axis. ---------------------> 1 4 2 20 17 12 10 8 it's hence not real function interpret math knowledge, has sort of index on x-axis has no numbering order , runs 1-20 20 first, or in middle.. may mixed.. hope understand mean cause hoping gnuplot can handle that. maybe can write info file point 2 contains info should there on y-axis , move labels around on x-axis? you e.g. write datafile "data" containing such values 1 1.5 4 2 2 3.2 20 2.2 17 0.4 12 4.3 the sec column "y-values", first column labels of x-axis (xtics) now seek plot info with: plot './data' u 2:xticlabel(1) is want? gnuplot

iOS - Converting HTML to Normal text -

iOS - Converting HTML to Normal text - in application, i'm receiving html file news server. after receiving, want remove tags, images, url anchors, etc , show text in text view. there's website functions similar 1 i'm looking for. website takes html input , removes tags , displays plain text result. want accomplish similar function in app , display text news received. any libraries or open source web services available this? there library here, this: nsstring *htmlstripped = [[nsattributedstring attributedstringwithhtml:data_for_my_html options:nil] string]; html ios text html-content-extraction

tsql - How to optimise paging in SQL Server when you order by a non indexed field -

tsql - How to optimise paging in SQL Server when you order by a non indexed field - i have read , followed instructions here: what efficient method of paging through big result sets in sql server 2005? , becomes clear i'm ordering non-indexed field - because it's generated field calcuations - not exist in database. i'm using row_number() technique , works pretty well. problem stored procedure pretty big joins on fair bit of info , i'm ordering results of these joins. realise each time page has phone call entire query 1 time again (to ensure right ordering). what (without pulling entire result set client code , paging there) 1 time sql server got whole result set page through that is there built-in way accomplish that? - thought views might can't find info on this. edit: indexed views not work me need pass in parameters. got more ideas - think either have utilize memcached or have service builds indexes in background. wish there way sql ser...

php - Using Zend Framework Inside Drupal -

php - Using Zend Framework Inside Drupal - i have issue project working on, whole application runs drupal 6 install, , bootstrapping zend framework application pull out info need (which create available in various views via module create). i have bulk of working correctly, issue having sessions, actual error getting follows :- php fatal error: uncaught exception 'zend_session_exception' message 'session has been started session.auto-start or session_start()' which think happening because drupal setting session , zf trying setup own sessions , clashing. there way can override/extend default zend session handling allow utilize drupal session api? thanks rich are going storing info in zend session? if not, away starting zend session completely, or @ to the lowest degree conditionally skip starting zend session if session has been started. if do, not able start or utilize zend_session* related functions (zend_session, zend_session...

Is it possible to pass in PHP variables into a custom Listener for PHPUnit if the Listener is defined in phpunit.xml? -

Is it possible to pass in PHP variables into a custom Listener for PHPUnit if the Listener is defined in phpunit.xml? - situation i may not using phpunit in traditional sense. i'm using phpunit selenium 2. had thought record actions selenium performing in "steps reproduce" sort of way. meaning if phone call selenium "click" or "type", action recorded. if action fails, recorded. aren't calling asserts setup-type actions. example, if we're testing page view client information, before can page need login, don't assert login actions, assert final part when have view client information. now when assert, want record result. created custom listener capture result. problem we're having how send result our action recorder. i ran phpunit test so: class sandboxtest extends phpunit_framework_testcase { /* tests */ } $steptracker = new qa_steptracker(); // our custom action recorder $suite = new phpunit_framework_testsuite(...

php trim a string -

php trim a string - i'm trying build function trim string it's long per specifications. here's have: function trim_me($s,$max) { if (strlen($s) > $max) { $s = substr($s, 0, $max - 3) . '...'; } homecoming $s; } the above trim string if it's longer $max , add together continuation ... i want expand function handle multiple words. does, if have string say: how today? 18 characters long. if run trim_me($s,10) show how yo... , not aesthetically pleasing. how can create adds ... after whole word. if run trim_me($s,10) want display how you... adding continuation after word. ideas? i pretty much don't want add together continuation in middle of word. if string has 1 word, continuation can break word only. so, here's want: <?php // original php code chirp internet: www.chirp.com.au // please acknowledge utilize of code including header. function mytruncate($string, $limit, $break="....

c# - Linq - getting a value that is between a lower limit and upper limit -

c# - Linq - getting a value that is between a lower limit and upper limit - i have list of fees (linq sql entity- if relevant) - upper fee, lower fee (both decimal values). passing in property value - 90000 , want check if property value best matches one (or first value out of many) list of fees. the fees like... (lower fee - upper fee) 0 - 50000 50001 - 75000 75001 - 90000 90001 - 140000 190000 - 500000 out of these values, 90000 best matched 75001 - 90000 band, want pull out feedetail entity. dont know operator use, help appreciated, code far is... [test] public void getfeerange() { const int id = 44; var propvalue = 90000; //get specific fee entity, range of fee details... var recommendedfees = reposession.all<fee>() .where(x => x.clientsurveytypeid == id) .groupjoin(_readonlysession.all<feedetail>(), x => x.feeid, ...

How do I tell NuGet that I do NOT want a particular dependancy from a package? -

How do I tell NuGet that I do NOT want a particular dependancy from a package? - there's particular bundle project on nuget. however, bundle author has decided include several dependant packages don't care , not required main package. have tried convincing bundle author these should separate packages , not dependancies - no avail. is there way tell nuget want bundle exclude dependancy? perhaps in packages.config or similar? <?xml version="1.0" encoding="utf-8"?> <packages> <package id="somepackage" version="1.0.0"> <ignoredependancy id="somepackage.uselessstuff" /> </package> </packages> i figured out. install-package -ignoredependencies or uninstall-package -force nuget

rails console get all -

rails console get all - i have simple question rails console, if want single business relationship this: y account.find_by_zipcode("xxxxx") this returns me 1 account, if want accounts have zipcode. lot. have tried account.find_all_by_zipcode('xxxxx') ? ruby-on-rails rails-console

Ban a URL from showing up in Google Analytics -

Ban a URL from showing up in Google Analytics - all, there website doesn't seem legitimate , keeps showing of these page views in google analytics. there way ban urls beingness processed in google analytics? you can create ip address not show adding filter. please @ http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=55481, though talks excluding internal addresses, should work guide how "difficult" site too. edit: filter on referrals need create custom filter. see http://support.google.com/googleanalytics/bin/answer.py?hl=en&answer=55492 guide. http://support.google.com/analytics/bin/answer.py?hl=en&topic=1034830&answer=1034842 talks excluding referrers. note filters deed on future data, referrals collected still show up. google-analytics

How to automate gmail to send email by using Selenium? -

How to automate gmail to send email by using Selenium? - i'm trying automate gmail selenium automatically send email proof of concept boss, can't create click on send button. could help me? to attach file, seek next se ide code: <tr> <td>click</td> <td>//span[text()='attach file']</td> <td></td> </tr> <tr> <td>type</td> <td>css=.liodqc</td> <td>c:\path\to\file.txt</td> </tr> updated entering info in 'to', 'subject', attachment, mail service body , sending mail: <tr> <td>type</td> <td>name=to</td> <td>surya.dixit@gmail.com</td> </tr> <tr> <td>type</td> <td>name=subject</td> <td>testsubject</td> </tr> <tr> <td>click</td> <td>//span[text()='attach file']...