Posts

Mathematica: Unusual piecewise plot issue -

Image
hello , in advance, i came upon issue trying plot piecewise function in mathematica. when entered directly plot function, piecewise did not plot. however, when defined piecewise variable, did plot. why issue occurring , can still join plot? (i join setting exclusions none) the following code: (i define maxwell strain function , trying model plastic deformation of polymer on multiple stress cycles) z = 2*10^10; h = 10^12; maxwellstrain[s_, t_] := s/z + (s*t)/h; stress = {0, 10^7, -10^7, 5*10^6, 10^7, -5*10^6}; time = {0, 100, 200, 300, 400, 500}; strainlist = join[{0}, table[maxwellstrain[stress[[i + 1]], t - time[[i]]], {i, 1, 5}]]; plot[ piecewise[ table[{ total[strainlist[[1 ;; + 1]]], time[[i]] < t < time[[i + 1]]}, {i, 1, 5} ], exclusions -> none] , {t, 0, 500} ] x = piecewise[ table[{ total[strainlist[[1 ;; + 1]]], time[[i]] < t < time[[i + 1]]}, {i, 1, 5} ], exclusions -> none] plot[x, {t, 0, 500}] the fol...

ios - Does the size of a placeholder image affect performance? -

at moment downloading images remotely using uiimageview category. while image downloading use placeholder image stored in xcassets folder. is worth having multiple placeholder images different sizes: small, medium, , large? or worth having 1 placeholder image , using throughout application? does size of placeholder image affect performance? well, should have @2x , @3x version of images, mean less work cpu scale / down image on different devices. also, there technically work done cpu scale image or down. however, apple's graphics processor pretty efficient @ scaling images. so technical answer "yes, affect performance", in reality not big enough difference notice. now, if have built poorly written app displays hundreds of these placeholders in uiscrollview instead of form of uicollectionview (which displays on screen, or on screen), notice slight performance difference images adds large performance difference.

c# - Setting the username in the model instead of javascript code -

i managed signalr chat going, , ran problem. <script type="text/javascript"> $(function () { // declare proxy reference hub. var chat = $.connection.chathub; // create function hub can call broadcast messages. chat.client.broadcastmessage = function (name, message) { $('#chat-body').append('<li><strong>' + name + ' :</strong> ' + message); }; // start connection. $.connection.hub.start().done(function () { $('#send-chat-msg-btn').click(function () { // call send method on hub. chat.server.send('username', $('#message-input-field').val()); // clear text box , reset focus next comment. $('#message-input-field').val('').focus(); }); }); }); </script> the username set in javascript code, when sending serv...

Date format changed when printing report in c# -

Image
i developed application uses reports, , have problem when attemp print report date format changed format on client pc, although print date in correct format on pc, here 2 pictures first pc , other client pc my pc client pc here code used display report string datestring = datetimepicker1.value.tostring("yyyy/mm/dd"); datetime dt = datetime.parseexact(datestring, "yyyy/mm/dd", null); string datestring2 = datetimepicker2.value.tostring("yyyy/mm/dd"); datetime dt2 = datetime.parseexact(datestring2, "yyyy/mm/dd", null); dailyworktableadapter.fill(this.workingmgmtdataset1.dailywork,label2.text,dt,dt2); datatable1tableadapter.fill(this.finalds.datatable1,dt,dt2,label2.text); this.reportviewer1.refreshreport(); the date field expresion in report : =fields!date.value the client pc seems setup different culture. can force format of datetime value this: datetime dt = datetime.no...

asp.net - How to use client side script on button click to modify text box -

Image
i'm developing interface using asp.net ajax webforms. shows update panel upon initialization of page , after various actions requested validate user pin number. interface used on tablets, created keypad buttons collect user's pin number looks this: when buttons clicked run: protected void btn0_click(object sender, eventargs e) { addnumbertopin("0"); } the procedure call labeled number argument strdigit defined as: protected void addnumbertopin(string strdigit) { txtpin.text += strdigit; if (txtpin.text.length == 5) { ... ...check database validate pin ... } } this works, slow because every button click creates round trip web server. seems should simple store collected pin in local variable on client , post server once 5 digits have been collected. i'm new web programming, i'm not sure how go doing this. i've read this , this , still can't figure out how buttons stop posting server. ...

asp.net mvc - Html.raw("test string") not displaying string with double quotes around it -

i have string 'test string" being displayed on html page but html.raw("test string") hides string when there double quotes around string, don't see in page text field does know how can fix this? you must escape special characters, such quotes, using \ character. in example be html.raw("\"test string\"")

Where can I compile my ruby code? -

i started programming on ruby @ codecademy can compile codes on doing website? when making lessons on c used codeblocks run codes. know text editor can run html code. ruby? thank you. i'll take stab @ answering question think you're asking, i'm not 100% sure here. ruby interpreted language (what mean? not whole lot nowadays. if you'd more in depth discussion on distinction or lack thereof between interpreting vs compiling, read jorg's comments below). execute ruby code, you'll need install ruby. fortunately you, freely available on major platform. if you're on unix-y (eg, linux or mac), i'd recommend installing ruby via rvm or rbenv. if you're on windows, can either go cygwin route , pretend it's unix-y environment, or there prebuilt installers out there. googling 'install ruby' should have sites can @ or near top of search results.