Posts

Showing posts from September, 2013

vba - Automatically add rows into a MS Word table in a loop as long as you read data from the excel sheet -

i'm vba newbie , having lots of errors , problems go on task. appreciated. basically have textbox (textbox1) in word doc. have users type in. it'll number , text references folder excel files numbers name. all excel files in folder has same formatting (created same template), number of rows in each file differs 1 another. my boss wants me create vba code in word import data excel word doc, problem occurs varying number of rows in each file, users can select existing file in folder. someone suggested creating rows in loop long there data pull excel, cannot code work. keeps failing i'm setting word table cell , excel cell equal each other (which don't know i'm doing right). here have far: private sub commandbutton1_click() dim tbl table dim row row set tbl = activedocument.tables(3) set row = tbl.rows.add(beforerow:=tbl.rows(1)) tbl.rows(1).range.formattedtext = tbl.rows(2).range.formattedtext '~~~> required above code inserts blank row...

Pointer to different data type in C -

i have compiled , run following program in c: #include <stdio.h> #include <stdint.h> #include <inttypes.h> int main(int argc, char* argv[]){ uint8_t data[8] = {0, 1, 2, 3, 4, 5, 6, 7}; uint32_t* pointer32 = &data[0]; uint64_t* pointer64 = &data[0]; printf("%" priu64 "\n", *pointer64); printf("%" priu32 "\n", *(pointer32++)); printf("%" priu32 "\n", *pointer32); return 0; } and received following expected output: 506097522914230528 50462976 117835012 the output correct , corresponds bitwise interpretation of data unsigned 64-bit integer , unsigned 32-bit integers. tried on 64-bit machine running ubuntu 14.04. compiled stock gcc compiler (4.8.4?). compiler throw "assignment incompatible pointer type" warning (which can safely ignored because incompatible assignment intended). is reliable way of converting , interpreting data in "data" array, or better r...

Elixir online IDE/playground website -

is there website allow test elixir snippets, save them , share like: http://haskellstub.com/ http://ideone.com/ http://www.tutorialspoint.com/codingground.htm i find like: http://www.tryerlang.org/ , http://try-elixir.herokuapp.com/ not allow share code, , second use elixir v0.10.2 . finally found wandbox 😎 features: elixir 1.1.0dev allow edit in vim/emacs mode execution of code syntax highlighting adding options commandline sharing links other supported languages[ bash script lazy k c lisp c# lua c++ php cpp pascal coffeescript perl d python elixir rill erlang ruby groovy rust haskell sql java scala javascript vim script] example: fizzbuzz problem

mysql - DATE in a between dynamic -

i need build sql query following select pi.desc, pa.nameaddress, pi.ref, pi.descitem, pi.quantity, pi.totaldf, pi.code, pi.codebl, cl.dateship, po.dtvalidated, po.supervisordate, datediff(po.supervisordate, po.dtvalidated) 'diffvalidsupervisor', datediff(cl.dtlivr, po.supervisordate) 'diffexpevalid', year(cl.dtlivr), month(cl.dtlivr) new.proforma_item pi inner join old.cdestk_lig cl on pi.codecde = cl.codcde inner join new.proforma po on po.idproforma = pi.idproforma inner join new.proforma_address pa on po.idproforma = pa.idproforma group pi.desc, pi.ref, pi.descitem, pi.code, pi.codebl, cl.dateship, po.dtvalidated, po.supervisordate, month(cl.dateship), po.dateinvoice having (po.dateinvoice between '2014-01-01' , '2014-12-31') but each year have review request change year. want make dynamic, because change manually crazy in our architecture. the best of is: say 15 june 2015 . be...

javascript - Path of template in js file in Symfony/angular project -

i working on angularjs/symfony project , cant figure out how define correctly path of twig template in js. the path to: -the original js -the template -the js path assetic ... +-src/ | +-mycompany/ | +-mybundle/ | +-resources/ | +-public/ | +-js/ | +-directive/ | +-my_file.js | +-view/ | +-template/ | my_template.html.twig +-web/ | bundles/ | +-mybundle/ | +-js/ | +-my_fil.js ... my js code: return { templateurl: '?' } so, there way include path bundle asset file? (i tried @bundle/ notation, didnt work). or, when include js in html, use js of bundle , not 1 of asset? thanks that be {% javascripts filter='?uglifyjs2' '@appbundle/resources/assets/js/your-file.js' '@appbundle/resources/assets/js/your-second-file.js' '@appbundle/resources/assets/js/adm...

java - Handler returning without Activity? -

i using handler update ui after thread returns - following method gets run thread (in fragment) public void signedin(final boolean success, final string error) { handler mainhandler = new handler(getactivity().getmainlooper()); mainhandler.post(new runnable() { @override public void run() { if(success) { toast.maketext(getactivity(), "signed in!", toast.length_short).show(); } else if (!success) { toast.maketext(getactivity(), "failed!" + error, toast.length_short).show(); } } }); } this works fine, if rotate phone @ correct time, handler gets called before activity has been created, getactivity() returns null , application crashes. can't wrap method in if (getactivity() != null), otherwise won't update ui @ all. what best way approach problem? android have can use around this? thanks, kevin....

Access SAP GUI for a linux -

i have sap installed on linux , sap gui on windows. for sap setups installed on windows, had installed webdynpro , able access them gui. linux, not sure configuration has done sap gui enable access. webdynpro (abap) proprietary declarative programming language runs on abap application server (and operating system independent). typically web dynpro applications commonly accessed via web browser i.e. client not have have sap gui (the client) installed view , access them, although technically possible view web dynpro applications via gui (it embedded web view). in order view applications typically need enable set of services of internet communication framework (icf) ensure host name of server configured correctly (should operate on qualified domain name) - set in instance profile (transaction rz10). so in summary os should not influence whether can access web dynpro application or not, rather sap system settings.

java - What is the return type of list<student>? -

i want create method populate data of student method signature public list<student> populatedata(string filename) . i new in java. can me this? code implemented me is public list<student> populatedata(string filename) { // todo auto-generated method stub scanner s = null; try { s = new scanner(new file("f:\\participant_workspace\\q3\\studentdatamanagementsystem\\studentdetails.txt‌​")); } catch (filenotfoundexception e) { // todo auto-generated catch block e.printstacktrace(); } list<student> list = new arraylist<student>(); while (s.hasnext()){ list.addall(s.next()); } s.close(); return list; } but gives error add arraylist<string> , list.addall(s.next()); . assuming file is this. abc 101 xyz 102 pqr 123 below given simple example, make alterations , stuff. public class printstudentsfromfile { public static void main(string[]...

Multiple Word Search not Working Correctly (Python) -

i working on project requires me able search multiple keywords in file. example, if had file 100 occurrences of word "tomato", 500 word "bread", , 20 "pickle", want able search file "tomato" , "bread" , number of times occurs in file. able find people same issue/question, other languages on site. i working program allows me search column name , tally how many times shows in column, want make bit more precise. here code: def start(): location = raw_input("what folder containing data processed located? ") #location = "c:/code/samples/dates/2015-06-07/large-scale data parsing/data files" if os.path.exists(location) == true: #tests see if user entered valid path file_extension = raw_input("what file type (.txt example)? ") search_for(location,file_extension) else: print "i'm sorry, file location have entered not exist. please try again." sta...

css - html <li> tag won't expand to wrap anchor padding -

i have following navbar on page, , <li> tags expand height height of anchors, reason ignore anchors padding (you can see if run snippet , mouseover menu items). can explain i'm doing wrong , how fix this? thanks #navbar { text-align: center; background-color: #913d88; } @media (min-width: 992px) { #navbar { border-radius: 10px; } } #navbar ul { list-style: none; text-align: center; } #navbar ul li { font-size: 1.1em; font-weight: 400; display: inline-block; } @media (min-width: 767px) { #navbar ul li { font-size: 1.2em; } } #navbar ul li { padding: 0.5em 1em; width: 100%; height: 100%; } @media (min-width: 992px) { #navbar ul li { padding: 0.5em 2em; } } #navbar ul li a:visited, #navbar ul li a:link { color: #fff; text-decoration: none; } #navbar ul li a:hover { background-color: #c371ba; color: #491f45; } #navbar ul li img { height: 1em; } #navbar ul .dropdown { ...

python - List Index Out of Range: Importing info from two lists into one conditionally -

a = "alpha" b = none c = "charlie" first_list = [a,b,c] a_define = "a" b_define = "b" c_define = "c" second_list = [a_define, b_define, c_define] third_list = [] len_of_firstlist = len(first_list) item in range(len_of_firstlist+1): if first_list[item] not none: first_list[item] = first_list[item] + second_list[item] third_list.append(first_list[item]) print third_list this might seem bit generic unfortunately, i'm lost... code seems work, keeps giving me indexing error. i think unclear of these points : range(start=0,stop,step=1) function starts default value 0 , stop when value equal stop i.e. stop value not included. further information, see docs . lists in python indexed 0 (like arrays in c). so if want traverse string length n , need define range range(n) . if want more compact code, few changes might be: a = "alpha" b = none c = "charlie" first_list = ...

c# - Get the raw values (not html) from AntiForgeryToken() -

this beautiful abstraction lets place @html.antiforgerytoken() in cshtml file magically expanded like; <input name="__requestverificationtoken" type="hidden" value="jjmhm5kjq/qjsyc4sgifqwwx/wmadmnveghzxxub07bwol84drmqze6k9irvyfsj5vsyqeuixgl4dw4nhsotlwflgytyeczlvrgzbtonxj9m3gvpguv7z6s2ih/klub78gn7fl4gj7kxg62meogczw175evwtmkkj0xrtefd5kcvvyimhny8mt2l+qhltsgl87c9dii42avouuq2gtvfpg==" /> by mvc before page served. page has javascript making ajax calls don't include token though it's been added form. getting expected [httpantiforgeryexception]: required anti-forgery token not supplied or invalid. because don't have token. i'm aware could parse value out of dom shouldn't have to. there other ways of accessing/getting value? clear, mean i'd overload of method returns value string or kind of object has name , value both. to provide bit more context form , relevant js looks little this; <form action="/settings...

c# - Executing PowerShell Script with Parameters -

sup. i'm adapting this solution windows forms solution. far i've been able execute get-wulist command no problems. doesn't seem go hide-wuupdate . i've tried far: public class powershellcontroller : ipowershell { //created @ global scope can fetch it. initialsessionstate initial; runspaceinvoke scriptinvoker; runspace runspace; powershell ps; //the view control iview view; //the helper gridviewprocessor class igridviewprocessor gp; //initializing controller - loads module. public powershellcontroller() { initial = initialsessionstate.createdefault(); initial.importpsmodule(new string[] { @"c:\users\jose\documents\windowspowershell\modules\pswindowsupdate\pswindowsupdate.psd1" }); scriptinvoker = new runspaceinvoke(); scriptinvoker.invoke("set-executionpolicy unrestricted -scope process"); runspace = runspacefactory.createrunspace(initial); run...

matplotlib - Python multiple boxplots automatic label -

is possible automatically set labels multiple boxplots? know can done custom annotations or ticklabels, possible automatically? naively 1 expect following, plt.boxplot doesn't support labels. import numpy np import matplotlib.pyplot plt #fake data data = (np.random.random(50), np.random.random(50)) labels = ('random set 1', 'random set 2') plt.boxplot(data, labels=labels) plt.legend() plt.show() any ideas? i realized shortest , cleanest along lines of: import numpy np import matplotlib.pyplot plt #fake data data = (np.random.random(50), np.random.random(50)) labels = ('random set 1', 'random set 2') plt.boxplot(data) plt.xticks(np.arange(len(labels))+1,labels) plt.show() but i'm still open other (automatic) suggestions.

php - Is it a good security practice to use ajax query to confirm if username exist for new user registration -

i going through cool functions of ajax , how can verify if username exist before submit registration form. using function can make job easier malicious users note of username use query login system. use of ajax not prone security infringement illustrated above?

compare - Benchmarking in Java (comparing two classes) -

i'll want compare speed of work 2 classes ( stringbuider , stringbuffer ) using append method. and wrote simple program: public class test { public static void main(string[] args) { try { test(new stringbuffer("")); // stringbuffer: 35117ms. test(new stringbuilder("")); // stringbuilder: 3358ms. } catch (ioexception e) { system.err.println(e.getmessage()); } } private static void test(appendable obj) throws ioexception { long before = system.currenttimemillis(); (int = 0; i++ < 1e9; ) { obj.append(""); } long after = system.currenttimemillis(); system.out.println(obj.getclass().getsimplename() + ": " + (after - before) + "ms."); } } but know, it's bad way benchmarking. want put annotations on method or class, set number of iterations, tests, different conditions...

html - How to keep the previous answer selected? (javascript quiz) -

my javascript quiz have both 'next' , 'previous' button. want keep answers selected when click previous/next button. here jsfiddle link javascript used check answer: var correct = 0; var pos = 0; var choice; var allquestions = [ {question:"what 10 + 5?", choices:["15", "12", "10"], answer: "a" }, {question:"what 10 - 5?", choices:["5", "6", "8" ], answer: "a" }, {question:"what 10 * 5?", choices:["50", "60", "70"], answer: "a" }, {question:"what 10 / 5?", choices:["1", "2", "3" ], answer: "b" } ]; function getid(x) { return document.getelementbyid(x) } function renderquestions () { var teststatus = getid("test_status"); var test = getid("test"); if(pos >= allquestions.length) { teststatus.innerhtml = "test completed...

Kendo UI Scheduler with AngularJS - Update issue in custom edit template -

we using custom editor template custom fields in agenda view. have edit button fires editevent of scheduler. problem that, when update event, doesn't fire update operation. as can see, in "add new event" case, works fine. while editing "repetitive events series" case, fires update operation desired. only problem, having that, while editing single event (all day event or non-repetitive events), update operation not fired. does have solution this? here link demo in telerik's dojo : the html: <div id="example" ng-app="kendodemos"> <div ng-controller="myctrl"> <div class="thistab clickheretabscheduledcont boxwrapper"> <div class="agenda" style="position:relative;"> <div kendo-toolbar k-options="toolbaroptions" class="newevent" id="toolbar" ng-click="scheduleroptions.addevent()"...

python - Django Get Latest Entry from Database -

i've got 2 questions, related same topic. i know how retrieve data for loop using template tags {% status in status %} <tr> <td>{{ status.status}}</td> </tr> {% endfor %} however when want retrieve single object error when use: po = status.objects.latest('id') and remove loop. i get: 'status' object not iterable my questions are: how can latest entry database given model? how can setup templates tags allow single record? you have 2 different questions here: how retrieve latest object database. you can using latest() queryset operator. reading docs note operator works on date fields, not integers. status.objects.latest('date_added') # or date_updated if want off id need order id , select first result. (this work if using incrementing primary keys, not work uuid's or randomly generated hashes). status.objects.order_by('id')[0] side note: use date_added / dat...

c++ - OpenGL Rendering Constricted to bottom left quarter of the screen -

Image
so i'm working on opengl project in c++ , i'm running weird issue after creating glfwwindow , drawing it, area i'm drawing in encompasses bottom left quarter of screen. example if screen dimensions 640x480, , drew 40x40 square @ (600, 440) shows here, instead of in top right corner expect: if move square area that's not within 640x480 parameter gets cut off, below: i'll post code main.cpp below: #define frame_cap 5000.0; #include <iostream> #include <gl/glew.h> #include <glfw/glfw3.h> #include "inputhandler.h" #include "game.h" using namespace std; void gameloop(glfwwindow *window){ inputhandler input = inputhandler(window); game game = game(input); //double frametime = 1.0 / frame_cap; while(!glfwwindowshouldclose(window)){ glint windowwidth, windowheight; glfwgetwindowsize(window, &windowwidth, &windowheight); glmatrixmode(gl_projection); glloadidentity()...

pointers - What is the difference between float* and float[n] in C/C++ -

this question has answer here: is array name pointer? 10 answers what difference between using float* f; and float f[4]; or treated exact same way? using 1 on other potentially cause run memory allocation issues? if not, there situations treated differently? don't know if relevant, i'm using type float* function argument. example: void myfun(float* f){ f[0] = 0; f[1] = 1; f[2] = 2; f[3] = 3; } which compiles , runs fine (i'm not sure why - think since didn't allocate memory f throw kind of exception). float f[4] is array allocated automatic storage (typically stack) float* f; is pointer, has no allocation other size of pointer. can point single floating point value, or array of floats allocated either automatic or dynamic storage (heap) an unallocated pointer typically points random memory, if pass m...

python - Text parsing - date recogniser -

does know if there's python text parser recognises embedded dates? instance, given sentence "bla bla bla bla 12 jan 14 bla bla bla 01/04/15 bla bla bla" the parser pick out 2 date occurrences. know of java tools, there python ones? ntlk overkill? thanks here attempt nondeterministically (read: exhaustively) solve problem of finding dates in tokenized text. enumerates ways of partitioning sentence (as list of tokens), partition size minps maxps . each partitioning run parser, outputs list of parsed dates, , token range parsed. each parser output scored sum of token ranges squared (so prefer date parsed 4 tokens rather 2 dates parsed 2 tokens each). finally, find , outputs parse best score. the 3 building blocks of algorithm: from dateutil.parser import parse parsedate def partition(lst, minps, maxps, i=0): if lst == []: yield [] else: try: l in range(minps, maxps+1): if l > len(lst): ...

html - Z-index doesn't work in chrome but does in firefox -

i've been trying fix while don't seem able to. * { margin: 0; padding: 0; } ul.tabs { position: relative; list-style-type: none; margin-left: 30px; } ul.tabs li { position: relative; display: inline-block; z-index: -1; color: #06e; -webkit-border-radius: 5px 5px 0 0; border-radius: 5px 5px 0 0; padding: 0.4em 1em 0.4em 1em; margin-right: 5px; border: 1px solid #aaa; border-bottom: 1px solid #fff; } ul.tabs li.active { position: relative; z-index: 2; } .content { z-index: 1; position: relative; margin-top: -1px; -webkit-border-radius: 5px; border-radius: 5px; padding: 10px; border: 1px solid #aaa; } <ul class="tabs"> <a href="#"> <li class="active">-</li> </a> <a href="#"> <li>+</li> </a> </ul> <div class="content"> text </div> in firefox has wanted behavior (the active (-) tab b...

java - how to declare local variable in mysql -

declare my_variable varchar(250) set my_variable= select quote( lower(substring_index (doctype, ' ', 1))) dms_report limit 1 ; select my_variable; i trying run query getting error on declare , when execute query not getting results while select quote( lower(substring_index (doctype, ' ', 1))) query returning value unable store in my_variable please me doing wrong how declare variable please suggest me you need parentheses around subquery: declare my_variable varchar(250); set my_variable = (select quote(lower(substring_index(doctype, ' ', 1))) dms_report limit 1); select my_variable; the declare looks okay, assuming code inside programming block. edit: if code not inside programming block (such stored procedure), do: select @var := quote(lower(substring_index(doctype, ' ', 1))) dms_report limit 1; select @var;

php - Access Denied after applying Magento SUPEE 6285 -

i applied magento patch supee-6285 , having permissions issues non-admin users. sections of admin accessible limited users no longer accessible. if @ role resources role see section enabled and, when logged role see menu option, if pick access denied. 3 extensions know of far giving me trouble are commerce themes - guess registered customer they add "manage guest reg" under "customers" menu adjustware - abandoned cart alerts they add menu items under newsletter adjustware - review reminders they add menu items under newsletter i'm sure there other extensions similar problems, , it's due how implemented admin pages, haven't been able figure out yet. have fix? update tried changing how router defined, didn't help. was: <admin> <routers> <guesttoreg> <use>admin</use> <args> <module>commercethemes_guesttoreg</module> ...

Can you step through python code to help debug issues? -

in java/c# can step through code trace might going wrong, , ide's make process user friendly. can trace through python code in similiar fashion? yes! there's python debugger called pdb doing that! you can launch python program through pdb using pdb myscript.py or python -m pdb myscript.py . there few commands can issue, documented on pdb page. some useful ones remember are: b : set breakpoint c : continue debugging until hit breakpoint s : step through code n : go next line of code l : list source code current file (default: 11 lines including line being executed) u : navigate stack frame d : navigate down stack frame p : print value of expression in current context if don't want use command line debugger, ides pydev have gui debugger.

gulp - Can browser sync overwrite CSS file hosted on CDN on injection? -

i not sure how frame question in post title, here's full story: i'm working on shopify theme , bit annoyed fact have save css changes, switch browser tab , hit reload see i've done (yes did discover theme gem detects local changes , uploads them, doesn't give me reloading...). so plan come gulp task following: detects changes scss files compiled them css injects changes using browser sync proxies shopify theme url localhost address the trouble i'm facing shopify uploads changed assets instantly cdn , loads them there when previewing theme. since css included different domain, guess browser sync doesn't recognize file anymore , 1 overwrite changes inject. so remaining question following: if theme preview url proxied local address http://localhost:3000 loads css file https://cdn.shopify.com/s/files/1/0878/7368/t/2/assets/style.css?12713062062911383123 , can tell browser sync in gulp overwrite file changes inject? hope i'm making sense he...

python - How do I stop PIL from swapping height/width when rotating an image 90°? -

i using pil rotate image. works in general, except when rotate image 90° or 270°, in case x , y measurements swap. is, given image: >>> img.size (93, 64) if rotate 89° this: >>> img.rotate(89).size (93, 64) and 91° this: >>> img.rotate(91).size (93, 64) but if rotate either 90° or 270°, find height , width swapped: >>> img.rotate(90).size (64, 93) >>> img.rotate(270).size (64, 93) what's correct way prevent this? i'm hoping comes more graceful solution, seems work now: img = image.open('myimage.pbm') frames = [] angle in range(0, 365, 5): # rotate image expand=true, makes canvas # large enough contain entire rotated image. x = img.rotate(angle, expand=true) # crop rotated image size of original image x = x.crop(box=(x.size[0]/2 - img.size[0]/2, x.size[1]/2 - img.size[1]/2, x.size[0]/2 + img.size[0]/2, x.size[1]/2 + img.size[1]...

rust - How to easily copy a non-mut &[u8] into to a &mut [u8] -

i want manipulations on &mut [u8]. in testing code have: #[test] fn test_swap_bytes() { let input: &[u8] = b"abcdef"; let result: &mut[u8] = ?; do_something(result); assert_eq!(b"fedcba", result); } how can mutable u8 slice in case? should put on place of question mark? you can use fact binary literal knows size @ compile-time. therefor can dereference , store on stack. let binding can mutable let binding. let mut input: [u8; 6] = *b"abcdef"; see playpen working example note there's no reason specify type, showed clarity.

java - JPQL query in Spring data jpa -

lets have : class range { public long start; public long end; } this jpa entity: @entity @table(name="entry") public class entry { @id long id; @onetomany set<individual> individuals; } another jpa entity: @entity @table(name="individual") public class individual { @id long id; long code; @manytoone entry entry; } and controller: public class indexedentrycontroller { entitymanagerfactory emf; list<entry> find(list<range> lst) { string str = ""; for(range r:lst) { if(!str.isempty) { str += " or "; } str += "(i.code between " + r.start + " , " + r.end + ")"; } string query = "select i.entry individual " + str + " group i.entry having count(i) > " + lst.size()-1; entitymanager em = emf.createentitymanager(); return em.createquery(query).getresultlist(); } } this query returns ...

angularjs - $http.post resulting in OPTIONS 596 error or insufficient arguments -

i trying make $http.post call api endpoint ( http://developer.zoopla.com/docs/read/arrange_appraisals ) getting options error. tried pass url directly params ones in request, tried passing object second parameter. have created plunker here ( http://plnkr.co/edit/0w1egx30decnwhc8odso?p=preview ), please advise correct approach , causing error. angular.module('someapp',[]) .controller('somectrl',function($scope,$http){ $scope.data = { branchid : 49953, propertyid : 5646166, custname : 'joe', custemail : 'joe123@gmail.com', custnumber : '07978765543', custnumbertype : 'mobile', custtime : 'anytime', custmessage : 'some random message', custenquirytype : 'arrange_valuation', ...

Processing Java: Align text and ellipse -

i trying align string of text , ellipse vertically in processing . although both textalign , ellipsemode set center , there still slight offset between text , ellipse. void setup() { size(200, 200); background(255); textalign(center); ellipsemode(center); nostroke(); smooth(); fill(0); text("document 1.txt", 60, 20); fill(255, 0, 0); ellipse(120, 20, 10, 10); } instead of textalign(center) , specifies horizontal alignment, used textalign(center, center) , guarantees text aligned both horizontally, , vertically.

SAS calulations with multiple observations -

i'm trying compute value across observations. data like id land decile distance 1 85 1 1.5 1 85 2 3.4 . . 1 85 9 13.2 2 76 1 0.9 2 76 2 2.7 i'm trying calculate each id ten deciles, (decile10 - decile(i+1))/(decile10 - decile1) , ith decile. i'm not worried decile 10. help! been struggling day. simple way multiple things on dataset: merge. here merge 10th decile onto 10 deciles, , use retain keep 1st decile value. there other approaches work if sorting difficulty, simplest if data aren't insanely large. proc sort data=have; id decile; run; data merged; merge have have(where=(decile=10) rename=(distance=distance_10 decile=decile10) keep=id decile distance); id; retain distance_1; if first.id distance_1=distance; *assuming sorted id decile; ... calculations, using distance_1 , distance_10 ... run;

multithreading - How to create a scheduled long running process using windows service in c# -

i want create windows service performs long , heavy work. code inside onstart method this: protected override void onstart(string[] args) { system.io.file.writealltext( @"c:\mms\logs\winservicelogs.txt", datetime.now + "\t mms service started." ); this.requestadditionaltime(5*60*1000); this.runservice(); } this.runservice() sends request wcf service library hosted on iis. long processes, ranging 1-20 min, depending on data has process. service i'm writing supposed scheduled run every day in morning. far, runs , works fine, when time goes on few seconds or min, generates timeout exception. causes windows service in unstable state, , can't stop or uninstall without restarting computer. since, i'm trying create automated system, issue. i did this.requestadditionaltime() , i'm not sure whether it's doing it's supposed or not. don't timeout error message, don't know how schedule runs ...

jquery - DataTables search on specific columns -

i have adapted following webpage needs , added bit of code has select2 dropdown menus instead of regular select menus (which lot better). have not been able figure out how adapt code can use on specific columns instead of on every column. guidance appreciated. http://datatables.net/examples/api/multi_filter_select.html (code adapted) initcomplete: function () { this.api().columns().every( function () { var column = this; var select = $("<select class='searchs2'><option value=''></option></select>") .appendto( $(column.header()).append() ) .on( 'change', function () { var val = $.fn.datatable.util.escaperegex( $(this).val() ); column .search( val ? '^'+val+'$' : '', true, false ) .draw(); ...

polymorphism without classes in C# -

i new object-oriented programming. problem when define method in class, can use method in way: myobj.mymethod(params); but don't want method member of class, still polymorphic function. mean, want "free" function different things based on parameters. example: mymethod(myobjoftype1, intvar); // works ints mymethod(myobjoftype2, stringvar); // different function works strings is possible in c#? to make 'independent method' not possible in c# since there class or member of class. to problem recommend using static class have static methods. usage: classname.methodname(); all methods different parameters should implemented inside class (method overloading). but if doesn't suit you, should have @ generic methods (but in case need create @ least 1 class).

adobe - Activatingtags for dispatcher -

i have imported package /etc/tags data in author instance clicked on replicate tags. tags got replicated publish instance not on dispatcher. is caching issue? how same tag values on dispatcher. it seems have wrong understanding of dispatcher - it's used caching static content (like html, js, css) , load balancing. on other hand - tags entities in repository, , not served end users aem, can not cached.

How to search a particular word in Oracle table CLOB column that contain a sql statements -

in sample data search rows contain word "100" , "col_2" based on sample data rows correct rows col1 values 1,4 , 7 note: sql_stmt clob column create table tab1 (col1 number, sql_stmt clob); insert tab1(col1, sql_stmt) values(1, 'select col1 tab1 col_2=100'); insert tab1(col1, sql_stmt) values(2, 'select col1 tab1 col_2=1000'); insert tab1(col1, sql_stmt) values(3, 'select col1 tab1 col_3=100'); insert tab1(col1, sql_stmt) values(4, 'select col1 tab1 col_2 = 100'); insert tab1(col1, sql_stmt) values(5, 'select col1 tab1 col_2 = 1000'); insert tab1(col1, sql_stmt) values(6, 'select col1 tab1 col_3 = 100'); insert tab1(col1, sql_stmt) values(7, 'select col1 tab1 tab1.col_2 = 100'); insert tab1(col1, sql_stmt) values(8, 'select col1 tab1 tab1.col_2 = 1000'); insert tab1(col1, sql_stmt) values(9, 'select col1 tab1 tab1.col_3 = 100'); commit; you can use query. select * tab1 ...

java - Changing the location of eclipse folder -

hey working on android application.my eclipse folder in c drive there no more space in c drive. want change location of eclipse folder.how can it? changing location effect projects or not ?? in general, eclipse resilient parts being moved around, long parts maintain own integrity. there 2 major parts of eclipse need aware of , move. the first part eclipse installation - program. can move folder contains entirety of eclipse drive, , eclipse run did before. the second part workspace - contains information such preferences, projects (by default). folder, location of chose when first opened eclipse, , may ask each time opens. can move whole folder drive. eclipse, when starting, ask location of workspace, , can enter new location of workspace. so, clarify in terms of steps: move folder containing eclipse new drive. move workspace folder new drive. open eclipse. when prompted, instruct eclipse open workspace in new location.

custom login in yii2 framework -

i new yii 2.0 framework,i went through many articles on how user can login using credentials database , not in array, couldn't understand how works, every time execute errors. yii framework 2.0 login user database , link custom login in yii 2.0 framework solved above question :)

python - Match second number that follows a given pattern -

i have strings of kind hello 45 blabla 12 100 code 45 13 093bb i'd match second number follows keyword code (with python). in example "13" should returned. here solution found s = "hello 45 blabla 12 100 code 45 13 093bb " re.search("code \d+ \d+",s).group(0).split(" ")[-1] # '13' it works there better solutions. have tried using lookbehind run issue python doesn't tolerate lookbehind of underfined length (and don't know number of digits in first number follows code ). tried that re.search("(?<=code \d+)\d+",s).group(0) # raise error, v # invalid expression # sre_constants.error: look-behind requires fixed-width pattern you skip re together >>> = s.split() >>> a[a.index('code') + 2] '13'

visual studio - CListCtrl mouse events not working -

i have clistctrl in cdialog. , of events not getting called clistctrl. example onmousemove no getting called when mouse pointer on clistctrl works if mouse pointer on window or editcontrol etc. note: clistctrl set report view. can explain behavior? i have suffered similar symptoms, (reported in question "mfc clistctrl not appear after minimise-restore" under name). found did, many messages not appear think should, not @ all. , others have found same thing. solved creating own class inheriting clistctrl , overriding onnotify(...). found received messages, trapped ones wanted , revised behaviour suit in own class. (i preventing resizing of column widths.) no other code needed in case. bool ccompilationlistctrl::onnotify(wparam wparam, lparam lparam, lresult* presult) { hd_notify *phdn = (hd_notify*)lparam; { if(phdn->hdr.code == hdn_begintrackw || phdn->hdr.code == hdn_begintracka) { *presult = true; retu...

vb.net - A good way to loop and sort on several criteria -

i working on project have medium sized list (with anywhere between 10 , 30 items) iterating through. there large list of criteria used sort list. in simple terms, have 5 categories, each of 2 counters tick based off status of item. simple me do, either switch / case or more basic if / elseif . makes problem more difficult, , in opinion worthy of outside input, each item has date attached it, , 3 items per month should counted. my approach set counter each month, , start ignore items fall within month, sure there smarter , fancier way , additional experience wonderful insight. here code show doing now: for each item in list if item.category = category1 if item.status = status1 category1status1 = +1 else category1status2 = +1 end if elseif item.category = category2 if item.status = status1 category2status1 = +1 else category2status2 = +1 end if elseif item.category...

c# - Using threads to parse multiple Html pages faster -

here's i'm trying do: get 1 html page url contains multiple links inside visit each link extract data visited link , create object using it so far did simple , slow way: public list<link> searchlinks(string name) { list<link> foundlinks = new list<link>(); // gethtmldocument() returns htmldocument using input url. htmldocument doc = gethtmldocument(au_search_url + fixspaces(name)); var link_list = doc.documentnode.selectnodes(@"/html/body/div[@id='parent-container']/div[@id='main-content']/ol[@id='searchresult']/li/h2/a"); foreach (var link in link_list) { // todo threads // getobject() creates object using data gathered foundlinks.add(getobject(link.innertext, link.attributes["href"].value, getlatestepisode(link.attributes["href"].value))); } return foundlinks; } to make faster/effic...

c# - Unit testing extension methods, had a go, is this right, or gone around the houses? -

i have poco library , have entities implement interface called ientitydelete. interface simple, looks this public interface ientitydelete { bool isdeleted { get; set; } } so have entity implements interface, again simple, looks this public class myentity() : ientitydelete { public bool isdeleted { get; set; } } i have extension method, created like public static void markasdeleted(this ientitydelete entity) { entity.isdeleted = true; } then needed check if method being called within 1 of service methods in unit tests. service method basic, looks this. public task<int> deletebyflagasync(myentity entity) { entity.markasdeleted(); return _context.savechangesasync(); } apparently cannot test extension methods easily, without using microsofts moles framework, not want dependency. i did googl'ing , found 2 articles on this, , how it, , know if correct, or whether have done stupid. two articles found where http://adventuresdotnet...

casting - Newbie "Cast To" Object in UE4 -

i have blueprint spawning zombies parameter 'numofzombies". in zombie's blueprint when health = 0 want -1 numofzombies. i use cast bp_spawnpoint numofzombies parameter don't know set object. when cast character attach "get player character" reffering other blueprints seems me bit confusing. you have set object might spawnpoint. when use 'cast something' node want check whether object of type want. so, if want keep numofzombies parameter have create in zombie blueprint variable of type of class "bp_spawnpoint". keep variable , cast bp_spawnpoint, , parameter.

Font type used zStartUp Theme from zerotheme.com -

im thinking of using zstartup theme zerotheme.com cant identify font type being used? http://www.zerotheme.com/484/zstartup-free-responsive-html5-theme.html anyone know? try bilbo rob - https://www.myfonts.com/fonts/typesetit/bilbo/regular/ or maybe ld grandpa - https://www.myfonts.com/fonts/lettering-delights/ld-grandpa/regular/ these similar not exact matches. try them out.

database administration - how to schedule a job on Oracle SQL developer to execute shell command "Java -Jar /Home/JavaFile.jar" each one minute? -

i create oracle job runs every 1 minute run command java -jar /home/file_name.jar" , using oracle sql developer on windows environment connect oracle db on linux environment. step 1 need first load java program in oracle can run on jvm installed in oracle database... ref link http://docs.oracle.com/cd/b19306_01/java.102/b14187/chthree.htm step 2 need create function or procedure run java program say create or replace function helloworld return varchar2 language java name 'hello.world () return java.lang.string'; step 3 need create job or scheduler in oracle run oracle function internally call java method. follow link create job http://docs.oracle.com/cd/e11882_01/server.112/e25494/scheduse.htm#admin12381