text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'm writing a Python function to split text into words, ignoring specified punctuation. Here is some working code. I'm not convinced that constructing strings out of lists (buf = [] in the code) is efficient though. Does anyone have a suggestion for a better way to do this?
```
def getwords(text, splitchars=' \t|!?.;:... | [
0.1987377107143402,
0.12575644254684448,
0.08928535133600235,
-0.3274853229522705,
-0.08542975783348083,
0.001811742433346808,
0.39366865158081055,
0.05566360801458359,
-0.08254788815975189,
-0.5100588798522949,
-0.20629984140396118,
0.6381664872169495,
-0.4171017110347748,
-0.127192899584... | |
>>> list(getwords('and/or'))
['and', 'or']
>>> list(getwords('one||two'))
['one', 'two']
>>> list(getwords(u'hola unicode!'))
[u'hola', u'unicode']
"""
splitchars = set(splitchars)
buf = []
for char in text:
if char not in splitchars:
buf.append(char)
... | [
-0.0014129233313724399,
-0.08298978209495544,
0.3584875464439392,
-0.23581773042678833,
-0.19080784916877747,
0.4714853763580322,
0.11272947490215302,
-0.43623894453048706,
-0.07399938255548477,
-0.47148430347442627,
-0.9197136759757996,
0.42188891768455505,
-0.36881208419799805,
-0.288850... | |
if buf:
yield ''.join(buf)
buf = []
# All done. Yield last word.
if buf:
yield ''.join(buf)
```
You can use re.split
```
re.split('[\s|!\?\.;:"]', text)
```
However if the text is very large the resulting array may be consuming too much memory. Then you may consider r... | [
-0.18039365112781525,
0.06109369918704033,
0.68450927734375,
-0.5130994915962219,
0.048476316034793854,
0.19476883113384247,
0.6233819723129272,
-0.444465696811676,
-0.20161579549312592,
-0.6924779415130615,
-0.7960728406906128,
0.6639084219932556,
-0.3294248878955841,
-0.01498922612518072... | |
"([%s]+)" % "".join([("^" + c) for c in splitchars]),
text)
for word in words_iter:
yield word.group()
# a quick test
s = "a:b cc? def...a||"
words = [x for x in getwords(s)]
assert ["a", "b", "cc", "def", "a"] == words, words
``` | [
0.03142335265874863,
0.12594562768936157,
0.2956613004207611,
-0.2140800505876541,
-0.14437274634838104,
0.01107124425470829,
0.5217025876045227,
-0.4977136254310608,
0.04961149021983147,
-0.2763698697090149,
-0.4505653977394104,
0.6469029784202576,
-0.12611186504364014,
0.0537099316716194... | |
How do I debug .NET code written within a script task in a SSIS package? The development environment allows placing a breakpoint however does not take me to the code like it would in regular .NET programming while debugging.
Also, I am at a loss to understand how to add the SSIS package variables to the debug watch wi... | [
0.21969549357891083,
-0.01388387382030487,
-0.13241353631019592,
0.3225497305393219,
-0.1073220893740654,
-0.3441091775894165,
0.38600221276283264,
0.04160010814666748,
-0.05137628689408302,
-0.7276101112365723,
0.16427524387836456,
0.6926553249359131,
-0.20244309306144714,
0.0924087688326... | |
Visual Studio.
You may find it useful to consult the reference [Debugging How-To-Topics(SSIS)](http://msdn.microsoft.com/en-us/library/ms137880.aspx)
If you have developed your very own custom component, i.e. from within visual studio, then you should be able to debug the specific functionality of that component with... | [
0.7126423120498657,
-0.09653881192207336,
0.02765175700187683,
0.10150006413459778,
-0.335319459438324,
-0.3321530222892761,
0.154685378074646,
-0.2885704040527344,
-0.30118483304977417,
-0.5531119704246521,
-0.32272183895111084,
0.4250176250934601,
0.05197456106543541,
-0.130061075091362,... | |
I am very new to stress testing and am just trying to learn the ropes. So my questions are:
1. If I have a development server which in terms of software is identical but in terms of hardware has a much lower spec that the production server, is it worth stress testing the development server to identify obvious software... | [
0.7504076957702637,
0.40966126322746277,
-0.14820918440818787,
0.03617485240101814,
-0.060901280492544174,
-0.052561208605766296,
0.18489940464496613,
-0.17401453852653503,
-0.06053870916366577,
-0.6662856936454773,
0.3854261338710785,
0.9114882349967957,
0.19642336666584015,
-0.0141339404... | |
if it can handle the load it will have in production, then you need to do "capacity" testing. You should do your capacity testing on your production hardware, which since it hasn't gone "live" yet, won't affect users.
* If your application is an existing application that is already deployed in production then what you ... | [
0.4396975040435791,
0.005276264622807503,
-0.11007553339004517,
0.11453913897275925,
0.17599357664585114,
0.026098929345607758,
0.3003919720649719,
-0.26006677746772766,
-0.25767582654953003,
-0.7587881684303284,
-0.0900583565235138,
0.769411027431488,
0.251670777797699,
-0.180860653519630... | |
As you make changes to your application, re-run your performance regression tests to see if any results have changed significantly from the baseline (and record the new numbers as your new baseline).
* If the performance regression results on your development server didn't change much from the baseline then you should ... | [
0.36743855476379395,
-0.04319072142243385,
0.26838916540145874,
0.13288664817810059,
0.1660545915365219,
0.010385261848568916,
0.35355299711227417,
-0.13822029531002045,
-0.40788736939430237,
-0.774217426776886,
-0.06647545844316483,
0.5661367774009705,
0.028511306270956993,
0.080628275871... | |
You know in Xcode, you can press **option - command - left/right arrows** to switch between multiple files. But what are these files?
They seem to be the ones that have been opened. But is there any way to check what they are? And close some unwanted ones.
Or, any other way you know to switch between files??
[alt te... | [
0.3968488276004791,
-0.03961407393217087,
0.5212605595588684,
0.08912970870733261,
0.11492293328046799,
-0.015226036310195923,
0.1506832242012024,
0.030803505331277847,
-0.6160641312599182,
-0.71585613489151,
-0.010455822572112083,
0.02351190149784088,
-0.25262582302093506,
0.2189435064792... | |
open document and open the most recent | [
0.05516337603330612,
0.25228041410446167,
0.2196415364742279,
0.08930365741252899,
-0.27940481901168823,
-0.5665125846862793,
-0.06619428843259811,
0.05915243551135063,
-0.34672364592552185,
-0.6825525164604187,
-0.6308947205543518,
0.3376407325267792,
-0.051063697785139084,
0.232506409287... | |
I am assigned with the task of verifying some verilog based RTL code. Now, coding the RTL testbench using verilog seems to be very difficult (for me). So I would like to try one of the following.
- Try providing a PLI interface to the RTL and thereby invoke 'C functions for testing
- Using system 'C for interfacing the... | [
0.7453151345252991,
0.23491616547107697,
0.09568072855472565,
0.09608756750822067,
0.02532976120710373,
-0.07696735113859177,
0.1161152794957161,
-0.1355409324169159,
0.10792504251003265,
-0.7542535662651062,
0.25116050243377686,
0.9458262920379639,
-0.15529903769493103,
-0.444736570119857... | |
test the behavioral model, then the thing to do is to just add a PLI (or DPI) interface that will allow you to call that c code from verilog.
SystemC is basically C++ with a lot of classes that allow you to model HW. I don't see how you would benefit from learning SystemC for the task you are attempting as you already... | [
0.3859082758426666,
-0.2208942174911499,
-0.07340970635414124,
0.45612776279449463,
-0.08683132380247116,
-0.17403118312358856,
-0.16225220263004303,
0.13902518153190613,
-0.1401243507862091,
-0.4402157664299011,
0.573998749256134,
0.9981551170349121,
-0.36107009649276733,
-0.2528245747089... | |
then I would suggest that you learn SystemVerilog. These days SystemVerilog, basically verilog with a bunch of high level software language features built in; along with "VMM", a "verification methodology" (i.e. a bunch of libraries), seems to be all the rage in hardware verification land. | [
0.4099076986312866,
0.06809872388839722,
0.38210806250572205,
0.33000606298446655,
0.10850542783737183,
-0.4293816387653351,
0.06177953630685806,
0.21082906424999237,
-0.05146791785955429,
-0.4729454517364502,
-0.09293892979621887,
0.8102540373802185,
0.0872955396771431,
-0.190638050436973... | |
Is there any tool available which can generate [data-flow diagrams](http://en.wikipedia.org/wiki/Data_flow_diagram) and [entity relationship diagrams](http://en.wikipedia.org/wiki/Entity-relationship_model) directly from VB.NET source code?
The question **as for me** was how to make
```
A::A()
{ //constructor
bb = ne... | [
0.3055645227432251,
0.05802195519208908,
0.26588162779808044,
0.08384022116661072,
-0.129822239279747,
-0.19823190569877625,
0.005181887652724981,
-0.5218880772590637,
-0.3626706600189209,
-0.5532636642456055,
-0.03787435218691826,
0.5131059288978577,
-0.09013675898313522,
0.21415723860263... | |
it is better to implement like
```
A::A():
bb( new B() )
{
// some logic
}
```
In these both cases when 'some logic' will start its execution you can be sure that object bb either initialized or exception will be thrown.
To make your case compilable B should has implemented assign operator.
**To your edit... | [
0.16972142457962036,
-0.15835735201835632,
0.019146015867590904,
-0.017615195363759995,
-0.04342137649655342,
-0.11843349039554596,
0.21888910233974457,
-0.21620799601078033,
-0.365115761756897,
-0.6512842774391174,
-0.151341512799263,
0.654970645904541,
-0.5503978729248047,
0.157197728753... | |
Has anyone had any success setting up Zend\_Test? What was your method/approach and how do you run your tests/test suites?
I already have PHPUnit installed and working. Now I'm trying to write some simple controller tests. The Zend Framework documentation assumes that autoloading is setup, which I haven't done. What m... | [
0.6106138229370117,
0.033428192138671875,
-0.1621360331773758,
0.17130844295024872,
-0.18740130960941315,
-0.2756451666355133,
0.34521740674972534,
-0.28135812282562256,
-0.05072297155857086,
-0.6154077053070068,
0.43962225317955017,
0.6323202252388,
-0.11753188073635101,
-0.12374032288789... | |
like the documentation uses...is that how you bootstrap your tests, or do you like to do it a different way? I would like to re-use as much of the regular bootstrap file as I can. How should I DRY up my bootstrap for testing and normal use?
Here's my test so far:
```
<?php
class IndexControllerTest extends Zend_Test... | [
0.7823230624198914,
-0.038030266761779785,
0.37377414107322693,
0.07424693554639816,
0.3711112439632416,
0.09263939410448074,
0.2219255119562149,
-0.5388679504394531,
-0.16787932813167572,
-0.6429268717765808,
0.10982435196638107,
0.8961440920829773,
-0.2942988872528076,
-0.086679749190807... | |
$this->frontController->registerPlugin(new Bootstrapper('testing'));
}
public function testIndexAction()
{
$this->dispatch('/index');
$this->assertController('index');
$this->assertAction('index');
}
}
//straight from the documentation
class Bootstrapper extends Zend_C... | [
0.3687710165977478,
-0.2899118661880493,
0.20490847527980804,
-0.004247894044965506,
0.24737930297851562,
-0.1520186811685562,
0.3304382860660553,
-0.5776461958885193,
0.06763066351413727,
-0.44620099663734436,
-0.054836250841617584,
0.7557457685470581,
-0.4689231812953949,
0.1249250248074... | |
*/
protected $_env;
/**
* @var Zend_Controller_Front
*/
protected $_front;
/**
* @var string Path to application root
*/
protected $_root;
/**
* Constructor
*
* Initialize environment, root path, and configuration.
*
* @param string $env
* @p... | [
0.02438322640955448,
-0.01496985275298357,
0.4184911549091339,
-0.004082602448761463,
-0.04386498034000397,
0.5264440774917603,
0.25082558393478394,
-0.6449698805809021,
-0.45108938217163086,
-0.5132978558540344,
-0.12589865922927856,
0.38914868235588074,
-0.3312019109725952,
0.16213943064... | |
string|null $root
* @return void
*/
public function __construct($env, $root = null)
{
$this->_setEnv($env);
if (null === $root) {
$root = realpath(dirname(__FILE__) . '/../../../');
}
$this->_root = $root;
$this->initPhpConfig();
$this->_fr... | [
-0.22888094186782837,
-0.5326301455497742,
0.7061195373535156,
-0.3145611584186554,
0.36754122376441956,
0.044290874153375626,
0.4531315267086029,
-0.30191171169281006,
-0.1124294176697731,
-0.4551905691623688,
-0.3126392662525177,
0.7825223207473755,
-0.5890244841575623,
0.185513541102409... | |
}
/**
* Route startup
*
* @return void
*/
public function routeStartup(Zend_Controller_Request_Abstract $request)
{
$this->initDb();
$this->initHelpers();
$this->initView();
$this->initPlugins();
$this->initRoutes();
$this->initControllers... | [
-0.13295680284500122,
-0.30417269468307495,
0.3631264865398407,
0.03685299679636955,
0.18059420585632324,
-0.08913623541593552,
0.23935861885547638,
-0.011661075986921787,
-0.22100256383419037,
-0.8575299382209778,
-0.10689608752727509,
0.13755343854427338,
-0.5955725908279419,
0.224333718... | |
methods would follow...
}
```
What should I do?
Here's what I did to get it to work:
First, we need to resolve the autoloading issue. We'll do this by creating a file that all the tests will include, and put it in the tests directory. Note: I pretty much copied all of this from my /public/index.php.
```
# /tests/lo... | [
0.42719683051109314,
0.05440773814916611,
0.36288484930992126,
0.09111222624778748,
0.31159621477127075,
-0.06340941041707993,
0.2658493220806122,
-0.7273075580596924,
0.043651655316352844,
-0.7750208973884583,
0.20228859782218933,
0.7326029539108276,
-0.49284282326698303,
-0.1727203130722... | |
APPLICATION_PATH . '/forms' . PATH_SEPARATOR .
get_include_path() );
require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();
```
Second, we need to include this file in our test. Our test file is in /tests/application/controllers/ . I'm not going to use my bootstrap as a plugin since my bo... | [
-0.0005010060267522931,
-0.06783559918403625,
0.47434449195861816,
0.05957594886422157,
0.2706104815006256,
-0.2334951013326645,
0.27827638387680054,
-0.4902746379375458,
-0.04911234974861145,
-0.9138088822364807,
0.054039936512708664,
0.5033052563667297,
-0.36596688628196716,
0.0731095224... | |
public $bootstrap = '../../../application/bootstrap.php';
public function testIndexAction()
{
$this->dispatch('/index');
$this->assertController('index');
$this->assertAction('index');
}
}
```
And that's it! If my bootstrap file was already a plugin, this might be a little more c... | [
0.339565247297287,
0.004641729407012463,
0.13526810705661774,
-0.04002056270837784,
0.0766398087143898,
-0.2181576043367386,
0.548350989818573,
-0.42438915371894836,
0.19706979393959045,
-0.34998399019241333,
0.01844981126487255,
0.6977973580360413,
-0.2835417687892914,
-0.0673095658421516... | |
Let's suppose that I have WebDAV-enabled server, where I have bunch of Office documents. I'd like to generate webpage which has link to document such that clicking on the link will open Microsoft Word. Word will in turn download document from WebDAV server, and when user finishes editing document, MS Word will upload i... | [
0.4180176854133606,
0.1832837164402008,
0.40292975306510925,
0.2497677057981491,
0.016384776681661606,
-0.025637874379754066,
0.021700439974665642,
0.10373584181070328,
-0.33813124895095825,
-0.5483100414276123,
0.07529610395431519,
0.5431003570556641,
-0.14349746704101562,
0.3990173637866... | |
I recall, the only way to achieve this is to explicitly instantiate Word through ActiveX, and the pass it the URL to open.
This can be done inside the HTML page (in which it'll need IE), or using an external application that then would need to be registered for a new mime type (see <http://greenbytes.de/tech/webdav/rf... | [
0.3070131838321686,
-0.08402451872825623,
0.4499262273311615,
-0.1963958889245987,
0.061463333666324615,
-0.1973809450864792,
0.6257967352867126,
0.1493387222290039,
-0.08602725714445114,
-0.8195098638534546,
-0.3825496435165405,
0.1518082320690155,
-0.18804894387722015,
0.1834978759288787... | |
How would I go about making a [Flight Gear](http://www.flightgear.org/) port for WiiBrew? Or, better yet, how would I convince someone else to?
> How would I go about making a Flight Gear port for WiiBrew?
"Porting" any non-trivial application is at least two-fold: technically, you'll first have to get the source code... | [
0.43477025628089905,
-0.013677234761416912,
0.42512133717536926,
0.4810223877429962,
0.021648282185196877,
-0.2491048276424408,
0.13225513696670532,
-0.26828643679618835,
0.12225420773029327,
-0.358051061630249,
-0.0838145986199379,
0.8824684619903564,
-0.009622929617762566,
-0.05111302807... | |
own dependencies!), which mainly seems to boil down to:
* [plib](http://plib.sourceforge.net/)
* [SDL](http://www.libsdl.org/)
* (pthreads: linux)
* [OpenAL](http://connect.creativelabs.com/openal)
* [OpenSceneGraph](http://www.openscenegraph.org/)
* [simgear](http://www.simgear.org)
Instructions for building FlightG... | [
0.23737435042858124,
0.3580150604248047,
0.8611962199211121,
0.07052231580018997,
0.1947302371263504,
-0.02973273955285549,
0.04627225175499916,
-0.30534830689430237,
-0.17590920627117157,
-0.5525954961776733,
-0.27905863523483276,
0.7848083972930908,
-0.22805795073509216,
-0.3626572191715... | |
target platform looks not suitable in this case, for this application - due to its runtime hardware requirements.
In fact, searching the FlightGear forums brings up a [related discussion](http://flightgear.org/forums/viewtopic.php?f=6&t=1833&p=13982) about running FlightGear on embedded (game console/mobile) platforms... | [
0.06092623993754387,
0.2609173357486725,
0.3780624270439148,
0.15119916200637817,
0.1873835027217865,
-0.16236725449562073,
0.029873764142394066,
-0.30313003063201904,
0.15908975899219513,
-0.6756318211555481,
-0.1764695793390274,
0.514803946018219,
-0.36030301451683044,
-0.357754677534103... | |
point of view, FlightGear is a flight simulator designed for use on personal computers, with certain peripherals present - in other words, it basically relies on a keyboard and mouse, as well as other input hardware (joystick/pedals).
So, even if you manage to port FlightGear to a viable target platform, it would stil... | [
0.1996898651123047,
0.02429422363638878,
0.44909796118736267,
0.5786411166191101,
0.3265233635902405,
-0.09728841483592987,
-0.29439064860343933,
0.018160419538617134,
0.25378039479255676,
-0.42520734667778015,
-0.0073869782499969006,
0.7337234616279602,
-0.03410503268241882,
-0.4191503822... | |
definitely a non-trivial task that cannot be easily accomplished, so while it's certainly possible, it would require a good amount of time or **money**.
So, if you have the funding available, you could try to outsource this effort using freelance sites such as [rentacoder](http://www.rentacoder.com/)/[elance](http://w... | [
0.5967402458190918,
0.013921286910772324,
0.1305088996887207,
0.5514680743217468,
0.473004013299942,
0.06056226044893265,
-0.11727683246135712,
0.1444411426782608,
-0.1707882583141327,
-0.7610981464385986,
0.1270400583744049,
0.40746447443962097,
0.25325727462768555,
0.0165808517485857,
... | |
required would not be specific to just one device, but would generally be useful for all efforts related to porting FlightGear to non-PC platforms, no matter if it's nintendo wii, sony playstation, apple iphone ...
In general, it would probably be a good idea to contact the FlightGear developers team and discuss your ... | [
0.42967844009399414,
-0.01338781788945198,
0.35141241550445557,
0.7402143478393555,
0.25046825408935547,
-0.30921313166618347,
-0.5039327144622803,
-0.30715155601501465,
0.29446426033973694,
-0.44080543518066406,
-0.28623896837234497,
0.3946484625339508,
0.1578979343175888,
-0.235060930252... | |
I have a custom ListBox which uses a custom Panel as ItemsHost. I want to have control over mouse wheel input, so that turning the wheel changes the single selected item.
I believe that the best method to do so is to handle the OnPreviewMouseWheel event (although this is only have what I want since it doesn't provide ... | [
-0.017736338078975677,
-0.012911006808280945,
0.5261056423187256,
0.034579481929540634,
-0.1808924525976181,
0.3169609308242798,
0.06468221545219421,
-0.25155478715896606,
-0.5828560590744019,
-0.6177443265914917,
0.15252414345741272,
0.5054912567138672,
0.2180410772562027,
0.2205063551664... | |
the "IsSelected" property of it's child elements)?
Use an inline statement as John\_ states, or, create a function in your code behind that performs the logic required.
```
protected string MyFunction(int nbrOrders)
{
if(nbrOrders>=Config.MAX_ENQUIRY_SALES)
{
return "TrueResult";
}
else
{
... | [
0.05115106701850891,
0.1890585869550705,
0.5614684820175171,
-0.17410491406917572,
0.23322618007659912,
0.23363535106182098,
0.22633153200149536,
-0.2701406478881836,
-0.023022128269076347,
-0.5558731555938721,
-0.2658001184463501,
0.5080942511558533,
-0.2344939261674881,
0.097579948604106... | |
you can try using the Visible flag of a placeholder containing your code. Such as:
```
<asp:PlaceHolder id="PlaceHolder1" runat="server" visible='<%# (Convert.ToInt32(Eval("NbrOrders"))>=Config.MAX_ENQUIRY_SALES)%>'>
<div>My True Html Here</div>
</asp:PlaceHolder>
<asp:PlaceHolder id="PlaceHolder2" runat="server" ... | [
0.22561997175216675,
-0.07737910002470016,
0.5184587836265564,
0.055834297090768814,
-0.041940510272979736,
0.2082565873861313,
0.3480725884437561,
-0.23441210389137268,
-0.06240182742476463,
-0.7851439118385315,
-0.27937474846839905,
0.3289012908935547,
-0.07841505110263824,
-0.0148970047... | |
I am trying to send an ajax request in the onunload event of a page.
I am using the $.post function of jquery, but when the event actually fires i get this error: "Microsoft JScript runtime error: '$' is undefined"
Does this mean that the jquery library has been deferenced before the $.post function was called and so ... | [
0.1327826976776123,
0.1710265576839447,
0.03728332370519638,
-0.21821436285972595,
-0.33165213465690613,
-0.3761667311191559,
0.5148963332176208,
0.0024010539054870605,
-0.06836759299039841,
-0.7323383092880249,
-0.0868375152349472,
0.560447633266449,
-0.49653780460357666,
0.15360581874847... | |
($.browser.msie)
{
alert("this is msie!");
}
$.post("../Main/FloatingWindowAjax.aspx", {REMOVEONLINEUSER : "<%=Master.UserId.ToString() %>" });
return false;
}
window.onunload = RemoveFromOnlineUsers;
</script>
```
You can't simply write more XML to the end of a seri... | [
0.007215842604637146,
-0.10796196758747101,
0.5036298036575317,
-0.2891519367694855,
0.04174282029271126,
-0.2615492641925812,
0.4307253360748291,
-0.0788399949669838,
-0.26409369707107544,
-0.7822775840759277,
-0.40139588713645935,
0.2514142096042633,
-0.5199828147888184,
0.36882889270782... | |
= XmlWriter.Create(strXmlTestCasePath));
{
xw.WriteStartElement("container");
ds.WriteXml(xw, XmlWriteMode.IgnoreSchema);
// from here on, you can use the XmlWriter to add XML to the end; you then
// have to wrap things up by closing the enclosing "container" element:
...
xw.WriteEndElement();
}
```
... | [
0.050189144909381866,
0.0010504461824893951,
0.7454957962036133,
-0.08988883346319199,
0.08494623005390167,
-0.22640249133110046,
0.1387069672346115,
-0.5489340424537659,
0.05655601993203163,
-0.5588991045951843,
-0.0750112310051918,
0.5871279835700989,
-0.2905416488647461,
0.2192036956548... | |
the `DataSet` and then delete it when you're done. It really depends on what your actual requirements are. | [
0.422850102186203,
0.018741877749562263,
0.25255855917930603,
0.4251236617565155,
0.38960620760917664,
-0.042250536382198334,
0.05661439895629883,
0.06325925141572952,
0.09210563451051712,
-0.43087640404701233,
-0.293220192193985,
0.6358376145362854,
0.05111893638968468,
-0.084318414330482... | |
Is there an easier way to break out of nested loops than throwing an exception? (In [Perl](https://en.wikipedia.org/wiki/Perl), you can give labels to each loop and at least continue an outer loop.)
```
for x in range(10):
for y in range(10):
print x*y
if x*y > 50:
"break both loops"
`... | [
0.2621461749076843,
-0.2357190102338791,
-0.27186572551727295,
0.13911421597003937,
-0.04950982704758644,
-0.20929065346717834,
0.5655671954154968,
-0.36816713213920593,
-0.4223111569881439,
-0.097749263048172,
-0.46440818905830383,
0.2927907705307007,
-0.2841991186141968,
-0.2970106303691... | |
range(10):
print x*y
if x*y > 50:
raise BreakIt
except BreakIt:
pass
```
It has at least been suggested, but also [rejected](http://www.python.org/dev/peps/pep-3136/). I don't think there is another way, short of repeating the test or re-organizing the code. It is sometimes ... | [
0.19286055862903595,
0.22021177411079407,
0.19324952363967896,
-0.25308752059936523,
-0.1599321961402893,
0.2740023732185364,
0.4517694115638733,
-0.5365399718284607,
-0.017974931746721268,
-0.05792897567152977,
-0.337345153093338,
0.4891567826271057,
-0.2314424365758896,
-0.25964662432670... | |
personally. :) | [
0.1911110281944275,
0.20928075909614563,
0.26190510392189026,
0.2873314917087555,
-0.07546805590391159,
0.33746278285980225,
-0.001534114358946681,
-0.08752768486738205,
-0.23850247263908386,
-0.13617227971553802,
-0.2074883133172989,
0.40369030833244324,
0.08512576669454575,
-0.0087700532... | |
When I check in code to our Team Foundation Server, I some times (probably more often than I actually do...) should associate my check-in with a task or a bug I am working towards. When I mark a task or a check in, it sets the Check-in Action to Resolve. But almost always, I just want to have it as just Associate. The ... | [
-0.05387016385793686,
0.13808220624923706,
0.1379351019859314,
0.0690845176577568,
0.08202317357063293,
-0.16396284103393555,
0.4577189087867737,
-0.05807194113731384,
-0.14365154504776,
-0.6744092106819153,
0.17819207906723022,
0.5948187708854675,
-0.27445054054260254,
-0.5067757368087769... | |
actively select. Like, this work item is related to my check-in AND it is now resolved. Not, this work item is related to my check-in, and btw, I still haven't fixed it completely yet...
Sadly, there is no way to make resolve and associate both available but default to associate. Therefore the safest option for you is ... | [
-0.11419098824262619,
-0.08721767365932465,
0.3051442503929138,
0.027871839702129364,
0.25799041986465454,
-0.28726911544799805,
0.32985156774520874,
-0.22307230532169342,
-0.3220447599887848,
-0.4629260003566742,
-0.05002490431070328,
0.9099361300468445,
-0.5826665163040161,
-0.0509379729... | |
a Work Item](http://www.woodwardweb.com/vsts/top_tfs_tip_3_r.html) | [
0.624093770980835,
-0.1857028305530548,
0.6466761231422424,
0.10447098314762115,
0.10610149055719376,
-0.37066560983657837,
0.09285285323858261,
-0.7975853085517883,
-0.5257121324539185,
0.1174347847700119,
0.09680679440498352,
0.420731782913208,
-0.16431966423988342,
0.06777859479188919,
... | |
I would like to pass some (dll or not) function pointers as arguments to some dll functions and call them from inside of the dll. I wonder if it is safe because I have found an information on <http://publib.boulder.ibm.com/infocenter/zos/v1r10/index.jsp?topic=/com.ibm.zos.r10.cbcpx01/fpref.htm> that:
*In DLL code, it ... | [
-0.103046715259552,
0.001969089498743415,
0.28373605012893677,
-0.05087045952677727,
-0.20546887814998627,
-0.022596778348088264,
0.018940310925245285,
0.012350265868008137,
0.05418338254094124,
-0.3683422803878784,
-0.2754374146461487,
0.48971858620643616,
-0.45185738801956177,
0.51932793... | |
a pointer produces an undefined function address. The subsequent branching to the undefined address may result in an exception.*
Does this rule apply to Visual Studio and other compilers as well?
What precisely I am trying to do is to solve the problem of memory allocation and deallocation between various dll and non... | [
-0.020839709788560867,
0.03793121501803398,
0.12474556267261505,
0.09391672909259796,
-0.12412424385547638,
0.06036408245563507,
-0.051477253437042236,
-0.15496213734149933,
-0.12622250616550446,
-0.5970912575721741,
-0.18867595493793488,
0.368066668510437,
-0.4509596824645996,
-0.04235069... | |
the same way as non-DLL code. If that were not the case, one could not use standard library functions like qsort() (which expects a function pointer argument) within a DLL. | [
-0.22085179388523102,
-0.46290886402130127,
0.12880119681358337,
0.1786724179983139,
-0.1555749922990799,
-0.19862954318523407,
-0.004471414256840944,
0.009339384734630585,
0.11601800471544266,
-0.5963718295097351,
-0.33558031916618347,
0.5749526619911194,
-0.39299845695495605,
0.044126760... | |
Here is the situation for which I am trying to find a suitable design.
I need to store profiles of numbers. A profile is just a series of numbers. They can be of either int, float or decimal type. Each profile has a ProfileDescription field based on an ennumeration.
Each Profile has a collection of ProfileVersion Ob... | [
0.3985980749130249,
-0.2275836318731308,
0.35723844170570374,
0.2236451506614685,
-0.4201110899448395,
0.3845585584640503,
-0.07965828478336334,
-0.1496737003326416,
0.14142479002475739,
-0.7349740862846375,
0.35543280839920044,
0.4445357024669647,
-0.17552238702774048,
0.02252644486725330... | |
a List of Profiles of different types, which I cannot have. I could use an ArrayList instead, but then i would have to cast out the data within it.
I though it might be possible to make just ProfileVersion and ProfileValue generic, and then have the Profile Object assign a type to the ProfileVersion depending on the v... | [
0.28017234802246094,
-0.1286381632089615,
0.39661461114883423,
-0.022700456902384758,
-0.47375980019569397,
0.14559757709503174,
0.23538580536842346,
-0.11127801239490509,
-0.08224659413099289,
-0.7154545783996582,
0.4386735260486603,
0.4886554181575775,
-0.3043888509273529,
0.165188848972... | |
having each class being generic, as I would have to cast out the subclass each time anyway.
I would appreciate your thoughts on the best design approach for this situation.
Thanks
Grzenio's idea is correct. Each of your profile classes could be made to be implementations of an `IProfile` object, and then your contain... | [
0.20157141983509064,
-0.11288753151893616,
0.2496493011713028,
0.2372172325849533,
-0.15953707695007324,
0.3218208849430084,
0.08582872152328491,
-0.16858002543449402,
-0.25623366236686707,
-0.773289144039154,
0.16496410965919495,
0.4941236972808838,
-0.5870984792709351,
0.2480877041816711... | |
and
> DecimalProfile, but this wouldn't
> really give me any advantage over
> having each class being generic, as I
> would have to cast out the subclass
> each time anyway.
The benefits would really depend on the level of abstractions that you make for your classes. If designed properly you can ideally have oper... | [
0.17779533565044403,
0.049980778247117996,
-0.08134309202432632,
0.2621942460536957,
-0.2925759553909302,
0.004760392941534519,
0.0581342950463295,
-0.08705182373523712,
-0.08169321715831757,
-0.3615780770778656,
0.1456594169139862,
0.558647096157074,
0.054216574877500534,
-0.0839333757758... | |
The information should be 2 date time columns(inserted/updated) with ms precision and should be automatically updated by the server whenever someone inserts, or updates a row.
Add columns to your table
```
ALTER TABLE yourTable ADD
Inserted datetime NULL,
Updated datetime NULL
GO
```
Create an Update and Ins... | [
-0.019735511392354965,
0.025089435279369354,
0.9479472637176514,
-0.019025880843400955,
0.33078473806381226,
-0.06329581886529922,
-0.12997278571128845,
-0.2620578110218048,
-0.12535719573497772,
-0.556915283203125,
-0.21318332850933075,
0.49656742811203003,
-0.3865955173969269,
0.02725697... | |
UPDATE AS
BEGIN
Update yourTable Set Updated = getdate()
from Updated
Where yourTable.Key = Updated.Key
END
GO
```
Now if you want to be really clean, you'd make sure that these two columns couldn't be changed/updated by using views instead of direct table access for your other access to the data. Also i... | [
0.5441197156906128,
-0.07020451128482819,
0.7610631585121155,
-0.1986953467130661,
-0.15194998681545258,
-0.2116854041814804,
0.1568092703819275,
-0.1668122261762619,
-0.024330483749508858,
-0.8638682961463928,
0.0341833159327507,
0.6096442937850952,
-0.166055366396904,
0.19328345358371735... | |
I found this piece of code inside System.Web.ISAPIRuntime using Reflector
```
public void DoGCCollect()
{
for (int i = 10; i > 0; i--)
{
GC.Collect();
}
}
```
Can anyone comment on this? Is there a reason to do GC.Collect() in a loop? Why 10 times and not 3, 5 or 20? Analysis indicated that it's ... | [
0.5814110636711121,
0.0007751513621769845,
0.4057481288909912,
-0.029409613460302353,
-0.23196744918823242,
-0.2676733732223511,
0.4610353708267212,
-0.1598941832780838,
-0.4192998707294464,
-0.34038159251213074,
0.08281853049993515,
0.33300715684890747,
-0.6631195545196533,
0.107490919530... | |
it. I know it's a bad idea in most (if not all) cases. The question is why .net framework does it. Thanks for all your answers.
I don't think you're going to get a better explanation that "one of Microsoft's programmers is pretty clueless, and apparently, no one else bothered to look at his code before it was checked i... | [
0.45917317271232605,
0.037042442709207535,
0.11429087072610855,
0.4518791139125824,
-0.03562629967927933,
-0.6229718327522278,
0.32332944869995117,
0.6906382441520691,
-0.04873893782496452,
-0.28172406554222107,
-0.06540973484516144,
0.5453917384147644,
-0.566585898399353,
0.21372407674789... | |
you should wait for the finalizer thread or something), so the naive solution is obviously "Well, I'll just keep calling it then".
Similar to pressing 'print' repeatedly until your document is printed.
Perhaps you should submit it to thedailywtf.com though. | [
0.5834433436393738,
-0.4086318016052246,
0.47086894512176514,
0.06141887605190277,
0.008305019699037075,
-0.266367107629776,
0.16189131140708923,
0.09151763468980789,
-0.12129246443510056,
-0.48985549807548523,
0.13052582740783691,
0.34889650344848633,
0.2987369894981384,
0.140738651156425... | |
Is there some way to make the following possible, or should it be done elsewhere?
```
class JobRecordForm(forms.ModelForm):
supervisor = forms.ModelChoiceField(
queryset = User.objects.filter(groups__name='Supervisors'),
widget = forms.RadioSelect,
initial = request.user # is t... | [
0.060155391693115234,
-0.19680015742778778,
0.2169855237007141,
0.07578588277101517,
0.23121556639671326,
-0.07202789187431335,
0.3925936818122864,
-0.29991453886032104,
-0.4243994355201721,
-0.42457157373428345,
-0.052893903106451035,
0.4819583296775818,
-0.45001569390296936,
0.0040664160... | |
handle this in your view function. Since your view function must create the initial form, and your view function knows the user.
```
form = JobRecordForm( {'supervisor':request.user} )
```
This will trigger validation of this input, BTW, so you can't provide hint values this way. | [
-0.1495097428560257,
-0.043161630630493164,
0.37463948130607605,
-0.2509739398956299,
0.17652584612369537,
-0.16475312411785126,
0.1302088052034378,
-0.050246138125658035,
0.14083555340766907,
-0.5721105337142944,
-0.19737055897712708,
0.5187047719955444,
-0.2316146045923233,
-0.0246532727... | |
From MySQL query I get data which I put into a dictionary "d":
> d = {0: (datetime.timedelta(0,
> 25200),), 1: (datetime.timedelta(0,
> 25500),), 2: (datetime.timedelta(0,
> 25800),), 3: (datetime.timedelta(0,
> 26100),), 4: (datetime.timedelta(0,
> 26400),), 5: (datetime.timedelta(0,
> 26700),)}
I have a list ... | [
0.09342948347330093,
-0.12293988466262817,
0.43164780735969543,
-0.12414917349815369,
0.1494196504354477,
0.31761670112609863,
0.2522292733192444,
-0.5170456171035767,
0.028377441689372063,
-0.5548923015594482,
-0.047492753714323044,
0.09843838959932327,
-0.13751621544361115,
0.24508744478... | |
d[3], d[5] in list "h":
> h = [7:05:00, 7:15:00, 7:25:00]
I'll appreciate your input for that...
I'm not entirely sure if this is what you're looking for, but I'll take a shot:
```
>>> indices = [index for index, i in enumerate(m) if i == 4]
>>> h = [d[i][0] for i in indices]
```
Then you have to process the timed... | [
0.49326780438423157,
-0.37192201614379883,
-0.06759987771511078,
0.34124860167503357,
-0.22801198065280914,
0.22821751236915588,
0.11740301549434662,
-0.5524917244911194,
-0.05244719982147217,
-0.6863340139389038,
0.224077969789505,
0.40667131543159485,
-0.1332063525915146,
-0.051886361092... | |
I'm trying to write a freeze decorator for Python.
The idea is as follows :
**(In response to the two comments)**
I might be wrong but I think there is two main use of
test case.
* One is the test-driven development :
Ideally , developers are writing case before writing the code.
It usually helps defining the arc... | [
0.6076278686523438,
0.1863379031419754,
-0.29560184478759766,
0.050188541412353516,
-0.08700534701347351,
0.06734346598386765,
0.201145738363266,
-0.03482256084680557,
-0.1248539462685585,
-0.6548805236816406,
0.049092404544353485,
0.4154708981513977,
-0.16744978725910187,
-0.0849411189556... | |
use of test case like that.
* The second is the idea that all project with a decent
size and a several programmers is suffering from broken code.
Something that use to work may get broken from a change
that looked like an innocent refactoring.
Though good architecture, loose couple between component may
help to fight ... | [
0.4335864186286926,
0.16564416885375977,
0.03739342838525772,
0.23791064321994781,
-0.11709310114383698,
-0.2588382363319397,
0.35296037793159485,
-0.2814139723777771,
-0.31413209438323975,
-0.8042434453964233,
0.008006330579519272,
0.4756433367729187,
-0.0636887401342392,
0.33375325798988... | |
to be considered as an overhead.
Frankly speaking, I'm a pretty young programmer and if I were
you, my word on this subject is not really valuable...
Anyway, I think that mosts company/projects are not working
like that, and that unit tests are mainly used in the second
case...
In other words, rather than ensuring th... | [
0.5130556225776672,
0.22990381717681885,
-0.28029102087020874,
0.1300920844078064,
0.18875369429588318,
0.007236870937049389,
0.1890908032655716,
-0.26575782895088196,
-0.19040948152542114,
-0.23473942279815674,
-0.19982939958572388,
0.31598523259162903,
-0.05958916246891022,
0.15928775072... | |
else: return n * pow(n,k-1)
```
It is perfectly nice, and you want to rewrite it as an optimized version.
It is part of a big project. You want it to give back the same result
for a few value.
Rather than going through the pain of test cases, one could use some
kind of freeze decorator.
Something such that the... | [
0.30176886916160583,
-0.0610809400677681,
0.2599693536758423,
-0.1327267438173294,
0.3054965138435364,
0.015299247577786446,
0.23863911628723145,
-0.34753087162971497,
-0.07072098553180695,
-0.7911984920501709,
-0.15664142370224,
0.32716307044029236,
-0.30479469895362854,
-0.23252066969871... | |
return 1
else: return n * pow(n,k-1)
```
Next time the program is executed, the decorator will load this map and check
that the result of this function for these args as not changed.
I already wrote quickly the decorator (see below), but hurt a few problems about
which I need your advise...
```
from __fut... | [
0.23696918785572052,
0.13212168216705322,
0.5374488830566406,
-0.18653520941734314,
0.1330510973930359,
0.11343232542276382,
0.09381899237632751,
-0.5543183088302612,
-0.2857136130332947,
-0.6212390661239624,
-0.22745291888713837,
0.5470810532569885,
-0.5093122124671936,
0.0486627630889415... | |
return []
else:
return [g.next()] + generator_firsts(g, N-1)
except StopIteration :
return []
def __post_process(v):
specialized_postprocess = [
(GeneratorType, generator_firsts),
(Exception, str),
]
try:
val_mro = v.__class__.mro()
for (... | [
0.00702782953158021,
-0.3847077190876007,
0.2667466700077057,
-0.2922392785549164,
0.30159860849380493,
0.5297218561172485,
0.2703201174736023,
-0.47139617800712585,
-0.18489348888397217,
-0.4069846272468567,
-0.44727325439453125,
0.6362707018852234,
-0.2679731845855713,
-0.070616975426673... | |
specialized ) in specialized_postprocess:
if ancestor in val_mro:
return specialized(v)
raise ""
except:
print "Cannot accept this as a value"
return None
def __eval_function(f):
def aux(args, kargs):
try:
return ( | [
-0.0077910213731229305,
-0.3072381913661957,
0.3571861684322357,
-0.1534033566713333,
0.15732434391975403,
0.43765226006507874,
0.22525033354759216,
-0.4410967230796814,
-0.15664364397525787,
-0.29212355613708496,
-0.4832878112792969,
0.8068936467170715,
-0.20042426884174347,
0.05705150589... | |
True, __post_process( f(*args, **kargs) ) )
except Exception, e:
return ( False, __post_process(e) )
return aux
def __compare_behavior(f, past_records):
for (args, kargs, result) in past_records:
assert __eval_function(f)(args,kargs) == result
def __record_behavior(f, past_records,... | [
-0.017969762906432152,
0.13718773424625397,
0.41291651129722595,
-0.07391683012247086,
0.03327268362045288,
0.3654190003871918,
0.378685861825943,
-0.5869397521018982,
-0.3655417263507843,
-0.2009311467409134,
-0.24918144941329956,
0.8678393363952637,
-0.1082656979560852,
0.227076560258865... | |
past_records.append( (args, kargs, res) )
def __open_frz():
try:
with open(".frz", "r") as __open_frz:
return cPickle.load(__open_frz)
except:
return defaultdict(list)
def __save_frz(past_records):
with open(".frz", "w") as __open_frz:
return cPickle.dump(past_records, ... | [
-0.11537656933069229,
-0.04408031702041626,
0.5254390835762024,
-0.15641456842422485,
0.3113726079463959,
0.34139880537986755,
0.15399456024169922,
-0.45065608620643616,
-0.4748045802116394,
-0.3444056212902069,
-0.23186980187892914,
0.6143528819084167,
-0.36722591519355774,
0.232522845268... | |
f_past_records = past_records[f_id]
__compare_behavior(f, f_past_records)
__record_behavior(f, f_past_records, args, kvargs)
__save_frz(past_records)
return f
return freeze_decorator
```
* Dumping and Comparing of results is not trivial for all type. Right now I'm thinking about us... | [
0.08089011907577515,
0.14801666140556335,
0.38708552718162537,
-0.05599099397659302,
0.2388755977153778,
0.3007429540157318,
0.1489851176738739,
-0.5469458699226379,
-0.36351242661476135,
-0.72114098072052,
-0.13859622180461884,
0.4919964373111725,
-0.06341158598661423,
0.5770546793937683,... | |
the user overload the predefined postprocess function.
My first question is :
**Do you know a way to check if an object is dumpable or not?**
* Defining a key for the function decorated is a pain. In the following snippets
I am using the function module and its name.
\*\* Can you think of a smarter way to do that. \*\... | [
0.3580048680305481,
0.1868678331375122,
0.06079912185668945,
0.0342838279902935,
-0.018947910517454147,
-0.05253896117210388,
0.23628032207489014,
-0.06373587250709534,
-0.3074047565460205,
-0.7077788710594177,
0.11087901145219803,
0.5261144042015076,
-0.1497868001461029,
0.068192809820175... | |
the file...
* I intend to add some functionalities to this. For instance, add the possibity to define
an iterable to browse a set of argument, record arguments from real use, etc.
Why would you expect from such a decorator?
* In general, would you use such a feature, knowing its limitation... Especially when trying to ... | [
0.42092716693878174,
0.14194925129413605,
0.028648922219872475,
0.43396204710006714,
0.202311709523201,
0.03819148987531662,
-0.08531899005174637,
-0.17585064470767975,
-0.2679765522480011,
-0.1341971606016159,
-0.07034273445606232,
0.627536416053772,
0.08685381710529327,
0.018152683973312... | |
hard or complex or expensive; and (2) it could be simpler to write the code, "freeze" the results and somehow use the frozen results for refactoring. This isn't helpful. Indeed, the very real possibility of freezing wrong answers makes this a bad idea.
First, on "consistency vs. correctness". This is easier to preserv... | [
0.01958133839070797,
0.17200016975402832,
0.11096320301294327,
0.2845678925514221,
0.1068536639213562,
0.2573573887348175,
0.3409839868545532,
-0.2983860671520233,
0.038607239723205566,
-0.643765389919281,
-0.3606135845184326,
0.5834806561470032,
-0.07486388087272644,
-0.05659198760986328,... | |
point of a unit test is **not** to "freeze" some random results. The point of a unit test is to compare real results with results developed another (simpler, more obvious, poorly-performing way). Usually unit tests compare hand-developed results. Other times unit tests use obvious but horribly slow algorithms to produc... | [
0.2766185700893402,
-0.13062387704849243,
-0.2978469729423523,
0.5499176383018494,
-0.14284153282642365,
0.1145104467868805,
0.23021747171878815,
-0.03132733702659607,
0.10370391607284546,
-0.45102497935295105,
-0.410349577665329,
-0.14704065024852753,
-0.03374657407402992,
0.1918752044439... | |
a bad idea; it looks like it subverts the intent of unit testing.
---
**"HOWEVER, Nobody can deny the overhead of writting test cases"**
Actually, many folks would deny the "overhead". It isn't "overhead" in the sense of wasted time and effort. For some of us, unittests are essential. Without them, the code may work... | [
0.8744704723358154,
0.1798827350139618,
-0.11469630151987076,
0.47735491394996643,
0.06852693110704422,
0.1179528683423996,
0.34853678941726685,
-0.16589295864105225,
-0.10830695182085037,
-0.5652837157249451,
0.1740366816520691,
0.8243138790130615,
0.28069931268692017,
0.1230454072356224,... | |
How can i create a browser component in J2ME which can display web pages inside an application? Is there any API available for this ? or is this really possible ?
As far as I know, the only browser written in J2ME is Opera Mini (not to get confused with Opera Mobile, which is a different thing). It runs amazingly good ... | [
0.17122557759284973,
-0.14520274102687836,
0.09141682088375092,
-0.05238265544176102,
-0.1681969314813614,
-0.1288602203130722,
0.3090446889400482,
0.2687399089336395,
-0.08983955532312393,
-0.9105618000030518,
0.09538466483354568,
0.441135048866272,
-0.24065299332141876,
-0.20677347481250... | |
or even impossible. You'd be able to code up a browser that displays very basic HTML pages, but doing it right even for more complex pages seems to be impossible on J2ME because of the limited memory and CPU.
I could imagine that some high end phones come with a custom API to embed a native browser into you Midled, bu... | [
0.13873013854026794,
0.049458231776952744,
0.027251742780208588,
0.34465500712394714,
-0.06971956789493561,
0.014886965975165367,
0.544223964214325,
0.3041438162326813,
0.080177903175354,
-0.3761592209339142,
0.0365789495408535,
0.3510490357875824,
-0.14724411070346832,
-0.1040444374084472... | |
I am a long time PHP user when it comes to web applications and am mostlz comfortable with it. However, I have a one semi-large project whose maintenance / extensibility has reached its end of a life cycle. I was weighing on different PHP frameworks (there were no when the project originated), since it is the way to go... | [
0.16398654878139496,
0.005120493471622467,
0.22382044792175293,
0.2249210625886917,
-0.3463951647281647,
-0.1783342808485031,
0.19418486952781677,
0.05218920856714249,
-0.027560990303754807,
-0.6473443508148193,
0.3194166123867035,
0.41370606422424316,
-0.13042308390140533,
0.0579216666519... | |
then it seemed to me it is more like Zend with less features and no Zend behind it
* Zend I like the system of that I can use only what I like and not being tied into a specific directory structure, and of course there is Zend behind it. Performance is what potentially bothers me
Now, after this little rationale behin... | [
0.4199977517127991,
0.12779533863067627,
-0.008745276369154453,
0.19812245666980743,
-0.5454129576683044,
-0.2140975445508957,
0.25350818037986755,
-0.1705908626317978,
-0.15109871327877045,
-0.4521009624004364,
0.2788330614566803,
0.623755156993866,
0.02846686542034149,
-0.165433317422866... | |
use ORM
* Not too much abstraction going on from the guts
* Flexible directory structure
As long as this project is going to be written anew, I just as might write it in Python/Django, since I am quite familiar with Python, but not with Django. So, I would like to know if there is someone that worked with both Zend Fr... | [
0.635002851486206,
0.15197162330150604,
0.17829257249832153,
0.11327172815799713,
-0.09267096221446991,
-0.39757129549980164,
-0.13728207349777222,
0.2092994749546051,
-0.28120550513267517,
-0.5964834690093994,
0.1798340380191803,
0.6853371262550354,
-0.08941630274057388,
-0.08367331326007... | |
other is for data administration in the backend. I must and will build backend on my own, some scaffolding methods would be cool, but full automatic scaffolding is as good as nothing in this case.
I am still quite not sure how one approaches building basically two applications within a directory structure of, what is... | [
0.39560890197753906,
-0.07262130826711655,
0.16134372353553772,
0.12591922283172607,
-0.006016445346176624,
-0.0024997671134769917,
-0.06435804814100266,
-0.10989652574062347,
-0.42416253685951233,
-0.6253167986869812,
0.03638163208961487,
0.500902533531189,
-0.22525088489055634,
0.0810674... | |
can see - everything is pretty much related to one problem - I need to start a project anew, it has already established database+data which I can remodel, but would like to keep that kind of work at minimum.
---
Ok, thank you everybody - looks like I'll try and implement this stuff with Zend, gives me most flexibilit... | [
0.4361051023006439,
0.3187028467655182,
0.3169892132282257,
0.48771893978118896,
-0.05233406275510788,
-0.24344415962696075,
0.09466802328824997,
-0.03227802366018295,
-0.10147643089294434,
-0.45515668392181396,
0.29777729511260986,
0.6619095206260681,
0.45609474182128906,
-0.1459063887596... | |
you would have full freedom there. As Deresh says, Zend is modularized so you can pick and choose the parts you want.
Personally I use Zend together with DB\_DataObjects from PEAR as by ORM. It can auto-generate your skeleton code. It is a very simple solution for handling simple queries but I can always write custom ... | [
0.40234994888305664,
0.2739521265029907,
-0.048452604562044144,
0.20032528042793274,
-0.13096515834331512,
-0.10986179113388062,
0.04472443461418152,
-0.37841877341270447,
-0.03258400037884712,
-0.31330081820487976,
0.10314695537090302,
0.4982979893684387,
-0.03420769050717354,
0.120567999... | |
is supported by Django or Zend. | [
-0.04274699091911316,
0.14256149530410767,
0.11780530214309692,
0.02281763404607773,
0.16592206060886383,
-0.1947484165430069,
0.004989195615053177,
0.37128227949142456,
0.02193651907145977,
-0.4740654528141022,
-0.32969340682029724,
0.49691304564476013,
-0.1631866842508316,
-0.20656317472... | |
I want to display portion of image not to display the total image.At first display the full image but after a delay time display the a portion of this image. I can not understand how can i do this. Like we can display portion of text by fixing the dimension of Label.But in case of image how can i do that using sprite o... | [
0.33728644251823425,
-0.17212165892124176,
0.4998035430908203,
-0.07908380776643753,
-0.39787498116493225,
0.34788817167282104,
-0.04611561447381973,
-0.02965753711760044,
-0.334535151720047,
-0.7029808759689331,
0.2740463316440582,
0.6762784123420715,
-0.2736038863658905,
0.29334726929664... | |
to emulate the preprocessor if it were a `log_function_entry()` macro.
> The ones that I have encountered that were intuitive and easy to understand were always like little mini functions, so I always wondered why they weren't just functions.
Usually they should be, unless they need to operate on generic parameters.... | [
0.043569453060626984,
-0.03333660587668419,
0.5394542217254639,
0.06883906573057175,
0.2562549114227295,
0.12407010793685913,
-0.015403084456920624,
0.07814452797174454,
-0.2552563548088074,
-0.5597723126411438,
0.06978170573711395,
0.724283754825592,
-0.6915231347084045,
0.082635201513767... | |
also allow you to call variadic functions such as `printf`
```
#define log_message(guard,format,...) \
if (guard) printf("%s:%d: " format "\n", __FILE__, __LINE__,__VA_ARGS_);
log_message( foo == 7, "x %d", x)
```
In which the format works like `printf`. If the guard is true, it outputs the message along with th... | [
0.027925590053200722,
-0.24305464327335358,
0.4036218225955963,
-0.1452021598815918,
-0.29072925448417664,
0.015179844573140144,
0.30723991990089417,
-0.4740612804889679,
-0.045153114944696426,
-0.6406787633895874,
-0.14714263379573822,
0.9634742140769958,
-0.2624371647834778,
-0.067080512... | |
```
for (int z = 0; z < alParmValues.Count; z++)
{
//string[] def;
string[] asd = alParmValues[z].ToString().Split(',');//this is of type string.collections and u cant cast it to a arraylist or array
//if (HUTT.clsParameterValues.bCustomObj == false)
string[] def = alMethSign[z].ToString().Substring(alMet... | [
0.14873006939888,
0.0823906734585762,
0.3923718333244324,
-0.1875506043434143,
0.20166559517383575,
-0.052509576082229614,
0.5652599930763245,
-0.6457937955856323,
-0.15351414680480957,
-0.3195507824420929,
-0.24961543083190918,
0.6575918197631836,
-0.6240102052688599,
0.3717658817768097,
... | |
work with it after your loop processing is done:
```
string[] arr = ...
for (int z = 0; z < alParmValues.Count; z++)
{
// work with arr...
}
var item = arr[3]; // Accessed outside of loop.
```
However, there seem to be a few things wrong with your code. I'd recommend thinking a little bit more about the loop bod... | [
0.26470938324928284,
-0.1464267522096634,
0.33168837428092957,
-0.30923253297805786,
-0.012577907182276249,
-0.19175267219543457,
0.5783734321594238,
-0.44280722737312317,
-0.36842167377471924,
-0.389295369386673,
-0.15900452435016632,
0.48198333382606506,
-0.35614511370658875,
0.040269974... | |
so this assignment serves no purpose and only keeps its last assigned
// value.
}
```
This assignment is pointless; every time you go through the loop, you just overwrite the previous value of `asd`, and you never use it later in the loop. | [
0.5225261449813843,
0.4796445369720459,
0.03568825498223305,
-0.039923641830682755,
0.05286809056997299,
-0.5297539234161377,
0.3232038617134094,
0.10941044986248016,
0.04409739747643471,
-0.4337337017059326,
-0.13162927329540253,
0.42524874210357666,
-0.43687206506729126,
0.41416811943054... | |
What's the simplest way to concatenate two [WAV](http://en.wikipedia.org/wiki/WAV) files in Java 1.6? (Equal frequency and all, nothing fancy.)
(This is probably sooo simple, but my [Google-fu](http://en.wiktionary.org/wiki/Google-fu) seems weak on this subject today.)
Here is the barebones code:
```
import java.io.F... | [
0.47393906116485596,
0.032854653894901276,
0.0799308493733406,
-0.2519303858280182,
-0.12654244899749756,
0.09363149106502533,
0.49443289637565613,
-0.6355441808700562,
0.0457775853574276,
-0.5134301781654358,
-0.07873526215553284,
0.5959774851799011,
-0.5343506336212158,
0.164133727550506... | |
AudioInputStream clip2 = AudioSystem.getAudioInputStream(new File(wavFile2));
AudioInputStream appendedFiles =
new AudioInputStream(
new SequenceInputStream(clip1, clip2), | [
0.41276049613952637,
-0.18398770689964294,
0.5815209150314331,
0.07378114014863968,
0.17877495288848877,
-0.03677402064204216,
-0.06289178133010864,
-0.4518532454967499,
-0.07095362991094589,
-0.5348572134971619,
-0.21678070724010468,
0.8156498670578003,
-0.4896807074546814,
0.062543407082... | |
clip1.getFormat(),
clip1.getFrameLength() + clip2.getFrameLength());
AudioSystem.write(appendedFiles, | [
0.2727617919445038,
0.18356743454933167,
0.5934333801269531,
0.09452933073043823,
0.2813257575035095,
0.03679138794541359,
0.031324952840805054,
-0.24379661679267883,
-0.013785415329039097,
-0.5585649609565735,
-0.26608240604400635,
0.8501900434494019,
-0.4011431038379669,
-0.1306180506944... | |
AudioFileFormat.Type.WAVE,
new File("D:\\wavAppended.wav"));
} catch (Exception e) {
e.printStackTrace();
}
}
}
``` | [
0.3313317596912384,
-0.09763806313276291,
0.5309948921203613,
-0.036537930369377136,
0.25459668040275574,
-0.4131629467010498,
0.25119078159332275,
-0.42688706517219543,
-0.016036204993724823,
-0.47077685594558716,
-0.5321184396743774,
0.9119926691055298,
-0.41646069288253784,
0.4115775525... | |
Well i have a application that is black and white and i need a function to lower the brightness how can i do this? all the white comes from a SolidColorBrush that is saved in a ResourceDictionary(Application.xaml), my current solution is to put a empty window that is back with 80% opacity over it but this does not allo... | [
0.41768643260002136,
0.09308373183012009,
0.5230105519294739,
-0.28233978152275085,
0.029877062886953354,
0.02351129986345768,
0.37194934487342834,
-0.435647189617157,
0.027212100103497505,
-0.9073163866996765,
0.40217798948287964,
0.6700281500816345,
-0.3568952679634094,
0.25495645403862,... | |
var color = brush.Color;
color.R -= 10;
color.G -= 10;
color.B -= 10;
brush.Color = color;
}
```
**Edit after your comment on the `Brush` being frozen:**
If you're using one of the built-in brushes (via the `Brushes` class) then it will be frozen. Instead of using one of them, declare your own `Brush... | [
0.18589453399181366,
-0.15751218795776367,
0.4299998879432678,
-0.07655947655439377,
0.07661841809749603,
0.19248463213443756,
0.3478906452655792,
-0.74869304895401,
-0.2508082985877991,
-0.38064858317375183,
-0.08649011701345444,
0.3582821488380432,
-0.3714810609817505,
0.1162200868129730... | |
Color="#000000"/>
```
There are two ways around this that I can see:
1. As Robert suggested, put the resource at a lower level in the resource tree. For example, in a `Window`'s `Resources` collection. This makes it harder to share though.
2. Put the resource in a wrapper that is not freezable.
As an example of #2 ... | [
0.15879620611667633,
0.07946781069040298,
0.6147717237472534,
-0.07435376197099686,
-0.06544867157936096,
0.11302250623703003,
0.2765762209892273,
-0.6349475383758545,
-0.14924852550029755,
-0.8931095004081726,
0.04184718057513237,
0.21514788269996643,
-0.4674554169178009,
-0.0083199590444... | |
Source={StaticResource ForegroundBrushContainer}}">Here is some text in the foreground color.</Label>
<Button x:Name="_button">Dim</Button>
</StackPanel>
```
*Window1.xaml.cs*:
```
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
_button.Click += _button_C... | [
0.054941799491643906,
-0.41546526551246643,
0.7519716620445251,
-0.1825064867734909,
-0.0002237494772998616,
0.15951739251613617,
0.20681969821453094,
-0.6711196303367615,
0.07875803858041763,
-0.7484526634216309,
0.014650830067694187,
0.5910889506340027,
-0.27060243487358093,
0.1097437366... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.