Posts

Showing posts from June, 2014

mysql - Self joining table view -

i have table containing non-unique leads, need group contain unique, recent (column date ) leads. id lead_id status date ----- ------ -- ------------------- 26199 666842 ok 2013-06-19 12:00:09 56199 376842 ok 2013-06-19 12:00:09 58322 376842 ok 2013-06-21 12:11:59 60357 376842 ok 2013-06-24 12:22:00 61431 376842 ok 2013-06-25 12:18:02 62365 376842 ok 2013-06-26 12:16:04 63202 376842 ok 2013-06-27 12:14:08 63983 376842 er 2013-06-28 12:12:06 so in example above should have 2 leads result: id 26199 , 63983 both ones max(date) while being group by lead_id. i tried left joins, max , group aggregation, don't know i'm doing wrong. select a.lead_id, max(a.created) created rawlead left join rawlead b on b.created = a.created group a.lead_id unfortunatelly cannot use subqueries, cause need present them in view. no subqueries :) select l1.* lead l1 left join lead l2 on l1.date <

c# - XML Serialization - different result in .NET 4.0 -

please see code below writes xml out file simple class containing list of 3 objects. 3 objects in list descend each other, base, derived1, derived2. use xmlarrayitemattributes override names during serialization. works fine in .net 3.0, outputs different result in .net 4.0. please see below outputs, noting second descendant item deriveditem2. has experience , how might fix work in .net 4.0 did in v3.5? it seems cannot control order in array items overridden. doesn't appear order in added xmlarrayitems. edit: i've tried same example using mono against framework versions 4.0 , 4.5 , works fine those. bug microsoft framework versions? using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using system.collections; using system.xml.serialization; using system.xml; using system.xml.schema; using system.io; namespace windowsformsapplication1 {

mysql - how to add date and time with backupfile name using mysqldump from command prompt and to define the path of backupfile -

im using command backup mysqldump mysqldump -uroot -ptrackerdb) --alldatabases >test.sql now want add date-time backup file current date , time e.g test_25july2013_13:00 for add test_ date +%y-%m-%d_%h-%m-%s .sql in file name gives error 'couldn't find table': date +%y-%m-%d_%h-%m-%s` what i'm doing wrong here? i'm using that: linux mysqldump -u <user> -p <database> | bzip2 -c > <backup>$(date +%y-%m-%d-%h.%m.%s).sql.bz2 windows (googled it, because have been using lin only) @echo off cls echo date format = %date% echo dd = %date:~0,2% echo mm = %date:~3,2% echo yyyy = %date:~6,4% echo. echo time format = %time% echo hh = %time:~0,2% echo mm = %time:~3,2% echo ss = %time:~6,2% echo. echo timestamp = %date:~6,4%-%date:~3,2%-%date:~0,2%-%time:~0,2%-%time:~3,2%-%time:~6,2% %mysqldir%\mysqldump -u %mysqluser% -p%mysqlpassword% -h %mysqlhost% -p %mysqlport% --databases --routines --verbose gnucash_shockwave > %ba

jquery - Populate two different combo boxes using AJAX at a time -

i have 3 combo box: department, courses, activities. department combo box load departments department table. need load courses in 1 combo box , activities in combo box belong department. table schema shown below. department table ---------------- | dept | name | ---------------- | 1 | dept1 | | 2 | dept2 | ---------------- department course table ---------------------- | cid |dept | course | ---------------------- | 1 | 1 | abc | | 2 | 1 | xyz | | 3 | 1 | pqr | | 4 | 2 | bar | | 5 | 2 | foo | ---------------------- department activities table --------------------------- | aid | dept | activities | --------------------------- | 1 | 1 | foo1 | | 2 | 1 | foo2 | | 3 | 1 | foo3 | | 4 | 2 | bar1 | | 5 | 2 | bar2 | --------------------------- department combo box load dept 1 , dept

java - Is there a way to find out which bundles are using my Bundle? -

i'm building osgi framework , wondering if there way bundles bound mine? it's because offer service bundles, , make new resources optimize preformence while offering service. offer way destroy resources when no longer needed, want failsafe when bundle unbinds without first deleting used resources. can use bundlecontext this? you seem asking 2 different questions. in first paragraph you're asking bundles bound you, interpret mean bundles import exported packaged. in second you're asking consumers of services; these orthogonal issues. for first question, can use bundlewiring api: bundlewiring mywiring = mybundle.adapt(bundlewiring.class); list<bundlewire> exports = mywiring.getprovidedwires(packagenamespace.package_namespace); (bundlewire export : exports) { bundle importer = export.getrequirerwiring().getbundle() } for services, can use servicefactory pattern. registering service instance of servicefactory rather directly instance of se

Django signal receiving across apps -

i have main_app , , app2 . main_app list of items data, , app2 has more information said items. main_app isn't supposed know app2 , app2 can import main_app . within main_app/signals.py , have import django.dispatch mysignal = django.dispatch.signal(providing_args=['uid']) in main_app/views.py , have view renders various main_templates , containing details of item, view editing, , 1 submitting said edited data. idea signal sent when each of called and, app2 receives this. main_template uses " with " call template2 , app's information. in app2/processes.py have following: import django.dispatch django.dispatch import receiver import models main_app.signals import mysignal, (mysignal2, etc) then each method, have @receiver(mysignal) def foo(sender, **kwargs) etc ok... so, in main_app/views.py , if have line: from app2.processes import mysignal, mysignal2 etc everything works smoothly. want remove reliance on app2 in main_app .

is it possible to generate Amazon SES credentials from existing amazon ec2 account? -

we using elastic email sending emails our customers but due technical reasons our team wants change amazon ses, we want generate amazon ses credentials using amazon ec2 account. is possible generate amazon ses credentials existing amazon ec2 account? if yes please me.. thanks in advance what mean generate credentials?? aws comes feature called iam, identity , access management, have look, hope looking similar service,one can access ses account using ses api or smtp settings.

sql - View already being created in Database now recompiling gives error ORA-00998: must name this expression with a column alias -

my view in database column alias not mentioned after expression in select query: select a.column1, a.column2, decode (a.column3,'hahaha', b.column21 || ' : ' || a.column4 || ' bye : ' || d.column31, b.column22) , a.column5 , b ,d a.column1 = b.column21 , a.column2= d.column31 (+); what unable understand if need recompile same view gives error ora-00998: must name expression column alias. understand decode expression missing alias name . but surprises me how got database. am unable understand . plz let me know how might have got db.

javascript - FineUploader does not show error messages -

if have implemented fine uploader , can upload files. have set allowed extensions allow pdf. but when try upload , jpg instance nothing happens. normally not problem see message. works on fineuploader website not me. hope can me. code: createupload({ button: $('#dienstverleningsdocumentuploader'), endpoint:'/adviseur/profile/dienstverleningsdocument/' + '@model.adviseur.servicedocumentid', messages: $('#dienstverleningsdocumentmessage'), allowedextensions: ['pdf'] }); function createupload(options) { var button = options.button[0];//should jquery $(...) var endpoint = options.endpoint; var allowedextensions = options.allowedextensions || ['doc', 'xls', 'docx', 'xlsx', 'pdf']; var sizelimit = options.sizelimit || 10000000;// 10mb var itemlimit = options.itemlimit || 10; var messages = options.messages || $('#messages'); var complete = options.complete; return new qq.fineuploaderbasic

magento - Magmi stock status issue -

each product in magento has indiviual minimum qty in stock i use magmi update stock external csv file. issue on successful updation of csv , magmi not refer minimum qty value set product "in stock" or "out of stock" so products endup being "in stock" , when edit , save product in admin sets right. above scenario explained again: if current qty= 1 & mim_qty = 05 , in csv qty= 100 after magmi run (re-indexing done) new qty= 100 , can see @ front end @ list.phtml next current qty= 100 & mim_qty = 05 , in csv qty= 3 after magmi run (re-indexing done) new qty= 3 , **i can see @ front end @ list.phtml** following setting common in bot case manage stock = 1; use_config_manage_stock = 1; min_qty = 05; if want min_qty parsed magmi, need provide input magmi beside qty value. magmi relies 95% on input data , not current existing db data (except not replicate select/multiselect option

Create rectangle shape drawable with two side curved corner in android -

i create shape drawable resource xml file create background 2 side curved corner. here post code of shape drawable. not give me right result. give me 4 side curved image. wanted know how create 2 side curved shape image. thanks <shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="#0579cd" /> <corners android:bottomleftradius="0dp" android:bottomrightradius="0dp" android:topleftradius="15dp" android:toprightradius="15dp" /> <padding android:bottom="8dp" android:left="8dp" android:right="8dp" android:top="8dp" /> just pass miner value non-curve corner field. in case: <corners android:bottomleftradius="0.1dp" android:bottomrightradius="0.1dp" android:topleftradius="15dp" android:toprightradius="15dp" /> and 1 thing more. preview

javascript - moment.js - UTC gives wrong date -

why moment.js utc show wrong date. example chrome's developer console: moment(('07-18-2013')).utc().format("yyyy-mm-dd").tostring() // or moment.utc(new date('07-18-2013')).format("yyyy-mm-dd").tostring() both of them return "2013-07-17" why returning 17th instead of 18th , passed in. but if use momentjs without utc: moment(new date('07-18-2013')).format("yyyy-mm-dd").tostring() i "2013-07-18" expect when using moment.js utc. does mean cannot correct date when using moment.js utc? by default, momentjs parses in local time. if date string (with no time) provided, time defaults midnight. in code, create local date , convert utc timezone (in fact, makes moment instance switch utc mode ), when formatted, shifted (depending on local time) forward or backwards. if local timezone utc+n (n being positive number), , parse date-only string, previous date. here examples illustrate (my l

php - Why is this code an infinite loop? -

before completing code, tested mistake , realized not stop: $var = "any"; ($i=1; $i < 2; $i++){ $var.$i = "any"; } why produce infinite loop? , why doesn't php produce error? i did simple test : echo $i; $var.$i = "any"; var_dump($var); result : 1string(3) "any" anzstring(3) "any" so $i transformed "anz" , doesn't pass validation out of loop. $var.$i = "any"; not correct, don't know trying do, if want fill , array should more : $var = array(); ($i=1; $i < 2; $i++){ $var[] = "any"; } if want change string letter letter : $var = "any"; ($i=1; $i < 2; $i++){ $var[$i] = "a"; // asign new letter string @ $i position }

php - Mysql Selects in nested loops -

i have table named people : id | name |parent_id ---+------+--------- 1 | john | 0 2 | jane | 1 3 | james| 1 4 | jack | 0 5 | jim | 4 6 | jenny| 4 so john parent of jane , james. tree goes this. john -jane -james jack -jim -jenny i want make table seems like <table border="1"> <tr> <th colspan="2">john</th> </tr> <tr> <td>-</td><td>jane</td> </tr> <tr> <td>-</td><td>james</td> </tr> <tr> <th colspan="2">jack</th> </tr> <tr> <td>-</td><td>jim</td> </tr> <tr> <td>-</td><td>jenny</td> </tr> <table> to this, use 2 sql queries. here pseudo-code: <?php $firstquery = 'select id, name people parent_id = 0'; start creating table whi

Ant not picking up the Junit File with Junit Target -

i'm using junit ant target running junits. when run junit file separately junit ran properly. when tried ant script junit test case not executed. showed me error as, running x.simpletest [junit] testsuite: x.simpletest [junit] tests run: 1, failures: 0, errors: 1, time elapsed: 0 sec [junit] tests run: 1, failures: 0, errors: 1, time elapsed: 0 sec [junit] caused error [junit] x.simpletest [junit] java.lang.classnotfoundexception: x.simpletest [junit] @ java.lang.classloader.loadclass(classloader.java:252) [junit] @ java.lang.classloader.loadclassinternal(classloader.java:320) [junit] @ java.lang.class.forname0(native method) [junit] @ java.lang.class.forname(class.java:247) [junit] @ org.eclipse.ant.internal.launching.remote.eclipsedefaultexecutor.executetargets(eclipsedefaultexecutor.java:32) [junit] @ org.eclipse.ant.internal.launching.remote.internalantrunner.run(internalantrunner.java:424) [j

Dgrid-OnDemandGrid Virtualscrolling -

i using dgrid ondemandgrid jsonrest store.on scrolling,i taking 40 records database. var grid= new ondemandgrid({ store: jsonstore, columns: layout, minrowsperpage : 40, maxrowsperpage : 40, loadingmessage: "loading data...", nodatamessage: "no results found." }, "grid"); on first time ,i getting response header content-range items=0-39/132 .on further scrolling ,the response header content-range items=38-78/132 instead of 40-79/132. can tell me how response 40-79/132 , 80-119..etc.. add queryrowsoverlap: 0 object you're passing grid constructor. queryrowsoverlap defaults 1, , reason queries overlap. property intended counteract issues dojo/store/observable "dropping" items @ page boundaries, though isn't perfect solution.

java - Why does netty example for HttpStaticFileServer use RandomAccessFile? -

is there specific reason netty httpstaticfileserverhandler example use randomaccessfile? i think can demonstrate use of chunkedfile , requires randomaccessfile . , reason seems chunkedfile needs able file's length. if not using https, need not use chunkedfile . can choose fileinputstream instead of randomaccessfile returns filechannel . cannot filelength fileinputstream required input defaultfileregion . think necessary use randomaccessfile . that's correct. however, potentially file length other way; e.g. using file.length() . actually, doesn't make difference way filechannel , file length.

centering - How to center an image with fluid layout in Twitter Bootstrap 2.3.2? -

i using bootstrap own site , struggle in centering single jpg image. i use following code <header class="row-fluid"> <div class="span4 offset4"> <img src="img/yup.jpg" title="hello" alt="world";> </div> <div class="title span12"> <h1>hello kitty</h1> </div> </header> but still image not centered... wrong here? many thanks!! try this <header> <div class="row-fluid"> <div class="span5 offset2"> <center><img src="img/yup.jpg" title="hello" alt="world"></center> </div> </div> <div class="row-fluid"> <div class="title span12"> <h1>hello kitty</h1> </div> </div> </header> update : based on comment when use row-fluid, cr

ios - Sending 10000+ push notifications but not all devices receive it -

for our ios news apps send out more 10000 push notifications registered devices, somehow not devices seem receive notification. have been doing years received user feedback stating did not receive push notification while did register device receive them. our logs show these specific devices registered , there no errors sending push notification, somehow apns not deliver notification. have seen removing app device , reinstalling solves problem still concerned. we think must apple's service fails deliver push notification sometimes, when comes sending large amounts of notifications. of experienced this? the apple docs says this: important: delivery of notifications “best effort”, not guaranteed. have checked payload size? per apple's documentation, maximum size allowed notification payload 256 bytes.

python - How to force IPython to see an updated library? -

i following in ipython notebook: import sys sys.path.append('my_directory') db import * it works fine. added new function db.py , ipython not see it. ok. not see if reset end re-execute cell imports everything. not see if user reload. not see if close ipython notebook , restart it. what way force ipython (or python) see updated content of file? you need use autoreload. check manual @ http://ipython.org/ipython-doc/dev/config/extensions/autoreload.html . seems need: %autoreload 2 the above automatically reload imported modules. except inlcuded in separate special list of modules specified %aimport modulename. autoreloaded if specify %autoreload 1.

javascript - What is x.fn.x.init[] value shown for $() and $(this) in chrome dev tools -

Image
i have habbit of debugging js , jquery script in developer tool. realized chrome dev tools showing x.fn.x.init value $() , $(this). dont realize these value: code <!doctype html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <script src="jquery-2.0.2.min.js" ></script> <script src="jquery.ui.widget.js" ></script> <title></title> <script type="text/javascript"> $(document).ready(function () { var outstring = ""; outstring = "" + $() + $(this); }); </script> </head> <body> </body> </html> this real code behind instantiating $ take @ github source jquery.fn = jquery.prototype = { // current version of jquery being used jquery: core_version, constructor: jquery, init: function( selector, context, rootjquery )

javascript - Same Origin Policy - Displaying Ads -

i've got difficult problem iframes, origins, ads , on. so have started new website, mockrs.com , , i'm trying place ads there generate revenue. ad code looks this: <aside id="leftad" class="adwrapper160x600"> <div class="ad"> <script language="javascript" type="text/javascript" charset="utf-8"> cpxcenter_width = 160; cpxcenter_height = 600; </script> <script language="javascript" type="text/javascript" src="http://ads.cpxcenter.com/cpxcenter/showad.php?nid=4&amp;zone=22607&amp;type=banner&amp;sid=18035&amp;pid=17900&amp;subid="> </script> </div> </aside> this code should render ads , does, they're 'placeholder' ads. real ads not rendered because of error. chrome says this: blocked frame origin " http://ads.cpxce

Find All the controls in a form using jQuery or javascript -

i starter in jquery . how find controls in form using jquery? i know code this function submitvalidator(){ $("form :input").each(function(){ }); i want access id's , need apply regular expressions some of text boxes numeric remaining alphanumeric. there method sort them apply regular expressions? you can add new property data-charset in html <input type="text" id='amt' data-charset='numeric'> add controlles want add after "form :" function submitvalidator(){ $("form :text, textarea").each(function(){ var numericonly = "^[0-9]*$"; var svid = $(this).attr('id'); if($(this).attr('data-charset') == 'numericonly') { if(!$(this).val().match(numericonly)) { alert("numeric");

flex - extracting xml cdata with actionscript 3 -

i have been racking brain trying extract cdata xml no success. here code. <?xml version="1.0" encoding="utf-8"?> <mx:application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:s="library://ns.adobe.com/flex/spark" creationcomplete="mydata.send();" backgroundcolor="white" > <mx:httpservice id="mydata" resultformat="e4x" url="./assets/rawxml.xml" result="handleresult1(event)"/> <mx:script><![cdata[ import mx.collections.xmllistcollection; import mx.rpc.events.*; [bindable] private var firstname:string; [bindable] private var myxml:xmllist; private function handleresult1(event:resultevent):void{ myxml = event.result.row; each(var sitexml:xml in myxml){ firstname = sitexml..sc_df_field_3.text(); } } ]]> </mx:script> <mx:textarea text = "{firstname}"

unit testing - How to override mocked response of $httpBackend in Angular? -

is possible override or re-define mocked response in mocked $httpbackend? i have test this: beforeeach(inject(function ($rootscope, $controller, _$httpbackend_) { $httpbackend = _$httpbackend_; //fake backend $httpbackend.when('get', '/myurl').respond({}); //empty data server ...some more fake url responses... } this fine cases have few tests need return different same url. seems once when().respond() defined can not change afterwards in code this: different response in single specific test: it('should work', inject(function($controller){ $httpbackend.when('get', '/myurl').respond({'some':'very different value long text'}) //create controller //call url //expect {'some':'very different value long text'} returned //but instead response defined in beforeeach })); how do that? code untestable :( the docs seem suggest style: var myget; beforeeach(inject(function ($

javascript - How do I move one <div> in front of another <div>, and back? -

i have 2 divs. 1 in front, , want 1 move right, , on top of first one. used jquery, changes z-index immediately, , proceeds moving 1 div right , left it's original position. how i've tried it: <!doctype html> <html> <head> <style> .block { position: absolute; background-color: #abc; left: 0px; top:30px; width: 60px; height: 60px; margin: 5px; } .block1 { position: absolute; background-color: red; left: 0px; top:30px; width: 60px; height: 60px; margin: 5px; z-index: 999; } </style> <script src="js/jquery-1.10.2.min.js"></script> </head> <body> <div class="block" onmouseout="hide();"></div> <div class="block1" onmouseover="show();"></div> <script> function show() { $(&q

Regex string replacement in Notepad++ -

i have following format in file: 011890111,mfcd00005493 i need turn of lines into: update [dbname].iwfs_part_search_tb set mdl_number='mfcd00005493' condensed_part_number = '011890111'; i don't know of way can use regex within notepad++ take matches , wrap matches , use them within want replace them rather replacing entire match. can me out here? try this: find what: ([0-9]+),([a-z]+[0-9]+) replace with: update [dbname].iwfs_part_search_tb set mdl_number='$2' condensed_part_number = '$1'; then make sure regular expression checked. what happening? ([0-9]+) - paranthesis signify "capture group", [0-9]+ means "one or more" of number. , - comma, not in capture group or anything... comma ([a-z]+[0-9]+) - capture group, contains 1 or more capital letters followed 1 or more numbers. the "capture groups" above can used within "replace with" field in notepad++ using $ followed inde

cultureinfo - C# DateTime conversion same culture on different machines -

if run console app test italian machine: static void main(string[] args) { string date = datetime.now.tostring("yyyy-mm-dd hh:mm", new cultureinfo("it-it")); console.writeline(date); console.readkey(); cultureinfo ci = new cultureinfo("it-it"); console.writeline("time: " + ci.name + " " + ci.datetimeformat.timeseparator); console.writeline("date: " + ci.name + " " + ci.datetimeformat.dateseparator); console.readkey(); } displays: 2013-07-25 15:40 time: it-it : date: it-it / but if run code usa server: 2013-07-25 15.40 time: it-it . date: it-it / why different format separator time part? correct 1 italian must : you found out data time separator italian changed between versions of windows (colon more up-to-date version). expected improving our data. if found because of transferring data between machines, sh

jquery - Always retrieving old value (but not new value) from editable DataTable during onblur -

i trying work on creating datatable has editable columns. best example have been able find located on datatables own website: http://www.datatables.net/release-datatables/examples/api/editable.html . everything works except issue have somehow capturing new value user entered and, onblur, send new value on server side. value sent on original value , not new value user has entered in. note: use handler.ashx handler retrieves new value on server side. here code display datatable: $(document).ready(function() { var otable = $('#example').datatable({ "sajaxsource": "displaytable.ashx", "aocolumns": [ { "stitle": "examcode"}, { "stitle": "division" }, ], "fndrawcallback": function() { $('td').editable( 'handler.ashx', { "submitdata": function ( value, settings ) {

browser cache - Javascript cached -

when updates in .js , clients browser old version , have press ctrl + f5 clean cache , browser can download new version. i know browsers, once cached, doesn't download doc same name. have 100 web pages js , question is: -do have create versions of js, doc.1.3.js? if yes, in case, have upload 100 pages every time change js. -how you, developers, threat issue, considering easy way maintence , control version? google has write on caching, specifically, using http headers cache-control: max-age, , last-modified: browser check, , latest files when needed. in case, , in peoples cases, whenever last-modified. https://developers.google.com/speed/docs/best-practices/caching if need more info on http headers, i've found helpful in past: http://net.tutsplus.com/tutorials/other/http-headers-for-dummies/

java - EclipseLink Sql-Server IDENTITY_INSERT ERROR -

using eclipselink, trying insert rows sqlserver legacy db has auto-incrementing identity column: create table [dbo].[tcontacts] ( [conidcontact] [int] identity (1, 1) not null , [concontactname] [varchar] (100) not null , ... i using 'identity" strategy described in http://en.wikibooks.org/wiki/java_persistence/identity_and_sequencing#example_identity_xml <orm:id name="id"> <generated-value strategy="identity"/> <orm:column name="conidcontact" updatable="false" /> </orm:id> eclipselink produces following sql: call: insert tcontacts (conidcontact, concontactname, ... values (?, ?, ... bind => [null, testheini_2, ... resulting in following exception: internal exception: com.microsoft.sqlserver.jdbc.sqlserverexception: ein expliziter wert für die identitätsspalte kann in der tcontacts-tabelle nicht eingefügt werden, wenn identity_insert auf off festgelegt ist. error code:

java - How to express dependency in a UML Class Diagram? -

i following 2 classes: class { void foo(){ b object= new b(); object.baar(); } } class b { void baar(){ } } how express class a using class b class diagram (which arrow use)? whenever 1 classes has reference/uses another, said have dependency on it. in example class a uses class b . therefore class a has dependency on class b . can uses uml dashed line open arrow described here . this general relationship. one class depends on if independent class parameter variable or local variable of method of dependent class. if class a had instance variable, use association link instead.

Boost shared_ptr and c++ references. What's wrong here, exactly? -

the code below create chain of b's, traversed method f. as presented below, code doesn't work. each traversal goes 1 level deep. i've learned chain should return shared_ptr, question why doesn't work? #include <iostream> #include <boost/shared_ptr.hpp> class b { public: b() { } b(const b& b) { } b& chain() { b = boost::shared_ptr<b>(new b()); return *b; } void f() { std::cout << << " " << bool(b) << std::endl; if (b) return b->f(); return; } boost::shared_ptr<b> b; }; int main() { b b0; b b1 = b0.chain(); b b2 = b1.chain(); b0.f(); b1.f(); b2.f(); } because when assign non-reference variables b1 , b2 , copies made. , since have copy-constructor nothing, member variable not copied. either remove copy-constructor, or implement properly.

javascript - How can I group an array of objects by month? -

i'm using javascript. have array contains data in format: [ {"user_name":"user1","last_successful_connect":"1373978337642"}, {"user_name":"user2","last_successful_connect":"1374515704026"}, {"user_name":"user3","last_successful_connect":"1374749782479"} ] (the numbers above represent utc date/time in milliseconds. i group (count) data month. this: [ {"month":"january, 2014","user_count": 2}, {"month":"february, 2014","user_count": 1}, ] i use jquery if simplifies matters. this looks map reduce problem. high-level solution follows: re-organize members of list. count them. here step-by-step how-to achieving this: map iterate through list of dictionaries convert datetime string javascript datetime object. use month-year key , list of dic

html - How can I detect mobile keys from a web application? -

summary of desired behavior: have html video (that can hosted anywhere such youtube, vimeo, etc) inside of .jsp webpage. when user plays video, changes fullscreen-mode , starts presentation. if user taps on [return key] of device, need show alert window. behavior must work windowsphone, blackberry, iphone , android devices, now, we're taking efforts on windowsphone diminish problem's scope. how can implement such behavior? appreciated.

properties - Setting of "Disabled" Property in jQuery Not Working for Touch Event -

for example, piece of jquery code: $("#my_button").prop("disabled", true); the code can prevent button responding mouse click events correctly. button continues responding touch events on mobile devices regardless of setting of "disabled" property. so i'm wondering if there way disable button or other elements preventing them responding user interactions. many thanks! you may .unbind() events listeners

c# - word add-in, KeyDown handling on combobox in customui -

blockquote need customui in word add-in. have <combobox /> in custom ui. how can handle enter pressing user ? need perform actions when user presses enter in combobox . can add keydown event somehow or maybe cast iribboncontrol useful? update : made decision not include functionality. still interested in solution problem. even windowselectionchange event wont you. works other key press not enter , backspace (as aware of). you have use low level keyboard hook edited* * there callback when of key been pressed called. private static intptr hookcallback( int ncode, intptr wparam, intptr lparam) { if (ncode >= 0 && wparam == (intptr) wm_keydown) { int vkcode = marshal.readint32(lparam); //check if enter key pressed if (vkcode == (int) keys.enter ) // here whatever need }

asp.net - UpdatePanel issue when using javascript only controls -

included below markup page have using fineuploader control. i've abridged code include important parts. page 2 parts both reside in updatepanel. first part simple table contains rows of data, last column of each row asp:linkbutton. second part nested updatepanel contains div in fineuploader control rendered when page first loaded (because fineuploader control strictly javascript , not further exist in code-behind). also, when linkbutton pressed this.page.ispostback false . the problem time linkbutton in first part of page pressed, fineuploader control disappears. cannot code re-render code-behind (with things clientscript.registerstartupscript/registerclientscriptblock ). i've tried various setups wrapping part 1 updatepanel still wipes out fineuploader control. i'm thinking i'm using update panels incorrectly, not sure (asp.net not work in). as added detail, if click button inside part 2 nested updatepanel, fineuploader control magically reappears.