Posts

Showing posts from 2013

Lotus notes database migration to Db2 -

i want migrate lotus notes db db2 , got read answers convert csv file format using scripts , import csv file in db2. can 1 me how convert data csv ....and how time take if data size approximately 30 mb ? thanks raj it pretty trivial export notes data csv. you can modify class wrote export views csv. jus have process fields in document. can find source code @ http://blog.texasswede.com/export-notes-view-to-excel-with-multi-value-fields/ if want export documents xml , include attachments and/or embedded images can @ tool wrote: http://www.texasswede.com/websites/texasswede.nsf/page/notes%20xml%20exporter 30 mb not much, take longer write agent run it. :)

make div height automatically adjust to viewport using css -

i want show data in table should scroll when data in tbody exceeding viewport height. here jsfiddle: http://jsfiddle.net/91zxh69r/ i able make scroll using { max-height: 200px; overflow: auto; } but problem here height getting fixed because of max-height: 200px . how can make tbody height adjustable according viewport using css ? can please ? thanks you wrap table div , stretch wrapping div on height: html <div class="tablewrapper"> <table> ... </table> </div> css: .tablewrapper { height: 100%; overflow: auto; }

javascript - Show new field after button click -

i want make field shows after button click. heres code far: <div class="control-group" style="display:none" id="passwordfield"> <label class="control-label">password:</label> <div class="controls"><input id="pw" type="password"></div> </div> the "display:none" makes invisible, after have button , javascript should change display "block", making visible again. <div style="padding-left: 160px;padding-bottom:20px"> <button class="btn btn-primary" onclick="showpwfield()">log-in</button> <script> function showpwfield() { document.getelementbyid("passwordfield").style.display = "block"; } </script&

javascript - How do I return the response from an asynchronous call? -

i have function foo makes ajax request. how can return response foo ? i tried return value success callback assigning response local variable inside function , returning one, none of ways return response. function foo() { var result; $.ajax({ url: '...', success: function(response) { result = response; // return response; // <- tried 1 } }); return result; } var result = foo(); // ends being `undefined`. -> more general explanation of async behavior different examples, please see why variable unaltered after modify inside of function? - asynchronous code reference -> if understand problem, skip possible solutions below. the problem the a in ajax stands asynchronous . means sending request (or rather receiving response) taken out of normal execution flow. in example, $.ajax returns , next statement, return result; , executed before function passed success callback

python - RuntimeError: the sip module implements API v11.0 but the PyQt4.QtCore module requires API v11.1 -

i'm trying install gnuradio repo, using homebrew. i'm on osx 10.10.2. the install keeps failing , saying sip , pyqt modules ahave mismatched api versions. i've done searching , things seem indicate should remove sip pyqt, install sip, , build pyqt against that. i've tried approach several times using brew uninstall sip , brew uninstall pyqt reinstalling them , doesn't seem work. ==> python setup.py install --prefix=/usr/local/cellar/gnuradio/head/libexec file "/usr/local/cellar/python/2.7.9/frameworks/python.framework/versions/2.7/lib/python2.7/multiprocessing/pool.py", line 251, in map return self.map_async(func, iterable, chunksize).get() file "/usr/local/cellar/python/2.7.9/frameworks/python.framework/versions/2.7/lib/python2.7/multiprocessing/pool.py", line 558, in raise self._value runtimeerror: sip module implements api v11.0 pyqt4.qtcore module requires api v11.1 thanks suggestions!

c# - Azure Mobile Service .NET Backend HttpResponseMessage return null Content -

i had function in web api of mobile service declared public httpresponsemessage post(loginrequest loginrequest) { easyparkcontext context = new easyparkcontext(); user user = context.users.singleordefault(a => a.username == loginrequest.username); if (user != null) { if (bcrypt.net.bcrypt.verify(loginrequest.password, user.password)) { claimsidentity claimsidentity = new claimsidentity(); claimsidentity.addclaim(new claim(claimtypes.primarysid, user.id)); claimsidentity.addclaim(new claim(claimtypes.nameidentifier, loginrequest.username)); loginresult loginresult = new easyparkloginprovider(handler).createloginresult(claimsidentity, services.settings.masterkey); return this.request.createresponse(httpstatuscode.ok, loginresult); } } return this.request.createresponse(httpstatuscode.unauthorized, "invalid username or password"); } and function declared in clie

How to display the username of a user after successful login in google maps v3 c#? -

i'm working on tracking system project in asp.net c#. i've implemented login section , made use of "session" track users. have map (google map v3) being displayed on homepage shows user his/her current location after successful login. want retrieve value of username , display on map. i've tried keep value of username in html element , try access javascript alas! didn't work! appreciated. expose username through webmethod in c# , grab when generate marker using ajax. similar this: function grabuser() { $.ajax({ type: "post", url: urltomethod, data: "{}", contenttype: "application/json; charset=utf-8", datatype: "json", success: function (msg) { alert(msg.d); } }); } [system.web.services.webmethod] public static string user() { return username; }

Spring lookup-method instance creation -

spring lookup-method attribute used method injection helps creates fresh instances every time when method invoked. container dynamically creates subclass class , overrides method. but, me 1 instances created normal injection , method injection. have posted complete code have tried. want understand how lookup-method working , how different normal injection. <bean id="processor" class="org.requestprocessor"> <lookup-method name="getresourcea" bean="resourcea"/> </bean> <bean id="resourcea" class="org.resourcea"/> <bean id="resourceb" class="org.resourceb"/> public abstract class requestprocessor { @autowired resourceb resourceb; public resourceb getresourceb(){ return resourceb; } abstract resourcea getresourcea(); } public class resourcea { string url ="http://localhost:8080"; public resourcea(){

Add, delete table row, column with jQuery -

Image
i have trying make functionality adding, cloning , deleting of table row , column. table has 4 columns initially. <tbody> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </tbody> i have made functionality. but, i'm facing issue @ time of adding row. main functionality of adding row have written is: if there existing row clone last row , add clone row after last row else add row 4 columns well, adding 4 columns inside else{} . because, table has 4 columns . should fine. but, problem there options deleting/adding column too. example, if delete column, total number of column 3 . if accidentally delete row, try add row again, add a new row 4 columns table has 3 columns . avoid kind of situation, should not add static 4 columns inside else {} but, don't understand how handle issue. please, me fix issue. ****************************update************************** aft

wicket 6 - AjaxButton onSubmit not called -

i have not understand in wicket. created ajax button override method onsubmit() linked html page. once press button method not call. here java code: ajaxbutton savebutton = (ajaxbutton) new ajaxbutton("save_ext", form) { @override protected void onerror(ajaxrequesttarget target, form<?> form) { super.onerror(target, form); //to change body of generated methods, choose tools | templates. system.out.println("save button ajax error"); } @override public void onsubmit(ajaxrequesttarget target, form<?> form) { system.out.println("save form"); }.setoutputmarkupid(true); form.add(savebutton); here html: <button type="submit" value="save" wicket:id="save_ext" class="btn btn-success" id="buttonsave_ext" onclick="savefunction()">save</button> do have idea how solve problem. thanks

c# - Saving related entities with a repository in a disconnected application -

we starting develop disconnected application , 1 problem comes again again repositories , aggregates. use ef. one example brand s , manufacturer s, have m:n relationship. 1 manufacturer can have 1 or more brands. the ibrandrepository<brand> contain crud methods brands. so if edit brand, load manufacturers assigned brand. object graph mapped view model contains brand's properties , list<manufacturer> of manufacturers. the question is, best approach when saving brand using repository? manufacturers assigned brand may deleted, other manufacturer may have been added. 1. logic best placed in ibrandrepository? if so, 1 query database before saving brand decide each manufacturer if added, edited, or deleted. 2. should there separate repository ibrandmanufacturerrepository, concerned assign brand manufacturer? as aggregate root, save brand , assigned manufacturers using ibrandrepository -- call savechanges() make sure happens in 1 database transaction. if th

javascript - mobile detection full site link -

when using js code mobile browser detection - http://detectmobilebrowsers.com how can add "view full site" button mobile page? i found this: [link on site: http://example.com?fullsite=true'>link full site] then add end of detect mobile browsers js. if (document.cookie.indexof('fullsite') > -1) { return; // skip redirect } i pretty new js need bit of on how add this. i found solution you: what need: jquery 1.7+ modernizr get code this github repo. , ad website. ad following button. <div class="rwd-display-options"> <span id="view-full" class="rwd-display-option">view full site</span> </div> you can more information , support the website of developer

algorithm - Searching for an element in log(n) time -

i came across following question: suppose modify given sorted list of 4n distinct numbers follows: keep elements in positions (positions 2, 4, 6, ... 4n) are. form n disjoint pairs (i,j) on odd numbered positions = 2k+1 k = 0 n−1 , j = 2k+1 k = n 2n−1. now swap elements in positions , j every such pair. (i.e. every element in odd numbered position in first half of array swapped element in odd numbered position in second half of array. no element involved in more 1 swap (i.e. swaps disjoint). don’t know these (i,j) pairs except element in odd numbered position in first half of array swapped element in odd numbered position in second half. given element x, explain how can determine whether or not x in (new reshuffled) array in o(logn) time. honestly, not sure how approach one. given x, can search whether exists @ numbered position using binary search. numbers in odd positions no longer sorted. any appreciated. thanks! you can determine whether element x in

vb.net - Me.close() not working in VB -

i'm having trouble vb. have database connected vb. when start debugging connection opens close connection have button it. have button close form. code in me.close() . won't work gives me error "property access must assign property or use value" i can't figure out why, tried put close connection button gives me same error. btw i'm using visual studio 2012 there object or control name "close" somewhere. change name of object resolve issue. when there object named "close", me.close() refer object, not close method of form, , error returned.

Magento fronted - file not found when admin hosted on different server -

my website divided in 4 server. fronted - front.mysite.com admin panel - admin.mysite.com cdn images - cdn.mysite.com database server when upload new product images. auto sync on cdn server admin server. media folder exits on admin , cdn server not in fronted server. i set cdn.mysite.com media url (secure & unsecure) in admin server. my issue product images not display on front.mysite.com server. other images display (category & cms pages). do set base media url cdn url trailing slash? mean: http://cdn.mysite.com /

java - NumberFormat for report formatting -

Image
i'm trying quick report in java , i'm having issues formatting numbers. here's have now: messageformat lineformat = new messageformat("{0}\t{1,number,#,##0}\t {2,number,#0}\t\t {3,number,#0.00}"); the problem array index 1 (and 3 some) hundreds , thousands , setting eliminates positions, have on output: feb 16, 2015 414 42 9.86 feb 17, 2015 1,908 81 23.56 feb 19, 2015 786 43 18.28 feb 20, 2015 1,331 99 13.44 i want index 1 , index 3 parameters align on right instead of left report looks neat. i have read decimalformat , numberformat java docs , googled , can't seem find solution. when want format strings far alignment, using string.format() sufficient enough alignment. references: http://www.homeandlearn.co.uk/java/java_formatted_strings.html java string align right public static void main(string[] args) throws exception { // prints number, 10 characters right justified

javascript - Writing commonjs module and load it using require (not using relative path) -

what best pratice referencing local commonjs module without using relative path below? var custmod= require(‘custommodule’); custmod(true); custmod.save(‘foo’); is there reference building module this? if wrote module below, getting undefined when call custmode.save(12); module.exports = custommodule;function custommodule(mode) { var mode = 1; return { save: function (value) { console.log(mode, value) }, get: function (id) { console.log(mode, id) } } you can add path require check using require.paths.push('/my/path'); or require.main.paths.push('/my/path'); depending on node version. then if custommodule.js exists @ /my/path/custommodule.js , can use require('custommodule'); do note though, you'd need on every module intend use method on.

jsf - When is it necessary or convenient to use Spring or EJB3 or all of them together? -

i'm little confused mixed use of jsf2+spring+ejb3 or combination of those. know 1 of spring principal characteristics dependency injection, jsf managed beans can use @managedbean , @managedproperty anotations , dependency injection functionality. ejb3 i'm more confused when use along jsf or if there reason use it. so, in kind of situation idea use spring+jsf2 or ejb3+jsf2? until have created small web applications using jsf2 , never needed use spring or ejb3. however, i'm seeing in lot of places people working stuff together. first of all, spring , ejb(+jta) competing technologies , not used in same application. choose 1 or other. spring or ejb(+jta). won't tell choose, tell bit of history , facts can easier make decision. main problem they're trying solve providing business service layer api automatic transaction management. imagine need fire multiple sql queries perform single business task (e.g. placing order), , 1 of them failed, of cours

django rest framework 3.1 Handle create/update in ModelSerializer where do i validate the nested data? -

i try create , update resources using nested representation. i took here -> http://www.django-rest-framework.org/api-guide/serializers/#writable-nested-representations . don't know put validation verify nested resources, not defined id, exists. json { "name": "this name" "network": { "code": "existing_code", "operator": "existing_op" }, } create method of serializer def create(self, validated_data): network = validated_data.pop("network") #this throw doesnotexist exception !!!! validated_data["network"] = network.objects.get(operator=network["operator"], code=network["code"]) instance = manny.common.models.deliverypoint.objects.create(**validated_data) return instance is okay check in validator directly on modelserializer: validate method of serializer def validate(self, data): #some code here...

java - How to open an empty gantt chart? -

in web java application need create many projects need open new empty gantt everytime want, problem table tasks contains other projects , if want create new project page display old tasks, can trick, please help. index.html <form action="newgantt.html"> <input type="submit" value="gantt" > </form> newgantt.html <body> <div id="gantt_here" style="width:100%; height:500px;"></div> <script type="text/javascript"> gantt.config.xml_date = "%y-%m-%d %h:%i"; gantt.config.scale_unit = "day"; gantt.config.duration_unit = "day"; gantt.config.date_scale = "%d"; gantt.init("gantt_here"); gantt.load("conector"); var dp = new dataprocessor("conector"); dp.init(gantt); conector.java @override protected void configure(httpservletrequest req, httpserv

node.js - Koding - Yeoman - AngularFullStack Cannot Create Scaffolding -

Image
hello using koding cloud based ubuntu development environment. i've managed install prerequisites required yeoman angular fullstack. installed below items sudo npm install -g yo grunt-cli bower karma sudo npm install -g generator-angular-fullstack after installing above. i've created abltd directory (folder structure shown below) and ran following command yo angular-fullstack abltd it ran end , throwing following error. 1070 error error: eacces, mkdir '/home/abitandco/tmp/npm-1293-ikfhqnho' 1070 error { [error: eacces, mkdir '/home/abitandco/tmp/npm-1293-ikfhqnho'] 1070 error errno: 3, 1070 error code: 'eacces', 1070 error path: '/home/abitandco/tmp/npm-1293-ikfhqnho', 1070 error parent: 'abltd' } 1071 error please try running command again root/administrator. 1072 error system linux 3.13.0-29-generic 1073 error command "/usr/local/bin/node" "/usr/local/bin/npm" "install" 107

xcode "copy files" build phase and symlinks -

Image
i have cmake projects generates xcodeproj. in xcodeproject copies openal*.dylib bundle's /framework directory. openal (from alsoft) has 3 .dylib files: a) openal.dylib, 17 bytes, symlink pointing (b) b) openal.1.dylib, 22 bytes, symlink pointing (c) c) openal.1.16.0.dylib, 483 kb, actual library these files copied in "copy files" now when build application bundle looks this: (a) openal.dylib, 22 bytes - assume (b) above (b) openal.1.dylib, 483 kb - (c) (c) openal.1.16.0.dylib - library itself, 483 kb. so apparently follow symlink "1 level deep"... ? how can xcode "follow symlinks end" ? i'd openal.dylib 483kb in bundle. read on should follow symlinks, shouldn't recursively 'to end' ? quick workaround delete/overwrite openal.dylib openal.1.16.0.dylib... better alternatives xcode follow symlink-chain end ?

MissingPropertyException in grails -

i have problem when try show view of 1 of domains. built method sum quantities, have error , don't know how fix it. understand variable awards not exist, have value in domain. here code of method in controller gives me error. uri /rewards/customer/show/1 class groovy.lang.missingpropertyexception message no such property: awards class: rewards.customer around line 14 of grails-app/services/rewards/calculationsservice.groovy 11: 12: def gettotalpoints(customerinstance){ 13: def totalawards = 0 14: customerinstance.awards.each{ 15: totalawards = totalawards + it.points 16: } 17: customerinstance.totalpoints = totalawards around line 33 of grails-app/controllers/rewards/customercontroller.groovy 30: 31: def show(long id){ 32: def customerinstance = customer.get(id) 33: customerinstance = calculationsservice.gettotalpoints(customerinstance) 34: [customerinstance: customerinstance] 35: } 36: controller (customercontroller.groovy) packag

swift - Cannot invoke 'filter' with an argument list of type '((_) -> _)' -

sounds ridiculous, i'm unable fix piece of code: self.runningscripts.filter({ $0 != scriptrunner }) no matter how write closure error: cannot invoke 'filter' argument list of type ' ((_) -> _) ' runningscripts defined this: var runningscripts = [scriptrunner]() and scriptrunner swift class (does not inherit nsobject) i'm using same in many other places without problems. suggestions? you can error if didn't make scriptrunner conform equatable : class scriptrunner : equatable { // rest of implementation here } func ==(lhs: scriptrunner, rhs: scriptrunner) -> bool { return ... // change whatever test satisfies lhs , rhs equal }

objective c - iOs memory stress test -

i'm trying simulate behaviour of component under heavy memory load. the main idea allocate bunch of memory, keep resident, work component, no matter do, memory allocate on purpose seem disappear somehow. after first test using strong nsarray of nsdata chunks (1mb each), tried rougher lower level approach (to prevent arc magic happen): // somewhere after includes static char *foo[max_chunks]; [...] // function called, checked :) - (void) allocatememorychunks:(int) chunks ofsize:(long) bytes { for(int = 0; < chunks; ++i) { foo[i] = (char *) malloc(bytes); } } no matter set chunks , bytes , long memory can allocated, 'disappears' memory count in xcode , leaves me usual meager 2mb consumed application (i'm talking of allocations in range of 400 chunks of 1024 * 1024 bytes, or 1 chunk of 400 * 1024 * 1024 bytes, what's worth...). the memory outside reach of arc (i'm using plain c mallocs!) yet, can't see (note same happened whe

mysql - Play - Execute an sql statement without writing the database configuration in application.conf -

i writing scala application using playframework. don't want write database configuration in application.conf file. instead have function similar 1 given below. want send configuration parameters arguments of function. want create connection , execute statement. btw, database mysql database. def run_sql(sql: string, host: string, user: string, pass: string, port: string, dbname: string): unit = { // **** create connection **** db.withconnection { conn => { val statement = conn.createstatement(resultset.type_forward_only, resultset.concur_read_only) try { statement.execute(sql) } catch { case e: exception => logger.warn("error executing dml %s. %s".format(sql, e.getmessage)) } } } } is possible? if how? hope have made question clear. if have confusion please ask. in advance. // **** create connection **** here can write val driver = play.

sql server - LINQ equivalent of my SQL Query for UNION ALL -

Image
(select * sheethay sheetstatus = 2) union all(select * sheethay sheetstatus = 1) union (select * sheethay sheetstatus = 0) union all(select * sheethay sheetstatus= 3) i result set this: i mean '2' together, '0' together, '3' ( no '1' in table yet). when use linq , union them see result on grid in order of sheetid, primary key. mean see order of sheets displayed 15,23,25,27,28,29 etc. want sql result set.23,43,25,28 etc ienumerable<sheethay> listtwos = get(linq query twos); ienumerable<sheethay> listones = get(linq query ones); ienumerable<sheethay> listzeros = get(linq query zeros); ienumerable<sheethay> listthrees = get(linq query threes); .... return listtwos.union(listzeros).union(listones).union(listthrees); let me know if need other information. thanks. you don't need use multiple queries can use case in order by in sql , similar way in linq. sql: select * sheethay sheetstatus in(

java - How do I solve IabHelper Error -

i have error on 264 , 163 of 2 file in editor it's fine line 264 : if (!mcontext.getpackagemanager().queryintentservices(serviceintent, 0).isempty()) { line 163 : mhelper.startsetup(new iabhelper.oniabsetupfinishedlistener() { i can't find why activity unable start logcat: 1266-1266/com.exercise.androidhtml e/androidruntime﹕ fatal exception: main java.lang.runtimeexception: unable start activity componentinfo{com.exercise.androidhtml/com.company.clipboard.androidhtmlactivity}: java.lang.nullpointerexception @ android.app.activitythread.performlaunchactivity(activitythread.java:2059) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2084) @ android.app.activitythread.access$600(activitythread.java:130) @ android.app.activitythread$h.handlemessage(activitythread.java:1195) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(looper.java:137) @ android.app.activitythread.main(activitythread.java:4745) @ java.lang.re

Support for Link headers in ServiceStack -

i planning generate link headers sake of pagination of rest api results. for reference, http://www.w3.org/protocols/9707-link-header.html describes how should use link headers describe our results in pages. are there c# classes or approaches in servicestack can resuse rather writing own classes , making sure link headers rfc compliant. http://tools.ietf.org/html/rfc5988#page-6 it desirable if build linkheader object, populate relevant data , have framework take care of formatting correctly , inserting header. is there such thing? have others done?

How to deserialize json to sealed trait using playframework in scala? -

i'm new in scala , got stuck in object deserialization. appreciate help. so problem is, have sealed trait permission , case objects extend it: sealed trait permission case object administrator extends permission case object dispatcher extends permission case object editor extends permission case object normaluser extends permission object permission { def valueof(value: string): permission = value match { case "administrator" => administrator case "dispatcher" => dispatcher case "editor" => editor case "normaluser" => normaluser case _ => throw new illegalargumentexception() } def stringvalueof(value: permission): string = value match { case administrator => "administrator" case dispatcher => "dispatcher" case editor => "editor" case normaluser => "normaluser" case _

virtual machine - Copy Docker container from boot2docker under OS X -

i have boot2docker running on os x 10.10. i used docker install conceptnet5 , 50gb big database takes days download location. now, requested ubuntu vm conceptnet5 running on in docker container me. so, avoid downloading again, wondered if there way transfer conceptnet5's container boot2docker newly created ubuntu vm. here docker container i'm using. you work save , load command. the save command produces tarred repository of image. contains parent layers, , tags. $ docker save myimage -o myimage.tar # or better, gzip using unix pipes $ docker save myimage | gzip > myimage.tar.gz now have tarball layer , metadata can pass around, offline, usb keys & stuff. to load back, it's load command. load command work following compression algorithm : gzip , bzip2 , xz . $ docker load -i myimage.tar.gz # or pipes $ docker load < myimage.tar.gz it's little bit easier running private registry, both works well.

java - Create a mock calling a constructor -

suppose have following class: class person { private string name; private integer id; public person(string name){ this.name=name; this.id=random(); } int random() { return new random().nextint(); } } it's possible create partial mock person class calling constructor mocked random() method? mean this: person a=easymock.createmockbuilder(person.class) .withconstructor(string.class) .withargs("albina") .addmockedmethod("random") .createmock(); i differently: use dependency injection "insert" random object: public person(random rand, string name) { this.random = rand ... and public person(string name) { this(new random(), name) ... then can create ordinary object of class; using mocked random. very often, think "complicated" solutions somehow test our production code. wrong approach: if code hard test; change code!

JSF + Liferay: Cannot send parameters from a bean to another -

i've tried methods, nothing works, in destination @postconstruct parameter null. i sending redirect beana page (backed beanb) , trying extract parameter beanb. requirement not add parameters url. i tried methods: facescontext.getcurrentinstance().getexternalcontext().getsessionmap().put("userid", userid); @sessionscoped bean, ec.getflash().put("userid", userid); any suggestions? redirecting with: facescontext facescontext = facescontext.getcurrentinstance(); facescontext.getexternalcontext().redirect(url); the portlet api knows 2 session scopes: portlet_scope , application_scope the default bridge maps attributes in session map portlet_scope , means attributes visible portlet. if want write , read session attributes portlets, have use: portletsession session = ((portletsession) facescontext.getcurrentinstance(). getexternalcontext().getsession(true)); // set session.setattribute(attributename, value, portletsessi

c++11 - Using char16_t, char32_t etc without C++ 11? -

i have fixed width types including character types. <stdint.h> provides types integers, not characters, unless when using c++11, can't do. is there clean way define these types ( char16_t , char32_t , etc) without conflicting defined c++11 in case source ever mixed c++11 ? thank :) checking whether types supported platform-dependent thing, think. example, gcc defines: __char16_type__ , __char32_type__ if these types provided (requires either iso c11 or c++ 11 support). however, cannot check presence directly, because fundamental types, not macros: in c++, char16_t , char32_t fundamental types (and header not define such macros in c++). however, check c++ 11 support. according bjarne stroustrup's page: __cplusplus in c++11 macro __cplusplus set value differs (is greater than) current 199711l. so, basically, do: #if __cplusplus > 199711l // has c++ 11, can assume presence of `char16_t` , `char32_t` #else // no c++ 11 suppor

c# - How get Attribute Value in CodeAttribute -

i wrote method attribute value property: public string getattributevaluebynameattributeandproperty(codeclass cc, string nameattribute, string nameproperty) { var value = ""; foreach(codeattribute ca in cc.attributes) { if(ca.name.contains(nameattribute) && ca.value.contains(nameproperty)) { value = ca.value.remove(0,ca.value.indexof(nameproperty)); value = value.replace(" ",""); if(value.contains(",")) value = value.remove(ca.value.indexof(",")); } } return value; } for example: have attribute [map(name = "menuitem, availability" )] i call getattributevaluebynameattributeandproperty( codeclass, "map" , "name") after method codeattribute.value , return string: name = "menuitem, availability" after remove "

java - Fest swing gui framework, strange output -

i testing swing gui. using fest framework. i have following input: window.textbox("txtdatabaseconnectionstring").entertext("jdbc:oracle:thin:10.254.202.27:1521:db"); it starts fill in textbox following values: jdbc.oracle.thin&a and test crashes... i following exception output java.lang.illegalargumentexception: invalid key code '46' @ org.fest.swing.core.roboteventgenerator.presskey(roboteventgenerator.java:116) @ org.fest.swing.core.basicrobot.dopresskey(basicrobot.java:633) @ org.fest.swing.core.basicrobot.keypressandrelease(basicrobot.java:618) @ org.fest.swing.core.basicrobot.type(basicrobot.java:589) @ org.fest.swing.core.basicrobot.entertext(basicrobot.java:572) @ org.fest.swing.driver.jtextcomponentdriver.entertext(jtextcomponentdriver.java:126) @ org.fest.swing.fixture.jtextcomponentfixture.entertext(jtextcomponentfixture.java:208) @ gui.guitest.shouldcopytextinlabelwhenclickingb

java - hibernate - cascading type persist for many to many relationship -

i have 2 classes policy , acl. have manytomany relationship in them. // policy public class policyentity { @id @generatedvalue(strategy = generationtype.sequence) @column(name = "policy_id") private int policyid; @column(name = "policy_name") private string policyname; @manytomany(cascade = cascadetype.persist) @jointable(name = "policy_acl",joincolumns=@joincolumn(name = "policy_id"), inversejoincolumns=@joincolumn(name = "acl_id")) private list<aclentity> acllist = new arraylist<aclentity>(); } // acl public class aclentity { @id @generatedvalue(strategy = generationtype.sequence) @column(name = "acl_id") private int aclid; @column(name = "acl_name") private string aclname; @manytomany(mappedby = "acllist") private list<policyentity> policylist = new arraylist<polic

android - My broadcast receiver class not responding for volume button press? -

i'm using broadcast receiver on volume button press creating shortcut call. broadcast receiver not responding volume button press , not getting exception also. here androidmanifest.xml class <receiver android:name="com.abc.utilities.callbroadcastreceiver" > <intent-filter> <action android:name="android.media.volume_changed_action" /> </intent-filter> </receiver> my broadcastreceiver class @override public void onreceive(context context, intent intent) { // todo auto-generated method stub if(intent.getaction().equals("android.media.volume_changed_action")){ lod.d("broadcast", "volume button pressed."); } } i try code want , it's work. 1) defined broacastreceiver in manifest : ... <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@strin

oracle - Find records with overlapping date range in SQL -

i have following table , data: create table customer_wer( id_customer number, name varchar2(10), surname varchar2(20), date_from date, date_to date not null, constraint customer_wer_pk primary key (id_customer, data_from)); insert customer_wer values (4, 'karolina', 'komuda', '01-jan-00', '31-mar-00'); insert customer_wer values (4, 'karolina', 'komuda', '01-apr-00', '30-jun-00'); insert customer_wer values (4, 'karolina', 'komuda', '15-jun-00', '30-sep-00'); insert customer_wer values (4, 'karolina', 'komuda', '01-oct-00', '31-dec-00'); insert customer_wer values (4, 'karolina', 'komuda', '01-jan-01', '31-mar-01'); insert customer_wer values (4, 'karolina', 'komuda', '01-apr-01', '30-jun-01'); insert customer_wer values (4, 'karolina', 'komuda', '01-jul-01&#

android - Encode bitmaps to movie using MediaCodec and MediaMuxer with custom presentation time for each image -

i trying create movie series of bitmaps. target api 19 take advantage of api 21 if available on device. i have been reading bigflake cts tests encodeandmux , encodedecodetest here i use mediacodec , mediamuxer classes , not ffmpeg or jcodec etc. i appreciate pointing out going wrong , how fix it. new android , struggling days! testing on samsung galaxy note 3 update: able reach eos codec error when trying release encoder. here updated code: public void createmovie(view view) { log.v(tag,"creating movie"); //1. prepare encoder , gpuimageview try { prepareencoder(); presentationtime = 0; int j = 0; (int = firstimageindex; <= lastimageindex; i++) { log.v(tag, "inloop: " + i); //1 durationinnanosec = (long) ((float) durations.get(j) * 100000); //get image int imageid = imageids[i];