Posts

Showing posts from April, 2012

sql - Can you run a portion of a script in parallel, based off the results of a select statement? -

i have portion of code which, when simplified, looks this: select @mainlooptableid = min(uid) queueofids (nolock) while (@mainlooptableid not null) begin -- large block of code several things depending on nature of @mainlooptableid -- . -- . -- . -- end of blocks main logic delete queueofids uid = @mainlooptableid select @mainlooptableid = min(uid) queueofids (nolock) end i able run segment of code that's inside while loop parallel uids inside queueofids table. based on happens inside loop i can guarantee not interfere each other in way if run concurrently, logically seems safe run this. real question if there way sql run portion of code values in there? note: did think generating temp table series of created sql statements stored strings, each 1 identical except @mainlooptableid value. if have table of sql statements ready execute, i'm not sure how of these statements execute concurrently. i can't think of way...

swing - Drawing two circles with different positions and colors in java -

Image
i'm new java , want try graphic things it. want generate 2 circles 2 different colors , different positions. code: paint class: package de.test.pkg; import javax.swing.*; public class paint { public static void main(string[] args) throws exception{ jframe frame = new jframe("titel"); frame.setdefaultcloseoperation(jframe.exit_on_close); circle d = new circle(); circle r = new circlered(); frame.add(d); frame.add(r); frame.setsize(600,200); frame.setvisible(true); } } circle class package de.test.pkg; import java.awt.*; import java.awt.geom.*; import javax.swing.*; public class circle extends jpanel { private double iconradius = 100; private color defaultcolor = new color(89,104,99); private int positionx = 0; private int positiony = 0; private ellipse2d iconbody = new ellipse2d.double(getpositionx(),getpositiony(),iconradius,iconradius); public icon(){ ...

android - Redrawing EditText after changing InputType -

i have made class responsible monitoring edittext widget following observer pattern. sole function disable or re-enable auto-correct based on method call. able achieve this, problem new inputtype applies new text add edittext - old text still retains red underline show can auto-corrected. is there way can force new inputtype apply entire edittext block, , not new content add? tried calling edittext.invalidate() , edittext.refreshdrawablestate() in hope text refresh, no avail. final class spellcheckerobserver implements edittextobserver { public static final int key = keygenerator.generateuniqueid(); private int defaultinputtype; spellcheckerobserver(edittextsubject subject) { subject.attach(spellcheckerobserver.key, this); } @override public void activating(edittext edittext) { defaultinputtype = edittext.getinputtype(); edittext.setrawinputtype(inputtype.type_text_flag_no_suggestions); } @override pub...

c# - XAML designer intellisense-like structured suggestion -

Image
with given class (containing hundreds of constants) public class objects { public class cars { public class opel { public const string corsa = "some parameters"; ... } public class ford { ... } ... } } it easy find needed constant in code behind (talking intellisense suggestions): var parameter = objects.cars.opel.corsa; when typing objects. prompted cars , after typing objects.cars. there suggestion opel , ford , etc. , after object.cars.opel there suggestion corsa (among others). my question approach should use provide same kind of suggestion in xaml designer? to example, if have markup extension , i'd assist programmer in choosing proper value out of list, make enum , set property of type , rest happens auto-magically: however, when dealing hundreds of constants i'd prefer have kind of structured selection, similar described earlier intellisense support nested clas...

Magento 1.9 Installation Error -

i trying install magento 1.9 on web hosting server . i ftp-ed files hosted website experience following error when try access url. fatal error: class 'mage_core_controller_request_http' not found in /home/bf/public_html/app/code/core/mage/core/model/app.php on line 1238 i tried google search unable find relevant . just download fresh copy magento community again. make sure server has prerequisite magento mentioned in below link. http://docs.magento.com/m1/ce/user_guide/magento/system-requirements.html

java - Showing different header based on variable in report -

my company switching jasper reports microsoft rs, converting reports jasper, these reports have multiple headers shown based on parametars passed.in rs when hide row(s) whole table jumps up, leaving no empty space. how done in jr? in jasper there property called print when expression think you

servlets - Tomcat 8 webapp, dynamically add PostResources -

i have webapp uses listener dynamically add servlet instances. each servlet instance defined user-defined configuration files, , encapsulates distinct dataset. each of these datasets may include user-defined static web files (html, jpg, css etc). static resources each servlet instance stored outside webapp folder (to avoid deletion on redeployment), , each servlet instance has separate folder hierarchy. in listener contextinitialized method, using javax.servlet.servletcontext.addservlet add each of servlet instances, , javax.servlet.servletregistration.dynamic.addmapping add url mapping servlet. i add other mappings static content in external folders. in tomcat 7, extended org.apache.catalina.servlets.defaultservlet change relativepath new document root, class not work in tomcat 8 0 - classnotfoundexception (org.apache.naming.resources.filedircontext). tomcat 8 has new 'resources' framework should make more straightforward. my question - how can add postresources e...

mysql - How to find list of people whose age is between a range? -

i have situation have date-of-birth stored in database eg. 1990/03/15. want find out info. of records age between 20 & 30. how should write query? i have tried this: age of candidates using query: select timestampdiff(year,dob,curdate()) age `profile` how use list of candidates between age 20 & 30? the now() gives current date. now, date 20 , 30 years older, can following: date_sub(now(), interval 20 year) , date_sub(date, interval 30 year) now remaining query simple. is, select * person dateofbirth between date_sub(now(), interval 20 year) , date_sub(date, interval 30 year)

php - view table joins in codeigniter -

i have 2 tables category table , factory table. in category table have following rows. idcategory category in factory table have following rows. idfactories factoryname postcode country telephone number email website profile adress idcategory i have table have idfactory , idcategory stored too. my factorycategories table has following rows. idfactorycat idfactory idcategory factorycat i made join in category model because want categories on site , when click on category factories stored in category has show up. in model have $this->db->select('*'); $this->db->from('bedrijfcategorieen'); $this->db->join('bedrijfcategorieen', 'bedrijfcategorieen.idbedrijven = bedrijven.idbedrijven'); $this->db->join('bedrijfcategorieen', 'bedrijfcategorieen.idcategorieen = categorieen.idcategorieen'); $query = $this->db->get(); what have store in controller , views? new codeigniter. ps: translated rows...

How do I use the git commit id as a docker image tag in maven? -

i'm trying have docker images maven java project built , pushed in install , deploy phases respectively; , i'd images tagged current git commit id. the problem facing maven-git-commit-plugin not seem export ${git.commit.id.abbrev} variable correctly consumption in docker-maven-plugin . my parent pom.xml goes this: <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <name>myproject</name> <groupid>mygroup</groupid> <artifactid>myartifact</artifactid> <version>0.0.1-snapshot</version> <packaging>pom</packaging> <modules> <module>mymodule<...

php - How to restrict wordpress plugin installation just on one website (preventing multi site install)? -

i have wordpress plugin going release soon. remaining feature restrict plugin usage people download can use on 1 website. cannot seem find existing tutorial on how achieve this. can give me pointers on how deal this? how can tweak plugin code such can keep track of how many times plugin has been used. please advise feasible ideas. great if can point me tutorials / articles explain concept in detail. perhaps there might existing solution not restricted wordpress, rather of general php solution. please advise me on this. ! there no possibility tha really. check in wp there few dirty solutions (my opinion), ioncubing code , implementing serialnumber encodes domain name. ping server you can implement ping own server actual domain name, check wether domain allowed use plugin, if not, sue domain owner. trust customers but if want more of opinon: trust customers.

javascript - Is it possible to edit and save text in phonegap? -

i developing app in phonegap (and xcode, xml & html) basic functions write file onload , read user etc. i'm @ point have been asked read file textarea , allow user edit , save edits file. using phonegap, possible so? i'm having trouble finding out how save edits - point find trouble with. please note i'm new xml , phonegap wold appreciated. if tell me if it's possible edit , save edits using languages using fantastic, although if possible direct me sites find out how it/give me code here? thank in advance xx you can read files or write files system using phonegap. read documentation it. if file xml, gonna have parse , read using javascript . you must try first , update comment section specific error encountering users here able out. luck.

HTML Form and Table Code Works in Fiddle But not on Site -

i have page has several tables forms send data php script. can see example here: https://jsfiddle.net/1gl4qzh2/ <form action='singleview.php' method='post'> <table id='scholarship' style='float:left;' align='center'> <thead> <th class='head' colspan='3' style='text-align:center;'>university of michigan--dearborn <br> <br>full tuition <br> <br>public <br> <br> <input type='hidden' name='id' value='arluj'> <input type='submit' value='view more details'> </th> </thead> </form> </table> the issue having first 2 table on top left corner button "view more details" not working. of other tables work fine on. when put in fiddle seem work properly. does know in fiddle code missing these work?

java - dynamically creation of subproject which can be access by subdomain based on different user -

i have project in java ee. want change logo , background color of project based on user. example : if url is: www.xyz.com --> should open project default logo , background. but if url is: abc.xyz.com or xyz.com/abc --> should open project logo , background specific abc . here abc user name can created dynamically. want know if create user how can access same project url username.xyz.com or xyz.com/username. i think solution configure app behave want http://appurl/username url , use apache http server proxy route calls http://username.appurl http://appurl/username . in order achieve http://appurl/username can map application treat mapped /* , treat following first / parameter. can achieved using basic servlet mapping or, example, spring mvc .

python - Django/sqlite3 "OperationalError: no such table" on threaded operation -

by read in docs, both django , py-sqlite3 should fine threaded access. (right?) code snippet fails me. operations in main thread work, not in thread(s) create. there get: file "c:\python27\lib\site-packages\django-1.9-py2.7.egg\django\db\backends\sq lite3\base.py", line 323, in execute return database.cursor.execute(self, query, params) operationalerror: no such table : thrtest_mymodel what's problem? how go tracking down what's happening patch django or whatever's necessary fix it? point of failure in django pretty indimidating. can't tell how see tables see, or differences between main , other threads. from django.db import models # super-simple model class mymodel(models.model): message = models.charfield('message', max_length=200, blank=true) #test django.test import testcase import time import threading import random done = threading.event() nthreads = 1 def insertrec(msg): rec = mymodel.object...

c++ Console application connection to android app -

i have make connection between android app , c++ console application: console application suppose client side has 4 commands data server android device. in other words need display device info (bt/wifi on/off, battery lvl) in console application. i created client side , have code things have check(if bt on example). thing i'm missing connection between these, have no experience in server code, , need this, how done or links tutorials cause didn't find some. the android code: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); //imei init telephonymanager telephonymanager = (telephonymanager) getsystemservice(context.telephony_service); imei = telephonymanager.getdeviceid(); //software version init packageinfo pinfo = null; try { pinfo = getpackagemanager().getpackageinfo(getpackagename(), 0); } catch (packagemanager.namenotfoundexcepti...

tomcat - No content encoding in response header -

server.xml file in /tomcat 6.0/conf given below. <?xml version='1.0' encoding='utf-8'?> <server port="8005" shutdown="shutdown"> <!--apr library loader. documentation @ /docs/apr.html --> <listener classname="org.apache.catalina.core.aprlifecyclelistener" sslengine="on" /> <!--initialize jasper prior webapps loaded. documentation @ /docs/jasper-howto.html --> <listener classname="org.apache.catalina.core.jasperlistener" /> <!-- jmx support tomcat server. documentation @ /docs/non-existent.html --> <listener classname="org.apache.catalina.mbeans.serverlifecyclelistener" /> <listener classname="org.apache.catalina.mbeans.globalresourceslifecyclelistener" /> <globalnamingresources> <resource name="userdatabase" auth="container" type="org.apache.catalina.userdatabase" ...

Trouble unit testing service with the Router injected in the constructor in Angular 2 -

i'm trying test service has application router injected in constructor. following julie ralph's suggestions presented in angularconnect conf 2015 (and repository: https://github.com/juliemr/ng2-test-seed ), i'm using karma , jasmine. it follows example service tested: import { router } 'angular2/router'; export class exampleservice { constructor(router : router) { this._router = router; } //... } right now, i'm asserting truth. follows service test: import { it, describe, expect, inject, beforeeachproviders, mockapplicationref } 'angular2/testing'; import { router_providers } 'angular2/router'; import { provide, applicationref } 'angular2/core'; import { exampleservice } 'example-service.js'; describe('exampleservice', () => { beforeeachproviders(() => [ router_providers, exampleservice, provide(applicationref, { useclass: mockapplicationref }) ]); it('should validate tru...

sql server - EF4 - The selected stored procedure returns no columns -

i have query in stored procedure calls linked servers dynamic sql. understand ef doesn't that, listed columns returned. yet, still doesn't that. doing wrong here? want ef able detect columns returned stored procedure can create classes need. please see following code makes last lines of stored procedure: select #tempmain.id, #tempmain.class_data, #tempmain.web_store_class1, #tempmain.web_store_class2, #tempmain.web_store_status, #tempmain.cur_1pc_cat51_price, #tempmain.cur_1pc_cat52_price, #tempmain.cur_1pc_cat61_price, #tempmain.cur_1pc_cat62_price, #tempmain.cur_1pc_cat63_price, #tempmain.flat_length, #tempmain.flat_width, #tempmain.item_height, #tempmain.item_weight, #tempmain.um, #tempmain.lead_time_code, #tempmain.wp_image_nme, #tempmain.wp_mod_dte, #tempmain.catalog_price_chg_dt, #tempmain.description, #tempmain.supersede_ctl, #tempmain.supersede_pn, tempdesc.cust_desc, ...

c++ - Python passing char * as an argument to a function -

i have created python module c++ static library using cython add-on. c++ library provides function listing contents of folder. provides name of directory contents displayed, output buffer contents of directory stored, , of course length of output buffer. c++ definition of function follows: int listitems(char *dir, char *buf, int buflen) the python module in turn has function pylistitems calls function: def pylistitems(char *dir, char *buf, int buflen): return listitems(dir,buf,buflen)` in script using function, define string buffer , pointer of type c_char_p , , pass function in place of buf argument: buf = c_types.create_string_buffer(100) pbuf = c_char_p(addressof(buf)) pylistitems('somefolder',pbuf,100) but getting following error: typeerror: expected string or unicode object, c_char_p found any appreciated. pbuf = c_char_p(addressof(buf)) you don't need this. create_string_buffer returns character array. do: buf = c_types.cre...

c++ - Checking if the object passed to a method is "this" -

i'm trying solve following problem: suppose i'm writing class has method mymethod modifies both *this , argument passed: class myclass { //some code here void mymethod(myclass& other) { //modify *this , other } }; the problem want method nothing when following piece called: myclass x; x.mymethod(x); checking equality not enough, because want able call 2 identical objects. in more down-to-earth way, example, suppose myclass std::set , mymethod merges 2 sets, emptying other . 2 identical sets can merged, can't empty , fill 1 set @ same time. how can check this? advice appreciated. you can compare address of other this : class myclass { //some code here void mymethod(myclass& other) { if (this != &other) { //modify *this , other } } }; since pass reference, pointers equal if pass same object function 1 called on.

powershell - Application runs in Windows 7 but not in Windows 10 -

i have created app , restore of computers. allows modification of adobjects through use of custom profile.ps1 file. app runs fine in ise no errors , works no errors in windows 7. however, when try run in newly imaged windows 10 machine "property can not found" errors on object properties. the thing can read properties when fill comboboxes fine. error occurs when form submitted. attach 1 of forms having problem with. again runs fine in windows 7, not windows 10. could problem microsoft updates? also, yes, setting set-executionpolicy -scope process -executionpolicy unrestricted . error message: the property 'company' cannot found on object. verify property exist , can set. + $co.company = $company + categoryinfo :invalidoperation: (:) [] runtimeexeption code: . \\iotsdsp01pw\installs$\movetoou\pcdeployment\profile.ps1 #region validation functions function validate-isemail ([string]$email) { return $email -match "^(?("")(""....

python - Error adding local file to docker image with docker-py -

i have been working docker-py, in order build images , launch containers in 1 script. far has been smooth. however, having issues add/copy commands in dockerfile string variable. i need add file source directory directly image. standard dockerfiles, have been able achieve successfully, using docker add command. using docker-py, throws exception: exception: error building docker image: lstat simrun.py: no such file or directory the script simrun.py stored in same directory docker-py script, cannot understand why receiving exception. relative line in dockerpy.py is: add ./simrun.py /opt is there i've missed, or functionality not work in docker-py yet? you need set path in docker build context using path parameter. see here

android - Shut down bluetooth after closing connection -

i bought bluetooth headphone pair experia z3. wondering code might use develop app automatically shut off bluetooth on phone after loses connection headphones. tried looking code couldn't find looking for. kind regards, here question may thought process enable/disable bluetooth .you can build upon specific task.

geb - What does curly brackets syntax mean in Groovy? -

what syntax mean in groovy: class createmessagepage extends page { static @ = { assert title == 'messages : create'; true } static url = 'messages/form' static content = { submit { $('input[type=submit]') } myverystrangeform { $('form') } errors(required:false) { $('label.error, .alert-error')?.text() } } } (taken spring mvc test htmlunit manual ) the question groovy , know answer in groovy terms. what content ? static variable? it's name random or predefined base class of page ? what = (equal singn) after it? assignment operator? what @ right hand side of = ? closure? or if anonymous class? or if these same? what submit inside curly braces? is variable? why there no assignment operator after then? is function definition? can define functions in arbitrary places in groovy? if function definition, errors then? is submit is function call, receiving { $('input[type=submit]...

php - Unable to replace alias "templating" with "fos_rest.templating" -

i'm trying setup symfony3 microkelner work fosrestbundle , i've faced issues it. i want use input json or xml , output json or xml. i've did setup , face errors: invalidargumentexception in containerbuilder.php line 766: service definition "templating" not exist. and invalidargumentexception in replacealiasbyactualdefinitionpass.php line 48: unable replace alias "templating" "fos_rest.templating". this how config.yml looks (parts templating , fos_rest) # friends of symfony rest fos_rest: disable_csrf_role: role_api view_response_listener: force force_redirects: html: true param_fetcher_listener: true body_listener: decoders: xml: fos_rest.decoder.xml json: fos_rest.decoder.json format_listener: enabled: true rules: - { path: '^/', priorities: ['json', 'xml'], fallback_format: 'json', prefer_extension: f...

Sharing text through XBee on Arduino -

how share text through xbee module? i tried, instead of word, getting numbers every time. want exchange text data both sides. using arduino communication. how can fix problem? i've been through similar problem , able work around it. assume you're using mega 2560 , have set of xbee modules connected 2 computers through sparkfun xbee usb explorer. i've included code can upload both of xbees , use them simple walkie-talkie pair. program meant read entire incoming word/string terminated defined character. //xbee walkie-talkies #define endofinput '@'//define terminating character void setup() { serial1.begin(9600); //serial thru pin 19 serial.begin(9600); //serial monitor } string incomingword=""; //initialize null char input; //to read incoming character void loop() { if (serial.available()>0) { // send out whatever typed @ serial //monitor thru xbee serial1.write(serial.read()); } //read entire incoming word ...

Search and Replace Columns using Full Text Search Mysql -

is there way of running mysql query using full text search search column example (hayes) , replace rest of string "hayes" once matched?: column1: london, hayes, md15 736 where match (column1) against ('hayes' in boolean mode) column1: hayes so since column 1 has matched "hayes" removed rest of string. needs done full text example takes long on large data sets. and there no set order keyword maybe cannot use find_in_set also running large number of keywords below: where match (column1) against ('hayes' in boolean mode) or match (column1) against ('+west +bromwich' in boolean mode) or match (column1) against ('london' in boolean mode) so if run above query on column1 contains following string: london, m456, hayes <<< match hayes , not both london , hayes. you can try find rows contain @ least 1 of 2 words. against ('+hayes +london' in boolean mode) if want find row contain both...

c - Suggestions to handle `Wframe-larger-than`-warning on kernel module -

hello , happy new year, i'm working on kernel-module. necessary numeric calculation of parameter set device correctly. function works gcc compiler (i'm using kbuild) gives me warning: warning: frame size of 1232 bytes larger 1024 bytes [-wframe-larger-than=] if i'm right means space local variables exceed limitation given machine module compiled on. there questions now: does warning refer whole memory space needed module, explicit function or function , sub-functions? how critical this? i don't see way reduce needed memory. there suggestions handle this? how-to? maybe helpful: calculation uses 64bit fixed-point-arithmetic. functions of library inline functions. thanks in advance alex following advice @tsyvarev problem reduce allocation in function example shows (i know code doesn't make sense - it's showing how declare variables inside functions): uint8_t getval ( uint8_t ) { uint64_t ar1[128] = {0}; uint64_t ar2[128] = {0}; ...

iphone - How to keep the ASIHTTPRequestDelegate even when if the user poped from that view controller? -

i have application in need have settings page,which has credentials of user can edit that.its table view loading array taken httprequest.by clicking on each of have option go aother view , update value , come back.i have done update call server on update view this.. dispatch_async(backgroundqueue_, ^{ [self performselectorinbackground:@selector(load) withobject:nil]; dispatch_sync(dispatch_get_main_queue(), ^{ [self showhud]; }); because in mainqueue doing popping operation.so need update service called in background.but problem when coming calling service in settings viewcontroller .to load updated value.some times delegates of request getting crashed.i calling service this. asiformdatarequest *request = [asiformdatarequest requestwithurl:url]; [request setpostvalue:uidstr forkey:@"userid"]; request.userinfo=[nsdictionary dictionarywithobject:@"update" forkey:@"type"]; [request ...

JAVA - calculator no if's or catch - ScriptEngineManager -

as school job have write calculator (args passed command line) without conditional operands such if, catch or for, while, etc. i want use javascript calculation, problem java.lang.classcastexception: java.lang.integer cannot cast java.lang.string. please me correct code. import java.math.bigdecimal; import javax.script.scriptenginemanager; import javax.script.scriptengine; public class calc { public string docalc(string string) { string[] argslist = {}; bigdecimal = null, b = null; string operand = null; try { argslist = string.split("\\s+"); = new bigdecimal(argslist[0]); operand = argslist[1]; b = new bigdecimal(argslist[2]); //javascript arithmetics scriptenginemanager mgr = new scriptenginemanager(); scriptengine engine = mgr.getenginebyname("javascript"); //javascript arithmetics return (string) engine.e...

ruby - How can I install Rails on Ubuntu 14.04? -

i'm newbie ubuntu. chromebook pixel ls(2015) ubuntu 14.04 amd64 crouton.unity and installed rvm 1.26.11 & ruby 2.3.0p0 how can install rails?? i tried things. don't have knowledge linux... (trusty)snowcat@localhost:~$ gem install rails --version 4.2.5 --no-ri --no-rdocfetching: rack-1.6.4.gem (100%) installed rack-1.6.4 fetching: concurrent-ruby-1.0.0.gem (100%) installed concurrent-ruby-1.0.0 fetching: sprockets-3.5.2.gem (100%) installed sprockets-3.5.2 fetching: thread_safe-0.3.5.gem (100%) installed thread_safe-0.3.5 fetching: tzinfo-1.2.2.gem (100%) installed tzinfo-1.2.2 fetching: i18n-0.7.0.gem (100%) installed i18n-0.7.0 fetching: activesupport-4.2.5.gem (100%) installed activesupport-4.2.5 fetching: mini_portile2-2.0.0.gem (100%) installed mini_portile2-2.0.0 fetching: nokogiri-1.6.7.1.gem (100%) building native extensions. take while... error: error installing rails: error: failed build gem native extension. current directory: /home/snowca...

How to properly "merge/purge" exported windows event logs? -

i'm looking ideas/suggestions on how improve process de-duplicating windows event log entries in exported .evt files. we collect exported windows logs number of machines on daily basis. these transferred separate facility archiving, analysis, etc. our process renames each log file year , day #, , archived. machine "server1", example, have each day's logs available in files this: server1_2016_001_application.evt server1_2016_002_application.evt server1_2016_003_application.evt ...and on. each log type (system, security, others well). in order avoid getting lots of duplication, i've been using wevtutil produce trimmed-down copies of these files so: wevtutil epl "application.evt" "server1_2016_003_application.evt" "/q:*[system[timecreated[@systemtime>='2016-01-02t00:00:00.000z' , @systemtime<='2016-01-02t23:59:59.999z']]]" /lf:true /ow:true but , other attempts i've made clumsy; "003...

How to skip the first and consider the second row whenever duplicate cells come in a column SQL Server -

i have following table. startdatetime column repeated when duration on day. want write query skips first row , count difference of second row whenever duplicate cell in startdatetime column come. e.g. in case of following sample table output want given in table. create table test ([name] varchar(50), [startdatetime1] datetime, [enddatetime2] datetime, diffy int) ; insert test ([name], [startdatetime], [enddatetime2], [diffy]) values ('abc', '2015-07-21 16:08:02.000', '2015-07-21 16:18:10.000', '608' ), ('abc', '2015-07-21 16:18:10.000', '2015-07-21 23:06:46.000', '24516' ), ('abc', '2015-07-21 16:18:10.000', '2015-07-23 12:37:35.000', '159565' ), ('abc', '2015-07-23 17:33:35.000', '2015-07-24 11:07:00.000', '63205' ) ; ╔══════╦════════╗ ║ name ║ diffy ║ ╠══════╬════════╣ ║ abc ║ 608 ║ ║ abc ║ 159565 ║ ║ abc ║ 63205 ║ ╚═...

flex - Do unused imports in Flash Builder 4 affect RUNTIME performance? -

i have not found links referred unused imports in flash builder . there were, however, plethora of links , comments on subject more popular languages. assume compilers optimize unused imports in same manner need sure before pass information on superior. so... do unused imports affect runtime performance in flash builder projects??? please provide references! in advance! if classes not used in code, import statement ignored compiler , classes not included in compiled application. unused imports have no effect on compiled app @ all. i can't think of reference in fb. can test though - take empty application, include custom component , compile. check swf filesize. remove component leave import in. compile again , see filesize reduced (this component not included in app).

System.Data.SqlClient.Sql Error in C# Winform Application -

i got following error when try run c# winform application on client machine description: stopped working problem signature: problem event name: clr20r3 problem signature 01: ics.exe problem signature 02: 1.0.0.0 problem signature 03: 5134926a problem signature 04: system.data problem signature 05: 2.0.0.0 problem signature 06: 4a275e65 problem signature 07: 2755 problem signature 08: 29 problem signature 09: system.data.sqlclient.sql os version: 6.1.7600.2.0.0.768.2 locale id: 1033 read our privacy statement online: http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409 if online privacy statement not available, please read our privacy statement offline: c:\windows\system32\en-us\erofflps.txt and here application.run code [stathread] static void main() { application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); application.run(new frmlogin2...

oracle - SQL Grouping with No Duplicates -

here output. no problem here. want. added distinct id remove duplicates , works in each grouped month. mn | cnt ==================== 1 | 1 10 | 2 11 | 5 12 | 5 select extract(month trunc(hdate)) mn, count(distinct id) cnt schema.travel (arr = '2' or arr = '3') , hdate between to_date('2015-10-01', 'yyyy-mm-dd') , to_date('2016-09-30', 'yyyy-mm-dd') group extract(month trunc(hdate)); but can still possibly have duplicates span more each month. if have record in october , in november same id - want count once - issue so on course of year or time period - id gets counted once...but still need maintain monthly groupings , output... ?? in other words, want count each id in first month appears. select extract(month trunc(hdate)) mn, count(distinct id) cnt (select id, min(hdate) hdate schema.travel t arr in '2', '3') , hdate between date...

powershell - Syntax Error in simple Python code -

i found exercise online make specific program, kinda got lost writing, , forgot test far long. program spitting out error - , strange one, @ that. i didn't know how of post, i'm putting out here in case. import math print "hey. want activate hypothenuse program, or diagonals one?" print "[1] hypothenuse" print "[2] diagonals" program_chosen = raw_input() if program_chosen == "1": print """ hello. simple math program determine length of hypothenuse of right triangle given other 2 sides. results rounded 3 decimal places, avoid confusion. """ # once other problems have been dealt with, implement "choose digits rounded" option. side1 = int(raw_input("please enter length of of non-hypothenuse sides of triangle. ")) side2 = int(raw_input("now, enter length of other side. ")) pythagoras = math.sqrt((side1**2)+(side2**2)) ...

javascript - Is it ok to rely on node.js module state? -

first of i'm not experienced in node.js. understanding of node.js' modules act pretty same python's modules. mean executing code once , maintaining internal state. until i've read this article : but might not realize (i sure didn't!) if project based on npm modules both require "shared" module dependency, this: node_modules/one/index.js: var shared = require('shared'); node_modules/two/index.js: var shared = require('shared'); ... , install dependencies npm, there 2 copies of "shared/index.js" hanging about: node_modules/one/node_modules/shared/index.js node_modules/two/node_modules/shared/index.js after reading i'm not sure, 1 can rely upon module's internal state because of possibility of existence of 1 module on different paths , hence having 2 or more instances of same module in cache. means @ least "no more singletons through native modules mechanism" . meanwhile, hav...

c# - OData v4 filter query fails when using contains on calculated property -

so have code first ef 6 layer has contact class of: public class contact { [key] public int id { get; set; } [maxlength(50)] public string prefix { get; set; } [maxlength(50)] public string suffix { get; set; } [maxlength(50)] public string firstname { get; set; } [maxlength(50)] public string middlename { get; set; } [maxlength(50)] public string lastname { get; set; } [notmapped] [displayname("full name")] public string fullname { { string tempname = (!string.isnullorempty(prefix) ? prefix + " " : "") + (!string.isnullorempty(firstname) ? firstname + " " : "") + (!string.isnullorempty(middlename) ? middlename + " " : "") + (!string.isnullorempty(lastname) ? lastname + " " : "") + (!string.isnullorempty(suffix) ? su...