Posts

Showing posts from August, 2014

c# - Running windows form using backgroundworker -

i've issue runing windows forms under background worker. private void workerdecrypter_dowork(object sender, doworkeventargs e) { route =(string) e.argument; try { application.run(new mono(route)); } catch (exception era) { } } mono windows form class, creates new window in decrypt text, when finish process, automatically close window. if there not try catch, exception an exception of type 'system.reflection.targetinvocationexception' occurred in mscorlib.dll not handled in user code additional information: exception has been thrown target of invocation. you should call application.run on main thread, not in thread. cause tia. as side note: if not main form, there no need open form in way. can do: mono m = new mono(route); m.show(); if not form, should instance of applicationcontext , don't think seeing code.

error line 86 for stored procedure -

i trying stored procedure work. have been working month straight, till 3 last night, , approaching burnout. want work have ad campaign spent hundreds on sending traffic to. use [redhotkitties2005db] go set ansi_nulls on go set quoted_identifier on go alter procedure [dbo].[proc_rhkprod_lock_items_for_paypal] @cfuseridid bigint ,@transaction_guid uniqueidentifier = null begin set nocount on; declare @tblcartid bigint ,@cfuserid bigint ,@tblproductsid bigint ,@quantity bigint ,@localinventoryid varchar(100) ,@taxologykey bigint ,@name varchar(1000) ,@shortdescription varchar(8000) ,@productdescription varchar(8000) ,@uorlorul varchar(2) ,@unitprice money ,@shippingweight numeric(6, 2) ,@oversize tinyint ,@smallpic1 nvarcha...

php sql, assign variable to each row of an array -

i have mysqli_query pulls 3 columns , 10 rows table. assign variable each row of query. 10 seperate querys , assign each variable, assumed frowned upon. (note: connection info in seperate file , not shown here). <?php $playoffseedings = mysqli_query($con, "select playoffseed, ttname, ttsuid standings ttsuid = $season_view , playoffseed > 0 order playoffseed limit 10"); $seedings = array($playoffseedings); foreach($seedings $ps){ $num_rows = 1; while($row = mysqli_fetch_array($ps)){ $num_rows++; echo $row['playoffseed'].$row['ttname']; echo "<br>"; }} ?> the foreach used above works fine , returns 10 rows of data queried. that's cool. need able display different rows in different places on page. thou...

javascript - Resizable Google Visualization inside JQuery Accordion -

inside of jquery resizable div have jquery accordion widget. inside of each accordion element table centered in accordion div setting width: 100%; margin: 0 auto; . in each table td element has google visualization column chart. when resize event triggered i'd google visualizations redraw dimensions of charts fit new container sizes. problem i'm having chart redrawn proper dimensions 1 in visible accordion div. i'm assuming when div element set display=none container dimensions ignored in resize event. if true have suggestions work around this? i should add width of visualization set '100%' not pixel number. thanks you may need set explicity dimensions in in chart.draw() call since you're drawing chart on hidden element. options variable set to: var options = {'width':400, 'height':300}; //substitute desired dimensions chart.draw(data, options); adjust accordingly if you're using 1 of other googl...

Jackrabbit Oracle Integration Issue -

i trying configure jackrabbit 2.6.3 use oracle 11g. when try login repository error. here code repositoryrepository = new transientrepository(new file(repositoryxml)); try { session = repository.login(credentials()); } catch(exception e){ e.printstacktrace(); } here error get. javax.jcr.repositoryexception: file system initialization failure. @ org.apache.jackrabbit.core.config.repositoryconfigurationparser$6.getfilesystem(repositoryconfigurationparser.java:1168) @ org.apache.jackrabbit.core.config.repositoryconfig.getfilesystem(repositoryconfig.java:916) @ org.apache.jackrabbit.core.repositoryimpl.<init>(repositoryimpl.java:262) @ org.apache.jackrabbit.core.repositoryimpl.create(repositoryimpl.java:589) @ org.apache.jackrabbit.core.transientrepository$2.getrepository(transientrepository.java:232) @ org.apache.jackrabbit.core.transientrepository.startrepository(transientrepository.java:280) @ org.apache.jackrabbit.core.transientre...

Reload .Renviron or .Rprofile from an active R session (without restarting R)? -

when r starts (with default options), loads .rprofile , .renviron files in working directory or user's home directory. in case these files may changed during course of r session (e.g. packrat does). wondering if there way ask r refresh .renviron having quit , restart r? for instance, in case of .rprofile , sufficient source(".rprofile") reload .rprofile working directory. can similar managed .renviron ? use readrenviron reference: http://stat.ethz.ch/r-manual/r-devel/library/base/html/readrenviron.html yes remember getting stuck on sys.getenv while ago. , question, reminded me packrat. going use distribute code manuscript.

php - assignment shifts work with forecast curve -

i need assign work shifts follow forecast curve. example. this forecast curve: 08:00 08:15 08:30 08:45 09:00 09:15 09:30 09:45 10:00 .....17:00 6(persons) 6 6 7 7 8 12 16 14 10 and have shift preconfigured. example: 08:00 12:00,08:15 12:15,08:30 12:30,08:45 12:45,09:00 13:00.... 16:00 20:00, 16:15 20:15... each person has shift. example: carl 08:00 12:00 rich 08:30 12:30 jason 09:45 13:45 louis 10:00 14:00 but assigned @ random. so, i'd curve, says there 6 people, must obligatorily 6 people, @ 08:00, 6 people turn starts 08:00. then situation become (suppose 6 people start @ 08:00 12:00): 08:00 08:15 08:30 08:45 09:00 09:15 09:30 09:45 10:00 .....12:00 13:00 6(persons) 6 6 7 7 8 12 16 14 10 10 6 6 6 6 6 6 6 6 6 6 0 now comes request. i script in php assign random shifts, following curve , changing situation in...

virtual machine - Virtualization of iOS -

i interested in analyzing network traffic utilized app found on app store. could use wireshark analyze traffic on network, easy. instead, rather run app on virtualized instance of ios. is possible run ios in virtual machine on os x? my initial search shows may difficult because lot of virtualization software designed x86 architecture, , ios runs on arm architecture. has gotten work before? as said, cannot run regular appstore apps on simulator. instead, use jailbroken idevice, install cydia tools tcpdump, sslkillswitch monitor phone device traffic. other tricks can find on ios app analysis website good luck!

Delete duplicated element from an mutidimension array - PHP -

i have 2 arrays , $my_array . , there duplicated arrays ['mot clé'] diffrent position here's $my_array : array ( [0] => array ( [position] => 0 [moteur] => bing.com france - (tout afficher) [mot clé] => bts esf 24 [site] => http://www.test.com [page positionnée] => pas de résultat [titre de la page] => [date] => 28/02/2014 ) [1] => array ( [position] => 0 [moteur] => bing.com france - (tout afficher) [mot clé] => bts esf 33 [site] => http://www.test.com [page positionnée] => pas de résultat [titre de la page] => [date] => 28/02/2014 ) [2] => array ( [position] => 1 [moteur] => bing.com france - (tout afficher) [mot clé] => bts esf 33 [site] => http://www.test.com [page positionnée] => pas de résultat [titre de la page] =...

mysql - Re-selecting from a table based on query results -

my sql knowledge basic , grateful advice. have table columns like: date, time, readings, .... comments1, comments2 what filter table show results when comments1 equal string, can achieve. tricky bit want find readings when time between 5 , 7 hours after times returned/identified initial query (comments1 = string"). there way , best strategy? thank you. you should store date , time in single column, otherwise midnight boundaries extremely difficult select across. example assumes "date" column datetime type stores timestamp. i believe you're looking for: with commenttime ( select top 1 date tblrecords comments1 = 'the comment find' ) select * tblrecords date >= dateadd(hour, 5, (select date commenttime)) , date < dateadd(hour, 7, (select date commenttime))

c# - how to update sucessfully db field? -

string diagnostic = txtdiagnostic.text; string sqlstr = "update consultasanimais set diagnostico='" + diagnostic + "' idconsultaanimal =" + idconsulta + " , idanimal=" + gridview2.datakeys[gridview2.selectedindex].value + ""; sqlcommand cmd = new sqlcommand(sqlstr, lbd.sqlcnn); lbd.sqlcnn.open(); sqldatareader dados = cmd.executereader(); dados.close(); lbd.sqlcnn.close(); this code should updating diagnostico field on consultasanimais entity. no errors nor database data changes use executenonquery() insert , update , delete queries: int numofrowseffected = cmd.executenonquery();

javascript - One script causes another to stop working -

Image
i have problem vertical scroll page i'm using (intending to, is) 2 nested quickscroll functions. this how it's supposed look: - remove scrollbar in mind. i'm using overflow:scroll here manually check on things. since js isn't forte (i have basic knowledge of it), got piece of code worked similarly, reverse engineered removing as html , css until left bare function, , plugged own page in terms of needed html , css code. i'm not using proprietary , i'm including author links, hoping i'm on safe side there (?) so, main scroll vertical 1 , inside 1 of vertical sections i'm using 'reverse engineered' horizontal quickscroll code. the new (nested) script cancels out main one. ideas how fix this? the main (vertical scroll) following: <script> $(document).ready(function() { $('a.panel').click(function () { $('a.panel').removeclass('selected'); $(this).addclass('selected'); ...

Android Training: Capturing Photo example -

i'm quite new android have been working through examples on google's site - i'm on one: http://developer.android.com/training/camera/index.html this "simple" example on using camera function on android. there button calls intent. intent displayed below. private void dispatchtakepictureintent(int actioncode) { intent takepictureintent = new intent(mediastore.action_image_capture); switch(actioncode) { case action_take_photo_b: file f = null; try { f = setupphotofile(); mcurrentphotopath = f.getabsolutepath(); takepictureintent.putextra(mediastore.extra_output, uri.fromfile(f)); } catch (ioexception e) { e.printstacktrace(); f = null; mcurrentphotopath = null; } break; default: break; } // switch startactivityforresult(takepictureintent, actioncode); as can see above, intent putextra of key mediastor...

installation - Visual studio 2013 ultimate issue -

i've windows 7 ultimate 64-bit. possible install visual studio 2013 ultimate. right i'mm getting error "the version of visual studio requires newer version of windows". kindly reply possible.. log file

c# - 0x800a1391 - JavaScript runtime error: 'Edit_Button_Click' is undefined -

in c# script, make button when page loads. button b = new button(); b.onclientclick = "edit_button_click(sender,e);"; the 'edit_button_click(object sender, eventargs e)' function looks this... protected void edit_button_click(object sender, eventargs e) { button btnsomebutton = sender button; btnsomebutton.text = "i clicked!"; } but, when click button on web form, before code gets function, error says '0x800a1391 - javascript runtime error: 'edit_button_click' undefined'. confusing me because didn't expect javascript errors while writing scripts in c#. new designing webforms, correct me if i'm wrong, don't think should seeing related javascript since page language in c#. <script runat = "server> protected void page_load(object sender, eventargs e) { button b = new button(); b.text = "edit"; b.id = r.id + "edit button"; ...

Powershell - Delete subfolder(s) in folder with specific name(s) older than 30 days -

stackoverflow, trying come posh script specific task has me beating head against desk here. pretty new powershell, , need here. here trying accomplish: i need able search through drive specific folder called "30 day toss" , delete subfolder(s) inside of has creationdate of on 30 days old. example: p:\project\2014\3d1004\plan 1\30 day toss\archive1 p:\project\2014\3d1004\plan 2\30 day toss\04-12-2014 the archive1 folder above created 10 days ago , doesn't need deleted. 04-12-2014 folder above created on 30 days ago , needs deleted, along files/folders under it. the project, year, job number , plan number variable , change, hard coding search path isn't option. any assistance appricieated, thanks! ok, assuming folder structure same, , want 6th level of folder or subfolders of that, work: gci p:\ -directory -recurse | ?{$_.fullname -match ".:\\.+?\\.+?\\.+?\\.+?\\.+?\\" -and $_.creationtime -lt (get-date).adddays(-30)}|remove-item...

java - Getting Spring 4 dependency injection working with RESTeasy 3 validator -

i have been running lot of trouble trying custom bean validation constraints leverage spring's dependency injection. for example might define constraint: @constraint(validatedby = { customconstraintvalidator.class }) @documented @target({ elementtype.method, elementtype.field, elementtype.constructor, elementtype.parameter }) @retention(retentionpolicy.runtime) public @interface customconstraint { string message() default "custom.constraint.error"; class<?>[] groups() default {}; class<? extends payload>[] payload() default {}; } validator implementation @component public class customconstraint implements constraintvalidator<customconstraint, string> { @autowired private somespringbean somespringbean; @override public void initialize(customconstraint constraintannotation) { } @override public boolean isvalid(string value, constraintvalidatorcontext context) { if (value != null) { ...

r - Switch statement with readline and handling error messages of different class types based on user input -

i want ask user select of options 1 4 , use switch statement transfer flow accordingly. have followed this how use switch statement in r functions? interactive() num1 <-readline("select 1 of options") num <- noquote(num1) switch(num, 1={ cat('you have selected option 1') }, 2={ print('you have selected option 2') }, 3={ #option 3 print('you have selected option 3') }, 4={ #option 4 print('you have selected option 4') }, { print('dah make mind,look @ options again') } ) the thing not working when pass string or number readline switch. removed quotes , checked again still doesn't work. i saved file , running source("file_name.r") want build interactive environment, collect variables user , perform different tasks based on options selected user. how can make work?

android - Login try and Login has leaked window -

i have login activity. problem has been driving me crazy on 2 days. when insert correct username , password, login successful. when insert wrong username or password, app freezes. think have correct dialog dismiss according search on stackoverflow main leak in circumstances login activity package com.example.tranfer; import java.util.arraylist; import java.util.list; import org.apache.http.namevaluepair; import org.apache.http.message.basicnamevaluepair; import org.json.jsonexception; import org.json.jsonobject; import android.app.activity; import android.app.progressdialog; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; import android.widget.toast; public class login extends activity implements onclicklistener { private edittext user, pass; private button msubmit, mregister; privat...

forms - Set Order By Clause Dynamically for Procedure based data block -

is possible set order clause dynamically procedure based data block? i have tried adding button , in when_button_pressed trigger have used below did not work... set_block_property('xxfdf_dtl', default_where,v_where); set_block_property('xxfdf_dtl',order_by,'paperstock'); any inputs appreciated. thanks you have static sql , sort based on value of variable: select ... ... order decode(:val, 1, col1, 2, col2)

excel - Faster way to look up multiple columns of data than VLookup in VBA? -

i have large data processing spreadsheet looks component number , loads relevant columns array. using vlookup function, slow function use thousands of times in loop. my current code section: set drng = sheets(data).range("d2:as" & imax) on error resume next = 1 7 jmax = sheets(shtname(i)).usedrange.rows.count j = 3 jmax component= sheets(shtname(i)).cells(j, 1).value2 datavar(1) = application.vlookup(component, drng, 32, false) datavar(2) = application.vlookup(component, drng, 35, false) datavar(3) = application.vlookup(component, drng, 42, false) datavar(4) = application.vlookup(component, drng, 11, false) datavar(5) = application.vlookup(component, drng, 15, false) datavar(6) = application.vlookup(component, drng, 24, false) datavar(7) = application.vlookup(component, drng, 18, false) datavar(8) = application.vlookup(component, drng, 38, false) datavar(9) = app...

css - Firefox :before position absolute incorrect -

Image
this question has answer here: does firefox support position: relative on table elements? 9 answers [duplicate of firefox support position: relative on table elements?] i have unordered list vertical rules between list-items: html <ul class="list-inner-border"> <li><span></span></li> <li><span></span></li> <li><span></span></li> </ul> css .list-inner-border { height: 100px; } .list-inner-border li { display: table-cell; position: relative; // not having causes misbehaviour width: 1%; } .list-inner-border li + li:before { background-color: red; content: ''; height: 80%; left: 0; margin-top: 5%; position: absolute; top: 0; width: 1px; } span { background-color: gray; display: block; hei...

Javascript: Passing large objects or strings between function considered a bad practice -

is considered bad practice pass around large string or object (lets ajax response) between functions? beneficial in way save response in variable , keep reusing variable? so in code this: var response; $.post(url, function(resp){ response = resp; }) function dosomething() { // response here } vs $.post(url, function(resp){ dosomething(resp); }) function dosomething(resp) { // resp here } assume resp large object or string , can passed around between multiple functions. objects , strings in javascript passed reference. (technically value of reference, means reassigning = variable inside function won't affect variable outside function, that's besides point question.) that means not expensive pass them functions because no copy made. passed function pointer original object , efficient. you need realize first scheme not work properly: var response; $.post(url, function(resp){ response = resp; }) function dosomething() { // respo...

functional programming - Is there a way in Haskell to express a point free function to edit the property of a data type? -

i have type: data cons = cons {myprop :: string} and later on i'm mapping on list, setting property different value: fmap (\x -> x{myprop = ""}) mylist is there point free way express anonymous function? there isn't point free way of doing this, can instead use lens library (which comes whole basket of goodies): {-# language templatehaskell #-} import control.lens -- if put _ @ beginning of field name lens can derive methods data cons = cons { _myprop :: string } deriving (eq, show) -- derives myprop lens (works fields in record) makelenses ''cons -- can manually -- myprop :: functor f => (string -> f string) -> cons -> f cons -- myprop = lens _myprop (\c newprop -> c { _myprop = newprop }) -- lets define lenses type without depending on lens -- bigger deal might think. can support library , -- , paradigms without depending on @ all. main = let cs = map cons ["a", "b", "c"] ...

php - Use memcache for different domains (the same keys) on one server -

i have situation: have 2 sites on 1 server - , use same frameworks (based on codeigniter framework). , in code use memcache like $memcache = new memcache; $memcache->connect('localhost', 11211); $value = $memcache->set('max_id', 100500); and in case when change value on site1 have value site2, need different values different sites. off course can replace keys, adding site_url() so: $value = $memcache->set(base_url() . 'max_id', 100500); but maybe exist better solution ? i found solution: create new class, inherited memcache , use on sites class. class site_memcache extends memcache { private $_prefix = ''; public function __construct() { $this->_prefix = $_server['http_host']; } public function set($key, $var, $flag = null, $expire = null) { parent::set($this->_prefix . $key, $var, $flag, $expire); } public function get($key, &$flags = nul...

image - Incorrect CSS Button Height computing -

i created example showing current issue have styling button contains image: example (sorry, not allowed post images yet) the height of image ( img ) 32 pixels, height of surrounding button 34 pixels , height of surrounding div 36 pixels. where additional pixels come from?! want these buttons have height of 32 pixels , rid of space in between 2 buttons. not want set specific height buttons (e.g. 32px). should adapt size of content (image, text). index.html <!doctype html> <html > <head> <meta charset="utf-8"/> <style type="text/css"> div { border: 0; margin: 0; padding: 0; } button { border: 0; padding: 0; margin: 0; } </style> </head> <body> <div> <button><img src="img/site/buttons...

c++ - How to get path to current exe file on Linux? -

this question has answer here: c/c++ - executable path 5 answers the code below gives current path exe file on linux: #include <iostream> std::string getexepath() { char result[ path_max ]; ssize_t count = readlink( "/proc/self/exe", result, path_max ); return std::string( result, (count > 0) ? count : 0 ); } int main() { std::cout << getexepath() << std::endl; return 0; } the problem when run gives me current path exe , name of exe, e.g.: /home/.../test/main.exe i /home/.../test/ i know can parse it, there nicer way that? dirname function you're looking for. #include <libgen.h> ssize_t count = readlink("/proc/self/exe", result, path_max); const char *path; if (count != -1) { path = dirname(result); }

c - Couldn't find function prototypes in a static library on Xcode (linker issue with library) -

i met linker issues when using static libraries. suppose have 2 c files: example.c , main.c. have example.c generated static library using: gcc -c example.c ar -r libmylibrary.a example.o then, on xcode, add libmylibrary.a following target->build phases->link binary libraries, , library showing in project. specify header search path , library search path. seems that's it. when compile project, linker can find function declaration in relative example.h file, however, not find function prototypes defined in example.c file. why happening? have googled lot , checked many relative questions on stack overflow, nothing helps far... btw, if use command line this: gcc main.c -lmylibrary -l. -i. –o main work. want work on xcode, can debug conveniently. thanks in advance!

jquery - Executing Javascript scripts after pasting HTML code -

i'm doing experiments, , found when execute code on web pages : document.documentelement.innerhtml = document.documentelement.innerhtml; javascript scripts 'disabled'. here little script wrote re-execute scripts using jquery ( you'll need inject jquery on websites ( i'm using firebug + firequery )) : // disabling javascript scripts document.documentelement.innerhtml = document.documentelement.innerhtml; // saving scripts tags , parent var scripts = []; jquery('html').find('script').each(function(){ scripts.push([jquery(this),jquery(this).parent()]); }).remove(); // removing script tags // re-appending deleted script tags in right place (var in scripts) { scripts[i][1].append(scripts[i][0]); } so script works on of website tried, except 1 : google ( in firefox ) the thing i'm trying storing google html, , pasting iframe ( via firefox extension ). working except can't javascript scripts working ( no autocomplete, button...

c# - Word, VSTO, OpenXml - Inserting XML into Paragraph object -

i using following code inject xml (openxml) range of paragraph in word. problem error message stating "xml markup cannot inserted specified location" c# code: try { string oxml = ""; // contains xml listed below // first paragraph paragraph p = this.paragraphs[1]; object missing = type.missing; // insert openxml formatted xml paragraph range p.range.insertxml(oxml, ref missing); // causes exception } catch (exception ex) { //_logger.error("openxml injection", ex); } xml injected: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <?mso-application progid="word.document"?> <pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlpackage" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"> <w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingcanvas" xmlns:...

osx - Java App installer and launcher for both Mac and Win? -

i have large java app, many required .jar files. i'd build native launcher , installer it, run on both mac , win machines. looks can use launch4j create .exe file launcher on windows. (though wraps single .jar, others have available in path.) use izpack create runnable .jar file install .exe , relevant .jar files directory. how do same os/x? after more digging, , avoiding dead url's found, i've come with: a) use launch4j build .exe windows systems. b) use appbundler (from java.com) build app bundle os/x. izpack can used make installer either platform.

r - Is it possible to merge two time series in one? -

i've been trying merge 2 ts objects, second 1 starts 1 period after next one. example, take following 2 time series ts1<-ts(c(1:12),star=c(2014,1),freq=12) ts2<-ts(c(13:24),star=c(2015,1),freq=12) as can see, both of them match in order make single ts out of 2 ts objects. thought logical answer rbind() function. makes matrix out of them, follows... > rbind(ts1,ts2) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] ts1 1 2 3 4 5 6 7 8 9 10 11 12 ts2 13 14 15 16 17 18 19 20 21 22 23 24 i've tried without success other functions merge,cbind. using c() i've managed 1 timeseries, main problema lose structure attributes of original timeseries, bad because i'm trying use function forecast new ts gives me this: error: variables ... specified different types fit i happy being able add additional observations time series. adding value 13 ts1 january,2015 haven´t found how eit...