Posts

Showing posts from March, 2010

c++ - Template matrix with char* consol stop responding when using operator= -

i need help. first hugh program in c++ (pointers nightmare). tried , can't find did wrong. class aghmatrix { private: t ** matrix; int n; int m; public: aghmatrix() : n(0), m(0) {}; aghmatrix(int _n, int _m); aghmatrix(const aghmatrix& other); ~aghmatrix(); void setitem(int n, int m, t item); void setitems (t * wsk); void setitems(int r, int c ...); void setall(); void getall(); bool couldbeadded(char * word, char sign); bool equals (t first, t second); t operator()(int a, int b); aghmatrix<t> & operator+(const aghmatrix<t> & other); aghmatrix<t> & operator*(const aghmatrix<t> & other); aghmatrix<t> & operator= ( const aghmatrix<t> & other); bool operator== (const aghmatrix<t> & other); bool operator!= (const aghmatrix<t> & other); }; test : char* cpt[] = {"to", "jest...

sapui5 - How to overwrite or change OpenUI5 Panel section id? -

i doing adding/delete of panel section container in openui5. while deleting selected panel container can able it. after deletion of container , again adding new container getting error of "adding element duplicate id txn_1". how fix issue? i using below code: var iconadd = new sap.ui.commons.button({ //add container code text : "add", width:"65px", icon : "sap-icon://add", press : function() { var len=$('#panelcontainer .sapuipanel').length; //alert("len"+len); createnewtransaction(len+1); //alert(""+len); //var content=$("#panelcontainer").html(); //$("#panelcontainer").append(content); //var length=$('#panelcontainer').length; // alert(""+length); } }); createnewtransaction(1);//onload defaultly 1 conatiner should show...

jsf - How to handle bootstrap modal in Java Server Faces? -

i principle composite-components , bootstraps modal wont work together. whats best practice manage multiple custom composite components dialogs , use example in jsf-table. pass managed bean value selected row dialog. this works me if wrote in 1 page file. see last one. bootstrapmodal.xhtml modal wrapped in composite component <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:cc="http://xmlns.jcp.org/jsf/composite"> <cc:interface> <cc:attribute name="title" /> <cc:attribute name="linknamelable" /> <cc:attribute name="linknamevalue" /> <cc:attribute name="urlnamelable" /> <cc:attribute name="urlnamevalue" /> <cc:attrib...

how to set record by update query sql vb.net -

i have table , want set value if cell=null set record textbox . here table -------------------- col1| col2| note 1 2 aaa 5 5 (*) set record here if cell null 42 14 47 55 ------------------ here code , problem query write every cell null , want write next cell before not null con.open() query = " update firealarm set note=@note note null" dim command sqlcommand = new sqlcommand(query, con) command.parameters.add(new sqlparameter("@note", sqldbtype.nvarchar)) command.parameters("@note").value = notebox.text.tostring command.executenonquery() con.close() first, let's fix immediate problem: in sql null not equal anything, including other null s, note<>null true rows. address problem, sql has special operators is null , is not null . using where note not null fix problem. a bigger problem remains, though: program vulnerable sql injection attack. fix problem in visual basic see this q&a . edi...

java - JavaFX ScrollPane memory leak software pipeline -

i have simple code , run -dprism.order=sw using jdk8_45: @override public void start(stage primarystage) throws exception { stackpane root = new stackpane(); root.getchildren().add(new scrollpane()); scene scene = new scene(root, 300, 250); primarystage.settitle("test fx scrollpane"); primarystage.setscene(scene); primarystage.show(); } run visualvm , have following: greates object int[] - 9-10mb than resizing window many times , @ visualvm out calling gc: greates object int[] - 400-500mb after calling gc: greates object int[] - 140-150mb if heap dump , @ int[] - it's images, , on time become more , more. if run -dprism.order=es2 it's right. any solutions this? thanks

regex - C# Regular Expression Nested Paraenthisis Recursive -

need find regular expression. text = @"{'the quick' | 'the lazy'}{{{'before'} 'fox' } | {{'before'} 'lion'}}" result string array should - [0] = 'the quick' | 'the lazy', [1] = before/1 fox | before/2 lion unless 2 or more strings split |, need them side side. thanks help. after thinking bit, able find simple solution. string sampletext = "{'what is' | 'when is'}{before/2 }{doing | 'to do'}{ near/3 }{'to ensure our' | 'to ensure that' | 'to make sure our' | 'to make sure our' | 'so our' | 'so our'}{ before/4 }{doesn*t | 'does not' | 'will not' | won*t}"; list<list<string>> list = new list<list<string>>(); match mt = regex.match(sampletext, @"\}([^{]*)\{"); string value = sampletext.replace(mt.value, "},{"); ...

ios - Interactive transition similar to scroll view -

Image
i have implemented interactive transition between 2 view controllers, using gesture recognizer , uipercentdriveninteractivetransition . doing custom swipe transition. i improve 2 things in order have similar scrollview animation: responsiveness. when pan super fast , short, next vc not showed, plus bug comes in ( animationended not called, story) there way preload next view controller, have child view controller may be? seems doing work in viewdidload. in implementation when gesture recognizer ends, call finishinteractivetransition . works ok, if start new pan gesture before transition completed ui jumps instead of smoothly scrolling. may should call finishinteractivetransition after delay, , calling manually updateinteractivetransition in mean time? may can use api sets have interactive animation (but scrollview not option)? just fyi: here view hierarchy during interactive swipe, gesture attached navigation view: try subclassing uipercentdriveninteractive...

how to execute a query that is result of another query in sybase -

i trying create procedure i'm passing parameter. based on parameter select field table select query( text datatype ). want retrieve data of select query. sql query in table text data type , sybase doesn't allow create text local variables. table1 filter_criteria db_query incremental select a,b,c table2 <filter_condition1> complete select a,b,c table2 <filter_condition2> table2 a b c 11 12 13 12 13 14 if pass ‘incremental’ proc return 11,12,13 , on.. use execute-immediate. i.e. compose sql query dynamically in varchar variable , execute 'execute(@your_varchar_variable)'

ruby - rails to_xlsx Couldn't find all Vulnerabilities with 'id': (all, {}) (found 0 results, but was looking for 2) -

Image
i have rails app (ruby 2.0.0, rails 4.2.1). export data excel using acts_as_xlsx gem . here controller: class vulnerabilitiescontroller < applicationcontroller before_action :set_vulnerability, only: [:show, :edit, :update, :destroy] # /vulnerabilities # /vulnerabilities.json def index @vulnerabilities = vulnerability.all respond_to | format | format.html # index.html.erb format.json { render :json => @vulnerabilities } format.xlsx { send_data @vulnerabilities.to_xlsx.to_stream.read, :filename => 'costings.xlsx', :type => "application/vnd.openxmlformates-officedocument.spreadsheetml.sheet" } end (…) here model: class vulnerability < activerecord::base acts_as_xlsx end but when click on button: <%= link_to 'download', url_for(:format=>"xlsx") %> i have error: couldn't find vulnerabilities 'id': (all, {}) (found 0 results, looking 2) screenshot: can help? ...

search - Searching In datagridview in Windows Application VB.NET -

i have filter datagridview using textbox.the code below using fill gridview.getdata function of db class returns datatable. i not using datasource property of gridview instead filing gridview using loop. i can searching using datasource property , dataview have not fill datagridview directly datasource property. sub griddesgn() datagridview1.columns.clear() datagridview1.rows.clear() datagridview1.columns.add("crime", "crime") datagridview1.columns.add("actname", "actname") datagridview1.columns.add("section", "section") datagridview1.columns.add("description", "description") end sub private sub test_load(byval sender object, byval e system.eventargs) handles me.load griddesgn() dim dbobj new db dim dtt datatable = dbobj.getdata("select crime,actname,section,description natureofcomplaint_women...

android - How to specify destination in multer to upload images to remote server folder in node js? -

app.post('/photo',[ multer({ dest:'http://example.com/images/new/',limits: {files: 8,fields: 18}} this not working on other server , trying upload server's folder.how change ? if understand correctly, user uploading image node server, wish move file different server, either physically not same node server or not have access file system server is. dest: destination directory uploaded files it means server should have direct file system access folder. can is: treat destination temporary folder, can move file required final location using other schemes. other schemes, meaning depending on available communication between server, can scp call, or if cloud server, aws-s3 module, depends. multer not automatically you.

php - Codeigniter Temporary Solution for Mcrypt extension -

i have big problem in project. developed project pyrocms , pyrocms developed codeigniter. pyrocms required " mcrypt extension ". i have ssh detail of server don't have permission install server. i need solution " mcrypt extension " how working without install or download anywhere , upload in project root directory if possible?. i need solution this possible in laravel using packed working project without install mcrypt extension please give solution pyrocms . today last day of project need upload today whatever happen otherwise lose project , work. please help. thanks you can override default library own library. can try below code: p.s.: have not tested code :) create file: /codeigniter/application/libraries/my_encrypt.php and have below code started: <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class my_encrypt extends ci_encrypt { public function __construct() {...

python - pandas remove observations depending on multi-index level value -

i have multi-index data frame levels 'id' , 'year': value id year 10 2001 100 2002 200 11 2001 110 12 2001 200 2002 300 13 2002 210 i want keep id s have values both years 2001 , 2002. means want obtain: value id year 10 2001 100 2002 200 12 2001 200 2002 300 i know df.loc[df.index.get_level_values('year') == 2002] works cannot extend account both 2001 , 2002. in advance. how use groupby , filter : df.groupby(level=0).filter( lambda df:np.in1d([2001, 2002], df.index.get_level_values(1)).all() )

Not getting the result what I want in java by using array and string? -

input:- agxgw 3 2 4 2 5 7 14 output:- yes no yes i answer “yes” or “no” using following rule: select 2 integers , b, if element @ position same element position b in non-ending chant. answer yes, otherwise no. code: import java.util.scanner; public class gf { /** * @param args */ public static void main(string[] args) { // todo auto-generated method stub scanner sc = new scanner(system.in); string k=sc.next(); int k1=k.length(); int a=sc.nextint(); (int =0; <a; i++) { int b=sc.nextint(); int b1=b%k1; int c=sc.nextint(); int c1=c%k1; if(k.charat(b1)==k.charat(c1)) { system.out.println("yes"); } else { system.out.println("no"); } } } } once char b1 , c1. need find weather chars in string k = "agxgw" @ position b1 , c1 same or not....

How PDO prepared statements help to prevent SQL vulnerable statements? -

i'm confused or rather i'm like, soooooooooo confused pdo prepared statements. know prepared statements best way keep data safe hackers. from : how can prepared statements protect sql injection attacks? we sending program server first $db->prepare("select * users id=?"); data substituted variable called "placeholder". note same query being sent server, without data in it! , we're sending data second request, totally separated query itself: $db->execute($data); query- $query=$db->prepare("select * users username=?"); $query->execute(array($tex)); $tex=blah; drop table users;-- then - select * users username=blah; drop table users;-- how prepare statements me example above? i'm sorry if question vague understand. appreciated. in advance. the prepared statement handler make sure bound value always used valid sql value/literal (ie. sql string or number) , never 'raw sql te...

android app not appearing on smartphone -

i have tried , tried put app on phone. have done adjusting things recommended on other sites phone. i've taken care of many other problems. when run edit->configurations usb choice, it's doing because can see 6:android comments running. it's never appears on phone. best guess may because above 6:android bar statement printer next kind of phone says, "no debuggable applications" in red. that's best guess wrong. to fix this: tried tools->android->enable adb. @ android studio - no debuggable applications , suggest solution "turn on debuggable flag (debuggable true) in application's gradle file:" however, have multiple gradle files, , i'm searched of them statements mentioned in gradle file , not 1 there. any troubleshooting? more info should provide? done (general): pretty sure did phone (don't remember exactly, followed lists other websites) installed , changed path git.exe changed stuff ut-8 file format down...

Python equivalent of C++ member pointer -

what equivalent of c++ member pointer in python? basically, able replicate similar behavior in python: // pointer member of myclass int (myclass::*ptmember)(int) = &myclass::member; // call member on instance, e.g. inside function // member pointer passed instance.*ptmember(3) follow question, if member property instead of method? possible store/pass "pointer" property without specifying instance? one way pass string , use eval . there cleaner way? edit: there several answers, each having useful offer depending on context. ended using described in answer, think other answers helpful whoever comes here based on topic of question. so, not accepting single 1 now. assuming python class: class myclass: def __init__(self): self.x = 42 def fn(self): return self.x the equivalent of c++ pointer-to-memberfunction this: fn = myclass.fn you can call using instance in c++: o = myclass() print(fn(o)) # prints 42 however, mo...

html - How do I position these images under the logo when scaling down to be responsive? -

Image
i have section in header on right side scales down fine exception of how right block of images moving. images resize fine, once begin scale down, push logo div , placed above it. how can position them place under logo , line accordingly while staying in header , without turning display none when reach screen size? here link jsbin of images/badges. live site in wordpress , code post. maybe if use firebug or dev tools. this live version of site. also sidenote: have -190px margin enabled on live site. here screenshot reference : i managed fix issue. added separate media query so: @media screen , (max-width: 479px) { .badges-container { position: relative; text-align: center; margin-top: 0px } .badges img { width: 19%; }

How to keep iterating through loops in MATLAB -

i have matlab code usrinput = input('enter month: ', 's'); if strcmp(usrinput, 'july') disp('summer') elseif strcmp(usrinput, 'january') disp('winter') elseif strcmp(usrinput,'october') disp('fall') elseif strcmp(usrinput, 'april') disp('spring') end where input month , gives season, every time call script (called month) , input month in have call script again month. how can set don't have call script every time. aka after type in july , says winter, automatically "enter month:" again , can type in new month thanks! you can use infinite "while loop" using while(1) , can have more elegant code using switch , here code: while (1) usrinput = input('enter month: ', 's'); switch usrinput case 'july' disp('summer') case 'january' disp('winter') case 'octo...

Google's Cloud MySQL shuts down after 15 minutes. Why? -

we using google's cloud mysql service. after 15 minutes seems shut down or go sleep. this activity directly relates settings of "on demand" , "per use" selections. have ensured these set "always on" , "package" upon creation of service. what occurs - after approximately 15 minutes of inactivity on mysql service attempt make query. first query takes approximately 10 seconds issue response. following queries respond within normal response times. we utilizing d1 tier . possibilities - tier possible low of resources make above settings effective? any suggestions ensure mysql service google running , not in type of idle mode? pinging mysql server every 14 minutes possibility seems google have ability handle themselves. unfortunately not able diagnose direct problem enough, had move forward. solved problem adding connection ping every 7 minutes keep connection alive. hope below helps someone. written within nodejs. ...

c - Clear 2 newline characters from the end of a file -

i have text file myfile.txt, , @ bottom of have. thanks reading, goodnight.\n\n how remove 2 newline characters? can open file writing, can't figure out how remove 2 end. just truncate file 2 characters: int fd = open("file.txt", o_wronly); fseek(fd, 0l, seek_end); int sz = ftell(fp); close(fd); truncate("file.txt", sz - 2); you supposed leave @ lease 1 new line character @ end of text file, isn't requirement: https://stackoverflow.com/a/12916758/1072647

c - Using 'dummy' pointers just for comparison -

i have struct contains string (character pointer). this string/array should in form of 1 of following: contain actual string data no actual data, should able show it's in called state_1 same above, state_2 i want able check if 'string' in state_1 or state_2 , , differently if contained actual data. if had 1 state, use null pointer. i tried along lines of this, leads undefined behavior. char *state_1, *state_2; ... if(tstruct.string == state_1 || tstruct.string == state_2){ ... } reserve 2 static addresses. they're guaranteed unique. static char state_1[1]; static char state_2[1]; if (tstruct.string == state_1 || tstruct.string == state_2) { ... } these global variables or static locals, either one.

Deedle dataframe slicing by rows in C# -

how slice rows in deedle dataframe using c#? example, want first 3 rows in deedle dataframe using c#. in deedle, can slice data frame based on row keys or based on offset. if have, example frame of type frame<datetime, string> (with dates keys), can write: var dfjanuary = df.rows.between(new datetime(2015, 1, 1), new datetime(2015, 2, 1)); as offsets, current api bit ugly, can write: // first 10 rows df.getaddressrange(rangerestriction<long>.newstart(10)); // last 10 rows df.getaddressrange(rangerestriction<long>.newend(10)); // rows 10, 11, 12, .. , 19, 20 df.getaddressrange(rangerestriction<long>.newfixed(10, 20)); we should add take extension method , few others make easier. (please open issue or better, send pull request that adds somewhere here .)

stackexchange api - How do I get the breakdown of a reputation score in the Reputation table of StackOverflow schema -

how breakdown of reputation score in reputation table of stackoverflow schema. example, user userid 1, total score in post table 6,036 reputation on 30,000. how breakdown of on 30,000 reputation score in reputation table? as far know, can't. need calculate manually finding amount of upvotes, accepted answers , down votes he/she received. should keep in mind can gain reputation editing posts. you can find querying votetypes table joined posts of user.

c# - Should i instantiate a new model? -

mvc. passing data view in model. in repository map linq result model. in controller send data. 1 should do: list<personmodel> people = new list<personmodel>(); people = repo.getpersonlist(); return view(people); or list<personmodel> people = repo.getpersonlist(); return view(people); as mentioned, in repo map result model, new model instance: var query = p in _db.person orderby f.lastname select new personmodel { id = f.personid, lastname = f.lastname }; return query.tolist(); either 1 works. use second 1 because thinking, repo creating new model passing controller when call repo.getpersonlist function. should create new instance in controller well, or continue am? go second. your first snippet has redundant new list<t> call allocates new list, while next line overrides reference newly created lis...

actionscript 3 - Calling a loop from eventEnterFrame function AS3 -

i cannot figure out how make loop progress evententerframe function. entire loop in 1 frame. trying make call classes function , let run thru course. code trying call function evententerframe , function call other functions , task. the task creating random y value, placing movieclip there , implementing gravity function movieclip falls. evententerframe calls create movieclip function via if loop creates multiples , fall @ different y locations. i want clean evententerframe function , move code out of main. not hard in main don't want in main. appreciated. private function evententerframe(e:event):void{ if(i<10){ i++; } else if(i>=10){ spikea.name = "spike_"+j; addchild(spikea); j++; i=0; } spikea.y+=5; if(spikea.y>600){ spikea.y=100; } } this how have spawning 1 "spike" in main the second issue controlling each created "spikea_"+j , giving each fa...

How to most efficently find the index of an item in an array with only two types of items 0, 1 in javascript -

say instance have var arr = [0,0,0,1,0,1,1,0,0,0,1]; and want find position of first 1 reference first 0. arr.indexof solve problem directly i'm not sure if compares linearly each item in array? binary search wouldn't work because loose index if sort , element... other way first 1 , aha! index 3, without going 1 element @ time? it searches iteratively beginning of array. the relevant part of specification: repeat, while k < len let k present result of calling [[hasproperty]] internal method of o argument tostring(k) . if k present true, let elementk result of calling [[get]] internal method of o argument tostring(k) . let same result of applying strict equality comparison algorithm searchelement , elementk . if same true, return k . increase k 1. source: http://es5.github.io/#x15.4.4.14 and yes, there no guarantees array structure - there nothing more efficient linear search. i'm not sure how 1 makes formal proof absence of t...

php - Laravel storage/framework/sessions on EC2 gives failed to open stream -

i use have working deployment system amazon beanstalk ec2 servers , added optimization post commmands scripts such composer dump-autoload sudo php artisan optimize --force sudo php artisan route:cache now on 1 of api endpoints it's strange half of data @ end have error file_put_contents(/var/app/ondeck/storage/framework/sessions/34325rfeq4324qfgr4): failed open stream: no such file or directory what's causing , how fix in ec2 deployment setup? edit i found out something! if on server thats giving me error run command below clear config cache error dissapears. how fix can still run php artisan config:cache , not have break? php artisan config:clear the reason why you're having issue because you're running artisan config:cache before "release" - on /var/app/ondeck if run eb ssh , you'll see app living inside /var/www you need run config:cache using post deploy hook - seems isn't officially supported yet. here's workar...

Java - Saving file from JAR to disk -

i'm trying save yaml formatted file packaged in jar user's disk. the file named config.yml , sits directly under 1 of project's source folders. can confirm file packaged in jar winrar. i using following code file jar: file file = new file(this.getclassloader().getresource("config.yml").getpath()); and using code copy file directory: fileutils.copyfiletodirectory(file, this.getdatafolder()); the getdatafolder() method implemented reliable 3rd party api. however, when use file instance defined same getdatafolder() file instance , path "config.yml": new file(this.getdatafolder(), "config.yml") the console logs filenotfoundexception. file path given in stack trace this: "file:\c:\users\evan\desk top\test%20server\plugins\lottocrates-1.0.jar!\config.yml" seems correct. tried opening file run prompt, able open jar with, not config.yml file.

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

there similar questions regarding issue haven't seen in particular test environment , sqlite. cannot validate schema test environment uses sqlite can validate schemas dev environment uses mysql. know reason , possible solution? whole application works fine in both dev , test environments though. phing , ci build broken. php app/console doctrine:schema:update --force --env=test updating database schema... database schema updated successfully! "9" queries executed php app/console doctrine:schema:validate --env=test [mapping] ok - mapping files correct. [database] fail - database schema not in sync current mapping file. update i'm adding sqldump result see if spots wrong it. thing can is, have 2 bundles. country below coming frontendbundle user entity missing defined in backendbundle . php app/console doctrine:schema:update --dump-sql --env=test drop index uniq_5373c9665e237e06; drop index uniq_5373c966d1f4eb9a; create temporary table __temp__country se...

Mule update to salesforce data -

this update account in sfdc, need put condition i.e condition @ end of update, there anyway can handle it?. query should like: update sfdcaccount setfields client_id='#[payload.get('id')]' i have seen example, select query condition, if satisfies update. can directly update based on condition? mule flow: <sfdc:update config-ref="sfdc__devint" type="account" doc:name="salesforce"> <sfdc:objects ref="#[payload]"/> </sfdc:update> if client_id external id ( salesforce docs ) can fetch object, remove id/any other external keys , set client_id , update object. do note fields may replaced if use original fetched object. perhaps should setup own input map before updating won't change field/future field mistake.

javascript - jQuery click works only once -

i want create circle everytime click button once click it, creates circle when click again nothing happen. $(document).ready(function() { var circle = $("<div class='circleclass'></div>"); $(".t-testbody").on("click", "#clickme", function() { $(".t-testbody").append(circle); }); }); .t-testbody { margin-top: 100px; margin-left: 50px; } .circleclass { width: 50px; height: 50px; border-radius: 100%; background-color: blue; display: inline-block; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="t-testbody"> <div class="circleclass"></div> <button id="clickme">button</button> </div> currently have created element , appended div. second append statement has not effect element exist in div. instead of eleme...

php - Unusual mass 301 redirects with .htaccess -

i'm migrating old ecommerce site new shopping cart system... need 301 redirect url scenarios seo purposes. i've got of handled, need insight on whether right technique task @ hand (and whether syntax looks correct)... there 1000 rules in htaccess. here's general rule setup each product page... there's multiple rules each product because i'm consolidating old mens / womens pages 1 new product page (as redirecting of various querystring versions of original url): rewriterule /mens-shirts-77/alice-in-wonderland-shirt-589.html$ http://www.domain.com/alice-in-wonderland-shirt-p160c3 [r=301] rewriterule /womens-shirts-92/womens-alice-in-wonderland-shirt-842.html$ http://www.domain.com/alice-in-wonderland-shirt-p160c3 [r=301] rewriterule /index.php?main_page=product_info*&products_id=(589|842)*$ http://www.domain.com/alice-in-wonderland-shirt-p160c3 [r=301] for reference, here's original query string looks like... "&cpath=##" no longer ...

php - htaccess rewrite url parameter -

i want redirect http://localhost:8080/mypproject/?supplier=test123 to http://localhost:8080/myproject/?product_cat=test123 but don't know how... you can use code in /myproject/.htaccess file: rewriteengine on rewritebase /myproject/ rewritecond %{query_string} ^supplier=([^&]+) [nc] rewriterule ^/?$ ?product_cat=%1 [l,r=301]

windows installer - WIX - Creating an uninstall shortcut inside installed folder -

i'm using wix 3.9 , wix-edit 0.7.5/notepad++ create msi installer application. want create uninstall shortcut inside installed folder. instance: c:\mysoftware\uninstall.lnk i tried few things, in cases when uninstall software through link, program folder c:\mysoftware not deleted. uninstalling every other way works expected. first tried create component inside <directory> tag. looks me bit hacky, because must add <createfolder> : <directory id="myinstalldir" name="mysoftware"> <!-- files... --> <component id="abc" guid="put-guid-here"> <createfolder/> <!-- have add --> <shortcut id="uninstallproduct" name="uninstall mysoftware" description="uninstalls mysoftware" target="[system64folder]msiexec.exe" arguments="/x [productcode]"/> </component> </directory> <feature id="defaultfeature...

c# - Unit test a void method with Mock? -

i want test void method mock. public class consoletargetbuilder : itargetbuilder { private const string console_with_stack_trace = "consolewithstacktrace"; private const string console_without_stack_trace = "consolewithoutstacktrace"; private loggermodel _loggermodel; private loggingconfiguration _nlogloggingconfiguration; public consoletargetbuilder(loggermodel loggermodel, loggingconfiguration nlogloggingconfiguration) { _loggermodel = loggermodel; _nlogloggingconfiguration = nlogloggingconfiguration; } public void addnlogconfigurationtypetagret() { var consoletargetwithstacktrace = new consoletarget(); consoletargetwithstacktrace.name = console_with_stack_trace; consoletargetwithstacktrace.layout = _loggermodel.layout + "|${stacktrace}"; _nlogloggingconfiguration.addtarget(console_with_stack_trace, consoletargetwithstacktrace); var consoletargetwithouts...

google spreadsheet - how i create a formula of payment using weeknum formula -

i need calculate paymant of people in same week see in spreadsheet https://docs.google.com/spreadsheets/d/1fhetofxzerjj07ducxxhuwul_1g3burvkrmyjt9_omm/edit#gid=91744412 used weeknum formula extract number of week using data in column ..for example "anselmi" earned 16 in week 24...... i made sheet in spreadsheet shared, called 'jp'. in cell a1 entered formula: =arrayformula(query({weeknum(foglio2!a2:a)\foglio2!b2:d}; "select col2, col1, sum(col3) col2 <>'' group col2, col1 label col2 'name', col1 'weeknumber', sum(col3) 'total'")) this formula outputs 3 columns: 1 column names, second 1 weeknumber , third column sum. ouput auto-update when new rows added in foglio2. see if works ?

ios - Why is my tableview jittery when I scroll -

a tablview cell being setup using following code... - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { mytableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"mytableviewcell" forindexpath:indexpath]; cell.titlelabel.text = [self.data[indexpath.row] objectforkey:@"node_title"]; cell.taxonomy1label.text = [self.data[indexpath.row] objectforkey:@"group"]; @try { nsdata *imagedata = [nsdata datawithcontentsofurl:[nsurl urlwithstring:[self.data[indexpath.row] objectforkey:@"image"]]]; cell.thumbnailimageview.image = [uiimage imagewithdata:imagedata]; } @catch (nsexception * e) { nslog(@"exception: %@", e); } return cell; } the try/catch because may or may not have image happening before put in. seems there sort of issue when goes dequeue cell. ideas? if familiar using third party libraries or ...

c++ - Why is the Analyze menu disabled in QtCreator -

i'm trying analyse (valgrind) program on linux using qtcreator. menu in qt creator disabled. i have opensuse 13.1. linux on 64bit. tried far: i've checked plugins dialogue , valgrind plugin greyed out, selected. i've checked installation directory , plugin there. valgrind installed (valgrind --version -> valgrind-3.8.1) valgrind works (valgrind --tool=callgrind ./myprog) i tried stock version of qtcreator (2.8.1) , newer installation in ~/bin/qt.. (3.4.0) i tried qmake , cmake project. i tried re-enable qtquick plugins. made menu work , analyse icon on left appeared, still no valgrind support. can help? you might need enable devices->remotelinux plugin well.

arrays - Node.JS, MongoDB TypeError: undefined function -

i have error on function call don't know why doesn't works. .get(function(req, res) { appointment.find({'creator._id':'55836c3929294c2506000001'}).toarray(function(err, appoint){ console.log("retrieved records:"); console.log(appointment); }); }); here can find error alert : typeerror: undefined not function @ object.handle (/users/maximesauvage/appoint/server.js:199:67) (it's find method on row 199) i want "appointment" rows creator._id = 55836c3929294c2506000001 my appointment json structure (an example): { "_id": { "$oid": "55846bd717ed43180f000002" }, "creator": { "_id": { "$oid": "55836c3929294c2506000001" }, "username": "hello", "email": "hello@toto.com", "__v": 2 .get(function(req, res) { appointment.find...

Using Java 8 lambdas/transformations to combine and flatten two Maps -

i have 2 maps: map<a, collection<b>> mapab map<b, collection<c>> mapbc i transform them map<a, collection<c>> mapac , i'm wondering if there's smooth way lambdas , transformations. in particular case, collections sets, i'd solve problem collections in general. one thought had first combine 2 maps map<a, map<b, collection<c>>> , flatten it, i'm open approach. data notes: b should occur in value collection associated 1 a , , same true mapbc (a given c mapped 1 b ). result, there should 1 path given a given c , although there may a -> b mappings there no b -> c mappings , there may b -> c mappings there no corresponding a -> b mappings. these orphans don't appear in resulting mapac . for sake of comparison, here's example of purely imperative approach same problem: map<a, collection<c>> mapac = new hashmap<>(); (entry<a, collection<b>> entry...

xcode - Microsoft Outlook API and Swift -

how access microsoft outlook api using swift. want use microsoft outlook api allow user search people in outlook server. search framework set up. confused how access server. code consulting people have done before. code have far: class exchangeapi { func httpsendrequest(request: nsmutableurlrequest, callback: (string, string?) -> void) { //implementing core data var appdel: appdelegate = (uiapplication.sharedapplication().delegate as! appdelegate) var context: nsmanagedobjectcontext = appdel.managedobjectcontext! let ent = nsentitydescription.entityforname("emails", inmanagedobjectcontext: context) var email = emails(entity: ent! , insertintomanagedobjectcontext: context) let task = nsurlsession.sharedsession().datataskwithrequest( request, completionhandler: { data, response, error in if error != nil { callback("", error!.localizeddescription) ...

c# - ADO.Net INSERT not inserting data -

i've got c#.net 4.5 console application , i'm trying insert data datatable sql server 2008r2 database table. no errors, no data gets inserted. here's code: int32 newid = 0; datatable dtmaxuserid = generalclasslibrary.generaldataaccesslayer.executeselect("select max(userid)+1 newid tiuser", false, "trackitcn"); newid = convert.toint32(dtmaxuserid.rows[0]["newid"].tostring()); //get new users alluserdata datacolumn dcrowid = new datacolumn("rowid", typeof(int32)); //dcrowid.allowdbnull = false; dcrowid.autoincrement = true; dcrowid.autoincrementseed = 1; dcrowid.autoincrementstep = 1; //dcrowid.unique = true; //dcrowid.columnname = "rowid"; datatable dtnewusers = new datatable(); dtnewusers.columns.add(dcrowid); dtnewusers.columns.add("maxid"); dtnewusers.columns.add("userid"); dtnewusers.columns.add("fullname"); dtnewusers.columns.add("title"); dtnewusers.columns.add("phone...

sequelize.js - How to define and use geo points in sequelize with mySQL -

i'm using sequelize orm connect mysql database - how define geo point in table/object model? since sequelize doesn't have point data type can pass in string represents mysql type? db.define(modelname, { id: { type: sequelize.integer, primarykey: true, autoincrement: true, allownull: false }, location:{ type:'point' //how define this?? }, createdby: { type: sequelize.integer, references: { model: 'user', key: 'id' } }, photoid: { type: sequelize.uuid }, caption: { type: sequelize.string } } since 3.4.0 sequelize support geometry postgres. based on commit messages, mysql supported. you can add new attribute this: point: { type: sequelize.geometry('point'), }, the supported types mysql are: var supported_geometry_types = ['point', 'linestring', 'polygon']; ...

jquery - Issue on Adding Animation Effect to Active Class -

can please take @ this demo , let me know why not able add animate effect active class through jquery i have class called .sliding-middle-out { display: inline-block; position: relative; padding-bottom: 3px; } .sliding-middle-out:after { content: ''; display: block; margin: auto; height: 3px; width: 0px; background: transparent; transition: width .5s ease, background-color .5s ease; } .sliding-middle-out:hover:after { width: 100%; background: blue; } now add same animation effect active class without having hover effect involeved. did merging hover part inthe after like .sliding-middle-out:after { content: ''; display: block; margin: auto; height: 3px; width: 0px; background: transparent; transition: width .5s ease, background-color .5s ease; width: 100%; background: blue; } and adding class .sliding-middle-out .active class like $("button").click(function(...

javascript - jQuery draggable clone doesn't stay where it is dropped -

i'm using jquery ui clone element div, drag , release @ div. @ first time drop cloned element, change position , goes far released. but, still draggable , stay must @ other times. $(document).ready(function(){ var counter = 1; $(".drag").draggable({ revert: "invalid", helper: 'clone', cursor: "crosshair", containment: 'frame', stop: function(event, ui) { var cloned = $(ui.helper).clone(); cloned.attr("id", "clonedelem" + counter); var pos = $(ui.helper).offset(); var draggableoffset = ui.helper.offset(), droppableoffset = $(this).offset(), left = draggableoffset.left - droppableoffset.left, top = draggableoffset.top - droppableoffset.top; cloned.css({ "position": "absolute", "left": left, ...