Posts

CORS initial connection for OPTION + GET -

i'm using cors make cross domain request, have: a preflight option call a get call i'd know why have initial connection each request , whereas have keep-alive of 5s , option request takes 700ms ? thanks :)

How could I generate a customized javadoc of a class, package ... to pdf in eclipse or something in maven? -

how generate customized javadoc of class, package ... pdf in eclipse or in maven? <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-javadoc-plugin</artifactid> <version>2.10.2</version> <reportsets> <reportset> <id>pdf</id> <reports> <report>javadoc</report> </reports> <configuration> <name>pdf</name> <description>this documentation on pdf.</description> <destdir>pdf</destdir> <doclet>com.tarsec.javadoc.pdfdoclet.pdfdoclet</doclet> <docletpath>${basedir}\..\..\tools\pdfdoclet-1.0.3-all.jar</docletpath> <usestandarddocletoptions>false</usestandarddocletoptions> <addition...

c# - Multiple validation errors with INotifyDataErrorInfo, old messages don't disappear -

in wpf project, i'm validating textbox input inotifydataerrorinfo implementation. multiple errors can occur. when input causes multiple errors, validation errors displayed. however, when fix 1 error, validation message doesn't change, means false error messages shown. when fix errors message disappears. is problem implementation, or wpf implementation re-fetch validation message if haserrors changed? stepping through debugger, however, can see geterrors , haserrors both called. steps reproduce attached example: enter 333333. 2 validation messages shown. change leading 3 2. still, both validation messages shown, although first error has been fixed. change second 3 0. both messages disappear change second digit 3 again. second validation message shown. change leading digit 3 again. second validation message shown, although should display both. and yes, example doesn't make sense, since rid of first check, since it's included in second check. the view...

ruby on rails - Testing a redirect_to(:back) on successful from completion isn't working -

i'm trying run test has redirect_to(:back) on successful form completion, error when run line assert_difference 'comment.count', 1 post comments_path, comment: { body: "optc", commentable_id: 1, commentable_type: 'post'} end error actioncontroller::redirectbackerror: no http_referer set in request action, redirect_to :back not called successfully. if test, make sure specify request.env["http_referer"]. looking this see need request.env['http_referer'] = 'http://test.com/' added setup. gives error nomethoderror: undefined method 'env' nil:nilclass now i'm not sure do. how can first error go away? update im using rails 4 here header of test file require 'test_helper' class categoryitemshowpagetest < actiondispatch::integrationtest def setup @user = users(:michael) @user1 = users(:archer) @guide = guide.find(1) @category = category.find(1) @category_item...

html - Flex box fix for IE? -

Image
i using flex portion of web page doesn't great in ie. what's best fix this? demo: https://jsfiddle.net/8otrpjt8/ /* latest compiled , minified css included external resource*/ /* optional theme */ @import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css'); body { margin: 10px; } .row-flex, .row-flex > div[class*='col-'] { display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; flex:1 1 auto; } .row-flex-wrap { -webkit-flex-flow: row wrap; align-content: flex-start; flex:0; } .row-flex > div[class*='col-'], .container-flex > div[class*='col-'] { margin:-.2px; /* hack adjust wrapping */ } .container-flex > div[class*='col-'] div,.row-flex > div[class*='col-'] div { width:100%; } .flex-col { display: flex; display: -webkit-flex; flex: ...

c++ - General swap implementation in terms of byte swap -

the current implementation general swap in standard library like template <class t> void swap(t& a, t& b) { t c(move(a)); = move(b); b = move(c); } i'm wondering whether can following instead. template <class t> void swap(t& a, t& b) { unsigned char x; auto pa = reintepret_cast<unsigned char*>(&a); auto pb = reintepret_cast<unsigned char*>(&b); auto pc = pa + sizeof(a); while (pa != pc) { x = *pa; *pa = *pb; *pb = x; ++pa, ++pb; } } i think implementation better in terms of space usage, takes 1 byte. there many considerations need addressed when swapping classes. pod types, swapping bytes works correctly. more complicated classes, however, may rely on invariants byte-swapping won't respect. example, consider reference member variable: struct foo { foo() : bar{}, barref{bar} {}; int bar; int& barref; // expected refer neighboring `bar` }; int main() { ...

Modifying the sort order of module in oscommerce -

how can modify sort order of modules in oscommerce. i cannot find module_admin_dashboard_xxxxx_sort_order defined. in administration panel under "modules" -> "dashboard". can set sort order of each item individually.