text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
#endregion
}
public class Program
{
static void Main(string[] args)
{
Address address1 = new Address("seattle", "washington", "Awesome St");
Address address2 = new Address("seattle", "washington", "Awesome St");
Person person1 = new Person("John", "Doe",... | [
0.3179073631763458,
-0.2794782221317291,
0.3946804702281952,
-0.22866976261138916,
0.1357986479997635,
0.0619049035012722,
0.4581635892391205,
0.3961619436740875,
0.20231887698173523,
-0.5670416951179504,
-0.5713866949081421,
0.2966022491455078,
-0.5664096474647522,
0.35149991512298584,
... | |
address1.Resident = person1;
address2.Resident = person1;
if (address1.Equals(address2)) // <-- No stack overflow!
{
Console.WriteLine("The two addresses are equal");
}
Person person2 = | [
-0.5921378135681152,
-0.21267086267471313,
0.5281637907028198,
-0.11696474999189377,
0.283225953578949,
0.4797009229660034,
0.33442506194114685,
-0.26868709921836853,
0.0815129429101944,
-0.7830609679222107,
-0.07850546389818192,
0.23723147809505463,
-0.0033593110274523497,
0.0658134073019... | |
new Person("John", "Doe", address2);
address2.Resident = person2;
if (address1.Equals(address2)) // <-- No a stack overflow!
{
Console.WriteLine("The two addresses are equal");
}
Console.Read(); | [
-0.5051935911178589,
-0.13485662639141083,
0.502213716506958,
-0.21143080294132233,
0.512421190738678,
0.30208325386047363,
0.22629313170909882,
-0.16390086710453033,
-0.10560771822929382,
-0.8153603076934814,
-0.4105830490589142,
0.2918136417865753,
0.005648690741509199,
0.362759202718734... | |
}
}
}
```
---
Output
------
> The two addresses are equal.
>
>
> The two addresses are equal. | [
-0.1929509937763214,
0.3168945908546448,
0.1951552778482437,
0.034267909824848175,
0.10673976689577103,
0.11174590140581131,
-0.022556180134415627,
0.08919161558151245,
0.35226139426231384,
-0.8232709169387817,
0.11209845542907715,
0.5189884901046753,
-0.2700813412666321,
0.150559067726135... | |
### Problem
I'm writing a Twitter client for the command line (in C). I'm currently working on doing TAB-completion for Twitter screen names, like so:
> tweet "@s<TAB>
>
> @sourcebits @spolsky
However, I can't get it to work mid-string, e.g.:
> tweet "Foo bar @s<TAB>
since Bash treats the string as one word. ... | [
-0.003996395971626043,
0.29750046133995056,
0.651432991027832,
-0.37467753887176514,
-0.3586450517177582,
0.31710126996040344,
0.4640112519264221,
0.14764370024204254,
-0.3293919265270233,
-0.5627942681312561,
0.052048031240701675,
0.5376882553100586,
-0.4964275360107422,
0.008899605832993... | |
(the variable `$last_word` below). However, I need to append `$prefix` to the beginning of the string that the TAB-completion produces, as it replaces the whole input string (remember: it's treated as one word). That's where I'm stuck.
### Question
How can this be done?
### Code etc.
```
__cltwitter_complete () {
... | [
-0.4087967276573181,
0.16904480755329132,
0.9238214492797852,
-0.3381689488887787,
0.26778095960617065,
-0.049042586237192154,
0.2701699137687683,
-0.03442246839404106,
-0.21220551431179047,
-0.6609840393066406,
-0.5269970893859863,
0.5123489499092102,
-0.07280746102333069,
0.5359345078468... | |
a quotation
last_word=${last_word:2}
elif [[ "$last_word" == @* ]]; then # if user put '@' in front
last_word=${last_word:1}
fi
COMPREPLY=( $( compgen -W "`cat $cache`" -P @ -- $last_word ) )
}
complete -F __cltwitter_complete tweet
```
Relevant section from the Bash man page:
> **COMP\_WORDS**
>
>... | [
0.07750677317380905,
-0.05068320408463478,
0.28716108202934265,
-0.09610439091920853,
-0.23132038116455078,
0.29016366600990295,
0.17247307300567627,
-0.5651388764381409,
-0.1372189223766327,
-0.31299296021461487,
-0.5724048614501953,
0.6215861439704895,
-0.078545942902565,
-0.123645059764... | |
functions invoked by the programmable completion facilities.
I think this is a common case of pattern abuse.
If you check your two "strategies", they do EXACTLY the same thing. The only thing that changes is the ProvincialTaxRate.
I'd keep things DRY and don't overuse this pattern (or any other), here you gain a lit... | [
0.27153220772743225,
-0.27205759286880493,
0.2942050099372864,
0.4198344349861145,
0.04698033630847931,
-0.12748710811138153,
0.42141464352607727,
-0.03477912023663521,
-0.40557020902633667,
-0.6253383159637451,
0.145545095205307,
0.6892096996307373,
-0.07619408518075943,
-0.20012159645557... | |
doing it harms the code readability and maintainability.
My opinion: keep it simple
Regards
**EDIT (In response to the author comment on my answer)**
I did not try to make fun of you, or anyone. This is a common mistake, I did it MANY times, and learned it the hard way, not only with patterns but also with fancy fr... | [
0.7642919421195984,
0.05506177991628647,
-0.030017562210559845,
0.18499617278575897,
-0.24102038145065308,
-0.15158668160438538,
0.5678578019142151,
0.05895809456706047,
-0.2200089693069458,
-0.1818990707397461,
0.07873205840587616,
0.11637242883443832,
-0.32243621349334717,
-0.51710009574... | |
Make a superclass for both strategies, this superclass would be abstract and should contain the shared rate value of their child strategies (FederalTaxRate)
* Inherit and implement the abstract method "Calculate" in each subclass (here you'll see that both methods are the same, but let's continue)
* Try to make each co... | [
0.3031977117061615,
-0.35266345739364624,
0.0229187048971653,
0.28204092383384705,
0.14642758667469025,
0.23659811913967133,
0.407958447933197,
-0.2649412155151367,
-0.3208153247833252,
-0.8738166689872742,
0.3363434672355652,
0.23646582663059235,
-0.41525962948799133,
-0.01123108249157667... | |
(that can very well be protected classes now)
**Edit II:**
Here's a pastie with some (pseudo) code to make the solution a bit more clear
<http://pastie.org/441068>
Hope it helps
Regards | [
0.06307687610387802,
-0.2559551000595093,
0.10970216244459152,
0.3574381470680237,
0.18191532790660858,
-0.03662269562482834,
0.37216174602508545,
0.19435013830661774,
-0.20682057738304138,
-0.5826866626739502,
-0.10237240791320801,
0.33764466643333435,
-0.013380613178014755,
0.14742276072... | |
So I have this big file of fix length lines. I want to do a find and replace on a character line position.
Example:
```
xxxxxxx 010109 xxxxxx xxxxx
xxxxxxx 010309 xxxxxx xxxxx
xxxxxxx 021506 xxxxxx xxxxx
xxxxxxx 041187 xxxxxx xxxxx
```
So in this case I would want to find any value starting on posit... | [
-0.07301340252161026,
0.09268278628587723,
0.4019320607185364,
-0.06794491410255432,
-0.22724522650241852,
0.4093395471572876,
0.20240579545497894,
-0.1906479299068451,
-0.24839049577713013,
-0.5250868201255798,
0.042764320969581604,
0.1576949954032898,
-0.05042966827750206,
0.252582043409... | |
of chars**
This works, tested on your data:
Find:
```
^(............)......
```
Replace:
```
\1010107
``` | [
-0.18480832874774933,
0.37834274768829346,
0.10437405854463577,
-0.2287951558828354,
0.11573808640241623,
0.4019853174686432,
0.25268885493278503,
0.07829314470291138,
-0.13362130522727966,
-0.37823745608329773,
-0.018147559836506844,
0.5749396681785583,
-0.2887203097343445,
0.129810780286... | |
In Java, when should static non final variables be used?
For example
```
private static int MY_VAR = 0;
```
Obviously we are not talking about constants here.
```
public static final int MY_CONSTANT = 1;
```
In my experience I have often justified them when using a singleton, but then I end up needing to have mo... | [
-0.028949253261089325,
-0.0738421082496643,
-0.14803743362426758,
-0.16256728768348694,
-0.29436996579170227,
-0.2502254247665405,
0.1596655696630478,
0.006432386580854654,
-0.6275695562362671,
-0.44019797444343567,
0.009635508060455322,
0.5284962058067322,
-0.37880584597587585,
-0.0149720... | |
`AtomicLong` etc anyway, at which point it can be final. Alternatively if you're collecting more than one stat, you could end up with a `Statistics` class and a final reference to an instance of it.
It's certainly pretty rare to have (justifiably) non-final static variables. | [
0.1874731034040451,
-0.25799763202667236,
-0.11789581179618835,
0.4069393575191498,
-0.35324224829673767,
-0.17353524267673492,
0.12764385342597961,
0.2864478528499603,
-0.4953404664993286,
-0.16420160233974457,
-0.1295456886291504,
0.25204071402549744,
-0.07658179849386215,
0.334935337305... | |
Is there a well-established approach for documenting Java "properties" file contents, including:
* specifying the data type/contents expected for a given key
* specifying whether a key is required for the application to function
* providing a description of the key's meaning
Currently, I maintain (by hand) a .propert... | [
0.24321989715099335,
-0.004786302335560322,
0.11802453547716141,
0.012498400174081326,
0.021411577239632607,
-0.3493621349334717,
0.10083025693893433,
-0.2953701913356781,
-0.434772789478302,
-0.43957436084747314,
-0.12156340479850769,
0.50209641456604,
-0.10428523272275925,
-0.25075775384... | |
way of doing it. What I would probably do is:
* wrap or extend the [java.util.Properties](http://java.sun.com/javase/6/docs/api/java/util/Properties.html) class
* override (of extending) or provide a method (if wrapping) the store method (or storeToXML, etc) that writes out a comment for each line.
* have the method t... | [
0.42847347259521484,
-0.14415207505226135,
0.20662575960159302,
0.12183692306280136,
-0.08521605283021927,
-0.11503481864929199,
0.008862955495715141,
-0.227156400680542,
-0.37186071276664734,
-0.7545790076255798,
0.035332005470991135,
0.36868804693222046,
-0.08035550266504288,
0.111649788... | |
the comments to read in. It would potentially give you the programmatic access that you need, but it is a roll-your-own sort of thing.
Or it might just be too much work for too little to gain (which is why there isn't something obvious out there).
If you can specify the sort of comments you want to see I could take a... | [
0.398844450712204,
0.31996437907218933,
0.1119871735572815,
-0.13692939281463623,
-0.4811613857746124,
-0.18315118551254272,
-0.08394281566143036,
0.32239413261413574,
-0.17639228701591492,
-0.8793318867683411,
0.020003581419587135,
0.4344102740287781,
-0.5410465598106384,
-0.1722539961338... | |
java.util.Map.Entry;
import java.util.Properties;
public class PropertiesVerifier
{
private final Map<String, PropertyInfo> optionalInfo;
private final Map<String, PropertyInfo> requiredInfo;
{
optionalInfo = new HashMap<String, PropertyInfo>();
requiredInfo = new HashMap<String, PropertyI... | [
-0.24024264514446259,
-0.40262043476104736,
0.4585126042366028,
-0.08159711211919785,
0.38109415769577026,
-0.0171387679874897,
-0.040118180215358734,
-0.5347106456756592,
0.019243095070123672,
-0.7738524079322815,
-0.6382544636726379,
0.8540655970573425,
-0.2739660441875458,
-0.1106432601... | |
if(info.isRequired())
{
infoMap = requiredInfo;
}
else
{
infoMap = optionalInfo; | [
0.24730683863162994,
-0.8224173188209534,
0.22230280935764313,
0.12354956567287445,
0.7394294142723083,
-0.2776080071926117,
-0.05947234109044075,
-0.31087982654571533,
0.08314868807792664,
-0.4774680435657501,
-0.5747183561325073,
1.1102558374404907,
-0.3190016448497772,
-0.53436261415481... | |
}
infoMap.put(info.getName(), info);
}
}
public void verifyProperties(final Properties properties)
{
for(final Entry<Object, Object> property : properties.entrySet())
{
final String key;
final String value; | [
0.1480245590209961,
-0.1705687940120697,
0.5574169158935547,
0.09426647424697876,
0.5532388687133789,
-0.020040882751345634,
0.11199849843978882,
-0.44952842593193054,
0.3623448312282562,
-0.38679173588752747,
-0.475904256105423,
0.8838128447532654,
-0.0585787408053875,
0.2594453990459442,... | |
key = (String)property.getKey();
value = (String)property.getValue();
if(!(isValid(key, value)))
{
throw new IllegalArgumentException(value + " is not valid for: " + key);
}
} | [
0.14566339552402496,
-0.38850006461143494,
0.43690189719200134,
-0.1475106030702591,
0.5788378715515137,
0.04125888645648956,
0.5389388203620911,
-0.45359528064727783,
-0.4794049859046936,
0.03409385681152344,
-0.36464813351631165,
0.6645253896713257,
-0.3240490257740021,
0.203785523772239... | |
}
public boolean isRequired(final String key)
{
return (requiredInfo.get(key) != null);
}
public boolean isOptional(final String key)
{
return (optionalInfo.get(key) != null);
}
public boolean isKnown(final String key)
{
return (isRequired(key) || isOptional(ke... | [
-0.14852465689182281,
-0.3486657440662384,
0.28301510214805603,
-0.12333604693412781,
0.3014102280139923,
-0.18757352232933044,
0.34218543767929077,
-0.15009526908397675,
0.09489414095878601,
-0.2355755716562271,
-0.7007904648780823,
0.8698631525039673,
-0.257277250289917,
0.04027197137475... | |
final PropertyInfo info;
info = getPropertyInfoFor(key);
return (info.getType());
}
public boolean isValid(final String key,
final String value)
{
final PropertyInfo info;
info = getPropertyInfoFor(key);
return (info.verify(value)); | [
0.1016797199845314,
-0.23195748031139374,
0.9697214961051941,
0.02476884052157402,
0.47691845893859863,
-0.16597937047481537,
0.023948952555656433,
-0.414819598197937,
0.32651785016059875,
-0.4277692139148712,
-0.5187109708786011,
0.9959443211555481,
-0.036286305636167526,
0.36242613196372... | |
}
private PropertyInfo getPropertyInfoFor(final String key)
{
PropertyInfo info;
info = requiredInfo.get(key);
if(info == null)
{
info = optionalInfo.get(key);
if(info == null)
{ | [
0.3109489977359772,
-0.5275118947029114,
0.5927526354789734,
0.14937090873718262,
0.5761869549751282,
-0.35835450887680054,
0.03517713397741318,
-0.42887672781944275,
0.22058328986167908,
-0.2568880021572113,
-0.4943418800830841,
1.2325531244277954,
-0.084540456533432,
0.029535682871937752... | |
// should be a better exception maybe... depends on how you
// want to deal with it
throw new IllegalArgumentException(key + " | [
0.46933799982070923,
-0.03672267124056816,
0.4096616506576538,
0.033822447061538696,
0.32553616166114807,
-0.18225069344043732,
0.12904292345046997,
-0.14825457334518433,
-0.33957067131996155,
-0.10074207931756973,
0.01898268051445484,
0.5074416995048523,
-0.05175238847732544,
-0.106010310... | |
is not a valid property name");
}
}
return (info);
}
protected final static class PropertyInfo
{
private final String name;
private final boolean required;
private final Class clazz; | [
0.20297189056873322,
-0.3770913779735565,
0.6302860379219055,
-0.08252326399087906,
0.4373220205307007,
-0.3853314518928528,
0.004980004858225584,
-0.12509626150131226,
0.07961273193359375,
-0.1334669142961502,
-0.7430843710899353,
0.7830824255943298,
-0.1700223684310913,
0.419741272926330... | |
private final Verifier verifier;
protected PropertyInfo(final String nm,
final boolean mandatory,
final Class c)
{ | [
-0.05117694288492203,
-0.14638209342956543,
0.14245031774044037,
-0.019870316609740257,
0.29225629568099976,
-0.21456360816955566,
0.30310186743736267,
-0.3528420031070709,
0.1539214849472046,
-0.014878615736961365,
-0.4800431430339813,
0.9075196385383606,
-0.05148598179221153,
0.278525650... | |
this(nm, mandatory, c, getDefaultVerifier(c));
}
protected PropertyInfo(final String nm,
final boolean mandatory,
final Class | [
0.007306971587240696,
-0.26019591093063354,
0.24389100074768066,
-0.09173421561717987,
0.37657204270362854,
-0.5043389201164246,
0.16823896765708923,
-0.44022759795188904,
-0.0026194213423877954,
-0.057842403650283813,
-0.584590494632721,
0.8054505586624146,
-0.17398494482040405,
0.2099337... | |
c,
final Verifier v)
{
// check for null
name = nm;
required = mandatory; | [
-0.1895478069782257,
-0.22826562821865082,
0.4461418688297272,
0.00018240843201056123,
0.2564377188682556,
-0.13716530799865723,
0.4597480297088623,
-0.3853019177913666,
-0.05683170258998871,
-0.0554727278649807,
-0.7407481074333191,
0.5556029081344604,
-0.347577840089798,
0.10733964294195... | |
clazz = c;
verifier = v;
}
@Override
public int hashCode()
{
return (getName().hashCode());
}
@Override
public boolean equals(final Object o) | [
-0.1782870888710022,
-0.010599485598504543,
0.7491288781166077,
-0.14772172272205353,
0.47815024852752686,
-0.05565686523914337,
0.11844097822904587,
-0.2246185690164566,
-0.14830389618873596,
-0.1698586493730545,
-0.2857465445995331,
0.6732679009437561,
-0.27495843172073364,
0.27535769343... | |
{
final boolean retVal;
if(o instanceof PropertyInfo)
{
final PropertyInfo other;
other = (PropertyInfo)o;
retVal = | [
-0.08446840196847916,
0.07972856611013412,
0.5897384881973267,
-0.20348228514194489,
0.06816728413105011,
-0.09788984060287476,
0.31439077854156494,
-0.6035085320472717,
-0.17669959366321564,
-0.022761797532439232,
-0.5350284576416016,
0.5953244566917419,
0.010891311801970005,
0.2764151990... | |
getName().equals(other.getName());
}
else
{
retVal = false;
}
return (retVal);
}
public boolean verify(final String value) | [
0.15573108196258545,
-0.031216386705636978,
0.5839458703994751,
0.11079090088605881,
0.15987451374530792,
-0.1991218477487564,
0.515616238117218,
-0.5155506134033203,
0.08163855224847794,
-0.11077232658863068,
-0.2304970771074295,
0.7328051924705505,
-0.102061428129673,
-0.0403920486569404... | |
{
return (verifier.verify(value));
}
public String getName()
{
return (name);
}
public boolean isRequired()
{
return (required); | [
0.24969083070755005,
-0.2806940972805023,
0.21545735001564026,
-0.0022902812343090773,
0.3169732093811035,
-0.30954229831695557,
0.309859961271286,
-0.37073177099227905,
0.19925819337368011,
-0.05638876557350159,
-0.4718265235424042,
0.8480963706970215,
-0.13715027272701263,
0.230383381247... | |
}
public Class getType()
{
return (clazz);
}
}
private static Verifier getDefaultVerifier(final Class clazz)
{
final Verifier verifier;
if(clazz.equals(Boolean.class))
{ | [
-0.2774205505847931,
-0.35586848855018616,
0.6181367039680481,
-0.11708342283964157,
0.09185375273227692,
-0.03631926700472832,
0.32161760330200195,
-0.26960912346839905,
0.044753547757864,
-0.3222631812095642,
-0.4489530026912689,
0.701697051525116,
-0.4168824553489685,
0.1006769463419914... | |
// shoudl use a singleton to save space...
verifier = new BooleanVerifier();
}
else
{
throw new IllegalArgumentException("Unknown property type: " + | [
0.1210213303565979,
-0.17865696549415588,
0.023234674707055092,
-0.09594642370939255,
0.3926793336868286,
-0.08357492089271545,
0.47515276074409485,
-0.28003907203674316,
-0.27374693751335144,
-0.16798226535320282,
-0.19911468029022217,
0.5730463266372681,
-0.33673906326293945,
0.217314541... | |
clazz.getCanonicalName());
}
return (verifier);
}
public static interface Verifier
{
boolean verify(final String value);
}
public static class BooleanVerifier
implements Verifier
{
public boolean verify(final String value)
{ | [
-0.0020414225291460752,
-0.12815912067890167,
0.5247502326965332,
0.17678971588611603,
0.2253265529870987,
-0.18916240334510803,
0.17650295794010162,
-0.2467374950647354,
0.10465879738330841,
-0.32043513655662537,
-0.31121543049812317,
0.8160392045974731,
-0.26211443543434143,
0.1898583024... | |
final boolean retVal;
if(value.equalsIgnoreCase("true") ||
value.equalsIgnoreCase("false"))
{
retVal = true;
}
else | [
-0.26456335186958313,
-0.19845573604106903,
0.9879932403564453,
-0.17226773500442505,
-0.08530878275632858,
0.2877825200557709,
0.6401515603065491,
-0.44159674644470215,
0.05272344499826431,
-0.13413594663143158,
-0.4763058125972748,
0.6396427750587463,
-0.2155567854642868,
0.0295789558440... | |
{
retVal = false;
}
return (retVal);
}
}
}
```
And a simple test for it:
```
import java.util.Properties;
public class Main
{
public static void main(String[] args)
{
final Properties | [
0.13973692059516907,
0.015964623540639877,
0.4257677495479584,
-0.22299513220787048,
-0.09289736300706863,
-0.05994024872779846,
0.6227288246154785,
-0.5194953083992004,
-0.20788908004760742,
-0.3584100902080536,
-0.5654877424240112,
0.6206846237182617,
-0.30966809391975403,
0.400325328111... | |
properties;
final PropertiesVerifier verifier;
properties = new Properties();
properties.put("property.one", "true");
properties.put("property.two", "false");
// properties.put("property.three", "5");
verifier = new PropertiesVerifier(
new PropertiesVerifi... | [
0.14036932587623596,
-0.16257987916469574,
0.39251333475112915,
-0.23317041993141174,
0.084803506731987,
0.13713032007217407,
0.21716387569904327,
-0.740127682685852,
-0.17765676975250244,
-0.9328385591506958,
-0.54707270860672,
0.7075762152671814,
0.17944183945655823,
0.6363218426704407,
... | |
new PropertiesVerifier.PropertyInfo("property.one",
true, | [
0.3410319685935974,
-0.3152446746826172,
0.5335280895233154,
0.10829107463359833,
0.09552093595266342,
-0.27232787013053894,
-0.07905451208353043,
-0.36382970213890076,
-0.08903989940881729,
-0.9643303751945496,
-0.14490246772766113,
0.6518206596374512,
0.06503453850746155,
0.3140267729759... | |
Boolean.class),
new PropertiesVerifier.PropertyInfo("property.two",
false, | [
0.02844601683318615,
-0.08981773257255554,
0.002327105263248086,
-0.022364117205142975,
-0.06122133880853653,
-0.12189421057701111,
0.18934111297130585,
-0.2981414198875427,
-0.17825189232826233,
-0.46106696128845215,
-0.38374921679496765,
0.5742037892341614,
-0.23269490897655487,
0.267729... | |
Boolean.class),
// new PropertiesVerifier.PropertyInfo("property.three",
// | [
0.0860605239868164,
-0.06276050209999084,
-0.010759996250271797,
-0.16510018706321716,
-0.048140451312065125,
-0.14460347592830658,
0.1311379075050354,
-0.4111344814300537,
-0.22208310663700104,
-0.5811668634414673,
-0.1608227789402008,
0.5196294188499451,
-0.10695555061101913,
0.329679608... | |
true,
// Boolean.class),
});
System.out.println(verifier.isKnown("property.one"));
System.out.println(verifier.isKnown("property.two"));
System.out.println(verifier.isKnown("property.three")); | [
-0.18150699138641357,
-0.22821944952011108,
0.12906600534915924,
-0.5001994371414185,
-0.05552715063095093,
-0.13058890402317047,
0.45495399832725525,
-0.4211888015270233,
0.029745129868388176,
-0.4175138473510742,
-0.4882911741733551,
0.8525726199150085,
-0.31041672825813293,
0.2461994588... | |
System.out.println(verifier.isRequired("property.one"));
System.out.println(verifier.isRequired("property.two"));
System.out.println(verifier.isRequired("property.three"));
System.out.println(verifier.isOptional("property.one"));
System.out.println(verifier.isOptional("property.two"));
... | [
-0.22238528728485107,
0.10841694474220276,
0.2829393148422241,
-0.21259547770023346,
0.15594065189361572,
0.14031970500946045,
0.40735992789268494,
-0.3399352431297302,
-0.274068146944046,
-0.6798235774040222,
-0.7128875851631165,
0.644999623298645,
-0.10697250813245773,
0.4580118954181671... | |
verifier.verifyProperties(properties);
}
}
``` | [
0.2535279393196106,
0.23277167975902557,
0.2993585169315338,
-0.052749551832675934,
0.289821982383728,
-0.3965330123901367,
0.2368798404932022,
0.028893670067191124,
0.16591821610927582,
-0.4788922369480133,
-0.166452094912529,
0.8411911725997925,
-0.21921075880527496,
0.20044687390327454,... | |
**EDIT!!** I should add that this site runs perfectly locally. It's only when deployed that there's this issue
**ORIGINAL POST:**
I have a site I just put up <http://splattonet0.web704.discountasp.net/>
Which loads the Index view of the Home controller just fine. However, when one clicks the links to the left, the ... | [
0.34404540061950684,
0.09943308681249619,
0.6048198342323303,
-0.24614594876766205,
-0.10725583881139755,
-0.08633993566036224,
0.39828094840049744,
0.17160800099372864,
-0.3943004608154297,
-1.0273910760879517,
0.1475028693675995,
0.5611319541931152,
-0.05039503052830696,
0.25510129332542... | |
the link section is as follows:
```
<div id="navContainer">
<ul id="mainNav">
<li><a href="/Home/Index" title="Home">Home</a></li>
<li><a href="/Home/AboutMe" title="About Us">About Me</a></li>
<li><a href="/Skills/Index" title="Skills">Skills</a></li>
... | [
-0.010649566538631916,
0.15388672053813934,
0.6581893563270569,
-0.1820649951696396,
0.1849144697189331,
0.12069082260131836,
0.1359572559595108,
-0.10208173096179962,
-0.12187925726175308,
-0.6797935962677002,
-0.46657514572143555,
0.5493820309638977,
0.208110973238945,
0.2406976372003555... | |
<li><a href="/Home/Experience" title="Experience">Experience</a></li>
<li><a href="/Home/SitesIveDesigned" title="Websites I've developed">My Websites</a></li>
<li><a href="/Home/References" title="References">References</a></li>
<li><a href="/Home/Projects" title="Projec... | [
0.3299938142299652,
0.6541611552238464,
0.6924247741699219,
0.035425249487161636,
0.2951507568359375,
0.1480286866426468,
0.0009133528219535947,
-0.36977627873420715,
-0.46664026379585266,
-0.49022001028060913,
-0.21745739877223969,
0.29630208015441895,
0.24261465668678284,
-0.054131012409... | |
....etc
</ul>
</div>
```
I have the same problem with and without the preceeding foreslash in the href property. I've decided to keep it there since that is how my other sites (that work!) are styled.
Can anyone shed some light on this for me? Thanks!
**FURTHER EDIT:**
I have been asked to prov... | [
0.18523581326007843,
-0.08626338094472885,
0.8782980442047119,
-0.04414069280028343,
-0.1568901538848877,
-0.09119315445423126,
-0.12709705531597137,
-0.12439398467540741,
-0.26471561193466187,
-0.8453726768493652,
-0.13959629833698273,
0.4455772638320923,
-0.2013867199420929,
0.1724420636... | |
href="/News/Index">Archived News</a></li>
<li><a href="/Home/BoardOfDirectors">Board Of Directors</a></li>
<li><a href="/Media/Index">In The Media</a>
...
</ul>
```
Easy:
```
Func<string,bool> func = x => x.Length > 5;
Predicate<string> predicate = new Predicate<string>(func);
```
Basically you can create a new del... | [
-0.06766390800476074,
-0.0010498259216547012,
0.8141524195671082,
-0.03746207058429718,
-0.40931516885757446,
0.03543666750192642,
0.08510880917310715,
-0.8256133794784546,
-0.22161555290222168,
-0.4819357693195343,
-0.32669728994369507,
0.3978121876716614,
-0.3295475244522095,
0.373278409... | |
I'm working on a Windows batch file that will bcp three text files into SQL Server. If something goes wrong in production, I want to be able to override the file names. So I'm thinking of doing something like this.
```
bcp.exe MyDB..MyTable1 in %1 -SMyServer -T -c -m0
bcp.exe MyDB..MyTable2 in %2 -SMyServer -T -c -m0
... | [
0.33990389108657837,
0.3861851394176483,
0.4180322587490082,
-0.2765424847602844,
0.12202319502830505,
0.126131072640419,
0.19559532403945923,
-0.05302813649177551,
-0.10186857730150223,
-0.7550433874130249,
0.09072817116975784,
0.5374557375907898,
-0.46031415462493896,
0.2687020003795624,... | |
or execute
```
myjob.bat "c:\myfile1" "c:\myfile2" "c:\myfile3"
```
and have it use those files. I haven't been able to figure out how to tell if %1, %2 and %3 exist and/or are null. I also don't know how to set those values conditionally. Is this possible? Any suggestions would be appreciated.
To test for the exist... | [
0.07119353860616684,
0.20811277627944946,
0.14315883815288544,
-0.2409529685974121,
-0.10892856121063232,
0.06872446835041046,
0.6449725031852722,
-0.2486225813627243,
-0.1333860605955124,
-0.43579861521720886,
-0.22858160734176636,
0.649058997631073,
-0.10554594546556473,
-0.0112080834805... | |
based on its contents. | [
0.15206150710582733,
0.29599013924598694,
0.10374725610017776,
0.2516018748283386,
0.2952324151992798,
-0.08733172714710236,
0.19016316533088684,
0.08683927357196808,
0.22000811994075775,
0.05651184916496277,
-0.024401115253567696,
-0.09214922785758972,
0.12153574079275131,
0.2228132933378... | |
How do you read and display data from .txt files?
```
BufferedReader in = new BufferedReader(new FileReader("<Filename>"));
```
Then, you can use in.readLine(); to read a single line at a time. To read until the end, write a while loop as such:
```
String line;
while((line = in.readLine()) != null)
{
System.out.... | [
-0.001551521592773497,
-0.3420402705669403,
0.6425514221191406,
-0.20432032644748688,
0.18664297461509705,
0.19263672828674316,
0.2182771861553192,
-0.16655997931957245,
-0.18394257128238678,
-0.6305421590805054,
-0.4155540466308594,
0.39007461071014404,
-0.2766309380531311,
0.203410550951... | |
In Java, it is very easy to code the following design:
```
public abstract class Pizza {
public static final Pizza.NULL = new Pizza() {
/* "null" implementations */
}
/* actual/abstract implmentations */
}
```
What is the preferred method to attain the same efficient scenario in Objective-C? I h... | [
0.0620366707444191,
-0.10617484897375107,
-0.20076468586921692,
-0.4889037311077118,
-0.20480132102966309,
-0.07658718526363373,
0.18610499799251556,
-0.2062898576259613,
0.043076541274785995,
-0.8062278628349304,
-0.10833276808261871,
0.6292120218276978,
-0.44982290267944336,
-0.136760264... | |
like to avoid writing a concrete NullPizza class that has a static method to obtain the singleton instance, as it seems more 'proper' for it to be some final property/field of the highest-level interface. (Pizza, in this case.)
**Edit:** While I understand how the NULL pattern specifically would be handled due to Obj-... | [
0.2654452621936798,
-0.19808010756969452,
-0.06938403099775314,
-0.032027747482061386,
-0.21742339432239532,
-0.08546323329210281,
0.19289468228816986,
0.4006597697734833,
-0.4623035192489624,
-0.6619374752044678,
-0.23982900381088257,
0.5348550081253052,
-0.3910110294818878,
0.21139395236... | |
in Cocoa is to have both immutable and mutable versions of a class (NSArray versus NSMutableArray). For your response example, it would make sense to have an immutable Response class that has the static YES and NO methods, and a MutableResponse subclass that exposes setters for those times where you do want objects to ... | [
-0.1559760719537735,
-0.26266443729400635,
-0.08382990956306458,
0.19267931580543518,
-0.22812579572200775,
-0.05330042168498039,
-0.06635988503694534,
-0.09516999125480652,
-0.48894110321998596,
-0.36067578196525574,
-0.25040706992149353,
0.5412462949752808,
-0.42993518710136414,
0.011414... | |
If `BaseFruit` has a constructor that accepts an `int weight`, can I instantiate a piece of fruit in a generic method like this?
```
public void AddFruit<T>()where T: BaseFruit{
BaseFruit fruit = new T(weight); /*new Apple(150);*/
fruit.Enlist(fruitManager);
}
```
An example is added behind comments. It seem... | [
-0.1805095672607422,
0.21079882979393005,
-0.04498201608657837,
-0.15743198990821838,
-0.09972254931926727,
0.6594297885894775,
0.09355627000331879,
-0.2791709005832672,
-0.26874807476997375,
-0.49335283041000366,
-0.11312778294086456,
0.4594215452671051,
-0.2387724369764328,
-0.3564357161... | |
solutions:
* Factory Pattern
* Reflection
* Activator
I tend to think reflection is the least clean one, but I can't decide between the other two.
Additionally a simpler example:
```
return (T)Activator.CreateInstance(typeof(T), new object[] { weight });
```
Note that using the new() constraint on T is only to mak... | [
0.48209431767463684,
-0.06797916442155838,
0.18970449268817902,
-0.08798156678676605,
-0.06593021005392075,
0.18529653549194336,
0.37142977118492126,
-0.3347572088241577,
-0.08700548112392426,
-0.6881644129753113,
-0.06020322069525719,
0.5006886720657349,
-0.6574103236198425,
0.04306441172... | |
I have a python script that runs continuously. It outputs 2 lines of info every 30 seconds. I'd like to be able to view this output on the web. In particular, I'd like the site to auto-update (add the new output at the top of the page/site every 30 seconds without having to refresh the page).
I understand I can do thi... | [
0.6361624002456665,
0.12750403583049774,
0.12899959087371826,
0.12089794874191284,
-0.19040776789188385,
-0.04708590358495712,
0.49052220582962036,
0.3959192931652069,
-0.22967858612537384,
-0.6996116638183594,
0.18878838419914246,
0.6732754111289978,
-0.17265701293945312,
-0.0441538058221... | |
for the basic question but I'm still clueless when it comes to web programming.
Thx!
This question appears to have two things in it.
1. Presentation on the web. This is easy to do in Python -- use Django or TurboGears or any Python-based web framework.
2. Refresh of the web page to show new data. This can be done two... | [
0.4348551034927368,
-0.01173658948391676,
0.41614291071891785,
0.1998947709798813,
-0.40516358613967896,
-0.06712502986192703,
0.26650309562683105,
-0.3185044229030609,
-0.08693654835224152,
-0.4586049020290375,
-0.01711305044591427,
0.7479224801063538,
-0.24481838941574097,
-0.27688485383... | |
I wrote a custom web part for SharePoint 2007 that loads an existing user control. One of the things the user control does is an asynchronous upload of a file via FTP. I'm using a third-party FTP library that has BeginUpload/EndUpload methods for async file transfer. I also have an update panel in the user control that... | [
-0.047821130603551865,
0.16679620742797852,
0.2500600516796112,
0.18101195991039276,
-0.08909539878368378,
0.012512843124568462,
0.02278878726065159,
0.10760680586099625,
-0.2907375991344452,
-0.7903030514717102,
0.24422575533390045,
0.5747036933898926,
-0.27010801434516907,
0.081491388380... | |
itself from a separate project. But when I access the web part that hosts the control and try an upload, the FTP library transfers about 64 KB and then the thread it's running on dies. The message I get in the VS output window is:
The thread 'Win32 Thread' (0xf34) has exited with code 0 (0x0).
I get several of those ... | [
0.20777153968811035,
-0.1200966164469719,
0.5927708148956299,
0.057908445596694946,
0.1488301306962967,
-0.1576245278120041,
0.2464396059513092,
-0.05135079845786095,
-0.248846173286438,
-0.6215674877166748,
0.004727812949568033,
0.13617956638336182,
-0.2637299597263336,
0.5559593439102173... | |
part to make this work? It seems to be something about SharePoint since the same code works fine if SP is out of the picture.
This question appears to have two things in it.
1. Presentation on the web. This is easy to do in Python -- use Django or TurboGears or any Python-based web framework.
2. Refresh of the web pag... | [
0.5288026928901672,
-0.2535429894924164,
0.3542279899120331,
0.23245617747306824,
-0.5397534966468811,
-0.14341400563716888,
0.2232656180858612,
-0.32875922322273254,
-0.17076392471790314,
-0.5801913142204285,
0.09609676897525787,
0.770134687423706,
-0.34626075625419617,
-0.232432350516319... | |
If you add a resource map to a namespace in your `routes.rb` in Rails 2.3, how do you make `link_to` (and `form_for`, etc) understand that it should get the namespaced controller instead of one in the root namespace?
For example...
With this in `routes.rb`:
```
map.namespace :admin do |admin|
admin.resources :opt_... | [
-0.20372524857521057,
-0.1295582503080368,
0.3193308115005493,
0.062255751341581345,
0.012058988213539124,
0.0013691390631720424,
-0.07471337169408798,
-0.2814442813396454,
-0.22018355131149292,
-0.9984392523765564,
0.06772015243768692,
0.2596130967140198,
-0.5502910614013672,
0.0836544856... | |
Using ASP.NET Dynamic Data with a LINQ to SQL DataContext from the Northwind Database...
When I add a DisplayColumn Attribute to one of my LINQ to SQL `entity` classes and reference a property from my custom code in the partial class, I lose the ability to sort by that column in the generated *GridViews*. I continue t... | [
-0.017636729404330254,
-0.27531442046165466,
0.47906503081321716,
0.08066119998693466,
-0.04083197936415672,
0.1240098848938942,
0.037292152643203735,
-0.07693617045879364,
-0.37486740946769714,
-0.851085364818573,
-0.14269156754016876,
0.32804757356643677,
-0.24486012756824493,
0.30821755... | |
LastName + ", " + FirstName; }
}
}
```
Aaron
EDIT: The `sortColumn` specifies the column that will be used to sort this entity when it is used as a foreign key (in a *DropDownList*), not when it is being sorted in the *GridView*.
This may be by Design...
The "sortColumn" specifies the column that will be used t... | [
-0.308230459690094,
-0.17936718463897705,
0.3645345866680145,
-0.18347901105880737,
0.1639968603849411,
-0.11108583211898804,
-0.01199065800756216,
-0.1924130767583847,
-0.29307177662849426,
-0.6206883788108826,
-0.501219630241394,
0.24830231070518494,
-0.3771046996116638,
0.00655106035992... | |
For my tests I am using 'Start > Run' dialog (not the cmd.exe).
This works fine, and I get 9 in log.txt
```
powershell -Command 4+5 > c:\log.txt
```
But this does not work:
```
powershell -EncodedCommand IAA1ACsANwAgAA== > c:\log.txt
```
So how can I redirect output in this case?
Experimental code:
```
functio... | [
0.3045112192630768,
0.15629027783870697,
0.21537593007087708,
-0.024313978850841522,
0.1666165143251419,
0.10127443820238113,
0.4584202170372009,
-0.36381882429122925,
0.06675683706998825,
-0.6396881341934204,
0.0584300197660923,
0.6064918637275696,
-0.3788614869117737,
-0.1142130792140960... | |
doesn't seem like it provides redirection at all. [According to this usenet post](http://groups.google.ca/group/microsoft.public.scripting.wsh/msg/d2034742beef06c2?hl=en) you only get redirection if you have a console. I wonder if the redirection parameter is being parsed by powershell.exe, which is choosing to redirec... | [
-0.3966503143310547,
-0.06811806559562683,
0.25369197130203247,
0.2624282240867615,
-0.1826971173286438,
0.030925534665584564,
0.4511937201023102,
-0.12346494197845459,
-0.4307572841644287,
-0.5155760645866394,
-0.2994907796382904,
0.6914580464363098,
-0.4681459665298462,
0.011582345701754... | |
So, I have a dedicated server. I host about dozen or so small sites.
Is there a real benefit in using S3(or Mosso) for my image and static file hosting? My server has more than enough disk space, or am I completely missing the point of S3?
I keep reading about how wonderful and cheap it is, and I ask myself "self, wh... | [
0.33293625712394714,
0.012154496274888515,
0.41057103872299194,
0.005145338363945484,
0.05064644291996956,
-0.025824110954999924,
0.09903068095445633,
0.2792742848396301,
-0.4417557716369629,
-0.727810263633728,
0.1358470767736435,
0.4064098000526428,
0.12695366144180298,
0.035414762794971... | |
you and that is where you should always start. Off the top of my head I can think of a couple reasons why you may want to move some storage to S3 in the future:
* Your storage or bandwidth needs grow beyond what you have and S3 is cheaper than upgrading your current solution
* You move to a multiple-dedicated-server s... | [
0.6258445978164673,
0.16000114381313324,
0.2312854379415512,
0.3831382989883423,
0.22363987565040588,
-0.12599198520183563,
0.06263136118650436,
0.11172757297754288,
-0.5444771647453308,
-0.7697479724884033,
0.002786083612591028,
0.41390401124954224,
0.07129663974046707,
0.0392660386860370... | |
I have a simple single page setup. Under a root folder, I have 3 subfolders (js, css, and images). In the root folder, I have an index.html page with the following content:
```
<html>
<head>
<title></title>
<script language="javascript" src="js/jquery-1.3.2.min.js"></script>
<script language="javascript" src="js/myscr... | [
0.3492559492588043,
0.20817948877811432,
0.48552829027175903,
-0.2906515598297119,
-0.26615190505981445,
0.20080971717834473,
0.36165061593055725,
-0.36928293108940125,
-0.02567555569112301,
-0.5679529905319214,
0.03241918608546257,
0.4676249623298645,
-0.15413883328437805,
0.0299849137663... | |
return false to prevent default action
});
});
```
As it is right now, you are trying to bind an event to an element that does not yet exist in the DOM.
Also, not sure why you have the `onclick` on the link itself, as the whole point of jQuery is to be able to take those ugly inline events out of there and bind... | [
0.15491671860218048,
-0.15773673355579376,
0.2729456126689911,
0.05039261281490326,
-0.03784416615962982,
-0.4032650291919708,
0.5650386214256287,
-0.1363387256860733,
-0.10370311886072159,
-0.6650974750518799,
-0.04260119050741196,
0.8460289835929871,
-0.2649856209754944,
0.21020051836967... | |
I have been working on a small web app using the Stripes framework. Now that the Google App Engine has added support for Java, I am wondering if I can convert it to run in the Google App Engine to save costs on hosting.
Yes, it supports servlets, so it should support [Stripes](http://www.stripesframework.org/display/st... | [
0.6031201481819153,
0.15271660685539246,
0.4284572899341583,
-0.12602941691875458,
-0.07125844061374664,
0.28541892766952515,
-0.044000912457704544,
-0.2880939841270447,
-0.2884938716888428,
-0.9663345813751221,
-0.024961574003100395,
0.29035067558288574,
-0.5443649888038635,
-0.0900247916... | |
configuration files,
> in a standard WAR directory structure.
> App Engine serves requests by invoking
> servlets according to the deployment
> descriptor. | [
-0.041628267616033554,
-0.002251631813123822,
0.366623193025589,
0.12185539305210114,
-0.17216435074806213,
0.2640170753002167,
0.1861559897661209,
-0.4501018226146698,
-0.3832089900970459,
-0.8792898058891296,
-0.6479710340499878,
0.3608168363571167,
-0.5746172070503235,
-0.05266275629401... | |
Hi All: I'm trying to set up my build file to be run for deployment on JBossAS 5.0.1, and I need to find the servlet jar file that I should use for the build..
All of the web pages I've looked at seem to indicate that the file is javax.servlet.jar and it should be in the C:\< install dir >\server\default\lib directory... | [
0.5418581366539001,
0.37714606523513794,
0.2968170642852783,
-0.1301451474428177,
-0.03615884855389595,
-0.17437848448753357,
0.5279386639595032,
-0.15933629870414734,
-0.06948356330394745,
-0.6076402068138123,
-0.005787103436887264,
0.5233216881752014,
-0.1300099492073059,
0.2234778851270... | |
are looking for is `JBOSS_HOME/common/lib/servlet-api.jar`.
From the JBossAS 5.0.0 [release notes](http://sourceforge.net/project/shownotes.php?release_id=645033): "Another notable change is that the majority of the libraries common to the different configurations have moved
to a new shared location, JBOSS\_HOME/comm... | [
0.2650894522666931,
0.19483643770217896,
0.4454178214073181,
-0.27425098419189453,
0.5323707461357117,
-0.24923139810562134,
0.3263842761516571,
-0.11002686619758606,
-0.4763615131378174,
-0.9155235886573792,
-0.30650612711906433,
0.053212519735097885,
-0.11652006208896637,
0.0945195332169... | |
I've overridden Equals and GetHashCode in an abstract base class to implement value equality based on an object's key property. My main purpose is to be able to use the Contains method on collections instead of Find or FirstOrDefault to check if an instance has already been added to a collection.
```
public abstract c... | [
0.12184171378612518,
0.28280097246170044,
0.40050408244132996,
-0.2168331891298294,
0.10684256255626678,
-0.21298260986804962,
0.36757275462150574,
-0.3045024275779724,
0.14483530819416046,
-0.4475766122341156,
0.13335248827934265,
0.4395727217197418,
-0.3755267858505249,
0.627510368824005... | |
return false;
}
if (obj.GetType() != GetType())
{
return false;
}
var entity = (Entity)obj;
return (entity.Id == Id);
}
public override int GetHashCode()
{ | [
-0.0743718072772026,
-0.018437905237078667,
0.3043173849582672,
-0.15714123845100403,
0.24383023381233215,
-0.02972439117729664,
0.5404346585273743,
-0.5001127123832703,
-0.14724759757518768,
-0.12131735682487488,
-0.4728591740131378,
0.5401403903961182,
-0.39184483885765076,
0.25401338934... | |
return Id.GetHashCode();
}
}
```
The problem with this approach is that all my objects are equal before they've been persisted and acquired an Id (generated by NHibernate). Am I doing it wrong? I could generate the Id in the constructor, but I would like to implement the same pattern for other projects that use ... | [
0.004423877224326134,
0.23039591312408447,
0.14835438132286072,
-0.15388740599155426,
-0.3136560022830963,
-0.05148429796099663,
0.031845539808273315,
-0.39203187823295593,
0.020614763721823692,
-0.6336272954940796,
0.2795315980911255,
0.7811092734336853,
-0.4772089421749115,
0.13216140866... | |
for my collections, I am checking to make sure that the collection does not already contain the object to be added. If all new'ed up objects are equal, then I can never add two new objects to the collection.
NHibernate gurantees that object reference identity of entities assocciated with the same context is the same as... | [
-0.02943490631878376,
0.19128775596618652,
0.4167993366718292,
0.01761840283870697,
-0.3221568763256073,
-0.17702333629131317,
0.17004144191741943,
-0.29563137888908386,
-0.36548539996147156,
-0.4868409335613251,
-0.0024592792615294456,
0.5128651261329651,
-0.3341240882873535,
0.4585154652... | |
the entity to the database and set the key of the entity to the generated key. | [
-0.01913221925497055,
0.09523128718137741,
0.49062398076057434,
0.3405437767505646,
0.2759314775466919,
-0.0749858021736145,
-0.22529689967632294,
-0.03410502150654793,
0.21682560443878174,
-0.19050516188144684,
-0.24426479637622833,
0.4450206756591797,
-0.19838522374629974,
0.508286833763... | |
This is probably a pretty n00b question, but i can't get it to work.
If i have following model:
```
from django.contrib.auth.models import User
class Entry(models.Model):
title = models.CharField()
users = models.ManyToManyField(User)
```
How would i get a list of all entry-titles of the currently logged i... | [
0.24720220267772675,
0.29966557025909424,
0.4241390824317932,
-0.11495981365442276,
-0.005492585711181164,
-0.36079439520835876,
0.020755009725689888,
-0.3563759922981262,
-0.3243579566478729,
-0.5031460523605347,
0.24521777033805847,
0.5620995163917542,
-0.16367574036121368,
0.14352816343... | |
the Django docs. | [
-0.20600076019763947,
0.4039021134376526,
0.013416849076747894,
-0.1478710174560547,
0.027226103469729424,
-0.314050555229187,
-0.18438497185707092,
0.09094976633787155,
-0.37852489948272705,
-0.4838368594646454,
-0.30572637915611267,
0.8095816969871521,
0.047777529805898666,
0.09491306543... | |
I have been working on a document conversion feature for converting a docx file to a pdf file using MOSS 2007. The SPFile.Convert() call is being made in the ItemAdded event and the ItemFileConverted event is fired fine as well. The eventing seems to be working fine, but the IsConvertedFile and SourceLeafName propertie... | [
-0.001052218722179532,
-0.04839685559272766,
0.46904993057250977,
-0.03254383057355881,
-0.26084721088409424,
-0.27017828822135925,
-0.01879088021814823,
-0.39550089836120605,
-0.11026052385568619,
-0.6707771420478821,
-0.09081202000379562,
0.8837636113166809,
-0.21185295283794403,
0.09649... | |
on SPFile.Properties "vti\_dttransformerid" and "vti\_dtparentleafname". The problem is, these two properties are not being set consistently whenever I have code in my ISPConversionProcessor.PostProcess() implementation in which I was hoping to do some post processing of the file. If there is no code in the PostProcess... | [
0.33104556798934937,
-0.00009968334779841825,
0.6480871438980103,
-0.032025836408138275,
-0.2270008623600006,
-0.3388812243938446,
0.3333674669265747,
-0.34421899914741516,
-0.49176380038261414,
-1.0115933418273926,
0.17480656504631042,
0.7151565551757812,
-0.07443412393331528,
0.178950697... | |
but even the HtmlLauncher and LoadBalancer services had no mention of these properties).
Has anyone done a complete Document Conversion implmentation and used the SPFile.IsConvertedFile and SPFile.SourceLeafName properties successfully?
I think the [Subversion FAQ](http://subversion.tigris.org/faq.html#log-in-source) ... | [
0.1474212259054184,
0.005370853468775749,
0.3109210431575775,
0.24599690735340118,
-0.11242561787366867,
-0.34670737385749817,
0.655004620552063,
0.14136046171188354,
-0.6054753661155701,
-0.6034743189811707,
-0.22609876096248627,
0.15150603652000427,
-0.25676995515823364,
0.43566605448722... | |
I'm creating a set of ColdFusion custom tags designed to make reusing certain layout elements easy. I'll be using them in a manner similar to the following:
```
<cfimport prefix="layout" taglib="commonfunctions/layouttags">
<layout:fadingbox>
This text will fade in and out
</layout:fadingbox>
<layout:stockticker>... | [
0.6143175363540649,
0.2992677092552185,
0.45483189821243286,
-0.23348459601402283,
0.10687417536973953,
-0.2989667057991028,
0.10121944546699524,
-0.3359960615634918,
0.10186777263879776,
-0.822323739528656,
0.1775595098733902,
0.23361836373806,
-0.49772754311561584,
0.07733120769262314,
... | |
be included *once* per page. After the first time one of these custom tags is used, I'd like subsequent calls to the same tag on the same page to avoid repeating the <script> tag. It's occurred to me that I could do something like this:
```
<cfif NOT isDefined("Caller.LayoutTagInitialized")>
<script src="commonfun... | [
0.4142535924911499,
-0.020157331600785255,
0.4783475995063782,
-0.14206352829933167,
0.006994087249040604,
-0.2006150633096695,
0.043972622603178024,
-0.33598729968070984,
-0.3844791054725647,
-0.8433332443237305,
-0.046826597303152084,
0.4376034438610077,
-0.44080251455307007,
-0.02986180... | |
type="text/javascript"></script>
<div class="mytag">
<cfelse>
</div>
</cfif>
```
...and I have CFML markup calling the tag like like this:
```
<layout:mytag>
One
</layout:mytag>
<layout:mytag>
Two
</layout:mytag>
<layout:mytag>
Three
</layout:mytag>
```
...I want HTML like the following to be g... | [
-0.03450636565685272,
0.04454047977924347,
0.6311987042427063,
-0.11880600452423096,
-0.19912150502204895,
0.06730682402849197,
0.1718042939901352,
-0.5279715657234192,
-0.1407250463962555,
-0.868087112903595,
-0.06289740651845932,
0.4200270175933838,
-0.30051177740097046,
-0.3710268139839... | |
you're wanting something to come out in the start or end mode of the tag, which is part of what you want.
But then you say you want that script tag put out in the start mode of only the first tag used on the page.
That's where you would use Peter's suggestion of the request scope. Unlike the default (or "variables")... | [
0.4869719445705414,
-0.3395234942436218,
0.347246915102005,
0.01012094784528017,
0.12234745174646378,
-0.000591982330661267,
-0.014734483323991299,
-0.1897171586751938,
-0.06963123381137848,
-0.48882120847702026,
-0.12372095882892609,
0.3793843686580658,
-0.2645741403102875,
-0.02460884861... | |
only be the local scope in the custom tag. The request scope (which has been around since about CF 4.01) is your best choice.
In that case, your proposed solution was close: in the custom tag, in the start mode, programatically check if you have already created a tracking variable in the request scope when you put the... | [
0.4332706928253174,
-0.17728054523468018,
0.46586403250694275,
-0.18789799511432648,
0.12646542489528656,
-0.34840983152389526,
0.10418925434350967,
-0.03207110986113548,
-0.2517339587211609,
-0.5124483704566956,
0.29631507396698,
0.7667008638381958,
-0.4100000262260437,
-0.382355302572250... | |
execute it again for when the IF test fails. | [
0.1852559745311737,
-0.14719408750534058,
-0.12402854859828949,
-0.06969264894723892,
0.09853668510913849,
-0.15402929484844208,
0.6391204595565796,
0.05554196611046791,
0.1080705001950264,
-0.4790831506252289,
-0.3861349821090698,
0.42605674266815186,
-0.27625229954719543,
-0.008705909363... | |
I have an android application that plays music from a site, however to authenticate to the stream, you need to send a cookie first I.E:
<http://example.com/site/content?id=SOMEID> = mp3 formatted stream
If you access the url without a cookie, you'll get a Server 500 error.
If you have a cookie, then you'll get the st... | [
0.2684655487537384,
0.39075228571891785,
0.19571232795715332,
0.15742701292037964,
-0.23448964953422546,
-0.32912477850914,
0.2661587595939636,
0.09017543494701385,
-0.004697240889072418,
-0.7371333837509155,
0.09804171323776245,
0.8459715247154236,
-0.21109670400619507,
0.4325291216373443... | |
connections, so there is no way to access the stream it is using AFAICT. | [
0.06086007133126259,
-0.18100160360336304,
0.42558589577674866,
0.4352641999721527,
0.23288549482822418,
-0.009423963725566864,
0.12781885266304016,
0.21570762991905212,
-0.39365312457084656,
-0.6694574952125549,
-0.0031004573684185743,
-0.048855748027563095,
-0.38074955344200134,
0.273139... | |
I have an asp.net MVC application that calls another service to generate a pdf. I want the user to be able to click a link in my View and get a 'save as...' dialog from the browser to save the pdf.
The call to the 3rd party service is made in a Model using WebClient.
How to get I the data from the WebClient call up t... | [
0.34448593854904175,
-0.11156871914863586,
0.5004830956459045,
0.0434468612074852,
-0.26695483922958374,
-0.052992552518844604,
0.04230465739965439,
-0.02446390688419342,
-0.29771164059638977,
-0.7626951336860657,
-0.022613752633333206,
0.8269868493080139,
-0.17185042798519135,
0.149898052... | |
than you would expect. | [
0.01581708900630474,
-0.17081250250339508,
0.10101870447397232,
0.1398410201072693,
-0.01731320470571518,
-0.09475135058164597,
0.03504598140716553,
-0.0029623289592564106,
-0.24166522920131683,
-0.4197703003883362,
0.1576349288225174,
0.301241010427475,
0.33890464901924133,
0.212441086769... | |
I have a hierarchy of three interfaces, grandparent, parent and child. **Parent and child have a method "add", which requires different input parameters in the child.** While it's no problem to add the required signature **in the child, the inherited method will be pointless**, so is there a way to not have it in there... | [
0.5220192074775696,
0.1436915248632431,
0.34577518701553345,
0.3797271251678467,
0.044782932847738266,
0.4993950128555298,
-0.059255603700876236,
-0.5048494935035706,
-0.0539417490363121,
-0.9965628981590271,
0.463493287563324,
0.3134106695652008,
-0.012486913241446018,
0.22571301460266113... | |
reading. I also have classes that represent a number of consecutive readings (a series), and one that contains multiple series running over the same period of time (let's just call that a table).
The table can be viewed as a series (which aggregates the values orthogonally to the time axis), and both table and series ... | [
0.3639101982116699,
-0.17588375508785248,
0.45823508501052856,
0.18528294563293457,
-0.19872860610485077,
0.126975417137146,
-0.12980662286281586,
-0.3761046528816223,
-0.07688266038894653,
-0.6861377358436584,
0.25813162326812744,
0.4155104160308838,
-0.34539034962654114,
0.18870162963867... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.