text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I am trying to make on top some padding but how to do this with Container?
```
JFrame frame = super.screen.getFullScreenWindow();
//Container contentPane = frame.getContentPane();
//JPanel contentPane = new JPanel();
// Make sure the content pane is transparent
if (contentPane instanceof JComponen... | [
0.34638354182243347,
-0.019846610724925995,
0.7208806872367859,
-0.15897712111473083,
0.09513600170612335,
0.1217540055513382,
0.4521559178829193,
-0.15845048427581787,
-0.25155574083328247,
-0.8902903199195862,
-0.300578236579895,
0.2845982611179352,
-0.2580336332321167,
0.245643690228462... | |
[javac] symbol : method setBorder(javax.swing.border.EmptyBorder)
[javac] location: class java.awt.Container
[javac] contentPane.setBorder(new EmptyBorder(10, 10, 10, 10) );
[javac]
```
You can override [Container#getInsets](http://docs.oracle.com/javase/7/docs/api/java/awt/Container.html#getInsets%28%29), althou... | [
0.11302091181278229,
-0.00877151545137167,
0.5073456764221191,
-0.10963843762874603,
-0.15903007984161377,
-0.1960727423429489,
0.11768808960914612,
-0.47975802421569824,
-0.364196240901947,
-0.3794752359390259,
-0.2574985921382904,
0.0634361132979393,
-0.3990449607372284,
0.23216342926025... | |
I need my CLI PHP script to post some value to a SPNEGO authenticated site.
```
$ch = curl_init(USERSPACE_MYSQL_SERVICES);
curl_setopt_array($ch, [
CURLOPT_HTTPAUTH => ??, //Set to SPNEGO
CURLOPT_POSTFIELDS => [...]
]);
```
However SPNEGO is disabled for some reason:
Extract from my phpinfo:
```
curl
cU... | [
-0.32923823595046997,
0.25042787194252014,
0.872392475605011,
0.010017052292823792,
-0.15777435898780823,
-0.2121732383966446,
0.5153743624687195,
-0.04319912567734718,
-0.15295551717281342,
-0.511104166507721,
-0.49894630908966064,
0.4013770520687103,
-0.449291855096817,
0.023576090112328... | |
=> OpenSSL/1.0.0e
ZLib Version => 1.2.3.4
```
The Apache server that it is communicating to is set up as follows:
```
AuthType Kerberos
AuthName "Kerberos LAN Realm Login"
KrbAuthRealm LAN
Krb5KeyTab /etc/apache2/auth/apache2.keytab
KrbMethodK5Passwd Off
... | [
-0.043952859938144684,
0.28300368785858154,
0.8614422678947449,
0.09854858368635178,
-0.0569990836083889,
-0.381405770778656,
0.6201950907707214,
-0.07855036109685898,
0.029444651678204536,
-0.5779618620872498,
-0.3563327193260193,
0.2043599933385849,
-0.20105697214603424,
0.42267847061157... | |
KrbLocalUserMapping On
```
When trying it through the command line `curl` it works, but I have to input a dummy password:
```
curl --negotiate -u user https://example.com
Enter host password for user 'user':
<html>
...
```
How can I enable SPNEGO for the php curl and how would I use it in my script?
Update
------... | [
-0.30715349316596985,
0.19487044215202332,
1.1153454780578613,
-0.15884630382061005,
-0.07383913546800613,
-0.11022241413593292,
0.48738110065460205,
-0.40146777033805847,
-0.15476085245609283,
-0.4347628355026245,
-0.26640620827674866,
0.5347537398338318,
-0.38041675090789795,
0.049993529... | |
the same problem. It is being caused by the tinymce-jquery package overriding the attr and css methods of the jquery object. It seems (sadly) that the solution is to not use the jquery version of tinymce.
I haven't worked yet out why this wasn't a problem with jquery 1.6 and is a problem with 1.7.
Edit:
I was using ... | [
0.13724742829799652,
0.07322578877210617,
0.6013113856315613,
-0.18608161807060242,
0.005202226806432009,
-0.11147462576627731,
0.3707955479621887,
-0.15403766930103302,
-0.14805549383163452,
-0.6819891929626465,
0.03239337354898453,
0.9224395751953125,
-0.4904569089412689,
0.3057437837123... | |
{
-- SETTINS HERE --
});
ed.render();
});
```
Hope this helps | [
0.030000681057572365,
0.2411828339099884,
0.43513453006744385,
-0.3765698969364166,
0.39724650979042053,
0.19678360223770142,
0.5604904890060425,
-0.05934559181332588,
-0.0033687634859234095,
-0.8325068950653076,
-0.4985629618167877,
0.7098592519760132,
-0.10333581268787384,
-0.05818902328... | |
The question says it all.
I understand that VC11 is currently only in beta, but what I'm asking is:
1. experience with trying to link with a closed source (widely used if possible) library compiled with vc10
2. specifications from Microsoft saying explicitely if yes or no the vc11 will be able to link with vc10 libra... | [
0.4904174208641052,
0.028525391593575478,
0.1906585693359375,
0.18709829449653625,
-0.23639783263206482,
-0.23870202898979187,
-0.033346910029649734,
-0.19298779964447021,
-0.20655427873134613,
-0.47909215092658997,
-0.015796532854437828,
0.4572281539440155,
-0.27678975462913513,
0.1662252... | |
even within the same version, there are changes between debug and release mode, and settings like \_HAS\_ITERATOR\_DEBUGGING, etc.).
[Quoting VC++ STL maintainer](http://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-3-The-CCX-Episode-with-Marian-Luparu#c634562282888943795):
> The STL never has and never will gua... | [
-0.21501171588897705,
-0.16538716852664948,
0.6535518169403076,
0.009638997726142406,
0.01770256645977497,
-0.40821272134780884,
0.5233837962150574,
0.3134027123451233,
-0.437249094247818,
-0.42326295375823975,
-0.4885807931423187,
0.3605204224586487,
-0.3626185655593872,
0.453327655792236... | |
I got this simple cache class setted up as a library in the Codeigniter:
```
<?php
class Easy_cache {
static public $expire_after;
static function Easy_cache()
{
if ($this->expire_after == '')
{
$this->expire_after = 300;
}
}
static function store($key, $val... | [
0.0050866687670350075,
0.01111664343625307,
0.6408896446228027,
-0.31699085235595703,
0.002072735456749797,
0.09019138664007187,
0.40878263115882874,
-0.06384576112031937,
0.15080907940864563,
-0.530979335308075,
-0.19564712047576904,
0.43267664313316345,
-0.17580881714820862,
0.2627841532... | |
$value = serialize($value);
file_put_contents(BASEPATH.'cache/'.$key.'.cache', $value);
}
static function is_cached($key)
{
$key = sha1($key);
if (file_exists(BASEPATH.'cache/'.$key.'.cache') && (filectime(BASEPATH.'cache/'.$key.'.php')+$this->expire_after) >= time())
re... | [
0.0005371876759454608,
-0.16404935717582703,
0.6857026815414429,
-0.3458635210990906,
0.3025114834308624,
0.0003791622584685683,
0.4980918765068054,
-0.5217588543891907,
-0.17445363104343414,
-0.5310600399971008,
-0.5032994747161865,
0.6584238409996033,
-0.19349458813667297,
0.314595878124... | |
sha1($key);
$item = file_get_contents(BASEPATH.'cache/'.$key.'.cache');
$items = unserialize($item);
return $items;
}
static function delete($key)
{
unlink(BASEPATH.'cache/'.sha1($key).'.cache');
}
}
```
I want to use it now, so in the controller I'm using this (I'm ... | [
-0.3626798987388611,
-0.18732783198356628,
0.40511012077331543,
-0.22628414630889893,
-0.17477667331695557,
-0.029028911143541336,
0.07774612307548523,
-0.33991703391075134,
-0.42090490460395813,
-0.5946636199951172,
-0.17537043988704681,
0.11507651954889297,
-0.48321691155433655,
0.631120... | |
public function index()
{
$cache = $this->easy_cache;
if ( !$cache::is_cached('statistics') )
{
$data = array('data' => $this->model_acc->count());
$cache::store('server_statistics', $data);
}
else
$data = array('this' => 'value'); | [
-0.4908548593521118,
-0.16237910091876984,
0.3795129954814911,
-0.04927302151918411,
0.11243614554405212,
0.11112290620803833,
-0.00023965431319084018,
-0.21547946333885193,
0.03604675829410553,
-0.5506583452224731,
-0.3979179561138153,
0.5448312759399414,
-0.5858989953994751,
0.0082452306... | |
$this->load->view('main', array('servers' => $this->servers->get()));
}
}
```
And then I'm getting this error:
```
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in [..]
```
I guess its something related to the double dots and the static function, but I'm a newbie with the classes, so whats the ... | [
-0.11486392468214035,
0.13202941417694092,
0.16718325018882751,
-0.23200540244579315,
0.12464354187250137,
-0.24401578307151794,
0.3851056694984436,
-0.004635508172214031,
-0.04831449314951897,
-0.6244425177574158,
-0.35232850909233093,
0.6420415639877319,
-0.5472200512886047,
0.0062390053... | |
{
$this->expire_after = 300;
}
}
```
IMO, class `Easy_cache` should be used like you tried to, but:
* use `->` instead of `::` for method calls
* remove all `static` keywords in the methods definitions
* (optional but recommended) rename `Easy_cache()` method to `__construct()` | [
-0.08132217824459076,
-0.0685960203409195,
0.22395747900009155,
-0.21276973187923431,
0.3384940028190613,
-0.3580508232116699,
0.26487189531326294,
-0.055089570581912994,
-0.12070148438215256,
-0.5839828848838806,
-0.37082746624946594,
0.6287878155708313,
-0.47504791617393494,
-0.141999363... | |
What is the most efficient way in terms of speed to access the pixel data of a PIL image from a C extension? I only need read-only access to it, if that makes a difference.
Here's how to remove the excess commas from the right hand side of a string:
```
In [2]: mystring = '1,2,3,4,"Hello!",,,,,,,,,'
In [3]: mystring.... | [
0.12812484800815582,
-0.017717450857162476,
0.9566937685012817,
-0.029693756252527237,
-0.0706491693854332,
0.21453113853931427,
0.1113554835319519,
-0.31308799982070923,
-0.21126705408096313,
-0.4621138274669647,
-0.09858348220586777,
0.5112398266792297,
-0.3138783574104309,
-0.0976234450... | |
I am thinking about a good way to find differences in two lists
here is the problem:
Two lists have some strings where first 3 numbers/characters (\*delimited) represent the unique key(followed by the text String="key1\*key2\*key3\*text").
here is the string example:
```
AA1*1D*4*The quick brown fox*****CC*34563212... | [
0.026011545211076736,
-0.03984552249312401,
0.2273145169019699,
-0.18501833081245422,
0.05962873250246048,
0.34269386529922485,
0.13718505203723907,
-0.1999865472316742,
-0.23976139724254608,
-0.7589392066001892,
0.1765354424715042,
0.6367614269256592,
-0.4546475112438202,
-0.2298856824636... | |
in another, I need to track one side and keep an empty entry in another side. (#4 in the example above)
return the list
This is what I did so far, but I am kind of struggling here:
```
List<String> Base = baseListCopy.Except(resultListCopy, StringComparer.InvariantCultureIgnoreCase).ToList(); //Keep unique v... | [
0.2408863753080368,
-0.1706027090549469,
0.6046193242073059,
-0.15066012740135193,
-0.3279213011264801,
0.07798700779676437,
0.1758977770805359,
-0.788846492767334,
-0.2539163827896118,
-0.648181140422821,
0.5177297592163086,
0.1757911741733551,
-0.36013028025627136,
0.07988300174474716,
... | |
//if both reports have same amount of blocks
if ((Result.Count > 0 || Base.Count > 0) && (Result.Count == Base.Count))
{
foreach (String S in Result)
{
String[] sArr = S.Split('*'); | [
0.45192891359329224,
-0.09507299959659576,
0.3594650328159332,
-0.310825377702713,
0.0755951777100563,
-0.03469834849238396,
0.2832790017127991,
-0.8126156330108643,
-0.22287310659885406,
-0.3861674666404724,
-0.5813032388687134,
0.25791746377944946,
-0.006665374152362347,
0.11815384775400... | |
foreach (String B in Base)
{
String[] bArr = B.Split('*');
if (sArr[0].Equals(bArr[0]) && sArr[1].Equals(bArr[1]) && sArr[2].Equals(bArr[2]) && sArr[3].Equals(bArr[3]))
{ | [
0.3340735137462616,
0.46238332986831665,
0.22591809928417206,
-0.6834300756454468,
-0.21738946437835693,
0.31957435607910156,
0.2942546308040619,
-0.7062197327613831,
0.04089108109474182,
-0.12132790684700012,
-0.42818766832351685,
0.14592477679252625,
-0.45406588912010193,
0.0350827351212... | |
String[] NA = new String[2]; //keep results
NA[0] = B; //[0] for base
NA[1] = S; //[1] for result | [
0.04909651726484299,
-0.218634232878685,
0.127048060297966,
-0.3800140619277954,
-0.2720099091529846,
0.3216817080974579,
0.504137396812439,
-0.7442412972450256,
-0.22240802645683289,
-0.15201430022716522,
-0.29603680968284607,
0.0836280807852745,
-0.2478114664554596,
0.11133795231580734,
... | |
blocksComparison.Add(NA);
break;
}
}
}
}
```
could you suggest a good algorithm for this process?
Thank you
If I understand your question correctly, you'd like to | [
0.24624350666999817,
0.18347224593162537,
-0.263467013835907,
0.21113567054271698,
0.2783583700656891,
-0.23770244419574738,
-0.004919905681163073,
-0.011334451846778393,
-0.12325140833854675,
-0.67676842212677,
-0.03442830592393875,
0.27873480319976807,
-0.38630884885787964,
-0.0408493503... | |
be able to compare the elements by their "key" prefix, instead by the whole string content. If so, implementing a custom equality comparer will allow you to easily leverage the LINQ set algorithms.
This program...
```
class EqCmp : IEqualityComparer<string> {
public bool Equals(string x, string y) {
retu... | [
-0.00577925331890583,
-0.014594554901123047,
0.49392417073249817,
-0.24414213001728058,
-0.03148316591978073,
0.17266875505447388,
0.3230646252632141,
-0.6020627617835999,
-0.005129139870405197,
-0.4433371126651764,
0.05417943745851517,
0.3803879916667938,
-0.41179773211479187,
0.055373653... | |
}
static IEnumerable<string> GetKey(string line) {
// If we just split to 3 strings, the last one could exceed the key, so we split to 4.
// This is not the most efficient way, but is simple.
return line.Split(new[] { '*' }, 4).Take(3);
}
}
class Program {
static void Main(string... | [
0.21345165371894836,
-0.6097870469093323,
0.3819844424724579,
-0.46614161133766174,
0.2565406560897827,
0.21671371161937714,
0.0652812123298645,
-0.24742412567138672,
-0.18473058938980103,
-0.3428134620189667,
-0.2638522684574127,
0.6295744776725769,
-0.5684273838996887,
0.1081170886754989... | |
"index1*index1*index1*some text",
"index1*index1*index2*some text ** test test test",
"index1*index2*index1*some text",
"index1*index2*index2*some text",
"index2*index1*index1*some text"
};
var l2 = new List<string> {
"index1*index1*index2*som... | [
0.06743712723255157,
-0.1493738442659378,
0.12835508584976196,
-0.13595376908779144,
0.22782692313194275,
0.1999608427286148,
0.07784993201494217,
-0.1651618629693985,
0.11612868309020996,
-0.5072160363197327,
-0.2930017411708832,
0.4385787546634674,
-0.14791657030582428,
-0.32198101282119... | |
test",
"index2*index1*index1*some text",
"index2*index1*index2*some text"
};
var eq = new EqCmp();
Console.WriteLine("Elements that are both in l1 and l2:");
foreach (var line in l1.Intersect(l2, eq))
Console.WriteLine(line);
Console.WriteLi... | [
-0.1755973994731903,
-0.20737065374851227,
0.4681483209133148,
-0.13835003972053528,
0.3912774622440338,
0.18485431373119354,
0.2897271513938904,
-0.21146994829177856,
0.24600352346897125,
-0.7208253741264343,
-0.30518561601638794,
0.26016709208488464,
-0.21476978063583374,
-0.148346900939... | |
not in l2:");
foreach (var line in l1.Except(l2, eq))
Console.WriteLine(line);
// Etc...
}
}
```
...prints the following result:
```
Elements that are both in l1 and l2:
index1*index1*index2*some text ** test test test
index2*index1*index1*some text
Elements that are in l1 but not... | [
-0.15233328938484192,
0.019636042416095734,
0.40146368741989136,
-0.2495667189359665,
0.3363962769508362,
0.1987728774547577,
0.18182799220085144,
-0.5164507031440735,
0.06251456588506699,
-0.598690927028656,
-0.5060763955116272,
0.34861481189727783,
-0.10769014805555344,
-0.29752394556999... | |
I need to setup a process monitor on a number of servers using a monitoring tool called Zenoss. The problem I'm facing is how can I get information on a specific process via SNMP? I'm not familiar with SNMP at all and I'm having trouble finding out what I need.
I've been trying to use a tool called SNMP-Probe but it o... | [
0.3057091534137726,
0.04205210506916046,
0.6094312071800232,
-0.002732398919761181,
0.22827786207199097,
-0.10810089856386185,
0.1865706592798233,
0.02963372878730297,
-0.39754098653793335,
-0.8836246728897095,
0.14272074401378632,
0.3237248957157135,
-0.02971363067626953,
0.25005498528480... | |
information such as process name, path, type, status, parameters, CPU and RAM usage even though those two informations are stored on another MIB ([hrSWRunPerfEntry](http://www.oid-info.com/get/1.3.6.1.2.1.25.5.1.1)). However how you do that "query" depends on the environment you're using, I am almost sure that vbs incl... | [
0.3139774799346924,
-0.08227651566267014,
0.654638946056366,
0.15480031073093414,
0.12535543739795685,
-0.010664430446922779,
0.05383883789181709,
-0.2451164424419403,
-0.5506629347801208,
-0.5190066695213318,
-0.3129391372203827,
0.15978753566741943,
-0.08897129446268082,
0.31458023190498... | |
I have a dynamic query string that I need to pass via an .htaccess redirect. For example:
I need to redirect this URL: `http://mysite.com/page1?action=signup&var2=dynamicVar`
To this: `http://mysite.com?action=signup&var2=dynamicVar`
I know this is pretty simple, but I'm really not sure what type of rule/syntax woul... | [
-0.039509668946266174,
0.00039974713581614196,
0.9141786694526672,
-0.09910628199577332,
-0.0322517566382885,
-0.10425682365894318,
0.5450291633605957,
-0.2590583860874176,
-0.22822313010692596,
-0.4053325653076172,
-0.05203714966773987,
0.4830493628978729,
-0.2994486093521118,
0.084593795... | |
Is there an `C#` equivalent to the `PHP` function `parse_str`?
I couldn't find anything and wrote my own function but is there something in the `C#` framework?
```
public Dictionary<string, string> parse_str(string query) {
Dictionary<string, string> data = new Dictionary<string, string>();
foreach(string s... | [
0.023086609318852425,
0.11503513902425766,
0.3095260262489319,
-0.1484953910112381,
0.04722727835178375,
0.018748734146356583,
0.1126355528831482,
-0.24615278840065002,
-0.07563254237174988,
-0.3037399351596832,
-0.23400063812732697,
0.6078273057937622,
-0.23033760488033295,
-0.01458541769... | |
I am currently writing my first Android app and have based most of my knowledge on the Android notepad tutorial:
<http://developer.android.com/resources/tutorials/notepad/notepad-ex3.html>
In my application I am using multiple DBHelpers in one Activity and not every Cursor is managed by the activity with startManagi... | [
-0.14209358394145966,
0.18940483033657074,
0.4507647454738617,
-0.16841202974319458,
-0.10023990273475647,
0.0012142446357756853,
0.21258826553821564,
-0.16688068211078644,
-0.17957495152950287,
-1.0173428058624268,
0.016415122896432877,
0.45249804854393005,
-0.49815836548805237,
-0.213565... | |
one SQLiteOpenHelper called mDriverDbHelper. This code is an adoption from the tutorial:
private DriverDbAdapter mDriverDbHelper;
```
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bus_se... | [
0.1482120007276535,
-0.4073270559310913,
0.6293463706970215,
-0.21523679792881012,
-0.2785642743110657,
-0.022308681160211563,
0.39333876967430115,
-0.3868595361709595,
-0.17876233160495758,
-0.8093420267105103,
-0.11077669262886047,
0.4644259214401245,
-0.5400157570838928,
0.4668993651866... | |
onStart() {
super.onStart();
mDriverDbHelper.open();
Log.v(TAG, "onStart");
}
@Override
public void onResume() {
super.onResume();
Log.v(TAG, "onResume");
}
@Override
public void onPause() {
Log.v(TAG, "onPause");
super.onPause();
}
@Override
public void onStop() {
mDriverDbHelper.clo... | [
0.40089094638824463,
0.024527907371520996,
0.5679551362991333,
-0.2520947754383087,
0.3365422785282135,
0.03808894753456116,
0.6180595755577087,
-0.11903009563684464,
-0.29190975427627563,
-0.6013520956039429,
-0.26830437779426575,
0.7908205986022949,
-0.5205300450325012,
0.280237287282943... | |
it has to be onStart and onStop and not onPause and onResume?
**FINAL ANSWER**
The tutorial is missing a close() method call. A general rule to using open and close in conjunction with the activity life-cycle is:
*After opening an SQLiteOpenHelper in an activity life-cycle-method you should close it in the correspon... | [
0.12743748724460602,
0.2111760824918747,
0.7471465468406677,
-0.08049803227186203,
0.36947938799858093,
-0.22288015484809875,
0.16736255586147308,
-0.05863237380981445,
-0.19461575150489807,
-0.4833669066429138,
-0.6671931147575378,
0.5743734836578369,
-0.27108070254325867,
0.2738803029060... | |
onPause() {
....
//close SQLiteOpenHelper
onResumeHelper.close();
}
@Override
public void onStop() {
....
//close SQLiteOpenHelper
onStartHelper.close();
}
@Override
public void onDestroy() {
....
//close SQLiteOpenHelper
onCreateHelper.close();
}
```
In the case of the Android N... | [
-0.225716695189476,
0.02779729850590229,
0.9168534278869629,
-0.14559614658355713,
0.18389882147312164,
0.19286000728607178,
0.2431672215461731,
-0.15598823130130768,
-0.1433487832546234,
-0.7608077526092529,
-0.2117723524570465,
0.5967339277267456,
-0.541666567325592,
0.3525571823120117,
... | |
activity to take care of managing the given
> Cursor's lifecycle for you based on the activity's lifecycle. That is,
> when the activity is stopped it will automatically call **deactivate()**
> on the given Cursor, and when it is later restarted it will call
> **requery()** for you. When the activity is destroyed, ... | [
-0.035443730652332306,
-0.376797616481781,
0.646983802318573,
0.0825086459517479,
-0.16114358603954315,
-0.23665012419223785,
0.5367637276649475,
-0.008835501037538052,
-0.5556530952453613,
-0.4412386119365692,
-0.38361307978630066,
0.8245977163314819,
-0.6652420163154602,
-0.2363214939832... | |
I have a string that can be either
```
"MyName (ctid 5555)"
```
or
```
"OtherName (id 555-5555-5555-555)"
```
I tried to write a regex to fetch `ctid` or `id`, like so:
```
"(?<=ctid=).+(?=))"
```
[Checking here](http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx) gave 0 r... | [
0.15036721527576447,
0.22390154004096985,
0.48324424028396606,
-0.18605688214302063,
-0.07966732233762741,
-0.29600563645362854,
0.4572506844997406,
-0.2678230106830597,
0.017152829095721245,
-0.41100168228149414,
-0.010449533350765705,
0.3857319951057434,
-0.23431827127933502,
0.281412333... | |
am assuming is) an invalid id like "(id 123)" (since it doesn't have the 3-4-4-3 pattern). | [
-0.11135289818048477,
0.11458691954612732,
0.06840723007917404,
-0.14201034605503082,
0.2709202468395233,
-0.3954569697380066,
0.3833933472633362,
-0.6159815192222595,
0.050988998264074326,
-0.278868168592453,
-0.48151934146881104,
0.34577763080596924,
-0.33825254440307617,
-0.254129022359... | |
Im using action bar compability library. Im trying to open the options menu from a button with openOptionsMenu() function but it does nothing.
Menu shows as usual when pressing the menu key on my phone. What is wrong here?
```
public class ReadActivity extends ActionBarActivity {
...
@Override
public bo... | [
0.10886461287736893,
-0.033957336097955704,
0.7465665936470032,
-0.4579046964645386,
0.07929451763629913,
0.2024977058172226,
0.7035158276557922,
-0.656851589679718,
-0.018258705735206604,
-0.46549347043037415,
-0.3181709051132202,
0.913655698299408,
-0.5999104976654053,
-0.014971341937780... | |
if (Helper.SupportsNewApi()) {
getActionBar().hide();
} else {
((View) ((LinearLayout) findViewById(R.id.actionbar_compat))
.getParent()).setVisibility(View.GONE);
}
return value;
}
@Override
public boolean onOptionsItemSelected(MenuItem ... | [
-0.1826939731836319,
-0.39172738790512085,
0.3104957640171051,
-0.27071255445480347,
0.45539143681526184,
0.36599576473236084,
0.17794722318649292,
-0.34884020686149597,
-0.23736490309238434,
-0.33889511227607727,
-0.49955126643180847,
0.6169736981391907,
-0.3247453570365906,
0.04743425175... | |
switch (item.getItemId()) {
case android.R.id.home:
finish();
break;
case R.id.menu_search:
// Toast.makeText(this, "Tapped search", Toast.LENGTH_SHORT).show();
break;
case R.id.menu_bookmark:
// selectText(); | [
0.06874992698431015,
0.011125914752483368,
0.433190256357193,
-0.46564003825187683,
0.27202820777893066,
0.14480681717395782,
0.19439315795898438,
-0.16267496347427368,
0.02570590190589428,
-0.6847286820411682,
-0.6237761378288269,
0.5333412289619446,
-0.27966052293777466,
0.35641157627105... | |
// setFullScreen(false);
break;
case R.id.menu_day_night_mode:
break;
case R.id.menu_settings:
break;
case R.id.menu_zoom_in:
showOverlay(false);
break; | [
0.23419727385044098,
-0.22760318219661713,
0.4029371440410614,
-0.35092782974243164,
0.23362194001674652,
-0.01321379654109478,
0.5822807550430298,
0.19928768277168274,
-0.09211239963769913,
-0.48679375648498535,
-0.6838542222976685,
0.7369601130485535,
-0.25138163566589355,
0.245920062065... | |
case R.id.menu_zoom_out:
showOverlay(false);
break;
case R.id.menu_table_of_contents:
Intent tocIntent = new Intent(this, TocActivity.class);
int GET_SECTION_REFERENCE = 1;
startActivityForResult(tocIntent, GET_SECTION_REFERENCE);
break; | [
-0.07363100349903107,
-0.2748696506023407,
0.726380467414856,
-0.46110671758651733,
0.4645744562149048,
-0.11467162519693375,
0.4997131824493408,
-0.28414565324783325,
-0.13396736979484558,
-0.3224693238735199,
-0.5533097982406616,
0.5128294825553894,
-0.27978572249412537,
0.19565269351005... | |
case R.id.menu_overflow:
Toast.makeText(this, "Tapped overflow", Toast.LENGTH_SHORT).show();
//closeOptionsMenu();
openOptionsMenu(); //tried the below aswell, no results
//getWindow().openPanel(Window.FEATURE_OPTIONS_PANEL, null);
break;
}
re... | [
-0.08315178751945496,
0.05019326135516167,
0.30210885405540466,
-0.47008001804351807,
0.1558227241039276,
0.3342004418373108,
0.43734294176101685,
-0.2329953908920288,
-0.24160411953926086,
-0.51963871717453,
-0.6296912431716919,
0.5591049790382385,
-0.11805699020624161,
0.2265666425228119... | |
@Override //disable volume buttons
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (!menuShown && (keyCode == 25 || keyCode == 24)) {
return true;
}
return super.onKeyDown(keyCode, event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
... | [
0.019895024597644806,
-0.3344193994998932,
0.53880774974823,
-0.27148115634918213,
0.39241644740104675,
-0.14131544530391693,
0.23668161034584045,
-0.44226592779159546,
0.09823417663574219,
-0.48671773076057434,
-0.6547955274581909,
1.0101027488708496,
-0.3453828692436218,
0.16621130704879... | |
if (keyCode == 82) {
if (!menuShown) {
//openOptionsMenu();
showOverlay(true);
} else {
showOverlay(false);
} | [
-0.0009101551258936524,
-0.04302220791578293,
0.4237755835056305,
-0.6395449638366699,
0.33679085969924927,
-0.0769975408911705,
0.3542633056640625,
-0.2814129590988159,
0.1453048437833786,
-0.6260682344436646,
-0.6477017998695374,
0.48223358392715454,
-0.2095135748386383,
0.00468260375782... | |
//don't want it to open when pressing menu
return true;
} else if (keyCode == 4 && menuShown) {
showOverlay(false);
return true;
} else if (keyCode == 25 && !menuShown) { | [
-0.09126199036836624,
0.03140278905630112,
0.564421534538269,
-0.6368656754493713,
0.4129070043563843,
0.18479451537132263,
0.52585369348526,
-0.26017245650291443,
0.2805517911911011,
-0.4457378685474396,
-0.538314938545227,
0.5382144451141357,
-0.11391529440879822,
0.334539532661438,
0.... | |
prevPage();
return true;
} else if (keyCode == 24 && !menuShown) {
nextPage();
return true;
}
return super.onKeyUp(keyCode, event);
}
}
```
I'm not sure how relevant this is, but [this](https://groups.google.com/forum/#!topic/android-developers/Kx2PBIbw... | [
0.19924046099185944,
-0.20246392488479614,
0.7018836140632629,
-0.23003032803535461,
-0.11243415623903275,
-0.05378098785877228,
0.43304190039634705,
-0.11129944026470184,
-0.16486522555351257,
-0.7545933127403259,
-0.3884160816669464,
0.5677729249000549,
-0.2350638061761856,
0.24926522374... | |
hope this post is relevant enough to solve your problem.
Good luck! | [
0.31798791885375977,
0.2887708246707916,
0.31058141589164734,
0.3620709776878357,
-0.0028174477629363537,
-0.25277838110923767,
0.7305561900138855,
1.145385503768921,
-0.032586582005023956,
-0.6378709077835083,
-0.0910772979259491,
-0.1320062130689621,
0.24897217750549316,
0.06812255084514... | |
Help!
I enjoy Excel but I wanted to see if this were an option. I might even consider coding this in a simple javascript or so file.
I am trying to make a code that can be copied and dragged down on each new file that is made from our server.
On the file, there are NPA's and NXX's. If you aren't sure what that is, ... | [
0.18218062818050385,
0.10115954279899597,
0.2982461750507355,
0.24587441980838776,
-0.22060160338878632,
0.34393033385276794,
0.10762215405702591,
-0.10698635131120682,
-0.3518533706665039,
-0.48927822709083557,
0.12397725135087967,
0.14194683730602264,
-0.0645153671503067,
-0.051902443170... | |
what their carrier is for our markets.
For example, 479-203 is Centurylink. However, 479 is in column N and 203 is in column O.
While I can create, if N2 = "479" and O2 = "203", CenturyLink, --- do another if statement.
I was not sure since I have another excel document that does not change with the values present ... | [
0.17885923385620117,
-0.14492584764957428,
0.6207605600357056,
-0.02681860700249672,
0.08750659227371216,
0.6177158355712891,
-0.6351621747016907,
0.11804342269897461,
-0.5465384721755981,
-0.8791903853416443,
0.19009017944335938,
-0.09532929956912994,
-0.38032615184783936,
0.2656724154949... | |
If you name the function, I'll look it up too. I'm not picky. :)
Edit:
=IF(OR(N10="479",N10="870"),VLOOKUP(CONCATENATE(N10,"-",O10),[TnList.xls]AR!$A:$D,4,FALSE),VLOOKUP(CONCATENATE(N10,"-",O10),[TnList.xls]KS!$A:$D,4,FALSE))
You will need to add another column to the left of the data in your carrier spreadsheet and ... | [
-0.13390657305717468,
-0.08598339557647705,
0.3997851610183716,
-0.2328176349401474,
-0.0947488322854042,
0.5215397477149963,
0.04310198873281479,
-0.3934832513332367,
-0.328128457069397,
-0.42477306723594666,
-0.32175374031066895,
0.562386155128479,
-0.6913490891456604,
-0.237926080822944... | |
| 789 | 333 | CarrierC
```
Then add 2 columns to your phone number data determine the carrier from your phone number spreadsheet. Column B needs to be filled with `=LEFT(C2,7)` and column A needs to be filled with `=VLOOKUP(B2,[CarrierSpreadsheet.xls]Sheet1!$A:$D,4,FALSE)`:
PhoneNumbers.xls
```
Carrier |... | [
0.09700682014226913,
0.19933000206947327,
0.6832178831100464,
-0.011843742802739143,
-0.08848003298044205,
0.6949126124382019,
0.11541319638490677,
-0.35614681243896484,
-0.3543850779533386,
-0.45783406496047974,
-0.15564095973968506,
0.3035217821598053,
-0.5745469331741333,
-0.10978796333... | |
or my answer. | [
0.2267535924911499,
-0.033301930874586105,
0.22772035002708435,
0.13309843838214874,
-0.03840692341327667,
0.25667262077331543,
-0.20263394713401794,
-0.044708315283060074,
-0.08057835698127747,
0.07233014702796936,
-0.04278441146016121,
0.23597094416618347,
-0.03418411687016487,
0.1240872... | |
I have following xml file:
```
<ab>
<![CDATA[
<table>
<tbody>
<tr>
<th>abcdef</th>
<th><a href="/1/2" target="_blank">Contact</a></th> | [
0.24312229454517365,
0.2992120385169983,
0.5595544576644897,
-0.4114847183227539,
-0.03637079894542694,
0.0840473473072052,
0.12696857750415802,
-0.14072218537330627,
0.21200963854789734,
-0.7956520318984985,
0.05417723208665848,
0.5021950602531433,
-0.31336018443107605,
0.1096565946936607... | |
</tr>
<tr>
<p>
<a href="/1/2" target="_blank">Home</a>
</p>
</tr>
</tbody>
</table>
]]>
</ab>
```
I am still learning linq. Want to know if there is an easier way to | [
0.053374916315078735,
0.3112233579158783,
0.2728809416294098,
-0.19166430830955505,
0.11936988681554794,
0.037500664591789246,
0.06483220309019089,
-0.02948915585875511,
-0.13985633850097656,
-0.7286533713340759,
-0.06219494342803955,
0.1692677140235901,
0.18132953345775604,
-0.21440720558... | |
find all a href = "/1/2/" tags inside cdata and remove them. Like in above example it should just show Contact and Home and remove the
```
void Main()
{
XDocument doc = XDocument.Load("C:\\test.xml");
XDocument xdoc = XDocument.Parse(doc.ToString());
XNode node = xdoc.DescendantNodes().Single(x => x.Node... | [
0.14334730803966522,
-0.21893079578876495,
0.5362005233764648,
-0.009589756838977337,
0.35173600912094116,
-0.18913720548152924,
0.11317592114210129,
-0.41980743408203125,
0.12138748914003372,
-0.6042476892471313,
-0.4547075629234314,
0.15873600542545319,
-0.40704163908958435,
0.3591486811... | |
{ | [
-0.03528670221567154,
0.33553311228752136,
-0.2578403353691101,
0.012649552896618843,
0.2680523991584778,
0.29581815004348755,
0.2716692388057709,
0.7318258285522461,
-0.10499224811792374,
-0.5542182922363281,
-0.18786980211734772,
0.16323457658290863,
-0.18786592781543732,
-0.184415668249... | |
XAttribute xAttribute = x.Attribute("href");
return | [
-0.07604759186506271,
-0.05311977490782738,
0.41152432560920715,
-0.2251242995262146,
-0.24399159848690033,
0.208384707570076,
0.20156100392341614,
-0.2616431415081024,
0.33929139375686646,
-0.22679924964904785,
-0.4083560109138489,
0.7368180751800537,
-0.3967236578464508,
0.11882684379816... | |
xAttribute != | [
0.07073212414979935,
-0.026414567604660988,
-0.03511665016412735,
-0.06434362381696701,
-0.4845344126224518,
-0.257785826921463,
0.3984299898147583,
-0.01887631230056286,
0.04011821746826172,
-0.16892161965370178,
-0.17711181938648224,
0.39157938957214355,
-0.7440509796142578,
0.0111382659... | |
null && xAttribute.Value == "/1/2"; | [
0.1639295518398285,
0.1561770886182785,
-0.0369826965034008,
-0.2717355191707611,
-0.058435503393411636,
-0.06313734501600266,
0.6397385597229004,
-0.09682907164096832,
0.21988870203495026,
-0.007848056964576244,
-0.478463351726532,
0.35545292496681213,
-0.5527461171150208,
0.0622609965503... | |
});
// do something here
}
}
```
contents of test.xml is
```
<ab>
<![CDATA[
<table>
<tbody>
<tr>
<th>abcdef</th>
<th><a href="/1/2" target="_blank">Contact</a></th> | [
0.4739774465560913,
-0.09612065553665161,
0.06397020071744919,
0.06521337479352951,
0.0961899682879448,
-0.3476793169975281,
0.14303161203861237,
-0.28846919536590576,
0.24395008385181427,
-0.7115762829780579,
-0.20768189430236816,
0.43645957112312317,
-0.4393986761569977,
-0.0183689538389... | |
</tr>
<tr>
<p>
<a href="/1/2" target="_blank">Home</a>
</p>
</tr>
</tbody>
</table>
]]>
</ab>
``` | [
-0.0702609047293663,
0.32735687494277954,
0.04149715602397919,
-0.40102025866508484,
0.1767348051071167,
0.4031001031398773,
0.008904182352125645,
-0.4177407920360565,
-0.0547330267727375,
-0.6265011429786682,
-0.5516483783721924,
0.4369141161441803,
-0.3172593116760254,
-0.057470593601465... | |
Is there an R function that can solve a partial differential equation using the [finite element method](http://en.wikipedia.org/wiki/Finite_element_method) (Strang and Fix, 1973)?
Based on the wikipedia list of [finite element software packages](http://en.wikipedia.org/wiki/List_of_finite_element_software_packages), t... | [
-0.545098602771759,
0.20311254262924194,
-0.0037242353428155184,
-0.09786541014909744,
-0.149219810962677,
0.14471204578876495,
-0.10036339610815048,
-0.4121553897857666,
-0.23066720366477966,
0.10797974467277527,
0.14043213427066803,
0.4517059922218323,
-0.33649471402168274,
-0.3167549073... | |
Press Published April 20, 2018
More information can be found here: <https://www.crcpress.com/Finite-Element-Computations-in-Mechanics-with-R-A-Problem-Centered-Programming/Mustapha/p/book/9781138501621> | [
-0.03044869937002659,
0.16533812880516052,
0.34563586115837097,
0.20471853017807007,
-0.13236407935619354,
-0.2552913725376129,
0.17253391444683075,
-0.5027732253074646,
-0.40566253662109375,
-0.24607408046722412,
-0.5855371952056885,
0.3680884540081024,
-0.00547547684982419,
-0.0966948345... | |
I am creating an application that is similar to the camera app provided in the iPhone. When the user launches the application, the camera should pop out, But i need a button to be displayed on the camera's view. (Similar to the slider provided in the camera app).
1.) Can this be done ?
2.) Are there any tutorials on t... | [
0.9950253963470459,
0.0695381909608841,
0.2718479335308075,
-0.1074294000864029,
0.09792295843362808,
-0.434600830078125,
0.07145298272371292,
-0.5670815110206604,
0.016016745939850807,
-0.4501757025718689,
0.06214679405093193,
0.48421210050582886,
-0.5190856456756592,
-0.27271416783332825... | |
the frame in its parent
frame.pack()
# tell frame not to let its children control its size
frame.pack_propagate(0)
# put the textbox in the frame
textBox.pack()
``` | [
0.6664121150970459,
0.03350900113582611,
0.1456044465303421,
-0.14541105926036835,
-0.06946951895952225,
-0.17864133417606354,
0.30846187472343445,
-0.6522037982940674,
-0.018069801852107048,
-0.6397635340690613,
-0.31157198548316956,
0.13738271594047546,
-0.5594223141670227,
-0.1385310292... | |
I'm trying to create a basic database trigger that conditionally deletes rows from database1.table1 when a row from database2.table2 is deleted. I'm new to triggers and was hoping to learn the best way to accomplish this. This is what I have so far. Suggestions?
```
CREATE TRIGGER sampleTrigger
ON database1.dbo.ta... | [
0.3764236569404602,
0.19359932839870453,
0.0652736946940422,
-0.18453727662563324,
0.11985830962657928,
0.07389219850301743,
0.14107854664325714,
-0.48856785893440247,
-0.2384326010942459,
-0.3449391722679138,
0.2287193387746811,
0.45676475763320923,
-0.638613760471344,
-0.0442369282245636... | |
AND bar = 4)
-- If there is a row that exists in database2.dbo.table2
-- matching the id of the deleted row and bar=4, delete
-- it as well.
-- DELETE STATEMENT?
GO
```
```
CREATE TRIGGER sampleTrigger
ON database1.dbo.table1
FOR DELETE
AS
DELETE FROM database2.dbo.table2
WHERE bar = 4 AND ID IN(S... | [
0.11420223861932755,
0.06781495362520218,
0.2916891872882843,
-0.10138142853975296,
0.10298199206590652,
0.16509689390659332,
0.2014152556657791,
-0.6879673600196838,
-0.02864840440452099,
0.03058815747499466,
-0.17402714490890503,
0.36581215262413025,
-0.7220456004142761,
-0.0091697191819... | |
There is an ArrayList that has nested HashMaps. It's easy to get the value from the parent HashMap, but when I try to get the value from the nested HashMap (child), I get ClassCastException. This is a sample how it looks like (similar to the previous post):
```
ArrayList<HashMap<String, Object>> data = new ArrayList<H... | [
0.1806424856185913,
0.1691603660583496,
-0.06008358672261238,
-0.1577416956424713,
-0.024556441232562065,
0.37481871247291565,
0.39135903120040894,
-0.23628196120262146,
-0.24969996511936188,
-0.5608104467391968,
0.047634970396757126,
0.12693582475185394,
0.019476840272545815,
0.3402934372... | |
here?
Errorlist:
```
04-03 17:34:01.640: W/dalvikvm(26248): threadid=1: thread exiting with uncaught exception (group=0x4001e578)
04-03 17:34:01.645: E/AndroidRuntime(26248): FATAL EXCEPTION: main
04-03 17:34:01.645: E/AndroidRuntime(26248): java.lang.ClassCastException: java.util.ArrayList
04-03 17:34:01.645: E... | [
-0.45269981026649475,
0.3311966359615326,
0.4698391556739807,
-0.4371374249458313,
-0.05653137341141701,
0.3910762071609497,
0.7722927927970886,
-0.6312070488929749,
-0.3442961871623993,
-0.4796700179576874,
-0.318318247795105,
0.5702368021011353,
-0.39227762818336487,
0.10607591271400452,... | |
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
04-03 17:34:01.645: E/AndroidRuntime(26248): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670)
04-03 17:34:01.645: E/AndroidRuntime(26248): at dalvik.system.NativeStart.main(Native Method)
```
JSON objects being repr... | [
-0.20248086750507355,
0.0026192832738161087,
0.3306853473186493,
-0.32326334714889526,
-0.34272176027297974,
0.03542488068342209,
0.49913471937179565,
-0.42401206493377686,
-0.29441723227500916,
-0.8984960913658142,
-0.33244800567626953,
0.6068174839019775,
-0.513399600982666,
0.0502237752... | |
User u = new User();
// Read simple fields of the JSON object
u.name = json.optString("name");
// Now recursively read other users from a "friend" property
JSONArray jsonFriends = json.optJSONArray("friends");
for (int i=0; i<jsonFriends.length(); ++i) {
// This is the next nested JSON Objec... | [
-0.5044591426849365,
-0.26377975940704346,
0.6999165415763855,
-0.5505868792533875,
0.19868192076683044,
0.13404712080955505,
0.3537009060382843,
-0.35534271597862244,
-0.10028032213449478,
-0.855862021446228,
-0.2705024480819702,
0.5384816527366638,
-0.46033528447151184,
-0.00488750962540... | |
// And add it to our friend list
u.friends.add(friend);
}
}
private String name;
private List<User> friends;
}
```
That class would nicely read a JSON such as:
```
{
"name": "Joe",
"friends": [
{
"name": "Jack"
},
{
"name": "Rose"
}
]
}
``` | [
-0.07914794981479645,
-0.059239961206912994,
0.1778639405965805,
-0.03242357447743416,
0.2346731722354889,
0.16983914375305176,
0.18611770868301392,
-0.08896347135305405,
0.017376868054270744,
-0.5978798866271973,
-0.34154951572418213,
0.40447837114334106,
-0.19747699797153473,
0.188343703... | |
I am using C# with .net 3.5
I am saving my program data in a file under: C:\Program Data\MyProgramName\fileName.xml
After installing and running my application one time I uninstalled it (during uninstallation I'm removing all the files from "program data")
and then I reinstall the application, and ran it.
The stran... | [
0.25804373621940613,
0.4552631676197052,
0.3434121906757355,
-0.18485237658023834,
0.12559416890144348,
0.011804369278252125,
0.2762584090232849,
0.1775342971086502,
-0.2612200677394867,
-0.7891712188720703,
-0.11358281970024109,
0.6339001059532166,
-0.11761682480573654,
0.3501579165458679... | |
the application as admin and then the file didn't exist.
After a research, I found out that when running my application with no admin priviliges instead of getting: "C:\Program Data\MyProgramName\fileName.xml" I get "C:\Users\userName\AppData\Local\VirtualStore\ProgramData\MyProgramName\fileName.xml"
and indeed there... | [
0.0018868254264816642,
0.4382978081703186,
0.666500449180603,
0.025776147842407227,
0.1825437992811203,
0.06108986586332321,
0.3483628034591675,
-0.02003282867372036,
-0.10513626784086227,
-0.6570784449577332,
-0.2820761203765869,
0.7095648646354675,
-0.2915162742137909,
0.4157671332359314... | |
question is:
1. why is it happen.
2. How can I prevent it from happening
Thanks in advance
Do you *actually* have to write to the per-system Program Data folder instead of the per-user Application Data folder(s)?
You might want to take a look at [`Environment.GetFolderPath`](http://msdn.microsoft.com/en-us/library/1... | [
0.4090237617492676,
0.11324276030063629,
0.3956552743911743,
0.10863062739372253,
0.30170512199401855,
-0.19277985394001007,
0.4838019907474518,
-0.6080094575881958,
-0.11720075458288193,
-0.5047545433044434,
-0.19308727979660034,
0.4096533954143524,
-0.3111560344696045,
-0.021582271903753... | |
into `C:\ProgramData\MyApp\Test.txt`. As far as I can tell (Administrator mode Command Prompt), there's no UAC virtualization going on either.
**Double edit:**
I guess what's happened is that at some point an Administrator user has written the files into your ProgramData folder, and as such, UAC file system virtuali... | [
0.3070634603500366,
-0.06117985397577286,
0.26882338523864746,
0.055835142731666565,
0.3157348930835724,
-0.21946804225444794,
0.42070165276527405,
0.5104146599769592,
-0.3718116879463196,
-0.7714210152626038,
-0.36588308215141296,
0.639065682888031,
-0.2805026173591614,
0.4446744322776794... | |
to do this, though... | [
0.21947653591632843,
0.30071917176246643,
-0.16095860302448273,
0.15654148161411285,
0.058853015303611755,
-0.1266910284757614,
0.03695576637983322,
-0.1848573088645935,
0.18244852125644684,
-0.5345728397369385,
0.2585408389568329,
0.24609588086605072,
0.14996546506881714,
-0.0093376431614... | |
I'm a PHP developer learning Ruby on Rails by reading [Michael Hartl's tutorial](http://ruby.railstutorial.org/ruby-on-rails-tutorial-book). Here is a quote from the book, referring to `csrf_meta_tag`:
> ...the Rails method `csrf_meta_tag` [prevents] cross-site request
> forgery (CSRF), a type of malicious web attack... | [
0.45228639245033264,
0.38889339566230774,
-0.2223551869392395,
-0.09683414548635483,
-0.28842079639434814,
-0.16481733322143555,
0.49128255248069763,
-0.1990812122821808,
-0.1959620714187622,
-0.4367694854736328,
0.14685185253620148,
0.2728237211704254,
-0.2942325174808502,
0.1230848357081... | |
aren't tied to a form an easy way of getting the token.
If you use the [jquery-ujs](https://github.com/rails/jquery-ujs) library the content of that meta tag is automatically added (as a request header) to any ajax requests made. | [
0.5089011192321777,
-0.2230878323316574,
0.5303585529327393,
0.22756312787532806,
-0.29034966230392456,
-0.14693959057331085,
0.23332616686820984,
-0.1092018410563469,
-0.15234585106372833,
-0.5617402791976929,
-0.200614333152771,
0.3366013765335083,
-0.24395635724067688,
-0.00839408207684... | |
I'm securing my MVC controllers with `AuthorizeAttributes`. Is there a way to instantiate those classes on its own?
At the moment I have an `AuthorizedAdmin` and a `IsAdmin` class which does the same. So ideally the `IsAdmin` should use the `AuthorizedAdmin` class. Is there a way to do that?
I'm asking because the `A... | [
0.1413402259349823,
-0.054428886622190475,
0.6464270353317261,
0.18539714813232422,
0.25246188044548035,
-0.25245311856269836,
0.06830547004938126,
-0.3630341589450836,
-0.09274287521839142,
-0.45311468839645386,
-0.22810719907283783,
0.7698086500167847,
-0.3390626907348633,
-0.05719091370... | |
hand the `IsAdmin` class is more complex and duplicates functionality.
Thanks
Sure, you can instantiate `AuthorizeAdmin` and call `OnAuthorization` on it. It will be messy to work with the `AuthorizationContext` though. Why not flip this around... put your business logic in `IsAdmin` and have `AuthorizedAdmin` use tha... | [
0.3293720483779907,
0.21390056610107422,
0.32972052693367004,
0.297334760427475,
0.2259698063135147,
-0.4264180064201355,
0.11645955592393875,
-0.18053600192070007,
-0.06574957817792892,
-0.23788140714168549,
0.2997082769870758,
0.5084105134010315,
-0.2329322248697281,
0.042375557124614716... | |
I have an array in jQuery, and I need to count the number of "true" strings in that array, and then make the "numOfTrue" variable equal the number of true strings. So in the below array, there are 2 "true" strings, so numOfTrue would be equal to 2.
```
var numOfTrue;
var Answers = [ "true", "false", "false", "true", "... | [
0.01624084822833538,
-0.01965457573533058,
0.19229482114315033,
-0.003581591183319688,
-0.2351527214050293,
0.022339634597301483,
0.5317374467849731,
-0.6048331260681152,
-0.01370150875300169,
-0.30984044075012207,
0.14375999569892883,
0.5917072892189026,
-0.21532811224460602,
-0.101888068... | |
if(Answers[i] === "true")
numOfTrue++;
}
```
or, a `reduce`
```
var numOfTrue = Answers.reduce((acc,curr) => {
if(curr === "true")
acc++;
return acc;
},0);
```
or a `filter`
```
var numOfTrue = Answers.filter(x => x === "true").length;
``` | [
-0.5088235139846802,
-0.37687286734580994,
0.2796758711338043,
0.12921865284442902,
-0.07973528653383255,
0.17348335683345795,
-0.043377142399549484,
-0.5462929606437683,
-0.05089235305786133,
-0.624302864074707,
-0.45562535524368286,
0.5294508934020996,
-0.16870366036891937,
0.08783099800... | |
My program (C++ on Solaris 10) writes output via wcout to its terminal when it is started from a shell. But when I execute it from within Sun Studio or the file manager is does not have a terminal and the ouput appears in the Sun Studio output window or nowhere at all.
I would like it to open its own terminal window i... | [
0.23044414818286896,
0.13649882376194,
0.48837390542030334,
-0.35602006316185,
-0.13792136311531067,
0.06666254252195358,
0.0757245421409607,
0.10157623142004013,
0.03520481660962105,
-0.856128454208374,
-0.19325050711631775,
0.7640107870101929,
-0.32918301224708557,
-0.1045590490102768,
... | |
shell or script. Because then execution in the Studio IDE and double-click in the file manager would still have the same effect.
Being a Windows programmer that seems quite natural to me but I could not find out how this is done in my Unix books nor in the web. Am I requesting the wrong thing, is it really so hard to ... | [
0.4616830050945282,
0.11275987327098846,
0.13571584224700928,
-0.03244626522064209,
-0.12847267091274261,
-0.3126518428325653,
0.1070990338921547,
0.1827118694782257,
-0.06150142848491669,
-0.48463085293769836,
-0.01367049291729927,
0.9347556829452515,
-0.26938965916633606,
0.1175816506147... | |
so.
* Before the intended output, a number is output. Again, I have no idea why.
* I don't seem to be able to redirect input.
Maybe someone else know how to fix those bugs (and any others I might not have noticed).
```
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <iostream>
... | [
-0.12236630916595459,
0.006579509470611811,
0.7296714186668396,
-0.4935573637485504,
0.4322333037853241,
0.21271711587905884,
0.40254542231559753,
-0.34471502900123596,
-0.30149462819099426,
-0.598426342010498,
-0.33927232027053833,
0.5474786162376404,
-0.618826687335968,
0.022448007017374... | |
close(pt);
return EXIT_FAILURE;
}
if (unlockpt(pt) == -1)
{
std::cerr << "Could not get pseudo terminal device name.\n";
close(pt);
return EXIT_FAILURE;
}
std::ostringstream oss;
oss << "xterm -S" << (strrchr(ptname, '/')+1) << "/" << pt << " &";
system(oss.str().c_str());
int xterm_f... | [
-0.2668018043041229,
0.0026417537592351437,
1.0245599746704102,
-0.4936629831790924,
0.469578355550766,
0.23229537904262543,
0.35901522636413574,
-0.2587747573852539,
0.09558951109647751,
-0.32214099168777466,
-0.6564091444015503,
0.5459808111190796,
-0.4360913634300232,
0.4140626192092895... | |
}
if (dup2(pt, 2) <0)
{
std::cerr << "Could not redirect standard error output.\n";
close(pt);
return EXIT_FAILURE;
}
std::cout << "This should appear on the xterm." << std::endl;
std::cerr << "So should this.\n";
std::cin.ignore(1);
close(pt);
return EXIT_SUCCESS;
}
``` | [
-0.06439851969480515,
-0.04773787409067154,
0.49723973870277405,
-0.3799188435077667,
0.43661749362945557,
-0.09548860788345337,
0.3424387276172638,
-0.1708139330148697,
-0.10754416137933731,
-0.3842436969280243,
-0.41000786423683167,
0.6331920623779297,
-0.5750623941421509,
0.320967882871... | |
jsFiddle : <http://jsfiddle.net/loren_hibbard/ChXbr/>
I'm trying to use the jQuery UI dialog box, but cannot figure out how to make it `fadeIn` when it appears and `fadeOut` when it is closed.
If I do something like this...
```
// Dialog
$('#dialog').dialog({
autoOpen: false,
width: 600,
modal: t... | [
0.20364399254322052,
-0.17455200850963593,
0.9345200061798096,
-0.25869661569595337,
-0.3409026861190796,
-0.17434139549732208,
0.1331409066915512,
-0.1648133248090744,
0.10182484984397888,
-0.7909383773803711,
-0.33908435702323914,
0.3373579978942871,
-0.2201002836227417,
-0.0662590637803... | |
materializes ( <http://www.bennadel.com/resources/presentations/jquery/demo5/index.htm> ).
Also, is there anyway to make the modal overlay a bit darker? And how come when I delete the paragraph of seemingly unrelated text, the modal stops working?
Try this:
```
$("#dialog").dialog({
autoOpen: false,
show: {
... | [
0.3413429260253906,
-0.28238391876220703,
0.9226143956184387,
-0.22462327778339386,
0.011247395537793636,
-0.09293368458747864,
0.8905952572822571,
-0.14976206421852112,
-0.04184092953801155,
-1.026031494140625,
-0.2557891011238098,
0.19874192774295807,
-0.3620799779891968,
0.1421710997819... | |
code. BTW, in your example you have modal set to both true and false. | [
0.5187438726425171,
-0.03793838247656822,
-0.29761257767677307,
0.028788616880774498,
-0.2465759515762329,
-0.04381363093852997,
0.655214250087738,
-0.1282961368560791,
0.01840750128030777,
-0.4257309138774872,
-0.23041927814483643,
0.6741795539855957,
-0.14917907118797302,
-0.145963281393... | |
Assuming that we have:
```
http.HandleFunc("/smth", smthPage)
http.HandleFunc("/", homePage)
```
User sees a plain "404 page not found" when they try a wrong URL. How can I return a custom page for that case?
**Update concerning gorilla/mux**
Accepted answer is ok for those using pure net/http package.
If you use... | [
0.1630874127149582,
0.012460834346711636,
0.4070190489292145,
-0.13777290284633636,
0.06241084262728691,
-0.17715398967266083,
0.3179013133049011,
-0.24933399260044098,
-0.42182308435440063,
-0.5490405559539795,
-0.3201184570789337,
0.743134617805481,
-0.5058387517929077,
0.078848734498023... | |
http.ListenAndServe(":12345", nil)
}
func homeHandler(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
errorHandler(w, r, http.StatusNotFound)
return
}
fmt.Fprint(w, "welcome home")
}
func smthHandler(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/smth/" {... | [
-0.36616626381874084,
0.2147485911846161,
0.6798228025436401,
-0.3444431722164154,
0.03131595626473427,
0.09322384744882584,
0.4328078627586365,
-0.3069564700126648,
-0.04587453976273537,
-0.6238533854484558,
-0.7078501582145691,
0.5719873309135437,
-0.09694525599479675,
0.1659248471260070... | |
== http.StatusNotFound {
fmt.Fprint(w, "custom 404")
}
}
```
Here I've simplified the code to only show custom 404, but I actually do more with this setup: I handle all the HTTP errors with `errorHandler`, in which I log useful information and send email to myself. | [
0.4004858732223511,
0.3137660026550293,
0.08920501172542572,
-0.24668367207050323,
0.32193392515182495,
-0.03568831831216812,
0.5201240181922913,
-0.11036279797554016,
-0.16700217127799988,
-0.5359349846839905,
0.1950557827949524,
0.8422713279724121,
-0.11089765280485153,
-0.00608204118907... | |
I need to represent huge data(37 columns,1000+ rows) in web. I would like to fix header row of this table and then manipulate data accordingly.
There are lots of possible solutions in web, some of them depends on css and some depends on javascript.
I have tried lots of them, and each time I ve stucked at the same p... | [
0.2974661588668823,
-0.008447944186627865,
0.1981528401374817,
0.02375355362892151,
-0.13869896531105042,
0.1332884132862091,
0.015127339400351048,
-0.09570609033107758,
-0.48837918043136597,
-1.1458947658538818,
0.4396987557411194,
0.41249826550483704,
-0.30234846472740173,
0.083650261163... | |
suggestions?
I m begginer to html and css, any help would be appreciated.
Thank you in advance!
i have some experience in this and i can give you some thoughts/ pointers:
* easiest way to do this is to set table style to fixed, then you can change column widths with css and they will stay that wide regardless of co... | [
0.43906113505363464,
0.038613785058259964,
0.2338702380657196,
0.2303839474916458,
-0.1889449954032898,
0.07489921897649765,
0.034802038222551346,
-0.03505032882094383,
0.16903983056545258,
-0.8279044032096863,
0.10942350327968597,
0.3684936761856079,
-0.06402779370546341,
0.00381172983907... | |
into a table above the table
* set the width of the new header's table to the width of original table
* set the outerwidth of each cell in the new table to the outer width of the same header cell in the original table
also, none of the solutions for doing this seem to be good. i found that writing a custom solution is... | [
0.3061215877532959,
-0.06047654524445534,
0.2752649188041687,
0.1793874204158783,
-0.02539975754916668,
0.06438954919576645,
0.47996559739112854,
-0.20591244101524353,
-0.1867893636226654,
-0.7454179525375366,
0.27737271785736084,
0.3130466341972351,
-0.3599720001220703,
0.1854919791221618... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.