Posts

Showing posts from 2010

sql server - ssrs reports line chart how to add category group based on the column data -

i developing sql server report conversion of excel report. without modifying sp, create sql server line chart report. i have rows returned this: date technicianname techniciantype issuesfixed 2011-03-04 xxxxx engineer 20 2011-03-04 yyyyy sr.engineer 35 2011-03-05 zzzzz engineer 22 2011-03-05 wwwww sr.engineer 40 my line graph should 1 line progress shows engineer , other line shows progress sr.engineer. while add category groups, can use aggregate functions not filters.. techniciantype=engineer, techniciantype=sr.engineer. could please guide me how can proceed it..? thanks in advance. try putting date category field, issuesfixed data field, , techniciantype series field. have 2 progress lines, 1 engineer , sr. engineer, date on horizontal axis, issuesfixed on vertical axis. if want filter individual names, or other variable, right-click on 'variable/b...

ruby - Error when loading YAML config files in Rails -

i configuring rails mongodb, , find strange problem when paring config/mongo.yml file. config/mongo.yml generated executing script/rails generate mongo_mapper:config , , looks following: defaults: &defaults host: 127.0.0.1 port: 27017 development: <<: *defaults database: tc_web_development test: <<: *defaults database: tc_web_test from config file can see objects development , test should both have database field. when parsed , loaded in config/initializers/mongo.db , config = yaml::load(file.read(rails.root.join('config/mongo.yml'))) puts config.inspect mongomapper.setup(config, rails.env) the strange thing comes: output of puts config.inspect {"defaults"=>{"host"=>"127.0.0.1", "port"=>27017}, "development"=>{"host"=>"127.0.0.1", "port"=>27017}, "test"=>{"host"=>"127.0.0.1", "port"=...

Naming a file by a url -

i generating images of webpages urls , writing them local filesystem, , want name image url. however, if this, since there / 's in url, create new directories instead of calling image entire url. there way avoid this? i don't believe it's possible place / or \ in file name. best thing can think recommend replacing / or \ alternate characters not found in urls, such $ ^ , !. if can't find single character replace slash, can use short string that's unlikely in url, such [slash] or combination of symbols. the problem watch out when using short string length of file names. although oses won't have problem, may not able zip them full name.

windows - How do I create SAS fixed-format output containing end-of-line control characters? -

i using sas's file statement output text file having fixed format (recfm=f). each row end in end-of-line control character(s) such linefeed/carriage return. tried file statement's option termstr=crlf still see no end-of-line control characters in output file. think use put statement insert desired linefeed , carriage return control characters, prefer cleaner method. reasonable thing expect of file statement? (is reasonable expectation outputting fixed format data?) (platform: windows v6.1.7600, sas windows v9.2 ts level 2m3 w32_vspro platform) do need use recfm=f ? can still fixed length output v : data _null_; file 'c:\temp\test.txt' lrecl=12 recfm=v; i=1 5; x=rannor(123); put @1 @4 x 6.4; end; run; by specifying want data go ( @1 , @3 ) , format ( 6.4 ) along lrecl fixed length output. there may work-around, believe sas won't output line-ending fixed format.

nswindow - cocoa release nswindowcontroller -

i loading window it's controller window nib file. window has "release when closed" option enabled. how release controller window closes? thank you in window controller subscribe window close notification. [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(windowwillclose:) name:nswindowwillclosenotification object:window]; and in windowwillclose: method write code release window controller.

jquery - Scroll to top after slideDown -

i have made small jquery collapse/expand script http://jsfiddle.net/goldie/qfl49/ (please don't pay attenton html/css code because did'n made it) how can make expanded div scroll top of page? thank help. i have found it .slidedown(200, function() { $('html, body').delay('200').animate({ scrolltop: $(this).offset().top - 111 }, 200); });

xml serialization - Serialize Eclipse Graphical Models (e.g. BPMN Diagram) to XML -

i'm working on project have build graphical process modeler proprietary bpm (business process management) system made in java. i'm mentioning software proprietary because not follow international standards bpel, bpmn, xpdl, , vital information answers may get. my intended approach use eclipse gmf create standalone rcp application, similar bonita studio, business analysts graphically model business processes , deploy process model web application. this application has internal wizard-like process modeler, rudimentary. modeler has functionality import , export models in custom, defined xml format, proprietary , has no international standards. what need persist graphical model created eclipse gmf rcp application i'm developing custom xml format. way can invoque import function in web application , process deployed. need able reverse: open custom process in xml format eclipse rcp , show in graphical manner. so, need is: i need save graphical diagram in custom xml ...

Python rpg adivce? -

i started coding rpg engine in python , want scripted(buffs, events). experimenting events , hooking. appreciate if tell me matured opensource projects(so can inspect code) learn from. not python, ideal. thanks in advance. as daenyth suggested, pygame great place start. there plenty of projects linked on page. the other library quite lovely type of thing panda3d. though haven't yet used it, library comes samples, , looks there list of projects using somewhere. have fun.

linux - OpenOffice Calc time conversion -

Image
i profiling programs using "time" command on linux. outputted results in format this: 1m48.952s now tabulate , graph collected data it's not easy when it's in format. i have 2 questions: 1. there way convert format solely pure seconds. perhaps openoffice calc function? 2. there way call "time" command output in seconds , not minutes-seconds. thank much well tagged excel, here's excel solution: =if(iserror(find("m",a1)),value(left(a1,find("s",a1)-1)), left(a1,find("m",a1)-1)*60+mid(a1,find("m",a1)+1,find("s",a1)-find("m",a1)-1)) it's simple formula translate directly open office. here's sample results: as second question, man time explains can -f format output. description of how set format string in link. believe want -f %e elapsed real time (in seconds). default appears %e elapsed real time (in [hours:]minutes:seconds).

tfs2010 - TFS 2010: How to handle external "branched-in" dependencies on working branches -

is there established "best practice" handling external dependencies in tfs working branches? mean is, have project in tfs contains common third-party libraries (in case i'm dealing log4net), branch our other projects needed. we're making significant change i'm doing on separate working branch, requires newer version of component. looks this: $/thirdparty /bin /log4net $/product /main /thirdparty /lognet <-- $/thirdparty/bin/log4net /working1 <-- $/product/main /thirdparty /log4net <-- $/product/main/lognet <-- $/thirdparty/bin/log4net part of work requires rebuilding log4net against .net 4 client profile , bringing in new version. normally, when upgrade third party component, it's checked $/thirdparty in appropriate folder, individual projects free merge latest binary, or not, see fit. as far have can determine, in order latest changeset $/thirdparty/bin/log4net need merge $/product/main , ...

html - A few extra pixels of height - where could they be coming from? -

on, e.g., link: http://4ad.com/releases/20949 , if @ album cover image in top right part of page, black border not quite square: there few pixels of height @ bottom. as far can tell image 300x300 pixels in size. there no obvious (to us!) sources of 4.5 pixels of height. know creating such discrepancy? since image inline , it's treated text, means few pixels added bottom leading. displaying image block (i.e. adding display: block; ) solves problem nicely.

SQL search through ALL fields -

i've got database i'm searching through, , want able return rows have @ least 1 field in them matches search criteria. there easier way looping through columns? like: select * table [insert simple code here] fieldstring if not can loop, wondering if there simple solution missing. use ors in clause: where col1 .... or col2 .... or col3 ...

code analysis - Simple dynamic call graphs in Java -

i looking simple dynamic call graph logger java can add in few lines of code. know there aspect j solution . also, helped zola develop glow c/c++ rewrite similar tool don't want dig jvm internals. any open source solution out there right stable , better aspectj solution? the purpose use companion unit testing portions of code want more information behavior. i think want collect call graph (as opposed set of calls) means possible. one can with static analyzer (if can strong enough one), collect potential call graph. dynamic method collects 1 @ runtime instrumenting code. folks may want dynamic one, because want see actual call graph specific set of input data. there several java profilers collect information dynamically, including ours . none of ones open source, know of, wrong. such profilers work instrumenting code (either source or vm code if language [e.g., java,c#] has such). how depends on supplier. in our case, use our program transformation ...

resources - Oracle 10g Table size after deletion of multiple rows -

as part of maintenance, remove considerable amount of records 1 table , wish dispose of space other table. thing i'm checking size of table , shows same original size before delete. missing here? to check size, i'm looking @ dba_segments . there concepts need know tables before can understand space usage. try , give 5 second tour ... a table made of extents, these can vary in size, lets assume 1mb chunks here. when create table, 1 extent added it, though table has no rows, occupy 1mb. when insert rows, oracle has internal pointer table known high water mark (hwm). below hwm, there formatted data block, , above there unformated blocks. starts @ zero. if take new table example, , start inserting rows, hwm move up, giving more , more of first extent used table. when extent used up, 1 allocated , process repeats. lets says fill 3 1mb extents , delete rows - table empty, oracle not move hwm down, or free used extents. table take 3mb on disk though empty, th...

Optimize jQuery code -

what better state following: var active = '-active'; if ($j('body').hasclass('faqs')) { $j('.faqs-support').toggleclass('faqs-support' + active); } if ($j('body').hasclass('cameras')) { $j('.camera-support').toggleclass('camera-support' + active); } if ($j('body').hasclass('manuals')) { $j('.manuals-support').toggleclass('manuals-support' + active); } if ($j('body').hasclass('downloads')) { $j('.downloads-support').toggleclass('downloads-support' + active); } how about: $j.each(['faqs', 'cameras', 'manuals', 'downloads'], function(i, e){ if ($j('body').hasclass(e)) { $j('.'+e+'-support').toggleclass(e+'-support-active'); } });

c# - BCrypt generating different hashes given the same salt, string, and factor -

using 1 of c# implementations of bcrypt hash passwords , store them sql database. when return validate against hash string bcrypt generates different hash 1 in database compare to. salts visibly same factors. here know $2a$12$vf/1s3mqizhwndshyzh/royuelofrj4uwv./vzwqk4o2k0uwhix7w "qwerty123" , stored in column initialized [nvarchar] (200). when use bcrypt.verify() or bcrypt.checkpassword() depending on implementation, trace until before makes comparison , hash compare before mentioned 1 $2a$12$vf/1s3mqizhwndshyzh/rokvrepzsxfxaipdv6.ipkbpeooxzgsee if close can see salts , factor parts same. idea causing this? the explicit implementation working can found here http://bcrypt.codeplex.com/ my question related asp.net mvc 3 app, bcrypt.checkpassword failing suggestion testing private void findwhatsfailing(string password) //password = whatever you're passing in verify bcrypt working { const string expectedpassword = "qwerty123"; if(expec...

asp.net - Facebook C# SDK - Mobile Web Page : Facebook Wall Post URL Redirect -

i working on mobile web page in asp.net mvc2 allows users post walls. have following code posts user's wall, instead have redirect facebook's mobile "post wall" view allow user add posted message , submit "post" button or "cancel". have recreate view myself? seems lot of sites use. public string posttowall(string code) { string authtoken = string.empty; try { authtoken = getauthtoken(code); facebookclient app = new facebookclient(authtoken); dynamic user = app.get("me"); var id = user.id; var args = new dictionary<string, object>(); args["message"] = "test wall post"; args["caption"] = "test caption"; args["description"] = "test description"; args["name"] = "test name...

ruby on rails - Railscast 198, but using formtastic -

how what's covered in ryanb's railscast on editing multiple records individually, using formtastic? formtastic doesn't use form_tag, ryanb's method relies on. the semantic_form_for wrapper around form_for can use same parameters. here formtastic version of ryan bates' screencast views/products/edit_individual.html.erb <% semantic_form_for :update_individual_products, :url => update_individual_products_path, :method => :put |f| %> <% product in @products %> <% f.fields_for "products[]", product |ff| %> <h2><%=h product.name %></h2> <%= render "fields", :f => ff %> <% end %> <% end %> <p><%= submit_tag "submit" %></p> <% end %> views/products/index.html.erb <% semantic_form_for :edit_individual_products, :url => edit_individual_products_path %> <table> <tr> <th><...

ios - XCode 4 - how to stop the download of documentation -

i accidentally started documentation download within xcode (not 1 wanted - of course). there way stopping huge download? in xcode preferences / downloads tab, can select whether automatically downloads components , documentation. can cancel library downloads in flight. [xcode 4.2]

java - Quantify a change of direction given an array of 3d points -

i working on piece of software written in java uses processing.core library classes , simpleopenni track user's hand xbox kinect. what trying figure out how determine when user's hand movement changes direction abruptly. what have @ disposal array of pvectors (essentially vector of x,y,and z coordinates: a point in 3d space ) record user's hand position past 30 frames or so. i imagine there must way obtain value represents amount of directional change in real-time given recent few points recorded. maybe fit curve , take derivatives? ideally solution should not computationally expensive, trying implement real-time worthy solution. any direction can offer appreciated! let position (that is, 0 frames ago) (x0, y0, z0) let position n frames ago (xn, yn, zn) . let position 2n frames ago (xm, ym, zm) . then change in position between frames 2n , n (xn-xm, yn-ym, zn-zm) . can think of average velocity during n frames. , change in position between...

How to format code in Xcode? -

this question has answer here: code formatting in xcode 9 answers i wonder how can format code align neatly? have feature similar eclipse's ctrl shift f ? the keyboard shortcut ctrl + i (that ^i more mac centric) it works on selected text. use cmd + a first if wish format text in selected file.

sharing information on windows phone 7 like android's ACTION_SEND -

i'm trying port android application windows. in android, there way start activity action_send flag i.e. intent intent = new intent(android.content.action_send); intent.settype("text/plain"); intent.putextra(android.content.intent.extra_text, "...."); startactivity(intent.createchooser(intent, "subject")) when this, list of applications (i.e. facebook, text messaging, twitter, evernote, etc...) can receive passed in information presented. user selects 1 , information can shared thus. is there analogous in windows phone 7? yes, windows phone 7 have similar. take @ launchers , choosers . with launchers, can launch application not information newly launched application after ends. similar startactivity in android. choosers, can receive information back, similar startactivityforresults. there bunch of launchers , choosers available.

php - Is there a Joomla plugin that will show/hide content after clicking? -

i want install plugin in joomla give me option show/hide functionality after click, maybe of websites have faqs (onclick of question answer shown). question 1 (click see answer) { blah blah blah question 1 } question 2 (click see answer) { blah blah blah question 2 } if don't mind using jquery, can try out method: http://docs.jquery.com/ui/accordion

Ruby on rails tasks automation in Windows 7 -

i'm looking tool or gem or allow me run ruby methods every time. i've tried many ways backgroundrb, whenever , starling , workling, main problem have automate tasks in windows 7, can't use cron. backgroundrb not being updated, can't install in ror 3.0.3 or 3.0.9 what need monit event, using rake outside takes long load , produce timeout in secondary system, need run methods 'inside' without loading environment every time. there many articles this, of them not updated, need current suggestion, in advance why not use built in windows task scheduler , batch or vbscripts? powershell work.

c - Explain the output of following? -

#include<stdio.h> void main() { char ch; if((ch=printf(1234)) printf("a"); else printf("b"); } answer b : don't know value assigned ch , happens printf(1234) from printf(3) man page: return value upon successful return, these functions return number of characters printed (not including trailing '\0' used end output strings).

ios - encoding:NSISOLatin1StringEncoding with .xml file -

why can't save str in .xml file? nsstring *strdata = @"issam bey"; nsmutabledata *objnsdata = [nsmutabledata datawithdata:[strdata datausingencoding:nsisolatin1stringencoding]]; objnsdata = [objnsdata encryptaes:@"12345678901234561234567890123456"]; nsstring *str=[[nsstring alloc] initwithdata: objnsdata encoding:nsisolatin1stringencoding];

JQuery - Custom slider - Restricting the slide when it reaches the end -

i've written custom slider using jquery show thumbnails of images. i've outer div inside slider moves. when slides come end don't want slide further (both left , right). how can that? here code - can save html , run - <html> <head> <title>content slider</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function () { }); function left() { $('#inner').animate({ 'marginleft': "-=200px" }, 1000, function () { }); } function right() { if ($('#inner').css('marginleft') != "0px" && $('#inner').css('marginleft') != "auto") { $('#inner').animate({ ...

C#/Oracle: Connect -

i've been trying find out how connect c# program oracle 10g db. code examples found used either ado.net oracleclient of .net-framework (which deprecated -> not good), or system.data.ado, apparently uses data source (odbc) -> not allowed use, or oracle developer tools odt (like odbc?), support olny visual studio 2005 10g , 11g vs 2010... there way connect, possible delphi (devart, odac), ive used before told possibilities of connecting c# , oracle? i think best way use odp.net perform actions on oracle database. this interesting read you

ruby on rails - Accessing class method from an instance method -

say have following code class monster def self.yell 'i yelling!' end def shout_something monster.yell end end my yell method class method while shout_something instance method calls yell . is there inherently wrong doing this? example, bad call class method instance method? ask because feels wrong maybe it's because i'm newbie ruby. on side note, thought doing self.yell instead of monster.yell make more sense doesn't work. there's nothing particularly wrong calling class method instance method. depending on intent , how want people subclass monster, might want use this: def shout_something self.class.yell end so subclasses can provide yell class method.

c# 2.0 - Integrating Visual C++ on .NET Framework 2.0 with C# Library -

i familiar c# programming. today need integrate 1 visual c++ program on .net framework 2.0 c# library. after referencing c# library, new c++ class created. following line cannot compiled in new class. using namespace mycsharplibspace; the error "the namespace not exist". why? think can use namespace after referencing it, right? i did trial on .net framework 3.5. created simple helloworld visual c++ project. works fine. did same above. seems different integrate visual c++ program c# library on 3.5 , 2.0? how on 2.0? i appreciate help! bing

Application bar in windows phone 7 -

i trying create application bar in windows phone 7 application. think there problem click event because works , not work. below code in xaml , .cs . xaml <shell:applicationbar isvisible="true" ismenuenabled="false"> <shell:applicationbariconbutton iconuri="/icons/appbar.edit.rest.png" text="edit" click="btnedit_click" isenabled="true"/> <shell:applicationbariconbutton iconuri="/icons/appbar.delete.rest.png" text="delete" click="btndelete_click" isenabled="true"/> <shell:applicationbariconbutton iconuri="/icons/appbar.feature.email.rest.png" text="email" click="btnemail_click" isenabled="true"/> <shell:applicationbariconbutton iconuri="/icons/appbar.back.rest.png" text="back" click="btnback_click" isenabled="true"/> </shel...

javascript - a problem occur when push a object into a array -

here's code var arr = [1,2,3]; var entry = {}; var test = []; for(var i=0;i<arr.length;i++){ entry.id = arr[i]; test.push(entry); } console.log(test); i wanna output array 3 different object. objects same, why? [object { id=3}, object { id=3}, object { id=3}] the problem you're reusing same object on of loop iterations. create new entry object within loop: var arr = [1,2,3]; var entry; // (modified, don't create here) var test = []; for(var i=0;i<arr.length;i++){ entry = {id: arr[i]}; // (modified, create new 1 here, `id` prop) test.push(entry); } console.log(test); otherwise, if assign entry.id on each loop, you're changing id property on same object. when push object reference onto array, you're pushing reference, not copying object. you can, of course, away entry variable entirely if like, may want keep clarity, etc. here's without: var arr = [1,2,3]; var test = []; for(var i=0;i...

java - spring junit testing -

i have maven spring project (latest version) , want write junit tests (latest version). the issue have spring beans autowired, , when call them junit test, null pointer exceptions, spring doesn't autowire them. how can load context things autowired? have studied testing chapter in spring reference documentation? here example should start with: @runwith(springjunit4classrunner.class) @contextconfiguration public class mytest { @resource private fooservice fooservice; // class body... } if in com.example.mytest in /src/test/java , need /src/test/resources/com/example/mytest-context.xml - exceptions show way.

php - Passing Array Using Html Form Hidden Element -

i trying post array in hidden field , want retrieve array after submitting form in php. $postvalue=array("a","b","c"); <input type="hidden" name="result" value="<?php echo $postvalue; ?>"> but getting array string after printting posted value. how can solve it? $postvalue=array("a","b","c"); foreach($postvalue $value) { echo '<input type="hidden" name="result[]" value="'. $value. '">'; } and got $_post['result'] array print_r($_post['result']);

media player - android ANR in MediaPlayer reset -

i've got simple activity plays video through videoview public class avideo extends activity { private videoview mvideoview; private mediacontroller mc; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.a_video); bundle extras = getintent().getextras(); uri path = uri.parse(extras.getstring("videouri")); mvideoview = (videoview) findviewbyid(r.id.video); mvideoview.setvideouri(path); mc = new mediacontroller(this); mvideoview.setmediacontroller(mc); } @override protected void onresume() { super.onresume(); mvideoview.start(); mc.show(); } } in cases when user pushes button, on activity, before video starts playing, he's got anr. here's traces: dalvik threads: "main" prio=5 tid=3 native | group="main" scount=1 dscount=0 s=n obj=0x4001b268 self=0xbd00 | systid=423 nice=0 sched=0/0 cgrp=default handle=-1344001384 @ android.m...

c# - WPF UserControl Binding Problem -

i create usercontrol own header property. public partial class someclass: usercontrol, inotifypropertychanged { public someclass() { initializecomponent(); } private string header; public string header { { return header; } set { header = value; onpropertychanged("header"); } } protected void onpropertychanged(string propertyname) { if (this.propertychanged != null) propertychanged(this, new propertychangedeventargs(propertyname)); } public event propertychangedeventhandler propertychanged; } in usercontol xaml: label name="lbheader" grid.column="0" content="{binding path=header}" if set value: aa2p.header = "someheeadertext"; label.caption not changed. how can solve ...

eclipse - How to show whitespace and tabs but NOT line-break characters? -

i'm trying switch komodo eclipse. i can't figure out how keep line-break characters being shown in eclipse - looks shown along tabs , other whitespace characters. is there way show tabs , other whitespace characters not line-break characters? if have eclipse 3.7 can disable them. preferences > general > editors > text editors -- 'show whitespace characters' , click on link 'whitespace characters'.

Merging two tiff image using c#.net -

in scenario have 2 tiff image in different location say c:/temp/img1.tiff , x:/temp/img2.tiff . i need merge these images single image programatically suggest ideas/codes. thanks, dev to using framework classes, this: load each of tiff images bitmap object, e.g. using image.fromfile . save first page encoder parameter encoder.saveflag = encodervalue.multiframe save each subsequent page same file encoder parameter of encoder.saveflag = encodervalue.framedimensionpage using bitmap.saveadd () it this: imagecodecinfo tiff = null; foreach ( imagecodecinfo codec in imagecodecinfo.getimageencoders() ) { if ( codec.mimetype == "image/tiff" ) { tiff = codec; break; } } encoder encoder = encoder.saveflag; encoderparameters parameters = new encoderparamters(1); parameters.param[0] = new encoderparameter(encoder, (long)encodervalue.multiframe); bitmap1.save(newfilename, tiff, parameters); parameters.param[0] = new encode...

objective c - Draw continuous CGPath with parts of different line width -

i need draw continuous path, e.g. 1 line of path needs thicker regular path width. there way accomplish default api or have calculate path joints myself? you have break path yourself. single path can drawn single graphics state.

iphone - Mach-O Linker (Id) Error -

Image
i have added google tools mac oauth classes project , following linker error any ideas need do? ipad app if makes difference. thanks :-) the error result of redefining symbol in rootviewcontroller. there few possible reasons this. in rootviewcontroller explicitly defined kgtmoauth2serviceprovidergoogle you used #include instead of #import you #import or #include implementation file (.m)

php - Working with Twitter OAuth... need some help -

i'm working through unofficial example of twitter's oauth pete warden, here . i need few things... i'm trying work through localhost can't callback url have set http://bit.ly/localhost/twitter/index.php/ when log in bring me original page index.php , located in localhost/twitter/index.php login link begin with. instead brings me base base of localhost. additionally, error notice: session had been started - ignoring session_start() in c:\wamp\www\twitter\index.php on line 295 i can't see how session has been started... literally place in of files in entire example session_start() called. let me know if can figure out why these things happening. you might have session.auto_start = 1 in php.ini. can check whether enabled calling phpinfo() .

data mining - Building an Intrusion Detection System using fuzzy logic -

i want develop intrusion detection system (ids) might used 1 of kdd datasets. in present case, dataset has 42 attributes , more 4,000,000 rows of data. i trying build ids using fuzzy association rules, hence question: considered best tool fuzzy logic in context? fuzzy association rule algorithms extensions of normal association rule algorithms apriori , fp-growth in order model uncertainty using probability ranges. assume data consists of quite uncertain measurements , therefore want group measurements in more general ranges e.g. 'low'/'medium'/'high'. there on can use normal association rule algorithm find rules ids (i'd suggest fp-growth has lower complexity apriori large data sets).

sql - Count records with a criteria like "within days" -

i have table below on sql. orderid account ordermethod orderdate dispatchdate dispatchmethod 2145 qaz 14 20/3/2011 23/3/2011 2 4156 aby 12 15/6/2011 25/6/2011 1 i want count records have reordered 'within 30 days' of dispatch date dispatch method '2' , ordermethod '12' , has come same account. i want ask if can achieved 1 query or need create different tables , in stages think wll have now? please can code/query? many t try following, replacing [tablename] name of table. select count(originalorders.orderid) [total_orders] [tablename] originalorders inner join [tablename] reorders on originalorders.account = reorders.account , originalorders.orderdate < reorders.orderdate , datediff(day, originalorders.dispatchdate, reorders.orderdate) <= 30 , reorders.dispatchmethod = '2' , reorders.ordermethod = '12'; by using inner join you'll sure grab or...

javascript - Creating an inline 'Jargon' helper in PHP -

idea: i have article formatted in html. contains whole lot of jargon words perhaps people wouldn't understand. i have glossary of terms (mysql table) definitions helpful there people. i want go through html of article , find instances of these glossary terms , replace them nice javascript show 'tooltip' definition term. i've done nearly, i'm still having problems: terms being found within words (ie: aps in perhaps) i have make sure doesn't alt, title, linked text, etc. text doesn't have formatting applied. needs work in tables , paragraphs. here code have: $query_glossary = "select word glossary_terms status = 1 order length(word) desc"; $result_glossary = mysql_query_run($query_glossary); //reset mysql via seek don't have query again mysql_data_seek($result_glossary,0); while($glossary = mysql_fetch_array($result_glossary)) { //once done can replace words nice tip $glossary_word = $glossary['word']; ...

Loading a file into MATLAB as it is? -

i'm working on telecommunications device simulator on matlab. i'm going encode digital data, modulate it, add noise , attempt demodulate it, see @ noise levels data cannot recovered anymore. my problem is, don't know how import crazy file workspace. it's not going txt or anything, file. how can make matlab read file in binary format or whatever called? try questions regarding work binary data in matlab working on binary data in matlab read , write from/to binary file in matlab

ios - Crash on master/detail app, when changing category, after releasing Var -

i'm struggling figure out why app crashing when release synthesized properties. app launches, , when tap on row, takes me detailviewcontroller, when go , tap row again app crashes exc_bad_access. detailviewcontroller.h: #import <uikit/uikit.h> @interface detailviewcontroller : uiviewcontroller { iboutlet uilabel *clipboardlabel; } @property (nonatomic, retain) iboutlet uilabel *clipboardlabel; @end detailviewcontroller.m #import "detailviewcontroller.h" @implementation detailviewcontroller @synthesize clipboardlabel; - (void)viewdidload { // additional setup after loading view nib. clipboardlabel.text = @"tap image copy"; [super viewdidload]; } - (void)dealloc { [clipboardlabel dealloc]; [super dealloc]; } @end call release instead of dealloc on clipboardlabel in dealloc method. that should : - (void)dealloc { [clipboardlabel release]; [super dealloc]; } a general rule : 1 ...

tfs - Ant task: "TfsVersion" -

is there possibility how use msbuild task:tfsversion in build script using ant. i need task changeset number tfs , set androidmanifest.xml file. but cant use task in ant build script because ant doesnt know task. this got ant when tried use tfsversion task: build.xml:84: problem: failed create task or type tfsversion cause: name undefined. action: check spelling. action: check custom tasks/types have been declared. action: check <presetdef>/<macrodef> declarations have taken place.

Global variable in Objective C IPhone -

i load few variables in appdelegate class. declared in .h file. i have global.h file declares same vars extern , such as: appdelegate.h nsstring *dbname; global.h extern nsstring *dbname; i haven't found pattern yet, of classes include global.h var nil. any idea doing wrong? edit: it looks vars like: int x; stick , available, vars pointers lost: nsstring *name; they loaded db in appdelegate. i tried declaring char name[30]; then assigning , good. now what? in .h: extern nsstring *global; in .m somewhere: nsstring *global = @"foobar"; if need set global @ runtime, you'll have in method somewhere; say, applicationdidfinishlaunching: . where assigning global in nsstring case? , when retaining value? mean "lost"? note variable must not declared in .h; extern goes in .h, nsstring *global; must in 1 , 1 .m file.

c# - How to add attributes to a base class's properties -

i have couple model classes so: public class mymodelbase { public string name { get; set; } } public class mymodel : mymodelbase { public string someotherproperty { get; set; } } how can mymodel add [required] attribute name property? try using metadata class. it's separate class referenced using attributes lets add data annotations model classes indirectly. e.g. [metadatatype(typeof(mymodelmetadata))] public class mymodel : mymodelbase { ... /* current model code */ } internal class mymodelmetadata { [required] public string name { get; set; } }

java - Cannot make a static reference to the non-static method sendEmptyMessage(int) from the type Handler -

i have error "cannot make static reference non-static method sendemptymessage(int) type handler" how fix it? think problem class not activity? new thread() { public void run() { try { list<sail> sails = searchsails(); selectsailintent.putparcelablearraylistextra( constant.sails, new arraylist<sail>(sails)); getcontext().startactivity(selectsailintent); handler.sendemptymessage(0); } catch (exception e) { alertdialog.setmessage(e.getmessage()); handler.sendemptymessage(1); } } }.start(); } }; "cannot make static reference non-static method sendemptymessage(int) type handler" this due fact handler refers class, sendemptymessage not static method (should called on object, , not on class). ...

oracle - Populate Java table with resultSet -

i'm building java application gets data oracle database , puts jtable . my problem not able populate table, don't understand how it. javadoc useless. i don't understand why table doesn't rows: if ((report.getmsg()=="selecteventoall") && (report.getesito()==1)) { defaulttablemodel dtm = new defaulttablemodel(); eventi_tb.setmodel(dtm); try { resultset res_eventi = report.getres(); = 0; object[][] datieventi = new object[report.getrowcount()][5]; while(res_eventi.next()) { j = 0; while (j < 5) { datieventi[i][j] = res_eventi.getobject(j+2); j++; } dtm.addrow(datieventi[i]); i++; } } you can using custom implementation of abstracttablemodel. after results back, put them in list , let backi...

iphone - Can't post to facebook wall with iOS SDK (authorization issue) -

first create facebook object appid: facebook = [[facebook alloc] initwithappid:kappid]; when call [_facebook authorize:_permissions delegate:self] my safari opens , after enter fb username , password, safari closes , returns app (like should). permissions are: _permissions = [[nsarray arraywithobjects:@"read_stream", @"publish_stream", @"offline_access",nil] retain]; the strange thing delegate method - (void)fbdidlogin or -(void)fbdidnotlogin:(bool)cancelled not called in fb sample app comes sdk. in .h file implement protocols "fbrequestdelegate, fbdialogdelegate, fbsessiondelegate" , in .m file have necessary methods. if try make post after with [_facebook requestwithgraphpath:@"me/feed" andparams:[nsmutabledictionary dictionarywithobject:@"test wall post" forkey:@"message"] andhttpmethod:@"post" anddelegate:self]; i error "req f...

.net - How Many Objects Inside of a Class is too Many? -

i'm new concepts of oo programming - programming in general still student. i'm working intern in department has me coding new structure base applications come. believe have idea behind oo down create "basic building blocks" , expand, expand , expand, until arrive @ complex object (for time being). i need put these "advanced" objects 1 how many many? can have 100 objects inside of bigger object if requires these "parts". i hope question makes sense everyone. i'm sure answer not going definite answer either need rule of thumb go by. i'd hate have 100 objects inside of 1 big 1 if there better design/programming technique. thank you. edit 1: thank responses i'm still little unclear. marked answer felt can continue have but... let me continue human example. human composed of many parts (or objects) , each part made of parts, way down single cell. human --> arm --> hand --> fingers --> thumb --> bones --> bo...

algorithm - Python: all possible words (permutations) of fixed length in mini-alphabet -

let's have string so: abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()-_+={}[]\:;"'?/>.<,`~|€ this basicly list of characters on keyboard. how possible combinations for, let's say, "word" made of 8 of these chars? know there going millions of possibilities. cheers! difference between permutations , combinations you either looking permutation or combination. 'abc' , 'bac' different permutations, same combination {a,b,c} . permutations of 'abc': '' , 'a' , 'b' , 'c' , 'ab' , 'ba' , 'ac' , 'ca' , 'bc' , 'cb' , 'abc' , 'acb' , 'bac' , 'bca' , 'cab' , 'cba' combinations of 'abc': {} , {'a'} , {'b'} , {'c'} , {'a','b'} , {'b','c'} , {'a','c'} , {'a','b','c'} in python use...

ruby on rails 3 - RefineryCMS consuming too many resources? -

i've developed refinerycms-based app, , i'm hosting @ site5, plan hostpro + turbo . a couple of weeks ago i've got folder disabled because support people told me consuming many computer resources. below told me: after recent problems server riverthames.accountservergroup.com found site causing problems due site's resource usage. site using many system resources (cpu , memory) shared hosting. shared hosting sharing hardware resources other people , unfortunately site using more it's fair share. unfortunately means site going need dedicated hardware resources. here summary of cpu , memory usage on account on past 24 hours: cpu: 11.17 % mem: 2.18 % we believe processes shown below responsible level of resource usage, please keep in mind if run dynamic site off wordpress or script might show index.php primary file runs entire site: --------------- top process %cpu 99.3 rack: /home/usr/app/curre...

java - DeploymentException & Class Not Found on WebLogic Admin Server 11g -

related: load external properties files ejb 3 app running on weblogic 11 using oracle enterprise pack eclipse, created enterprise project , named it: propertiesdemoear also created propertiesdemoearweb module in put code (inside propertiesdemoearweb / java resources / src / com.project.util): package com.project.util; public class propertiesfilehandler extends applicationlifecyclelistener { private static final string file = "c:/etc/error.properties"; public void prestart(applicationlifecycleevent evt) { system.out.println("\n\n\t\tinside prestart() method\n\n"); inputstream = evt.getapplicationcontext().getappclassloader().getresourceasstream(file); try { properties convertedprops = convertstreamtoproperties(is); string usermissingerror = convertedprops.getproperty("user_missing_error"); system.out.println("\...

Concurrent reading in oracle? -

say have customer table has record custid lastname 1 hamlin in 1 request customer last name hamlin custid=1. update last name kathy not commit it. another request comes try last name custid=1. kathy or hamlin. my understanding if both request different connection object(which should case) second request see hamlin. if same connection object , second request object see last name kathy. p lease let me know if above understanding correct? since you're in read-committed transaction isolation level (or higher, oracle supports no lower), not see changes made uncommitted other transactions, ever. beware in serializable mode, query may required wait other transaction commit or rollback, or alternatively transaction may rolled you. oracle supports read committed , serializable (you can pick, e.g., via set transaction isolation level ); other database systems additional support read-uncommitted, allow see updated not yet committed value.

activerecord - Enforcing a has_one association -

i using devise user model related legacy table , fine works perfectly. now want implement ability reset passwords, , enforces having new fields ( reset_password_token , reset_password_token_at ), cannot create on original table. i decided use old delegate has_one relationship. here's did: class user < legacydatabase set_table_name 't_clients' devise :database_authenticatable, :authentication_keys => [:email] devise :recoverable has_one :user_setting delegate :reset_password_token, :to => :user_setting delegate :reset_password_sent_at, :to => :user_setting # (...) end my problem need enforce users have usersetting created when need access new fields. if doing hand, usersetting.find_or_create_by_user_id(...), before going down path, i'd know if rails provides way accomplish without falling manual code. ok, how ugly approach (seems work): alias :old_user_setting :user_setting def user_setting old_user_setting |...

c++ - Creating a function that is a friend to multiple classes -

in code below, trying create function "patient_count" friend classes "horse" , "pig" , , "dog". can function friend 1 class not 3. can tell me mistake is? /*******************************************************\ * veternarian class problem - need class each * * of 3 animals. horse, pig , dogs * \*******************************************************/ #include <cstdlib> #include <iostream> #include <string> const int horse_kennel = 100; // number of horses can store const int pig_kennel = 100; // number of pigs can store const int dog_kennel = 100; // number of dogs can store /*******************************************************\ * class horse * * * * member functions * * horse_count -- keeps track of number of horses * * add_horse -- sends data object ...