Posts

Showing posts from April, 2013

ruby on rails - FactoryGirls randomly fails with 'Factory not registered', why? -

i've tests randomly fail, approx. 20% of times. means without changing code, each time run tests 1 time out of 5 fail "factory not registered" error. it's weird.. :( this consone output: failures: 1) unit#new_from_string returns factor metric conversions failure/error: factorygirl.create :taza argumenterror: factory not registered: taza # ./spec/models/unit_spec.rb:29:in `block (2 levels) in <top (required)>' finished in 0.29619 seconds 4 examples, 1 failure failed examples: rspec ./spec/models/unit_spec.rb:22 # unit#new_from_string returns factor metric conversions randomized seed 61727 and code: file: "unit_spec.rb" require 'spec_helper' describe unit, "#new_from_string" "parses string , returns unit object" [some tests...] factorygirl.find_definitions u = factorygirl.create :taza factorygirl.create :tbsp [tests...] end "returns factor metric...

html - TD taking up entire width of row -

i need set html table email in each column has set width. the left column image , right have text. have set td width td renders 600px wide no matter what. the email can viewed here here code <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="description" content="fitzgerald description"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title> fitzgerald email </title> </head> <body bgcolor="#ffffff" style="margin:0; padding:0; width:100% !important; background-color:#f8f6f2; font-family:calibri, 'helvetica neue', helvetical, arial, geneva, clean, sans-serif;"> <table bgcolor="#ffffff" align="center" border="0" cellpadding="0" cellspacing="0" style="width:600px; max-width:600px; margin:0 auto 0 auto;" width="60...

performance - Is Redis good choice for performing large scale of calculations? -

currently pulling large scale of data oracle database & performing calculation on web side generating html reports. using groovy & grails frame work report generation. now problem , having huge calculation & takes lots of time generate report on web side. i planning re-architecture reports , generate reports quickly. i don't have command on oracle database it's third-party production database. i don't want replication of database , because has millions of records , can't schedule & replication slow down production. i came caching architecture , perform calculation engine. anyone can me providing best solution ? thanks what structure of data? want query sql can you, or binary/document? do need persistence (durability) or not? redis fast. if have single threaded app using ms sql , bulk importer, it's incredibly fast too. redis key/value stores need perform single set every column within domain object, can slower othe...

regex - regular expression which should allow limited special characters -

can 1 tell me regular expression textfield should not allow following characters , can accept other special characters,alphabets,numbers , on : + - && || ! ( ) { } [ ] ^ " ~ * ? : \ @ & this not allow string contains of characters in part of string mentioned above. ^(?!.*[+\-&|!(){}[\]^"~*?:@&]+).*$ see here brief explanation assert position @ beginning of line (at beginning of string or after line break character) ^ assert impossible match regex below starting @ position ( negative lookahead ) (?!.*[+\-&|!(){}[\]^"~*?:@&]+) match single character not line break character .* between 0 , unlimited times, many times possible, giving needed (greedy) * match single character present in list below [+\-&|!(){}[\]^"~*?:@&]+ between 1 , unlimited times, many times possible, giving needed (greedy) + the character "+" + a "-" character \- one of characters &|!(){}[” «&|!(){}[...

javascript - Passing method through a directive to a parent directive -

edit: modified code per stevuu's suggestion added plunkr here i'm attempting have child directive call method(resolve) through directive way parent directive i'm having difficulties identifying problem approach. the problem right seems although resolve() called expected on click, selected remains undefined. the html: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>angular: directive using &amp; - jsfiddle demo</title> <script type='text/javascript' src='//code.jquery.com/jquery-1.9.1.js'></script> <link rel="stylesheet" type="text/css" href="/css/normalize.css"> <link rel="stylesheet" type="text/css" href="/css/result-light.css"> <script type='text/javascript' src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0....

sql - FOR INSERT trigger not firing -

i having problem insert trigger this trigger code : set ansi_nulls on go set quoted_identifier on go create trigger [dbo].[vtriggers] on [dbo].[stats] insert insert [newdb].dbo.newstat (statid) select id inserted the weird thing , build table exact table want make trigger in , trigger works new 1 , on old 1 not working. info : in old table have multiple inserts in same time. here schema both table : old stat ( trigger not working on it) set ansi_nulls on go set quoted_identifier on go create table [dbo].[stats]( [id] [int] identity(1,1) not null, [code] [nvarchar](100) null, constraint [pk_stat] primary key clustered ( [id] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on, fillfactor = 80) on [primary] ) on [primary] textimage_on [primary] and new test stat ( trigger works on it) : set ansi_nulls on go set quoted_identifier on go create table [dbo].[teststats]( ...

asp.net - how to delete image file after upload in C#? -

i have problem on deleting or moving files after upload in asp.net. i using radupload uploading files , want have remove button delete physical file. however, right after successful upload can't delete physical file , error raised "file in use". you should delete self writing code, , think should upload code too. anyway here sample code delete file. fileinfo info1 = new fileinfo(folderpath + filename); if (info1.exists) { info1.delete(); }

javascript - How to Postback with radconfirm window with RadContextMenu? -

i have code below , aspx--> <telerik:radcontextmenu id="radcontextmenu1" runat="server" onclientitemclicking="onclientcontextmenuitemclicking" onitemclick="radcontextmenu1_itemclick" oninit="radcontextmenu1_oninit"> <items> <telerik:radmenuitem value="addnick" text="" /> <telerik:radmenuitem value="edit" text="" /> <telerik:radmenuitem value="delete" text="" font-bold="true" /> </items> </telerik:radcontextmenu> javascript --> var allowposback = false; function confirmcallbackfn(arg, eventargs) { if (arg) { allowposback = true; } } function onclientcontextmenuitemclicking(sender, eventargs) { var item = eventargs.get_item(); item.get_menu().hi...

javascript - Typescript generating redundant variable -

consider following typescript code: module demoappmodule{ 'use strict'; export module nest{ export var hello = function () { alert('hello!'); }; } } demoappmodule.nest.hello(); after transpiling have following javascript code: var demoappmodule; (function (demoappmodule) { 'use strict'; (function (nest) { nest.hello = function () { alert('hello!'); }; })(demoappmodule.nest || (demoappmodule.nest = {})); var nest = demoappmodule.nest; })(demoappmodule || (demoappmodule = {})); demoappmodule.nest.hello(); why line generated? hurts eyes. var nest = demoappmodule.nest; short answer: needed access module variable locally. e.g. module demoappmodule{ 'use strict'; export module nest{ export var hello = function () { alert('hello!'); }; } // following not possible without line console...

class - Modules and classes in Ruby. Contradictions? -

according rubymonk section 8.1 modules hold behavior , not state , classes can hold behavior , state. yet modules super-class of classes in ruby. how can be? oh brother, , if forget module/class instance variables , module/class methods, can't classes hold state--because it's instances of classes hold state. classes hold list of instance methods. whole section on classes technically wrong too. the bottom line 99.99% of things in ruby objects, , object can hold state. class object(as producer of objects), module object(but not producer of objects), , instances of classes objects. i suggest not worry state. concentrate on fact modules can used 2 things: 1) namespace: module myfunctions def myfunctions.puts(str) #...or: def self.puts(str) kernel.puts "***" + str end end puts 'hello' myfunctions.puts 'hello' --output:-- hello ***hello 2) package of methods included, e.g. in class: module animaltricks def speak ...

jquery - Validate form before adding an extra text fields -

if check fiddle here , there form validated properly. can click on submit button check how works. and there button called add person,which creates group of text fields. my question is, add person button should create text fields when form filled. if form not filled , user clicks on add person button should show alert. here code $.validator.setdefaults({ submithandler: function() { alert("submitted!"); } }); $().ready(function() { // validate comment form when submitted $("#commentform").validate(); // validate signup form on keyup , submit $("#signupform").validate({ rules: { firstname: "required", lastname: "required", email: { required: true, email: true }, topic: { required: "#newsletter:checked", minlength: 2 }, agree: ...

rails 3.2 NoMethodError undefined method `slice' for nil:NilClass -

i getting error end have no clue how fix it. weird thing is, working before. think after run annotate, broken, not sure. error comes confs.controller index , own methods. rejects this: conf.machine_brand[0,1].upcase nomethoderror [ ] bla bla conf model: # == schema information # # table name: confs # # id :integer not null, primary key # machine_brand :string(255) # machine_model :string(255) # control_unit_brand :string(255) # control_unit_model :string(255) # tool_axis_x :decimal(, ) # tool_axis_y :decimal(, ) # tool_axis_z :decimal(, ) # rotary_axis_number :integer # linear_axis_number :integer # turning_mode :boolean # milling_mode :boolean # description :text # xml :text # user_id :integer # developer_id :integer # created_at :datetime not null # updated_at :datetime not null # class conf < activerecord::base att...

java - In a swing worker is it possible to kill the thread? -

i load data in background mode swing worker thread. simplified version of routine below. important part work2 holds object until thread done , work2 gets null value. what might expect garbage collection remove thread, see in debugger swingworker-pool-1-thread-1-running. point of view, have no more use thread, since loading done. it best off ignore fact thread still running, ask anyway. desirable explicitly kill thread? haven't yet looked explicit command because used setting object null , there no more references, java kills things me. so best advice? kill or ignore it? thanks, ilan protected void loaddata(petctframe par1, arraylist<imageplus> imglist, arraylist<integer>seriestype) { work2 = new bkgdloaddata(); work2.addpropertychangelistener(new propertychangelistener() { @override public void propertychange(propertychangeevent evt) { string propertyname = evt.getpropertyname(); if( propertyname.equals(...

c# - Changing bitmap image dynamically -

i'm having issues of having bitmap image change dynamically between usercontrol , page load. i'm using dispatcher timer keep image changed. not work. error stated urisource null. i'm using ms visual studio 2012, metro application c# code in usercontrol xaml: <image x:name="img"> <image.source> <bitmapimage urisource="{binding path=bitmapimage}" /> </image.source> </image> code in usercontrol: public bitmapimage bitmapimage { { return _bitmapimage; } set { if (_bitmapimage == value) return; _bitmapimage = value; raisepropertychanged("bitmapimage"); } } public event propertychangedeventhandler propertychanged; private void raisepropertychanged(string propertyname) { if (propertychanged != null) { propert...

Correctly pass view errors to template with Django -

how can pass errors display them in templates, using clean , common way ? i'd show errors through overlay box message. transmit error object each return ? push in session, , check in template ? check template using ajax method ? use common error template page ? (not user friendly..) i'm confused when using httpresponseredirect ; unless using session variables, it's not possible pass errors. the usual way use django's message framework , rohan said. anywhere in view, can use code pass errors templates : from django.contrib import messages def my_view(request): … messages.error(request, 'oops, bad happened') return redirect… you can add following code in base.html template display messages (here using bootstrap classes): {% if messages %} <div class="span12"> {% message in messages %} <div class="alert alert-{{ message.tags }}"> {{ message|safe }} </div> {% endfor ...

how to add thousands of image into a pdf with reportlab -

i have 1 thousand png images,and use reportlab add these images pdf, code is: def pic_exits(pic_path): if os.path.exists(pic_path): #print ('pic_exits') #print (pic_path) target = pil.image.open(pic_path) #fp = open(pic_path,'rb') #target = pil.image.open(fp) #fp.close() targetx,targety = target.size del target #print (targetx,targety) tx,ty = get_xy(targetx,targety) targetimg = image(pic_path, tx, ty) else: targetimg = paragraph('<para align = center>not exist</para>',bodystyle) return targetimg def draw_sourcepic(self_dir,pic_list): pic = [pic_list[i:i+3] in range(0,len(pic_list),3)] data = [] = 0 val in pic: eachline = [] pic_path in val: i+=1 pic_image = pic_exits(pic_path) eachline.append(pic_image) while len(eachline) < 3: eachline.append(none) data.append(eachline) pic_table = drawtable(data,(150,150...

apex code - row from datatable does not updated in salesforce -

i have 1 data table no. of records available. i using actionpollar , action updatelist latest list display on view on given time interval below code <apex:actionpoller action="{!updatelist}" rerender="thepageblock" interval="5"/> now, updating row using below code. <apex:commandbutton action="{!quicksave}" value="save" id="savebutton" rerender="thepageblock"/> but, not change. , not update record. if remove code of actionpollar , remove method updatelist controller ..it updates data..but, after putting it, not work. can tell how can ? thanks interesting, keeping same copy of dataset, been refreshed every 5 seconds , displayed, means viewstate been refreshed every 5 seconds, looks me might submitting same values last received not containing changes, i'll go 1 of 2 routes: stop poller when edit mode or making changes blocking record editing no 1 else overwrite changes. s...

c# - Binding in ControlsTemplate -

i have next control - calendar. got nuget wpcontrols. modified it, because needed button - today. here xaml code: <controltemplate x:key="calendarcontroltemplate1" targettype="wpcontrols:calendar"> <scrollviewer> <grid height="auto" background="black"> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> <rowdefinition height="auto"/> </grid.rowdefinitions> <grid.columndefinitions> <columndefinition width="auto"/> <columndefinition width="*"/> <columndefinition width="auto"/> </grid.columndefinitions> ...

java - Crash app in Thread.setDefaultUncaughtExceptionHandler -

i crash app on purpose after logging own error. handler registered in application.oncreate(): // set global exception handler thread.setdefaultuncaughtexceptionhandler(new uncaughtexceptionhandler() { @override public void uncaughtexception(thread thread, final throwable ex) { // unregister thread.setdefaultuncaughtexceptionhandler(null); // report ... // crash app -does not work, app frozen if (ex instanceof runtimeexception) throw (runtimeexception) ex; throw new runtimeexception("re-throw", ex); } however, app freezes instead of crashing dialog. how can crash application if hadn't registered handler? this bit of code never going work. an uncaught exception handler called after thread has terminated due exception not caught. if attempt re-throw exception, there nothing else catch it. if want have re-thrown exception handled in normal, have logging further stack. the other option have explicitly chain uncaughtexceptionhandler ...

css - Split available width between two divs -

i have container (width not known) containing 4 divs, follows: | div1 | div2 ............... | .............. div3 | div4 | the leftmost , rightmost divs (div1/div4) fixed width; that's easy part. the width of div2/div3 not known, , avoid setting fixed width them, depending on content 1 can wider other (so cannot e.g. have each 1 use 50% of available space) i width of div2/div3 automatically computed browser, if there remaining space left, should stretch fill remaining space (it not matter how remaining space split between div2/div3) the way approaching right is: div1 floated left (or absolutely positioned) div4 floated right (or absolutely positioned) div2 has margin-left equal width of div1 (known) div3 has margin-right equal width of div4 (known) my question is, how have div2 , div3 stretch fill remaining available width? guess 1 option use display: table, , possibility flex-box . there alternatives? update: edited clarity. update 2: please note i ca...

ruby on rails - How to create a form and connect it with a download -

i'm looking hours now, how create simple form on website , submitting, start download. i want simple form name, last name, , email adress. should send me via email. submitting name, should either start download of file or if easier, want send e-mail submitted email address download link in it. any idea on how or know tutorial didn't find yet? thanks lot! marc i dont know of framework doing so, but not hard implement yourself. make anchor tag redirect user download. bind evnt of clicking anchor using jquery .on function. in js function send ajax serialised info. throw .ajax function. when complete, redirect user using location.assign('/dl.php?f=123.mp3'); built in js function. is help? (if not, not vote me down, ask further , help)

python - SQLAlchemy class __init__() meets takes at least 5 non-keyword arguments error -

i wrote code user class sqlalcemy ##############models.py class user(base,usermixin): __tablename__ = 'users' id = column(integer, sequence('seq_user_id'), primary_key=true) name = column(string(50), unique=true, index = true, nullable = false) email = column(string(120), unique=true, index = true, nullable = false) password = column(string(128), nullable = false) registerdate = column(date, nullable = false) def __init__(self, name, email, password, registerdate): self.name = name self.email = email self.password = password self.registerdate = datetime.datetime.now() def __repr__(self): return '<user %r>' % (self.name) def is_authenticated(self): return true def is_active(self): return true def is_anonymous(self): return false def get_id(self): return unicode(self.id) then wrote code create test user ############## fron...

How to include jquery to joomla2.5 article -

i using joomla2.5,i need have jquery effect on 1 of page(not home page) wondering can include jquery joomla article if not should do? you can include jquery in index.php in <head> section.

adfs2.0 - ADFS 2.0 - using claim rules to find out when password expires -

i need adfs 2.0 tell relying party application when current user's password expire. basically, need extract data ad, using adfs claim rules, repeat logic of article: http://blogs.msdn.com/b/adpowershell/archive/2010/08/09/9970198.aspx i can access user-level ad attribute "pwd-last-set" without problems (other changed value caching around 20 minutes), but: i can not access domain-level attributes (like max-pwd-age) claim rules. how can that? i can not find appropriate attributes of data, domainmode. may there ready solution problem, googling skills weak find? you can access ad attributes pertain logged-in user. for kind of thing, suggest writing custom attribute store returns info. require.

html - google maps infobox above all other content z-index does not work -

i use infobox attach div 20 markers on map. div contains anchor shows via classname:hover. works expected alas: have box, pops @ :hover trump all other content on page in order make sure, content of box not behind else. i have applied position , z-index relevant elements on page , popup boxes have z-index 1000 while other below 100. still marker-image (z-index 80) covers box. tried change panes , have set index marker using setzindex 80 no avail. boxtext.innerhtml = '<p class=\"sheikh_flag\"> <a style=\"z-index:1000\" class=\"sheikh\" href=\"index.php\"> linktext </a> text </p>'; is there way make sure, anchor class sheikh displayed atop others? z-index works elements have position: relative / absolute / fixed

php - Getting type of file request -

i have example code: <img src="e.php"/> <link href="e.php" rel="stylesheet"/> <script src="e.php"></script> is there way know if e.php loaded on window or if called document elements? if request 'friendly' - i.e. can trust - pass parameter inside dom: <img src="e.php?query=dom"/> otherwise, if can not trust (i.e. parameters changed) - there's no way figure out type of query - can either 'normal', query elements or via curl call (in common case, curl third-party library )

c# - how to read metadata of a file which is in amazon s3 -

i read metadata of file amazon s3. there work around achieve it. ex: image in amazon s3, read 'date taken' metadata property of image , return application. thanks in advance if need download 'metadata' of s3 object itself, need perform head operation on file in question. return header information, include metadata had been included in object. amazon s3 specific how metadata can put header of object. otherwise default things such file size, server date, owner name, , few other pieces. if trying dig out metadata information part of object itself, inside image file, out of luck. need download entire file first. not unless can need pre-defined byte range in object, because perform operation , specify byte-range wish download. aws s3 head documentation can read here: http://docs.aws.amazon.com/amazons3/latest/api/restobjecthead.html

javascript - onsubmit validation option of infragistics igeditor not working -

here scenario have html page as <form id="form"> <table id="formtable"> <tr> <td id="label1"> <td id="editor1"> </tr> <tr> <td id="label2"> <td id="editor2"> </tr> </table> <input type="button" value="save" id="save"/> </form> and @ script side declaring , appending table elements var label1 = document.createelement('label'); var input1 = $('<input id="txt1"/>'); var label2 = document.createelement('label'); var input2 = $('<input id="txt2"/>'); label1.innerhtml = "first name"; label2.innerhtml = "last name"; $(input1).igeditor({ width: 140, required:true, validatoroptions: { onchange: false, ...

Lua cut-scene - coroutine.resume leads to fps drop (or i doing it wrong) -

i try use coroutines achieve cut scenes using lua, , there no problems except massive fps drop. i don't know why, coroutine.resume slow down program 5000 fps (without rendering @ all) 300-350 fps while event couroutine not dead (e.g resume constantly). event became dead fps returns normal. i think couroutines can't slow, , there problems in event.lua/eventmanager.lua code, or measure fps wrong way, or doing horrible. event.lua function event() print("event started") --simply can = 1,1000 coroutine.yield() end --[[ wait local wait = 0.0 print("waiting 5 sec") while wait < 5.0 wait = wait + coroutine.yield() end --]] --[[ play sound local alarmsound = soundsmanager.getsound("sounds/alarm.ogg") alarmsound:play() while alarmsound:isplaying() coroutine.yield() end --]] print("event ended") end fps.lua local fps = { fps = 0, l...

Ajax requests for php queries -

i using cache plugin wordpress website, have few questions, don't want plugin cache following php codes (the code ratings, download counts , page views. <?php if(function_exists('the_ratings')) { the_ratings(); } ?> <?php setpostviews($post->id); ?> <?php echo getdownloadcounter(get_the_id()); ?> the owner of plugin suggested use ajax requests. can please how adjust above code in ajax? new such things. thanks.

Display the value in prompt message using Javascript and PHP -

i'm newbie in using of javascript php. need me solve problem. scenario: i have table name "tbldata" . in database, below data tbldata. fldbldgname fldplaylist bldg 1 playlist1 bldg 1 playlist2 bldg 1 playlist3 bldg 2 playlist4 i have form display data of fldbldgname checkbox. when check checkbox of bldg 1 click button name "view playlist" display fldplaylist of bldg1 using javascript or prompt message. for summary: i want display data of bldg1 or other bldg in prompt message using javascript okay button only. there way this? search google can't find answer problem. thanks in advance. there two ways this. 1. generating javascript on server php. small example: php (pseudo-code) $sql = // ... (your sql query); $list = // ... (your result objects sql); // build html of received items want show $html = '<div id="playlists">'; foreach(listitem in l...

c# - boundaries cut the image when rotated -

Image
i want rotate image in picture box. here code. public static bitmap rotateimage(image image, pointf offset, float angle) { if (image == null) { throw new argumentnullexception("image"); } var rotatedbmp = new bitmap(image.width, image.height); rotatedbmp.setresolution(image.horizontalresolution, image.verticalresolution); var g = graphics.fromimage(rotatedbmp); g.translatetransform(offset.x, offset.y); g.rotatetransform(angle); g.translatetransform(-offset.x, -offset.y); g.drawimage(image, new pointf(0, 0)); return rotatedbmp; } private void button1_click(object sender, eventargs e) { image image = new bitmap(picturebox1.image); picturebox1.image = (bitmap)image.clone(); var oldimage = picturebox1.image; var p = new point(image.width / 2, ...

java - METRO Web Service client does not respond -

hello, dear users! we have troubles performance of java metro web service client. the web-service client part of web application, not desktop program (maybe important). deployed on glassfish 3.1.2, os 32-bit windows server 2003 sp2. client performs high number of requests web-service (which web application on different machine) - hundreds of requests in minute. the problem (4 or 5 times day) web service client stops responding , hangs (without exceptions thrown). in tcpview can see lot of processes started web-service client. when problem first occured, specified minimal ws client timeout values, issue still persists (probably container not dispose connections?). could please suggest can possibly source of problem? maybe should change keep-alive http value, or else? understand description of problem not detailed, unfortunately not have ideas how begin investigation. thank in advance!

android - php - adding messages and setting date -

i don't know php @ , try rewrite example of using php android i want android app send data - name , message , receive list of data json now - have example : <?php // post data $data = urldecode($_post['data']); $name = urldecode($_post['name']); $jsondata = array(); $jsontempdata = array(); $jsontempdata = array(); $jsontempdata['name'] = $name; $jsontempdata['number'] = $data; $jsontempdata['date_added'] = // don't know how set date $jsondata[] = $jsontempdata; $outputarr = array(); $outputarr['android'] = $jsondata; // encode array json data print_r( json_encode($outputarr)); ?> which means send data , in 1 method , assume, wrong. how can separate them - sending data php , receiving json.i have repeat, got 0 knowledge in php. plus it's 1 name-message pair wrapped array , need make arr...

Specific date format using Calendar in Java -

i have date format generate using calendar class in java date : thu, 04 jun 2009 02:51:59 gmt what's best way generate ? thanks in advance use simpledateformat class. calendar doesn't format dates.

wcf - 'System.ServiceModel.CommunicationException' occurred in wp8 app -

i create service in wcf , consume service in wp8 app, created service listing details,in wcf testclient i'm getting records while using service in wp8 app i'm getting exception "system.servicemodel.communicationexception" how can solve ideas? first build working client service desktop c#. compare outgoing of working client output of wp8. turn on wcf trace on server see error details.

.net - Visual Studio installer project does not overwrite output .EXE file -

i've created visual studio installer project copy applications' output folder on target pc. now, when want distribute newer version, create installer increased version. properties 'removepreviousversions' , 'detectnewerinstalledversion' set true. what happens is: files in target folder overwritten installer, except .exe file, not replaced. did forget setting somewhere? thanks, after lot of trying , setting properties on , off, appears if want assembly or executable overwriten installer, have increase version of project each time build installer (and not version of installer project!!!). if don't this, original file kept. select executable/assembly project > properties > application > assembly information. here can modify version.

Android charts: to use webview/JS or to go native -

we going build android library provide api developers build applications can embed charts (the charts display specific contents particular api). since there no charting libraries dominant in market, library ideal this. of chart types need developed not supported native libraries( heatmaps). keeping in mind guys advice going in native lib or webview embedded html/js. the problem webview cannot package assets(html/js) on library project resources. again additional step developers using library copy assets project. additional info: my api should allow developer embed chart. like <org.example.custompiechart android:id="@+id=chart" android:width="150dip" android:height="150dip" /> and api should take care of else. if developer wants change color, customize stuff possibly use other parts of api , that. i have used achartengine library chart , working fine. suggesting achartengine.

data modeling - Snowflake schema dimension -

Image
this first time i'm working on bi project , pentaho products not yet familiar me, needed know if following models correct , won't face difficulties later when creating hierarchies on bi server ! thank you. time dimension : complication dimension, every complication can have sub-complications : not idea. your calendar dimension table should this: create table calendar ( calendar_id int primary key, name text not null unique, date_iso date unique, year smallint, quarter smallint, month smallint, month_name text ... ); insert calendar values (0, 'n/a', null, null, null, null, null), (20130826, 'aug 26, 2013', '2013-08-26', 2013, 3, 8, 'august'); the point of data warehouse ease analysis . making bi analyst 3 joins date not ease analysis. calendar_id "smart key", i.e. not meaningless surrogate key. calendar table table should use smart key, aids table partitioning date. note nullable fields, a...

java - get all absolute paths of files under a given folder -

i need hold in memory absolute paths of file names under given directory. mydirectory.list() - retrieves string[] of file names (without absolute paths). don't want use file object since consumes more memory. last thing - can use apache collections etc. (but didn't find useful that). string directory = <your_directory>; file[] files = new file(directory).listfiles(); for(file file : files){ if(file.isfile()){ system.out.println(file.getabsolutepath()); } } this works, , gotta i'm confused when don't wanna use file objects, whatever works, guess.

c# - How to trigger Item_Command event for Checkbox in Repeater -

i having repeater contains check-boxes,i want fire item_command event whenever check-box on repeater checked. since item_command event wont fire check-box. googled , heard bubble event wont trigger check box,is there other way can achieve this? thank you askar thanks @upvote markanswer did it... declared item_created event repeater , added following code, protected void rptrincdnttype_itemcreated(object sender, repeateritemeventargs e) { repeateritem item = (repeateritem)e.item; if (item.itemtype == listitemtype.item || item.itemtype == listitemtype.alternatingitem) { checkbox chkbxsafety = item.findcontrol("chkbxsafety") checkbox; chkbxsafety.checkedchanged += new eventhandler(checkbox2_checkedchanged); } } private void checkbox2_checkedchanged(object sender,eventargs e) { checkbox cb = (checkbox)sender; }

alarmmanager - Android reminer reads only one alarm -

i have reminder app. this source code. problem when set 1 alarm fine. when set example 3 alarm, app reads last alarm, reminds third alarm , ignores first 2 alarms. can me set alarmmanager schedule every notification in specific time? this remindermanager.java: import java.util.calendar; import android.app.alarmmanager; import android.app.pendingintent; import android.content.context; import android.content.intent; public class remindermanager { private context mcontext; private alarmmanager malarmmanager; public remindermanager(context context) { mcontext = context; malarmmanager = (alarmmanager)context.getsystemservice(context.alarm_service); } public void setreminder(long taskid, calendar when) { intent = new intent(mcontext, onalarmreceiver.class); i.putextra(remindersdbadapter.key_rowid, (long)taskid); pendingintent pi = pendingintent.getbroadcast(mcontext, 0, i, pendingintent.flag_one_shot); m...

Compiling MySQL Plugin for Qt 4.8.1 on Windows with Visual Studio 2010 C++ -

the qt project not provide mysql database drivers qt sql module 1 have use odbc or compile plugin manually . trying latter. have been using pre-built qt 4.8.1 vs 2010 , fail find plugin's project file (mysql.pro) in "c:/qtsdk/qtsources/4.8.1/src/sql/drivers/mysql/" numerous tutorials use. there qsql_mysql.pri following contents: headers += $$pwd/qsql_mysql.h sources += $$pwd/qsql_mysql.cpp # modified! added these: #includepath += "c:/program files (x86)/mysql/mysql server 5.6/include" #libs += "c:/program files (x86)/mysql/mysql server 5.6/lib/libmysql.lib" unix { isempty(qt_lflags_mysql) { !contains(libs, .*mysqlclient.*):!contains(libs, .*mysqld.*) { use_libmysqlclient_r:libs += -lmysqlclient_r else:libs += -lmysqlclient } } else { libs *= $$qt_lflags_mysql qmake_cxxflags *= $$qt_cflags_mysql } } else { !contains(libs, .*mysql.*):!contains(libs, .*mysqld.*):libs += -lli...

bash - Move ALL git commits dates 1 day into the future -

my system time incorrectly set during game jam, commits 24 hours before else's. i'd try doing filter-branch: #!/bin/sh git filter-branch --env-filter ' an="$git_author_name" ad="$git_author_date" cd="$git_committer_date" if [ "$git_author_name" = "wilbefast" ] ad=date_plus_one(ad) cd=date_plus_one(cd) fi export git_author_date="$ad" export git_committer_date="$cd" ' i can't figure out how parse , modify date though :s i'm not bash pro i'm afraid; ideas? git_author_date , git_committer_date in unix time, can add 24 hours worth of seconds these values (86400 seconds) ad=$[ $ad + 86400 ] cd=$[ $cd + 86400 ]

android - KSOAP2 Parsing complex hierarchy of Response -

i have problem parsing complex response of ksoap2. my response xml file is: <word>breadth</word> <definitions> <definition> <word>breadth</word> <dictionary> <id>gcide</id> <name>the collaborative international dictionary of english v.0.44</name> </dictionary> <worddefinition>breadth \breadth\ (br[e^]dth)</worddefinition> </definition> <definition> <word>breadth</word> <dictionary> <id>moby-thes</id> <name>moby thesaurus ii grady ward, 1.0</name> </dictionary> <worddefinition>87 moby thesaurus words "breadth": </worddefinition> </definition> </definitions> my class file is: public class mainactivity extends activity { private static final string soap_action = "http://services.aonaware.com/webservices/define"; private...