Posts

Showing posts from February, 2012

sql server - Crystal Reports does not put linked view into FROM clause causing "The multi-part identifier xxx could not be bound" -

i've stuck crystal reports 2008 (12.0.0.683) project. i have added 1 more view in database expert existing (working) report. it's (the view) linked main table. it's linked left outer join (not enforced, =). on runtime sends query sql server column additional view put select clause view name not put clause. causes "the multi-part identifier xxx not bound" error. understend error cannot force cr use view in clause. not think there special view (more views linked in report). did face similar problem? please give tips. in advance! ps. query goes sql server (seen sql profiler) like: select newview.col1, newview.col2, maintable.col1, maintable.col2, subtable.col1, subtable.col2 -- no [newview] anywhere in clase maintable inner join subtable on (.. = ..) .. = .. finally i've found solution. there "show sql query.." in crystal reports apps. in query view i've found 1 of tables taken database (test db instead ...

bash - How to prompt to the user while performing a find>replace in unix -

i'm trying write script works microsoft words find>replace function. first asks 2 inputs user. first 1 strings found , second 1 strings replace old ones. though pretty straight forward, want count number of things replaced , echo user confirms these specific number of replacements. how can that? far have search>replace function: for file in `find -name '*.sdf.new'`; grep "$search" $file &> /dev/null sed -i "s/$search/$replace/" $file done while read -u 3 -r -d '' file; n=$(grep -o "$search" "$file" | wc -l) read -p "about replace $n instances of '$search' in $file. ok? " ans if [[ $ans == [yy]* ]]; sed -i "s|${search//|/\\\\|}|${replace//|/\\\\|}|g" "$file" fi done 3< <(find -name '*.sdf.new' -print0) there's tricky stuff going on here: the output find command send while loop on file descriptor 3, , ...

c++ - What is wrong with this solution of mine for the PKU Judge ID 1003? -

here link problem id 1003 of pku judge: http://poj.org/problem?id=1003 all need problem calculate sum of harmonic progression , compare variable have inputted i getting right answers sample input cases, don't know why answer not getting accepted? getting 'wrong answer' result. part in problem says "the input consists of 1 or more test cases, followed line containing number 0.00 signals end of input" don't know how 0.00 part, taking single input, didn't understand how that? here solution: #include<iostream> using namespace std; int main() { float c; float sum = 0; cin >> c; short int = 1; while(1) { sum += (float)1/(i+1); if(sum >= c) { cout << << " card(s)"; break; } i++; } return 0; } the input consists of 1 or more test cases, followed line containing number 0.00 signals end of input. each test...

neo4j - relationship types in py2neo -

how can can type of relationship cypher query in py2neo? have piece of code works. def print_row(row): a,b = row print (a["name"] + " " + b["name"]) cypher.execute(graph_db, "start a=node(1) match (a) - [] - (b) return a,b", row_handler=print_row) this way can print out nodes connected input node (1). rock paper rock scissors however print type of relationship these nodes have. for instance: rock beats scissors rock beaten_by paper what tried (and failed) follows: def print_row(row): a,b,r = row print (a["name"] + r["type"] + b["name"]) cypher.execute(graph_db,"start a=node(1) match (a) -[r]->(b) return a,b,r", row_handler=print_row) how can py2neo? you need use cypher type function ( http://docs.neo4j.org/chunked/milestone/query-functions-scalar.html#functions-type ). code this: def print_row(row): a, r_type, b = row print(a["name"] ...

java - Probabilistic Latent Semantic Analysis -

i looking tutorial or implementation of plsa in java. there similar question in link https://stackoverflow.com/questions/16396463/probabilistic-latent-semantic-analysis-indexing-in-java , however, there no reply query swell. have watched talk on plsa thomas hoffman, can't seem head around implementation. appreciated. well according wikipedia : p(w,d) = \sum_c p(c) p(d|c) p(w|c) = p(d) \sum_c p(c|d) p(w|c) that formula need implement. further, em algorithm need. if don't understand algorithm or function cannot consumer of it.

Publish on Tomcat from Eclipse -

i have problem when publishing web project on tomcat. i've got error: !entry org.eclipse.wst.server.core 4 0 2013-07-17 14:22:41.293 !message not publish server. !stack 0 java.lang.nullpointerexception @ org.eclipse.wst.common.componentcore.internal.util.virtualreferenceutilities.getdefaultprojectarchivename(virtualreferenceutilities.java:81) @ org.eclipse.jst.j2ee.componentcore.j2eemodulevirtualcomponent.getjavaclasspathreferences(j2eemodulevirtualcomponent.java:338) @ org.eclipse.jst.j2ee.componentcore.j2eemodulevirtualcomponent.getnonmanifestrefs(j2eemodulevirtualcomponent.java:242) @ org.eclipse.jst.j2ee.componentcore.j2eemodulevirtualcomponent.getreferences(j2eemodulevirtualcomponent.java:166) but if turn off maven's resolve dependencies workspace in web project works fine. any idea thanks zlaja i have used m2e plugin instead of m2e-wtp. after installing m2e-wtp works fine. zlaja

xml element is being returned as object HTMLCollection -

i have xml document returns list of map markers. <markers> <marker name="marker 1 name" theid="100"> <content>text goes here</content> </marker> <marker name="marker 2 name" theid="101"> <content>other text goes here</content> </marker> ... </markers> i have javascript read through list of markers , returns attributes variables name , theid . <script> ... var xml = parsexml(data); var markernodes = xml.documentelement.getelementsbytagname("marker"); (var = 0; < markernodes.length; i++) { var name = markernodes[i].getattribute("name"); var theid = markernodes[i].getattribute("theid"); var content = markernodes[i].getelementsbytagname("content"); ... </script> however cannot javascript return contents of element tag content . in place of text content message [object htmlcollection] . kind enough me fix please? t...

drools - Event Processing -

i'm new drools. i'm trying write simple complex event processing (cep) application using drools fusion. my requirement is - on receipt of critical event, perform action (right that's sop) - if critical event arrives within 5 minutes of previous event , same source, ignore i have simple event class follows: public class event { private string id; private date timestamp; private string source; private event.severity severity; private string description; /// getter , setter /// } the rules file follows: declare event @role(event) end rule "alert critical events. don't alert next 5 minutes if same source" when $ev1: event($source: source, severity == event.severity.critical) entry-point "events" not ( event(this != $ev1, source == $source, severity == event.severity.critical, before [1ms, 5m] $ev1) entry-point ...

jax rs - How to make in Jax-rs @Path to accept an url encoded? -

i'm trying have route working: http://localhost:8080/api/settings/http%3a%2f%2fdbpedia.org%2fresource%2fapplication_software where http://dbpedia.org/resource/application_software id item want settings. instead, i've got working: http://localhost:8080/api/settings/http://dbpedia.org/resource/application_software which not if want pass other parameters after url http://dbpedia.org/resource/application_software . the function code is: @get @path("/settings/{uri:^(https?|ftp|file)://[-a-za-z0-9+&@#/%?=~_|!:,.;]*[-a-za-z0-9+&@#/%=~_|]}") public response geturisettings( @pathparam("uri") string uri, @context final httpservletresponse response) { logger.debug("getting settings of " + uri); ... i'm validating have url in paramenter regex, cannot pass urlencoded... how can work around problem have url id encoded on request? thanks!

css - Line breaks in LESS -

is possible tell less ignore deleting line breaks in compiled css in order have cleaner , more readable css? and possible tell less keep single line css rules instead of inserting line breaks between each selector, example: less: html,body,div,span { ... } compiled css: html, body, div, span { ... } to best of knowledge, cannot done. looking source of less compiler , there options used customize behaviour (e.g. max_line_len ), none affect behaviour. i think need either find way customize less compiler or find out alternative compiler implementation less allow configuration. either way, i'm not sure if worth trouble. also, honest, way less uses line breaks. it's more readable , encourages apply rules in simplest possible fashion keep number of lines low.

jquery - explode, match and get value -

this question has answer here: how can query string values in javascript? 73 answers i have string: title=hello world&dropdown=on&count=on&hierarchical=on and want explode string & , like; title=hello world dropdown=on count=on hierarchical=on i know names title, dropdown, count,hierarchical (but names not fixed, can anything), now want match names (name means words before equal sign) name know, if match value (words after equal sign), like: if (name == myname) value var myname = dropdown; if (dropdown == myname)alert(dropdown.value) split string array, put array object, can compare nicely: var string = "title=hello world&dropdown=on&count=on&hierarchical=on"; var stringarr = string.split("&"); console.log(stringarr); var newobj = {}; (var = 0; < stringarr.length; i++) { var parts =...

database design - EF Modelling Help: User with multiple Roles and Locations at a Company (Model First) -

i kind of stuck in easy modelling / design process. how design following model? i'm working entity framework 5 / model first. i have users working in companies. each user can have multiple roles in company. each user can work @ multiple locations company. a user can work @ more 1 company, , has choose in company's name acting (this important). i designing weird looking ternary classes "userlocationcompany" has 1-n-relationships each entity (what when designing tables in db), , properties "user.currentcompany" ends having dead end @ company entity. right approach such problem? you know better whether fits case, make location property of role? role link onto either location or perhaps 1 role can have many locations. either way, stops repeating work of linking company , user, using existing connection add more data. hope that's useful :)

How can i create custom YMM in magento? -

we developing online store car auto parts need filter product on base of year,make , model attribute. create custom module modules block code goes here... public function getyears(){ $attribute = mage::getmodel('eav/config')->getattribute('catalog_product', 'year'); $option = $attribute->getsource()->getalloptions(true); return $option; } public function getmake(){ $attribute = mage::getmodel('eav/config')->getattribute('catalog_product', 'make'); $option = $attribute->getsource()->getalloptions(true); return $option; } public function getmodel(){ $attribute = mage::getmodel('eav/config')->getattribute('catalog_product', 'model'); $option = $attribute->getsource()->getalloptions(true); return $option; } } via above function configurable products attributes option , values depend on basis of these attribute se...

java - How can I change Page Title periodically and switch the change on/off? -

i want change title of page periodically, i.e. add (*) in front of current page title , remove after couple of seconds. want turn title change on , off in code. i , set page title from: public static native void setpagetitle(string title) /*-{ $doc.title = title; }-*/; public static native string getpagetitle() /*-{ return $doc.title; }-*/; but how should write function change page title every 300 miliseconds while adding , removing prefix? what tried was: private void changepagetitle(final string prefix) { new timer() { @override public void run() { string pagetitle =getpagetitle(); if (pagetitle.startswith(prefix)) { pagetitle = pagetitle.substring(prefix.length()); } else { pagetitle = pagetitle + prefix; } setpagetitle(pagetitle); } } }.schedule(300); } this not work. , not know how s...

html - Looking for a clean way to handle IE7 Compatibilty for multiple inline-block elements -

i have several occurrences of inline-block elements in webpage. i'm tired of applying *display: inline; zoom: 1; hack on css selectors use blocks. there convenient way fix occurrences on page? you have 1 big selector applies of them @ once, e.g. /* inline-block fix older versions of ie */ .foo, .bar, .baz, .gallery > li { *display: inline; zoom:1; }

django alter settings for one app -

well, have django project works fine now. i'd add new app it, in need access multiple databases. i know django support multiple databases settings , know how configure it. not problem. the issue that, in 90% of project components, don't need maintain multiple databases settings. usage second databases in new added app. so tried alter settings calling: django.conf.settings.configure(databases = {....}) in new app. , django said: runtimeerror: settings configured. which makes sense, since have origin settings file , set django_settings_module up. so question should approach in case. i don't want discard django_settings_module variable. i try not include second database in setting file initially, since new app independent module should work independently outside django project. want have similar config in new app setup database config. does has idea this? thanks in advance! actually, have same issue in current project. have totally in...

java - Jersey - Marshal Object from HTTP Headers -

is possible have jersey take series of http headers , marshall them pojo, 1 might post parameters? if want access specific @headerparam string , use answers provided @juned ahsan or @dj spiess. if want inject them pojo, recommend using jersey's @beanparam in 2.x. for example: @path("/foo") public class fooresource { @get @path("/bar") public void bar(@beanparam mybean mybean) { // } } public class mybean { private string uacompatible; public mybean(@headerparam("x-ua-compatible") string uacompatible) { this.uacompatible = uacompatible; } public string getuacompatible() { return this.uacompatible; } } @beanparam can replaced @injectparam jersey 1.x (>=1.4) or @inject in 1.x earlier 1.4. javax- @inject can used if you're using dependency injection framework such spring.

authorization - Spaces in ActiveMQ AuthorizationEntry Group Names -

i trying use jaasauthenticationplugin authenticate users trying access specific queues. (most of code based off of examples given in activemq in action) ultimately, want authenticate against active directory server, may have groups spaces in names, when attempt use groups spaces in names, run problems. have far: login.config: activemq-domain { org.apache.activemq.jaas.propertiesloginmodule required debug=true org.apache.activemq.jaas.properties.user="users.properties" org.apache.activemq.jaas.properties.group="groups.properties"; }; users.properties: user=password group.properties: users=user users group=user activemq.xml: <plugins> <jaasauthenticationplugin configuration="activemq-domain" /> <authorizationplugin> <map> <authorizationmap> <authorizationentries> <authorizationentry queue=">"...

sed - copy paste a line into another file at the same position in bash -

i want copy line 30 1 specific file , paste line 30 in file. cannot manually because files big (20 gb+) i have found out how append end of file: awk 'nr==30' file1.txt >> file2.txt how specify line file2? you can't using redirection mechanism. perhaps suggest perl script (or awk, given you're using awk already), reads line, writes it, , slips new line in @ appropriate place. my $count = 0; while (<input>) { print output $_; if ($count == 30) { print output $linetobeinserted; } $count++; } note how doesn't store whole file in memory merely each line @ time.

javascript - Firefox Input Label and jquery 1.9 -

i'm trying figure out best way of detecting firefox without use of .browser (since jquery 1.9 has deprecated) essentially have html: <label class="uploadbutton" for="test">test</label> <input type="file" name="test"/> this works fine ie , chrome nothing in firefox. pre 1.9 had this: if ($.browser.mozilla) { $('.uploadbutton').click(function () { $(this).siblings("input").click(); }); } which worked without issues. what best way of making work .browser property gone? (i looked under features , found no feature detect well..) i found ua = window.navigator.useragent.tolowercase() as part of answer here .

java - new Thread(runnable, name) return null -

i have problem multi-threaded application, bound button stop thread thread = null; after start thread (using same variable) thread = new thread(this, "game"); thread.start(); after new thread, thread still null , don't know why please help. without more information following speculation. please in future show more details , explain have done debug problem. after new thread, thread still null , don't know why please help. it not possible constructor return null else going on. thread thread = null; thread = new thread(this, "game"); // thread guaranteed non-null here maybe sharing thread field between 2 threads? example, maybe main thread starts background thread , ui thread trying read it? in case should make thread volatile shared between threads. volatile thread thread = null; if volatile you dealing different instance of thread field. maybe thread field should marked static ?

python - Django Middleware context handling issue related to variable domain -

i face weird variable domain issue when trying define middleware django keep request in thread context. first code section create error when try access method "get" api in views file. second code example works great. why??? example 1 (does not work): class contexthandler(object): #_locals = threading.local() def process_request(self, request): self._locals = threading.local() self._locals.x = "alon" return none example 2 (works): class contexthandler(object): _locals = threading.local() def process_request(self, request): self._locals.x = "alon" return none common method: @classmethod def get(cls): return getattr(cls._locals, 'x', none) thanks! in first example have no class property _locals , instance property. in first case contexthandler._locals none , cls in get() contexthandler . if want thread safe code don't stick @classmethod and cl...

android - Orders of objects in LinearLayout -

i have linearlayout works fine shown code below, change order of linear layouts. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:weightsum="100" tools:context=".quicknotefragment" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:paddingbottom="5dp" > <com....

Visual Studio Command Window Change Directory not working -

so, trying use command window in visual studio 2010 on windows 7 64bit machine, need run through possible additional steps enable re-targeting of test projects .net framework 3.5 . problem command window not seem responding simple commands cd. need working correctly please?

ios - I need to get the referencing outlet, or some other identifier from the sender (UITextView) -

warning: new ios development not coding in general. i trying validation on uitextview, several actually. have different requirements length. have created custom delegate handle running issue figuring out how make unique textview sending it. i have several fields in several different nibs make use of delegate. of nibs have 3 textviews labeled like: summary, detail , special instructions. each of these has different max length 50, 100, 130 respectively. tl:dr; how can unique id each sender can switch on them? edit: update label, hidden until needed, count down available chars left. how make sure accessing correct controller , label? in delegate protocol, define way send uitextview instance along else, like: @protocol uitextfieldvalidationdelegate - (bool) textfield:(uitextfield)tf textforvalidation:(nsstring *)newtext; @end so when uitextfields call this, pass in inspection delegate: bool valid = [self.delegate textfield:self textchanged:newtext]; in delega...

c# - Retrieve value from dynamic TextBox -

i have button creates list of textboxes dynamically , have button submits information. don't know how access values of textboxes . below code: if (ispostback) { viewstate["count"] = convert.toint32(viewstate["count"]) + 1; int count = int.parse(string.format("{0}", viewstate["count"])); var lsttextbox = new list<textbox>(); (int = 0; < counter; i++) { textbox txtbx = new textbox(); txtbx.id = string.format("txtbx{0}", i); // txtbx.autopostback = true; lsttextbox.add(txtbx); //txtbx.text = "initial value"; } session["lsttextbox"] = lsttextbox; } protected void button1_click(object sender, eventargs e) { int total = counter; (int = 0; < total; i++)//calls createbox createtextb...

responsive design - max-width doesn't work with float -

i'm trying design responsive page. have 2 divs same height. both have max-width property , max-width working. once add float:left property max-width doesn't affect them. here's example: jsfiddle <div class="color1"> text </div> <div class="color2"> bla </div> <div style="clear: both;"> and css: div{ height: 100px; float: left; } .color1{ background-color: #6ac1ff; max-width: 400px; } .color2{ background-color: #bdbcf4; max-width: 100px; } i want them align vertically. there way make other float , keep max-width? use defined width percentages , float: http://jsfiddle.net/deew5/3/ div{ height: 100px; display:block; float:left; } .color1{ background-color: #6ac1ff; width: 80%; max-width:400px; } .color2{ background-color: #bdbcf4; width: 20%; max-width:100px; } use defined width percentages inline-block: http://jsfiddle.net/d...

c# - how to create a custom cast explicit in c #? -

have code: string abc = "123456"; to convert int should use convert: int abcint = convert.toint32(abc); the problem if not number have exception see returning 0 final code like: try{ int abcint = convert.toint32(abc); }catch(exception e){ int abcint = 0; } so see decided create book made ​​me object returning 0 numeric without exception if failed, keep flexible programming without junk code: int abcint = libs.str.safeint(abc); the code is: public int safeint(object ob) { if ((ob == null) || (string.isnullorempty(ob.tostring()))) return 0; try { return convert.toint32( system.text.regularexpressions.regex.replace(ob.tostring(), @"@[^ee0-9\.\,]+@i", ""). tostring(cultureinfo.invariantculture.numberformat) ); } catch (formatexception e) { return 0; } } but want go 1 step further , this: int abcint = (safeint)abc; how do? can not convert type ...

visual studio - ASP.NET Session-State InProc -

why creating asp.net 4.5 web forms project in visual studio 2012 have following in web.config default: ... <connectionstrings> <add name="defaultconnection" providername="system.data.sqlclient" connectionstring="data source=(localdb)\v11.0;initial catalog=aspnet-project.web-20130625130806;integrated security=sspi;attachdbfilename=|datadirectory|\aspnet-project.web-20130625130806.mdf" /> </connectionstrings> ... <sessionstate mode="inproc" customprovider="defaultsessionprovider"> <providers> <add name="defaultsessionprovider" type="system.web.providers.defaultsessionstateprovider, system.web.providers, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" connectionstringname="defaultconnection" /> </providers> </sessionstate> ... (my question not localdb or why there's sample connection string) it says here inproc means ...

c# - Stream dynamic zip files with resume support -

suppose, have list of mp3 files on server. , want user download multiple files (which wants through means). for, want create zip file dynamically , while saving output stream using dotnetzip or ioniczip libraries. well, that's not perfect solution if zip file got heavy in size. as, in scenario server doesn't support resumable downloads. so, overcome approach, need handle zip file structure internally , provide resume support. so, there library (open source) can use provide resumable dyanamic zip files stream directly output stream . or, if possible happy if let me know structure of zip file specially header content + data content . once download has started, should not alter zip file anymore. because resume result in broken zip file. make sure dynamically created zip file stays available! the issue of providing resume-functionality solved in article .net 1.1 , , still valid , functional.

ios - CollectionView [__NSCFConstantString _isResizable]: unrecognized selector sent to instance -

i find signal sigabrt thread when run app. here error message : [__nscfconstantstring _isresizable]: unrecognized selector sent instance 0x5c20 the problem coming [[self mycollectionview]setdatasource:self]; because disappear when comment it. on i've understand, type of mycollectionview datasource , self not same. why have error. thanks help pierre calviewcontroller.h #import <uikit/uikit.h> @interface calviewcontroller : uiviewcontroller <uicollectionviewdatasource, uicollectionviewdelegate> @property (weak, nonatomic) iboutlet uicollectionview *mycollectionview; @end calviewcontroller.m #import "calviewcontroller.h" #import "customcell.h" @interface calviewcontroller () { nsarray *arrayofimages; nsarray *arrayofdescriptions; } @end @implementation calviewcontroller - (void)viewdidload { [super viewdidload]; [[self mycollectionview]setdatasource:self]; [[self mycollectionview]setdelegate:self]; arrayof...

php - For loop decreasing order value -

problem have made loop decreasing value $k not coming in opposite manner. below code running working great. basically dealing iframe , want fetch parent url data, using $_server['http_referer'] . getting parent url when breaking string want in opposite manner. please @ actual , desired result below. url: http://www.example.net/home?game_id=myteam11game_type=activity&auth=success code $mainurl = array(); $mainurl = parse_url($_server['http_referer']); $mainurl = array_slice($mainurl, 3, true); $mainurl = $mainurl['query']; $mainurlarr = explode('&', $mainurl); for($k=count($mainurlarr)-1; $k>=0; $k--){ echo $mainurlarr[$k].' ,pos=> '.$k."<br />"; } actual output auth=success ,actual pos=> 2 game_type=activity ,actual pos=> 1 game_id=pranavs%20running12 ,actual pos=> 0 desired output auth=success ,actual pos=> 0 game_type=activity ,actual pos=> 1 game_id=pranavs%20running12 ,ac...

c# - How do I get this binding expression? -

the following xaml code: <listview itemssource="{binding path=viewmodel.rows}" x:name="lview" horizontalalignment="left" height="401" margin="10,52,0,0" verticalalignment="top" width="504"> <listview.view> <gridview> <gridviewcolumn x:name="expressions" width="250" header="expression" displaymemberbinding="{binding expression}"> </gridviewcolumn> <gridviewcolumn x:name="tele" width="50" header="in tele?"> <gridviewcolumn.celltemplate> <datatemplate> ...

iphone - How to hide or remove navigation Bar at the top? -

this code successful excuted "terms , condition page" open. 1 problem face 1 navigation bar show on top of page. how hide or remove navigation bar @ top of page ? clsmainpageappdelegate.m #import "clsmainpageappdelegate.h" #import "clstermsandconditionviewcontroller.h" - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil]; clstermsandconditionviewcontroller *ivc = [storyboard instantiateviewcontrollerwithidentifier:@"termsandconditioncontrol"]; uinavigationcontroller *navigationcontroller=[[uinavigationcontroller alloc] initwithrootviewcontroller:ivc]; self.window.rootviewcontroller=nil; self.window.rootviewcontroller = navigationcontroller; [self.window makekeyandvisible]; } have read documentation? uinavigationcontroller class reference [navigat...

sql - MSSQL find most recent measurement of most recent visit where person seen within the last year -

the generic example can think of people seeing doctor keeps trying lower patient's temperature i'd want see lowest reading. patients.patient_id, patients.doc_id visits.visit_id, visits.patient_id, visits.doc_id, visits.datetime vitals.vitals_id, vitals.visit_id, vitals.patient_id, vitals.temp, vitals.datetime doctor.doc_id, doctor.name select patients.patient_id, last_visit.temp, last_visit.maxdate patients inner join doctor on patients.doc_id = doctor.doc_id inner join ( select visits.patient_id, last_vitals.temp, max(visits.datetime) maxdate visits inner join ( select vitals.visit_id, vitals.temp, max(vitals.datetime) maxvitals vitals group vitals.visit_id, vitals.temp ) last_vitals on visits.visit_id = last_vitals.visit_id group visits.patient_id, visits.datetime having visits.datetime >= dateadd(mm, -12, getdate()) ) last_visit on patient.patient_id = last_visit.patient_id do...

javascript - Using server-side includes, what are options for selecting a current nav element? -

i'm using 10-item unordered list navigation bar. using ssi, put header , navigation bar every file. i'd way add class="active" ruleset of active page (the current page's corresponding <li> have different style). including file in every page means that, in included file, none of items can have active class. is there way in few lines of code? (using jquery/js) my other option match last part of url part of href of anchor within each list item. solution: (courtesy of romangorbatko) var tab = window.location.pathname.split("/"); tab = tab[tab.length - 1]; // not efficient - suggestions? if (tab != "") $("#nav a#" + tab).addclass("active"); for example. hame pages: http://site.com/index/ http://site.com/faq/ http://site.com/forum/ and menu has next form: <ul> <li class="index">index</li> <li class="faq">faq</li> <li class=...

Setting Navigation Icon on Android ActionBar -

Image
so i'm working on adding actionbarsherlock , navigation drawer project implemented custom (very poorly written) "action bar". instead of using fragments , backstack of activities navigation, activities show , hide different layouts. (that is, suppose in list mode , select button go edit screen. app hides list layout , shows layout.). so i've added actionbar sherlock , navigation drawer activities. want able programmatically switch navigation icon 3 lines arrow when buttons pressed. i can't figure out how though. ideas? thanks! the solution problem use method: setdrawerindicatorenabled(boolean enable) inside actionbardrawertoggle class.

python - How to output a Numpy array to a file object for Picloud -

i have matrix-factorization process i'm running on picloud. output set of numpy arrays (ndarray). now, want save bucket, i'm not able 0 in on right way it. let's assume array saved p. i tried: cloud.bucket.putf(p,'p.csv') but returned error: "ioerror: file object not seekable. cannot transmit". i tried numpy.ndarray.tofile(p,f, sep=",", format="%s") #outputing array file object f cloud.bucket.putf(f,'p.csv') #saving file object f in bucket. i tried couple of other things, including using using numpy.savetext (as if ran locally) i'm not able solve between picloud documentation , stackexchange questions. haven't tried pickle yet, though. felt straightforward, i'm feeling quite silly after spending few hours on this. as guessed, want pickle array follows: import cloud import cpickle pickle # write cloud.bucket.putf(pickle.dumps(p), 'p.csv') # read obj = pickle.loads(cloud.bucket.ge...

python - need to iterate through dictionary to find slice of string -

i have function accepts dictionary parameter(which returned function works). function supposed ask string input , through each element in dictionary , see if in there. dictionary 3 letter acronym: country i.e:afg:afghanistan , on , forth. if put in 'sta' string, should append country has slice united states, afghanistan, costa rica, etc initialized empty list , return said list. otherwise, returns [not found]. returned list should this:[ [‘code’,’country’], [‘usa’,‘united states’],[‘cri’,’costa rica’],[‘afg’,’afganistan’]] etc. here's code looks far: def findcode(countries): some_strng = input("give me country search using 3 letter acronym: ") reference =['code','country'] code_country= [reference] key in countries: if some_strng in countries: code_country.append([key,countries[key]]) if not(some_strng in countries): code_country.append( ['not found']) print (code_country) retur...

c++ - SWIG issue with pointers -

i have problem wrapping member of c++ class swig. i have class has method returns map<int, postlib::nastran::element> . the class postlib::nastran::element in interface file is: class element { public: element(void) ; element( const element &in) ; ~element(void) ; // data manipulation %feature("docstring", "gettype()->int\n\treturns id corresponding type of fe element") gettype; int gettype(void) const ; std::string gettypename(void) const ; int getnbrnodes(void) const ; int getnode(int index) const ; /* %extend { std::set<int> getnodes(void) { const std::set<int> *silist; silist = &$self->getnodes(); return *silist; } }*/ } ; //class element my method looks this: pyobject * getels(void) { std::map<int, postlib::nastran::element> els = $self->getelements(); std::map<int, postlib::nastran::...

java - Android HttpURLConnection FATAL Error -

i coding download manager android , when try open httpurlconnection gives error 07-17 20:30:13.928: e/androidruntime(25485): fatal exception: main 07-17 20:30:13.928: e/androidruntime(25485): java.lang.illegalstateexception: not execute method of activity 07-17 20:30:13.928: e/androidruntime(25485): @ android.view.view$1.onclick(view.java:3699) 07-17 20:30:13.928: e/androidruntime(25485): @ android.view.view.performclick(view.java:4223) 07-17 20:30:13.928: e/androidruntime(25485): @ android.view.view$performclick.run(view.java:17275) 07-17 20:30:13.928: e/androidruntime(25485): @ android.os.handler.handlecallback(handler.java:615) 07-17 20:30:13.928: e/androidruntime(25485): @ android.os.handler.dispatchmessage(handler.java:92) 07-17 20:30:13.928: e/androidruntime(25485): @ android.os.looper.loop(looper.java:137) 07-17 20:30:13.928: e/androidruntime(25485): @ android.app.activitythread.main(activitythread.java:4921) 07-17 20:30:13.928: e/androidruntime(25485)...

linux - How do 2 or more fork system calls work? -

here's code use 2 fork() system calls 1 after - how work? #include <unistd.h> #include <iostream.h> using namespace std; int main() { cout << "0. process " << getpid() << endl; (void) fork(); cout << "1. process " << getpid() << endl; (void) fork(); cout << "2. process " << getpid() << endl; } i output : 0. process 27701 1. process 25915 1. process 27701 2. process 27781 2. process 26170 2. process 27701 this next program i've used 3 fork system calls, how such output? if solve code manually, logic? #include <unistd.h> #include <iostream> using namespace std; int main() { cout << "0. process " << getpid() << endl; (void) fork(); cout << "1. process " << getpid() << endl; (void) fork(); cout << "2. process " << getpid() << e...

.net - Data Table not Allowed to resize column -

Image
i have datagridview in vb app. cannot resize columns. populate datagridview datatable. property of datagridview (allowusertorezisecolumn) set true. i can resize in red circle green check beside it. seems rest of data table. insight? populate datagrid code using conn sqlconnection = new sqlconnection(connectionstring) conn.open() using comm sqlcommand = new sqlcommand(sqlquery, conn) dim rs sqldatareader = comm.executereader dim dt datatable = new datatable dt.load(rs) datgdxlog.datasource = dt end using 'comm conn.close() end using 'conn i reiterate allowusertoresizerows in prepaint datgdxlog.allowusertoresizecolumns = true if datgdxlog.rows.count >= 3 if datgdxlog.rows(e.rowindex).cells(3).value >= 3 datgdxlog.rows(e.rowindex).defaultcellstyle.forecolor = color.red end if end if i believe problem fact data table. makes me think datagridview propertie...

Google Maps Multiple markers with the exact same location Not working -

i want check see if of existing markers match latlng of new marker , if merge info window/tooltip text. this tried do: <!doctype html> <html> <head> <meta charset="utf-8"/> <title></title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/src/markerclusterer.js"></script> <script type="text/javascript"> var map; var mc;//marker clusterer var mcoptions = {gridsize: 10, maxzoom: 8}; var infowindow = new google.maps.infowindow();//global infowindow var geocoder = new google.maps.geocoder(); //geocoder var address = new array("42.3334,-89.1572", "39.2058,-76.7531", "39.7751,-86.1322", "40.4894,-78.3499", "42.0203,-87.9059", "36.2673,-86.29...

android - jQuery UI Map Current Position Marker with Accuracy -

is possible in phonegap application using jquery ui map, set current position blue dot blue radius around accuracy happens native google maps application in android ? if so, how can achieve that found work around create circle overlay accuracy value found inside position object here full code (don't forget add reference file jquery.ui.map.overlays.js) function locsuccess(position) { //set current position google maps object var newpoint = new google.maps.latlng(position.coords.latitude, position.coords.longitude); //get marker current position var mypos = $('#map_canvas').gmap('get', 'markers')['mypos']; //if there no marker (first time position) if(!mypos) { //create new marker $('#map_canvas').gmap('addmarker', { 'id':'mypos', 'position':newpoint, 'icon' : 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png' }); //create accuracy...

java - Working with computing changes with Arrays -

i trying compute changes via java programming --> parallel arrays. reason keep getting "0s" output. rest of program runs fine. here part of program "computing" occurs. public int computepopulationchange(int population2010[], int population2000[]) { populationchange[count] = population2000[count] - population2010[count]; return populationchange[count]; }//end computepopulationchange public double computepercentchange(int population2010[], int population2000[]) { percentchange[count] = ((population2000[count] - population2010[count])/population2000[count]) * 100; return percentchange[count]; }//end computepercentchange are there specific steps take when trying compute numbers data file? not sure missing in whole program. you're not iterating on arrays. consequently, you're not filling result array. if result should parallel array, consider this: public int[] computepopulationchange(int populat...

jquery - Redactor image resize adding inline style attributes, how to force redactor to use "width" and "height" attributes -

redactor adding style attribute img tag while resizing <img src="image_url" style="width: 189.00884955752213px; height: 118px;" > this inline css not affecting image size when viewing in outlook desktop app. after doing research found outlook show image in required size if size specified in image tag width & height attributes. and width value in style attribute generated redactor not integer 189.00884955752213px. how fix these 2 issues i resolved issue using syncbeforecallback method make sure image had width attribute outlook syncbeforecallback: function (html) { // set image width attribute (for outlook) var $html = $('<div/>').html(html); $html.find('img').each(function copyimagecsswidthtoattribute() { var width = parseint($(this).css('width')); if (width > 0) { $(this).attr('width'...

string - BaseAdapter class wont setAdapter inside Asynctask - Android -

i have asynctask gathers usernames, comments, , numbers. places them strings , suppose call baseadapter class, create adapter, , set adapter class. code doesn't work, crashes app, here code public class dashboardactivity extends listactivity { string comments[]; string usernames[]; string numbers[]; listview lstcomments; class createcommentlists extends baseadapter{ context ctx_invitation; string[] listcomments; string[] listnumbers; string[] listusernames; public createcommentlists(string[] comments, string[] usernames, string[] numbers) { super(); listcomments = comments; listnumbers = usernames; listusernames = numbers; } @override public int getcount() { if(null == listcomments) { return 0; } ...