Posts

Showing posts from February, 2011

javascript - Explanation of jQuery animated bubbles script variables -

ischluff provided awesome solution previous question adjusting speed , position of jquery bubbles. now need understanding each variable in script doing. bubbles contain quotes, i'm trying slow them down enough give people time read them. i've managed slow them down adjusting vertspeed , horispeed . however, i've tried adjusting window.settimeout(callback, 1000 / 60) , omega: 2*math.pi* horispeed/(width*60), //omega= 2pi*frequency random: (math.random()/2+0.5) * * 10000, //random time offset , cannot figure out how increase time between each bubble being generated. is section below can slow down rate @ bubbles generated? calling whole function , setting interval time? if so, shouldn't decreasing denominator in settimeout slow down bubble generation? window.requestanimationframe = (function(){ return window.requestanimationframe || window.webkitrequestanimationframe || window.mozrequestanimationframe || function( callback ){ wind

php - ZF2 how to use View Helper for JsonModel Ajax Call -

i use zend framework 2. data server ajax , how can return formatted data json. (for example multi currency format in .phtml file $this->currencyformat(1234.56, "try", "tr_tr")) cannot use view helper action. my code this. (mycontroller.php) <?php class mycontroller extends abstractactioncontroller { public function myaction(){ $data = array(); //i want format data multi currency format. us,fr,tr etc.. $data['amount'] = '100'; return new jsonmodel(data); } } yargicx, asking question. caused me learn new feature of php (5.3). here code returns answer original question: formatted currency in json. may little weird if aren't familiar invokable classes, i'll explain how works. use zend\i18n\view\helper\currencyformat; use zend\view\model\jsonmodel; class mycontroller extends abstractactioncontroller { public function myaction() { $data = array(); //i wa

c++ - Filling structure from a file -

hey guys doing project @ school , need fill array of pointers info text doc: 4101 braeburn_reg 1 0.99 101.5 4021 delicious_gdn_reg 1 0.89 94.2 4020 delicious_gldn_lg 1 1.09 84.2 4015 delicious_red_reg 1 1.19 75.3 4016 delicious_red_lg 1 1.29 45.6 4167 delicious_red_sm 1 0.89 35.4 4124 empire 1 1.14 145.2 4129 fuji_reg 1 1.05 154.5 4131 fuji_x-lge 1 1.25 164.1 4135 gala_lge 1 1.35 187.7 4133 gala_reg 1 1.45 145.2 4139 granny_smith_reg 1 1.39 198.2 4017 granny_smith_lge 1 1.49 176.5 3115 peaches 1 2.09 145.5 4011 bananas 1 0.49 123.2 4383 minneolas 1 0.79 187.3 3144 tangerines 1 1.19 135.5 4028 strawberries_pint 0 0.99 104 4252 strawberries_half_case 0 3.99 53 4249 strawberries_full_case 0 7.49 67 94011 organic_bananas 1 0.99 56.3 so have take put in struct. here function doing so: bool readinventory(string filename) { inputfile.open(filename); //opening products file bool errors = true; if(!inputfile.fail()) // validate file did open { while (!filename)

c# - Converting Flat data to hierarchical -

Image
i getting flat data in c# application list. sample data google drive spreadsheet i want data converted hierarchical structure. have created json representation of same here the final structure expecting here i have created data list in c#. want list converted c# collection object. please give me pointers on easiest way so. [this console application code] using system; using system.collections.generic; using system.linq; using system.text; namespace consoleapplication1 { class program { public class marklist { public string student_name { set; get; } public string frequency { set; get; } public string major { set; get; } public string subject_category { set; get; } public string subject_subcategory { set; get; } public int spring_mark { set; get; } public int autumn_mark { set; get; } public int summer_mark { set; get; } public marklist() { } public marklist(string student_name,string frequency,strin

Android custom map marker, canvas drawing and image sizing -

Image
i'm trying create custom marker in image below, either outline or drop-shadow if possible. rectangle inside represents dynamic image. anyway, got basics down, can't figure out how change image's size, because can define top left offset point , rest of canvas gets filled image down bottom right edge, covering background. have no idea how create triangle pointing down, tried rotating canvas, drawing rectangle , rotating (see second code snippet), doesn't work because doesn't rotate around center. ideas? doing "properly"? right way build custom markers or slow / not optimal? //image marker - red background image on top latlng vogel3 = new latlng(mylat+0.0005,mylong+0.0005); bitmap.config conf = bitmap.config.argb_8888; bitmap bmp = bitmap.createbitmap(40, 40, conf); canvas canvas = new canvas(bmp); paint color = new paint(); color.setcolor(color.red); canvas.drawrect(0, 0, 40, 40, color); canvas.drawbitmap(bitm

durandal - How to create and use an Excel Web App with DurandalJS? -

Image
i'm trying add excel web app durandaljs website. basically, json object server, transform <table>...</table> tag excel web app can understand it. i'd able view table excel web app (resize columns, select, sort, filter, etc). to start off, i'm trying simplest solution possible - hardcoded ![<table />][1] : created new durandaljs project (using template on their website ) replaced content of welcome.html following code found on excelmashup.com : <a href="#" name="microsoftexcelbutton" data-xl-tabletitle="my title" data-xl-buttonstyle="standard" data-xl-filename="book1" data-xl-attribution="data provided company" ></a> <table> ... </table> <script type="text/javascript" src="https://r.office.microsoft.com/r/rlidexcelbutton?v=1&kip=1"></script> but durandal show table data, ignoring excel button. same thing happens w

c# - float doesn't register -

this question has answer here: division returns zero 6 answers example: output when debugging: bvar= 0.0 what missing? you dividing integers, not floats. use float bvarianza = (499f/ 500f); instead. your expression evaluated float x = (float) (int / int) . after integers have been divided (which results in 0 because integers don't have fractal part) result stored in variable of type float, adds .0 fractal part.

Small error in my program C Language -

so program not outputting proper value numdeposit or numcheck, outputs value of 0 both of these. think prime area of interest main function , bottom function can't see did wrong. #include <stdio.h> #include <stdlib.h> file *csis; file *fp; void outputheaders(); void initialbalance(double amount, double *balance, double *service, double *openbalance); void deposit(double amount, double *balance, double *service, int *numdeposit, double *amtdeposit); void check(double amount, double *balance, double *service, int *numcheck, double *amtcheck); void outputsummary(int numdeposit, double amtdeposit, int numcheck, double amtcheck, double openbalance, double service, double closebalance); int main(void) { char code; double amount, service, balance; double amtcheck, amtdeposit, openbalance, closebalance; int numcheck, numdeposit; if (!(fp = fopen("account.txt", "r"))) { printf("account.txt not opened input.&qu

java - How to Add Listener to cell in GXT Editable Grid -

i writing code editable grid using gxt.i created 1 column textfield editor below: column=new columnconfig(); column.setid("checkintime"); column.setheader("check in time"); column.setwidth(80); column.setmenudisabled(true); column.setsortable(false); final textfield<string> text = new textfield<string>(); column.seteditor(new celleditor(text)); configs.add(column); now need add listener cell of column validate value of cell , need reset value if validations fails.please suggest how this. i using gxt 2.2.3. update below imports import com.extjs.gxt.ui.client.widget.grid.columnconfig; import com.extjs.gxt.ui.client.widget.grid.columnmodel; import com.extjs.gxt.ui.client.widget.grid.editorgrid; import com.extjs.gxt.ui.client.widget.form.textfield; import com.extjs.gxt.ui.client.widget.grid.celleditor;

java - Web application using SpringMVC /JQuery -

i analyzing java web frameworks web application, web application communicate rmi retrieve data , render contents in gui(no major business processing needed rendering of data objects in presentation layer required), end application sending/receiving data rmi gui(maximum users of application may not greater 10-20). there can data 1 million entries in grid main requirement performance of application should good. other requirement user friendly , responsive gui. i have analyzed few frameworks spring mvc, gwt, vaadin , zk, have few advantages , disadvantages of it, after analysis have selected spring mvc+ j query web application framework have few queries in same is there constraint related performance using spring mvc? how difficult learn j query developers coming java desktop based application background? thanks in advance. is idea use framework spring core/spring mvc for business logic , gwt or zk presentation layer? deliver performance? spring mvc idea use web

windows - Cannot connect to Cygwin-based OpenSSH server with authorized_keys -

i have problem setting-up sshd service in windows 7 running cygwin. i've followed this tutorial , worked first time, after reboot public keys stored in ~/.ssh/authorized_keys won't allow me access machine external cli. in addition password authorization doesn't work, i've try reset password in cygwin using passwd testinguser . these steps i've made far: reinstall cygwin sshd service (i've removed other windows user accounts testinguser) re-run ssh-host-config again, mentioned in tutorial reset testinguser password cygwin console set privileges .authorized_keys & parent folder: chmod 700 ~/.ssh & chmod 600 ~/.ssh/authorized_keys disabled windows defender firewall , other av software (httpd works well) below result of ssh <host> -v command: debug1: remote protocol version 2.0, remote software version weonlydo 2.1.3 debug1: no match: weonlydo 2.1.3 debug1: enabling compatibility mode protocol 2.0 debug1: local version string ssh

How to upload files (.xls) using angularjs? -

how can upload files using angularjs? need upload .xls files need extension check , need read data , display in table before posting php server. angular client side framework file upload not going out of ordinary. @ dom level use html form file input field. the angular way write directive wraps upload form. angular isn't going give special saving file anywhere. implement in backend receive file being uploaded. such common requirement sure there example out there whatever language using. there couple of directives written. example, used this on recent project.

Asp.net css not working properly after publish -

Image
i have asp.net (.net 4.0) page, contains javascript, css , custom controls. when debug page, looks fine , working properly. after publishing, css don't work anymore. of them do. although same css file. i.e. have table-data ( <td> ) tags, have select-box in it. in debug, select-box visible (width of select: 85%) in published, select-box thin, because td doesn't have width , 85% of 0 is... not ;). also not able hide , unhide divs in page via javascript anymore. set display block or none, divs hidden always, while in debug work. i saw problems regarding including path of css , script files (with root or without root directory etc), tried didn't solve problem. another source said, because of compatibility mode .net 3.5, changed 4.0 , didn't solve problem, also. do have idea happen here? for example, header of table: in internetexplorer while debugging: and in internetexplorer after publishing: you can see there gap between <td> tags

c# - Converting between negative Hexadecimal and negative Decimal gives wrong results -

i attempting manually convert numbers between decimal , hexadecimal. have working positive numbers , converting negative decimal 'negative' hexadecimal can't convert 'negative' hexadecimal negative decimal. here code attempting work with: private string hextodecimal(char[] toconvert) { if (negativevalue) { negativevalue = false; long var = convert.toint64(hextodecimal(resultlabel.text.tochararray())); long valuetohex = var - (long)math.pow(16, 15); return resultlabel.text = valuetohex.tostring(); } else { double total = 0; //convert hex decimal hexordecimallabel.text = "decimal"; //todo: create int array indivial int char[] chararray = toconvert; long[] numberarray = hexswitchfunction(chararray); //todo: reverse array array.reverse(numberarray);

python - Unexpected behaviour in pygtk Window resizing -

i writing code obtain size of physical screen , use dimensions resize window : #!/usr/bin/env python import gtk class gettingstarted: def __init__(self): window = gtk.window() width = gtk.gdk.screen.get_width()#line1 height = gtk.gdk.screen.get_height()#line2 window.resize(width,height)#line3 label = gtk.label("hello") window.add(label) window.connect("destroy", lambda q : gtk.main_quit()) window.show_all() gettingstarted() gtk.main() with line1,line2,line3 commented out of code, regular window "hello" displayed on screen. aforesaid lines included in code, calendar displayed reason! error thrown : traceback (most recent call last): file "gettingstarted.py", line 17, in <module> gettingstarted() file "gettingstarted.py", line 8, in __init__ width = gtk.gdk.screen.get_width() typeerror: descriptor 'get_width' of 'gtk.gdk.screen

parsing - Parse string containing dots in php -

i parse following string: $str = 'procedurescustomer.tipi_id=10&procedurescustomer.id=1'; parse_str($str,$f); i wish $f parsed into: array( 'procedurescustomer.tipi_id' => '10', 'procedurescustomer.id' => '1' ) actually, parse_str returns array( 'procedurescustomer_tipi_id' => '10', 'procedurescustomer_id' => '1' ) beside writing own function, know if there php function that? from php manual : dots , spaces in variable names converted underscores. example <input name="a.b" /> becomes $_request["a_b"] . so, not possible. parse_str() convert periods underscores. if can't avoid using periods in query variable names, have write custom function achieve this. the following function (taken this answer ) converts names of each key-value pair in query string corresponding hexadecimal form , par

javascript - Recognize letters using smartphone camera -

i develop web app can recognize text using smartphone camera. saw on web exist lot solution can recognize text in picture/stream video, solution need develop native app. want recognize text creating little site in can following stuff: register myself access smartphone camera recognize text in shot show letters recognized in label save letters in remote database associated account anyone knows way recognize letters without taking pic , without native app? on web found tesseract ocr , i'm not sure can use in html5, css3 , javascript page. used library? in mobile browser works (safari ios, browser android , internet explorer windows phone 7/8)? have tried this? it's javascript library ocrad

c++ - Compiling from Visual Studio 2012 to g++? -

i have c++ program compiled in visual studio 2012. contains boost library. now, want compile using g++ compiler. things must aware of? things silently break code in random places. for example assuming long 4 bytes buy g++ treats 8 bytes. alone need changes. and version of gcc use, 4.7.3, 4.6.4 or 4.8.2? some of things have keep in mind. list not comprehensive things on top of mind when read question. pragma once : when using g++, should gaurd file inclusion using #ifndef, #define , #endif guards. header inclusion : vs 2012 lenient , not make fuss of forward or backward slash while including headers. g++ strict in enforcing them. if using win32 threads / mutex, best shift std::thread. if using boost threads, ok. the version of gcc can use , away depends on usage of c++11 features. gcc ahead of microsoft in implementing c++11 features , should ok older version of gcc too. cannot answer question unless understand c++11 features using in code. safe more recent ve

java - Hibernate model OneToOne do not share entire object? -

i discovering jpa , hibernate , have question repository , model (using spring). i have object "structure" fields ( id , type example ) , lot of others objects related structure : example address. address in addressrepository : address findbystructureid(long structureid); but way found have object structure in object address. don't know if problem or not according memory because structure big object lot of subobjects address. in structure @onetoone(fetch = fetchtype.lazy, mappedby = "structure", cascade = cascadetype.all) private address address; in address @genericgenerator(name = "generator", strategy = "foreign", parameters = @parameter(name = "property", value = "structure")) @id @generatedvalue(generator = "generator") private long structureid; @onetoone(fetch = fetchtype.lazy) @primarykeyjoincolumn @jsonignore private structure structure; i have problem architecture. need keep "su

html - How to format a div id in a div class? -

<div class="content"> <div class ="imgs"> <a href="#"><img src="images" alt="some_text" width="250" height="210"></a> </div> <div class = "compu"> <div id="titulo">text</br></div> <div id="subtitle">text </div> </div> </div> how format text in titulo , subtitle ?? the css have compu : .compu { position: relative; width: 250px; font-family: helvetica, sans-serif; color: #1b57a0; letter-spacing:2px; line-height:120%; font-size: 12px; font-weight: normal; text-align: justify; } i don't know html , css, , first project, thank you you can give css style titulo , subtitle follow .compu #titulo { /*write style code here*/ } .compu #subtitle { /*write style code here*/ }

drupal 7 - what is the use of classes_array in drupal7 template.php -

in template.php many times used classes_array..am not getting meaning , why using,..what purpose of classes_array , when have use in drupal7 .tpl.php example code: if(in_array('administrator',array_values($variables['user']->roles))) { $variables['classes_array'][]="debug"; } $variables['classes_array'] used in preprocess functions. adds classes used in rendering element processed. in example, class named "debug" added html container of rendered element: if actual code function <your theme>_preprocess_html(&$variables) { if (in_array('administrator',array_values($variables['user']->roles))) { $variables['classes_array'][]="debug"; } } your theme output body tag like <body class='debug [...other classes...]'> for users administrator role. you can add classes nodes, or other kind of elements preprocess hook available.

java - How to determine info about WebLogic datasource from datasource connection? -

i have spring app running in weblogic. in dao, inherits base class method returns "javax.sql.datasource". inject datasource indirectly using "jee:jndi-lookup" in spring application context datasource jndi. when @ in debugger, appears "weblogic.jdbc.common.internal.rmidatasource". i'd figure out how can introspect datasource in code determine information database i'm connected to, particularly host, port, sid, , username. there way that? for background, have extensive diagnostics in app troubleshooting db connection , query issues. helpful if @ runtime, introspect information weblogic datasource database connection in use. as described, determined in debugger actual type was, , i've examined obvious properties in object casting or reflection opportunities, , don't see obvious indications of information "host", "port", or "sid". i think can use reflection , call getter methods of class. sho

android - Why does a task still exist after pressing the back button? -

the android docs say if user continues press back, each activity in stack popped off reveal previous one, until user returns home screen (or whichever activity running when task began). when activities removed stack, task no longer exists . well tried on galaxy s4 android 4.3, afterwards when hold home button show tasks task still there (tried settings app, app, internet app, own app). in way not exist? edit: i'm reading on tasks understand android system. have no specific app development problem.

java - Reading and saving the full HTML contents of a URL to a text file -

this question has answer here: how programmatically download webpage in java 8 answers requirement: to read html website " http://www.twitter.com ". print retrived html save text file on local machine . code: import java.net.*; import java.io.*; public class oddless { public static void main(string[] args) throws exception { url oracle = new url("http://www.fetagracollege.org"); bufferedreader in = new bufferedreader(new inputstreamreader(oracle.openstream())); outputstream os = new fileoutputstream("/users/rohan/new_sourcee.txt"); string inputline; while ((inputline = in.readline()) != null) system.out.println(inputline); in.close(); } } code above retrieves data, prints on console , saves text file retrieves half code (because of line spa

Discrete Cosine Transform in image processing -

given vector f , scalar s difference between dct(f) , dct(f+s) and between dct(f) , dct(f*s) adding scalar equivalent adding zero-frequency component signal transform, you'll having larger 0th index of dct -- 'peak' if want, of value s/k k constant depending bit on particular implementation. check out this wikibook link well.

java - Javafx select multiple rows -

i m trying select multiple rows in javafx dont want use keyboard (shift)for that.it should after click on selected , when click on other column should selected well. i check other answers here couldnt find short , handy.is there shorter way ? @fxml private static logger logger = logger.getlogger(mainframecontrol.class); public tableview<box> boxtable; protected final observablelist<box> boxdata = fxcollections.observablearraylist(); service service = new serviceimpl(); private stage mainstage; public mainframecontrol(stage mainstage) { fxmlloader fxmlloader = new fxmlloader(getclass().getresource("mainframe.fxml")); fxmlloader.setroot(this); fxmlloader.setcontroller(this); this.mainstage = mainstage; stage stage = new stage(); try { fxmlloader.load(); } catch (ioexception exception) { throw new runtimeexception(exception); } arraylist<box> list = service.findallboxen(); table

python - Custom Log File That Doesn't Grow Past a Given Size -

i need write output log file every time events in application triggered. right i'm doing in simplest way imagineable: with open('file.log', 'a+') file: file.write('some info') this works, problem don't want file grow indefinitely. want hard size cutoff of, 25 mb. don't want clear file when reaches size. instead, want function how believe other log files work, clearing oldest data top of file , appending new data end of file. approach achieving in python? note can't use python's logging library because celery application , (a) have logging set purposes unrelated , (b) celery , logging library not play @ all. import os statinfo = os.stat('somefile.txt') this return size of somefile.txt in bytes. can like: if statinfo.st_size > 25000000: you can implement want. read number of lines going replaced, delete , save reminder in temporary file, write data wish, , append temporary file. not effective, work.

Mass file renaming in Csh -

i'm trying rename files in directory in csh (i'm using freenas). i thought had hang of until accidentally prepended whole file name have files of format veronica mars - 1x22 leave beaver.mkv - hdtv 720p and them in format of veronica mars - 1x22 leave beaver - hdtv 720p.mkv i purely script can ssh in box , run without having install extra. the expedient way vidir, allows edit filenames in directory in text editor. can use vim's or emacs' column editing/search , replace. you can download vidir , , here's brief introduction . the caveat it's written in perl, not sure if freenas has available.

javascript - a href link clicked and div displays image -

Image
i javascript method display image in div depending on href link clicked. i have written code needs developing further. <script type=" "> function changeimg(){ var image1 = new image(); image1.src='car.png' var imghol = document.getelementbyid("imageholder"); var elements = document.getelementbyid("fs"); if(elements.onclick = function()){ imghol = image1; } </script> <div class="ads2"><h2>vehicle part</h2><p>please select part wish find; <div class="vertical_menu"> <ul> <li><a id="fs" href="#home" onclick="changeimg">front side</a></li> <li><a id="rs" href="#news">rear side</a></li> <li><a id="s" href="#contact">side</a></li> <li><a id="us"href="#about">under side</a&

javascript - Secure POST request from NodeJS to Node/Express hangs -

i'm using following send post data secure nodejs server: file: main.js var strdata = json.stringify({"data":"thisdata"}); var options = { host: '192.168.1.63', port: 3001, path: '/saveconfig', method: 'post', rejectunauthorized: false, requestcert: true, agent: false, headers: { 'content-type': 'application/x-www-form-urlencoded', 'content-length': buffer.bytelength(strdata) } }; var req = https.request(options, function(res) { console.log('status: ' + res.statuscode); console.log('headers: ' + json.stringify(res.headers)); res.setencoding('utf8'); res.on('data', function (chunk) { console.log('body: ' + chunk); }); }); console.log(req.write(strdata)); console.log(req.end()); req.o

php - How to pass a multiline directive to apache using the -c parameter? -

i'm trying start apache command line, passing directive using "-c" parameter : sudo httpd -c "<virtualhost *:80>\n</virtualhost>" but fails : httpd: syntax error in -c/-c directive: -c/-c directives:1: <virtualhost> not closed. i tried passing multiline string using php through exec/system, fails : <?php $directive = <<<eot <virtualhost *:80> </virtualhost> eot; exec("sudo httpd -c \"" . $directive . "\""); is possible ? yes possible ! -c / -c act 1 line in httpd.conf, can add many parameters lines : sudo httpd -c "<virtualhost *:80>" -c "</virtualhost>"

c++ - Fixed Allocator with stack - how to implement allocate and deallocate? -

i've started code fixedallocator class allocates memory chunks of fixed size , works stack, works in constant time allocate/deallocate. actually, i'll need class use std::vector, have implement std::allocator methods. everything here learning purposes - don't need complete implementations or headers - real ones have lot of code on problem. and got stuck on allocate/deallocate methods - understand should somehow reserve memory pool - example using vector, understand should use static_cast convert char type t-type, don't understand how rebuild 2 ideas list. deallocate takes pointer argument, not tnode - that's maybe main problem. if wrote kind of allocator - answer code perfect. suggestions, links , other source of knowledge welcome. thank you. here skeleton of code: template <typename t, unsigned int nodesize> class fixedallocator : public std::allocator<t>{ private: static size_t used; static const size_t max_size = 100000; struct

tfs - Reparenting a child branch to its grand-parent -

i have following branch structure: - main |- release 1 |- release 1.1 |- release 2 i want reparent release 1.1 main looks like - main |- release 1 |- release 1.1 |- release 2 the reason want because many changesets need merged main release 1.1 not release 1 i have been trying baseless merge main release 1.1 using following command: tf merge /recursive /baseless $/main $/releases/release1.1 it works great, once checked in, can reparent release 1.1 main. but thing is, command merges main , want create merge relationship. don't want merge main release 1.1 since many other changes other branches have occurred meanwhile. is there way achieve or future changesets need baseless merged every single time? to merely create relationship [and not merge everything] need perform baseless selective merge parent potential child branch passing selected changeset numbers. may achieved via gui following below steps mentioned in blogpost: http://ro

line - R from SpatialPointsDataFrame to SpatialLines -

Image
i'have spatialpointsdataframe load pst<-readogr("/data_spatial/coast/","points_coast") and spatiallines in output, have find somthing coord<-as.data.frame(coordinates(pst)) slo1<-line(coord) sli1<-lines(list(slo1),id="coastline") coastline <- spatiallines(list(sli1)) class(coastline) it seems work when try plot(coastline) , have line should not there ... some 1 can me ? the shapefile here ! i have looked @ shapefile. there id column, if plot data, seems id not ordered north-south or something. lines created because point order not perfect, connecting points next each other in table, far each other in terms of space. try figure out correct ordering of data calculating distances between points , ordering on distance. a workaround remove lines longer distance, e.g. 500 m.. first, find out distance between consecutive coordinates larger distance: breaks . take subset of coordinates between 2 breaks , lastly creat

java - Javadoc error: unmappable character for encoding ASCII -

im trying create javadoc can't. i have written comments in swedish så content charachters å,ä,ö. giving me on 248 erros. is there way change encoding whole project? i have tried: right-clicked on project choosed resource change utf-8 restarted eclipse create new javadoc this results in following error: error: unmappable character encoding ascii is there else can solve problem? specifying utf-8 resource encoding thing do, may perform following: if generate javadoc using javadoc binary, may check -encoding parameter: javadoc: usage: javadoc [options] [packagenames] [sourcefiles] [@files] ... -encoding <name> source file encoding name using eclipse , may specify option in field " extra javadoc options (...): " in last wizard step (example: -encoding utf-8 ).

c# - How to make WinSCP .NET assembly perform faster? -

has come speed performance using winscp .net? i try c# winscp example in http://winscp.net/eng/docs/library#csharp . note when starts up, takes 30 seconds reach first statement (the initialization of winscp.sessionoptions ). anyone knows going on? how speed up? the thing have write c++ program (be c++/cli or plain c++) automate sftp transfers may happen per minute, per x minute, per hour, or per day. speed concern me, transfers happen per minute. if there library can perform better, please let me know. thanks. i figure out! sorry that. version mismatch. version of winscp.exe different winscpnet.dll (the assembly). i use source code of latest version of winscp . use dotnet\winscpnet.csproj in source. add project c# example. compile assembly , c# example. example runs immediately, see message saying compiled assembly has version mismatch between dot net assembly , winscp.exe. once make sure both (assembly , exe) same version (5.5.2), c# example runs (without startu

qt - QPrintPreviewDialog hangs if screen resolution is 2560x1600 -

i have problem qprintpreviewdialog - when report has 2 pages , screen resolution 2560x1600 hangs - application starts "eat" memory. not have such problem when screen resolution 1920x1200 or less, or report has 1, 3 or more pages. ( :-\ ) when have problem previewing (2560x1600, 2 pages), report prints normaly, no matter select print pages or range. after installation event filter on qprintpreviewdialog (event types): qpainter::end() returned: true printpreviewdialog: 203 printpreviewdialog: 13 printpreviewdialog: 14 printpreviewdialog: 152 printpreviewdialog: 17 printpreviewdialog: 13 printpreviewdialog: 24 printpreviewdialog: 99 printpreviewdialog: 26 printpreviewdialog: 76 printpreviewdialog: 77 printpreviewdialog: 12 printpreviewdialog: 76 printpreviewdialog: 77 printpreviewdialog: 12 printpreviewdialog: 76 printpreviewdialog: 76 printpreviewdialog: 77 printpreviewdialog: 12 printpreviewdialog: 173 printpreviewdialog: 76 printpreviewdialog: 25 !!! printpreviewd

sql server - Getting error on create table with foreign key constraint (Cascade) -

Image
create table employee ( eid int primary key, ename varchar(50), cid int, sid int, constraint fk_hello1 foreign key(cid) references country(cid)on delete cascade on update cascade, constraint fk_hello2 foreign key(sid) references state(sid) on delete cascade on update cascade, ) i have been trying apply code getting error msg......... error message msg 1785, level 16, state 0, line 1 introducing foreign key constraint 'fk_hello2' on table 'employee' may cause cycles or multiple cascade paths. specify on delete no action or on update no action, or modify other foreign key constraints. msg 1750, level 16, state 0, line 1 not create constraint. see previous errors. you can not use on update cascade when have cycle references in relations in database structure: only no action allowed (see error specify on delete no action or on update no action ) is state country has different meaning state in employee ? correct soluti

windows installer - WiX get culture preprocessor variable -

i have folder struckture like [myapp] --[videos] --[de-de] -video1.mpg - blah blah blah --[en-us] - video1.mpg - blah blah blah etc etc to include videos languagespecific installers need ability access $(var.culture) (<--didnt exist). tried use language files <wixlocalization culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization"> <string id="localisation">en-us</string> </wixlocalization> but doenst work cause arent preprocessor variables cant use them in "candle" process. there way culturecode preprocessor variable current builded msi? im sorry if question trivial searched google , didnt find real solution. you can use localization variable: <file id="filevideo1" source="!(loc.localisation)\video1.mpg"/> candle take value localization file each culture.

backbone.js - Iterating Through Collections in BackboneJs, is for faster than forEach? -

iterating through collections: although can use simple loop iterate through collection follows: //a simple loop for(var = 0; < mylibrary.length; i++){ var model = mylibrary.at(i); console.log('book ' + + ' called ' + model.get('name')); } there more elegant utility function provided underscore helps iterate through collections, namely, foreach function. //using foreach mylibrary.foreach(function(model){ console.log('book called ' + model.get('name')); }); which 1 better performance-wise if @ underscore source can see tests native foreach , chooses on using loop. given 2 options, on browsers support native foreach, underscore faster, , have same run time in others. var each = _.each = _.foreach = function(obj, iterator, context) { if (obj == null) return obj; if (nativeforeach && obj.foreach === nativeforeach) { obj.foreach(iterator, context); } else if (obj.length === +obj.length) {

java - Could not connect to SMTP host -

i trying send email via our private smtp server here code public static void main(string args[]) throws messagingexception { properties props = system.getproperties(); props.put("mail.smtps.host", "gi-systems.net"); props.put("mail.smtps.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.port", "25"); session session = session.getinstance(props, null); message msg = new mimemessage(session); msg.setfrom(new internetaddress("xxxx@gi-systems.net")); msg.setrecipients(message.recipienttype.to, internetaddress.parse("yyyy@hotmail.com, false)); msg.setsubject("password recovery"); msg.settext(pwd); msg.setsentdate(new date()); smtptransport t = (smtptransport) session.gettransport("smtps"); t.connect("smtp.gi-sy

AngularJS filters based on PHP server side request/response -

in application i'm working on need add filters example: approved, documents, documents approved , others. these filters based on mysql queries db performed php controller (i'm using symfony2) , functions on controllers return formed json. question is: can write filters angularjs based on behavior? how? (i mean little example understand flow) i think can similar below code: //in symfony controll public function sampleaction() { $data = $this->getdoctrine()->getmanager()->getrepository('yourbundle:sampleentity')->findall()->toarray(); return $this->render('yourbundle:views_path:sampletwigoutput.html.twig', array( 'data' = json_encode($data) )); } in twig file can have like <div ng-init="mydata = {{ data|raw }}"></div> <table id="sorteddata"> <tr><th>t1</th><th>t2</th></tr> <tr ng-repeat="data in mydata | filter:sortdata&

python - AllowAccess issue even if my server has `Access-Control-Allow-Origin:*` -

i'm trying access box.com api, xhr perform browser give me follow access-control-allow-origin issue: [error] xmlhttprequest cannot load https://www.box.com/api/oauth2/token. origin http://localhost:8888 not allowed access-control-allow-origin. (localhost, line 0) i use easy python server found @ this gist it has (at line 44) line of code self.send_header("access-control-allow-origin", "*") , think auld work correctly... right? this code generate xmlhttprequest: this.getaccesstoken = function(code) { var parameters = 'grant_type=authorization_code' + '&code=' + code + '&client_id=' + box.client_id + '&client_secret=' + box.client_secret; var xhr = new xmlhttprequest(); xhr.open('post', 'https://www.box.com/api/oauth2/token'); xhr.setrequestheader("content-type", "application/x-www-form-urlencoded"); xhr.setrequestheader("content-length",

javascript - Why isn't this image changing function working? -

here wrote: var img_current = 0; var image0 = new image() image0.src = "img/image_centrale/1_house_0.jpg" var image1 = new image() image1.src = "img/image_centrale/1_house_1.jpg" var image2 = new image() image2.src = "img/image_centrale/1_house_2.jpg" function affich_centrale() { if (house_bought == 1 && neighborhood_bought == 0) { img_current = 1; document.images.main.src = eval("image" + img_current + ".src").innerhtml = 'image_centrale'; } else if (house_bought == 2 && neighborhood_bought == 0) { img_current = 2; document.images.main.src = eval("image" + img_current + ".src").innerhtml = 'image_centrale'; } else{} this go on, think gist. what's wrong code? images won't change "house_bought" variable changes. in html part, put this: <div id="image_centrale"> <img src=&quo

php - json_encode result inside json_encode -

i need help, don't on own. may gap me. i got 2 classes: first 1 (application) has method (tojson) return private variables json-string. the second (problem) contains first class , able return own content , content of child json. now, if call tojson-method of superior second class, method calls tojson-method of child. both tojson-methods using json_encode. logical consequence is, final-result contains escape characters. {"application":"{\"abbreviation\":\"gb\",\"identifier\":1,\"name\":\"great bounce"\"}"} the tojson-method of application similar this: public function tojson() { return json_encode(array( "abbreviation" => $this->_abbreviation, "identifier" => $this->_identifier->getid(), "name" => $this->_name )); } the tojson-method of problem: public function tojson() { return json_encode(array(

ruby on rails - Use multiple Redis servers in Sidekiq -

i using sidekiq process background jobs 1 of our rails project. want use different redis server located @ different location sepearate out reportdb other background processing job. according sidekiq config wiki can configure like config/initializers/sidekiq.rb sidekiq.configure_server |config| config.redis = { :url => 'redis://redis.example.com:7372/12', :namespace => 'mynamespace' } end sidekiq.configure_client |config| config.redis = { :url => 'redis://redis.example.com:7372/12', :namespace => 'mynamespace' } end but how can initialise connection multiple redis server? sidekiq 2 doesn't support multiple redis servers, upgrade sidekiq 3 released today , adds new client sharding feature need. from: sidekiq 3 release note client sharding sidekiq 2.x has scalability limit: 1 redis server. in practice limit greater 5000 jobs per second on hardware wasn’t big deal of more intense sidekiq users

html - How can I make a container layout like this? -

Image
i tried make container repeat panel of posts again , again such blogs can't make spaces disappear. so picture show need. pic 1: pic 2: as images show, need remove spaces pic 1 , can't it. please give me html css file make second image. you can use jquery plugins this. example mansonry or isotope . think css solution not work. maybe display: table, display:table-cell works css.

Server cannot append header after HTTP headers have been sent c# excel inline -

i have problem trying return excel inline response. i searched through coding pages answers , can not find works yet. i made simplified example of doing below. issue happen. error in line: line 56: response.addheader("content-disposition", code behind: public partial class _default : system.web.ui.page { protected void page_load(object sender, eventargs e) { pleasewait(); call(); } protected void call() { strsql = "select * ....... ; "; sqlcommand cmd = new sqlcommand(strsql); datatable dt = getdata(cmd); gridview gridview1 = new gridview(); gridview1.allowpaging = false; gridview1.datasource = dt; gridview1.databind(); response.clear(); response.buffer = true; response.bufferoutput = true; response.clearheaders(); response.addheader("content-disposition", "attachment;filename= "