Posts

Showing posts from February, 2010

javascript - Bootstrap tooltip showing behind modal window -

i have modal window consists div : <div class="input-group"> <div class="input-group-addon" title="insert here domain account name" data-toggle="tooltip" data-placement="left" id="account"> @html.label("domain account name", new { @class = "control-label" }) </div> <div class="a"> @html.textboxfor(model => model.login, new { @class = "form-control" }) @html.validationmessagefor(model => model.login) </div> </div> as can see, there tooltip on label. it's initalized code: $('#account').tooltip({ container: 'body' }); the code working, tooltip showing behind modal. tried setting z-index of tooltip this: .tooltip { z-index: 1151,!important; } or #account { z-index: 1151,!important; } but none of them worked. can suggest how should set css make tooltip s...

binary - what are bits and bitwise operations used for? -

can please explain, in simple, simple terms why need bitwise operators? started programming 1 month ago. i understand stored in binary form. understand computers count in base 2. , understand bitwise operators. don't understand kind of programming require using bits , bitwise operators? i tried answer on web, , read binary flags , disabilities, , got more confused. i guess i'm wondering, kind of real life application require bits , bitwise operators? you can pack data in concise format. the smallest amount x86 computer can adress byte - that's 8 bits. if application has 24 yes/no flags (bools), store them in 1 byte each? that's 24 bytes of data. if use bits, each byte contains 8 of bools - need 3 bytes 24 yes/no values: > 1 byte per flag: > 0000 0000 = off > 0000 0001 = on > easy check: if(b == 0) { /* flag off */ } else if(b == 1) { /* flag on */ } > 1 bit per flag > 0011 1101 = flags 1, 4, 8, 16 , 32 on, flags 2, 64 , 128 of...

How to extract date with format 2014 January 1? PHP -

i have code. want extact 2014 january 1 in string keep on getting null $paragraph = "today 2014 january 1"; preg_match_all('/(\d{4}/) \b(?:jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may?|jun(?:e)?|jul(?:y)?|aug(?:ust)?|sept(?:ember)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?) (\d|\d{2}) ', $paragraph, $date); var_dump($date); but var_dump($date) returns null try following, had adjustments regexp. $paragraph = "today 2014 january 1, , tomorrow 2015 march 12"; $date = array(); // find dates preg_match_all('@((?:\d{4}) (?:jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may?|jun(?:e)?|jul(?:y)?|aug(?:ust)?|sept(?:ember)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)) (?:\d{1,2}))@', $paragraph, $date); // display results echo '<pre>'; print_r($date[0]); echo '</pre>'; // iterate on results $total = count($date[0]); for($i=0;$i<$total;$i++){ // use following if want change display format date...

QR algorithm for tridiagonal matrix -

i have matrix. used householder algorithm , found tridiagonal matrix. now, want decompose q matrix, r matrix. then, i'll use results calculate eigenvalues , eigenvectors of matrix. can me resolve problem? thanks perhaps problem can solved via qr decomposition .

QT 5.2 has no kit or qmake with MingW after installation -

i downloaded qt 5.2 build mingw/opengl build , installed it. when run qtcreator , try create project, can't set because there no kit available choose from. have mingw installed, tried point qt installation, there qmake missing. i'm not sure if manual configuration of compiler suffice have kit choose from, expectation. so question is, how setup qt recognizes mingw installation , how qmake continue qt? after downloading 600mb package have expected works out of box. os windows 7 , mingw uses gcc 4.8 should same version qt brings in it's package well.

sql server - SQL Time Conversion -

i having trouble conversion of time. i have table called 'totaltime' set int , holds time in seconds only. want convert these seconds days, hours, minutes, seconds e.g. 01d 09:26:43. now show code using: select [buildid],[product],[program], sum(case when [state] = 'running' cast(totaltime int) else 0 end) [running], sum(case when [state] = 'break' cast(totaltime int) else 0 end) [break] [line_log].[dbo].[line1log] group [buildid], [product], [program] so can see grouping [state] column , display results of 'totaltime' in format mentioned above. now have tried code not work cannot convert int varchar select [buildid],[product],[program], sum(case when [state] = 'running' cast(floor(totaltime / 86400) varchar(10))+'d ' + convert(varchar(5), dateadd(second, totaltime, '19000101'), 8) else 0 end) [running] [line_log].[dbo].[line1log] group [buildid], [product], [program] the above not display in exact format...

How to load Proxy Auto Config (PAC) file in Android with java -

i want create proxy application connectting specific web sites proxy. thinking using pac file in application, didn't find source this. how can load pac file programmatically in android? if there isnt way this, how can set proxy rule in android java?

python - How to create a Pandas DataFrame from String -

in order test functionality create dataframe string. let's testdata looks like: testdata="""col1;col2;col3 1;4.4;99 2;4.5;200 3;4.7;65 4;3.2;140 """ what simplest way read data pandas dataframe ? simple way use stringio , pass pandas.read_csv function. e.g: import sys if sys.version_info[0] < 3: stringio import stringio else: io import stringio import pandas pd testdata=stringio("""col1;col2;col3 1;4.4;99 2;4.5;200 3;4.7;65 4;3.2;140 """) df = pd.read_csv(testdata, sep=";")

hadoop - Load data from Cassandra -

i using cassandra 1.2.12 , want load data cassandra using java code, forced use limit in query. using datastax api fetch data cassandra. lets assume keyspace 'k' , columnfamily 'c' , read data c on condition results in 10 million records, since getting time-out exception limited 10000, , i know cant limit 10001 20000.... , want load full 10 million records, how can solve problem.? what you're asking called pagination, , you'll have write queries where key > [some_value] set starting boundary each slice want return. correct value use, you'll need @ last row returned previous slice. if you're not dealing numbers, can use function token() range check, example: select * c token(name) > token('bob') token() may required if you're paging partition key, disallows slicing queries. example (adapted datastax documentation ): create table c ( k int primary key, v1 int, v2 int ); select * c token(k) > toke...

view - Use uncached / uncompiled laravel blade template -

is possible use uncompiled / uncached laravel blade view stack trace doesn't report : c:\xampp\htdocs\laravel\app\storage\views\952767ebe8bae04dc9f53b45e5aa8047 but rather original name : c:\xampp\htdocs\laravel\app\views\view.blade.php view cache in core of laravel's view, don't think can easily, but, in quick dirty @ this, can delete remaining views every time application starts, won't have many of them around, should fast. foreach(file::files(app::make('path.storage').'/views') $file) { file::delete($file); }

c++ - Async Socket IO -

to refresh , expand c++ knowledge trying implement fcgi application , implement fcgi interface myself. however, have no expierience using sockets. research has lead me boost.asio, lack of socket knowledge find hard use library tutorials, code examples, , browsing apireference when not know looking difficult. questions: which tutorial(other 1 coming wiht boost.asio)/book recommend read on sockets/asynchronus io? for fcgi find hard understand benefits of asyncio, header has decode first , data can received, how 1 benefits asynchronus i/o? is there heuristic know parameters (number of threads, sockets per thread, socket multiplexing(yes(how many connections?)/no, async io, buffersize) yield thebest performance fcgi interface? i recommend (for free) beejs networking guide or (for pay) w richard stevens book on sockets. aio (in case) method of multiplexing multiple connections. if don't have multiple connections won't see benefit. it's fastest though har...

testng - Incorrect test suites order in reportng html report -

Image
my test launch consists of test suites specified in testng.xml. in html reportng report see test suites logs in incorrect order in comparison run , specified run them in xmls. do have idea how fix it? thanks in advance! update (to antonio): i'm sorry samples in russian i see following in reportng html test report: it's totally incorrect order in comparison actual tests running order (and testng xml test suite): <suite name="fullsuitename" verbose="1"> <suite-files> <suite-file path="thisis5thsuiteonthefigure.xml"/> <suite-file path="thisis3rdsuiteonthefigure.xml"/> <suite-file path="thisis4thsuiteonthefigure.xml"/> <suite-file path="thisis1stsuiteonthefigure.xml"/> <suite-file path="thisis2ndsuiteonthefigure.xml"/> </suite-files> </suite> test reports each test suite shown in correct ord...

c++ - Qt Signals and Slots - nothing happens -

i'm trying connect qml signal c++ slot unsuccessfully. i had on several other examples think didn't got how root object of qml document... my problem is, seems signal sent qml file, not received in cpp file. there no errors when execute code. //counter.h #ifndef counter_h #define counter_h #include <qobject> class counter : public qobject { q_object private: int counter; public: explicit counter(qobject *parent = 0); signals: void counterhaschanged(int); public slots: void click(); }; #endif // counter_h //counter.cpp #include "counter.h" #include <qdebug> counter::counter(qobject *parent) : qobject(parent) { this->counter = 0; qdebug() << "class counter created"; } void counter::click() { this->counter++; qdebug() << "clickregistered() - emit counterhaschanged()"; emit counterhaschanged(counter); } //main.cpp #include <qtgui/qguiapplication> ...

Convert String name into javascript variable name? -

this question has answer here: “variable” variables in javascript? 7 answers problem example: variable name: var product5519 = 10; i can name in form of string i.e var str = "product5519" is there way convert variable name can use value assigned product5519 i know 1 way solve problem i.e using eval(str) if there way solve please tell? once creating global variable right thing do, can add variable window object, so: window[str] = 42; this works because variable lookups end trying window object if variable not defined in inner scope.

winapi - raw input handling (distinguishing secondary mouse) -

i writing pices in winapi's raw input seem working though not sure how reliable (unfaliable) (and if working on systems machines etc, bit worry) also there appears many question, 1 i use first (i mean normal/base mouse) in old way, processint wm_mousemove etc , moving arrow cursor, secondary mouse need processing raw_input (primary can stay untouched rawinput), problem is 1) how can sure mouse detected rawinput secondary? 2) second mouse moves arrow -cursor, if disable ridev_nolegacy both not moving cursor (it bacame hourglass) , wrong too think maybe should setup bit differently setrup rawinput function like void setuprawinput() { static rawinputdevice rid[1]; rid[0].ususagepage = 0x01; rid[0].ususage = 0x02; rid[0].dwflags = 0; // rid[0].dwflags = ridev_nolegacy; / rid[0].hwndtarget = null; int r = registerrawinputdevices( rid, 1, sizeof(rid[0]) ); if (!r) error_exit("raw input register fail"); } ...

date - format a DateTime in php with format "JJJJ-MM-TTTss:mmZZZ" -

i'm trying format date google specifies format it the format specified google : " jjjj-mm-tttss:mmzzz " what tried far is: var_dump(date_format($date,'y-m-d h:m:s')); results in "2013-aug-wed 18:08:37" when try uses googles format var_dump(date_format($date,'jjjj-mm-tttss:mmzzz')); it results in jjjj-augaug-cestcestcest3737:0808720072007200" i have no idea should like, help? thanks in advance what this? $date = date_create(); print date_format($date, 'y-m-d\th:it'); output: 2014-03-24t10:43cet

css JavaScript widget overrides my stylesheet -

morning, i writing site includes widget via javascript. for reason widget has embedded line in stylesheet: * { color:#000 } because widget loads after page seems overide text within page. i have added !important styles within sites css file need different color, not work. i have asked widget supplier why has line because many black & white sites use widget hes not keen on removing line. is there way of overriding or removing line (via jquery maybe) ? many thanks how being bit more specific widget? using instance id of wrapping div, or body?

activemq - Connect exception when discovering active mq queues using hermes JMS -

Image
i have created active mq session in hermes jms. when try discover queues on broker connect exception: in session properties should have specified serviceurl like: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi this specifies url jmx connector active mq. active mq must running jxm connector @ port hermes jms connect it. check port open: netstat -lntp | grep 1099 or check active mq startup log. must show line like: info | jmx consoles can connect service:jmx:rmi://localhost:1593/jndi/rmi://localhost:1099/jmxrmi if there no jmx connector on port, edit activemq.xml in conf directory of active mq installation. change createconnector true : <managementcontext> <managementcontext createconnector="true"/> </managementcontext> restart active mq.

javafx - Set Graphic to label -

i want set label graphic. tested code: private static final imageview liveperformicon; static { liveperformicon = new imageview(mainapp.class.getresource("/images/flex.jpg").toexternalform()); } final label label = new label(); label.setstyle("-fx-background-image: url(\"/images/flex.jpg\");"); liveperformicon.setfitheight(20); liveperformicon.setfitwidth(20); label.setgraphic(liveperformicon); but don't see image. the way found make work this: label.setstyle("-fx-background-image: url(\"/images/flex.jpg\");"); is there way solve this? not sure, afaik controls should created on javafx application thread, you're creating imageview in static initializer, i'm not sure if it's executed on application thread. besides: want liveperformicon static???

python - Number/Version Paddings in Maya -

i trying write out code doing number/ version padding tried search thru internet, however, able find mel example in works doesn't make sense me (most not understand how works) $padding = 3; $num = 5; string $pad = `python ("'%0"+$padding+"d' % "+$num)`; // results is: 005 however when tried convert python style, got following result: padding = '3' num = '5' pad = ("%0"+padding+"d' % "+num) result is: %03d' % 5 or tried rearrange code around, results either wrong (totally wrong, can see) or maya errors typeerror: cannot concatenate 'str' , 'int' objects any pointers? padding = '3' num = '5' pad = ("%%0%si" % padding) % int(num) print pad # prints '005' how works: you use %% escape %% % after string processing:: in [17]: step1 = ("%%0%si" % padding) in [18]: step1 out[18]: '%03i' in [19]: step2 = step1 % int(num) i...

How to send a html page from java -

i have form html page: <form name="form1" id="form1" action="test" method="post" enctype="multipart/form-data"> <input type="hidden" name="hiddenfield1" value="ok"> file upload: <input type="file" size="50" name="file3"> <br/> <input type="submit" value="upload"> </form> i want send file page calling java , passing file path through client. how this? you need library commons fileupload implements part of web browser fills out forms (and "upload files" part).

visual studio 2010 - How to change the title/caption of MFC SDI documentless application -

i can't find working solution change title of mfc sdi application. don't use document/view. need change title according internal state of applicaiton. i've tried cmainframe::setwindowtext main app module in initinstance - no luck. i've tried change cmainframe::m_strtitle member variable , call onupdateframetitle(true) after - still no luck. inside ontimer procedure - calling afxgetmainwnd()->setwindowtext(_t("title ontimer")); - not work either. what missing? should common , simple task, shouldn't it? edit: i'm sorry, seems setwindowtext working, need compile app. that's fault. overwrite cmainframe::precreatewindow. clear style fws_addtotitle cs.style &= ~(long)fws_addtotitle; now should possible window caption in way like. the default window caption taken string resource id afx_ids_app_title.

ruby on rails - Trying to build SOAP Request with Savon? -

i trying hit soap service ruby on rails - soap ui can hit fine , request xml below: <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:mun="http://schemas.datacontract.org/2004/07/myexternalservice.map" xmlns:mun1="http://schemas.datacontract.org/2004/07/myexternalservice.common.map"> <soapenv:header/> <soapenv:body> <tem:getinformationsforcoordinates> <!--optional:--> <tem:coordreq> <!--optional:--> <mun:coordinates> <!--zero or more repetitions:--> <mun:coordinate> <!--optional:--> <mun:id>1</mun:id> <!--optional:--> <mun:qualityindex>90</mun:qualityindex> <!--optional:--> <mun:x>-1...

ios - Refresh split view -

i have universal application list of items (loaded backend) , item details (loaded backend well). each view controller listens uiapplicationdidbecomeactivenotification , view refreshed when user (re-)opens app. works far. now problem. on ipad, have split view. so, when user (re-)opens app in landscape, both views reloaded. if there no connection backend, user gets 2 alerts retry/cancel options, 1 above other. not want... have 1 default item not require connection backend , want set selected , display details in detail view. when selected item missing in master view. what have done far... in master view controller, check whether selected item available after refresh , if not, update selection , detail view. should solve problem when requests left , right pane processed in correct order. however, both view controllers uiapplicationdidbecomeactivenotification , make asynchronous requests backend. has experience in refreshing split views? right way solve problem? don't want ...

How do I refer to a section in a markdown page from source code for doxygen? -

i want link source code specific section in 1 of project documentation markdown files. can link file using \ref filename.md. cannot link section in file \ref sec_somesection unrecognized. how can link specific section (or subsection etc)? since you're using named sections, use \ref command create links them. http://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdref you can use \anchor command on secondary pages, , link it, without having create section.

php - Wordpress, custom mod_rewirte in .htaccess -

i want add own rules in .htaccess in wordpress. i have this http://page.com/materialy/?id_s=2&nazwa=stale-niestopowe i want this: http://page.com/materialy/s/2/stale-niestopowe i tried plugins in wp dosent work, because in custom page use [insert_php] how edit .htaccess make work? please help! if want manually, follow these steps. open .htaccess file , edit it. add these lines rewriteengine on rewriterule ^([^/]*)/([^/]*)\.html$ /materialy/?id_s=$1&nazwa=$2 [l] output: http://www.page.com/2/stale-niestopowe.html

git - Github encoding breaks pdf embedded fonts -

i using doxygen miktex , ghostscript create documentation pdfs. these pdf's git pushed github repo. if subsequently pulled down again (e.g. on different pc) fail open correctly adobe warns not extract embedded fonts. i have found may down github transfer problem not occur if transfer pdf's in question via usb key etc. info adobe forums seems indicate down pdfs being wrongly encoded ascii when should binary. how can solve pdf's open correctly when pulled github repo? ide (eclipse) sets encoding of pdf files utf-8, should changed? after testing folks @ github, seems issue down eclipse changing encoding of pdf sometime during commit or push reason. using new repo github windows or git bash did not present such problems.

wordpress site is not opening any page. showing error that this page has redirect loop -

i working on membership site. users didn't select level , have registered date of birth, want redirect them membership level when try visit page. using wordpress , buddypress installed. have written code in function.php. add_action('init','redirect_to_levels'); function redirect_to_levels(){ $user_id = get_current_user_id(); $birthday = xprofile_get_field_data( 'birthday', $user_id ); $did_level = displayed_user_on_level($user_id); //this returns level $redirect_page = get_permalink(215); if(!$did_level && $birthday ) { wp_redirect( $redirect_page ); exit; } } but problem when try visit site, browser doesn't open page , shows error. "this webpage has redirect loop" , when remove wp_redirect, works fine. when in redirects $redirect_page, page runs redirect_to_levels function , redirects again causes redirect loop. you can add if ( is_page(215) ) exit; to first line of functio...

php - Cannot work autocomplete textbox in dynamically add row using javascript -

i create auto complete textbox smoothly working in normal textboxbot when dynamically add row autocomplete textbox cannot working. my javascript code autocomplete textbox is.... <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script> <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" /> <script type="text/javascript"> $(document).ready(function(){ $(".p").autocomplete({ source:'autocomplete1.php', minlength:1 }); }); </script> ...

Windows 2008R2 64bit vs Apache/PHP 32bit: Unable to load dynamic library -

my environnement windows server 2008 r2 sp1 64bit apache 2.2.25 , php 5.4.22 both 32bit. in apache error.log found: php warning: php startup: unable load dynamic library 'd:\\app\\prdapp\\apache\\php\\ext\\php5apache2_2.dll' - specified module not found.\r\n in unknown on line 0 php warning: php startup: unable load dynamic library 'd:\\app\\prdapp\\apache\\php\\ext\\msql.dll' - specified module not found.\r\n in unknown on line 0 php warning: php startup: unable load dynamic library 'd:\\app\\prdapp\\apache\\php\\ext\\php_curl.dll' - specified module not found.\r\n in unknown on line 0 do think due incompatibility win 2008r2 64bit vs apache/php 32bit? lost version of apache/php. witch version ideal on windows 2008 64bit server? regards, fred

web analytics - Monitoring users usage of a saas application -

i trying find way learn more on users behaviour in saas web application, in order improve ui experience, , know features used, in way, etc the application organizations (and hosted outside organization's network), need data in-house (not in third-party service). are there products can install on server purpose, or need develop own custom solution? i developing on asp.net mvc 4.0 thanks i'm not sure if there out of box solution understand application usage, customer behavior, pattern etc, experience of being developer of saas application framework provider , developer have consider below points effective analysis, are log each individual feature & method access users log each independent urls access along time, browser , other additional details possible. with able identify analytics on how features , modules of applications utilized, highly utilized features, customers behavior etc. hope helps

windows phone 7 - Difference in LoadingPivotItem and SelectionChanged -

i have 4 pivotitems in pivot. i'm loading data in each pivotitem when comes view. i'm using pivot.selectionchanged event, so: private void pivotselectionchanged(object sender, selectionchangedeventargs e) { switch(mypivot.selectedindex) { case 0: //load items pivotitem 0 ....... ....... } } however, see there loadingpivotitem event, can used in similar way. difference between these 2 methods? 1 more efficient other? loadingpivotitem means can manipulate content before displayed. additional information here => loadingpivot

weblogic12c - Coherence Servers Weblogic 12.1.1 ClassNotFoundException -

i following tutorial , in part need set parameter in server start on coherence servers. my class path configurations are: /opt/oracle/weblogic/12.1.1/coherence_3.7/lib/coherence.jar: /opt/oracle/weblogic/12.1.1/modules/javax.management_1.2.2.jar: /opt/oracle/weblogic/12.1.1/modules/javax.management.remote_1.0.1.4.jar: /opt/oracle/weblogic/12.1.1/coherence_3.7/lib/coherence-web-spi.war:` and argument configurations are: -dtangosol.coherence.management.remote=true -dtangosol.coherence.management=all -dtangosol.coherence.session.localstorage=true -dtangosol.coherence.cacheconfig=/opt/oracle/weblogic/12.1.1/user_projects/domains/labs_domain/config/coherence/my_coh_cluster/session-cache-config.xml ‐xmanagement:autodiscovery=false,authenticate=false,ssl=false,port=8291 when tried start server received following error: <mar 21, 2014 4:53:21 pm> <info> <nodemanager> <starting coherence server command line: /usr/lib/jvm/jdk1.6.0_45/bin/java -dtangosol.cohere...

Try to store Object in iCloud but don't see any action iOS -

Image
i use this tutorials store object icloud ( key-value storage ). my gui had 1 button triggers: pressbutton method here relevant code: nsstring *const keystoragestr = @"keyforstore"; /* ... */ - (ibaction)pressbutton:(uibutton *)sender { score++; [demoicloudviewcontroller setscore: score]; scorecountlabel.text = [nsstring stringwithformat:@"%d", score]; // store preferences nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; [defaults setinteger:score forkey:keystoragestr]; // store icloud [self setinteger:score forkey:keystoragestr]; } - (void)setinteger:(int)value forkey:(nsstring*)key { [self setobject:[nsnumber numberwithint:value] forkey:key]; } - (void)setobject:(id)value forkey:(nsstring *)key { nsubiquitouskeyvaluestore *store = [nsubiquitouskeyvaluestore defaultstore]; if (store) { [store setobject:value forkey:key]; //[store synchronize]; } } and handle...

java - How can I get largest prime factors between two numbers and store them in an array? -

i've been asked solve question: write function takes 2 numbers n1 , n2 input (with n2>n1 ) , returns array of largest prime factors corresponding each number between n1 , n2 . my attempt shown below, code not working properly. not iterating n1 n2 . how can right? public static class a{ static int testcase1=5; static int testcase2=10; public static void main(string args[]){ testinstance = new a(); int[] result = testinstance.getlpfd(testcase1,testcase2); system.out.print("{"); (int i=0;i<result.length;i++){ if (i>0) system.out.print(","); system.out.print(result[i]); } system.out.println("}"); } public int[] getlpfd(int n1,int n2){ int current=0; int[] factors = new int[20]; for(int j=n1;j<=n2;j++){ (int ...

Control ASP.NET WebAPI JSON serialisation without access to source code -

i using asp.net webapi return object assembly can't change source code in. i want remove 1 property response, cannot add [jsonignore] property because can't edit class returning. is there way specify separate property ignore list? there serialization happening automatically @ moment using ok() method: return ok(myobject); you can create custom newtonsoft.json.serialization.icontractresolver conditionally serialize properties. for more info on json.net's support in space, can take @ following link: http://james.newtonking.com/json/help/index.html?topic=html/contractresolver.htm config.formatters.jsonformatter.serializersettings.contractresolver = new shouldserializecontractresolver(); public class shouldserializecontractresolver : system.net.formatting.jsoncontractresolver { public new static readonly shouldserializecontractresolver instance = new shouldserializecontractresolver(); protected override jsonproperty createproperty(memberinfo ...

sql - Union All Transform: How to order the inputs -

i using union transform combine 2 input data sets. first data set 1 column header , second 1 column of data. want use union transform combine header , data rows 1 output column. can't figure out how make header row appear first, before data. no matter do, header comes last. appreciated! so have query select <columns> header_table union select <columns> data_table; introduce artifical column sort , use in order by select * ( select 0 sort, <columns> header_table union select 1 sort, <columns> data_table) raw order sort;

c# - Edit a button by its given name -

i generating x amount of buttons , give of them unique name. after generated, want edit 1 of them without regenerating them wondering if component name? i using winforms you can use controls property of form (or container control on form). linq can select buttons , find first button required name: var button1 = controls.oftype<button>().firstordefault(b => b.name == "button1"); or if want search child controls recursively var button1 = controls.find("button1", true) .oftype<button>() .firstordefault(); without linq can use method find(string key, bool searchallchildren) of controlcollection: control[] controls = controls.find("button1", true); if (controls.length > 0) { button button1 = controls[0] button; }

moodle - Student sees all courses on the main page -

i have problem lms moodle: students see courses on main page, want, see courses, enrolled. is possible configure moodle in way? you'll need change settings front page /admin/settings.php?section=frontpagesettings change "front page items when logged in" "enrolled courses" and remove "front page" "list of courses"

Insert Data into Dynamic Table in SQL Server -

sp insert data intermediatesmstable, intermediatesmstable input param db details of client db hence can configurable application level. below details: input params: @smsdata, intermediatesmstable xml format of @smsdata below: <sms> <details nid="123" mno="98745124" msg="aaaa" sid="123" date="12-03-2014" /> </sms> intermediatesmstable = server.database.table insert intermediatesmstable (code, phone, text, misc_data, date) values (strsmsnotificationid, strmobileno,strmessage,scheduleid,getdate())

php - login with cookies and sessions -

how can make cookies safe i want make login sessions , cookies try make this code <?php $my_username =isset($_post['username']) ? make_it_safe($_post['username']) :null; $my_userpass =isset($_post['userpass']) ? make_it_safe($_post['userpass']) :null; $saveinfo =isset($_post['save_info']) ? make_it_safe($_post['save_info']) :null; if(empty($my_username)){ echo "<div class='alert alert-error'>insert username</div>"; }else if(empty($my_userpass)){ echo "<div class='alert alert-error'>insert userpass</div>"; }else { $my_userpass = sha1($my_userpass) ; $select = $mysqli->query("select * members username='$my_username' , userpass='$my_userpass' limit 1"); $num = $select->num_rows; if($num){ $rows = $select->fetch_array(mysql_assoc); $id = $rows ['id']; $username = $rows ['username']; $userpass ...

python - Is there a way to create a grid? -

is there way create grid can access easy? example if grid is: x y z 1 2 3 b c and if run: print([1][1]) output 2 thanks! the usual way use nested lists: grid = [['x', 'y', 'z'], [1, 2, 3], ['a', 'b', 'c']]

c# - Asynchronous Thread Lifetime & WPF UI Update -

on button click have fired call startcontinuousthread keeps polling server every 1 second. public class threadswindow { cancellationtokensource wtoken = new cancellationtokensource(); private void btnstarttest_click(object sender, routedeventargs e) { startcontinuousthread(); } void startcontinuousthread() { while(true) { var fact = task.factory.startnew(() => { callserver(); task.delay(1000, wtoken.token); }, wtoken.token); } } } startcontinuousthread starts executing, btnstarttest_click event handler finishes execution. how startcontinuousthread method able update ui in case? i wonder whether startcontinuousthread terminated event handler, since there no wait keyword re-joining. please help! if goal poll server every second have number of problem. there no loop. execute method once , stop. you crea...

Android Push Notification Message Cut off -

hi im working on project uses push notifications push out information in text format. when receive push notification text cut off , replaced "..." im using notificationcompaq builder build notifications when app receives information receiver. here gcmbroadcastreceiver im pretty sure issue in builder im not sure need fix it. import utilities.commonutilities; import android.app.activity; import android.app.notificationmanager; import android.app.pendingintent; import android.content.broadcastreceiver; import android.content.context; import android.content.intent; import android.support.v4.app.notificationcompat; import android.util.log; import android.widget.toast; import com.google.android.gms.gcm.googlecloudmessaging; /** * handles incoming messages server. * */ public class gcmbroadcastreceiver extends broadcastreceiver { static final string tag = "gcmdemo"; public static final int notification_id = 1; private notificationmanager mnotif...

sql - How to finish this LAG calculation in Oracle -

i have month , value columns in table,like month value market 2010/01 100 1 2010/02 200 1 2010/03 300 1 2010/04 400 1 2010/05 500 1 2010/01 100 2 2010/02 200 2 2010/03 300 2 2010/04 400 2 2010/05 500 2 what want new month , value combinations using (value in month(n-1)+value in month(n))/2=value in month n, calculation based on market column, group market number. so, above example, new month , value combination should month value market 2010/01 null 1 2010/02 (100+200)/2 1 2010/03 (200+300)/2 1 2010/04 (300+400)/2 1 2010/05 (400+500)/2 1 2010/01 null 2 2010/02 (100+200)/2 2 20...

javascript - regex: non-greedy search of vocals before a text -

i making script able conjugate verbs, recognized when word followed (verb) expression. example: "i start(verb) everything"; started searching regex "(verb)" , replaced corresponding "ing" or "ed", resulting succesfully in: "i started everything" or "i starting everything" (of course system not perfect) problem now; if root ends in vocal, vocal should removed: bake(verb) search should have included last vocal; have result "baking", instead of "bakeing", changed regex into: "[aeiou]?(verb)" [aeiou] matches letter between brackets, , ? sign makes non-greedy. regex worked fine in http://regexr.com/ , in javascript code, stopped finding. function replacetense(replace, str) { return str.replace(new regexp('[aeiou]?\(verb\)', 'gi'), replace); } where "replace" variable corresponding "ing" or "ed". regexp needs double escaping \\( instea...

database - SQL Subquery to get first record -

i need execute query below. select to_char(rownum), a.name, b.order, (select * ( select round(last_order_amount,5) orders id=a.id , request_level='n' order o_date desc) rownum =1) amount table1 left join table2 b on a.type_code = b.entity_type but gives me a.id invalid error in oracle. need first record inner query return multiple records. can please let me know how can bind these tables achieve goal. thank in advance. you can rewrite subquery using with clause, not sure on syntax should following. with amountquery ( select id ,round(last_order_amount, 5) amountvalue ,row_number() on ( order o_date desc ) rn orders request_level = 'n' ) select to_char(rownum) ,a.name ,b.order ,c.amountvalue table1 left join table2 b on a.type_code = b.entity_type left join amountquery c on a.id = c.id , c.rn = 1 here sql...

latency - Taking 17.x seconds to send 10MB over a 10MB/s link through a switch in ns3 -

i working hang of ns3 , doing sanity check turned out wrong. i want send 10mb on tcp through switch @ rate of 10mb/s , expect take 1.x seconds because of apparent buggery taking whopping 17.x seconds. can't seem figure out wrong after googling , checking users ns-3 group. if point me in right direction of how debug i'd take answer. btw, if set delay zero, works ten times faster couldn't make sense out of , takes 1.7x seconds. here enough code reproduce behaviour: #include <iostream> #include <fstream> #include "ns3/core-module.h" #include "ns3/network-module.h" #include "ns3/applications-module.h" #include "ns3/bridge-module.h" #include "ns3/csma-module.h" #include "ns3/internet-module.h" using namespace ns3; int main (int argc, char *argv[]) { uint32_t burstsize = 10000000; uint32_t packetsize = 1000; config::setdefault("ns3::tcpsocket::segmentsize", uintegervalue (packe...

python - Testing if rows in a numpy array are the same as a given row or different by each element -

this related earlier question: elementwise logical comparison of numpy arrays i have 2 numpy arrays of random integers a=np.random.randint(q,size=(n,m)) b=np.random.randint(q,size=(1,m)) i need test if of rows in have more 0 , less m common elements elementwise b. for example if a=np.array([[2,0],[0,1],[1,2]]) b=np.array([1,0]) i expect true since [1,0] , [1,2] share more 0 , less 2 elements elemenwise. on other hand if b=np.array([2,0]) i expect false since there rows chare 2 or 0 elements elementwise at moment approach is: c=np.where((a[:]==b))[0] n=np.bincount(c) ((n==0)+(n==2)).all() to me seems convoluted way of testing , wondering if there more natural way i'm missing. i this neq=(a==b).sum(-1) result = any(logical_and(neq<b.size, neq>0)) where neq keeps track of how many digits each line of a has in common b .

javascript - Recognize in which tag given word is? -

next, have div below tags contains type [info] [/ info]: <div id="tags"> [info id=“rol”] rol -> greatest project add in same people [/info] [info id=“add”] add -> moment pick ball , shoot in cars [/info] [info id=“tree”] tree -> tree of views in other dimensions [/info] </div> i created search engine made ​​in jquery, type in text field , click search saves variable 'searchtext', can see below: $(“#buttongo").click(function() { var searchtext = $(‘#searchfield’).val(); }); after have is: take value stored in variable searchtext, , text in div then find text give warning showing in located info tag, eg: searchtext var = "views in other";   must recognize tag [info id = "tree"] [/ info] because text located within tag .... , return alert should come follows: (tag: info, id: tree, desc:"tree -> tree of views in other dimensions") i not know start, can give me hand?...

python - matplotlib.FuncAnimation not removing some data from plot -

i plotting position data on time matplotlib.basemap , matplotlib.animation . there maximum of point_number points, points being gradually introduced , removed being present or not in data. i.e. day 1 -------- 1 some-lon some-lat 2 some-lon some-lat day 2 -------- 1 some-lon some-lat 2 some-lon some-lat 3 some-lon some-lat day 3 -------- 2 some-lon some-lat everything animates fine until number of points begins decrease (as on day 3), @ point number of points plotted (equal no longer present on day 3) remain frozen on map. this appears due init() routine not doing job. setting each point equal empty object, can't seem figure out why doing this. init() function : def init(): pt in pts_dots: pt.set_data([], []) return pts_dots animation() function : def animate(i): # filter out daily data pandas dataframe lons = data.lons[data.daynr==dates[i]].values lats = data.lats[data.daynr==dates[i]].values z in range(len(lons)): x, y = ...

ruby - How do I split command output by space or tab? -

i'm trying do: input = %x{netstat -ano | grep ^:80} input.gsub(/\s+\t/m,' ').strip.split(" ") puts input[4] but output of: c , expected <pid> example output of netstat command is: tcp 0.0.0.0:8080 0.0.0.0:0 listening 1800 tcp 0.0.0.0:8081 0.0.0.0:0 listening 8780 tcp 0.0.0.0:8085 0.0.0.0:0 listening 5540 additionally, i'm unsure of how make grep match exactly 80 (or other port specify). a plain split without arguments want: input.lines.map |line| proto, local, foreign, state, pid = line.split pid end #=> ["1800", "8780", "5540"] you code has several problems want point out though, maybe can learn this: you using gsub , strip never changes input . might want use gsub! , strip! (mutators) purpose. split has no mutator equivalent, because return value array , not string. input[4] g...

animation - How to create a Heart Pulse animtion in Android? -

i need have heart pulse animation in app such this or this . don't mind using external resource long i'm able control pulse rate. after googling many had suggested android.graphics.path should used have no idea of how should need. so if knows how achieve such thing ? you can add objectanimator this, creating pulsating effect in image objectanimator scaledown = objectanimator.ofpropertyvaluesholder(imageview, propertyvaluesholder.offloat("scalex", 1.2f), propertyvaluesholder.offloat("scaley", 1.2f)); scaledown.setduration(300); scaledown.setrepeatcount(objectanimator.infinite); scaledown.setrepeatmode(objectanimator.reverse); scaledown.start(); another way achive have customclass , override ondraw method, creating effect of growing or decrease increasing variable , recalling invalidate(). did these in post make button background grow, if want follow way can usefull you. ...

css - How to align these DIVs side by side (fiddle inside)? -

i've managed align side side div containing image, , div containing text, side side, applying float:left image div. but when include these 2 divs in parent div, , duplicate parent , try align parents side side applying float:left first parent, doesn't work. here's code: <div style="width:350px;min-height: 200px; float:left;"> <div style="float:left;"><img src="image.jpg" width=120px height=120px style="border: 1px solid black;padding:1px;"></div> <div style="font-size:15pt;color:red;letter-spacing:-.04em;padding-top:2px;padding-left:135px;">title</div> <div style="font-size:11pt;color:black;letter-spacing:-.02em;margin-top:4px;padding-left:135px;">text text text text text text text text text text text text text text text text.</div> </div> <div style="width:350px;min-height: 200px;"> <div style="float:left;">...

c++ - Create Code Snippet for Method Comments -

i'm trying make code snippet using snippet manager in visual studio 2013 c++. code snippet ideally provide c#-like comment template methods. suppose following method: void mymethod( int a, float b ); i able type comment on line above method, press tab, , have following populate: // // describe 'mymethod' here. // - a: describe 'a' here. // - b: describe 'b' here. // void mymethod( int a, float b ); i have following far snippet: <?xml version="1.0" encoding="utf-8"?> <codesnippets xmlns="http://schemas.microsoft.com/visualstudio/2005/codesnippet"> <codesnippet format="1.0.0"> <header> <title>comment</title> <shortcut>cmt</shortcut> <snippettypes> <snippettype>expansion</snippettype> </snippettypes> </header> <snippet> ...

azure - Application crashes when run from C# Process in contrast to from command window -

i running azure cloud service processes data native compiled executable. if run following in command prompt on target machine: c:\algorithms\sinnovations.algorithms\sinnovations.algorithms.rawconverter.1.0.0-pre-20140323\nikonrawreader.exe dsc_028.nef then runs no problems. if do: processstartinfo procstartinfo = new processstartinfo("cmd",@"/c c:\algorithms\sinnovations.algorithms\sinnovations.algorithms.rawconverter.1.0.0-pre-20140323\nikonrawreader.exe dsc_028.nef"); procstartinfo.redirectstandardoutput = true; procstartinfo.useshellexecute = false; procstartinfo.createnowindow = true; procstartinfo.workingdirectory = workingdirectory; using (process proc = new process()) { proc.startinfo = procstartinfo; proc.start(); var text = await proc.standardoutput.readtoendasync(); trace.traceinformation(text); proc.waitforexit((int)ti...