Posts

Showing posts from February, 2011

python - Error:Index out of bounds -

as can seen, having 1000 divisions each of theta, sigma. when iterating 1 1000 theta can seen, getting error. import time start_time = time.clock() import numpy np theta=np.linspace(3,100,1000) sigma=np.linspace(0,10,1000) re=5 import os completename = os.path.abspath("new volume (f:)/new innings 3/sigma @ re=5 @100 .txt") file = open("sigma @ re=5 @100.txt", "w") in np.arange(0,k,1): //k=1000 mu=np.sqrt(re*sigma) a=(mu-1)*np.exp(mu)+(mu+1)*np.exp(-mu) b=2*mu*(theta[i]) c=(a/b) d1=np.exp(mu)/(2*(mu+sigma)) d2=np.exp(-mu)/(2*(mu-sigma)) d3=mu**2 d4=np.exp(-sigma) d5=sigma d6=(mu**2)-(sigma**2) d7=d3*d4 d8=d5*d6 h=d7/d8 d9=(1/sigma) d=d1-d2+h-d9 k1=c-d k2=np.delete(k1,0) k3=np.nonzero(k2>0) k4=sigma[k3] k5=k4[0] k55=np.array(k5) file.write("%g\n" % k55) file.close() print time.clock() - start_time, "seconds" the output foll

c# - automapper create.map() to a collection property -

how map collection of property interested last record of collection. say, like. public class itemdto <-- destination class { public string name { get; set; } public decimal pricesprice { get; set; } } public class item <-- source class { public int id { get; set; } public string name { get; set; } public virtual icollection<price> prices { get; set; } } public class price <-- source class { public int id { get; set; } public int itemid { get; set; } public decimal price { get; set; } public virtual item item { get; set; } } then have tried this, doesn't seems right. mapper.createmap<item, itemdto>() .formember(dto => dto.pricesprice, opt => opt.mapfrom(s => s.prices.lastordefault().price)); edit: , after did projection because if use mapper.map() return entire result set not want, want values needed. did this: project().to<itemdto>() well, basically, want this: from item in somedbcontext.

Counting the actual used months in a range of Excel date values -

i want monthly average counts months containing transaction. easy summing transaction amounts , dividing number of months used. i couldn't find native excel formula count months that, , trying sum on criteria based on row() function using table or named range didn't work. return 0 when attempting limit count year (or other criteria). that formula looked this: ={sum(if(match(month(daterange),month(daterange),0)=(row(daterange)-min(row(daterange))+1),1,0))} that's array formula, way. looks see if row you're on same first row month referenced in sorted list. that's 1 problem every method i've tried; range needs sorted date. the greater problem arises when attempting use and() or boolean expression limit named range 'daterange' specified year. so question remains, how 1 specify particular criteria in single formula , count number of months in range based on criteria? the solution came following non-array formula using sumproduct(

ruby - make json from params hash -

i trying call api , pass data form in view controller , call api post method. what in params is: parameters: {"utf8"=>"✓", "authenticity_token"=>"kllavrc6kcndkfb1nkntstzgcg95cmct1uvencqwlgc=", "score_sheet"=>{ "score_sheet_master"=>{ "issue_date(1i)"=>"2014", "issue_date(2i)"=>"6", "issue_date(3i)"=>"27"}, "print_date(1i)"=>"2014", "print_date(2i)"=>"6", "print_date(3i)"=>"27", "product_id"=>"2", "pull_id"=>"2", "press_run_id"=>"1", "total_section"=>"2", "score_sheet_sections_attributes"=>{ "0"=>{"section_name"=>"a", "total_pages"=>"2", "color_pages"=>"1", &quo

c# - Callback interface inheriting another interface -

i try create "modular" architecture wcf service. hostfunctions (servicecontracts) work, can't apply same scheme callback interfaces. what want achieve: public interface icallback : icallbacka, icallbackb { } public interface icallbacka { [operationcontract] void methoda(); } public interface icallbackb { [operationcontract] void methodb(); } [servicecontract(callbackcontract = typeof (icallback))] public interface ihostfunctions : ifunctionsa { } when , create proxy svcutil.exe, hostfunctions servicecontract attribute. callback interface(s) not included in proxy. here's example of should like: generated proxy callbacks my generated proxy looks same except including callback interface. can't/mustn't reference service's project in client's project. how working?

.net - Custom overrides the Enabled property of the UserControl? -

i have user_control 1 textbox , button. want override enabled property of control in such way, retain button enabled , enable / disable of control affect textbox. how can archive it? in advance. edited : think question may not clear. have overrides enabled property follows, private m_enabled boolean public overloads property enabled() boolean return m_enabled end set(byval value boolean) button1.enabled = true textbox1.enabled = value m_enabled = value end set end property i have place usercontrol , few other textboxs in panel1. try loop through controls 1 one , disable it. each panelcontrol control in panel1.controls panelcontrol.enabled = false next panelcontrol this enabled property never called in case. (whole control disabled / enabled) can me? the problem cast: for each panelcontrol control use control's enabled property, not overload. try casting instead: for each ctrl usercontrol

asp.net - context.User.Identity.Name return empty value always in ashx -

context.user.identity.name return empty value in ashx login.aspx: protected void button1_click(object sender, eventargs e) { if (username.text == "admin" && password.text == "admin") { formsauthentication.setauthcookie(username.text, false, formsauthentication.formscookiepath); response.redirect("manageindex.aspx"); } } ashx: /// <summary> /// summary description transactionrecordlist /// </summary> public class transactionrecordlist : ihttphandler { public void processrequest(httpcontext context) { string a= context.user.identity.name; }

c# - Windows Forms, Right To Left Layout BG Image not showing -

i have right left layout applied form. , there form, has background image, , not showing when righttoleft true. what's problem ? thanks check remarks section here on msdn. for form.righttoleftlayout property: backgroundimage, opacity, transparencykey, , painting events not supported. workaround (after setting righttoleftlayout = true add panel , set background image): this.righttoleftlayout = true; panel pnl = new panel(); pnl.dock = dockstyle.fill; pnl.backgroundimage = system.drawing.image.fromfile("d:\\background.png"); pnl.backgroundimagelayout = imagelayout.stretch; this.controls.add(pnl); pnl.sendtoback();

java - Update Eclipse with Android development tools v. 23 -

Image
i updated eclipse new sdk tools (rev. 23), when eclipse starts receive error: this android sdk requires android developer toolkit version 23.0.0 or above. current version 22.6.3.v201404151837-1123206. please update adt latest version. no updates found "check updates" . if try "install new software" , can see version 23, can't upgrade due following error: cannot complete install because of conflicting dependency. software being installed: android development tools 23.0.0.1245622 (com.android.ide.eclipse.adt.feature.feature.group 23.0.0.1245622) software installed: android developer tools 22.2.1.v201309180102-833290 (com.android.ide.eclipse.adt.package.product 22.2.1.v201309180102-833290) 1 of following can installed @ once: adt package 22.6.3.v201404151837-1123206 (com.android.ide.eclipse.adt.package 22.6.3.v201404151837-1123206) adt package 23.0.0.1245622 (com.android.ide.eclipse.adt.package 23.0.0.1245622) cannot satisfy dependency: f

geolocation - Not able to get location via google maps API -

i trying location of user via geolocation api, working fine till yesterday today getting "unable location" every attempt script used api <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> <script type="text/javascript"> var geocoder; if (navigator.geolocation) { navigator.geolocation.getcurrentposition(successfunction, errorfunction); } //get latitude , longitude; function successfunction(position) { var lat = position.coords.latitude; var lng = position.coords.longitude; //var num = parsefloat(lat); //var str = num.tofixed(10); //str = str.substring(0, str.length-7); $('#yourlat').val(lat);$('#yourlat1').val(lat); //var num1 = parsefloat(lng); /

javascript - jQuery change innerHTML of link based on href -

i have following html generated cms tabbed element: <li class="active" style="width: 233px;"> <a href="#tabopen_tickets">open tickets</a> </li> i want change link's text of "open tickets" other text, know link's href . how can jquery? thanks! $('a[href="#tabopen_tickets"]').html('your new value');

c# - How to fetch a model's relationship in a dynamic way? -

so have application makes use of sqlite database. have methods fetching models out of database. have repository communicaties database. , looks this: public class photorepository { appdatabase db = null; public photorepository () { db = new appdatabase (constants.databasefilepath); } public photo getphoto(int id) { return db.getitem<photo>(id); } public ienumerable<photo> getphotos (int album_id) { return db.getitems<photo>().where( x => x.album_id == album_id ); } public int savephoto (photo item) { return db.saveitem<photo>(item); } public int deletephoto(int id) { return db.deleteitem<photo>(id); } } i concerned getphotos(int album_id) method, because method approaches in database class looks following: public ienumerable<t> getitems&

New dialog activity not starting in Android -

i have activity, starts dialog box when list item long pressed. start activity via code snippet: private void showwifisettings(int arg2) { intent newintent = new intent("com.example.searchingwifi.dialogactivity"); startactivity(newintent); } and, code in new dialog activity undersigned. package com.example.searchingwifi; import android.app.alertdialog; import android.app.dialog; import android.content.dialoginterface; import android.os.bundle; import android.support.v4.app.dialogfragment; import android.view.layoutinflater; public class dialogactivity extends dialogfragment{ @override public dialog oncreatedialog(bundle savedinstancestate) { alertdialog.builder builder = new alertdialog.builder(getactivity()); // layout inflater layoutinflater inflater = getactivity().getlayoutinflater(); // inflate , set layout dialog // pass null parent view because going in dialog

ios - Probelm in converting the date from String -

all, in code getting string server value "06-27-2014", want convert other date format final result getting different. here code using. nsstring* dateval = @"06-27-2014"; nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"mm-dd-yyyy"]; nstimezone *gmtzone = [nstimezone systemtimezone]; [dateformatter settimezone:gmtzone]; nsdate* adate = [dateformatter datefromstring:**dateval**]; getting adate **2014-01-26 18:36:00 +0000** here month changing first month 6th. nsdateformatter *dateformat = [[nsdateformatter alloc] init]; [dateformat setdatestyle:nsdateformattershortstyle]; nsdate *thedateselected =adate; nsstring *thedate = [dateformat stringfromdate:thedateselected]; the final date getting 27/01/14 totally different can 1 suggest correct date format. your date format wrong, should mm month. mm u

javascript - Stripe.js conflicting only when put into lightbox -

i using stripe.js add card customer. have done on standard page, @ it, there little information on page, i'd put in lightbox. have transferred relevant script inclusions had main site header lightbox header it's conflicting somewhere , can't work out why. these script includes in original header: <script src="//code.jquery.com/jquery-1.10.2.min.js"></script> <script type="text/javascript" src="/js/jquery.colorbox-min.js"></script> <script src="/js/admin_general.js"></script> <!--[if lt ie 9]> <script type="text/javascript" src="/js/tipped/excanvas.js"></script> <![endif]--> <script type="text/javascript" src="/js/tipped/spinners.js"></script> <script type="text/javascript" src="/js/tipped/tipped.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js">&l

java - difference between equals() and hashCode() -

i want brief definition equals() , "==" , hashcode(). if run following code means output "true false 2420395 2420395". had understand equals() method compares string , "==" compares reference. in output hashccode() method prints reference number both strings same why "==" returns "false". string str = "name"; string str1 = new string("name"); if(str.equals(str1)) system.out.println("true"); else system.out.println("false"); if(str==str1) system.out.println("true"); else system.out.println("false"); system.out.println(str.hashcode()); system.out.println(str1.hashcode()); } hashcode() not return object's reference, hash of object , computed in way. == not compare objects using value of hashcode() but, correctly say, value of objects' references.

if statement - Order of logical operations and resultant execution -

i thinking situation : if( && b) { dosomething(); } considering using c++, evaluated first ? a or b ? and, let's imagine a is evaluated first, if a false , if statement try evaluate b before going out of if ? is comportement same other programming languages ? && , || typically implemented short-circuit operators. if a false , b not need evaluated , (in languages) not be. a evaluated first , depending on value, b may or may not evaluated.

laravel - Am I mock too much or doing TDD and unit testing the right way? -

i'm developing web application using laravel , web app has connect internal service. choose tdd in project , i'm facing problem dependencies mock. in registercontroller , allow user login , upgrade account type, see code below: public function loginforupgradeaccount() { $data = input::only('email', 'hashedpassword'); if (!empty($data['email']) && !empty($data['hashedpassword'])) { $email = $data['email']; $hashedpassword = $data['hashedpassword']; $login = $this->createloginserviceconnector(); $token = $login->withemailandhashedpassword($email, $hashedpassword); if ($token) { $profile = $this->createprofileserviceconnector($token); if ($profile->getdata()['secret_code'] != session::get('thirdpartydata')['secret_code']) { return $this->builderrorjsonresponse('upgd-002', 'secret

c# - AutoEllipsis=true affects the vertical positioning of the text -

Image
i have label autoellipsis = true , textalign = contentalignment.middleleft . when enter text not extending label width, text vertically aligned middle of label. however, when text extends label width text not aligned middle, top aligned instead. why behaving way, , there way keep text vertically center aligned? i see it. looks limitation in underlying winapi, drawtextex() . doesn't lot of label class, doesn't turn on dt_singleline option (aka textformatflags.singleline) since capable of rendering multiple lines. drawtextex() documents required vertically centered text (dt_vcenter). real bug shouldn't centered @ :) note do centered text when grow label vertically. the simplest way work around setting label's usecompatibletextrendering property true.

datagridview not updating automatically in vb.net -

the datagirdview not updating after immediate in inserting records. private sub updatedgv() using congv oledbconnection = new oledbconnection("provider=microsoft.jet.oledb.4.0;data source=..\library.mdb") dim strgv string = "select * normaltransaction regno='" & txt_registerno.text & "'" dim cmdgv oledbcommand = new oledbcommand(strgv, congv) dim sdagv oledbdataadapter = new oledbdataadapter(cmdgv) dim dsgv dataset = new dataset("gvset") sdagv.fill(dsgv) datagridview1.datasource = dsgv datagridview1.datamember = dsgv.tables(0).tablename end using end sub please me solve this.

jhipster hot reload failed to register liquibase changelog directory -

i started using jhipster , face problem already, here's development stack : - os windows 7 - eclipse juno - maven 3.1 - latest node , npm - mysql db in ubuntu vm and here's have done : - generate jhipster "yo jhipster" - convert maven project "mvn eclipse:eclipse" - maven compile "mvn clean" & "mvn install" - add jhipster-reload feature in eclipse run vm arguments - , run main class in eclipse "right click application.java , run java application" - generate new entity yo jhipster:entity ala - pretty generated new entity, liquibase changelog doesn't generated - try recompile maven eclipse found line below [error] io.github.jhipster.loaded.jhipsterfilesystemwatcher - failed register directory 'target\classes\config\liquibase\changelog' - afaik seems same bug here , says it's fixed thanks this, i'm confused here i'm new jhipster, liquibase, hot reload concept, , documentation or

PostgreSQL: duplicate key value violates unique constraint on UPDATE command -

when doing update query, got following error message: error: duplicate key value violates unique constraint "tablea_pkey" detail: key (id)=(47470) exists. however, our update query not affect primary key. here simplified version: update tablea set items = ( select array_to_string( array( select b.value tableb b b.a_id = b.id group b.name ), ',' ) ) a.end_at between now() , now() - interval '1 day'; we ensured primary key sequence synced: \d tablea_id_seq which produces: column | type | value ---------------+---------+-------------------------- sequence_name | name | tablea_id_seq last_value | bigint | 50364 start_value | bigint | 1 increment_by | bigint | 1 max_value | bigint | 9223372036854775807 min_value | bigint | 1 cache_value | bigint | 1 log_cn

c# 4.0 - Java Streams v .Net (C#) LINQ -

i need know if string or char array has duplicate characters , if how many of each duplicates there are. with linq can following way:- class program { private const string source = "appearances"; static void main(string[] args) { var testq = ch in source group ch ch testg testg.count<char>() > 1 select testg; int num; foreach (var tg in testq) { num = tg.count(); console.out.writeline("{0}, {1}", tg.elementat(0), num); } console.readline(); } } can suggest how might go java streams? you stream - suppose mean java 8. here how it: public map<character, integer> countoccurs(final char[] input) { return countoccurs(new string(input)); } public map<character, integer> countoccurs(final string input) { return input.chars(). collect( hashmap::new,

Design: Spring Integration jdbc best practice -

after using spring integration in project, observation use jdbc adapter or gateway @ start or end of flow. if use them in middle of flow become verbose , complex. for example: <jdbc:outbound-gateway query="select * foo c1=:headers[c1] , c2=:headers[c2] , c3=:headers[c3] , c4=:headers[c4]" row-mapper="foomapper" data-source="mydatasource" max-rows-per-poll="100000" /> <int:service-activator ref="serviceactivator" method="processfoo" /> in above <jdbc:outbound-gateway> , need pass placeholders (c1, c2, c3, c4) in header of message. need , forth in java code , xml file change in condition or when there many clauses. it error prone. example, if misspelled :headers[c1] :headers[d1] not throw exception , replace :headers[d1] null . if query not return row throw exception default. so, have use requires-reply="false" change default behaviour. if

java - Internationalization using SPRING MVC -

below project-structure showing keep messages files: web java resources src/main/resources messages_en.properties messages_fr.properties bean configuration file define message source looks shown below: <bean id="messagesource" class="org.springframework.context.support.resourcebundlemessagesource"> <property name="basenames"> <list> <value>messages_fr</value> </list> </property> </bean> i new concept of internationalization. don't know except if put .properies file inside tag picked , changes reflected. facing problem in dealing multiple .properties files. if have more 1 .properties file how should implement locale changes? how program know file take? you should use : <bean id="messagesource" class="org.springframework.context.support.resourcebundlemessagesource"> <property name="basenames"> <list> <value>m

MYSQL Left Join COUNTS AND SUMS from multiple tables -

i have tried looking similar questions here in , have not found far. feel free tag duplicate or similar question 1 if you'd like. i want join several columns display report. i have 3 tables. users id name 1 chris 2 john 3 rick inmessages id content 1 hello1 2 hello2 3 response1 4 response2 5 hello3 6 hello4 outmessages id userid inmessageid content currentrate 1 1 1 replyhello1 10 2 2 2 reply1hello2 10 3 3 2 reply2hello2 10 4 3 2 reply3hello2 10 5 1 3 replyresponse1 10 6 2 4 replyresponse2 10 7 1 5 replyhello3 4 8 3 6 replyhello4 4 and report i'd see like: user inmessagescount outmessagescount rate10 rate4 chris 3 3 2 1 john 2 2 1 1 rick 2 3 2 1 i have tried

java - Hiding parts of the code from other contributors -

manager of team has requested me hide parts of codebase of android application project incoming intern (these parts related networking). how should approach - should create jar library , import project (and work on jar separately)? code copy if real matter intern copy code, might enough (unless wishes he'd want reverse engineer code. decompress jar, reverse .class files , here go). code use if problem use code in own projects/other companies, can't. may need make him sign contract of non disclosure, if it's important team, talk lawyer this. secrets use in case it's related secret keys, passwords, ips or so, easy extracting these codes in different file, , having own copy (you'd have "good one", , he'd have test version). solution implies he'd using test codes, should work long internship lasts. ps: post open additions

javascript - Jquery feedback plugin not working -

i planned implement feedback feature in webapp. google , find jquery plugin .as per documentation included library in html file , written following code. $(document).ready(function () { //set minimal options feedback_me plugin fm_options = { bootstrap: false, name_placeholder: "email please", name_required: true, message_placeholder: "go ahead, type feedback here...", feedback_url: "", custom_params: { csrf: "", user_id: "mygmailusername@gmail.com", feedback_type: "clean" } }; //init feedback_me plugin fm.init(fm_options); }); plugin coming pretty this . but problem after enter email , message if user click on send not getting mail. may miss parameter values, think didn't mention csrf attribute value may because of

Jetty SSL configuration Apache karaf -

i trying configure jetty work ssl in apache karaf osgi container. http works, https not work. problem? my configuration details below: etc/jetty.xml <call name="addconnector"> <arg> <new class="org.eclipse.jetty.server.nio.selectchannelconnector"> <set name="host"> <property name="jetty.host" /> </set> <set name="port"> <property name="jetty.port" default="8282" /> </set> <set name="maxidletime">300000</set> <set name="acceptors">2</set> <set name="statson">false</set> <set name="confidentialport">8443</set> <set name="lowresourcesconnections">20000</set> <set name="lowresource

Ant objects and references: what is the scope of a reference's ID? -

seems odd there no documentation (at least no documentation i'm aware of; , i'll happy stand corrected). when this: <fileset id="my.fs" dir="..."/> what scope of id my.fs ? the entire ant execution cycle? the current target (and target depends on current target)? and, lastly, happens if multiple threads (spawned using parallel task) attempt define filesets same id? references visible across project in defined. example, if <fileset id="my.fs" dir="..."/> placed outside target, visible targets in buildfile. if defined in target a , visible in target b if b depends on a : example 1: <project name="project1" default="doit"> <fileset id="my.fs" dir="some_dir"/> ... <target name="doit"> <copy todir="some_dir_copy"> <fileset refid="my.fs" /> <!-- work --> &l

javascript - Conceptual: Create a counter in an external function -

i've written javascript download hundreds of files external site, using wget @ core. after downloading of files, stuff them. issue is, files aren't of equal size. so, last wget formed isn't last file downloaded, meaning can't tell when last file has completed. i do, however, know how many files there in total, , number associated each wget. i have 3 js files, [parseproducts.js] ==> [createurl.js] ==> [downloadurl.js] using information, how can tell when of files have been downloaded? tried creating "ticker" function in file function resets on each instance, doesn't work @ all! edit: code added didn't because didn't think people want trawl through it! i'm new programming/javascript/node. please let me know if there's better (i'm sure of more efficient!) parseproducts.js var fs = require('fs'); var iset = require('./ticker.js'); var createurl = require('./createurl.js'); var array = []; f

android - How to launch application with Theme.Material on older devices -

how can run app on pre-v21 devices? compilesdkversion 'android-l' minsdkversion 14 targetsdkversion 'l' i'm using theme.material on v21 . i'm not using v20 support library, i'm using com.android.support:support-v4:19.+ when running application android studio says device in not compatible: {compatible=no, reason=minsdk(api 20, l preview) != devicesdk(api 16)} from taking minsdk 20 ? edit: the reason happening (if verified) if compile against preview sdk (android-l), build tools lock minsdkversion , targetsdkversion same api level. results in produced application being unable installed on devices running older releases of android, if application isn't doing specific l. source: reddit if compile against preview sdk (android-l), build tools lock minsdkversion , targetsdkversion same api level. results in produced application being unable installed on devices running older releases of android, if application is

php - how to skip multiple rows for one id -

hi guys use query find online friends (users have session_time >30 sec ) sometime users have multiple sessions rows in friend list 1 username repeated multiple times need know how can skip multiple sessions rows 1 user ?!thank you. $friends_id = "95"; $time = time() - 50; $query_b = "select session_user_id phpbb_sessions session_time > '" . $time . "' , session_user_id = '".$friends_id."'"; $result_b = mysql_query($query_b,$connect2->connect()); $row_b = mysql_fetch_array($result_b) $connect2->disconnect(); use distinct keyword: select distinct session_user_id phpbb_sessions

java - NoClassDefFoundError when running PopupMenu using android-support-v7-appcompat library in android -

i trying implement popup menu in android application supported android 2.2 . used android-support-v7-appcompat support library it. unfortunately getting java.lang.noclassdeffounderror exception. can't able sort out , can me out? in advance! the logcat shows, 06-27 15:40:30.160: e/androidruntime(26985): fatal exception: main 06-27 15:40:30.160: e/androidruntime(26985): java.lang.noclassdeffounderror: android.support.v7.internal.view.menu.menubuilder 06-27 15:40:30.160: e/androidruntime(26985): @ android.support.v7.widget.popupmenu.<init>(popupmenu.java:66) 06-27 15:40:30.160: e/androidruntime(26985): @ com.example.basic.mainactivity$4.onclick(mainactivity.java:401) 06-27 15:40:30.160: e/androidruntime(26985): @ android.view.view.performclick(view.java:4421) 06-27 15:40:30.160: e/androidruntime(26985): @ android.view.view$performclick.run(view.java:17903) 06-27 15:40:30.160: e/androidruntime(26985): @ android.os.handler.handlecallback(handler.java:730) 0

sql - Group by with Case and Subquery -

i'm having problems when performing grouping following sql: select case when t = '11' 'v' when (t = '20' or t = '25') 's' end [ty], convert(char(3), dateex, 101) + convert(char(4), dateex, 120) [fecha], count(*) [total], sum (case when codlastestado in (3,4,5,6,7,10,11,12,13) 1 else 0 end ) [c1], sum (case when codlastestado in (4,5,6) 1 else 0 end ) [c2], ( select count(*) (select t.line, t.vto, t.subtypo (select c.line, convert(char(3), c.dateex, 101) + convert(char(4), c.dateex, 120) [vto], row_number() on (partition a.numid order a.fechaaccion desc) fila, subtypo acciones a, contratos c a.numid = c.numid , (c.codlastestado in (10,11) , a.idcodtipoestado in (4,5,6)) , c.brand = 'mouse' ) t t.fila = 1 )as q

What are "watches" in IntelliJ and how to use them? -

Image
when debug app, in debug tool window there watches window . have read manual on , over, cannot find practicle usage of watches. somehow, think cool , useful tool , lack not using it. can explain when should use , give few samples? ideally, description bound concrete (imaginary) situation better apply in work. this section allows define expressions you'd see how evolve/change every step of debug process, without manually inspecting available objects , properties. let's take following simple sample intentionally throws npe: public class watchsample { static class student { public static final int credits_required_for_graduation = 10; private string name; private integer credits; public student(string name, integer credits) { this.name = name; this.credits = credits; } string getname() { return name; } public boolean hasgraduated() { return cre

mysql - Multiple inner join on a table where rows represent data attributes -

i have following user table (don't ask me why :) ) | id | cid | attr | text | rdate | --------------------------------------- | 1 | 1 | name | joe | null | | 2 | 1 | date | null | 10.05.2014 | | 3 | 1 | stat | 2 | null | ---------------------------------------- | 4 | 2 | name | joe | null | | 5 | 2 | date | null | 05.05.2014 | | 6 | 2 | stat | 1 | null | ---------------------------------------- | 7 | 3 | name | joe | null | | 8 | 3 | date | null | 03.05.2014 | | 9 | 3 | stat | 2 | null | as can see every user's attribute (name, date, stat) row in table. attributes same cid belong same user. i delete entries refer user attribute date before 08.05.2014 , attribute stat not 2. after running query table be: | id | cid | attr | text | rdate | --------------------------------------- | 1 | 1 | name | joe | null | | 2 | 1 | date | null | 10.05.2014 | | 3 | 1 | stat | 2 |

java can system out result in out of memory issues -

this theoretical question . can flood of system out on java applet , cause applet go out of memory ? if yes easy solution remove multiple sysout spanning across multiple files ? a single system.out.println(x) can cause out of memory error, if x.tostring() uses memory. can flood of system out on java applet , cause applet go out of memory ? it size of resulting string matters, not number. more messages slower, make no difference amount of free memory after full gc , counts.

java - Dependency injection failed when two different packages are interlinked in spring -

i not able autowire when field exists in different package autowired. my code looks this injecting class package com.vmware.vchs.networkservice.extensions.http @component public class httpserviceclient implements contextaware { @autowired jmxagent jmxagent; .... }; injected class package com.vmware.vchs.networkservice.monitoring; @component public class jmxagent { }; my component scan xml file looks this <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:bean="http://www.springframework.org/schema/context" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/

Elixir - Passing multiple lists as function parameters -

i new in elixir google searches , reading have not found me solution current problem. have seen examples in books , tutorials passing in single list parameter function so: [ head|tail ]. defmodule math def double_each([head|tail]) [head * 2| double_each(tail)] end def double_each([]) [] end end i need pass in 2 lists , perform actions on them, so: defmodule pagination def getpaginatedlist([], _, _, _) [] end def getpaginatedlist([list], [paginated], f, l) when f == 1 enum.take(list, l) end def getpaginatedlist(_, [paginated], f, l) when l <= f paginated end def getpaginatedlist([list], [paginated] \\ [], f, l) getpaginatedlist(tl(list), paginated ++ hd(list), f, l - 1) end end however, receive error function clause not matching when passing in list , list b in error below: iex(23)> pagination.getpaginatedlist(a, b, 1, 2) ** (functionclauseerror) no function clause matching in pagination.getpaginatedlist/4 pagin