text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
Is there a way to start an ordered list from a specific index while following XHTML Strict? Using start=n works well, but has been [deprecated](http://www.w3schools.com/tags/tag_ol.asp)… The intended purpose is to resume the index with paging.
I saw a few references to a CSS solution, but the starting index cannot be ... | [
0.2814861238002777,
-0.14683854579925537,
0.35270142555236816,
0.11582101881504059,
-0.324679970741272,
0.00845248345285654,
0.14121365547180176,
-0.4062905013561249,
-0.4318758547306061,
-0.265292763710022,
-0.06888951361179352,
0.3854917883872986,
-0.3086324632167816,
-0.1671177446842193... | |
the following in
> your CSS:
>
>
>
> ```
> OL#page_one { counter-reset: item }
> OL#page_two { counter-reset: item 5 }
> LI { display: block }
> LI:before {
> content: counter(item) ". ";
> counter-increment: item;
> display:block;
> }
>
> ```
>
> And, this is how your lists should be
> defined:
>
>... | [
0.0989130511879921,
0.024021249264478683,
0.6464269757270813,
0.10250110179185867,
-0.4538246989250183,
0.06295836716890335,
-0.057341448962688446,
-0.4806845188140869,
-0.26939651370048523,
-1.0273418426513672,
-0.04557138308882713,
0.04094152897596359,
-0.02341747097671032,
0.56692421436... | |
Were Here</li>
> </ol>
>
> <ol id="page_two">
> <li>The Wall</li>
> <li>More</li>
> <li>Piper at the gates of Dawn</li>
> <li>Final Cut</li>
> <li>Meddle</li>
> </ol>
>
> ``` | [
0.16245342791080475,
-0.4307030141353607,
0.1249156966805458,
0.003775525139644742,
-0.8267907500267029,
0.49511855840682983,
0.31582075357437134,
-0.5635595917701721,
0.045972395688295364,
-1.0841963291168213,
0.3871467709541321,
0.13138963282108307,
0.20945805311203003,
0.467941522598266... | |
What is the best/cleanest/easiest way to maintain the edit history of records in Rails?
I'm looking for logging - who made the edits and when and the ability to rollback to earlier versions of records.
My guess is that you would use ActiveRecord callbacks on updates or deletes and instead of updating/deleting records... | [
0.34325912594795227,
0.08754610270261765,
0.03640446066856384,
0.3238207995891571,
0.044765450060367584,
-0.0999278575181961,
0.2330683469772339,
-0.01091574877500534,
-0.476462721824646,
-0.5275034308433533,
0.19064843654632568,
0.6632986664772034,
-0.16997456550598145,
0.1450732201337814... | |
for this that I don't know?)
acts\_as\_audited wins hands down. You can even use acts\_as\_versioned with it. The [plugin-page](http://opensoul.org/2006/7/21/acts_as_audited) explains everything. Go through the discussion comments below the post on the page. Developers have posted issues and have obtained positive resp... | [
0.014311744831502438,
-0.08782383054494858,
0.4958536922931671,
0.20332033932209015,
-0.20934702455997467,
-0.18671977519989014,
0.4720246195793152,
-0.5594087243080139,
-0.4250112473964691,
-0.4853348731994629,
0.04853694885969162,
0.6301856637001038,
-0.4048061668872833,
-0.1502497941255... | |
any of the
> model objects that you wish to have
> audited. The audit log stores the
> model that the change was on, the
> “action” (create, update, destroy), a
> serialzied hash of the changes, and
> optionally the user that performed the
> action. | [
-0.008834481239318848,
-0.21918751299381256,
0.44195273518562317,
0.15915252268314362,
-0.10598167032003403,
0.028281237930059433,
0.18273918330669403,
-0.11930400133132935,
-0.22920258343219757,
-0.6265850067138672,
-0.06606587022542953,
0.5567002892494202,
-0.2520740032196045,
-0.0557603... | |
We currently have an inventory management system that was built in-house. It works great, and we are constantly innovating it.
This past Fall, we began selling products directly on one of our websites via a Shopping Cart checkout.
Our inventory management system runs off a server in the office, while the three websi... | [
0.6338726282119751,
0.28464850783348083,
0.4202616214752197,
0.12044501304626465,
0.38522276282310486,
0.19664666056632996,
-0.08362015336751938,
0.38078659772872925,
-0.3721601366996765,
-0.5584912300109863,
0.17805694043636322,
0.444247841835022,
0.13893729448318481,
0.4115663766860962,
... | |
always up to date and we are not selling something we don't have.
Our internal inventory tracking works great and flows well, but I have no idea on how I would implement a solid tracking system that can communicate between the two.
The software is all written in Python, but it does not matter as I am mostly looking f... | [
0.5032007694244385,
0.20917321741580963,
0.1866995096206665,
0.27957287430763245,
0.48198434710502625,
-0.12091442197561264,
-0.10594125092029572,
0.5003961324691772,
-0.23231029510498047,
-0.4328238070011139,
0.3179290294647217,
0.7456485033035278,
0.04207056388258934,
-0.3787996470928192... | |
used by the web shopfront to be accessed remotely. With a reasonably secure VPN link or ssh tunnel type arrangement, the web shopfront could get stock levels, place orders or execute searches against the inventory system.
Notes:
1. You would still have to add a reasonable security layer to the inventory service in ca... | [
0.39649441838264465,
-0.09238260984420776,
0.324891060590744,
0.04058755189180374,
0.1844525784254074,
-0.08885892480611801,
0.06056550145149231,
-0.07946501672267914,
-0.367208868265152,
-0.32792457938194275,
-0.06045820564031601,
0.3770228326320648,
0.01520137581974268,
-0.05147416889667... | |
the web shopfront. This probably means some sort of hot failover arrangement. | [
0.5460899472236633,
0.07094430178403854,
0.23248252272605896,
0.315310537815094,
0.03298482671380043,
-0.1332598179578781,
0.2257094383239746,
0.5190353393554688,
-0.353386789560318,
-0.4219130873680115,
-0.23689116537570953,
0.3856675326824188,
0.09053187817335129,
0.13462787866592407,
... | |
can anyone recommend a TAPI component for use with C++ in the MS Windows environment?
I have tried the standard MS implementations of TAPI 2 and 3 and had problems with both. Mainly recovery from modems been switched off or losing connections.
The latest problem is the TAPI device disappearing after a couple of days... | [
0.18579038977622986,
-0.09768904000520706,
0.19735276699066162,
0.26249945163726807,
0.1197776198387146,
-0.19573503732681274,
0.5037020444869995,
-0.04277900606393814,
-0.04542671889066696,
-0.2064245641231537,
-0.006905227899551392,
0.5501465201377869,
-0.26194947957992554,
-0.0451348945... | |
use it again until we reboot the computer
2) we receive a callback "CTapiLine::OnCallStateChange (hCall, dwState, dwStateDetail, dwPrivilage);", where dwState = LINECALLSTATE\_DISCONNECTED; and
dwStateDetail=LINEDISCONNECTMODE\_NODIALTONE staight after making a connection, but we have already switched off the "wait ... | [
0.29641276597976685,
-0.7370634078979492,
1.1788066625595093,
0.083064965903759,
0.18245868384838104,
0.23652060329914093,
0.11824381351470947,
0.0767400711774826,
-0.09514885395765305,
-0.7475553154945374,
-0.137826606631279,
0.5628527998924255,
-0.26340848207473755,
0.1049128994345665,
... | |
across the WM\_SETREDRAW win32 message. This really stops controls drawing whilst you update them and can be applied, IIRC to the parent/containing panel.
This is a very very simple class demonstrating how to use this message:
```cs
class DrawingControl
{
[DllImport("user32.dll")]
public static extern int Sen... | [
0.17099596560001373,
-0.2172803431749344,
0.6106870770454407,
-0.2856733500957489,
-0.1832757145166397,
-0.08765742182731628,
0.2523263394832611,
-0.2523631155490875,
-0.5616759657859802,
-0.4379490911960602,
-0.24462272226810455,
0.37955862283706665,
-0.31829336285591125,
0.16394099593162... | |
ResumeDrawing( Control parent )
{
SendMessage(parent.Handle, WM_SETREDRAW, true, 0);
parent.Refresh();
}
}
```
There are fuller discussions on this - google for C# and WM\_SETREDRAW, e.g.
[C# Jitter](https://web.archive.org/web/20160324214157/http://blog.bee-eee.com/2008/04/18/c-getting-rid-o... | [
-0.09096790105104446,
-0.36445820331573486,
1.229965329170227,
-0.08463099598884583,
0.013077840209007263,
-0.09046564251184464,
0.2076132595539093,
0.09126577526330948,
-0.5107358694076538,
0.006344123277813196,
-0.38200506567955017,
0.6053837537765503,
-0.20529961585998535,
0.48021519184... | |
11
' Extension methods for Control
<Extension()>
Public Sub ResumeDrawing(ByVal Target As Control, ByVal Redraw As Boolean)
SendMessage(Target.Handle, WM_SETREDRAW, True, IntPtr.Zero)
If Redraw Then
Target.Refresh()
End If
End Sub
<Extension()>
Public Sub Su... | [
0.02834412269294262,
-0.2996736764907837,
0.6323915123939514,
-0.21228943765163422,
0.3115638196468353,
0.16856566071510315,
0.2647852897644043,
-0.18167918920516968,
-0.26967185735702515,
-0.24303250014781952,
-0.5654863119125366,
0.5873448252677917,
-0.4328082799911499,
-0.18302077054977... | |
End Sub
<Extension()>
Public Sub ResumeDrawing(ByVal Target As Control)
ResumeDrawing(Target, True)
End Sub
End Module
``` | [
-0.11188363283872604,
-0.49038705229759216,
0.8247663974761963,
-0.06250645220279694,
0.3497294485569,
-0.29551756381988525,
0.18890228867530823,
0.04964489862322807,
-0.0878850519657135,
-0.13579033315181732,
-0.4775252938270569,
0.5654396414756775,
-0.17814432084560394,
-0.00203223526477... | |
The question is in the title : "Is there an equivalent to java @SuppressWarnings in JSP ?"
Yes, just use:
```
<%! @SuppressWarnings("unchecked") %>
``` | [
0.10033509880304337,
-0.007235581520944834,
0.02583148516714573,
-0.047365300357341766,
-0.18033240735530853,
-0.42600512504577637,
0.10470561683177948,
0.04331975802779198,
0.10274408757686615,
-0.17844662070274353,
-0.29791930317878723,
0.6032061576843262,
-0.33074262738227844,
-0.271258... | |
Where you have a databound list of items and for each item you may want to provide users the ability to (for example):
* Delete
* Download
* View Detail
* or 'mark' in some way
You have a few options:
* Provide buttons or links within the row itself to complete the operation on the row item
* Provide a checkbox sele... | [
0.26453375816345215,
-0.2420032024383545,
0.20961004495620728,
0.4167020916938782,
0.0931907519698143,
0.15356005728244781,
0.036033738404512405,
-0.2668529748916626,
-0.4646167457103729,
-0.5780801177024841,
-0.226845383644104,
0.46966877579689026,
-0.11602489650249481,
0.0271737594157457... | |
approach to providing this kind of interaction?
Links to examples of 'usable' lists would be good.
I assume that you're talking about types and not objects (I know it is called an object model, but it really is a model of the types involved).
Anyway, if you subscribe to the Single Responsibility Principle, which st... | [
0.4306870698928833,
0.061943624168634415,
0.13823620975017548,
0.3063412606716156,
-0.21536943316459656,
0.10135958343744278,
0.27673473954200745,
-0.1314510703086853,
-0.5619134306907654,
-0.3230133056640625,
0.0706576555967331,
0.46674588322639465,
-0.375917911529541,
-0.0372321419417858... | |
rarely (if ever) need to look at all the types at a time.
Managing large software project is all about splitting things up into manageable pieces and labeling them in a sensible way. If you do that, the number of types becomes less important in my experience. | [
0.5037006139755249,
0.12101571261882782,
-0.3581821024417877,
0.3605349361896515,
0.008621742948889732,
-0.2933300733566284,
0.2655644416809082,
0.037185490131378174,
-0.5007318258285522,
-0.6532501578330994,
-0.22334715723991394,
0.3461369276046753,
-0.3655904233455658,
0.0202049147337675... | |
I would like to know the best way to save an image from a URL in php.
At the moment I am using
```
file_put_contents($pk, file_get_contents($PIC_URL));
```
which is not ideal. I am unable to use curl. Is there a method specifically for this?
Using file\_get\_contents is fine, unless the file is very large. In that... | [
0.21190638840198517,
-0.09668377786874771,
0.6950926780700684,
0.027074016630649567,
-0.15141265094280243,
-0.13867974281311035,
0.04633283242583275,
0.05632586032152176,
-0.4291588068008423,
-0.8040187954902649,
-0.2403290569782257,
0.3164028227329254,
-0.08909860253334045,
0.121516197919... | |
"rb");
while (!feof($fin)) {
$buffer= fread($fin, 32*1024);
fwrite($fout,$buffer);
}
fclose($fin);
fclose($fout);
```
(Devoid of error checking for simplicity!)
Alternatively, you could forego using the [url wrappers](http://uk.php.net/manual/en/wrappers.php) and use a class like PEAR's [HTTP\_Request](http:... | [
0.3195527195930481,
-0.10788475722074509,
0.40792316198349,
-0.29257047176361084,
-0.12788529694080353,
-0.11477115005254745,
0.328836053609848,
-0.529876172542572,
-0.21720847487449646,
-0.2250356674194336,
-0.28649768233299255,
0.6108196377754211,
-0.25487396121025085,
0.1146103739738464... | |
I'm using git for a PHP project, I think it's really handy. There is one thing that would be great if I get it to work.
I have created a branch, meant for deployment. It has some differences, like different configuration files and documentation.
I can't just ignore them, because then they will stay in both branches, ... | [
0.49421992897987366,
0.01702541671693325,
0.00008655989222461358,
0.49599048495292664,
-0.0031915262807160616,
0.004537342116236687,
0.027708372101187706,
0.32776546478271484,
-0.355849027633667,
-0.6966993808746338,
0.4560542106628418,
0.22803936898708344,
-0.06730332225561142,
0.25245714... | |
done?
Update Feb. 2021: Git itself is still not a good fit, but [GitHub Action environment could help](https://stackoverflow.com/a/66248867/6309).
2009: I am not sure Git is meant to be used this way.
First a quick [Linus advice](http://www.gelato.unsw.edu.au/archives/git/0701/37960.html), always "colorful" and infor... | [
0.3503946363925934,
-0.1021777018904686,
0.6901472806930542,
-0.21069003641605377,
0.18390630185604095,
-0.37577807903289795,
0.16121210157871246,
-0.14266559481620789,
-0.3485688865184784,
-0.6943159699440002,
-0.17525243759155273,
0.5636588335037231,
0.037152498960494995,
0.0881256684660... | |
it. It's much more fundamental than that. Once you start doing per-file branching and merging, you've basically screwed yourself, and you'll never be able to work on the project as a "whole project" any more - you no longer have a well-defined history that actually is the history of the whole project.
---
There.
Tha... | [
0.44706493616104126,
-0.3272552192211151,
0.3267808258533478,
0.33701062202453613,
0.10851550847291946,
-0.359592080116272,
0.12497561424970627,
0.18247424066066742,
-0.20521023869514465,
-0.7219105958938599,
-0.24684827029705048,
0.260263055562973,
-0.13442346453666687,
0.4633859395980835... | |
your deployment server
```
Development Deployment
#origin/master:
x--x $ git clone
# master
x--x
$ git checkout -b deployment origin/master | [
0.3979266881942749,
0.3023218512535095,
0.33442622423171997,
-0.16985592246055603,
0.31881895661354065,
-0.03022048808634281,
-0.0034390881191939116,
-0.009388226084411144,
-0.33256351947784424,
-0.8475486040115356,
-0.4007225036621094,
0.3864363729953766,
-0.14085713028907776,
0.228261247... | |
x--x
\
-- #deployment
$ .... #makes changes for config files | [
0.13459236919879913,
0.16540253162384033,
0.38247376680374146,
0.0632750540971756,
0.21219483017921448,
-0.26750239729881287,
0.24428004026412964,
0.012169343419373035,
-0.020397886633872986,
-0.7748086452484131,
-0.47850096225738525,
0.44760969281196594,
-0.5607871413230896,
0.06422152370... | |
#or other specific deployment files
x--x
\
--d1--d2 # no need to push that branch ever.
#new developments
x--x--x--x | [
0.24562139809131622,
-0.08360951393842697,
0.5751528739929199,
0.21791556477546692,
0.29070335626602173,
-0.2789366841316223,
0.35500791668891907,
0.4084007740020752,
-0.4095146358013153,
-0.49654462933540344,
-0.5721032619476318,
0.41956427693367004,
-0.141240656375885,
0.0168375913053751... | |
$ git pull --rebase #pull origin/master and
#replay current branch on top of it
x--x--x--x | [
0.0555083267390728,
0.005548337008804083,
0.5736395120620728,
0.13766419887542725,
0.1336931437253952,
0.03853660821914673,
0.15564364194869995,
0.30155816674232483,
-0.006138355005532503,
-0.3132668733596802,
-0.24717123806476593,
0.19293738901615143,
-0.36003321409225464,
0.3868353068828... | |
\
--d1'--d2' #SHA1 rewritten in deployment branch
#not important since this branch | [
-0.48784348368644714,
0.05918833985924721,
0.17816446721553802,
-0.2561151087284088,
-0.03925405442714691,
0.06915538758039474,
0.4904468059539795,
-0.05206998437643051,
-0.14101722836494446,
-0.4216436445713043,
-0.3579517602920532,
0.218863382935524,
-0.09102027118206024,
-0.054375156760... | |
#is not pushed (published)
``` | [
0.14975348114967346,
0.05251786485314369,
0.645327627658844,
-0.07067176699638367,
-0.1831689178943634,
-0.23418031632900238,
0.08049352467060089,
0.19299741089344025,
-0.19455844163894653,
-0.15933005511760712,
-0.3098567724227905,
0.37535661458969116,
-0.3577299118041992,
0.1764099299907... | |
I want to make a multi-language site, such that all or *almost* all pages will be available in 2 or more translations. What are the best practices to follow?
For example, I consider these language selection mechanisms:
1. Cookie-based selection of the preferred language.
2. Based on `Accept-Language` header if the co... | [
0.218607097864151,
0.22795823216438293,
0.5202046036720276,
-0.13331981003284454,
-0.10984618216753006,
-0.07272002846002579,
0.31469693779945374,
0.10487065464258194,
-0.2385716736316681,
-0.7719115614891052,
-0.23463411629199982,
0.3629893660545349,
-0.4305395185947418,
0.018047196790575... | |
correct `Content-Language` header are enough?
What is the best way to let the users know there are other translations, but do not distract them?
1. list available languages in the header/footer/sidebar (like Wikipedia)
2. put “Choose a language” selector next to the content
What is the best policy to deal with missi... | [
0.24149954319000244,
0.36379656195640564,
0.12956058979034424,
0.29748401045799255,
-0.18534113466739655,
-0.24339504539966583,
0.577008068561554,
0.14413423836231232,
-0.16512025892734528,
-0.6288315057754517,
-0.3038403391838074,
0.5117979049682617,
-0.2197968065738678,
0.049573197960853... | |
that you standard RFC 4646 language identifiers (e.g. EN-US, DE-AT); you may already be aware of this. The [CLDR](http://www.unicode.org/cldr) project is an excellent repository of internationalization data (the Supplemental Data is really useful).
If a translation of a specific page is not available, use a language f... | [
0.2631988823413849,
0.11731283366680145,
0.2521018087863922,
0.08829627931118011,
0.11965016275644302,
-0.2958146035671234,
0.32702168822288513,
0.20863698422908783,
-0.31616899371147156,
-0.6758222579956055,
-0.7689031958580017,
0.47734683752059937,
-0.049613259732723236,
-0.3010762929916... | |
native and current-language names to allow both native and non-native speakers to view the specified translations, e.g. "Deutsch (German)" if the current locale is EN-`*`.
A lot of sites use a flag icon to show the current locale, but this is more relevant to the location and some people may be offended if you show on... | [
0.18500767648220062,
0.14269016683101654,
0.1409253180027008,
-0.052487295120954514,
-0.024510711431503296,
-0.19177749752998352,
0.43365561962127686,
0.5304524302482605,
-0.32606786489486694,
-0.5079290866851807,
-0.6401407718658447,
-0.21659895777702332,
-0.08501888811588287,
0.422628521... | |
choice.
Semi-related: if your users are in located in different time zones include a zone preference in their account profile for displaying time values in their local time. And store all time stamps using UTC. | [
0.27488452196121216,
-0.3573785126209259,
0.4209122061729431,
0.517714262008667,
0.34264275431632996,
0.16201288998126984,
0.09363489598035812,
0.32232651114463806,
-0.43132153153419495,
-0.600022554397583,
-0.23693087697029114,
0.09569106251001358,
0.048103343695402145,
0.0781696960330009... | |
I want to crawl a site with Greasemonkey and wonder if there is a better way to temporarily store values than with GM\_setValue.
What I want to do is crawl my contacts in a social network and extract the Twitter URLs from their profile pages.
My current plan is to open each profile in it's own tab, so that it looks m... | [
0.8178319931030273,
0.2871166169643402,
0.30108916759490967,
-0.1392025351524353,
-0.015361495316028595,
0.18527401983737946,
0.20811493694782257,
0.32661569118499756,
-0.14474911987781525,
-0.8561593890190125,
0.3196549117565155,
0.5312870740890503,
-0.08868716657161713,
-0.04544777050614... | |
happy with the storage option, though. Maybe there is a better way?
I have considered inserting the user profiles into the current page so that I could all process them with the same script instance, but I am not sure if XMLHttpRequest looks indistignuishable from normal user initiated requests.
I've had a similar pro... | [
0.505756676197052,
-0.004496914800256491,
0.1839369684457779,
0.24568238854408264,
-0.2270481288433075,
-0.1873285174369812,
0.005915560759603977,
0.1250888705253601,
-0.2692556381225586,
-0.5433549880981445,
0.2688641846179962,
0.3655615448951721,
-0.11272888630628586,
-0.0300077479332685... | |
can be stored in a form (hidden using style properties if you want), using field names or id's to identify the data. Then all you need to do is make the form action an .aspx page and submit the form using javascript.
(Alternatively you could add a submit button to the page, allowing you to check the form values before... | [
0.3787905275821686,
-0.23277099430561066,
0.46116194128990173,
0.24988076090812683,
0.07735615968704224,
-0.28465545177459717,
-0.00810309685766697,
-0.38057753443717957,
-0.02832302264869213,
-0.5980427265167236,
-0.3826417922973633,
0.318665087223053,
-0.0834323987364769,
-0.232159793376... | |
I'm looking for a way to get the categories defined in the site directory of a portal programmatically. As far as I could see categories are represented as fields of the type "choice" with multiple values the user can chose form.
My problem is, how could I distinguish category fields from normal fields like "title" o... | [
0.4456200897693634,
0.1936763972043991,
0.024578846991062164,
0.20847006142139435,
-0.16737841069698334,
-0.20798282325267792,
0.06172706559300423,
0.13405515253543854,
-0.35182711482048035,
-0.3025364279747009,
0.05227880924940109,
0.47571736574172974,
-0.23220381140708923,
0.439879417419... | |
information about this problem.
Bye Flo
It may be `body.onunload` in the source of the page loaded in the IFRAME.
As the modal window is essentially an IFRAME, then when you close (or refresh) the main window, the browser knows it is killing that IFRAME, hence any `body.onunload` in that IFRAME fires. | [
0.33046358823776245,
-0.1406986266374588,
0.7154412865638733,
0.0613836832344532,
-0.01993962936103344,
-0.2341209352016449,
0.09719860553741455,
0.278329461812973,
-0.36206719279289246,
-0.3916469216346741,
-0.19790804386138916,
0.5161404013633728,
-0.2558038830757141,
-0.0061559742316603... | |
I have the following situation:
There is a tool that gets an XSLT from a web interface and embeds the XSLT in an XML file (Someone should have been fired). "Unfortunately" I work in a French speaking country and therefore the XSLT has a number of words with accents. When the XSLT is embedded in the XML, the tool conve... | [
0.5571017265319824,
0.28065916895866394,
0.24995531141757965,
-0.25849083065986633,
0.015631211921572685,
0.10529263317584991,
0.5302868485450745,
0.38914501667022705,
0.1541154831647873,
-0.6811146140098572,
0.012559555470943451,
0.44449296593666077,
-0.0552079901099205,
-0.18173855543136... | |
XSLT the Xalan tool throws an exception.
I initially though to do a regexp to change all the accents in the XSLT usch as:
```
# the & is omitted in the codes becuase it will be rendered in the page
$xslt =~s/Aacute;/Á/gso;
$xslt =~s/aacute;/á/gso;
$xslt =~s/Agrave;/À/gso;
$xslt =~s/Acirc;/Â/gso;
$xslt =~s/agrave;/à... | [
0.08067668229341507,
0.11499722301959991,
0.7574981451034546,
-0.18472044169902802,
-0.13402557373046875,
0.0535716712474823,
0.5925154685974121,
0.08861038833856583,
0.06528650969266891,
-0.734585702419281,
-0.39813318848609924,
0.5734294652938843,
-0.4443124532699585,
-0.4002794623374939... | |
I need to have a Perl only solution, security does not let me install any type of libs they have not checked for a week or so :(
You can try something like [HTML::Entities](http://search.cpan.org/~gaas/HTML-Parser-3.59/lib/HTML/Entities.pm). From the POD:
```
use HTML::Entities;
$a = "Våre norske tegn bø... | [
0.165145143866539,
0.15201428532600403,
0.634163498878479,
0.11898383498191833,
0.1336386501789093,
-0.1303531527519226,
0.2767057418823242,
-0.23445676267147064,
-0.32182255387306213,
-0.4605773091316223,
-0.13930293917655945,
0.2968193292617798,
-0.396090030670166,
0.004664938896894455,
... | |
installed"'
``` | [
0.3160068094730377,
0.22245462238788605,
0.6331926584243774,
0.20398764312267303,
0.47525906562805176,
-0.01689322106540203,
-0.04956348240375519,
-0.028626760467886925,
-0.25763562321662903,
-0.3500775396823883,
-0.22329409420490265,
0.520793616771698,
-0.250672847032547,
-0.1509260088205... | |
I'm building a MVC web application (using the Spring MVC framework), and I'm a little stumped on the best way to design a particular area.
The application has to interact with a series of web services which are not really all that greatly designed, and don't offer much abstraction in and of themselves - basically ther... | [
0.3494979441165924,
0.35619381070137024,
0.19347622990608215,
-0.0017028562724590302,
0.03013710305094719,
0.050244078040122986,
-0.019867049530148506,
-0.19995656609535217,
-0.17503903806209564,
-0.2716977596282959,
-0.12519240379333496,
0.6343421339988708,
-0.1080809235572815,
-0.0206546... | |
to - in other words, there are no "transaction" based methods.
For example, simply to create a new user account requires calling a total of seven different web service methods to set up all of the records in the necessary tables (a `user` record, adding the correct `privileges` to that user, setting up the user's `bil... | [
0.29121237993240356,
-0.04352249205112457,
0.5163748264312744,
0.2248387187719345,
0.39281949400901794,
0.1450701504945755,
-0.025036931037902832,
-0.22332732379436493,
-0.17577342689037323,
-0.4714571535587311,
-0.18145279586315155,
0.5848714113235474,
-0.35048264265060425,
0.183466017246... | |
represent and abstract the datatypes defined in the web service WSDL, so that my domain logic is not dependent on the web service types and so that we can abstract and hide whichever details we like.
What I'm looking for some opinions on is the best way to design the "user creation process" I mentioned above as an exa... | [
0.6431128978729248,
-0.054455023258924484,
0.2982276678085327,
0.19090618193149567,
-0.22022278606891632,
-0.039623063057661057,
0.13183081150054932,
-0.01783481054008007,
-0.3871699571609497,
-0.6509726047515869,
0.029073871672153473,
0.47978726029396057,
-0.12577378749847412,
0.280002325... | |
different web services to be invoked.
Currently I've only designed this "regular user" creation, as a bit of a proof of concept - I have a domain object `User`, a `UserDao` interface which has methods for `getUser(name)` and `createUser(User)`, and a `WebServiceUserDao` which implements the `UserDao` methods and knows... | [
0.16243799030780792,
0.25903600454330444,
0.49994078278541565,
0.06716848909854889,
-0.12182793766260147,
-0.029003290459513664,
0.2568298280239105,
0.027152901515364647,
-0.18194574117660522,
-0.6597200036048889,
0.019115805625915527,
0.3278680443763733,
-0.26360273361206055,
0.1316814720... | |
`User.getType()`, I'm unsure where to draw the line between the business/service layer class and the DAO. For instance, should I:
1. Create one `UserDao` implementation per "user type", so the logic to create each "user type" can be encapsulated in it's own class, and let the `UserCreationService` decide which `UserDa... | [
0.3321891129016876,
0.08169152587652206,
0.15161599218845367,
-0.00029019807698205113,
-0.11155816912651062,
-0.08313006907701492,
0.06390373408794403,
-0.4260995090007782,
0.08803442865610123,
-0.6516371369361877,
-0.19268682599067688,
0.2134719043970108,
-0.4430675208568573,
0.0787116736... | |
And then have different `UserCreationService` implementations for the various different "user types"? In other words, this strategy would have a `PrivilegesDao`, a `BillingPlanDao`, etc., even though I would have no need for a corresponding `Privilege` or `BillingPlan` domain object. This would be many service classes ... | [
0.06846708804368973,
-0.001262529636733234,
0.23564597964286804,
0.2615104615688324,
0.1120515912771225,
-0.35263311862945557,
0.08481807261705399,
-0.23312263190746307,
-0.106475830078125,
-0.5080926418304443,
-0.14770983159542084,
0.39115259051322937,
-0.18624365329742432,
0.159275233745... | |
and might lead to less complication when viewed from an overall API perspective.
One goal that I have with this application is to make sure that if we ever have to change the details of the data persistence, that all we need to do is change the DAO implementations - if we have to start interfacing with a different bil... | [
0.31798651814460754,
0.3185397684574127,
0.2746324837207794,
0.1457352340221405,
0.15660671889781952,
0.15702654421329498,
-0.031111767515540123,
-0.009121693670749664,
-0.16901670396327972,
-0.5064114332199097,
0.16240395605564117,
0.7191190719604492,
0.01184518076479435,
-0.0979070439934... | |
What kind of strategies do you use when deciding where to break down "business logic" versus "data access logic" when they seem to overlap?
Maybe you can have three layers instead of two: "one extra level of indirection".
At the top layer, you might have business logic which doesn't know about data-access: this busin... | [
0.16250526905059814,
-0.09804506599903107,
0.1617373675107956,
0.471785306930542,
0.06852149963378906,
0.11882580071687698,
0.03974384069442749,
-0.21526457369327545,
-0.19787055253982544,
-0.629745364189148,
-0.1794244349002838,
0.7336289882659912,
-0.012648525647819042,
-0.02367574535310... | |
(e.g. User and Account) but not what your business logic is. The middle layer knows your data access layer. The job of your middle layer is to use your data access layer's API to I/O your business objects. | [
0.26135843992233276,
0.2380438596010208,
0.3543884754180908,
0.3776872158050537,
0.3285735547542572,
0.13455037772655487,
0.01582261547446251,
-0.031209155917167664,
-0.028011703863739967,
-0.6931224465370178,
-0.13140588998794556,
0.6129248738288879,
-0.015827886760234833,
0.0642605200409... | |
I want to add a row of headers to an existing CSV file, editing in place. How can I do this?
```
echo 'one, two, three' > testfile.csv
```
and I want to end up with
```
column1, column2, column3
one, two, three
```
Changing the initial CSV output is out of my hands.
Any standard command will do. The impo... | [
0.521064043045044,
0.16414791345596313,
0.42382001876831055,
-0.08779299259185791,
-0.16481055319309235,
0.2809552848339081,
0.19808979332447052,
-0.644866406917572,
-0.41317835450172424,
-0.48416873812675476,
-0.08812449127435684,
0.3243262767791748,
-0.6332709193229675,
0.227202281355857... | |
A "non-believer" of C# was asking me what the purpose to extension methods was. I explained that you could then add new methods to objects that were already defined, especially when you don't own/control the source to the original object.
He brought up "Why not just add a method to your own class?" We've been going ro... | [
0.46090108156204224,
0.09009095281362534,
-0.011164279654622078,
0.16097794473171234,
-0.13061116635799408,
-0.10431025922298431,
0.26713845133781433,
-0.28442972898483276,
-0.05456724390387535,
-0.22133395075798035,
0.08959613740444183,
0.34196409583091736,
-0.3599069118499756,
0.17176145... | |
used extension methods that you couldn't have (or shouldn't have) used a method added on to your own class?
I think extension methods help a lot when writing code, if you add extension methods to basic types you'll get them quicky in the intellisense.
I have a format provider to [format a file size](https://stackoverf... | [
0.2900390326976776,
0.09221921116113663,
0.528502345085144,
-0.19635549187660217,
0.058155328035354614,
-0.0387042872607708,
-0.1838790625333786,
-0.24168163537979126,
-0.19581088423728943,
-0.8069453835487366,
-0.10021960735321045,
0.7604659199714661,
-0.2254572957754135,
0.02780143171548... | |
Ok, this is bugging me, and I just can't figure out what is wrong...
I have made two forms. First form just has a simple button on it, which opens the other as a dialog like so:
```
using (Form2 f = new Form2())
{
if (f.ShowDialog() != DialogResult.OK)
MessageBox.Show("Not OK");
else
MessageBo... | [
0.19582803547382355,
-0.06948134303092957,
0.6300826668739319,
-0.3322605788707733,
0.1195150688290596,
-0.10258782655000687,
0.18269366025924683,
-0.22103263437747955,
-0.1130497083067894,
-0.5868497490882874,
-0.17775185406208038,
0.44244053959846497,
-0.6540243625640869,
0.0639029964804... | |
is all that should be needed to make this work. But when I run it, I click on the button which opens up Form2. I can now click on the one set as CancelButton, and I get the "Not OK" message box. But when I click on the one set as AcceptButton, nothing happens?
The InitializeComponent code of Form2 looks like this:
```... | [
0.2478916347026825,
-0.31990694999694824,
0.7852001786231995,
-0.35857337713241577,
0.5494381785392761,
-0.35085588693618774,
0.1667771190404892,
-0.04490119218826294,
-0.16966651380062103,
-0.4062221944332123,
-0.4215468168258667,
0.4982782304286957,
-0.46726417541503906,
-0.0166342183947... | |
= new System.Drawing.Point(211, 13);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.DialogResult = System.Window... | [
-0.22276057302951813,
-0.30756738781929016,
0.8707967400550842,
-0.09487918764352798,
0.26237598061561584,
0.4657895863056183,
0.2082325518131256,
-0.39519768953323364,
-0.5272855162620544,
-0.5498387217521667,
-0.3584156036376953,
0.1774599403142929,
-0.2730679512023926,
0.131128177046775... | |
//
// Form2
//
this.AcceptButton = this.button1;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.button2;
this.ClientSize = new System.Drawing.Size(298, 59);
this.Controls.Add(this.butt... | [
0.15420465171337128,
-0.19170868396759033,
0.8432548642158508,
-0.38380002975463867,
0.2925060987472534,
0.13722331821918488,
0.3036627173423767,
-0.5523670315742493,
-0.36310023069381714,
-0.5831142663955688,
-0.24508529901504517,
0.7505375146865845,
-0.4615304172039032,
-0.17622458934783... | |
not enough. This just tells which button should be invoked on `Enter`/`Esc`. You have to set the button's `DialogResult` property. | [
0.22812119126319885,
-0.0721336230635643,
0.6357752084732056,
0.17071691155433655,
0.4392792582511902,
-0.024763906374573708,
0.29170477390289307,
-0.32477137446403503,
-0.09629560261964798,
-0.5211544632911682,
-0.17691011726856232,
0.8472574949264526,
-0.2554320693016052,
-0.213494122028... | |
We have an old legacy PHP application. Now I want to write a new application module using Ruby on Rails.
Deployment is a one problem. I guess that it should be possible to run PHP app (via mod\_php) and RoR app (via mod\_proxy / mongrel) on a one Apache server. I don't want to use mod\_rails because it requires to ru... | [
0.41630733013153076,
0.20984438061714172,
0.3062763810157776,
0.20034325122833252,
-0.07535525411367416,
-0.10347939282655716,
0.43081924319267273,
-0.21591709554195404,
-0.19805879890918732,
-0.629041314125061,
0.10861552506685257,
0.6454004645347595,
-0.3545095920562744,
0.24306292831897... | |
info is stored in PHP session data. The RoR app will be placed in a subdirectory of main PHP app (eg www.example.com/railsapp). So RoR should receive all HTTP cookies. And the question is how to extract PHP session data from RoR app.
Above this is just my first idea which is rather bad because of possible race conditi... | [
0.16531413793563843,
0.01666906848549843,
0.5823798179626465,
0.38317742943763733,
-0.12198016047477722,
-0.08798050135374069,
0.31093406677246094,
-0.17808426916599274,
-0.03436785936355591,
-0.43803873658180237,
0.11917349696159363,
0.8957061171531677,
-0.19528980553150177,
-0.0536040924... | |
updated (logout a user).
Does anyone solved similar problem? Or at least can point a most promising direction?
Update: It should be possible to configure mod\_php to store session data in sql DB. In this way there will be no race conditions. DB engine should prevent race conditions.
Update2: Actually it is possible... | [
0.046965617686510086,
0.002030236879363656,
0.304820716381073,
0.20048630237579346,
-0.4043513238430023,
-0.059391964226961136,
0.5390214323997498,
-0.14082615077495575,
-0.23213240504264832,
-0.786791205406189,
0.001946470234543085,
0.6976165771484375,
-0.30822765827178955,
-0.36170017719... | |
directory it is possible to use mod\_rails. In your configuration for the PHP site you can have a location that has a root for rails.
```
<Location /railsapp>
DocumentRoot /.../app/public
</Location>
```
To get a session over to the rails side, you could either create a connect page on the rails and call it from t... | [
0.3366847634315491,
0.0022926279343664646,
0.26357364654541016,
0.1738627552986145,
-0.25106412172317505,
-0.15819944441318512,
0.36700114607810974,
0.008431344293057919,
-0.27163347601890564,
-0.6321464776992798,
0.12733706831932068,
0.46788546442985535,
-0.392302006483078,
0.211573556065... | |
store it in a cookie with the correct name and secret, and create a session in the database manually with that id.
You can also (which I recommend) have proxy page on the rails side which logs the user in and redirects them to their desired page. You could do it like this (*not actual working code, but you get the ide... | [
-0.027465347200632095,
-0.06513974070549011,
0.2971112132072449,
0.04115557298064232,
0.09547588974237442,
-0.21463491022586823,
-0.006788814440369606,
-0.2183825820684433,
-0.15648958086967468,
-0.824940025806427,
-0.04977388679981232,
0.3668220043182373,
-0.11615792661905289,
0.238866373... | |
if params[:key] == key
login_user params[:userid]
redirect_to params[:page]
else
render :nothing, :status => 403
end
end
end
``` | [
-0.2690718173980713,
0.0011956162052229047,
0.7879236936569214,
-0.044221412390470505,
0.008466128259897232,
0.0073514217510819435,
0.49850994348526,
-0.4085891842842102,
-0.37071001529693604,
-0.595099151134491,
-0.4283234775066376,
0.20734025537967682,
-0.4202967584133148,
0.381261646747... | |
I'm working on a Silverlight app using the MVVM pattern. My ViewModel currently consists of a property that represents a collection of Model Objects:
```
public ObservableCollection<IndexEntry> IndexList
{
get;
set;
}
```
it also has several methods that will populate that col... | [
0.056884147226810455,
0.07423417270183563,
0.6771647334098816,
0.053837571293115616,
0.042199645191431046,
0.04561041668057442,
0.036079153418540955,
-0.10663668066263199,
-0.2724137604236603,
-0.67787104845047,
-0.02047736756503582,
0.3383506238460541,
-0.49209076166152954,
0.458784788846... | |
I implement `IDisposable` and set the property's reference to null or will the destruction of this class be sufficient to remove all references to the collection tis property refers to? Are there any caveats that might leave a reference hanging out there?
Thanks.
The only way a reference survives garbage collection is... | [
0.4154450297355652,
0.0809125080704689,
-0.03912177309393883,
0.29115647077560425,
0.17935802042484283,
-0.3553524315357208,
0.4216012954711914,
-0.31178125739097595,
-0.09800877422094345,
-0.4157077670097351,
0.008667325600981712,
0.6059850454330444,
-0.2626609802246094,
0.428620010614395... | |
your collection. You have one reference to it, in your property. Some other code executes the line "ObservableCollection<> myOtherReference = YourObject.IndexList;". They now have a reference to the actual memory object, too. Making your property reference null will only eliminate your property's reference; the 'myOthe... | [
0.2044467329978943,
0.0115232914686203,
0.4798171818256378,
0.3289683163166046,
0.05718633159995079,
0.1234063133597374,
0.021195249632000923,
-0.2741405665874481,
-0.40186238288879395,
-0.5568222403526306,
-0.1502898782491684,
0.4181791841983795,
-0.34691935777664185,
0.5078340768814087,
... | |
to it will throw an exception. | [
0.1778509020805359,
0.21696390211582184,
0.11909804493188858,
-0.15563704073429108,
-0.021717296913266182,
0.09104529768228531,
-0.1218850314617157,
-0.03568929433822632,
-0.0010195064824074507,
-0.7826583385467529,
-0.16249249875545502,
0.3010079562664032,
0.016467342153191566,
0.17048597... | |
We have written a number of SSIS packages that import data from CSV files using the Flat File Source.
It now seems that after these packages are deployed into production, the providers of these files may deliver files where the column order of the files changes (Don't ask!). Currently if this happens, our packages wi... | [
0.4390734136104584,
0.08886124193668365,
0.404003769159317,
0.18563050031661987,
0.19419556856155396,
0.033200476318597794,
0.21432022750377655,
-0.1828853040933609,
-0.3527243137359619,
-0.6064848303794861,
-0.263225793838501,
0.47696244716644287,
-0.32301759719848633,
0.18982070684432983... | |
following content :
```
OurReference,Client,Amount
235,MFI,20000.00
236,MS,30000.00
```
The output from the flat file source is :
```
OurReference Client Amount
235 ClientA 20000.00
236 ClientB 30000.00
```
Subsequently, the file delivered changes to :
```
OurReference,ClientReference... | [
0.11637422442436218,
0.19243329763412476,
0.8404328227043152,
-0.10658188164234161,
0.14982998371124268,
0.6649543046951294,
-0.018063860014081,
-0.2274017632007599,
-0.36442285776138306,
-0.566646933555603,
-0.26042428612709045,
0.7623475193977356,
-0.39498624205589294,
0.1313293725252151... | |
B222 ClientB,30000.00
```
Ideally, we would like to use a data source that will cope with this problem - ie which produces output based on the column names, instead of the column order.
Any suggestions would be welcomed!
Not that I know of.
A possibility to check for the problem in advance is to set up two dif... | [
0.27686187624931335,
-0.006513337604701519,
0.28542831540107727,
-0.04305088892579079,
0.06693218648433685,
-0.16499057412147522,
0.11257077008485794,
0.14375776052474976,
-0.3166642487049103,
-0.658578634262085,
-0.20203030109405518,
0.5648233890533447,
-0.37170371413230896,
0.05984368175... | |
that flat one-field row the only connection manager, and use a script component in your flow to parse the row and assign to the columns you need later in the flow.
As far as I know, there is no way to dynamically add columns to the flow at runtime - so all the columns you need will need to be added to the script task ... | [
0.1360005885362625,
-0.1443120688199997,
0.3059736490249634,
0.11910010874271393,
0.10102120786905289,
0.047010887414216995,
-0.020054547116160393,
0.059902045875787735,
-0.351946085691452,
-0.7017941474914551,
0.02125413902103901,
0.7975309491157532,
-0.3329947888851166,
0.005868497304618... | |
final possibility is to use the SSIS object model to modify the package before running to alter the connection manager - or even to write the entire package dynamically using the object model based on an inspection of the input file. I have done quite a bit of package generation in C# using templates and then adding in... | [
0.07286470383405685,
-0.14100173115730286,
0.3727230429649353,
0.12895505130290985,
0.03204435482621193,
-0.2269681841135025,
0.16010886430740356,
-0.04557815194129944,
-0.15721005201339722,
-0.7583180069923401,
-0.09274891018867493,
0.8295536041259766,
-0.15533071756362915,
-0.07482615113... | |
After user places an order I have to send detailed email message containing order details, instructions for payment, some additional text etc.
I want to create nicely formatted HTML email message.
By now I found two options:
* manually creating piece by piece, string by string, which is too cumbersome,
* creating ac... | [
0.3768409192562103,
0.03600076586008072,
0.5117032527923584,
-0.15116176009178162,
-0.5099572539329529,
0.07910697162151337,
0.25346261262893677,
-0.23894721269607544,
-0.30532363057136536,
-0.8623416423797607,
-0.059591881930828094,
0.37468773126602173,
-0.2863166630268097,
-0.15637108683... | |
overhead to instantiate page and render it
How to load page and render it? Do you have any other ideas or suggestions for this task?
I'll use a template like Jay mentioned.
Below resource might turn out useful for you.
<http://dotnettricks.com/blogs/roberhinojosablog/archive/2006/05/12/57.aspx> | [
0.559051513671875,
-0.3440232276916504,
0.46480032801628113,
0.08327925205230713,
-0.24241527915000916,
0.13104170560836792,
0.1717628687620163,
-0.08160839229822159,
-0.35229018330574036,
-0.6840305924415588,
0.3310241401195526,
0.6005104780197144,
-0.038764096796512604,
-0.02333193831145... | |
ModelMultipleChoiceField doesn't select initial choices and I can't make the following fix (link below) work in my example:
<http://code.djangoproject.com/ticket/5247#comment:6>
My models and form:
```
class Company(models.Model):
company_name = models.CharField(max_length=200)
class Contact(models.Model):
... | [
-0.4155706465244293,
-0.254611611366272,
0.476243257522583,
-0.30557942390441895,
0.13583508133888245,
0.13732685148715973,
-0.028122255578637123,
-0.3669026494026184,
-0.14020869135856628,
-0.48436832427978516,
-0.30946022272109985,
0.7597060799598694,
-0.25086769461631775,
0.114579327404... | |
for test, otherwise a variable
>>> form = Action_Form(initial={'from_company': [o.pk for o in contacts_from_company]}) # as suggested in the fix
>>> print form['from_company']
<ul>
</ul>
>>> print contacts_from_company
[<Contact: test person>, <Contact: another person>]
>>> form2 = Action_Form(initial={'from_company':... | [
-0.1221751719713211,
-0.47636204957962036,
0.4998401999473572,
0.13537180423736572,
0.031562402844429016,
-0.016431011259555817,
0.2525402903556824,
-0.6031901836395264,
-0.0881950855255127,
-0.5440829396247864,
0.05406191945075989,
0.5102146863937378,
-0.09908056259155273,
-0.080768510699... | |
can I pass a variable to Action\_Form(ModelForm) so that in my ModelForm I could have:
```
from_company = forms.ModelMultipleChoiceField(queryset=Contact.objects.filter(company__exact=some_id) # where some_id comes from a view
```
You will need to add an `__init__` method to `Action_Form` to set your initial values,... | [
-0.14985771477222443,
-0.23432141542434692,
0.547462522983551,
-0.27564162015914917,
-0.0773865357041359,
0.29315584897994995,
0.15582507848739624,
-0.4745340347290039,
-0.329395592212677,
-0.30575674772262573,
-0.16959001123905182,
0.4664801359176636,
-0.43881067633628845,
-0.119864359498... | |
probably better:
```
myfilter = kwargs.pop('myfilter')
```
For more information, here's another link referring to [Dynamic ModelForms in Django](http://www.rossp.org/blog/2008/dec/15/modelforms/). | [
-0.16942957043647766,
-0.18642127513885498,
0.43640199303627014,
-0.03876771032810211,
-0.26624420285224915,
-0.20268510282039642,
-0.04225316643714905,
0.08345934748649597,
-0.4636661410331726,
-0.6992985606193542,
-0.09048845618963242,
0.5089455246925354,
-0.022497287020087242,
-0.076386... | |
I'm working on a basic Issue Management System in order to learn ASP.NET MVC. I've gotten it up and running to a fairly decent level but I've run into a problem.
I have a controller named Issue with a view called Open. /Issue/Open lists all of the open issues currently logged on the system. I've defined a route like s... | [
0.012800952419638634,
0.0826493576169014,
0.3981148898601532,
0.04239369556307793,
-0.022134123370051384,
-0.16886445879936218,
0.2402079850435257,
0.05823612958192825,
-0.6585701704025269,
-0.88958340883255,
-0.08523835241794586,
0.17325691878795624,
-0.4324812889099121,
-0.08756136149168... | |
// Route name
"Issue/Open/{sort}", // URL with parameters
new { controller | [
-0.15698522329330444,
-0.3740377128124237,
0.576002836227417,
0.3042736351490021,
0.1622784435749054,
-0.18908314406871796,
-0.18622075021266937,
0.07957771420478821,
-0.4036768078804016,
-0.4583420157432556,
-0.22235868871212006,
0.22213834524154663,
-0.22497104108333588,
0.51811599731445... | |
= "Issue", action = "Open", sort = "TimeLogged" } // Parameter defaults
);
```
This is working fine so far, using the following code in IssueController.cs:
```
public ActionResult Open(string sort)
{
var Issues = from i in db.Issues where i.Status == "Open" orderby i.TimeLogged ascending select ... | [
-0.22873732447624207,
-0.18290932476520538,
0.4563787281513214,
-0.3544776439666748,
0.004568458069115877,
0.12355197221040726,
0.09823666512966156,
-0.5788679718971252,
-0.5747427940368652,
-0.5627087354660034,
-0.42478641867637634,
0.6509813070297241,
-0.271747350692749,
0.07874217629432... | |
"Open" orderby i.ID ascending select i;
break;
case "TimeLogged":
goto default;
case "Technician":
Issues = from i in db.Issues where i.Status == "Open" orderby i.Technician ascending select i;
break;
case "Customer": | [
-0.03951016068458557,
0.10121405124664307,
0.3403240144252777,
-0.24451392889022827,
0.04288588836789131,
0.12055067718029022,
0.37007617950439453,
-0.3093796968460083,
0.026395056396722794,
-0.4155094027519226,
-0.7282673120498657,
0.44100308418273926,
0.0147708086296916,
0.46165317296981... | |
Issues = from i in db.Issues where i.Status == "Open" orderby i.Customer ascending select i;
break;
case "Category":
Issues = from i in db.Issues where i.Status == "Open" orderby i.Category ascending select i;
break;
case "Priority": | [
-0.3961404263973236,
0.312379390001297,
0.2108381688594818,
-0.07529928535223007,
-0.49113228917121887,
0.3913787007331848,
0.06818138808012009,
-0.34036725759506226,
-0.4550277590751648,
-0.2591172456741333,
-0.6987062692642212,
0.400981068611145,
-0.02216939814388752,
0.34769755601882935... | |
Issues = from i in db.Issues where i.Status == "Open" orderby i.Priority ascending select i;
break;
case "Status":
Issues = from i in db.Issues where i.Status == "Open" orderby i.Status ascending select i;
break;
default:
break;
} | [
-0.29403698444366455,
0.2556588649749756,
0.22041696310043335,
-0.0930667519569397,
-0.21024823188781738,
0.3286302089691162,
0.170450359582901,
-0.42561250925064087,
-0.37823668122291565,
-0.3705848157405853,
-0.610022246837616,
0.4461057186126709,
-0.12258333712816238,
0.3340947926044464... | |
ViewData["Title"] = "Open Issues";
ViewData["SortID"] = sort.ToString();
return View(Issues.ToList());
}
```
This is working fine (although, I wonder if there is a better way to handle my definition of the query than a switch?) but now I want to be able to do two things on the Open Issues view:
1. Sort by a... | [
-0.020572207868099213,
-0.2353590577840805,
0.48981544375419617,
-0.0633668377995491,
0.007885481230914593,
-0.07761935889720917,
-0.02789633721113205,
-0.27116432785987854,
-0.48726046085357666,
-0.583149254322052,
-0.11201188713312149,
0.6681795716285706,
-0.4975863993167877,
0.140851676... | |
organise my queries. I've also just realised that unless I figure out how to generate my queries on the fly I am going to need (number of sort options) \* (number of filter options) in my switch.
Argh, can anyone point me in the right direction? Cheers!
1. Remove sort from the route. Just use a route without a paramet... | [
0.10932648926973343,
0.28625717759132385,
0.6613522171974182,
-0.39066624641418457,
-0.3912605941295624,
0.05763344466686249,
0.26385533809661865,
-0.3676225543022156,
-0.539419412612915,
-0.5842933058738708,
-0.20340506732463837,
0.5275641679763794,
-0.504847526550293,
-0.1430778056383133... | |
string) for any of these query string parameter arguments which might not be filled in.
I actually think this is a "more correct" way to write the URL. The URL itself identifies the resource (open issues); the query string parameters customize how to display the resource.
As far as the number of queries go, remember ... | [
-0.10435554385185242,
0.12000678479671478,
0.40499669313430786,
0.0934787392616272,
-0.19050948321819305,
0.10271945595741272,
0.1284029334783554,
-0.4980982542037964,
-0.2456492781639099,
-0.6859972476959229,
-0.2246219962835312,
0.5519193410873413,
-0.2900218367576599,
0.2280053794384002... | |
Issues = Issues.OrderBy(i => i.ID);
break;
// [...]
default:
Issues = Issues.OrderBy(i => i.TimeLogged);
}
``` | [
-0.1078641265630722,
0.2541608512401581,
0.2438744157552719,
-0.2637846767902374,
0.37115007638931274,
-0.06863074004650116,
0.19186967611312866,
-0.19032151997089386,
-0.5668295621871948,
-0.423922598361969,
-0.4487171173095703,
0.566083550453186,
-0.5362011790275574,
0.2663405239582062,
... | |
I have a small text file that I'd like to read into a scalar variable exactly as it is in the file (preserving line separators and other whitespace).
The equivalent in Python would be something like
```
buffer = ""
try:
file = open("fileName", 'rU')
try:
buffer += file.read()
finally:
fil... | [
0.0038617977406829596,
0.17121128737926483,
0.1440068930387497,
-0.26907944679260254,
0.03945109620690346,
-0.0916392132639885,
0.3977673351764679,
0.035077933222055435,
-0.10467314720153809,
-0.5106924772262573,
-0.10871239006519318,
0.34551557898521423,
-0.342592716217041,
0.037576012313... | |
message is going into my file buffer.
From the [Perl Cookbook](http://oreilly.com/catalog/cookbook/chapter/ch08.html):
```
my $filename = 'file.txt';
open( FILE, '<', $filename ) or die 'Could not open file: ' . $!;
undef $/;
my $whole_file = <FILE>;
```
I would localize the changes though:
```
my $whole_file =... | [
-0.04136257991194725,
-0.22724783420562744,
0.7027726173400879,
-0.4003220200538635,
0.20909340679645538,
0.28472909331321716,
0.5461620688438416,
0.33246853947639465,
-0.34031400084495544,
-0.9437922239303589,
-0.5103161334991455,
0.17626138031482697,
-0.5425559282302856,
0.33563891053199... | |
I've got a very simplistic "game" set up on the iPhone. Things move around, rotate, you can interact with them, etc. In the simulator, it runs fine, but on the device it gets around 0.25 FPS, and it's so slow that it doesn't have time to recognize touches, apparently.
This was originally just using a UIView with an ar... | [
0.36070194840431213,
-0.15769390761852264,
0.6004409193992615,
0.06454931199550629,
0.06686771661043167,
0.24053072929382324,
0.11745546758174896,
-0.21357809007167816,
0.0990508496761322,
-0.6014705896377563,
0.4804568588733673,
0.5442532300949097,
-0.2072211056947708,
-0.0642802268266677... | |
working so horribly slow, so I turned the `Item` class into a subclass of the `CALayer` class, moving the layer around instead of redrawing the items. However, I was moving the `CALayer` around manually, frame-by-frame, and this, apparently, is no good. It was still way too slow. So I told it to move to its final desti... | [
0.4406057596206665,
-0.01875351555645466,
0.13489705324172974,
0.1361340433359146,
-0.44267258048057556,
0.36345604062080383,
0.008458922617137432,
-0.11051753908395767,
-0.08056558668613434,
-0.571887731552124,
0.22548715770244598,
0.22791749238967896,
-0.08822648972272873,
0.236449509859... | |
back to moving every tick, and instead of just setting the new position, I also wrapped it in a CATransaction and gave the transaction the same length as the tick.
Works OK, but new problem arises: If I want to animate something, I still have to use [self setNeedsDisplay] every tick, which calls `drawInContext:`, and ... | [
0.36028367280960083,
-0.3264489471912384,
0.44171378016471863,
0.2812333405017853,
0.050383664667606354,
-0.03939902037382126,
-0.02437758818268776,
-0.09990938752889633,
-0.3224930167198181,
-0.6146302223205566,
0.24824270606040955,
0.6257566809654236,
-0.076167032122612,
-0.0569144152104... | |
or in embedded C++. What am I missing? Do I really need to learn OpenGL to do any sort of interesting manual animation?
I found out the real issue was the necessity to call `[self setNeedsDisplay]`. Redrawing on a frame-by-frame basis is bad mojo. So I am using images instead for the most part, and I can still get away... | [
-0.06706945598125458,
-0.15872414410114288,
0.22207309305667877,
-0.21941865980625153,
-0.3927623927593231,
0.18888115882873535,
0.2512959837913513,
-0.41769078373908997,
-0.05303802713751793,
-0.6217013001441956,
-0.18564842641353607,
0.8339308500289917,
-0.32418909668922424,
-0.317124575... | |
We have just started using ASP.Net MVC Release Candidate and the test project we have was previously testing Ajax requests with MVC beta.
The old code looked something like this:
```
Mock<HttpRequestBase> request = new Mock<HttpRequestBase>();
Mock<HttpResponseBase> response = new Mock<HttpResponseBase>();
Mock<HttpC... | [
0.04847193881869316,
-0.27738651633262634,
0.9745357036590576,
-0.21200400590896606,
-0.22443975508213043,
0.20213237404823303,
0.2567840814590454,
-0.525979220867157,
-0.10678262263536453,
-0.7588595747947693,
-0.30736464262008667,
0.5357783436775208,
-0.17973946034908295,
0.1533025354146... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.