Posts

Showing posts from April, 2011

android - Getting error ld.exe: error: cannot find -lgnustl_shared in ndk on compiling tbb source files -

i trying compile tbb source files threadingbuildingblocks . i have tried available solutions on stackoverflow none of them works. error getting is: lib -l/cygdrive/d/android/ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/x86 -lgnustl_shared -shared -wl,-soname=libtbb.so --sysroot=/cygdrive/d/android/ndk/platforms/android-9/arch-x86 -m32 -wl,--version-script,tbb.def d:/android/ndk/toolchains/x86-4.6/prebuilt/windows/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld.exe: error: cannot find -ldl d:/android/ndk/toolchains/x86-4.6/prebuilt/windows/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld.exe: error: cannot find -lgnustl_shared d:/android/ndk/toolchains/x86-4.6/prebuilt/windows/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld.exe: error: cannot find -lstdc++ d:/android/ndk/toolchains/x86-4.6/prebuilt/windows/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld.e

WCF ServiceContract's method returning Task<T> and timeout -

i'm new wcf. i'm making service in need compute lengthy operation. since method lengthy thought make operation async returning task. not work. i'm still getting timeout exception. sample code (not actual code) demonstrating problem below: [servicecontract] public interface icalculator { [operationcontract] task<double> computepiasync(ulong numdecimals); } internal class calculator : icalculator { public async task<double> computepiasync(ulong numdecimals) { return await someveryverylongwayofcomputingpi(numdecimals); } } // server using (var host = new servicehost(typeof(calculator), new uri("net.pipe://localhost"))) { host.addserviceendpoint(typeof(icalculator), new netnamedpipebinding(), "calculator"); host.open(); console.writeline("service running. press <enter> exit."); console.readline(); host.close(); } // client var factory = new channelfactory<icalculator>

Java/Webdriver - opening a Firefox instance - firefoxbinary and setenvironmentproperty -

im trying launch firefox instance webdriver, want instruct use xvfb display. think wrong code, though firefoxbinary ffox = new firefoxbinary(); ffox.setenvironmentproperty("display", "22"); driver = new firefoxdriver(); as can see, @ no point there mention "new firefoxdriver()" use ffox setting, when put ffox in brackets of firefoxdriver, code goes red, because can't accept such thing. is there wrong code? you need set system property use ff binary. refer here http://code.google.com/p/selenium/wiki/firefoxdriver

django - How to group by and return values from each group? -

i have such table id p_id number 1 1 12 2 1 13 3 2 14 4 2 15 how such items in view, mean group p_id , number values group for p_id 1 returns count 2 , 12,13 p_id 2 returns count 2 , 14,15 you can use values() , annotate() group, so: from django.db.models import count pid_group = yourmodel.objects.values('p_id').annotate(ncount=count('number')) after list of dicts pid_group this: [{'p_id': 1, 'ncount': 2}, {'p_id': 2, 'ncount': 2}] you can number value then: for pid in pid_group: number_values = yourmodel.objects.filter(p_id=pid.get('p_id')) hope helps.

c# - Call Ignore Case for Contains Method using a generic LINQ Expression -

i using below code generic filter, search text passed contains method case sensitive, how can write ignore case. public static class queryextensions { public static iqueryable<t> filter<t>(this iqueryable<t> query, string search) { var properties = typeof(t).getproperties().where(p => /*p.getcustomattributes(typeof(system.data.objects.dataclasses.edmscalarpropertyattribute),true).any() && */ p.propertytype == typeof(string)); var predicate = predicatebuilder.false<t>(); foreach (var property in properties ) { predicate = predicate.or(createlike<t>(property,search)); } return query.asexpandable().where(predicate); } private static expression<func<t,bool>> createlike<t>( propertyinfo prop, string value) { var parameter = expression.parameter(typeof(t), "f");

c# - LINQ Filter Implementation with Expressions -

in mvc4 , providing search box user search value in table. implementing generic filter condition @ server side in c# need combine multiple expressions form single expression expression<func<t, bool>> for example table columns menutext, role name (role.name mapping), actionname now if user entered in search box abc , can in of rows in shown columns, need filter. model public class menu { public string menutext {get;set;} public role role {get;set;} public string actionname {get;set;} } public class role { public string name {get;set;} } so far have implemented /// <summary> /// string[] properties property.name (menutext, actionname), including deeper mapping names such (role.name) /// </summary> public static expression<func<t, bool>> filterkey<t>(string filtertext, params string[] properties) { parameterexpression parameter = expression.parameter(typeof (t)); expression[] p

marklogic - XQuery concat not outputting document XML in expected way -

let $d := doc('foo.xml') return concat('let $d := &#xd;&#xd;', $d) returns let $d := bar i need return: let $d := <foo>bar</foo> reading function signature fn:concat , there no reason expect output xml. http://www.w3.org/tr/xpath-functions/#func-concat fn:concat( $arg1 xs:anyatomictype?, $arg2 xs:anyatomictype?, ...) xs:string that is, takes variable number of atomic items , returns string. if pass xml node, attempt atomize , return string result. if haven't run atomization yet, try string(doc($uri)) see happens. ignoring that, looks you're trying build xquery expression using string manipulation - perhaps use xdmp:eval ? that's fine, don't pass in xml using xdmp:quote . correctness, performance, , security reasons, right tool job external variable. xdmp:eval(' declare variable $input external ; let $d := $input return xdmp:describe($d)', (xs:qname('input'), $d)) better

oracle - BASH: Replacing special character groups -

i have rather tricky request... we use special application connected oracle database. control reasons application uses special characters defined application , saved in long field of database. my task query long field periodically , check changes. that, write content using bash script in file , compare old , new file md5sum. when there's difference, want send old file via mail. problem is, old file contains these special characters , don't know how replace them example string describes them. i tried replace them on basis of ascii code, didn't work. i've tried replace them appearance in file. (they this: ^p ) didn't work neither. when viewing file text editor nano characters visible described above. when using cat on file, content displayed until first appearance of such control character. as far know there know possibility replace them while querying database because of fact content in long field. i hope can me. thank in advance. marco

asp.net - how to reference different projects in one solution and access through link in MVC4 -

i have 2 projects in 1 solution 1 company.admin , other company.web, want link these 2 example if write http://localhost60693.com/web company.web view should open , when write http://localhost60693.com/admin redirect me admin panel...please me..what logic should implement in controller or action links? , guide me how publish multiple projects in mvc4? thanks as @maxs87 say, can create areas every section. if must use them in separate project, conside have multiple web application in 1 solution, have multiple sites after deploying. can create helper link cross site other or come back: public static string myredirectlink(string sitename, string controller, string action, string text) { stringbuilder result = new stringbuilder(); string url = "http://" + sitename + "/"; url = url + controller + "/" + action; result.appendformat("<a href=\"{0}\" target=\"blank\" >{1}", url,

javascript - Setting a cookie to remember hidden element state -

i'm having trouble setting cookie remember whether elements have been hidden or not. script i'm using (which came answer on here) seems work in terms of hiding or showing elements i'm trying control, doesn't appear working in terms of 'remembering' current state when reloading/changing pages. on site i'm developing, 2 pages have code: http://www.emelisandetribute.com/music.php , http://www.emelisandetribute.com/videos.php the javascript used on pages (directly before tag) follows: <script type="text/javascript"> function setcookie (name, value, expires, path, domain, secure) { document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } function getcookie (name) { var cookie = &quo

user interface - Select row from scrollarea by value - applescript ui, lync automation -

i'm trying automate osx based microsoft lync using applescript ui programming. did not idea in how select item of lync contact list value. ui inspector shows hierarchy: axapplication-axwindow:axstandradwindow-axscrollarea-axoutline-axrow:axoutlinerow-axstatictext axvalue: "audio test service - verfügbar - nur voicemail" i tried this: tell process "microsoft lync" select - ???? it great receiving idea…! tell application "system preferences" reveal anchor "output" of pane id "com.apple.preference.sound" end tell tell application "system events" tell process "system preferences" tell table 1 of scroll area 1 of tab group 1 of window 1 select (row 1 value of text field 1 "internal speakers") end tell --tell table 1 of scroll area 1 of tab group 1 of window 1 --if selected of row 1 --set selected of row 2 true --else --set selected of row 1 true

xslt for a date 90 days older than current date -

earlier have 1 field need current date, case have used following. <value><xsl:value-of select="java:format(java:java.text.simpledateformat.new('dd-mm-yyyy'), java:java.util.date.new())"/></value> now, have requirement have date not older 90 days today. please suggest me can done basing above code or have other way of doing using xslt? in case using xslt 2.0 can use this: <xsl:value-of select="current-date() - xs:daytimeduration('p90d')" xmlns:xs="http://www.w3.org/2001/xmlschema"/>

qt4.8 - Qt 4.8.4 giving error in debug mode compilation -

i have installed qt 4.8.4 visual studio 2010. qt-win-opensource-4.8.4-vs2010.exe http://download.qt-project.org/archive/qt/4.8/4.8.4/ qt project file: libs += -lqaxserver \ -lqaxcontainer in qt gui application using qaxobject access ms-excel. when compile project in release mode, not error. , gui running expected. able generate excel files using qaxobject objects. but getting following 3 errors when doing debug build: file not found: qaxcontainer.lib(qaxbase.obj) file not found: qaxcontainer.lib(qaxobject.obj) file not found: qaxcontainer.lib(qaxtypes.obj) why happen in debug builds? how solve it? edit :---- i commented libs & added config. still no change release mode compiling debug giving error. #libs += -lqaxserver \ # -lqaxcontainer config += qaxserver config += qaxcontainer now getting 7 errors :---- axserverd.lib(qaxtypes.obj) : error lnk2005: "class qcolor __cdecl olecolortoqcolor(unsigned int)" (?olecolortoqcolor@@

azure - The cloud service you have chosen is deployed in a region or affinity group that does not currently support virtual machines -

problem: i attempting add new vm second domain contoller existing domain , error when attempting add same cloud service. steps1: created virtual network assigned affinity group network (cloudag) scripted creation of vm following protocol add dc dns. as part of process cloud service created vm (dccloudservice) in affinity group. scripted creation of second vm , when attempting related same cloud service using line: $service = 'dccloudservice' (please note have amended other parameters , 100% sure command value causing conflict error) error1: the following error displayed: new-azurevm : "an exception occurred when calling servicemanagement api. http status code: 409. service management error code: conflicterror. message: specified dns name taken.. operation tracking id: 121129c1212be49c8be9f81411178a61ac." @ line:25 char:1 + new-azurevm -servicename $service -affinitygroup $ag -vms $myvm1 -dnssettings $m ... + ~~~~~~~~~~~~~~~~~~~~

SPARQL QUERY given nothing -

i have 2 graph named <http://localhost:5822/fub> & <http://localhost:5822/fub_byrn> . both graph contain metaphonecode. wanted result metaphone have same metaphonecode appear in both graph. after executing query no geting result. need , suggestion. select ?metaphone { graph <http://localhost:5822/fub> { graph ?g {} { ?s <http://localhost:2020/vocab/dbo_unidata_metaphonecode> ?metaphone . } } graph <http://localhost:5822/fub_byrn> { graph ?g {} { ?s <http://localhost:2020/vocab/dbo_fub_bayern_metaphonecode> ?metaphone . } } } limit 100 when formatted in more readable way, query is: select ?metaphone { graph <http://localhost:5822/fub> { graph ?g { } { ?s <http://localhost:2020/vocab/dbo_unidata_metaphonecode> ?metaphone; } } graph <http://localhost:5822/fub_byrn> { graph ?g { } { ?s <http://localhost:2020/vocab/dbo_fub_bayern_metap

java - How do I create a new instance of thread multiple times in same program -

i newbie please forgive me if not clear want. have java app inserts 2 mysql tables upon clicking submit, 1 on local machine , other on web server . problem have created 2 threads , 1 each . works fine first time app launched , started , when app running , try insert again clicking submit , not . again when restart app works fine first time . question how stop thread or end , start new instance of , in same instance of app. am sorry if not clear . heres code, final int m = msfuntion.getmemomoc(); thread t1 = new thread(new runnable(){ public void run() { while(runt1){ try{ for(int i=0;i<=jtable2.getrowcount();i++) { object slno= jtable2.getvalueat(i, 1); object item2= jtable2.getvalueat(i, 2); object size2= jtable2.getvalueat(i, 3); string = slno.tostring(); string si = item2.tostring(); int qt = integer.parseint(size2.tostring()); m

c# - Collection changed event for child property -

i have use following code snippet creating observablecollection binded datagrid. public class test:inotifypropertychanged { private string _name; public string name { { return _name; } set { _name = value;onpropertychanged("name"); } } private string _city; public string city { { return _city; } set { _city = value;onpropertychanged("city");} } #region inotifypropertychanged members public event propertychangedeventhandler propertychanged; public void onpropertychanged(string propertyname) { propertychangedeventhandler handler = propertychanged; if (handler != null) { var e = new propertychangedeventargs(propertyname); handler(this, e); } } #endregion } class data:inotifypropertyc

python multiprocessing scheduling task -

i have 8 cpu core , 200 tasks done. each tasks isolate. there no need wait or share result. i'm looking way run 8 tasks/processes @ time (maximum) , when 1 of them finished. remaining task automatic start process. how know when child process done , start new child process. first i'm trying use process(multiprocessing) , it's hard figure out. try use pool , face pickle problem cause need use dynamic instantiate. edited : adding code of pool class collectorparallel(): def fire(self,obj): collectorcontroller = collectorcontroller() collectorcontroller.crawltask(obj) def start(self): log_to_stderr(logging.debug) pluginobjectlist = [] pluginname in self.settingmodel.getallcollectorname(): name = pluginname.capitalize() #get plugin class , instanitiate object module = __import__('plugins.'+pluginname,fromlist=[name]) pluginclass = getattr(module,name) pluginobject = pluginclass() pluginobjectl

return value - Stored procedure for adding an application user MS SQL 2012 -

i trying write stored procedure 1 of queries adding users table. having difficulty capturing return values during success , failure. the username column in user table defined have unique constraint. this outline of stored procedure. stored procedure name: createuser parameters @username varchar(64) @firstname varchar(64) @lastname varchar(64) @md5password varchar(64) @access_control int returns identity, -1 if user exists or (-@@error) (integer) below stored procedure have written can't seem capture return value part. alter procedure [dbo].[createuser] -- add parameters stored procedure here @username varchar(64) = null, @firstname varchar(64) = null, @lastname varchar(64) = null, @md5password varchar(255) = null, @access_control int = -10 declare @return_code int begin -- set nocount on added prevent result sets -- interfering select statements. set nocount on; -- insert statements procedure here insert [dbo].[user] ([username], [firstname], [lastnam

coded ui params method doesn't work -

i attempting automate entering in values on html page using microsoft's coded ui. when use normal method (i.e. hardcoded values gotten through action recording) works fine if use params method , pass explicit value doesn't work @ all; worse yet, test not fail @ point, seems skip on step. i'm hoping can give me idea of i'm missing (if anything) when set data driven aspect of test or if there's else can try out. erik here data connection string test [deploymentitem("pfchecks\data\company.xml"), datasource("microsoft.visualstudio.testtools.datasource.xml", "|datadirectory|\company.xml", "iteration", dataaccessmethod.sequential), testmethod] and line of code trying use params method set value on field. usenterssn.methodusersyncenterssnparams.uissnoedittext = "012831444"; there 1 object in method used, uissnoedittext object. object name correct in ui map , matches named on web page itself.

php - Symfony 1.4 default query condition possible with Doctrine -

we added new column database called is_active , have modify whole code in symfony 1.4 , doctrine.. query entries match condition. i know in yii there defaultscope applied everytime automatically when query database. there in symfony. thanks lot in advance you have created getwhateverscopequery() in modeltable class, , set condition there, it's little late. better late never ;)

delete duplicate rows in large postgresql database table -

i have postgresql database 100 gb size. 1 of tables has half billion entries. quick data entry, of data repeated , left pruned later. 1 of columns can used identify rows unique. i found this stackoverflow question suggested solution mysql: alter ignore table table_name add unique (location_id, datetime) is there similar postgresql? i tried deleting group , row number, computer runs out of memory after few hours in both cases. this when try estimate number of rows in table: select reltuples pg_class relname = 'orders'; reltuples ------------- 4.38543e+08 (1 row) two solutions come mind: 1). create new table select * source table clause determine unique rows. add indexes match source table, rename them both in transaction. whether or not work depends on several factors, including amount of free disk space, if table in constant use , interruptions access permissible, etc. creating new table has benefit of tightly packing data , indexes, , table sma

Join tables from different databases, servers in SQL and C# -

i have 1 table called "eemailsentdata" belongs database "a" , table "eeventguest" belongs database "b", want make query joining these tables, possible? if both database on same sql server pretty simple. prefix table names database name , name of schema. if not on same sql instance have create connected server object , prefix table objects name. thats it create linked server: http://msdn.microsoft.com/en-us//library/ff772782.aspx

PHP parse function body from Javascript code -

i've googled lot, found nothing similar want. i have javascript code. , there particular function there. want parse javascript code (as text) in php , retrieve function body code. are there special libraries this? thanks in advance!

model view controller - How to add errors to Modelstate in Custom mediaFormatter -

i using custom media formatter read post data multipartform in webapi. handling serialization errors , validation errors in custom action filter attribute. in formatter mapping input type object imagemedia. want add serliazation errors modelstate can handle in customfilterattribute, recieve actioncontext. here code: public class imagemediaformatter : mediatypeformatter { public imagemediaformatter() { supportedmediatypes.add(new mediatypeheadervalue("image/jpeg")); supportedmediatypes.add(new mediatypeheadervalue("image/jpg")); supportedmediatypes.add(new mediatypeheadervalue("image/png")); supportedmediatypes.add(new mediatypeheadervalue("image/gif")); supportedmediatypes.add(new mediatypeheadervalue("multipart/form-data")); } public override bool canreadtype(type type) { return type == typeof(imagemedia); } public override bool canwritetype(type type)

internet explorer - Twitter Bootstrap Collapse Issue in IE-9 -

i have web application done in asp.net mvc4. using twitter bootstrap unicorn theme in application. added twitter bootstrap collapse in 1 of pages. not working in ie-9.the collapse not opening on click in ie. copied html part of collapse given in bootstrap-collapse check if have missed out class/style not working. there fix issue? did remember set data-target attribute (there's data-* attribute need set, can't recall off top of head). check out main bootstrap website show how create dropdown menu&mdash, there's clear example of data-* attributes required make work. update: actually, think collapse used different purpose—mainly hiding navbar menus when screen width changes below value when using responsive.css styles. (i've been using bootstrap 2 weeks now, love it!). there's css class called dropdown-menu . here's official twitter bootstrap documentation on dropdown menus .

gcc4.8 - MacPorts: Installing arm-none-linux-gnueabi-* fails -

i'm trying install toolchain arm cross-compilation. installed gcc 4.8. the installation of arm-none-linux-gnueabi-gcc fails following output: $ sudo port install arm-none-linux-gnueabi-* ---> cleaning arm-none-linux-gnueabi-binutils ---> computing dependencies arm-none-linux-gnueabi-gcc ---> fetching archive arm-none-linux-gnueabi-gcc ---> attempting fetch arm-none-linux-gnueabi-gcc-2005q3-2_0.darwin_12.x86_64.tbz2 http://lil.fr.packages.macports.org/arm-none-linux-gnueabi-gcc ---> attempting fetch arm-none-linux-gnueabi-gcc-2005q3-2_0.darwin_12.x86_64.tbz2 http://mse.uk.packages.macports.org/sites/packages.macports.org/arm-none-linux-gnueabi-gcc ---> attempting fetch arm-none-linux-gnueabi-gcc-2005q3-2_0.darwin_12.x86_64.tbz2 http://packages.macports.org/arm-none-linux-gnueabi-gcc ---> fetching distfiles arm-none-linux-gnueabi-gcc ---> verifying checksums arm-none-linux-gnueabi-gcc ---> extracting arm-none-linux-gnueabi-gcc ---> appl

c# Error: “Could Not Find Installable ISAM” in converting Excel file into .CSV file -

i'm working on project able convert excel files .csv file , think there problems in c# code generating , error message could not find installable isam , please me sort out problem. code: if (dlgone.filename.endswith(".xlsx")) { strconn = @"provider=microsoft.ace.oledb.12.0;data source=" + srcfile + ";extended properties=\"excel 12.0;\""; } if (dlgtwo.filename.endswith(".xls")) { strconn = @"provider=microsoft.jet.oledb.4.0;data source=" + srcfile + ";extended properties=\"excel 1.0;hdr=yes;imex=1\""; } oledbconnection conn = null; conn = new oledbconnection(strconn); conn.open(); <------------ throw exception in debug mode application throws exception (line: conn.open(); ) searched internet , found have put data source between 1 cotes doesn't work in case. both of connection strings wrong. for .xlsx, should be: strconn = @"provider=microsoft.ace.oledb.12.

ios - Bad formatting: Add JSON data to existing URL -

i need send request this: "http://api.site.com/login?q={"meta":{"api_key":"cb2f734a14ee3527b3"},"request":{"id":"username@host.name","password":"passw0rd"}}` ...the response should {"id":399205,"token":"d43f8b2fe37aa19ac7057701"} so, have tried following code: self.responsedata = [nsmutabledata data]; nsdictionary *apikeydict = [nsdictionary dictionarywithobject:@"cb2f734a14ee3527b3" forkey:@"api_key"]; nsdictionary *idpassworddict = [nsdictionary dictionarywithobjectsandkeys:@"tc-d@gmail.com",@"id", @"abc",@"password", nil]; nsdictionary *dict = [nsdictionary dictionarywithobjectsandkeys:apikeydict, @"meta", idpassworddict, @"request", nil]; nsurl *url = [nsurl urlwithstring:@"http://api.site.com/login?="]; nserror *error = nil; nsmutableurlrequest *request = [nsmutableurl

How to improve this php mysql code? -

with these codes echo rank of student regd equal $regd . in fact, working code. however, advised friend in mysql statement distinct , group by should not used together. newbie, not figure out how implement without using distinct because not return rows without distinct . can suggest me how improve these codes? <?php mysql_select_db($database_dbconnect, $dbconnect); $query_myrank = "select distinct regd, name_of_exam, name_of_student, totalscore, rank (select *, if(@marks = (@marks := totalscore), @auto, @auto := @auto + 1) rank (select name_of_student, regd, name_of_exam, sum(mark_score) totalscore cixexam, (select @auto := 0, @marks := 0) init group regd order totalscore desc) t)

asp.net - update panel is preventing JQuery from running -

i have problem on update panel preventing jquery running. when page loading jquery fraction of second after page loaded remove jquery effect it. ran jquery function on console & work fine. remove updatepanel page , work fine asking how can fix update panel problem ? as call update panel asynchronous jquery not called(loaded) during asynchronous call see update panel issue jquery try following: $(document).ready(function () { bindevents();//your jquery method }); this script tag binds bindevents method .it main use support jquery update panel call asynchronous <script type="text/javascript"> // create event handler pagerequestmanager.endrequest var prm = sys.webforms.pagerequestmanager.getinstance(); prm.add_endrequest(bindevents);// bind bindevents method support update panel </script>

ios - What am I looking for? <Error>: CGAffineTransformInvert: singular matrix -

i checked other solutions on here non problem. dont think duplicate. gives error? checked scrollview , not set 0,0 , here code imageview picker: imagepicker =[[uiimagepickercontroller alloc] init]; imagepicker.delegate=self; imagepicker.sourcetype=uiimagepickercontrollersourcetypephotolibrary; imagepicker.allowsediting=yes; self.popover=[[uipopovercontroller alloc] initwithcontentviewcontroller:imagepicker]; [self.popover presentpopoverfromrect:self.button.bounds inview:sender permittedarrowdirections:uipopoverarrowdirectionany animated:yes]; i cant see problem, can tell me looking for. first set delegate of uipopovercontroller . self.popovercontroller.delegate = self; and not sure problem presentpopoverfromrect:self.button.bounds so give proper cgrect it, might solve problem . such cgrect rect = cgrectmake(20, 50, 70, 40);// set need self.popovercontroller = [[uipopovercontroller alloc] initwithcontentviewcontroller:imgpicker]; self.popovercontr

xpages - Binding an inputText value to a viewScope with a computed name -

i have inputtext component on custom control , trying bind value viewscope, viewscope name computed using compositedata value , string. if hardcode value binding works, example: value="${viewscope['billingdate_from']}" the viewscope name computed using following javascript code: compositedata.daterangefilter[0].from_fieldname + '_from' i have tried many ways of achieving no success, errors, unexpected character errors of time inputtext box empty. the code have tried: value="${viewscope[#{javascript:compositedata.daterangefilter[0].from_fieldname + '_from'}]}" i have found, , don't know reason this, trying bind dynamically doesn't work if there's string concatenation in evaluation. way got around creating custom control accepts bindingvalue , datasource parameters, passing in document , field name want use. whatever reason, if code uses composite data, still allows editing when page loads.

javascript - overwrite $location pushState history AngularJS -

if returning user " results page " want see last filters used. using ngcookies update last used search parameters on page. controller('results', ['$location','$cookies',function($location,$cookies){ $location.search(angular.fromjson($cookies.search)); }]); //will yield: /results?param1=dude&param2=bro however, if click " back " not brought last page expect. that's because state pushed onto history unperceived user. the user landed on /results controller pushed /results?param1=dude&param2=bro onto state history. how overwrite or delete state /results " back " return me user expect last page came be? chain replace() onto end of $location.search call: controller('results', ['$location','$cookies',function($location,$cookies){ $location.search(angular.fromjson($cookies.search)).replace(); }]); this causes last history entry replaced, rather new 1 added. there

php - How to add an HTML element after two record zii.widgets.CListView widget Yii -

<?php $this->widget('zii.widgets.clistview', array( 'dataprovider'=>$dataprovider, 'summarytext'=>'', 'itemview'=>'_view', )); ?> i need output __________________________ id : 10 id : 11 name : xxx name : yyyy age : 15 age : 20 place: abc place:xyz -------------------------- id : 12 id : 13 name : aaa name : sss age : 24 age : 27 place: vvc place:xzss -------------------------- how change _view.php this? this voucher printing, need reduce paper cost, that's why seek solution. you can use html posted mohit bhansali. you'll have add more css first: .view { float: left; width: 250px; /* or other width */ } then in _view.php clear float on top, each second item. can use predefined $index variable: <?php if($index!=0 && $index%2==0): ?> <div style="clear:left"></div> <?php endif; ?>

Enterprise Architect Java API -

i'm trying find java api of ea, couldn't find information it. there code org.sparx.* want see can using it. there knows how can it? i'm using 10.0.1008 corporate edition way. the java api allows access ea:s "object model," accessible c# , in-ea scripts (which can written in vbscript, javascript or jscript). through object model can retrieve , update information in ea repository. there "add-in model" which, in addition object model functionality, allows code respond number of events triggered when user connects repository, creates diagram, initiates model validation, etc, , allows add own gui elements ea. add-in model available through .net. check file under automation , scripting - enterprise architect object model. necessary setup documented in using automation interface, , api in reference.

qt - Set background of QMainWindow central widget -

using qt 4.8.4 on windows 7 (msvc 2010) have standard qmainwindow in app toolbar. want toolbar stay grey, central widget should have white background. calling centralwidget->setstylesheet("background-color: white;") @ first seemed job, using designer-generated widget (a q_object ) doesn't. subsequently toyed around various other methods set style sheet (also using designer) no avail. to see effect, add or remove q_object line in test.h . when it's there, label gets white bg. if q_object commented out, whole central widget white. of course, want whole area white, need q_object . here's files: main.cpp: #include "test.h" class testwin : public qmainwindow { public: qwidget *centralwidget; qtoolbar *maintoolbar; testwin(qwidget *parent = 0) : qmainwindow(parent) { centralwidget = new test(this); setcentralwidget(centralwidget); maintoolbar = new qtoolbar(this); this->addtoolbar(qt::t

multithreading - What will happen two different background process access the same file in unix? -

please explain me on below cmd: touch temp.txt touch temp1.txt > temp.txt & cat temp.txt | wc -l >temp1.txt & say temp.txt file empty file. so, present in temp.txt , temp1.txt files after execution. could explain possible cases, since jobs running in background mode? it depends. cat(1) might see or nothing in input file. here's rough picture of what's going on in final 2 commands. (i'm ignoring touch(1) calls because synchronous.) who >f1 child forked, output file clobbered, output file moved child's stdout, , new program run. cat f2 | wc -l>f2 child forked, pipe made, child forked, children move pipe ends stdin or stdout appropriate, 1 child runs command open input file, other child clobbers output , on above. i don't guarantee that's shell doing -- maybe clobbers before forks, etc. -- that's close enough. so, let's put these shell commands on time dimension: [time ============================

javascript - Using jQuery in Cloud9 -

i teaching myself how program usign js, jquery, html , css. downloaded jquery-master github , use in project, still cannot import html files can utilize it. know how? appreciated! you can use js file donot need download js files need place script tag each html page trying play jquery code. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> use script , include jquery code inside script block <script type="text/javascript"> alert('hi friend') </script> hope works thanks.

javascript - How Do I use jQuery in CasperJS? -

casper.start(url, function() { casper.page.injectjs('c:/users/mike/documents/n1k0-casperjs-bc0da16/jquery-1.10.2.min.js'); var names = $('span.author-name'); this.echo(names); this.exit(); } referenceerror: can't find variable: $ what do? i've tried when creating casper instance: var casper = require('casper').create({ // i've tried both commented lines below // clientscripts: ['c:/users/mike/documents/n1k0-casperjs-bc0da16/jquery-1.10.2.min.js'] // clientscripts: ['includes/jquery-1.10.2.min.js'] }); you have evaluate jquery code in browser context using casper.evaluate execute code if using browser console. var namecount = this.evaluate(function() { var names = $('span.author-name') return names.length; }); this.echo(namecount);

php - 301 redirects of subpages -

there lots of questions these redirects didn't worke me. we moving site domain , redirect links new domain, including sub pages. i'm using hostgator made 301 redirect cpanel front page goes new domain www.etilerprep2go.com --> www.iqworldinc.com etilerprep2go.com --> www.iqworldinc.com but need subpages redirect because of google ranks etc. mean want link http://www.etilerprep2go.com/egitimlerimiz-etiler-ingilizce-kursu/ should go http://www.iqworldinc.com/egitimlerimiz-etiler-ingilizce-kursu/ well couldn't manage that. @ moment code looks @ end of htaccess: rewritecond %{http_host} ^.*$ rewriterule ^(.*)$ "http\:\/\/www\.iqworldinc\.com\/$1" [r=301,l] any advice how that? thanks in advance. edit: managed adding categories , other pages manually as; options +followsymlinks rewriteengine on redirectmatch ^/$ http://www.iqworldinc.com redirect 301 /hakkimizda-etiler-levent-ingilizce-kursu http://

c# - Compare Two Liste <T> -

how can compare 2 list ? public class pers_ordre : iequalitycomparer<pers_ordre> { int _ordreid; public int lettrevoidid { { return _lettrevoidid; } set { _lettrevoidid = value; } } string _ordrecummul; public string ordrecummul { { return _ordrecummul; } set { _ordrecummul = value; } } // products equal if names , product numbers equal. public bool equals(pers_ordre x, pers_ordre y) { //check whether compared objects reference same data. if (object.referenceequals(x, y)) return true; //check whether of compared objects null. if (object.referenceequals(x, null) || object.referenceequals(y, null)) return false; //check whether products' properties equal. return x.lettrevoidid == y.lettrevoidid && x.ordrecummul == y.ordrecummul; } // if equals() returns true pair of objects // gethashcode() must return sam

caching - Rails cache from the console returning nothing nil -

i unable see in cache console in either development or production. for development, have turned on caching , set memory store, in production use dalli gem , memcachier on heroku. every key try comes nil. however, in development, if put in binding.pry before somewhere i'm doing rails.cache.fetch , can rails.cache.read there , see returning, , indeed if so, execution not go in fetch 's block. from console, if try rails.cache.read ing same key returned cached result in pry breakpoint console, nothing. seems console has separate cache, if console rails.cache.write("whatever", "blah") , rails.cache.read("whatever") , "blah" in return, expected. is there way experiment cache running server console? change cache store: memory store stores in process's memory, every instance of application have separate cache. in particular console won't see set running web application. you use file store (which stores data in