Posts

Showing posts from September, 2011

.net - Entity Framework Where(Func<Car, bool>) clause not going to server -

i want pass "where" clause method via method parameter have found clause not getting sent database server. query actual fetches of records , "where" applied ef in client application. here example demonstrate problem: // id name colour // ----------------------- // 3 red_car red // 4 white_car white // 5 blue_car blue using (qdbentities db = new qdbentities()) { // #1 - no variable "where" - sent server, result correct. foreach (var car in db.cars.where(r => r.colour == "red")) console.writeline(car.id + " " + car.name); // output: 3 red_car // profiler: ... [dbo].[car] [extent1] // n'red' = [extent1].[colour] // #2 - using variable "where" - not sent server, result correct. func<car, bool> = new func<car, bool>(r => r.colour == "red"); foreach (var car in db.cars.where(where)) console.writeline(car.id

asp.net mvc - Setting the layout of ServiceStack Razor views on per-customer basis -

i working on servicestack-based web application used multiple clients. there default layout/design used in absence of client-specific one. hoping take advantage of support cascading layout templates available in servicestack razor having no luck making work. here how have structured views in project: \ _viewstart.cshtml defaultlayout.cshtml somesharedcontentpage.cshtml \views somesharedviewpage.cshtml \clienta layouta.cshtml stylesa.css \clientb layoutb.cshtml stylesb.css the logic in _ viewstart.cshtml checks identity of logged-in user , sets appropriate layout kind of (in simplified form): if (user.client.id == client_a_id) layout = "~/views/clienta/layouta.cshtml"; else layout = "~/views/clientb/layoutb.cshtml"; in turn, client-specific layouta , layoutb both use shared basic design/layout defined in defaultlayout.cshtml including following @ top: @

xml DTD correctness, why would we use round braces inside of round braces when declaring XML node? -

i'm looking @ piece of xml (inside of dtd file): <!element entry ((node1?, node2?, node3?), node4, node5?, (node6 | node16)?, (node17, node18?, (node19, node20)?)*, node21?, node22?, node23*, node24*, ((node25) | (node26?, node27?))?, node28*, node29?, node30*, node31*)> what reasoning behind having (node1?, node2?, node3?) in round braces? mean node1 , node2 , node3 optional? -> aren't alreday optional fact have question mark added already? parentheses used grouping. grouping lets put qualifiers on parts of patterns, (node6 | node16)? , or control precedence, (node25) | (node26?, node27?) . in case of (node1?, node2?, node3?) , parentheses redundant. means same thing node1?, node2?, node3? . sometimes people add parentheses because think makes things easier read, or emphasize related pieces of pattern. people type no reason.

Is there a way to automatically verify all imports in a Python script without running it? -

suppose have long python script (too long hand-audit) contains expensive operation, followed bunch of library function calls dependent on output of expensive operation. if have not imported necessary modules library function calls, python error out after expensive operation has finished, because python interprets line line. is there way automatically verify have necessary imports without either a) manually verifying line line or b) running through expensive operation each time miss library? another way put question whether there tool c compiler respect verifying dependencies before run time. no, not possible, because dependencies can injected @ runtime. consider: def foo(break_things): if not break_things: globals()['bar'] = lambda: none long_result = ... foo(long_result > 0) bar() which depending on runtime value of long_result , may give nameerror: name 'bar' not defined .

php - Paypal shipping calculator connection with cart66 -

i set shipping calculations within paypal account , working fine paypal buy buttons created. moved cart66 , need able continue using paypal's shipping calculator. not want use cart66's shipping calculator. @ moment many product select or whatever zipcode put keep getting same price 0$ shipping. how fix this? actual website; http://goo.gl/qofvd9 <-- explicit (consider warned) it looks site using express checkout. express checkout, cart has pass on shipping. can't use shipping profile within paypal account. paypal account shipping work website payments standard buttons, not express checkout. may have poke around in shopping cart determine need set shipping profiles in there.

Applescript Loop/Repeat Functions in Excel with Firefox -

i'm new applescript , on highly appreciated. think challenge more skills me. described has been done in snow leopard ms office 2011. i have list of urls (starting in cell q2) , i've got applescript execute following series of tasks: open ms excel create new workbook copy url ms excel cell q2. paste firefox address bar , go. click firefox menu bar function 'view1'(from add-on) click firefox menu bar function 'view2'(from add-on) click firefox menu bar function 'copy tables'(from add-on) create new workbook in excel paste copied text new workbook cell a1 save new workbook workbook002.xlsx close workbook i've put script below , works. trouble cant make repeat. repeat function required repeat execution of whole script, first changing cell q2 q3 , on point last cell contains value 0 signal end loop, , save each workbook names in sequential order (workbook002 workbook003 etc). don't think firefox part needs changed because steps s

disabled control - Disable a row in jQGrid -

i want disable 1 row on grid depending on value of global javascript variable. example, lets value of variable 123. row has 123 in column called "xyz" should disabled. where best way implement such functionality ? inside loadcomplete or beforeselectrow ? thanks the best way inline editing mode adding not-editable-row class row. can use rowattr add class based on content of column. see the answer details. if use form editing have choose way. use navgrid can disable editing or hide buttons based on value in column of selected row. see the answer , this one more details. beforeselectrow place such changes.

jquery - Can't get Textillate Plugin to work properly -

using textillate plugin , i've trying recreate simple demo ... however, i'm not sure why i'm unable "out" part of effect working. want block of text fade in left , fade out right. suck , nothing try seem work. if has used plugin, maybe can point me in right direction. thanks! note: when add effect "out" or "in", plugin doesn't work @ all. <div class="tlt"> <ul class="texts"> <li>hello world!</li> <li>i hate you</li> </ul> </div> $('.tlt').textillate({ in: { shuffle: false, sync: true }, out: { effect: 'fadeoutrightbig', shuffle: false, sync: true } }); effect names case sensitive correspond particular class defined in animate.css. change fadeoutrightbig fadeoutrightbig. $('.tlt').textillate({ in: { shuffle:

Python/Tkinter Button and Entry on the same window -

i'm beginner in python (2.7.5). here basic question i'm trying create window both button , entry reason doesn't work. if try make window entries or button works not both button , entry @ same time. so question basically: how create window both button , entry ? below script: from tkinter import* def super_function(): fen1.quit fen1 = tk() entr = [] in range(10): entr.append(entry(fen1)) entr[i].grid(row=i) button(fen1,text='store in list',command=fen1.quit).pack(side=bottom) fen1.mainloop() thank ! the problem using pack , grid @ same time. instead, should use one: from tkinter import * def super_function(): fen1.quit fen1 = tk() entr = [] in xrange(10): entr.append(entry(fen1)) entr[i].grid(row=i) # use grid instead of pack here button(fen1,text='store in list',command=super_function).grid() fen1.mainloop()

jQuery mobile multiple theme dependecies -

below mentioned in jquery mobile docs if no theme swatch letter set @ all, framework uses "a" swatch (black in default theme) headers , footers , "c" swatch (light gray in default theme) page content maximize contrast between both. all items in containers inherit swatch parent. exceptions rule listdivider in listviews, header of nested list pages, , button of split button lists. default "b" (blue in default theme). count bubbles default "c" (silver in default theme). my questions 1) why jquery mobile doesn't use single theme. why "a" "b" , "c"? 2) because of it's using multiple theme it's not possible make single custom theme. example if make "g" custom design. there way force use single swatch "a" or "b" or "c" can make custom theme using of them. it use single theme! themes have multiple color profiles called swatches

.net - Show a form confined within a tabpage -

Image
we have usercontrols (that each have own presenter). each 1 lives within tabpage on main form. one of them has graphical display of objects can interact with. when actions taken need collect information user, pop form (you call dialog). we'd form visible within tab page, can flip tab check information , come back, etc. we tried setting .toplevel = false on form, causes weird behavior that's unacceptable. various typical solutions (use mdi, no border on form, etc...) don't work in our circumstance. are there other ways can achieve desired behavior? your question reminded me of solution similar problem in wpf. let me best explain problem , solution. the problem provide method business logic interact user through "interaction requests" handled in appropriate region of user interface. business logic unaware of ui involved in interaction, initiate request event handled ui. couldn't find example again , wpf centric anyway, handled creating con

ssas - Calculating the number of days in a time dimension node - with Grand Total -

Image
i need know number of days in time dimension period calculating weighted averages. using following expression in calculated measure obtain number of days in current dimension member: count( descendants( [date].[calendar].currentmember, [date].[calendar].[date key] ) ) this works fine drill-down situations, not work grand total when have filter. suspect currentmember not work in situation. returns total number of days in data. illustrate, measure above formula aggregated in bids follows because fact data starts in 1984 , there 11100 days in time dimension. how can change formula filter accounted in aggregation? users can drill down day level. here excel pivot table: if need filter members [date].[calendar].[date key] level can intersect descendants result actual filter> with member [measures].[a] count ( intersect ( descendants ( [date].[calendar].currentmember ,[date].[cale

API for getting visitors statistic of heroku app -

does heroku have api getting visitors statistic web app hosted on site? don't want use google analysis. no doesn't. google (uh) alternatives if don't want use google analytics - there quite few.

anchor - WYSIWYG editor with links -

i new using wysiwyg web builder 9 , know how link index word. example, index titles are: home chemical cleaning contact chemicals , cleaning on same page when people click on cleaning goes straight cleaning information on page. on website explain how work links. if working single page have "index" , want go specific part of page, want use bookmarks. for reference on how use see page: creating hyperlinks . you may want read all, bookmark part @ bottom of page. let me know if helped.

javascript - How to get a random value from a Fixture Data in Ember -

i'm playing sample ember app shows data stored in fixture, , tries show random data fixture. complete demo here: http://jsbin.com/ifatot/2/edit everything works fine, however, i'm not able random index out of ember data. i'm trying find length , grab random index believe length coming 0, though have data in there. the function looks this: app.thoughtscontroller = ember.arraycontroller.extend({ randommessage: function() { var thoughts = this.get('model'); var len = thoughts.get('length'); var randomthought = (math.floor(math.random()*len)); return thoughts.objectat(randomthought); }.property('model') }); you should add length property dependent on randommessage computed property. allow content have finished resolving , have length . randommessage: function() { var len = this.get('length'); var randomthought = (math.floor(math.random()*len)); return this.objectat(randomthought); }.property(

Multiple Tag Search WordPress -

wordpress 3.5.2. old construction ?tag=tag1+tag2 doesn't work more. dunno why. have form check boxes. , tags sorts category. wanna search tag1+tag2+tag3 in specific category. how that? i'm tired solution :( comma separate them: /** posts of following tags */ $query = new wp_query( 'tag=bread,baking' ); /** posts of following tags */ $query = new wp_query( 'tag=bread+baking+recipe' ); /** or alternatively */ $query = new wp_query( array( 'tag_slug__in' => array( 'bread', 'baking' ) ) ); documented here: http://codex.wordpress.org/class_reference/wp_query

android - When creating a button from a Dialog Box -

the original code has been deleted, new working code shown. idea behind code create new textview within layout has custom name user provides. previously, npe error happening. fix. questions, please feel free ask. edit: found solution the fix needs followed: accountedit = new edittext(this); // accountedit needs global variable then within builder.setpositivebutton builder.setpositivebutton(r.string.btn_save, new dialoginterface.onclicklistener(){ public void onclick(dialoginterface dinterface, int whichbutton) { linearlayout linelayout = (linearlayout)findviewbyid(r.id.linear_layout); string newaccountname = accountedit.gettext().tostring(); newtextview = new textview( getbasecontext() ); newtextview.setvisibility(view.visible); newtextview.settext( newaccountname ); newtextview.setid(id); newtextview.settextsize(35); newtextview.setonclicklistene

autolayout - How do I reposition the Nav/Toolbar when toggling Status Bar? -

Image
environment: autolayout within ios 6/7, xcode 5. understand adjust navbar accommodate status bar, set navbar's background image 64 bits high (ref: wwdc 2013 video lecture #214). is there convenient way toggle presence of status bar while repositioning navbar flush against container view (and vice/versa)? added concern: need work both ios 6 & 7. ios 6 has solid status bar. hence, have change navbar's background image in ios 7 automatically accommondate status bar... or ...am correct can merely set status bar opaque have similar positioning in both ios 6/7 environments? doubleencore has blog post may status bar issues ( link ). there section of uitransition guide deals bars should review ( link ). should review uibarbuttonitemclass reference ( link ), has important sample code uicatalog showing different uikit objects ( link ). these references should give complete control of uikit objects in project.

node.js - Exception when attempting to wrap Buffered-writer -

disclaimer: i'm new node (but not javascript). im trying write logger class, holds few lines @ time in memory, flushes disk when buffer reaching capacity problem calling logger wrapper results in exception in buffered writer im sure ive misunderstood how require() works, , various people advised me create object using new chatlogs.chatlogger() iti dont see many other node libs using way of working /www/im/node_modules/buffered-writer/lib/buffered-writer.js:125 cb (); ^ typeerror: undefined not function @ writer.flush (/www/nodeim/node_modules/buffered-writer/lib/buffered-writer.js:125:3) @ chatlogger.close (/www/nodeim/helpers/chatlogs.js:27:14) @ object.<anonymous> (/www/nodeim/app.js:76:16) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ function.module.runmain (module.js:497:10) @ startup (nod

coding style - Scala - Pattern matching result of a for comprehension -

i'm performing pattern match on result of for-comprehension follows val validxsrf = for( cookie <- request.cookies.get("xsrf-token"); header <- request.headers.get("x-xsrf-token"); if cookie.value == header ) yield true; validxsrf match { case some(true) => callbackfunc(); case none => throw new xsrfexception(); } however feels little overly verbose - there cleaner way of expression this? ideally i'd love like for(....) match { .... } however not appear possible in scala without wrapping entire for-comprehension in brackets. is there cleaner / more elegant way of expressing logic? you abbreviate things bit (assuming callbackfunc returns string ): def validxsrf():string = { val xsrf = for{ cookie <- request.cookies.get("xsrf-token") header <- request.headers.get("x-xsrf-token") if cookie.value == header } yield callbackfunc() xsrf.getorelse(throw n

Jquery: Open link in new window. Re-usable with custom dimensions per link -

in situations open links in new windows jquery. wondering how keep common code links, while modifying width , height per link? (the width/height width/height of window opens when link clicked). i thinking of using custom data attribute (like: data-window-width , data-window-height). i have made start not sure of how handle width , height variables. html: <a href="some_link_here" class="linksocial" data-window-width="700" data-window-height="400">link text</a> javascript: //open social links in new window $('body').on('click', 'a.linksocial', function() { var width = 'width' + $(this).data('window-width'); var height = 'height' + $(this).data('window-height'); //not sure next width , height! newwindow=window.open($(this).attr('href'),'','height=400,width=770'); if (window.focus) {newwindow.focus()} return false;

java - solrj error: array out of bounds -

hi im trying run code , can seem figure out wrong..sorry im new solrj import org.apache.solr.common.solrdocument; import java.util.map; import org.apache.solr.common.solrdocumentlist; import org.apache.solr.common.solrdocument; import java.util.map; import java.util.iterator; import java.util.list; import java.util.arraylist; import java.util.hashmap; import org.apache.solr.client.solrj.solrserver; import org.apache.solr.client.solrj.solrserverexception; import org.apache.solr.client.solrj.solrquery; import org.apache.solr.client.solrj.impl.commonshttpsolrserver; import org.apache.solr.client.solrj.impl.httpsolrserver; import org.apache.solr.client.solrj.response.queryresponse; import org.apache.solr.client.solrj.response.facetfield; public class solrjtest { public void query(string q) { //commonshttpsolrserver server = null; solrserver server = null; try { server = new httpsolrserver("http://localhost:8983/solr/")

osx mountain lion - Handling process information from a KEXT -

inside kext, need processing either proc_t or pid. if go pid route, sysctl() of sorts. unfortunately, can't either. proc_t undefined , sysctl() isn't either. sysctlbyname() can called kinfo_proc isn't defined. if try use proc_t, compiler complains forward definition of [struct proc] i'm assuming sysctl() there used in user mode there way can use proc_t? tried use xnu/osfmk/bsd include dir won't compile because of redefinitions , other errors. it's little disconcerting , i'm still trying wrap head around can , cannot do. surely can done don't quite know how. ok, i'm going try , take stab @ question think you're asking. as you've discovered, proc_t pointer opaque struct proc . don't write off though, there various functions operate on such pointers, don't need gain direct access struct (which helps maintain binary compatibility). of these declared in sys/proc.h in kernel.framework - i.e. /system/library/framework

fade in background jquery -

i'm trying fade images on background of site isn't working t_t . in advance ! html : <body> <div id="menu1"></div> <div id="menu2"></div> <div id="menu3"></div> </body> css : body { background-color: #1f304e; background-image: url('images/bg.jpg'); background-repeat: no-repeat; background-attachment:fixed; background-position: center 0px; } jquery : $('#menu1').click(function(){ $(body).animate({background : url('images/bg1.jpg') }, 600); }); $('#menu2').click(function(){ $(body).animate({background : url('images/bg2.jpg') }, 600); }); $('#menu3').click(function(){ $(body).animate({background : url('images/bg3.jpg') }, 600); }); you cannot directly animate background image property of element. can fade in entire element though, try create div contains image, , fade in. try

php - Zend framework query where clause -

i have following query searching tables car model no , category name select * cars car left join categories cat on cat.car_id = car.car_id (car.model_no '%gt v8%') or (cat.name '%gt v8%') i using zend framework have query far in model $sql = $this->select()->setintegritycheck(false) ->from(array('car'=>$this->_name), array()) ->joinleft(array('cat'=>'categories'), 'cat.car_id=car.car_id', array()) then in clause i this $sql->where('car.model_no ?', '%'.$query['search'].'%') ->where('cat.name ?', '%'.$query['search'].'%') but output where (car.model_no '%gt v8%') , (cat.name '%gt v8%') i can't find way replace , or.. there anyway in zend_db? use orwhere (example #19) $sql->where('car.model_no ?', '%'.$query['search'].'%')->orwhe

bash - sed statement to change/modify CSV separators and delimiters -

i have csv files contains comma seperated values , of column values can contain characters ,.<>!/\;& i trying convert csv comma separated, quote enclosed csv example data: datecreated,datemodified,sku,name,category,description,url,originalurl,image,image50,image100,image120,image200,image300,image400,price,brand,modelnumber 2012-10-19 10:52:50,2013-06-11 02:07:16,34,austral foldaway 45 rotary clothesline,home & garden > household supplies > laundry supplies > drying racks & hangers,"watch product video plenty of space hang family wash austral's foldaway 45 rotary clothesline folding head rotary clothes hoist beautifully finished in either beige or heritage green. though foldaway 45 compact, still large 45 metres of line space, big enough full family wash. if want advantage of rotary hoist, dont want lose yard, austral foldaway 45 clothesline you.&nbsp; installation note:&nbsp;a core hole required when installing exist

android - IBM Worklight 6.0 - Hybrid application using webservices is not working on actual device? -

Image
i have developed application using dojo 1.9. in trying fetch data soap web service using http adapter. after build , deploy when previewing application in worklight console's mbs works fine (see screen shot #1 below), same on android 2.2 avd (see screen shot #2). when running app on actual device returns "request failed!" is there way make work on actual device connected network ? did miss soap message creation in impl.js file? is necessary make soap request call? if yes, please tell me how can generate soap message? adapter bsenseprice-impl.js: function bsenseprice(exchng) { var path = 'clientstockservice.asmx/bsenseprice'; var input = { method : 'get', returnedcontenttype : 'text/xml; charset=utf-8', path : path, parameters: {'exchng': exchng} }; return wl.server.invokehttp(input); } application javascript: function wlcommoninit(){ require([ "layers/cor

Chrome extension using multiple omnibox keywords -

i trying create google chrome extension , want listen multiple keywords omnibox. make short, want know whether these 2 things possible: defining multiple omnibox keywords 1 extension in manifest file letting chrome.omnibox.oninputentered , other events know keyword enabled thanks in advance. no, chromium developers have made clear not support multiple omnibox keywords extensions: my take on omnibox keyword ui surface, page/browser action. limit extensions 1 ui surface avoid adding clutter. given that, don't think should implement this. granted, bug asks both ability define multiple keywords and dynamically change keywords on fly. however, developer response seems opposed multiple keywords in general. the same response suggests alternative: the keyword meant act prefix extension, rather having n keywords, how 1 keyword accepts n commands? instead of supporting both keyword1 something , keyword2 something , can use masterkeyword keyword1 som

iphone - Switching from one navigation stack to another navigation stack using popViewController -

i have created module in have 5 classes in need perform task vc1->vc2->vc3 now vc3 used push vc4 reference of base class. base class class on vc1 controller's added subview. and need pop vc4 vc3. nsinteger index = 0; (uiviewcontroller *view in self.navigationcontroller.viewcontrollers) { if([view.nibname isequaltostring:@"yourviewcontroller"])//put `xib name` u want navigate break; index = index + 1; } //[[self navigationcontroller] pushviewcontroller:[[self.navigationcontroller viewcontrollers] objectatindex:index] animated:yes]; [[self navigationcontroller] poptoviewcontroller:[[self.navigationcontroller viewcontrollers] objectatindex:index] animated:yes];

CUDA 5.5 - Relocatable device code causes unresolved external symbol -

i'm using cuda 5.5 , compiler vc2012. projects consists of 2 .cu files. need use dynamic parallelism have enabled "generate relocatable device code" option. option enabled following linking error: error lnk2001: unresolved external symbol __fatbinwrap_54_tmpxft_0000110c_00000000_8_cuda_device_runtime_cpp1_ii_5f6993ef if turn option off error disappears. error not depend on contents of files - if comment out in them ( #if 0 .... #endif empty files) still same error. update: installed vc2010, , still exact same error message! update 2: got tired whole thing took dynamic parallelism sample project vc2010 sdk samples (cdpsimpleprint), replaced files in , compiled. issue gone. tried compare settings between 2 projects, couldn't find anything. i don't know caused it , frankly, @ stage don't care already, long have workaround. check linking cudadevrt library, see "compiling , linking" section in cuda dynamic parallelism programming gu

apache storm - Getting data from one database and process and store it to another database using trident topology -

i want data 1 database through spout , process data , store in database using trident.i new storm , trident , not sure how implement it.i got data database in spout(separate java class implements irichspout supported trident) , emit object.i need pass trident topology processing(counting number of records) , storing database. tridenttopology topology = new tridenttopology(); tridentstate wordcounts = topology.newstream("spout1",spout) now new stream takes spout input i.e syntax is stream storm.trident.tridenttopology.newstream(string txid, irichspout spout) but want give object emitted spout input stream trident process , save database.so how can bring spout class inside trident , pass new stream or should combine both spout , trident same class?? can plz..... you can like myfoospout spout = new myfoospout(); topology.newstream("spout1", spout).... where myfoospout class should implements irichspout from trident t

internet explorer 9 - starting IE9 via vboxmanage guestcontrol can't access localstorage -

we use virtualbox winvista vm testing our javascript app in ie9 (and other windows browsers). test runner, use karma. through karma github located bash script launches ie9 , starts test runner in browser. this works, biggest part, when want use localstorage "access denied" error. however, when start browser manually in vm, can access localstorage without problem. it seems starting browser via vboxmanage guestcontrol command user rights prevents browser accessing localstorage directory on hard disk. of course, we're using same user account vboxmanage , running browser hand. chrome displayed same issue, redirect public directory. we've tried changing registry entry points ie9 localstorage directory, doesn't seem work. if can't figure out, we'll have fall our previous solution, using selenium webdriver run tests, making karma less useful. i had entirely exact same problem (if not exactly). after pulling out hair trying use runas.exe load

c# - Type-safe collection of Type class with defined base type -

i'm use generic collection in code: list<type> what want type-safe collection of types defined basetype list<typeof(basetype)> , valid :) you can't create type-safe collection of type objects describe types derive base type, because c#'s type-safe generic mechanism can operate on types known @ compile-time, while relationship between typeof(mybasetype) , typeof(myderivedtype) knowm @ runtime. furthermore, have remember relationship between these type objects not relationship of inheritance. string may derive object , typeof(string) doesn't derive typeof(object) . while relationship may seem relevant type-safety, isn't really. a collection of type objects of subtypes of specific type equivalent, in terms of type safety, collection of even-numbered int s - has nothing type safety, , such difficult implement generics.

c# - Mysql dataadapter InsertCommand -

i have following code mysqlconnection mycon = new mysqlconnection(system.configuration.configurationmanager.appsettings["mysqlcon"]); mysqldataadapter dadap = new mysqldataadapter(); dadap.insertcommand = new mysqlcommand("insert pmduedates(ecid,ecclass,ddate,pmtype) values(ecid,ecclass,ddate,pmtype)", mycon); dadap.insertcommand.parameters.add("ecid", mysqldbtype.varchar, 20, "eqpid"); dadap.insertcommand.parameters.add("ecclass", mysqldbtype.varchar, 100, "class"); dadap.insertcommand.parameters.add("ddate", mysqldbtype.varchar, 100, "mainttype"); dadap.insertcommand.parameters.add("pmtype", mysqldbtype.date, 10, "duedate"); mycon.open(); dadap.update(dtdue); mycon.close(); in above code dtdue datatable , eqpid,class,mainttype , duedate datacolumns. when executing code n't gives error data not updating in table pmduedates. why should dataadapter insert records in

Reordering Product Information tabs in Magento admin panel -

i'm trying change ordering of tabs in adding , editing products in admin panel editing app/code/local/mage/adminhtml/block/catalog/product/edit/tabs.php . however, i've come stump associated products tab. i'd move before meta information can't seem find said tab being set. can please guide me on how move associated products tab up? in advance. in xml : app/design/adminhtml/default/default/layout/catalog.xml associated products tab added separately after tabs configurable products : <adminhtml_catalog_product_configurable> <reference name="product_tabs"> <action method="addtab"><name>configurable</name><block>adminhtml/catalog_product_edit_tab_super_config</block></action> <action method="bindshadowtabs"><first>configurable</first><second>customer_options</second></action> </reference> </adminhtml_catalog_produ

c# - How can I put my semicolon on same line on rich text box? -

using (oraclecommand crtcommand = new oraclecommand("mycommand", conn1)) { richtextbox1.appendtext(environment.newline); richtextbox1.appendtext(crtcommand.executescalar().tostring() + ";"); richtextbox1.appendtext(environment.newline); } result: create unique index "xpktbl_a" on "tbl_a" ("field_a1") ; expected result: create unique index "xpktbl_a" on "tbl_a" ("field_a1"); @andreasniedermair suggested in comments trim line break should help richtextbox1.appendtext(crtcommand.executescalar().tostring().trimend('\r', '\n', ' ') + ";");

ruby - Rails getting form value to create method -

i creating form allows user send user email without seeing email address. i using gem: https://github.com/plataformatec/mail_form handle this. currently close getting things working. have app emailing correct person , giving correct reply information. however, cannot message body appear. my view form. (emails/new.html.erb) <h1>mail#new</h1> <p>find me in app/views/mail/new.html.erb</p> <%= form_for @email |f| %> <%= f.label :message, 'message:' %> <%= f.text_area :message %> <%= f.submit "send message" %> <% end %> my controller (emails_controller.rb) class emailscontroller < applicationcontroller def new @email = email.new flash[:userid] = params[:id] end def create @touser = user.find(flash[:userid]) @fromuser = user.find(current_user.id.to_i) @email = email.new(:name => @fromuser.name, :email => @fromuser.email, :message => para

c# - Using IN operator with Stored Procedure Parameter -

i building website in asp.net 2.0, description of page working about: listview displaying table (of posts) access db, , listbox multiple select mode used filter rows (by forum name, value=forumid). converting listbox selected values list, running following query. parameter: oledbparameter("@q",list.tostring()); procedure: select * sp_feedbacks forumid in ([@q]) the problem is, well, doesn't work. when run msaccess 2007 string 1,4, "1","4" or "1,4" 0 results. query works when 1 forum selected. (in (1) instance). solution? guess use many or's avoid option. solution convert datatable list filter using linq, seems messy option. thanks in advance, bbln. when have: col in ('1,4') this tests col equal string '1,4' . not testing values individually. one way solve using like : where ','&@q&',' '*,'&col&',*' the idea add delimiters each string.

javascript - How to check button is clicked inside a function -

my scenerio: i have function: function addprocedure() called on onclick of addprocedure button. in function want check if btnaddselectedprocedures clicked else nothing function addprocedure(){ if()// check if button clicked, button id = `btnaddselectedprocedures` { //do } else{ //do nothing } } try $('#btnaddselectedprocedures').click(function(){ $(this).data('clicked', true) }) then function addprocedure(){ if($('#btnaddselectedprocedures').data('clicked')){ //clicked } else { //not clicked } }

java - Picking a suitable class name for a randomiser -

i apologise firstly , foremost if have put in wrong place. believe inherent programming design decision, hence why here. i working on android game has various classes related via inheritance. i have coin object, , die object (as in single dice), die object has subclass, customdie (which allows user define die many faces, i.e. 7 sided dice). since both coin , die have similar functions, coin picks random number between 1 , 2, , die between 1 , 6 , custom die between (n,m) or whatever range user has defined. thinking putting of functionality in parent class. i not sure class called, perhaps along lines of randomgenerator or randompicker. suggests welcome. i agree of answers based on opinions, there degree of knowledge required, i.e. use of verbs/nouns; pick class name. later affect choice of method names , other classes/variables used in project. , software architects converge on 1 or 2 of best suggestions, please dont write question off 1 cannot answered. imagine

python - Is it worth using IPython parallel with scipy's eig? -

i'm writing code has compute large numbers of eigenvalue problems (typical matrices dimension few hundreds). wondering whether possible speed process using ipython.parallel module. former matlab user , python newbie looking similar matlab's parfor ... following tutorials online wrote simple code check if speeds computation @ , found out doesn't , slows down(case dependent). think, might missing point in , maybe scipy.linalg.eig implemented in such way uses cores available , trying parallelise interrupt engine management. here 'parralel' code: import numpy np scipy.linalg import eig ipython import parallel #create matrices matrix_size = 300 matrices = {} in range(100): matrices[i] = np.random.rand(matrix_size, matrix_size) rc = parallel.client() lview = rc.load_balanced_view() results = {} #compute eigenvalues in range(len(matrices)): asyncresult = lview.apply(eig, matrices[i], right=false) results[i] = asyncresult i, asyncresult in r

javascript - How to share video / audio file on facebook from iPhone app created using titanium appcelrator -

i want share video / audio kind of file on facebook . i able share status or other stuffs except audio / video.i working in titanium . here code login.addeventlistener('click', function(e){ titanium.facebook.authorize(); var f=titanium.filesystem.getfile(ti.filesystem.applicationdatadirectory+"/"+"audio"+"/"+"abc.mp4"); var blob=f.nativepath; alert(blob); var data={ message: 'check video!', video: blob } titanium.facebook.requestwithgraphpath('me/videos', data, 'post', function(e) { if (e.success) { alert("success! fb: " + e.result); } else if (e.error) { alert(e.error); } else { alert('unknown response.'); } }); }); you passing file path ( nativepath ) facebook, instead try passing actual image blob this: var blob=f.read(); var data={

android - How to bypass bluetooth pairing dialog in LG nexus 4 (E960)? -

i connecting embedded bluetooth device lg nexus 4 in application using following code private void pairdevice(bluetoothdevice device) { bluetoothsocket tmp = null; try { tmp = device.createinsecurerfcommsockettoservicerecord(uuid .fromstring("<uuid of embedded device>")); } catch (ioexception e) { log.e("log_tag", e.getmessage()); e.printstacktrace(); } log.v("log_tag", "socket found"); try { tmp.connect(); log.v("log_tag", "connected"); } catch (ioexception e) { log.e("log_tag", e.getmessage()); e.printstacktrace(); } } its working fine in other devices samsung galaxy grand when trying lg nexus 4 shows me dialog 2 options pair or cancel , not want should directly connect device. please me.