text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
i'm trying to use the GeoKit plugin to calculate the distance between 2 points. So the idea is, i do a search for an article, and the results i want to order by distance. So i have a form where I enter the article (that im looking for) and my address. Then rails must find all articles that match with my query and order...
[ 0.11512715369462967, 0.24294228851795197, 0.6773460507392883, 0.1279309242963791, -0.032509636133909225, 0.1458895057439804, 0.1745140105485916, -0.1508835256099701, -0.0376141220331192, -0.8061603307723999, 0.17548303306102753, 0.27502134442329407, -0.30441001057624817, 0.3123026192188263...
fields: * id * name * user\_id (FK to User model) And my user model has four fields * id * name * lat (latitude) * lng (longitude) OK, to have access to the user info thru articles i do the query: ``` @articles = Article.find(:all,:conditions=>"vectors @@ to_tsquery('büch')",:joins=>" INNER JOIN users ON users.id ...
[ 0.2025851309299469, 0.4088740646839142, 0.8960209488868713, 0.020668869838118553, 0.06972920894622803, 0.20028024911880493, 0.05728406086564064, -0.45094558596611023, -0.052811749279499054, -0.6979132294654846, -0.1525001972913742, -0.035796135663986206, -0.27030113339424133, 0.33961021900...
where uses articles.lat/lng to users.lat/lng it works. I'm not really an SQL expert, and I find joins very hard to wrap my head around (even more than figuring out multiple NOT's like `if(!(foo != !bar & (!baz)))` ) but I do feel that either the `:joins` line or the `:include` line is redundant, or even wrong. (I clea...
[ 0.29655957221984863, 0.39833730459213257, 0.6772865056991577, -0.22534702718257904, 0.2607799470424652, -0.1553063988685608, 0.27597320079803467, -0.15104293823242188, 0.00012266244448255748, -0.8693566918373108, -0.1893022358417511, -0.0822954997420311, -0.4125170111656189, -0.01066590007...
the model of the user and article should define their relation, so you don't need a manual join or that you remove the include. But I don't see from this code where the distance is actually calculated (probably some automagic in GeoKit?). The distance should be "named" with the SQL someting like: ``` SELECT (some_he...
[ 0.303582102060318, 0.33648985624313354, 0.3835311830043793, 0.008320407010614872, -0.03426159545779228, -0.06234245374798775, 0.051901791244745255, -0.4208425283432007, -0.10615963488817215, -0.3295249044895172, 0.038046710193157196, 0.5398330688476562, -0.14748719334602356, 0.256539940834...
better...
[ 0.18535694479942322, 0.06058984249830246, -0.1512853354215622, 0.08802958577871323, -0.2161790132522583, -0.1980179250240326, 0.31620824337005615, -0.08361074328422546, 0.10184971988201141, -0.9973007440567017, 0.05730770528316498, 0.5784403085708618, 0.09722641855478287, 0.135327011346817...
Quick question: Would it be a good or a bad idea to implement my domain-driven design style repositories as singletons? Why? Or should I maybe use a dependency injector container to manage my repositories and decide if they are singletons or not? I'm still reading *DDD Quickly*, and would like to see some good reposi...
[ 0.29967206716537476, -0.19198006391525269, -0.3257049322128296, 0.42431506514549255, -0.15384700894355774, 0.016139788553118706, 0.1052311435341835, 0.3593639135360718, -0.2397814840078354, -0.6344392895698547, 0.08151915669441223, 0.5946672558784485, -0.2623158395290375, 0.352432906627655...
if you avoid this. If you can use a di-container to do this then go for it. You can also make the repositories implement the singleton pattern. I'd try to avoid this because singletons usually use static methods. This can make testing the code that calls into the singletons more difficult. If you have to do things thi...
[ 0.49848702549934387, -0.1781853288412094, -0.6180338263511658, 0.20242352783679962, -0.14031559228897095, -0.23825252056121826, 0.24020913243293762, -0.05882563069462776, -0.17749914526939392, -0.6174356341362, 0.07144869863986969, 0.7700552344322205, -0.46996986865997314, 0.15411771833896...
where the repositories never get called. When someone navigates the object graph in the model and requests an object that isnt loaded the model just raises an event and the repository reacts to this event. This way there are no calls into the repository and it's completely decoupled from the model. I havn't used this a...
[ -0.028032787144184113, 0.04220748320221901, 0.2822286784648895, 0.1604287028312683, -0.14313282072544098, -0.1777908354997635, 0.24469944834709167, -0.17364604771137238, -0.42028099298477173, -0.3776342570781708, 0.05294984579086304, 0.3021084666252136, -0.08172614127397537, 0.187994793057...
Assuming a largish template library with around 100 files containing around 100 templates with overall more than 200,000 lines of code. Some of the templates use multiple inheritance to make the usage of the library itself rather simple (i.e. inherit from some base templates and only having to implement certain busines...
[ 0.691891074180603, 0.13059401512145996, 0.12292342633008957, 0.3044406473636627, 0.3578956425189972, 0.07345535606145859, 0.3399934768676758, -0.4080316722393036, -0.005669926758855581, -0.7340503334999084, -0.181598499417305, 0.12496661394834518, -0.3480980694293976, 0.009258915670216084,...
some interdependent templates need changing. Testing is nearly impossible due to the sheer amount of functions. Now, I would really like to simplify the architecture to use less templates and more specialized smaller classes. Is there any proven way to go about that task? What would be a good place to start? I'm not ...
[ 0.6226793527603149, 0.04136244207620621, -0.3049392104148865, 0.42460447549819946, -0.15131936967372894, 0.02185630425810814, 0.2849269211292267, 0.030965210869908333, -0.30464237928390503, -0.787543535232544, 0.21096819639205933, 0.6561718583106995, -0.3032739460468292, 0.1943962275981903...
automatically assuming that "fewer templates will make the architecture better" is flawed imo. I'd say that templates *potentially* allow you to build a much cleaner architecture than you'd get without them. Simply because you can make separate classes *totally* independent. Without templates, classes functions which ...
[ 0.4380456209182739, -0.04238802567124367, -0.36840155720710754, 0.2417900562286377, -0.10749504715204239, -0.2575572431087494, 0.5358695387840271, -0.40862134099006653, -0.04436267167329788, -0.6851677894592285, 0.029937956482172012, 0.7272412180900574, -0.5449191927909851, 0.1159064173698...
course, the added compile-time may be a valid reason to avoid templates in some cases, and if you only have a bunch of Java programmers, who are used to thinking in "traditional" OOP terms, templates might confuse them, which can be another valid reason to avoid templates. But from an architecture point of view, I thi...
[ 0.32949090003967285, 0.483566015958786, -0.3065148591995239, 0.3487266004085541, 0.06761419773101807, -0.31075939536094666, 0.5501234531402588, -0.11068635433912277, -0.19230420887470245, -0.49145328998565674, -0.038890574127435684, 0.8459863662719727, -0.1864619255065918, -0.0650901645421...
you're already concerned with the amount of code, removing templates will most likely lead to *more* lines of code.
[ 0.957588255405426, 0.001483648899011314, -0.3756435513496399, 0.3454299867153168, -0.015560363419353962, -0.008189045824110508, 0.39029431343078613, -0.19206006824970245, -0.38861212134361267, -0.694913923740387, -0.07010257989168167, 0.3534756898880005, -0.14062578976154327, 0.00038715355...
I'm looking for a syntax highlighter cum code formatter for my blog on BlogSpot. I've tried several today, but the all want to include `<style>` tags, or reference a stylesheet. I'm looking for one that is ideal for segments of code, and includes styling inline. Any suggestions? You can always copy the extra few bytes ...
[ 0.8339158296585083, 0.06767623871564865, 0.4300653636455536, 0.2018459439277649, -0.1163003221154213, -0.10099188983440399, -0.13073688745498657, 0.29820743203163147, -0.2203795164823532, -0.6980793476104736, 0.18237018585205078, 0.4431094825267792, 0.07039208710193634, -0.1539950072765350...
I saw something about needing to have the assembly available for the type of the first argument passed to the function. I think it is, I can't figure out what am I missing. This code is in a service. I was running the service under the 'NETWORK SERVICES' user account, when I changed the account to that of the session ...
[ 0.2580372989177704, 0.23559176921844482, 0.25616681575775146, -0.17023155093193054, -0.02901504375040531, 0.076056569814682, 0.3971680700778961, -0.05529950559139252, -0.2656354606151581, -0.6247417330741882, 0.2717120945453644, 0.5841981172561646, -0.14207978546619415, 0.24671953916549683...
assembly located in the GAC. Simple, and stupid :)
[ 0.3037462830543518, -0.12468532472848892, 0.196035698056221, 0.20159107446670532, -0.15781216323375702, 0.026238812133669853, 0.2091168761253357, -0.017308004200458527, -0.2952260971069336, -0.44914761185646057, -0.4320140480995178, 0.08601784706115723, -0.32202473282814026, -0.24742679297...
I'm looking at building a Rails application which will have some pretty large tables with upwards of 500 million rows. To keep things snappy I'm currently looking into how a large table can be split to more manageable chunks. I see that as of MySQL 5.1 there is a partitioning option and that's a possible option but I d...
[ 0.16332855820655823, 0.1272321492433548, 0.20961418747901917, -0.11826608330011368, -0.23450510203838348, 0.05426716431975365, 0.0272174421697855, 0.31724855303764343, -0.5824158787727356, -0.7210165858268738, 0.22108964622020721, 0.42692846059799194, -0.20916344225406647, 0.25830686092376...
is no way to do this - does anyone have any suggestions as to how I might implement this or any alternative strategies? Thanks Arfon Partition columns in MySQL are not limited to primary keys. In fact, a partition column does not have to be a key at all (though one will be created for it transparently). You can parti...
[ 0.18462273478507996, 0.1702755242586136, 0.3404674232006073, 0.2429998368024826, -0.09659656882286072, -0.13624615967273712, 0.04123454913496971, -0.09697286784648895, -0.3065759241580963, -0.8273580074310303, -0.10155361890792847, 0.27091851830482483, -0.11107689887285233, 0.1277404278516...
on certain criteria. [HiveDB](http://www.hivedb.org/) is an open-source framework for horizontal partioning for MySQL. In addition to sharding and partioning you should employ some sort of clustering. The simplest setup is a replication based setup that helps you spread the load over several physical servers. You shou...
[ 0.19593539834022522, 0.12280123680830002, 0.3855528235435486, 0.07206326723098755, -0.0534207820892334, -0.10790127515792847, -0.05415922775864601, -0.25198185443878174, -0.44424599409103394, -0.4800974428653717, 0.4539860785007477, 0.11696026474237442, -0.38723841309547424, 0.214083701372...
lot of information on the subject. Might be relevant for you as well.
[ 0.5705916881561279, 0.11981386691331863, -0.016810618340969086, 0.2836335003376007, -0.005214768461883068, -0.14902594685554504, 0.04755186289548874, 0.5411636829376221, -0.17020419239997864, -0.3333796262741089, 0.22384706139564514, 0.10797496885061264, 0.3583661615848541, 0.1398571133613...
Can anyone point me out, how can I parse/evaluate HQL and get map where key is table alias and value - full qualified class name. E.g. for HQL > SELECT a.id from Foo a INNER JOIN a.test b I wish to have pairs: a, package1.Foo b. package2.TestClassName It's relatively easy to do for result set > ``` > HQLQueryPla...
[ 0.2537510395050049, 0.08696005493402481, 0.6567394733428955, -0.09520167857408524, -0.24697500467300415, -0.09561643749475479, 0.5487928986549377, -0.48495596647262573, 0.0026044112164527178, -0.6376909017562866, -0.25677254796028137, 0.43681028485298157, 0.06152809411287308, -0.0004807557...
new NodeTraverser(new NodeTraverser.VisitationStrategy() { public void visit(AST node) { if(node.getType() == SqlTokenTypes.FROM_FRAGMENT || node.getType() == SqlTokenTypes.JOIN_FRAGMENT) { FromElement id = (FromElement)node; System.out.println(node+": "+id.getClassAlias()+" - "+id.g...
[ -0.371457040309906, -0.4081985354423523, 0.8682227730751038, -0.030555590987205505, -0.044400542974472046, -0.04311450198292732, 0.5249395966529846, -0.21656008064746857, -0.3712034821510315, -0.8281798958778381, -0.28105825185775757, 0.39160430431365967, -0.3364289402961731, 0.46360152959...
interprets the AST based on guessing the semantics of the different nodes. This might not work on all HQL-statements, and might not work, or have different behaviour, on a future hibernate-version.
[ -0.02856639213860035, -0.3004579544067383, 0.34014517068862915, -0.180405393242836, -0.27118945121765137, 0.1705407351255417, 0.7043012976646423, -0.07849937677383423, 0.2588348984718323, -0.3597172498703003, -0.32792383432388306, 0.4035152792930603, -0.31107965111732483, -0.52093523740768...
Imagine I have the following: ``` inFile = "/adda/adas/sdas/hello.txt" # that instruction give me hello.txt Name = inFile.name.split("/") [-1] # that one give me the name I want - just hello Name1 = Name.split(".") [0] ``` Is there any chance to simplify that doing the same job in just one expression? You can get ...
[ 0.23337271809577942, -0.06977695226669312, 0.3263152539730072, -0.2184114009141922, 0.07595542818307877, 0.18686333298683167, -0.07335449755191803, -0.46154525876045227, -0.19701024889945984, -0.6385703086853027, -0.11302340030670166, 0.6126025915145874, -0.19969934225082397, 0.14423422515...
then any other answer) because it does not break down on other [platforms that use different path separators (you would be surprised how varried this can be)](http://en.wikipedia.org/wiki/Path_(computing)#Representations_of_paths_by_operating_system_and_shell). It also carries most points because it answers your quest...
[ 0.09038415551185608, -0.1994304656982422, 0.4179362952709198, 0.41081735491752625, -0.30861717462539673, -0.019047759473323822, 0.03656120225787163, -0.1775803118944168, 0.036878280341625214, -0.6690298318862915, 0.010092334821820259, 0.38451436161994934, 0.005224102642387152, -0.176992923...
I have a plugin project I've been developing for a few years where the plugin works with numerous combinations of [primary application version, 3rd party library version, 32-bit vs. 64-bit]. Is there a (clean) way to use autotools to create a single makefile that builds all versions of the plugin. As far as I can tel...
[ 0.7667332291603088, 0.18020287156105042, -0.1004725843667984, -0.0666002705693245, 0.12495645880699158, 0.06886506080627441, 0.05439656227827072, -0.08161668479442596, -0.1731845736503601, -0.6533264517784119, 0.13945545256137848, 0.5291950106620789, -0.37437745928764343, -0.00040639427606...
changes across all the different copies and (b) there is a lot of wasted space in duplicating the project so many times. Is there a better way? **EDIT:** I've been rolling my own solution for a while where I have a fancy makefile and some perl scripts to hunt down various 3rd party library versions, etc. As such, I'...
[ 0.6374918222427368, -0.01297660730779171, 0.2488887757062912, 0.13222892582416534, 0.09570254385471344, 0.050379443913698196, 0.2982531785964966, 0.15716540813446045, -0.3872525990009308, -0.7347313761711121, 0.04191083461046219, 0.5228070020675659, -0.15648365020751953, -0.025171827524900...
of trouble. I'm mostly looking for a linux solution, but one that also works for Windows and/or the Mac would be a bonus. As far as I know, you can't do that. However, are you stuck with autotools? Are neither [CMake](http://www.cmake.org/) nor [SCons](http://www.scons.org/) an option?
[ 0.2342217117547989, -0.10369902104139328, 0.19948013126850128, 0.47477230429649353, 0.3014090955257416, 0.1040116623044014, 0.22654767334461212, 0.5362286567687988, -0.45120227336883545, -0.5182339549064636, -0.1375778615474701, 0.6761178374290466, -0.22905714809894562, -0.2173016816377639...
I want to know what is the difference between a query and a view in terms of performance. And if a view is costly, what else besides a query could I do to improve performance? Views and ad-hoc queries, in the simple case, are nearly identical in terms of performance. So much so that when you program with a view, you sh...
[ 0.4777340888977051, 0.32241562008857727, 0.08947871625423431, 0.19285142421722412, -0.1373995840549469, 0.08784317970275879, -0.10987889021635056, -0.4453513026237488, 0.07117626816034317, -0.421541690826416, 0.15414941310882568, 0.7600748538970947, 0.014329031109809875, 0.2612755298614502...
this case, behind the scenes SQL Server maintains the same structures that underlie a table, making an indexed view and a table very similar in terms of performance. In SQL Server, though you can generally nest views fairly liberally without running into performance problems, it can make things more difficult to under...
[ 0.07218219339847565, 0.02493511699140072, 0.07540721446275711, 0.22630172967910767, -0.26590415835380554, -0.2961335778236389, -0.04368085041642189, -0.06253558397293091, -0.26255208253860474, -0.5459011197090149, -0.13757525384426117, 0.5462727546691895, -0.22447387874126434, -0.043837986...
I have developed a framework that is used by several teams in our organisation. Those "modules", developed on top of this framework, can behave quite differently but they are all pretty resources consuming even though some are more than others. They all receive data in input, analyse and/or transform it, and send it fu...
[ 0.8179231882095337, 0.26589876413345337, 0.03487073630094528, 0.1929202526807785, 0.26820385456085205, 0.18431738018989563, -0.1747507005929947, -0.307483047246933, -0.11513297259807587, -0.42557284235954285, -0.011349943466484547, 0.5222269296646118, 0.09502829611301422, -0.00436253426596...
data as input. Do you have any advice? Any remarks on this simple procedure? Your question is pretty broad, so unfortunately my answer will not be very specific either. First, benchmarking is hard. Do not underestimate the effort necessary to produce meaningful, repeatable, high-confidence results. Second, what is ...
[ -0.0017582080326974392, -0.1359231024980545, 0.2234240621328354, 0.6570035815238953, 0.024661555886268616, 0.12503354251384735, 0.005407507531344891, -0.21365971863269806, -0.3644929528236389, -0.596165657043457, 0.11555393040180206, 0.5701103210449219, -0.04734020307660103, -0.15611252188...
on which goal you have, then you should design your benchmark to measure against that goal. So, if you are interested in throughput, you probably want to send messages / transactions / input into your system at a prescribed rate and see if the system is keeping up. If you are interested in latency, you would send mess...
[ 0.11603844910860062, -0.16668447852134705, 0.29139643907546997, 0.23144324123859406, 0.13918526470661163, 0.10239381343126297, 0.14078135788440704, -0.02106783166527748, -0.49396082758903503, -0.6637916564941406, 0.1584191769361496, 0.7002670764923096, -0.015399552881717682, -0.02385407127...
support.) Second, you do not say if these modules are going to be CPU bound, I/O bound, if they can take advantage of multiple CPUs/cores, etc. As you are trying to evaluate different hardware solutions you may find that your application benefits more from a great I/O subsystem vs. a huge number of CPUs. Third, the b...
[ 0.22459185123443604, 0.25268039107322693, 0.20622801780700684, 0.5775851607322693, 0.10740304738283157, 0.06160205602645874, 0.10183151066303253, -0.4782012701034546, -0.409524530172348, -0.477217435836792, 0.041546307504177094, 0.7098833918571472, -0.05752277374267578, -0.3333346247673034...
points in the system to see how it behaves (if you do not have them already,) modifying the existing system to add record/playback capabilities, modifying the playback to run at different rates, and getting a realistic (i.e., similar to production) environment for testing.
[ 0.5532394647598267, 0.1666135936975479, 0.3736189007759094, 0.4506065547466278, 0.3596264719963074, -0.054558221250772476, -0.03944818302989006, -0.3877737820148468, -0.18831583857536316, -0.4956229031085968, -0.06568267941474915, 0.49290731549263, 0.2685217559337616, 0.09453484416007996, ...
I am confused about the licensing model for Microsoft PerformancePoint Server. When I look at <http://www.microsoft.com/business/performancepoint/howtobuy/default.aspx> I see a 20,000 USD Server License, plus a 200 USD CAL license. But the language is a bit vague about what this means-- is CAl required for any user ...
[ 0.1932433694601059, 0.19796018302440643, 0.42623186111450195, 0.10655413568019867, -0.014132466167211533, -0.18570931255817413, 0.0633242130279541, -0.07174693793058395, 0.04504014924168587, -0.33378031849861145, 0.09499247372150421, 0.7912233471870422, 0.09746968001127243, -0.070515923202...
What's the best way to throw an exception in objective-c/cocoa? I use `[NSException raise:format:]` as follows: ``` [NSException raise:@"Invalid foo value" format:@"foo of %d is invalid", foo]; ```
[ 0.10938692092895508, 0.6589087843894958, -0.10272519290447235, -0.23914949595928192, -0.274991512298584, -0.15201535820960999, 0.002728275954723358, -0.15835940837860107, -0.16137714684009552, -0.17489631474018097, -0.06421119719743729, 0.49984997510910034, -0.268971711397171, -0.236457794...
If I have several `Section` elements in an XML document, what XQuery do I use to get a list of all the `name` values? ``` <Section name="New Clients" filePath="XNEWCUST.TXT" skipSection="False"> ``` In XPath 2.0 (which is a subset of XQuery) one would use the following expression to get a sequence of all string value...
[ 0.4473891854286194, 0.11749253422021866, 0.7468684315681458, -0.19184790551662445, -0.21741069853305817, -0.09469273686408997, 0.01153318677097559, -0.24688072502613068, -0.08772701770067215, -0.31028637290000916, -0.19536612927913666, 0.4795101284980774, -0.4466386139392853, 0.06799934059...
(such as one using specific location steps) should be preferred.
[ 0.17118701338768005, -0.07834098488092422, -0.1362512856721878, 0.15222321450710297, 0.31868797540664673, 0.039996251463890076, 0.18888314068317413, -0.31419575214385986, -0.025239761918783188, -0.6523923873901367, -0.35973870754241943, 0.32090023159980774, 0.08269774168729782, -0.41917696...
I have html code that looks roughly like this: ``` <div id="id1"> <div id="id2"> <p>some html</p> <span>maybe some more</span> </div> <div id="id3"> <p>different text here</p> <input type="text"> <span>maybe even a form item</span> </div> </div> ``` Obviously there's more to it than that,...
[ 0.10526952892541885, 0.03835950791835785, 0.4293816387653351, -0.1078726276755333, 0.00012981526379007846, -0.09890665113925934, 0.01846640184521675, -0.26725050806999207, -0.07138893008232117, -0.7513845562934875, 0.10209356248378754, 0.3499402403831482, -0.16927480697631836, -0.050528995...
functionality) that can read and write the two nodes (and all their children) so as to swap their location in the DOM? In this case, `document.getElementById('id1').appendChild(document.getElementById('id2'));` should do the trick. More generally you can use [`insertBefore()`](https://developer.mozilla.org/en-US/docs/...
[ 0.26345059275627136, -0.29750266671180725, 0.29952219128608704, -0.05197778716683388, 0.616027295589447, -0.12686482071876526, 0.1141492947936058, -0.2965841591358185, -0.09815475344657898, -0.43578654527664185, -0.32111385464668274, 0.791835367679596, -0.3931831121444702, 0.22025792300701...
This is a multi-site problem. I have a lot of sites with .htaccess files with multiple line similar to: ``` rewriterule ^(page-one|page-two|page-three)/?$ /index.php?page=$1 [L] ``` This means that both www.domain.com/page-one and www.domain.com/page-one/ will both load www.domain.com/index.php?page=page-one Howeve...
[ 0.4531726837158203, 0.1311437487602234, 0.5601733326911926, 0.014327742159366608, -0.23619723320007324, -0.35516104102134705, 0.24604995548725128, 0.06829577684402466, -0.26598748564720154, -0.5794497132301331, 0.04381684586405754, 0.47111648321151733, -0.33461785316467285, 0.3747529685497...
force everything to end with a slash ``` rewritecond %{REQUEST_FILENAME} !-f rewritecond %{REQUEST_URI} !(.*)/$ rewriterule ^(.*)$ http://%{HTTP_HOST}/$1/ [L,R=301] ```
[ -0.029094062745571136, -0.09250525385141373, 0.8247215151786804, -0.3373291492462158, 0.17564398050308228, -0.04354414343833923, 0.47490042448043823, -0.27940210700035095, -0.021195514127612114, -0.44494348764419556, -0.4183281362056732, 0.5246549248695374, -0.44527432322502136, 0.32251906...
I was wondering if it is possible to tweak the way garbage collector works on JavaMe in order to improve performance somehow(may reducing the number of passages)? I´ve seen some articles about it, but mostly directed Java SE and most of them says GC is highly dependant on the maker. How much would that be. Thanks for a...
[ 0.5735077857971191, 0.278583288192749, 0.14248885214328766, 0.18380290269851685, -0.12963348627090454, -0.05375519394874573, 0.22457341849803925, 0.2327672243118286, -0.19016100466251373, -0.3296760320663452, 0.12720440328121185, 0.6529399156570435, -0.03986772149801254, 0.0409884601831436...
I am working on a calculator that allows you to perform calculations past the decimal point in octal, hexadecimal, binary, and of course decimal. I am having trouble though finding a way to convert floating point decimal numbers to floating point hexadecimal, octal, binary and vice versa. The plan is to do all the ma...
[ 0.030462831258773804, 0.5548293590545654, 0.16064974665641785, 0.1762273907661438, 0.33653223514556885, 0.24617622792720795, -0.006393310613930225, 0.2392202913761139, -0.12694095075130463, -0.6397379636764526, 0.17083901166915894, 0.3117043972015381, 0.3555390536785126, 0.0079504959285259...
Seymour Lipschutz. For some reason it is still on my bookshelf 23 years later. As a hint, convert octal and hex to binary, perform the operations, convert back to binary. Or you can perform decimal operations and perform the conversions to octal/hex/binary afterward. The process is essentially the same for all positi...
[ -0.04548109695315361, 0.3218176066875458, 0.11632947623729706, 0.2761539816856384, -0.02546641230583191, 0.2911455035209656, 0.1935955137014389, -0.01650485023856163, -0.12701529264450073, -0.39291059970855713, 0.01603119634091854, 0.034639421850442886, 0.06370275467634201, 0.4391996860504...
What do people recommend for creating popup's in ASP.Net MVC? I have used the AJAX toolkit and component art's methods in the web forms world and am looking something with similar capability. What JQUERY plugins do people like? SimpleModal, JBOX (I think this was, what it was called) Is it worth exploring pulling ou...
[ 0.4027271270751953, -0.20928044617176056, 0.15821373462677002, 0.20791150629520416, -0.29114294052124023, -0.12198816239833832, 0.3873860836029053, 0.5011906623840332, -0.3273559510707855, -0.5834389328956604, 0.19417326152324677, 0.16761431097984314, -0.12686869502067566, -0.2050364762544...
Is there any way to follow a URL in JavaScript without setting the `document.location.href`? I have a page that displays a list of objects and each object may have a file download associated with it, which is accessed via a hyperlink. Clicking the link initiates an AJAX request that ultimately leads to a transient fil...
[ 0.23636239767074585, 0.15019363164901733, 0.5293111801147461, 0.09031543135643005, 0.08946972340345383, -0.21481387317180634, -0.0796559751033783, 0.13471640646457672, -0.17801570892333984, -0.6153784990310669, -0.12418738007545471, 0.5390341877937317, -0.09265598654747009, 0.1807966381311...
the browser's address bar, so if the page is refreshed the file is downloaded again rather than the object listing page itself getting refreshed. I guess I could set the URL back to what it was before, but that feels a bit hacky. Incidentally, I'm using the Prototype JavaScript framework. you could open a new window w...
[ 0.31062188744544983, 0.012447982095181942, 0.44429078698158264, 0.07862874120473862, -0.30954819917678833, -0.11454436182975769, 0.40800124406814575, 0.3851136863231659, -0.18727558851242065, -0.9148904085159302, -0.06477618962526321, 0.47586795687675476, -0.09523295611143112, 0.2234983295...
In C++ often do something like this: ``` typedef map<int, vector<int> > MyIndexType; ``` Where I then use it like this: ``` MyIndexType myIndex; for( ... some loop ...) { myIndex[someId].push_back(someVal); } ``` If there was no entry in the map the code will insert a new empty vector and then append to it. In...
[ -0.29943859577178955, -0.177944615483284, 0.31949830055236816, -0.2609473168849945, -0.27036982774734497, 0.04133811593055725, 0.08479424566030502, -0.07952947914600372, -0.1090017780661583, -0.5527741312980652, -0.06568166613578796, 0.5084933638572693, -0.5262788534164429, -0.150721281766...
encountered at dictionary declaration time? You want to use: ``` from collections import defaultdict myIndex = defaultdict(list) myIndex[someId].append(someVal) ``` Standard Library [`defaultdict` objects](http://docs.python.org/library/collections.html#id3). Example usage from the Python documentation: ``` >>> s ...
[ -0.09460645169019699, 0.11887045204639435, 0.31109827756881714, -0.22660139203071594, -0.13650482892990112, 0.21875010430812836, 0.48867279291152954, 0.09552834182977676, -0.20831382274627686, -1.0132077932357788, -0.40160635113716125, 0.5010907053947449, -0.10717438906431198, 0.1402567923...
I want to execute a php-script from php that will use different constants and different versions of classes that are already defined. Is there a sandbox php\_module where i could just: ``` sandbox('script.php'); // run in a new php environment ``` instead of ``` include('script.php'); // run in the same environme...
[ 0.42237913608551025, 0.048155155032873154, 0.1927553415298462, -0.13428691029548645, 0.15549971163272858, 0.06959982216358185, 0.2135121077299118, -0.008657181635499, 0.051745299249887466, -0.6987488865852356, -0.051162056624889374, 0.5724459290504456, -0.1386040598154068, 0.04855221882462...
I'm developing class to represent special kind of matrix: ``` type DifRecord = record Field: String; Number: Byte; Value: smallint; end; type TData = array of array of MainModule.DataRecord; type TDifference = array of DifRecord; type TFogelMatrix = class private M: Byte; N: Byte; ...
[ -0.041767094284296036, -0.055259063839912415, 0.2057681530714035, -0.03412993252277374, -0.12545794248580933, 0.30938521027565, 0.30076128244400024, -0.4466300904750824, -0.02486758679151535, -0.5444082021713257, -0.08834747970104218, 0.5118423104286194, -0.35633528232574463, 0.42588004469...
Data and DifVector class members. I use pointers to array of records, as you see. So, the main question is, how can I correctly reserve memory? I suppose I can not use something like that: `new(Data); new(DifVector);` cause I`m loosing the main idea - to reserve memory space, as much as I want to, at run-time. Th...
[ 0.023240499198436737, -0.05427829548716545, 0.16845211386680603, 0.09161441773176193, -0.006116002798080444, -0.0003730358148459345, -0.06352590024471283, -0.46451473236083984, -0.12683390080928802, -0.4749189615249634, 0.040051043033599854, 0.47688114643096924, -0.3635278642177582, -0.020...
of whatever type the array holds. Change your declarations for the arrays to simple arrays: ``` Data: TData; DifVector: TDifference; ``` and use it with SetLength, it should do the trick.
[ 0.4730669856071472, -0.42981478571891785, 0.25095319747924805, -0.09103991091251373, -0.3374682068824768, -0.14289020001888275, 0.17039498686790466, -0.41318604350090027, 0.05709117650985718, -0.21330323815345764, -0.10463231801986694, 0.6809796094894409, -0.4402272701263428, -0.2195257395...
One of my API calls can result in updates to a large number of objects (Django models). I'm running into performance issues with this since I'm updating each item individually, saving, and moving on to the next: ``` for item in Something.objects.filter(x='y'): item.a="something" item.save() ``` Sometimes my ...
[ 0.288445383310318, -0.23880420625209808, 0.06781227141618729, 0.1493372619152069, -0.12547311186790466, -0.13463561236858368, 0.024794286116957664, 0.0029711222741752863, -0.3834860622882843, -0.95174640417099, 0.09314146637916565, 0.4282352924346924, -0.5744747519493103, 0.060630489140748...
signals to do bits of work on save, [`QuerySet` has an `update` method](http://docs.djangoproject.com/en/dev/topics/db/queries/#updating-multiple-objects-at-once) which you can use to perform an `UPDATE` on the filtered rows: ``` Something.objects.filter(x__in=['a', 'b', 'c']).update(a='something') ```
[ 0.3028833866119385, 0.11718808114528656, 0.29876601696014404, 0.042244426906108856, -0.19989506900310516, 0.1612202674150467, 0.14611512422561646, -0.2125989943742752, -0.2979218065738678, -0.33022114634513855, -0.026220671832561493, 0.2196669578552246, -0.5995610952377319, -0.098804011940...
Say for example I have the following string: var testString = "Hello, world"; And I want to call the following methods: var newString = testString.Replace("Hello", "").Replace("world", ""); Is there some code construct that simplifies this, so that I only have to specify the Replace method once, and can specify a b...
[ 0.34735116362571716, 0.19856390357017517, 0.4194867014884949, -0.24047279357910156, 0.014317012391984463, 0.18121257424354553, 0.3911038041114807, -0.3705902695655823, 0.24364599585533142, -0.5905691385269165, 0.06619948148727417, 0.5896821022033691, -0.3957469165325165, 0.1348060667514801...
I have something like this: ``` <node TEXT=" txt A "/> <node TEXT=" txt X "/> <node> <html> <p> txt Y </p> </html> </node> <node TEXT="txt B"/> ``` and i want to use XSLT to get this: ``` txt A txt X txt Y txt B ``` I want to strip all useless whitespaces and linebreaks of @...
[ 0.21658939123153687, 0.16303138434886932, 0.4061228036880493, -0.23203741014003754, -0.14418953657150269, -0.2622162699699402, 0.05965667963027954, -0.3307237923145294, -0.20126603543758392, -0.7819502949714661, -0.23012299835681915, 0.6032048463821411, -0.41584038734436035, 0.083189181983...
| text()"> <xsl:if test="normalize-space(.)"> <xsl:value-of select= "concat(normalize-space(.), '&#xA;')"/> </xsl:if> <xsl:apply-templates /> </xsl:template> </xsl:stylesheet> ``` when applied against this XML document ``` <t> <node TEXT=" txt A "/> <node TEXT=" txt X"/> <node> <html> ...
[ 0.010317099280655384, -0.16888119280338287, 0.6848125457763672, -0.27351441979408264, -0.07148377597332001, 0.1479952186346054, 0.011893247254192829, -0.5692960023880005, 0.014925739727914333, -0.5098057389259338, -0.6011580228805542, 0.546596884727478, -0.18392030894756317, -0.15867687761...
off all leading and trailing spaces and replaces every sequence of other spaces with just one space.
[ -0.16787444055080414, -0.06410197168588638, 0.5069535374641418, 0.07429250329732895, 0.058050647377967834, 0.11956147849559784, -0.07372664660215378, -0.026166915893554688, -0.13838358223438263, -0.38950416445732117, -0.4685770571231842, -0.009993107989430428, -0.564731776714325, 0.1756774...
I'm looking for a good online resource of software patterns. Preferably something with a comprehensive selection and concise well written explanations, not just a collection of links. .Net examples would be nice, but not essential. To see real world examples of patterns implemented, why not grab an open source .net pro...
[ 0.8954370617866516, -0.16802117228507996, -0.3380705416202545, 0.43717294931411743, -0.155318483710289, -0.1412236988544464, 0.14397454261779785, 0.2948818504810333, -0.2301284223794937, -0.7391629219055176, 0.36872413754463196, 0.36497366428375244, -0.29054713249206543, -0.000452087202575...
Using Microsoft's AntiXssLibrary, how do you handle input that needs to be edited later? For example: User enters: `<i>title</i>` Saved to the database as: `<i>title</i>` On an edit page, in a text box it displays something like: `&lt;i&gt;title&lt;/i&gt;` because I've encoded it before displaying in the text b...
[ -0.08724888414144516, 0.10556651651859283, 0.0842960774898529, -0.028662147000432014, -0.2142893522977829, -0.1301357001066208, 0.5147964358329773, -0.1049138680100441, -0.09827117621898651, -0.559408962726593, -0.14441390335559845, 0.384370893239975, -0.47043997049331665, 0.07288515567779...
downvoted. Looks like you're encoding it more than once. In ASP.NET, using Microsoft's AntiXss Library you can use the HtmlAttributeEncode method to encode untrusted input: ``` <input type="text" value="<%= AntiXss.HtmlAttributeEncode("<i>title</i>") %>" /> ``` This results in ``` <input type="text" value="&#60;i&#6...
[ -0.27292340993881226, -0.24543648958206177, 0.5471832752227783, 0.06761747598648071, -0.06497768312692642, 0.13047395646572113, -0.12119469046592712, 0.03650672361254692, -0.15048222243785858, -0.7149831652641296, -0.5270501375198364, 0.17317482829093933, -0.4793432354927063, -0.3918931484...
I'm trying to gauge the possibility of a patch to WebKit which would allow all rendered graphics to be rendered onto a fully transparent background. The desired effect is to render web content without any background at all, it should appear to float over the desktop (or whatever is displayed behind the browser window)...
[ 0.6209526658058167, 0.09441200643777847, 0.30302292108535767, 0.21133066713809967, -0.003134379396215081, -0.23500923812389374, 0.23130019009113312, 0.49921295046806335, -0.35781198740005493, -0.7820450067520142, -0.010810433886945248, 0.6526661515235901, -0.046151526272296906, -0.22651498...
technique. So, this must be possible. --- **Update 2:** I've compiled WebKit on linux and noticed the configure options include: ``` --enable-dashboard-support enable Dashboard support default=yes ``` I'm getting closer. Can anyone help? --- **Update 3:** I continue to find references to this in posts on various...
[ 0.14260154962539673, -0.06023325026035309, 0.6494939923286438, 0.06804502755403519, -0.1765243262052536, -0.23582684993743896, 0.36305540800094604, -0.36722034215927124, -0.2770794630050659, -0.9309291243553162, -0.04519476741552353, 0.5983759164810181, -0.03969546779990196, -0.15486225485...
of course the system you're running it on should have a capable graphics card (intel, radeon, or nvidia) and be running a compositing window manager (like Compiz). And finally, to actually see transparency, the content you're viewing must set a transparent background using CSS3, otherwise it's still completely opaque....
[ 0.15775726735591888, 0.2977811396121979, 0.33436715602874756, 0.08610837906599045, -0.23665787279605865, -0.11747467517852783, 0.001478449790738523, -0.05711553990840912, -0.1583223193883896, -0.7463143467903137, -0.21400828659534454, 0.5431202054023743, -0.49150314927101135, -0.0429597608...
to RGBA GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL); GdkScreen *screen = gtk_widget_get_screen(window); GdkColormap *rgba = gdk_screen_get_rgba_colormap (screen); if (rgba && gdk_screen_is_composited (screen)) { gtk_widget_set_default_colormap(rgba); gtk_widget_set_colormap(GTK_WIDGET(windo...
[ 0.22232288122177124, 0.08538191020488739, 0.8522090315818787, -0.20208705961704254, -0.1136389672756195, 0.23213307559490204, 0.28614142537117004, -0.3204496204853058, -0.33511626720428467, -0.5858299732208252, -0.4688296616077423, 0.5218818187713623, -0.2927328944206238, 0.126023218035697...
the window closes gtk_widget_grab_focus(GTK_WIDGET(web_view)); gtk_widget_show_all(window); gtk_main(); return 0; } ``` [![Screenshot!](https://i.stack.imgur.com/pZok0.png)](https://i.stack.imgur.com/pZok0.png)
[ -0.3151901662349701, 0.1206560879945755, 0.9993888735771179, -0.45904070138931274, 0.011259584687650204, -0.13350945711135864, 0.05236385390162468, 0.4175211787223816, -0.1779816448688507, -0.5240287780761719, -0.818947434425354, 0.45651575922966003, -0.2002684772014618, 0.2038217633962631...
We have a legacy ASP.net powered site running on a IIS server, the site was developed by a central team and is used by multiple customers. Each customer however has their own copy of the site's aspx files plus a web.config file. This is causing problems as changes made by well meaning support engineers to the copies of...
[ 0.5851492881774902, 0.0534764789044857, 0.7064834237098694, -0.0678873211145401, 0.3021683096885681, 0.142953023314476, -0.3378184735774994, -0.16676713526248932, -0.22420412302017212, -0.5060537457466125, -0.020786644890904427, 0.24940066039562225, 0.055340733379125595, -0.022529600188136...
aspx & web.config Customer4/Source aspx & web.config ... This is something I'd like to change to each customer having just a customised web.config file and all the customers sharing a common set of source files. So something like: OurApp/Source aspx & default web.config Customer1/web.config Customer2/web...
[ 0.31803837418556213, 0.03380768001079559, 0.5028129816055298, -0.054817166179418564, -0.08368975669145584, -0.06905314326286316, -0.15366746485233307, -0.28776928782463074, -0.17827531695365906, -0.5971733927726746, -0.09780212491750717, 0.5866166353225708, -0.008928573690354824, -0.169059...
engineers but is there any way to avoid having multiple copies of the source aspx files? I hate that sort of duplication! If you're dead-set on the single app instance, you can accomplish what you're after using a custom ConfigurationSection in your single web.config. For the basics, see: * <http://haacked.com/archive...
[ 0.3513028919696808, 0.4641820192337036, 0.25481852889060974, 0.09630616009235382, 0.32745692133903503, 0.02037864178419113, -0.11748139560222626, -0.3593818247318268, -0.45197901129722595, -0.9151095151901245, -0.12581957876682281, 0.7053892612457275, -0.03833070397377014, 0.01586893014609...
set, use a condition (request domain or something else that uniquely identifies the Customer) to decide which to use. With the proper implementation, the app developers don't need to be aware of what's going on behind the scenes. They just use CustomSettings.Settings.SomeSetting and don't worry about which Customer is...
[ 0.49056485295295715, -0.1475265771150589, 0.1941058337688446, 0.36171019077301025, 0.2912306785583496, -0.05551541596651077, -0.03835437446832657, -0.19658006727695465, -0.04533353075385094, -0.6796920299530029, -0.4594505727291107, 0.5531179308891296, -0.29107847809791565, -0.168057471513...
Is it possible to pass a query string to Namescape's [rDirectory](http://www.namescape.com/Products/rDirectory/Default.aspx)? I'd like to build a web-app that can do a search and display the results in rDirectory, rather than first launching rDirectory and doing said search. If you're dead-set on the single app instanc...
[ 0.1500202864408493, -0.0028128742706030607, 0.43178996443748474, 0.019925426691770554, 0.10727833211421967, -0.05325527861714363, -0.12952832877635956, -0.33057472109794617, -0.37710046768188477, -0.6310126185417175, -0.13659292459487915, 0.5465458035469055, -0.0037435204721987247, -0.1348...
in your ConfigSection Properties, expose Name, SomeSetting, and Another. When the Property is accessed or set, use a condition (request domain or something else that uniquely identifies the Customer) to decide which to use. With the proper implementation, the app developers don't need to be aware of what's going on be...
[ 0.15591317415237427, 0.014830555766820908, 0.522996723651886, 0.39534440636634827, 0.2716813087463379, -0.16572436690330505, -0.10504972189664841, -0.0230758935213089, -0.21204137802124023, -0.6671881675720215, -0.07850686460733414, 0.5483984351158142, -0.08859783411026001, 0.0115662533789...
i have a winforms application. i have a user control with a lot of icons. the user can load this control on a form many times (in a tabbed layout). right now i am loading the icons each time the control is created (could be up to 50 times in teh app). is there any way to cache these icons in the application. if i did t...
[ 0.33207568526268005, -0.015114985406398773, 0.2492031455039978, 0.1300175040960312, -0.08994515985250473, 0.2059038281440735, 0.16016526520252228, 0.028461826965212822, 0.08699028193950653, -0.9823859333992004, 0.23122400045394897, 0.6478908658027649, -0.11700503528118134, 0.32373705506324...
Subsequent calls uses the existing handle. Without knowing more about your user control my next suggestion can be only be very general. But you could have a single bitmap layer on which you draw all your icons. The remaining elements of your user control would exists above and around this bitmap. Unfortunately this ...
[ -0.01309220027178526, 0.03379141539335251, 0.5039135813713074, 0.2974804937839508, 0.0059860036708414555, 0.19554202258586884, 0.1504860818386078, -0.44818639755249023, -0.10028977692127228, -0.6295230388641357, -0.08834037184715271, 0.756369948387146, -0.509380042552948, -0.09489849954843...
our CAM software. Too many text entries caused various forms of strangeness and leaks. So we instead created labels with borders that looked like text entries and had ONE text entry (and a combo box entry too). When the user tabs, enters, or clicked the single text entry moved to the new entry and the label was setup f...
[ 0.5191808938980103, 0.009711340069770813, 0.37267792224884033, 0.4243048429489136, 0.12275630980730057, -0.2516944706439972, -0.09509851038455963, -0.19259802997112274, 0.11244094371795654, -0.4055052399635315, 0.36519667506217957, 0.7666441202163696, -0.12308616936206818, 0.24978305399417...
with dozens or hundreds of entries and that you have to approach the problem using a different design.
[ 0.34785351157188416, 0.3314567506313324, 0.20593905448913574, 0.5592935681343079, 0.12246882915496826, 0.13248500227928162, 0.13752329349517822, -0.1681070625782013, -0.45744144916534424, -0.6815899610519409, 0.013488547876477242, 0.2644406855106354, -0.1263573318719864, 0.2388321608304977...
can anyone show me how to get the users within a certain group using sharepoint? so i have a list that contains users and or groups. i want to retrieve all users in that list. is there a way to differentiate between whether the list item is a group or user. if its a group, i need to get all the users within that group...
[ 0.3545466959476471, 0.03539276495575905, 0.2723848223686218, 0.4030230641365051, -0.08483152836561203, -0.2529486119747162, -0.18370284140110016, 0.12565599381923676, -0.31483331322669983, -0.5569722652435303, 0.2778065800666809, 0.6103708148002625, -0.05763254314661026, 0.0137313436716794...
thing you need to know is that when you have a list with a User / Group field you must be aware of its type. When you have one user or group within the item value, the field type is SPFieldUserValue. However, if the field has multiple user / group selection the field type is SPFieldUserValueCollection. I'll assume t...
[ -0.020600687712430954, -0.06940586119890213, 0.6948919296264648, 0.035084068775177, -0.04854044318199158, -0.21566492319107056, -0.005685314070433378, -0.3643331527709961, -0.5638084411621094, -0.7075647115707397, -0.041083671152591705, 0.24844519793987274, -0.2983245551586151, -0.02389390...
is (the field's name is *"Users"*). ``` SPFieldUserValue usersField = new SPFieldUserValue(mainWeb, item["Users"].ToString()); bool isUser = SPUtility.IsLoginValid(site, usersField.User.LoginName); List<SPUser> users = new List<SPUser>(); if (isUser) { // add a single user to the list users.Add(usersField.Use...
[ -0.164934903383255, 0.09640039503574371, 0.7463746070861816, -0.05757385864853859, -0.09211932122707367, 0.2268896847963333, -0.2085120975971222, -0.28274044394493103, -0.6766781806945801, -0.4283181428909302, -0.24597042798995972, 0.05588458850979805, -0.39675605297088623, -0.100083269178...
I expect the column to be a VARCHAR2, in my Oracle Database. US Zips are 9. Canadian is 7. I am thinking 32 characters would be reasonable upper limit What am I missing? [EDIT] TIL: 12 is a reasonable answer to the question Thanks to everyone who contributed. Skimming through [Wikipedia's Postal Codes page](http:/...
[ 0.33866897225379944, 0.2847844362258911, 0.14565767347812653, 0.2612340450286865, -0.22714221477508545, 0.37038442492485046, 0.46642372012138367, 0.030504997819662094, -0.4067055284976959, -0.39347782731056213, -0.041203029453754425, -0.22635836899280548, -0.2545090317726135, -0.1071746647...
Given a jQuery result set, how do you convert that back into plain HTML? ``` <div class="abc"> foo <strong>FOO</strong> </div> <div class="def"> bar </div> ``` -- ``` var $mySet = $('div'); ``` Given `$mySet`, how would you go about returning to the plain HTML above? If your set consists of precisely one ...
[ 0.14377668499946594, 0.208872988820076, 0.338201105594635, -0.28626397252082825, -0.3433727025985718, 0.06315372884273529, 0.1815091371536255, -0.4063889682292938, -0.10670178383588791, -0.6525152921676636, -0.31556227803230286, 0.37159258127212524, -0.383328914642334, -0.1018223911523819,...
I'd like to use visitor IP addresses into a company name. This will be used for displaying something like "Hello visitor from **Apple Inc.**" . Note I am looking for the company name, not the domain name. Extra points for determining the originating country. The app is written in Ruby on Rails, but examples in other la...
[ 0.07593274861574173, 0.38536715507507324, 0.29822471737861633, 0.10816911607980728, 0.1863614022731781, -0.0453176312148571, 0.40342265367507935, 0.7245284914970398, -0.4932147264480591, -0.4296391010284424, -0.14817333221435547, 0.016567934304475784, -0.1413097083568573, 0.293096095323562...
are two companies that offer databases that include organization level detail: <http://www.maxmind.com/app/ip-location> <http://www.ip2location.com/> Edit to clarify based on additional answers: The organization level detail in the databases from these vendors is different than ISP information, which is what the ...
[ 0.42228028178215027, 0.10244058072566986, -0.015509002842009068, 0.45321932435035706, 0.1304808259010315, -0.2537307143211365, -0.2740045189857483, 0.06127205863595009, -0.5828808546066284, -0.43578749895095825, 0.008786890655755997, 0.33784401416778564, -0.06706472486257553, 0.14833126962...
I have a Java file `TestThis.java` like the following: ``` class A { public void foo() { System.out.println("Executing foo"); } } class B { public void bar() { System.out.println("Executing bar"); } } ``` The above code file is compiling fine without any warnings/errors. Is ...
[ 0.5199007391929626, 0.43282026052474976, -0.13612531125545502, -0.2884073555469513, -0.08147002756595612, -0.18987523019313812, 0.469576895236969, -0.44482624530792236, -0.026813844218850136, -0.5344003438949585, 0.10091236233711243, 0.2867504358291626, -0.3395220935344696, 0.1587616056203...
files without a top-level class? As usual (for example, accessing from the Test.java): ``` public class Test { public static void main(String... args) { A a = new A(); a.foo(); B b = new B(); b.bar(); } } ``` The rule here is that you could not have more than one public class ...
[ 0.29164260625839233, 0.09853219240903854, -0.2613155245780945, -0.13396938145160675, -0.020244859158992767, -0.21628089249134064, 0.46927616000175476, -0.1389208883047104, -0.039217688143253326, -0.46111422777175903, -0.37462833523750305, 0.3861319124698639, -0.4213639497756958, 0.48150566...
you can name your file as you wish. Other, non-public classes, will be package-visible and you can access them as usual.
[ 0.4623464047908783, -0.30931225419044495, -0.16601289808750153, 0.2981216609477997, 0.2673145532608032, -0.17281660437583923, 0.02735217474400997, 0.30309826135635376, -0.30181068181991577, -0.7108513712882996, -0.3940829336643219, 0.36123839020729065, -0.047386717051267624, 0.244406759738...
Here I am faced with an issue that I believe(or at least hope) was solved 1 million times already. What I got as the input is a string that represents a length of an object in imperial units. It can go like this: ``` $length = "3' 2 1/2\""; ``` or like this: ``` $length = "1/2\""; ``` or in fact in any other way...
[ 0.1211419329047203, 0.2894708812236786, 0.4902104139328003, 0.16958287358283997, -0.27020350098609924, 0.34770551323890686, -0.21718886494636536, -0.21321247518062592, -0.4216579496860504, -0.5047297477722168, 0.20472310483455658, 0.300900936126709, 0.06984145194292068, 0.36804330348968506...
but don't worry, the regex check at the end makes it completely safe. ``` function imperial2metric($number) { // Get rid of whitespace on both ends of the string. $number = trim($number); // This results in the number of feet getting multiplied by 12 when eval'd // which converts them to inches. $...
[ 0.4964565932750702, 0.10280993580818176, 0.5002985596656799, -0.22328577935695648, -0.057019609957933426, 0.3149625360965729, 0.4153779149055481, -0.2973541021347046, -0.42922836542129517, -0.6699614524841309, 0.31252989172935486, 0.2905711829662323, -0.11728312075138092, -0.13979941606521...
$number = preg_replace('/\s+/', '+', $number); // Make sure they aren't making us eval() evil PHP code. if (preg_match('/[^0-9\/\.\+\*\-]/', $number)) { return false; } else { // Evaluate the expression we've built to get the number of inches. $inches = eval("return ($number);"); ...
[ 0.38196757435798645, 0.07080584764480591, 0.8235061168670654, 0.3320161700248718, 0.059295300394296646, 0.1412055790424347, 0.3529914319515228, -0.3411574363708496, -0.2897932231426239, -0.5076436400413513, 0.3398536145687103, 0.3302302956581116, 0.07462823390960693, 0.1053881123661995, ...
= $inches * 0.0254; // Returns it in meters. You may then convert to centimeters by // multiplying by 100, kilometers by dividing by 1000, etc. return $meters; } } ``` So for example, the string ``` 3' 2 1/2" ``` gets converted to the expression ``` 3*12+2+1/2 ``` which gets evaluat...
[ 0.43053022027015686, 0.0886668860912323, 0.7373802661895752, 0.09992647171020508, -0.07192502170801163, 0.08244245499372482, 0.10915420204401016, -0.4245416820049286, -0.1602998822927475, -0.5728652477264404, 0.034169044345617294, 0.09272044897079468, 0.40682148933410645, 0.372835159301757...
I have a project built and packaged with a specific version of jsp-apiand servlet-api jar files. Now I want these jars to be loaded when deploying the web project on any application server for example tomcat, WAS, Weblogic etc. The behaviour I have seen on tomcat is that it gives messages that the packaged version of ...
[ 0.5719562768936157, 0.3467501103878021, 0.04777351766824722, -0.3275139331817627, -0.4140474796295166, -0.11728361248970032, 0.47267410159111023, -0.08536256104707718, -0.2818331718444824, -0.29973912239074707, 0.08787039667367935, 0.5561649799346924, -0.4471237063407898, 0.258732289075851...
app server. 1. If you have control over the server where you want to install this webapp you can replace the core jars with yours. 2. Additionally you can prepend the jars in the startup of the app server. **Update:** As for the second part, you'll need to modify the startup file of the application server it self. ...
[ 0.4559670090675354, 0.35160261392593384, 0.168552964925766, -0.0350995734333992, -0.17985661327838898, 0.1403283327817917, 0.14186103641986847, -0.13659554719924927, -0.15059715509414673, -0.7982457280158997, 0.13427633047103882, 0.7661620378494263, -0.32925063371658325, -0.127896249294281...
of those in such a way the command line look like this: (assume a windows installation) ``` java -Xbootclasspath/p:c:\cutomjars\myJar.jar;customjars\myOtherJar.jar ..................... // the rest of the normal command line. ``` -bootclasspath/p prepends the jars to the app classpath -bootclasspath/a appends the ...
[ 0.21329788863658905, 0.2578938603401184, 0.22712695598602295, -0.4000338017940521, -0.015164956450462341, 0.13515058159828186, 0.4445161521434784, -0.015771664679050446, -0.3537522256374359, -0.46136829257011414, -0.12640215456485748, 0.5789350867271423, -0.5903514623641968, 0.146388754248...
folder where all the extensions are. Plus, there is an ext directory in the jre. Take a deep dive into your application server bin directory and find out what each script is used for, I'm pretty sure you'll make it through. Here's a more formal explanation of this topic: <http://java.sun.com/j2se/1.5.0/docs/tooldocs/...
[ 0.31864455342292786, -0.024245716631412506, 0.24768590927124023, -0.046262726187705994, 0.0119355833157897, -0.3203480541706085, 0.3140436112880707, 0.1082690954208374, -0.27442246675491333, -0.8000137209892273, 0.052466511726379395, 0.4820172190666199, -0.06789997965097427, -0.06636350601...
I want to develop Java apps, real quick, what IDE should I choose? I think CodeGear [jbuilder](http://www.codegear.com/products/jbuilder) is a very good start.
[ 0.5952041149139404, 0.27790525555610657, -0.1066129207611084, -0.11784130334854126, 0.0012461221776902676, 0.0835866928100586, 0.18497629463672638, 0.28430530428886414, -0.05551942065358162, -0.6260525584220886, 0.031086308881640434, 0.45044049620628357, 0.05113998427987099, -0.21104232966...
I'm looking to use procedurally-generated sound and music in a Flash program I'm writing. I haven't found anything in the ActionScript 3.0 reference manual that shows how to do this. Is this possible? Have any third-party tools been developed that can do this? Or can Flash/ActionScript communicate with external program...
[ 0.3723669648170471, -0.05034542828798294, 0.29384705424308777, 0.25525978207588196, -0.02938738465309143, -0.18764671683311462, 0.009573500603437424, -0.20957612991333008, -0.1894027143716812, -0.44543033838272095, -0.03234099596738815, 0.9230206608772278, -0.13847483694553375, -0.12030325...
example of playing a sound generated from scratch, and the docs on [Sound.extract()](http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/media/Sound.html#extract()) have a useful example of playing a loaded MP3 where the data is being modified in real time. To answer your last question I don't think there are any good...
[ 0.11198433488607407, -0.2003328949213028, 0.04117875173687935, 0.1527755707502365, -0.050921812653541565, -0.28558269143104553, 0.08185427635908127, -0.15335054695606232, -0.3624722957611084, -0.4285459816455841, 0.06611791998147964, 1.0035983324050903, -0.10270502418279648, -0.18564179539...