Posts

Showing posts from July, 2015

asp.net mvc - JQUERY GET operation not working -

i'm having trouble following jquery script $('#extra_data').append('<div id="tabs-' + (tab_length + 1) + '"></div>'); $.get(url, function(data) { $('#tabs-' + (tab_length + 1)).html(data); }); my trouble $.get(..) operation doesn't return results - although when using firebug shows ajax call expected. any clues? thanks. controller <httppost()> _ function getpartialview() actionresult if (request.isajaxrequest()) return view("pvtest") else return view() end if end function i've filtered request if ajax. can pass object partial view. jquery <script type="text/javascript"> $(document).ready(function() { $.ajax({ type: 'post', url: 'home/getpartialview', data: {}, datatype: 'json', beforesend: function(xmlhttprequest) {

.net - need help in linq -

i need in linq from refoffence in ref_offencecodes join offencecodematrix in inf_offencecodematrixes on refoffence.offencecodeid equals offencecodematrix.offencecodeid refoffence.code=="1909" select new {offencecodematrix.standardpenaltyunits * offencecodematrix.standarddollaramount } i need muliplication of standardpenaltyunits , standarddollaramount result. please debug query. well, 1 problem you're trying create anonymous type multiplication operation, you're not specifying name. why using anonymous type @ all? try: from offencecode in ref_offencecodes join codematrix in inf_offencecodematrixes on offencecode.offencecodeid equals codematrix.offencecodeid offencecode.code=="1909" select codematrix.standardpenaltyunits * offencecode.standarddollaramount however, it's hard tell what's wrong provided failing code, without indication of way in it's failing. final line was problem, may not have been one.

working with dropdownlist in asp.net c# -

i have 2 dropdownlist in asp.net c#, 1 has 2 items in it('ok' 'pk') , other 1 bound database field , has 158 items in it. i want remove 2 items second list when user selects 'ok' , keep original list when user selects 'pk'. how can it?? have bound second list database there property can hide values in list?? first, dropdownlists have remove option. like ddl.items.remove(ddl.items.findbyvalue("value")); another way not select items list. refers question "hide" database values after retrieving. take use dropdownlists below: dropdownlist1.datasource =ds.tables[0]; // list of items retrieved db if display subset of table retrieve records need database using whatever db connection options have. instance after user selected ok use pseudo code below: // full list allitems = db.getallitems(); selecteditems = allitems.where(p => p.itemid != itemid1 || itemid2); dropdownlist1.datasource = selecteditems; and rest

join - the role of index in performance in mysql -

why defining index mysql tables increase performance in queries haveing join? if interested in specific topic in book, go of book , find alphabetically in index. index tells page number(s) topic discussed. jump straight pages interested in. much, faster reading whole book. it's same in database. index means can jump joining rows instead of scanning every row in table looking match. have @ how clustered index works ( http://msdn.microsoft.com/en-us/library/ms177443.aspx ). can have 1 of per table. this artical explains how non clustered index works ( http://msdn.microsoft.com/en-us/library/ms177484.aspx ). can have many of them want. both of these articles microsoft sql server, theory behind indexes same across relational database management systems. indexes have associated cost. every time insert/update performed on table, effected index(es) may have updated also. , of course indexes take space - not issue of us. need balance performance benefits of faster jo

java - Operational Transform Implementation (not javascript) -

i'm looking implement multi-user operational transform plain-text based changes on server-side on web-site. is there non-javascript implementation can recommend? consider google-diff-match-patch - diff, match , patch libraries plain text: "the diff match , patch libraries offer robust algorithms perform operations required synchronizing plain text." diff: compare 2 blocks of plain text , efficiently return list of differences. diff demo match: given search string, find best fuzzy match in block of plain text. weighted both accuracy , location. match demo patch: apply list of patches onto plain text. use best-effort apply patch when underlying text doesn't match. patch demo available in java, javascript, c++, c#, objective c, lua , python. regardless of language, each library features same api , same functionality. versions have comprehensive test harnesses. you can find here .

CREATE INDEX in SQL Server 2008 not result in "visible index" -

Image
i using sql server 2008 express. in db in question, there 1 schema: dbo. if run following script: create unique index ix_clientsocialtypes_cover on clientsocialtypes(clientid, socialtypeclassid, [source]) include (urlid); ... executes ok, cannot see index when go db diagram , view indexes table. further, "includes" field grayed out, when specify non-clustered index (hence use of script). any ideas? where trying see index? did refresh database diagram after creating index? update: ok, seems in diagram editor, cannot define included columns (always grayed out - in full ssms, on sql server 2008 r2 dev edition). but in table designer (right-click on (your table name) > indexes > new index in object explorer), it's totally visible , usable....

java - Horizontal and vertical scrollbar in Android with tablelayout? -

please me if know how add both scrollbar. first of clear all. added both scroll bar in tablelayout main problem m using dynamic data filling tablerow. so, if there 1 record horizontal scroll view top after data. want show horizontal in bottom , show vertical. prashant use code.. <scrollview android:id="@+id/scrllvwno1" android:layout_width="fill_parent" android:layout_height="fill_parent"> //textview //button </scrollview> </linearlayout>

vba - ADODB RecordSet as Access Report RecordSource -

i have simple form, query , report in access 2003. have manipulate results query in recordset using vba , pass on report recordsource. if declare recordset recordset , use name property recordsource of report working. however, because need edit recordset, though easier use adodb recordset below. the records set declared dim rs adodb.recordset in global module. rest of code is; dim db database set db = currentdb dim con adodb.connection set con = currentproject.connection set rs = new adodb.recordset set rs.activeconnection = con rs.source = "select * xxx" rs.locktype = adlockoptimistic rs.cursortype = adopenkeyset rs.open 'manipulate rs here....' i used pass recordsource of report myreport.recordsource = rs.name. adodb doesn't have name property. how can pass recordset report recordsource? thanks you cannot bind report ado recordset in mdb, in adp: http://support.microsoft.com/?id=287437

Display Magento Category Image -

generally, top menu list out sub-category's name, want list out sub-category's image. can advise php code. thank you it can done adding additional attribute frontend categories attributes load list via config.xml: <frontend> <category> <collection> <attributes> <[attribute_code] /> </attributes> </collection> </category> </frontend> just replace [attribute_code] image attribute code (maybe in case image ) and able access category image via $category->getimage() , possible need override mage_catalog_block_navigation block custom html formating of menu. when complete customization, don't forget clean cache , rebuild flat categories index (if used).

wpf - C# Winforms.ReportViewer - can I have my custom build parameters UI? -

i have rendered test report using winforms.reportviewer in wpf app.... now want removed 'default' parameter panel , build own ui , pass parameters programmatically. i see example how use serverreport.setparameters method. need hide default ssrs parameters ui . sql2008, c# 4.0 to hide parameters in report. open report. in designer mode, right click 'outside of report'. you should notice option " report parameters " select all parameters (which appears in list @ left) 1 one , uncheck ' hidden ' check box. to hide parameters panel in rendered report, have hide parameters.

git - No submodule mapping found in .gitmodule for a path that's not a submodule -

i have project has submodule @ lib/three20 my .gitmodule file looks this: [submodule "lib/three20"] path = lib/three20 url = git://github.com/facebook/three20.git i have cloned in past without errors, ( git submodule init followed git submodule update ) , it's been working while. i tried clone new machine, , i'm getting error on git submodule init : no submodule mapping found in .gitmodules path 'classes/support/three20' that path empty folder in xcode use house projects other directory. it's not part of .gitmodules file, don't see it's getting path from. any ideas? update november 2013: following rajibchowdhury 's answer (upvoted), git rm advised removing special entry in index indicating submodule (a 'folder' special mode ' 160000 '). if special entry path isn't referenced in .gitmodule (like ' classes/support/three20 ' in original question), need remove it, in orde

asp.net - Tracking Down Mysterious Errors -

i have rather complex legacy asp.net application under continuous development, , 1 client has started erroring recently. the application uses asp.net 3.5 , c# on server side, backed sql server 2005 , iis6. the application utilises microsoft asp.net ajax libraries , devexpress components. we have comprehensive logging platform in place, via page_error handler in custom page base, logs unhandled exceptions , displays nice error page. the problem is, 1 client has started getting errors cannot trace - nothing logged, despite nice error page being displayed. no exceptions caught , handled page_error handler, method redirects users error page - , no redirection happens without error being handled. i have added client side javascript asp.net ajax pagescriptmanager endrequesthandler javascript handler logs clientside errors wide open ashx logging script. the errors client side catches follows: sys.webforms.pagerequestmanagerservererrorexception: unknown error occurred while

php - get parameters from $_SERVER['HTTP_REFERER'] -

i want value http_referer in same/similar way you'd request: $this->_getparam('order', 0); i thought i'd try this: $lastrequest = new zend_controller_request_http($_server['http_referer']); $lastorder = $lastrequest->getparam('order', 0); but doesn't work. there no parameters. getparams returns empty string. missing? there better way this? thanks! this bad idea. on top of justin pointed out , it's easier pass values on new page directly rather trying parse them referrer.

.net - Parametrized query as String -

in project need log queries executed against database. example can use staff user data here. in class have function generating command parameters follows: public function sqlupdate(byval conn sqlclient.sqlconnection) sqlclient.sqlcommand implements idbconnected.sqlupdate dim sqlstatement string = "update persons set active=@act, abbreviation=@abbr, firstname=@first, lastname=@last, " & _ "birthday=@bday, email=@email,tel=@tel, fax=@fax, registered=@reg, admin=@adm" sqlstatement &= " id=" & me.id dim comm new sqlclient.sqlcommand(sqlstatement, conn) comm.parameters .add("@act", sqldbtype.bit).value = me.active .add("@abbr", sqldbtype.varchar).value = me.abbreviation .add("@first", sqldbtype.varchar).value = me.firstname .add("@last", sqldbtype.varchar).value = me.lastname .add("@bday", sqldbtype.smallda

dll - Different platform AppDomains in one .Net process? -

i interesting in: can load 32bit x86 dll second appdomain 64 bit application environment? for more details: 1) main exe 64 bit c# pure .net 4 app; 2) module third party .net 2.0 wrapper of unmanaged x86 dll; so can create second 32bit appdomain in 64bit .net 4 process , load 32bit module new created 32bit appdomain? , marshal between default 64bit appdomain , second 32bit appdomain? thank advice! that's not possible, bitness process property, not appdomain property. make work, you'll need load dll in separate process. use standard .net ipc mechanisms talk it. named pipes, sockets, remoting, wcf. or force platform target setting x86.

Delphi: Call a function whose name is stored in a string -

is possible call function name stored in string in delphi? please give more details on trying achieve. as far know: it not possible call random function that. for class , object functions (myobject.function) can done rtti, it's lot of work. if need call 1 particular type of functions (say, function(integer, integer): string), it's lot easier. for last one, declare function type, function pointer , cast this: type tmyfunctype = function(a: integer; b: integer): string of object; tmyclass = class published function func1(a: integer; b: integer): string; function func2(a: integer; b: integer): string; function func3(a: integer; b: integer): string; public function call(methodname: string; a, b: integer): string; end; function tmyclass.call(methodname: string; a, b: integer): string; var m: tmethod; begin m.code := self.methodaddress(methodname); //find method code m.data := pointer(self); //store pointer object instance re

Different images for different resolutions in HTML resources in Android -

how display different images different screen resolutions (hdpi, ldpi, mdpi) in embedded html resource of android app? the html resource located in assets , can changed if necessary. if not possible, how change display size of image based on screen resolution? /* mdpi resources midium-density (mdpi) screens (~160dpi). css medium density (mdpi) android layouts in here webkit-device-pixel-ratio:1 */ @media screen , (-webkit-min-device-pixel-ratio: 1), screen , (min--moz-device-pixel-ratio: 1), screen , (min-resolution: 160dpi) { .title { text-align: center; vertical-align: middle; color: white; font-size: 1.25em; } } /* high density resources (hdpi) screens (~240dpi). css high density (hdpi) android layouts in here webkit-device-pixel-ratio:1.5 */ @media screen , (-webkit-min-device-pixel-ratio: 1.5), screen , (min--moz-device-pixel-ratio: 1.5), screen , (min-resolution: 240dpi) { .title {

java - Compass Lucene hits -

i use lucene , compass on , have problem: try { compasshits hits = compassquery.hits(); (compasshit compasshit : hits) { if (results.size() >= maxresults) { log.info(this, "number of results exceeded %,d query %s", maxresults, query); break; } else { results.add((t) compasshit.getdata()); } } } when data geting compasshit.getdata()); , it's 100 hit re-execute search, there possibility change 200 or more? edit: from wiki apache org: "iterating on hits slow 2 reasons. firstly, search() method returns hits object re-executes search internally when need more 100 hits". and question there opportunity change value "100" "200"? important use compass nor raw lucene. i looked @ source hits in 2.9.2. it's hard coded. looks it's hard coded hits(searcher s, query q, filter f) throws ioexception { this.weight = q.weight(s);

actionscript 2 - Flash player 10 XML and AS2 problem -

i having trouble less (<) symbol in recent version of flash player as2 app. have xml contains strings of html text passing text field code below shows. in browser text after &lt; disappears(even if shows on machines player). know if replace &lt; &lt; work not option. have suggestion. var internalxml:xml = new xml("<annotation><![cdata[<p align='left'><font letterspacing='0' kerning='0'>this visible text &lt; text dissapear</font><p>]]></annotation>"); var internalxmlnode:xmlnode = internalxml.firstchild; internalxmldisplay.htmltext = internalxmlnode.firstchild.nodevalue; i've copy & paste code , worked pretty fine me. sure 'internalxmldisplay dynamic text , / or accepts html (internalxmldisplay.html = true;) ?

Prevent iPhone app to run on iPad -

Image
i'm shipping 2 binaries; 1 iphone/itouch , other ipad. it's same application. will apple ensure user never receive iphone version of app on ipad? if yes, don't have worry about, if not have problem. the reason ask iphone application not work correctly on ipad because server knows it's ipad , deliver ipad hd content , iphone cannot handle that. rather not hack application send server fake device type if running iphone app on ipad in order receive correct resources. suggestions? i've been looking while because couldn't prevent iphone app load on ipad. searched bit understand why happening, followed @hotpaw2 insctructions , found on official apple store rules: https://developer.apple.com/appstore/resources/approval/guidelines.html

perl - How can I modify my CPAN area to require only one directory in my @INC path? -

i have installed bunch of cpan modules in area. seems each package wants installed somewhere different under prefix. in case, have use this: setenv cpan_dir <my root>/perl-5.12.2_cpan setenv perllib $cpan_dir/install/lib64/site_perl/x86_64-linux:$cpan_dir/install/lib/5.12.2:$cpan_dir/install/lib/site_perl/x86_64-linux:$cpan_dir/install/lib/site_perl:$cpan_dir/install/lib/perl5:$cpan_dir/install/lib/site_perl/5.12.2:$cpan_dir/install/lib/site_perl/5.12.2/x86_64-linux i'd able setup package 'release' area requires only: setenv perllib <one dir> or use lib '<one dir>'; surely not novel idea. what's trick? use lib , perl5lib both add not directories specify, expected version or arch subdirectories under them. sure have problem here? if so, can show example use lib not working, including perl -v output?

java - Change the image dimensions -

i want resize image, either increasing or decreasing dimensions, in android application. this code have far... bitmap scratch = bitmapfactory.decoderesource (getresources (), r.drawable.skalyzmn); canvas.drawbitmap (image, x, y, null); is correct way resize image? how progress part stage perform actual resizing? read article: how resize image in java ? think contains detailed explanations.

jquery autocomplete with remote json object -

i want make input field have jquery autocomplete fetch company names database , display user. below snippet found on jquery.com. want rewrite fit needs , need help. $(function() { function log( message ) { $( "<div/>" ).text( message ).prependto( "#log" ); $( "#log" ).attr( "scrolltop", 0 ); } $( "#company_name" ).autocomplete({ source: function( request, response ) { $.ajax({ url: "inc/company_name.php", datatype: "jsonp", data: { featureclass: "p", style: "full", maxrows: 12, name_startswith: request.term }, success: function( data ) { response( $.map( data.geonames, function( item ) { return { label: item.name, value: item.name } })); } }); }, minlength: 2, select: function( event, ui ) { log( ui.item ? "selected: " + ui.item.label :

regex - PHP and preg_replace -

i have text parsing this: some text. text. text. text. text. text. text. text. text. text. text. text. text. text. text. text. text. [attachment=0]winter.jpg[/attachment]some text. text. text. text. text. text. text. text. text. text. text. text. i want match , remove instance of text string: [attachment=0]winter.jpg[/attachment] where winter.jpg can text. however, getting php notices. used regexpal.com construct this, works there uses javascript regex function: \[attachment=.*?].*\[/attachment] when run code: $pm_row['message_text'] = preg_replace('\[attachment=.*?\].*\[/attachment\]', '', $pm_row['message_text']); php complains notice: [phpbb debug] php notice: in file /mail_digests.php on line 841: preg_replace() [function.preg-replace]: delimiter must not alphanumeric or backslash so on similar line of code, delimit pattern "/": $post_row['post_text'] = preg_replace('/\[attachmen

When to develop using Powershell vs C#? -

i'm getting started in powershell , 1 of sysadmins told me powershell can as c# can systems management, if not more. please forgive ignorance of question, when use powershell on c#? when worked in windows build lab long time ago (1997) rule taught if code satisfies either of these 2 conditions write in interpreted script, otherwise write in compiled code: there's more overhead code (using/include lines, function declaration, etc) there's better 10% chance code change before gets run again

java - JSR-303 validation using an OR relationship -

i have field in bean either null, or date in past. jsr-303 provides annotations null , past, if apply both never validate because can't both null , past. combine validations in or relationship. i'm pretty sure i'll have create own validator implementation that, i'm hoping i'm missing , 1 of can show me how combine existing validators in or relationship. all of default jsr-303 annotations allow null through. (except, obviously, notnull!) using @past implicitly "in past, or null."

scala - guide to move from filter to withFilter? -

is there detailed guide move filter() withfilter()? warnings using filter() implementations can't find easy guide moving withfilter()... you can relive birth of withfilter on the mailing list . and check out the diff brought scalacheck.

c# - ComboBox Silverlight -

i have standard silverlight combobox behave html combobox. let's have combobox states in us, if press 'i' key, should navigate selected item start @ i's ... there anyway this, doesn't make sense it's not built in functionality. maybe missed memo? ideas? it's not comes standard - in silverlight 4 (i hit problem today). however, there quite few diy implementations on net: http://gistom.blogspot.com/2009/12/silverlight-combobox-with-keyboard.html http://www.codeproject.com/kb/silverlight/comboboxkeybrdselection.aspx http://www.reflectionit.nl/blog/permalinkd137c1f7-a515-4084-8199-f8b3cf892b8f.aspx the author of last post created small behavior fixes problem. can attach keyboardselectionbehavior listbox or combobox using microsoft expression blend. drag assets , drop on combobox or listbox. if have custom itemtemplate have set selectionmemberpath property. if don't have access blend use code template , edit xaml hand produce

Kernel Programming From Beginner to Expert using C -

hello new kernel programming , answer me how , how take me started confidence play code , meanings. listing questions goals .please answer of them if not all. 1.i evaluate myself on "how much" c know in order able understand code , general concepts of source code. how evaluate myself find skill level of programming in c? i have read k&r don't yet have serious understanding on pointers , structs. when mean serious mean not able comprehend source code,yet. where find puzzles,projects in order gain real world experience? what books suggest in order solidfy knowledge in c programming? how long take me competent programmer(if not already?) expert professional competent advanced beginner novice a path of books or links explained in time&skill level order great. 2.i able play code , create new in order experiment kernel. a path of books or links, kernel oriented, explained in time&skil

Calling another Action Helper from another action Helper in Zend Framework -

is possible call action helper action helper. have created action helper preform layout related stuff using predispatch hook. want call ajaxcontext within first action helper's predispatch method. ideas how can achieve this? you can use zend_controller_action_helperbroker fetch other helpers.

Writing a program that will use an xbox controller and a pic to control motors -

i looking advice on start regards writing c code program use xbox controller , pic activate motors. have advice on start? thank you, the xbox controller usb hub plus usb hid device. heard pic24f can act usb host, you'd need implementation of usb hid class , you're done.

windows - win32: destroy a deskstop created with CreateDesktop -

what's opposite of createdesktop() ? closedesktop() seems close handle new desktop, not delete it. iirc, desktops reference counted, they're destroyed when nothing using them anymore (and having un-closed handle 1 included "using").

ruby on rails - JRuby + Glassfish Gem + Bundler error -

i'm getting following error when trying use jruby, bundler, glassfish gem, , rails 2.3.9 in production: could not load bundler gem. install `gem install bundler` no matter try, happens. deploy via capistrano, , bundle gets created in shared directory of app. bundler installed , can see in gem env. i'm starting app via cd #{current_path}; bundle exec glassfish -p #{shared_path}/pids/glassfish.pid" the server start, "something went wrong" when go app url. any ideas? robert, first off, assume have followed instructions in http://gembundler.com/rails23.html . if not, make sure do. second, make sure running bundle jruby: jruby -s bundle exec glassfish third, -p requires daemonization, make sure have option turned on (either -d flag, or in glassfish.yml ).

objective c - where to use SQLITE in iPhone apps? -

i use sql vb.net make such projects im learning , looking sqlite in iphone apps can use exemple app used sqlite or you can use sql lite if have store larger amounts of data. small amount of data nsuserdefaults practicable.

arrays - Using Java to automate google and print output -

does know if there's easy way implement this: i have array of strings (~650 elements) , google each element, , have number of results acquired in each search stored in integer array. looked @ google api, seems little daunting me, seems simple task, can't seem find guidance on how this. help appreciated. thanks. my first thought following. don't think fastest or elegant way, think should trick: if check url on google, same: http://www.google.com/search?q='here searchword' so iterate on array , each string create url e.g. http://www.google.com/search?q=test do http-post , parse result. here short example of httppost. can see how response. don't know how googles response looking, if print out whole response, think see how have parse it.

sql - Query column nullability of the resulting rowset of a tsql SELECT statement? -

consider following pseudo-tsql table { field1 int, field2 int null } table b { field1 int, field3 int } create procedure sp1 select a.field1, a.field2, b.field3 inner join b on a.field1 = b.field1 is possible query procedure sp1 if resulting columns can null or not? seems dataset generator can pull off right? can done in tsql? other means? desired output: field1 int, field2 int null, field3 int or: field1, field2 nullable, field3 (the first better) thanks! the dataset generator set fmtonly set option on. causes empty result sets returned client, instead of running queries. client data access technologies (e.g. ado.net , sql native client, etc) have ways of interrogating result set objects (even empty ones) , determining schema information them. i can't think of way consume information t-sql though. way of grabbing result set stored procedure insert...exec , in case, have have table defined.

css3 - What does @media screen and (max-width: 1024px) mean in CSS? -

i found piece of code in css file inherited, can't make sense out of it: @media screen , (max-width: 1024px){ img.bg { left: 50%; margin-left: -512px; } } specifically, happening on first line? that’s media query. prevents css inside being run unless browser passes tests contains. the tests in media query are: @media screen — browser identifies being in “screen” category. means browser considers desktop-class — opposed e.g. older mobile phone browser (note iphone, , other smartphone browsers, do identify being in screen category), or screenreader — , it’s displaying page on-screen, rather printing it. max-width: 1024px — width of browser window (including scroll bar) 1024 pixels or less. ( css pixels, not device pixels .) that second test suggests intended limit css ipad, iphone, , similar devices (because older browsers don’t support max-width in media queries, , lot of desktop browsers run wider 1024 pixels). however, apply des

c++ - GetModuleFileName from MSI -

i try use "getmodulefilename" current "setup.msi" location use mydll.dll in setup.msi installer. but give me "c:\windows\system\setup.msi". body know why ? plx . you mention c++ i'm assuming creating type 1 custom action described here . if so, i'm guessing trying figure out install occurring can reference file or something. if so, check out msigetproperty function , originaldatabase property. if doesn't meet needs checkout the msisourcelist* functions starting msisourcelistgetinfo .

Jquery table sorter cell height problems with pager -

having problem jquery table sorter , pager plugin. all works fine, if have 'description' column, , it's larger the other cells (expands dynamically) how can pager plugin stick bottom of new table? my code @ home right now, here sample of 2 together. http://tablesorter.com/docs/example-pager.html in example, every '100' denoted "100 , alot of writing wrap around new row within entries in table" do have make every cell uniformly big? (cause may quite bigger others) thanks .tablesorterpager({ container: $("#pager"), positionfixed: false }); change false true

objective c - How to duplicate a .xib file? -

i see there's no "duplicate" when right click on .xib. way it: go finder, copy file name, , drag resources? i'd need do? [note: wondering if there's other files or settings need bother with.] yes, that's of what's needed. make sure open nib file , verify connections want them be. act file duplicate. give original name , make sure it's saved in correct folder before import project.

C++ Pointers and References Clarification -

this me understand pointers better, if guys can confirm/deny/explain looks don't understand appreciative. examples of using mailboxes, , aunts, , streets, , crap confusing. int = 5; int b = &a; // b memory address of 'a' int *c = a; // c value of 'a' 5 int *d = &a; // d pointer memory address of 'a' int &e = a; // be? void functiona() { int = 20; functionb(&a); // 15? } void functionb(int *a) { = 15; } thank guys help, trying improve understanding beyond of crappy metaphor explanations im reading. i'll take things 1 one: int b = &a; // b memory address of 'a' no. compiler (probably) won't allow this. you've defined b int , &a address of int , initialization won't work. int *c = a; no -- same problem, in reverse. you've defined c pointer int , you're trying initialize value of int. int *d = &a; yes -- you've defined d pointer int, , you

What should I do to extend output values in c++ -

this program converts celsius degrees fahrenheit degrees , kelvin. when run code in dev c++ celsius values going 2 300. how code output celsius values starting -300 , ending @ 300? set cels = -300 in loop. why output start 2? #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { double cels, fah, kel, cels2fah, cels2kel, fah2cels, fah2kel; cout<<"my name \n"; cout<<"program 8.0 "<<endl; cout<<"\n\n"; cout<<"celsius fahrenheit kelvin \n" <<"degrees degrees --------\n" <<"-------- ----------- --------\n"; for(cels = -300; cels<= 300; cels++) { cels2fah = (cels*9.0/5)+32.0; cels2kel = cels+273.15; setprecision(4.0); cout<<setw(3)<< cels <<" " <<setw(12)<< cels2fah <<" " <<setw(14)<< cels2kel <<

mouse - jQuery Hover with Class Single Item -

trying figure out how apply common class jquery hover single item @ time if there multiple items same class on page. i.e. html <div class="button">button</div> <div class="button">button 1</div> <div class="button">button 2</div> js jquery('.button').hover(function () { jquery('.button').addclass('button-hover'); }, function () { jquery('.button').removeclass('button-hover'); }); how can if hover on 'button' not buttons add class ? i.e. want add class when focused on single div ? thnks use this : jquery('.button').hover(function () { jquery(this).addclass('button-hover'); }, function () { jquery(this).removeclass('button-hover'); });

jQuery how to find an element based on a data-attribute value? -

i've got following scenario: var el = 'li'; and there 5 <li> 's on page each data-slide=number attribute (number being 1,2,3,4,5 respectively) . i need find active slide number mapped var current = $('ul').data(current); , updated on each slide change. so far tries have been unsuccessful, trying construct selector match current slide: $('ul').find(el+[data-slide=+current+]); does not match/return anything… the reason can't hardcode li part user accessible variable can changed different element if required, may not li . any ideas on i'm missing? you have inject value of current attribute equals selector: $("ul").find("[data-slide='" + current + "']"); es6 way: $("ul").find(`[data-slide='${current}']`)

c# - What is the output, if we use a "character pointer" as an index to a character array in C++ and how to achieve this in c SHarp? -

i have vc++ character array "wchar_t arr[0x30] = { 0x0,0x1,..., 0xc...hexadecimal initialization here ......} ". there 1 more c++ character pointer wchar_t * xyz . operation like---- wchar_t ch = arr[xyz[2]] done. can kindly explain in detail happening in this, because arr[] char array , should pass integer index array right? here index passed character array "arr[] " character pointer xyz[2]. in above code suppose character 'a' stored @ xyz[2] mean indexing c++ character array this--- arr[xyz[2]] becomes arr['a']. kindly let me know. how can achieve in c sharp.. if know happening in c++ code above can myself achieve in c sharp. can kindly let me know happening here in c++ code. what happens wchar_t stored @ xyz[2] promoted int , used index arr array. it means that, if xyz[2] contains l'a' , program exhibit undefined behavior , since arr has space 48 items l'a' promoted 97 . concerning se

Passing POST data from Javascript(jquery) to php problems? -

i been trying passing value: // content submit php others string here. , link: http://www.youtube.com/watch?v=cuugkj2i1xc&feature=rec-lgout-exp_fresh+div-1r-2-hm to php page, , insert database. here current code: ... // javascript var content = $("#mcontent").val(); $.ajax({ url : '<?php echo path; ?>functions/save.php', type: 'post', data: 'id=<?php echo $_get['id']; ?>&content=' + content + '&action=save&val=<?php echo md5("secr3t" . $_session['userid_id']); ?>', datatype: 'json', success: function(response) { if (response.status == 'success') { alert(response.message); } else { alert(response.message); } } }); no errors actually, in database, saved is: others string here. , link: http://www.youtube.com/watch?v=cuugkj2i1xc i guess know whats problem, problem the: http://www.you

jquery - disable click on hover -

i have jquery game members keep finding ways win. it's numbers game here link text . i've made game can't play on firefox, don't know if other browsers have same cheat tools firefox. 1st problem had gamers keep mouse on 1 box till number showed they'd click it. fix (with genius on stackoverflow) made can't click same box twice in row. it's same problem, they'll move box , keep mouse till see number. need make if on over box more x number of seconds won't able click on box. a count down timer may trick though , eliminate hover script. please ever 1 can. here's script. var hitcount = 0, misscount = 0; function isnumeric(n) { return !isnan(n); } $("#getit").click(function() { var hitcount = 0, misscount = 0; $('#misscount').text(0); $('#hitcount').text(0); $('#message').hide(100); $('#randomnumber').empty(); $('#randomnumber').show(300); var li = [], intervals =

java - How does one use polymorphism instead of instanceof? (And why?) -

if take code below: shape p1 = new square(); square c1; if(p1 instanceof square) { c1 = (square) p1; } what mean prefer polymorphism instanceof , , incidentally, why better? edit: understand polymorphism is; i'm missing how 1 use rather instanceof . the main difference between if...else... (or switch, or visitor), , between polymorphism modularity. there's called open-closed principle, means, when add new feature existing program, less changes make in existing code better (because every change requires work, , may introduce bugs). let's compare amount of changes: adding new method (eg. have paint(), , getarea(), let's add getcircumference()): if-else solution have alter 1 file - file contain new method. polymorphism, have alter implementations of shape class. adding new kind of shape (you have square, circle - let's add triangle): if-else solution have review existing classes if-else , add new if branch triangle; polymporphism have add new

html development for android mobile -

how develop html + css android mobile.. guidance great help http://mobiforge.com/starting/story/dotmobi-mobile-web-developers-guide

c++ - select() on a pipe in blocking mode returns EAGAIN -

the man pages select() not list eagain possible error code select() function. can explain in cases select() can produce eagain error? if understand select_tut man page , eagain can produced sending signal process blocked waiting on blocked select(). correct? since using select() in blocking mode timeout, this: bool selectrepeat = true; int res = 0; timeval selecttimeout( timeout ); while ( true == selectrepeat ) { res = ::select( fd.get() + 1, null, &writefdset, null, &selecttimeout ); selectrepeat = ( ( -1 == res ) && ( eintr == errno ) ); } should repeat loop when error number eagain? select() not return eagain under circumstance. may, however, return eintr if interrupted signal (this applies system calls). eagain (or ewouldblock ) may returned read , write , recv , send , etc.

Simple Modal Window + jQuery Cookie -

i use plugin jquery simple modal window display modal window. use jquery cookie plugin (jquery.cookie.js) set cookies. how can mix jquery simple modal window , jquery cookie? it`s necessary after clicking on "continue" button, cookies set , modal window in future doesnt appear users. i'm sorry, i'm beginner. this code: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/jquery.cookie.js"></script> <script type="text/javascript"> $(document).ready(function() { //put in div id want display launchwindow('#alert'); //if close button clicked $('.window .close').click(func

Looking for decent Git libraries for Java -

Image
i looking decent git library java stand-alone applications. can recommend any? i believe can use jgit in java application. the main page includes: jgit has few dependencies, making suitable embedding in java application, whether or not application taking advantage of other eclipse or osgi technologies. the download page mentions that: jgit can consumed in maven build. multiple artifacts available, depending on application's requirements: see full pom.xl in jgit-cookbook/blob/master/pom.xml : extract: <repositories> <repository> <id>jgit-repository</id> <url>http://download.eclipse.org/jgit/maven</url> </repository> </repositories> <!-- core library --> <dependencies> <dependency> <groupid>org.eclipse.jgit</groupid> <artifactid>org.eclipse.jgit</artifactid> <version>3.4.1.201406201815-r</version&

.net - Need help and guidance with reports for VS2010 -

hello general question.i want create simple report data of client , table measurements , few photos.... have no experience reporting in .net little jasper confusing @ me,i wondering better use available options c# , .net 2010 see crystal report (the time classic) , report using microsoft reporting technology... need deploy application.. easier? need little guidance ,what read ,some links articles ,tutorials ,because googling returned out-of-date results , misleading! hope not loose day simple report.. crystal vs. ssrs topic crops , again on - here's relatively sober appraisal: new project: ssrs vs. crystal reports? and here's more acerbic one: compare sql server reporting services crystal reports both tools full-featured, powerful reporting tools. both have built-in tutorials , wizards development; both take significant investment of time master. crystal more alike jasper, in think both banded reporting tools. for stack of microsoft technologies, ssrs

teamcity - How can I avoid this deep folder structure with MSDeploy to filesystem using MSBuild? -

i'm pulling hair out on msbuild issue. we're using teamcity build solution 2 mvc websites in it. part of build we're deploying folder on build server. iis points folder give integration build visible management. here's code msbuild file uses msdeploy publish package - not zip file. <target name="deploy"> <msbuild projects="$(solutionfile)" properties="platform=$(platform);configuration=$(configuration); deployonbuild=true; deploytarget=package; packagelocation=$(packagelocation); packageassinglefile=false; autoparameterizationwebconfigconnectionstrings=false" /> </target> the problem here incredibly deep folder structure. here's example... c:\deploy\archive\content\c_c\users\edmond\documents\visual studio 2008\creatiogreen\creatio\code\core\trunk\website\website\obj\release\package\packagetmp[published files] i want deploy predictable folders like... c:\build\website[pub

sharepoint - Convert docx to pdf with Word Automation Services -

with of http://msdn.microsoft.com/en-us/library/ff742315.aspx tried doing conversion docx pdf on sharepoint ... 1) created cs file on sharepoint server ... 2) compiled a bat file console exe 3) exe runs gives exception system.nullreferenceexception: object reference not set instance of object. the files exist , editable @ \mysrv\sites\casedocs\documents\elfdev\10080003 , @ https:\mysrv\sites\casedocs\documents\elfdev\10080003, latter no cert error. 1) cs file ... using system ; using system.collections.generic ; using system.linq ; using system.text ; using microsoft.sharepoint ; using microsoft.office.word.server.conversions ; class program { static void main( string[] args ) { string siteurl = "https://mysrv" ; string wordautomationservicesname = "word automation services" ; string source = siteurl + "/sites/casedocs/documents/elfdev/10080003/jk1.docx" ; string target = siteurl + "/sites/casedocs/documents/elfdev/1008000

Warnings of valid HTML5 attributes in Eclipse -

Image
i use eclipse , write jsp files html5 content. have example line: <div class="test" data-role="test123"> in eclipse warning: undefined attribute name (data-role) what needed done these warnings won't appear anymore? in html5 attribute allowed (data-*) can see here: http://ejohn.org/blog/html-5-data-attributes/ best regards. it seems eclipse still has problems validating html5 elements , attributes now. i'm running mars 4.5.1 , have had warnings <main> element, despite fact there no warnings <section> element. but there solution! window > preferences > web > html files > validation here can tick ignore specified element names in validation checkbox , enter names of elements eclipse incorrectly warning about. in case, want tick ignore specified attribute names in validation checkbox , enter data-role attribute. after click 'apply', eclipse ask full validation of project. select 

process - homework questions from stallings book -

Image
a.why there many wait states in in vms/vax process states ? all of waits except 1 have memory swapping or thread swapping. the vax architecture had virtual addressing. program access 1 gigabyte of address space, huge in 1977. if remember correctly, 32 or 64 megabytes of memory standard. meant programs access more memory machine had. vax managed virtual memory paging memory , disk drive. multiple users use vax. accomplished multiple user threads. since processor execute 1 instruction @ time, 1 thread active @ time. generally, thread run until i/o instruction encountered. thread swapped out, , other threads allowed execute, while i/o instruction completed. if want feel in olden days, read tracy kidder's "soul of new machine". it's story of team developed data general eclipse mv/8000 .

shellexecute - How to launch a console application from an IIS based web service, and have it visible while processing? -

i'm trying launch console app iis based web service, not visible on server. code far is: string downloaderpath = configurationmanager.appsettings["downloaderexepath"]; system.diagnostics.processstartinfo si = new system.diagnostics.processstartinfo(); si.windowstyle = system.diagnostics.processwindowstyle.normal; si.filename = downloaderpath; si.useshellexecute = true; //false doesn't make difference system.diagnostics.process.start(si); the process fires, errors. have visible on screen, possible? i don't think there in .net bcl allow so, if @ possible. you need start application in current 'interactive' user session. when starting app webservice, running in session of iis (as service). perhaps looking @ tools psexec might shed light on how working. alternatively, log errors file and/or attempt hook debugger iis process (w3wp.exe)

java - Finding the nth string in a delimited string -

does have idea how find n-th field (string) in delimited string delimiters (separator) either single char or several chars. for instance, string = "one*two*three" separator = "*" and syntax user-defined function findnthfield(string,separator,position) so position 3 return three the separator in use chr(13) . this has run on android , should efficient. any suggestions appreciated. something perhaps? public string findnthfield(string string, string separator, int position) { string[] splits = string.split(separator); if (splits.length < position) { return null; } return splits[position - 1]; } obviously, separator must regex string , didn't null check(s).

php - Wordpress - Adding classes to wp_list_pages -

does know how edit/change wordpress's wp_list_pages function in order add classes ul , li items? i'm trying implement new version of jquery.treeview requires <li class="expandable"> , <ul style="display: none;"> on expandable lists , child ul's. i've been messing around aint working in applies 'expandable' class li's: $pages = wp_list_pages('title_li=&echo=0' ); $pages = preg_replace('/class="/','class="expandable ', $pages); //note space on end of replacement string //output echo $pages; and here outputted html should like: <ul class="treeview" id="tree"> <li><a href="#">home</a></li> <li class="expandable"><a href="#">expand 1</a> <ul style="display: none;"> <l

view - How do I style a gwt 2.1 CellTables headers? -

i see nothing in documentation except reference include "cssresource" , clientbundle, how override tbody , th of celltable? is possible? create interface: interface tableresources extends celltable.resources { @source({celltable.style.default_css, "<your css file>.css"}) tablestyle celltablestyle(); } interface tablestyle extends celltable.style { } and initialize cell table: celltable.resources resources = gwt.create(tableresources.class); table = new celltable<someproxy>(rowsize, resources); in cellview.client package can find default gwt css files. yo use starting point. in "<your css file>.css" put specific style changes. you can set colum style (on col element): table.addcolumnstylename(colnumer, "some_css_style_name"); or better use css resource name instead of string "some_css_style_name".

soap - Exchange Web Services? -

does exchange server 2007 , 2010 allows create appointment, emails, contacts through ews (exchange web service)? i'm truing using soapui test , keep getting http/1.1 405 method not allowed allow: get, head, options, trace server: microsoft-iis/7.0 x-powered-by: asp.net date: tue, 16 nov 2010 14:05:48 gmt content-length: 0 any suggestions? cheers to url pointing soapui? https://servername/ews/exchange.asmx correct one. replace servername dns name of exchange box.

Compare jQuery UI vs jQuery Tools -

i'm new web programming (i desktop development professionally). want learn more web programming, using jquery library. see references jquery ui , jquery tools; find there controversy surrounding these. what relationship between jquery , jquery ui/jquery tools. 1 preferred on others? there references (besides respective home pages) using these libraries? thanks there no relationship between 2 libraries except fact both built on top of jquery. in experience, both libraries work set of feature provide. need have @ feature set on home page , decide on need, make choice. you can use both of them @ same time if need to, answer comment on answer, using drag & drop jqueryui , tooltip jquery tools option. if can use 1 library it's best though. code clearer (as every library coded different style) , users have less javascript files download when visit website. as documentation, expect find more documentation on jqueryui, used many people on place (i don't h

postgresql - Postgres Full Text Search performance question -

postgres full text search performance seems depend on dictionary use, here's example my table contains 60000 entries default german dictionary (only stopwords, think) select title sitesearch s, to_tsquery('german','holz') query query @@ searchtext limit 10 query plan limit (cost=247.14..282.99 rows=10 width=21) (actual time=1.286..1.534 rows=10 loops=1) -> nested loop (cost=247.14..1358.57 rows=310 width=21) (actual time=1.278..1.512 rows=10 loops=1) -> function scan on query (cost=0.00..0.01 rows=1 width=32) (actual time=0.019..0.019 rows=1 loops=1) -> bitmap heap scan on sitesearch s (cost=247.14..1354.68 rows=310 width=570) (actual time=1.237..1.452 rows=10 loops=1) recheck cond: (query.query @@ s.searchtext) -> bitmap index scan on sitesearch_searchtext_idx (cost=0.00..247.06 rows=310 width=0) (actual time=0.871..0.871 rows=1144 loops=1) index cond: (query.query

Expression Encoder SDK in Silverlight Application -

we trying build silverlight application allows user stream video iis smooth streaming server using encoder sdk. application stream video users desk tv screen @ our front desk connected computer running silverlight application. when try , add encoder assemblies project get: you can't add reference microsoft.expression.encoder.api2.dll not built against silverlight runtime. silverlight projects work silverlight assemblies. is there way me kick off encoder live session silverlight application? i've considered running remote command , starting encoder command line i'd use encoder om if @ possible. thanks, neil well after more research i've found it's not possible inside of silverlight application. have use local wcf service implement encoder sdk , access service silverlight app. thanks, neil

iphone - how to create custom tableViewCell from xib -

i want create custom tableviewcell on want have uitextfield editing possibility. created new class xib. add tableviewcell element. drag on uitextfield. added outlets in class , connect them together. in tableview method cellforrowatindexpath create custom cells, not custom cells - usual cells. how can fix problem, , why is? thanx! //editcell. h #import <uikit/uikit.h> @interface editcell : uitableviewcell { iboutlet uitextfield *editrow; } @property (nonatomic, retain) iboutlet uitextfield *editrow; @end //editcell.m #import "editcell.h" @implementation editcell @synthesize editrow; #pragma mark - #pragma mark view lifecycle - (void)viewdidunload { // relinquish ownership of can recreated in viewdidload or on demand. // example: self.myoutlet = nil; self.editrow = nil; } @end //in code - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellident

c++ - What does 'char x[]' mean? -

i have struct this: struct { char x[]; }; what mean? when like: a a; a.x = "hello"; gcc throws error saying: error: incompatible types in assignent of 'const char [6]' 'char [0u]' this c99 "flexible array member". see here gcc specifics: http://www.delorie.com/gnu/docs/gcc/gcc_42.html

Customizing/Overriding Rails SimpleForm Gem -

i'm using rails gem simpleform, think question may applicable gem. https://github.com/plataformatec/simple_form it has lot of great features , customization, i'm looking go bit further. example, wish markup generated had no default classes inserted it, i'd still ability insert own manually. found remove of classes commenting out lines in gem files. outside of project-- want dry solution stay project when deploy production, preferably without having pack of gems. i imagine common situation apply gem, , should able override gem wholly or partially adding customs files in project override gem... i'm not sure how. any appreciated! thanks. are talking monkey patching ? gem has class in file # simple_form_gem/lib/some_file.rb class def some_method puts 'a' end end if want change output of #some_method can create initializer file , do # config/initializers/my_monkey_patch_for_simple_form_gem.rb class def some_method puts 'd