text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I need to get the path of the extension installed directory from JavaScript.
My goal is to write to a JSON file within the extension directory from a Firefox extension. In order to do that, I need to determine the directory in which the extension is installed within the Firefox profile.
I use this code:
```
functio... | [
0.5445401668548584,
0.2710101902484894,
0.700789213180542,
-0.5340670347213745,
0.3730548024177551,
-0.0342438705265522,
0.16241572797298431,
-0.5764175057411194,
-0.12160512059926987,
-0.8207978010177612,
-0.2541506886482239,
0.8181081414222717,
-0.5943036079406738,
0.09892156720161438,
... | |
.getInstallLocation(id)
.getItemLocation(id);
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(ext.path);
file.append("config.json");
var foStream = | [
0.15182273089885712,
-0.42289745807647705,
0.7227796316146851,
0.1729748696088791,
0.055551692843437195,
0.27602729201316833,
0.40607360005378723,
-0.18221625685691833,
-0.4078226089477539,
-0.7708587646484375,
-0.30196064710617065,
0.663867712020874,
-0.6706668138504028,
0.118691354990005... | |
Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream);
foStream.init(file, 0x02 | 0x08 | 0x20, 0666, 0);
var data = '[ {"id" : "2"} ]';
foStream.write(data, data.length);
foStream.close();
```
It thro... | [
0.2522508203983307,
-0.06048627197742462,
0.5945152044296265,
-0.09580597281455994,
0.06870613992214203,
0.059672631323337555,
0.29778966307640076,
-0.3539502024650574,
-0.10156986862421036,
-0.8554915189743042,
-0.1375756412744522,
0.6843327283859253,
-0.6588478684425354,
0.21284458041191... | |
extensions with no luck.
---
Thanks very much for your replies. It didn't let me solve my problem instantly anyway but it forced me to reading Mozilla documentation. I finally got a hang of how it works. Thanks again.
**Solution to the question above:**
```
Components.utils.import("resource://gre/modules/Addon... | [
0.3170669376850128,
-0.13509559631347656,
0.820997416973114,
-0.14725424349308014,
-0.04851299151778221,
0.13068340718746185,
0.227929025888443,
-0.46643316745758057,
-0.5776898860931396,
-0.7373934984207153,
-0.4747548997402191,
0.5963296294212341,
-0.43601560592651367,
0.2501944005489349... | |
= uri.asciiSpec;
stringUri = stringUri.replace(new RegExp(/\//g), '\\');
stringUri = stringUri.slice(8);
alert(stringUri);
file.initWithPath(stringUri);
alert(addon.hasResource("config.json"));
var stream = FileUtils.openFileOutputStream(file,
Fil... | [
0.3012171685695648,
-0.6275001764297485,
0.6086640357971191,
-0.33234119415283203,
0.2984065115451813,
0.087783582508564,
0.40996113419532776,
-0.13331860303878784,
-0.24344132840633392,
-0.6404219269752502,
-0.5362613201141357,
0.6227637529373169,
-0.55720055103302,
0.11883563548326492,
... | |
| FileUtils.MODE_CREATE
| FileUtils.MODE_TRUNCATE);
stream.write(dataToWrite, dataToWrite.length);
stream.close();
```
Starting with Firefox 4 you should be using the | [
0.16647055745124817,
-0.09883809834718704,
0.935099720954895,
-0.2501344382762909,
0.23613572120666504,
-0.44112616777420044,
0.44181230664253235,
-0.22503745555877686,
-0.136674702167511,
-0.4517165422439575,
-0.12974563241004944,
0.8985880017280579,
-0.6196494698524475,
0.182493597269058... | |
[Add-on Manager API](https://developer.mozilla.org/en/Addons/Add-on_Manager/AddonManager):
```js
Components.utils.import("resource://gre/modules/AddonManager.jsm");
AddonManager.getAddonByID(id, function(addon)
{
var uri = addon.getResourceURI("config.json");
if (uri instanceof Components.interfaces.nsIFileURL)
... | [
0.05108998343348503,
-0.21272504329681396,
0.6059242486953735,
-0.27522918581962585,
0.09511815756559372,
-0.015586628578603268,
0.19114714860916138,
-0.5379309058189392,
-0.43321746587753296,
-0.7957146167755127,
-0.677517831325531,
0.6898422241210938,
-0.45166417956352234,
0.266565531492... | |
A better idea might be writing to a file in the profile directory, then you won't need to sacrifice performance.
Writing to a file can be simplified using [FileUtils.jsm](https://developer.mozilla.org/en/JavaScript_code_modules/FileUtils.jsm):
```js
Components.utils.import("resource://gre/modules/FileUtils.jsm");
va... | [
0.3560359477996826,
-0.2901320457458496,
0.3639553487300873,
0.03735611215233803,
-0.029538294300436974,
-0.1297493278980255,
0.3522188067436218,
-0.38008594512939453,
-0.08559253066778183,
-1.001971960067749,
-0.12450537830591202,
0.7344281673431396,
-0.22072811424732208,
-0.1187820956110... | |
I want to reset the background image of a textbox when it receives focus. How can I do this?
This is pretty simple, if you know about the `sign` function...
```
which(diff(sign(df))!=0)
# [1] 2
``` | [
0.44561731815338135,
0.14183665812015533,
0.3874591588973999,
-0.3047260046005249,
0.15076565742492676,
0.020788921043276787,
0.3018706738948822,
-0.13991235196590424,
0.06975023448467255,
-0.6139103174209595,
-0.01508310530334711,
0.8439725637435913,
-0.3872491419315338,
-0.26626530289649... | |
I was wondering what are the general benefits (or drawbacks) of using a non-static class with a static method versus a static class with the same static method, *other than* the fact that I cannot use static methods from a non-static class as extension methods.
For example:
```
class NonStaticClass
{
public stati... | [
0.1445935219526291,
-0.4140564203262329,
0.11148469150066376,
-0.10425791889429092,
0.03858291730284691,
-0.08514299988746643,
0.08451488614082336,
0.061307068914175034,
-0.29237571358680725,
-0.06057371944189072,
-0.17364045977592468,
0.7843372225761414,
-0.41326776146888733,
0.1606453955... | |
was invoked from a static class.";
}
}
```
What are the performance/memory implications of using one method over another?
**NOTE:** Suppose that I do not need to instantiate the class. My use-case scenario is limited to something like this:
```
Console.WriteLine(NonStaticClass.GetData());
Console.WriteLine(Stat... | [
-0.18129993975162506,
-0.19883733987808228,
0.3278481662273407,
-0.06073801964521408,
-0.074942946434021,
-0.19191297888755798,
0.31903865933418274,
0.10204596072435379,
-0.17006130516529083,
-0.25011947751045227,
-0.18750078976154327,
0.7618020176887512,
-0.5347402691841125,
0.13367097079... | |
notion of `static`. A static class is both `abstract` and `sealed`, which effectively prevents inheritance and instantiation.
As for performance, I don't see any possiblities for compiler or runtime to optimize one over the other.
In this example, I would focus on expressing your intent as clear as possible to the ... | [
0.010241330601274967,
-0.13287273049354553,
-0.09223601222038269,
0.2640422582626343,
-0.2565687894821167,
-0.28515586256980896,
0.34595200419425964,
0.31910058856010437,
0.0005952409701421857,
-0.367241233587265,
-0.21620413661003113,
0.5242369771003723,
-0.2911253869533539,
0.51170349121... | |
The following code is not compiling in Java:
java version "1.6.0\_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (suse-3.1-x86\_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
```
public class XOR
{
public static void main(String[] args)
{
long one = 595082963178094600000L;
}
}
```
... | [
0.1539655178785324,
0.11148128658533096,
0.6268763542175293,
-0.2981703281402588,
0.16370940208435059,
0.060579586774110794,
0.42880409955978394,
-0.03349684923887253,
-0.2988312542438507,
-0.20198363065719604,
-0.07874628901481628,
0.3596315383911133,
-0.4005632698535919,
0.56412076950073... | |
}
}
```
This throws:
```
java.lang.NumberFormatException: For input string: "595082963178094600000"
```
What am I doing wrong?
Well, maybe because it *is* `too large`?
```
595082963178094600000 //your value
9223372036854775807 //Long.MAX_VALUE
```
You will need either `BigInteger` or `BigDecimal`:
```
new ... | [
-0.18344002962112427,
0.0749645084142685,
0.2535088360309601,
-0.15223856270313263,
0.33282411098480225,
0.006030513904988766,
0.24310387670993805,
-0.09131073951721191,
-0.4488219618797302,
-0.39500051736831665,
0.009788828901946545,
0.7019613981246948,
-0.31474122405052185,
0.37574532628... | |
```
private void launchEventPanel(String title) {
EventQueue.invokeLater(new Runnable(title) {
public void run() {
JFrame myFrame = new JFrame();
myFrame.setTitle(this.val$title);
myFrame.setIconImage(CrConference.this.mainCore.myPanel.myIconManager.getPromptIcon(Mart.cla... | [
0.345135360956192,
-0.11125251650810242,
0.41939085721969604,
-0.1458185613155365,
0.398288369178772,
-0.1807660311460495,
0.24378027021884918,
-0.02237340621650219,
-0.10119552910327911,
-0.34706640243530273,
-0.6025339961051941,
0.5610207915306091,
-0.24419093132019043,
0.371657431125640... | |
}
});
}
```
i got some code that i am trying to compile and understand. help highly appreciated
This line:
```
myFrame.setTitle(this.val$title);
```
Is simply setting the title of a `JFrame` object, using the value of the attribute `val$title` for doing so. `val$title` is an instance attribute of the current c... | [
0.26125630736351013,
0.11148746311664581,
0.31856387853622437,
-0.11522985994815826,
0.07682632654905319,
-0.5233443379402161,
0.11318350583314896,
0.04551286995410919,
0.09843115508556366,
-0.6877533197402954,
-0.21419574320316315,
0.37243106961250305,
-0.13099230825901031,
0.500947117805... | |
Maybe is a dumb question, but I can't find the proper function:
I have a string date like `04/05/2012`
How I can pass to this format: `2012-04-05 20:18:11` to insert in mySQL?
Combination of date and strtotime ...
```
$my_date = date('Y-m-d H:i:s',strtotime('04/05/2012'));
``` | [
0.13287436962127686,
0.23272253572940826,
0.540428102016449,
0.04751717299222946,
0.07302229106426239,
-0.04202398285269737,
0.13719341158866882,
0.43733686208724976,
0.14711813628673553,
-0.5267000794410706,
0.27427956461906433,
-0.03372830152511597,
0.10465175658464432,
0.526461958885192... | |
I am trying to setup mutual authentication SSL connection between java host and android client. Don't know why its not getting connected. Below are the code of Android client app and Java server.
Client code:
```
private SSLContext createSSLContext(final Context cont){
SSLContext ssl_cont = null;
try {
... | [
0.2404136210680008,
0.08660822361707687,
0.6279980540275574,
-0.27605536580085754,
0.09711284190416336,
0.08165285736322403,
0.8764027953147888,
-0.5000405311584473,
0.27712783217430115,
-0.8611936569213867,
-0.17909251153469086,
0.5075615048408508,
-0.31540194153785706,
-0.028496857732534... | |
trustStore.load(trustStoreStream, "client".toCharArray());
trustManagerFactory.init(trustStore);
Log.d(TAG, "TrustStore - Initialized");
// Setup keystore
Log.d(TAG, "KeyStore - Initializing");
KeyStore keyStore = KeyStore.getInstance("BKS");
KeyManagerFactory keyManager... | [
0.14840909838676453,
-0.26341965794563293,
0.4798811674118042,
0.08495887368917465,
0.21446144580841064,
-0.020223993808031082,
0.8377017974853516,
-0.747631311416626,
0.08895809203386307,
-0.6831611394882202,
-0.21106015145778656,
0.7974237203598022,
-0.28374069929122925,
-0.0038761361502... | |
Log.d(TAG, "KeyStore - Initialized");
ssl_cont = SSLContext.getInstance("TLS");
ssl_cont.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null);
} catch (Exception e) {
// TODO Auto-generated catch block
alertbox("SSLClient", "ERROR: " + e.getMessage... | [
-0.1522926688194275,
-0.41745203733444214,
0.4193740487098694,
-0.21519766747951508,
0.2825256288051605,
0.016456175595521927,
0.5801469087600708,
-0.3438914716243744,
-0.2734054923057556,
-0.5612238645553589,
-0.5519759058952332,
0.5924596786499023,
-0.48174774646759033,
0.196712478995323... | |
// TODO Auto-generated method stub
try {
// Setup the SSL context to use the truststore and keystore
Log.d(TAG, "Started..");
SSLContext ssl_context = createSSLContext(cont);
Log.d(TAG,"here 1...");
SSLSocketFactory socketFactory = (SSLSocketFactory) s... | [
0.11441171914339066,
-0.3267306685447693,
0.26176735758781433,
-0.3477533161640167,
0.13552533090114594,
0.062419138848781586,
0.8447402119636536,
-0.5021548867225647,
0.2895895540714264,
-0.6074805855751038,
-0.25860533118247986,
0.5456017255783081,
-0.4694623649120331,
-0.018576160073280... | |
Log.d(TAG,"here 2...");
socket = (SSLSocket) socketFactory.createSocket(ipadd.getText().toString().trim(), Integer.parseInt(port.getText().toString().trim()));
Log.d(TAG,"here 3...");
dataOut = new DataOutputStream(socket.getOutputStream());
dataIn = new DataInputStream(s... | [
-0.2094581127166748,
-0.36180320382118225,
0.6215206980705261,
-0.16776028275489807,
0.0792931541800499,
0.3486759662628174,
0.48402100801467896,
-0.1819583922624588,
-0.3060931861400604,
-0.9318966865539551,
-0.47593972086906433,
0.44116681814193726,
-0.37928998470306396,
0.20317195355892... | |
Log.d(TAG, "Completed..");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
msgin.setText("Not connected");
alertbox("Main", "ERROR: " + e.getMessage());
Log.d(TAG, "ERROR: " + e.getMessage());
} | [
-0.14754943549633026,
-0.48234647512435913,
0.2188715934753418,
-0.18476472795009613,
0.3454330861568451,
-0.12219306826591492,
0.3998778164386749,
-0.271375834941864,
-0.23002615571022034,
-0.21998563408851624,
-0.552693247795105,
0.3868977129459381,
-0.5172515511512756,
0.015118125826120... | |
}
};
```
Server code:
```
try {
mySSLServerFac = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
mySSLServerSocket = (SSLServerSocket) mySSLServerFac.createServerSocket(9999);
System.out.println("Listening on 9999\n");
mySSLSocket = (SSLSocket) mySSLServerSocket.acce... | [
-0.1619209200143814,
-0.11906876415014267,
0.8842648267745972,
-0.04364917799830437,
0.30748194456100464,
0.24124211072921753,
0.6017318367958069,
-0.32402122020721436,
-0.14724132418632507,
-0.785271942615509,
-0.3366996645927429,
0.9060066342353821,
-0.4505396783351898,
0.223734691739082... | |
System.out.println("Remote IP Address : " + mySSLSocket.getInetAddress());
msg = input.readUTF().toString();
System.out.println(msg);
java.util.Scanner sc = new java.util.Scanner(System.in);
output.writeUTF(sc.nextLine());
}while(msg != "exit");
System.out... | [
-0.58680659532547,
-0.40502485632896423,
0.7556296586990356,
-0.4199647903442383,
0.32344213128089905,
0.10470028221607208,
0.4640163481235504,
-0.13479472696781158,
-0.4696311056613922,
-0.7550123333930969,
-0.63718581199646,
0.09389148652553558,
-0.4895332455635071,
0.4345806837081909,
... | |
} catch (Exception e) {
e.printStackTrace();
}
```
I am stuck with "No cipher suites in common" error at server. Since i am nowhere in SSL connection setup. Let me help if you find out the bug or major problem.
Here is the [link](http://blog.callistaenterprise.se/2011/11/24/creating-self-signed-certifica... | [
0.3430721163749695,
0.29943376779556274,
0.4438464641571045,
-0.1824013888835907,
0.1638192981481552,
-0.40546539425849915,
0.707577645778656,
-0.07330264896154404,
-0.18752464652061462,
-0.7709193825721741,
-0.19787219166755676,
0.5097399950027466,
-0.37997913360595703,
0.1837151348590850... | |
possible.
Thanks in advance.
It's solved ! Problem was with the truststore of java host, followed [this](https://stackoverflow.com/questions/9548807/sslhandshakeexception-no-cipher-suites-in-common) post.
The trustStore needs to be specified for client/server as they are using the default trustStore, causing failure... | [
-0.05606040731072426,
0.1550777554512024,
0.5913549065589905,
-0.08338040858507156,
0.11594080179929733,
-0.5038712620735168,
0.8022388219833374,
-0.6109780073165894,
-0.015841681510210037,
-0.7736247777938843,
0.017244087532162666,
0.6416159272193909,
-0.21722064912319183,
0.1256815642118... | |
Does anyone know how to align these jquery buttons without using `float:left`?
This problem occurs when `<button>` and any other elements like `<a>` are used:
<http://jsbin.com/afixij/edit#javascript,html,live>
Same problem is also on jquery's website:
<http://jqueryui.com/demos/button/#default>
It's solved ! Probl... | [
0.13312874734401703,
0.08864375948905945,
0.7023494243621826,
-0.06829080730676651,
-0.0038833131548017263,
-0.30786392092704773,
0.5357813835144043,
-0.5661553740501404,
-0.09164060652256012,
-0.5991270542144775,
0.17326924204826355,
0.6795591711997986,
-0.08502746373414993,
-0.0283635593... | |
creating sslsession and multi-threaded programming. | [
0.04017486423254013,
-0.013147656805813313,
-0.12036801874637604,
0.24074386060237885,
-0.17916837334632874,
-0.26828157901763916,
-0.06115367263555527,
-0.16187146306037903,
-0.2516929507255554,
-0.5936254858970642,
-0.23151233792304993,
0.2638869285583496,
-0.5062007904052734,
-0.1718626... | |
I'm getting a list of IListBlobItems using `CloudBlobContainer.ListBlobs`. I'm then looping over each entry to show the size of the blob using the following code:
```
foreach (IListBlobItem item in blobs)
{
if (item.GetType() == typeof(CloudBlobDirectory))
{ }
else i... | [
0.005630424711853266,
-0.040810853242874146,
0.7634782791137695,
-0.20618107914924622,
0.12097270786762238,
0.1757715344429016,
-0.00008935466030379757,
-0.1212770938873291,
-0.3825156092643738,
-0.8428816795349121,
-0.07282465696334839,
0.19137321412563324,
-0.5539106726646423,
0.35612413... | |
{
CloudBlockBlob blockBlob = (CloudBlockBlob)item;
IEnumerable<ListBlockItem> blocks = blockBlob.DownloadBlockList(new BlobRequestOptions { BlobListingDetails = BlobListingDetails.All });
Console.WriteLine(blockBlob.Name.PadRight(50, ' ') +
blocks.Sum(... | [
-0.3030596971511841,
-0.26925212144851685,
1.0142849683761597,
-0.011835216544568539,
0.3557221591472626,
0.23469087481498718,
0.26008284091949463,
-0.29731249809265137,
-0.305606871843338,
-0.6933912634849548,
-0.49704664945602417,
0.505891740322113,
-0.2206452190876007,
0.143538504838943... | |
else
{
Console.WriteLine(item.Uri.LocalPath);
}
}
```
However, when I check the count on the variable `blocks`, it is always 0. Why is that?
I believe (not 100% sure) that `DownloadBlockList()` is only valid if the blob was initially uploaded in blocks, rather than all... | [
0.22331811487674713,
-0.014467379078269005,
0.5283035635948181,
-0.1625518500804901,
0.129010409116745,
-0.2016238570213318,
0.14573778212070465,
0.11549733579158783,
-0.32097819447517395,
-0.5801362991333008,
-0.13104015588760376,
0.35688844323158264,
-0.29372045397758484,
0.3441999554634... | |
you get no blocks back.
In any case, you seem to only want the total size of the blob anyway. So using the `blob.Properties.Length` property may be an easier approach:
```
CloudBlockBlob blockBlob = (CloudBlockBlob)item;
blockBlob.FetchAttributes();
Console.WriteLine(blockBlob.Name.PadRight(50, ' ') + blockBlob.Prope... | [
-0.15658757090568542,
-0.2610768675804138,
0.74723219871521,
-0.024377288296818733,
0.10426102578639984,
0.03608628362417221,
0.05126449465751648,
-0.2508871853351593,
-0.5955653786659241,
-0.6578224897384644,
-0.36779290437698364,
0.3887961208820343,
-0.19299949705600739,
0.21828982234001... | |
I recently asked this question [Posting data with curl - actually refreshing to the next page](https://stackoverflow.com/questions/9999741/posting-data-with-curl-actually-refreshing-to-the-next-page) but I soon realized that the solution wasn't exactly great...
So I'm passing data between PHP pages in several places. ... | [
-0.005558775272220373,
0.1321207582950592,
0.7255393266677856,
-0.26601430773735046,
-0.22628678381443024,
-0.21982643008232117,
0.46250274777412415,
0.06309547275304794,
-0.3322543799877167,
-0.6162191033363342,
-0.04702387750148773,
0.5934399366378784,
0.02591080777347088,
-0.09352249652... | |
since this is a 'header' on each page, it needs to be generic. For example, any post or get data sent to it (from another page, or a form) should be sent to the redirected page.
Get is easy because I can include it in the url, but I've been having problems with Post.
I started with cURL to send Post data to the next ... | [
0.18158064782619476,
0.1298263669013977,
0.6717013120651245,
-0.09416019171476364,
-0.29557493329048157,
-0.24432820081710815,
0.37688377499580383,
-0.12459959089756012,
-0.06389583647251129,
-0.5065228939056396,
-0.5053244233131409,
0.22046257555484772,
-0.6367413997650146,
0.195040404796... | |
and I soon realized that it wasn't such a great solution;
1. When redirecting, if I set the Post data to the Session variable (store the data), then each page that uses Post data needs to check if the data is in Post or Session.
2. It's not efficient - I'm sending data between two pages, not necessarily information ab... | [
0.047944046556949615,
-0.05721752345561981,
0.3524681329727173,
-0.10198778659105301,
-0.30387401580810547,
0.12466112524271011,
0.47911468148231506,
-0.12433939427137375,
-0.44177693128585815,
-0.5070437788963318,
0.09487917274236679,
0.3355221748352051,
-0.3439992070198059,
0.31699606776... | |
Example:**
I have a registration page that sends the form data to the validation page. Both of these has the header to check if cookies are enabled.
Post data is sent to the validation page, and if there is a problem, I can't post data back to the validation page (telling the user what were the problems), I've got to ... | [
0.5434756875038147,
0.4611296057701111,
0.13661395013332367,
0.03679655119776726,
-0.1423097401857376,
-0.07995052635669708,
0.4514528810977936,
-0.14719782769680023,
-0.3070937395095825,
-0.39722543954849243,
0.09978283941745758,
0.34056466817855835,
-0.2526859641075134,
0.043899416923522... | |
will add later.
**Back to the problem**
1. I need to check if cookies are enabled on each page.
2. I don't know if
my current application is the most efficient way (redirecting); it's
certainly caused a lot of problems
3. If anyone can tell me how to
check cookies without redirecting (and doesn't conflict with
anythi... | [
0.29342567920684814,
0.1112978458404541,
0.4984055459499359,
0.1634969413280487,
-0.2857635021209717,
-0.051158104091882706,
0.5426000952720642,
-0.09590256214141846,
-0.4401124119758606,
-0.7371737360954285,
0.1274268627166748,
0.6415536403656006,
-0.10961095988750458,
-0.1288373172283172... | |
know it's a big task, but if anyone could help it'd be greatly appreciated!
If all the intermediary page is doing is validating form data, scrap it; just do it in the same PHP script. At the simplest, you can have:
```
<?php
$yourkey = 'goeshere';
if (!isset($_COOKIE[$yourkey])) {
setcookie($yourkey, $... | [
0.14742428064346313,
-0.09901342540979385,
0.517219066619873,
0.1437743902206421,
0.13477823138237,
-0.45730090141296387,
0.6176139116287231,
-0.34885093569755554,
-0.034013532102108,
-0.6023468971252441,
-0.24244779348373413,
0.43911346793174744,
-0.20818406343460083,
-0.06828992813825607... | |
// iterate over your fields and add any errors to $errors array
if (empty($errors)) {
// redirect if there are no errors, if you really need to
header('Location: success.php');
exit;
}
}
?>
<html>
<body>
<form method="post" action="">
<label for="name"... | [
0.23186235129833221,
-0.129966139793396,
0.33415696024894714,
0.025793474167585373,
0.20377664268016815,
0.0002726596430875361,
0.4795948565006256,
-0.48934265971183777,
-0.1020343005657196,
-0.5943129658699036,
-0.10109253972768784,
0.4141591787338257,
-0.11929267644882202,
-0.20592828094... | |
<input type="text" name="name" value="<?php echo isset($_POST['name']) ? $_POST['name'] : ''; ?>" id="name" />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
```
There is an XSS vulnerability `echo`ing POST data in your HTML page, but I'll leave that up to you to secure. | [
0.26397669315338135,
0.1927500069141388,
0.1590333878993988,
-0.1008400022983551,
-0.21758754551410675,
0.03134962171316147,
0.783048689365387,
-0.47056707739830017,
0.09637822210788727,
-0.5408219695091248,
-0.2771301567554474,
0.15224412083625793,
-0.419611394405365,
-0.01643061451613903... | |
I have a wcf service which is used to upload and download large files to server. I'm using MTOM message encoding and I want to use streamed transfer mode. But we are using wsFederationHttpBinding. How do I support streaming in wsFederationHttpBinding?
My WCF Service web.config code is given below,
```
<wsFederationH... | [
0.16417112946510315,
0.11770565062761307,
0.6689221262931824,
-0.22416262328624725,
-0.15300261974334717,
-0.13784341514110565,
0.011983988806605339,
-0.3058203458786011,
-0.5499303340911865,
-0.8509140610694885,
-0.03826348856091499,
0.37885934114456177,
-0.38891804218292236,
0.1417931318... | |
maxReceivedMessageSize="2147483647" >
<readerQuotas maxStringContentLength="2147483647"
maxDepth="2147483647"
maxBytesPerRead="2147483647"
maxArrayLength="2147483647"/>
<security mode="TransportWithMessageCredential"> | [
-0.4164166748523712,
-0.2811059355735779,
0.3894721567630768,
0.30291688442230225,
0.31522083282470703,
-0.049140650779008865,
0.27331721782684326,
0.04428332298994064,
-0.4980276823043823,
-0.5350745916366577,
-0.5395516157150269,
0.4338394105434418,
-0.017663657665252686,
0.2985857427120... | |
<!-- Ping token type MUST be SAML 1.1, do not change -->
<message
issuedTokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1" negotiateServiceCredential="false">
<!-- TODO: You must put the proper issuer URN of the Ping STS; normally this would be ... | [
-0.2891436517238617,
-0.0882425308227539,
0.8105674386024475,
0.046167340129613876,
-0.027793262153863907,
-0.1418614387512207,
0.040732987225055695,
-0.43228304386138916,
-0.3731926381587982,
-0.40891948342323303,
-0.23672616481781006,
0.2354908138513565,
-0.09816262125968933,
-0.24973843... | |
binding="customBinding" bindingConfiguration="FileUploadSTSBinding" />
</message>
</security>
</binding>
</wsFederationHttpBinding>
<customBinding>
<binding name="FileUploadSTSBinding">
<security authenticationMode="UserNameOverTransport" requireDerivedKeys="false... | [
-0.31591328978538513,
0.13533173501491547,
0.5799640417098999,
-0.041342150419950485,
-0.0786789059638977,
-0.19440768659114838,
0.4469204843044281,
-0.934945821762085,
-0.25395649671554565,
-0.3044416904449463,
-0.27953097224235535,
0.39247336983680725,
-0.15289108455181122,
0.24794948101... | |
<httpsTransport maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
```
It's been a few years, so I don't know if this still helps, but I came across this post while trying to figure out the same issue, so it might help someone.
As it t... | [
0.3628908693790436,
-0.19681890308856964,
0.5775163173675537,
0.20426122844219208,
-0.052744925022125244,
-0.3657166063785553,
0.8087739944458008,
-0.11731258034706116,
-0.45560887455940247,
-0.6890060901641846,
0.19692355394363403,
0.11427897214889526,
-0.038389332592487335,
0.06990925222... | |
HttpsTransport with TransferMode set to Streamed:
```
public class FileUploadSTSBinding : WS2007FederationHttpBinding
{
protected override TransportBindingElement GetTransport()
{
return new HttpsTransportBindingElement()
{
TransferMode = TransferMode.Streamed
};
}
}
``... | [
0.1538466513156891,
-0.6375036239624023,
0.5960842967033386,
-0.2342803180217743,
-0.41558122634887695,
-0.25812602043151855,
0.38880738615989685,
-0.126520574092865,
-0.15714891254901886,
-0.8603695034980774,
0.04469973221421242,
0.4922536313533783,
-0.6359396576881409,
0.3018465042114258... | |
being generated as a stack of binding elements rather than using the shortcuts provided by the federation binding:
```
<customBinding>
<binding name="CustomBinding_ISdk">
<security defaultAlgorithmSuite="Default" authenticationMode="IssuedTokenOverTransport"
... | [
0.1132240742444992,
-0.026873458176851273,
0.3524971008300781,
0.13423292338848114,
-0.056674495339393616,
-0.2979891002178192,
0.27925148606300354,
-0.8162264823913574,
-0.3667026162147522,
-0.2865409255027771,
-0.13349056243896484,
0.12882280349731445,
-0.30527040362358093,
0.20907287299... | |
<issuedTokenParameters keyType="BearerKey">
<additionalRequestParameters>
<trust:SecondaryParameters xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512"> | [
0.11756888777017593,
-0.39502090215682983,
0.493853896856308,
0.4735611379146576,
-0.4395308494567871,
-0.11624401062726974,
0.5507556796073914,
-0.6196167469024658,
0.2278805524110794,
-0.10389994829893112,
-0.0007583898841403425,
0.058906588703393936,
0.08075127750635147,
0.0217097438871... | |
<trust:KeyType xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</trust:KeyType>
</trust:SecondaryParameters>
</additionalRequestParameters>
</issuedTokenParameters> | [
0.0011214266996830702,
-0.3409055471420288,
0.6203327775001526,
0.3183515667915344,
-0.2617277204990387,
0.042589057236909866,
0.4111146330833435,
-0.7828912138938904,
0.10807449370622635,
-0.28270432353019714,
0.19203725457191467,
0.27045947313308716,
0.08864503353834152,
-0.0428088419139... | |
<localClientSettings detectReplays="false" />
<localServiceSettings detectReplays="false" />
</security>
<textMessageEncoding /> | [
-0.22138459980487823,
-0.208378404378891,
0.2551202178001404,
-0.10194000601768494,
0.10342274606227875,
-0.3016928732395172,
0.85599684715271,
-0.012005784548819065,
-0.3807081878185272,
-0.5619302988052368,
-0.09686697274446487,
0.6519657373428345,
-0.016743645071983337,
-0.1855720281600... | |
<httpsTransport />
</binding>
```
..which shows what the underlying binding elements actually *are*, which lets you tweak them all you like. And, as it turns out, they're really not that different from the actual binding since the only really special part is the security element, and it doesn't change... | [
0.7264353632926941,
-0.05726557597517967,
0.2854859232902527,
0.22876688838005066,
-0.11900549381971359,
-0.537672221660614,
0.20765253901481628,
0.034008920192718506,
-0.2620430588722229,
-0.6570075154304504,
-0.07322876155376434,
0.21148790419101715,
-0.3613493740558624,
-0.0791476219892... | |
I am trying to grep for any string that matches the following:
```
AAA-###
```
Where A is any alpha character, and there can be from 2 to 5 of them.
# is any digit, and there could be 1 or more of them.
So, the following strings should be found:
```
ABC-123
DE-4
FGHI-56789
```
But this shouldn't be found:
```
... | [
-0.2768215835094452,
0.18581698834896088,
0.22382907569408417,
-0.2494780719280243,
-0.28967225551605225,
0.22176098823547363,
0.3630763292312622,
-0.12226185202598572,
-0.27058765292167664,
-0.38360267877578735,
-0.23036018013954163,
0.38289862871170044,
-0.7114173173904419,
-0.1760755479... | |
[[:alpha:]]\{2,5\}-[[:digit:]]\+ file
$ grep -E [[:alpha:]]\{2,5\}-[[:digit:]]\+ file
ABC-123
DE-4
FGHI-56789
```
I personally prefer to use `''` to avoid all the `\` characters:
```
$ grep -E '[[:alpha:]]{2,5}-[[:digit:]]+' file
ABC-123
DE-4
FGHI-56789
``` | [
-0.4463341534137726,
0.5753501057624817,
0.12813685834407806,
0.06684836745262146,
0.013437732122838497,
0.39906567335128784,
0.35541656613349915,
-0.14197251200675964,
-0.26071640849113464,
-0.48365649580955505,
-0.6162021160125732,
0.47737517952919006,
-0.6100738644599915,
0.029488597065... | |
I'm learning about Java enums and I was wondering what is the best approach to check multiple enums for a matching value in order to call a specific method. I have defined two separate enums below that are used by getValue method's colName parameter to determine what method to execute. So the enum drives the method cal... | [
0.045968055725097656,
0.02499791420996189,
0.4008043110370636,
-0.11280051618814468,
-0.10698577761650085,
0.011513568460941315,
0.060889068990945816,
-0.38218632340431213,
0.1661543995141983,
-0.6222501993179321,
0.27138686180114746,
0.7344364523887634,
-0.4339257478713989,
0.034889850765... | |
colName.equalsIgnoreCase("ATTRIBUTETWO")){
callAsStringMethod();
} else if(colName.equalsIgnoreCase("ATTRIBUTEFOUR")){
callAsIntegerMethod();
}
```
**My Attempt using enum:**
```
public class RowHelper implements IRowHelper
public static enum StringAttributes {
... | [
-0.5315356254577637,
-0.0006223942036740482,
0.6721713542938232,
-0.21543845534324646,
0.21241621673107147,
0.2434369921684265,
0.2882267236709595,
-0.36387357115745544,
0.3304833173751831,
-0.6583360433578491,
0.023031160235404968,
0.7592703700065613,
-0.31749725341796875,
0.0262619033455... | |
ATTRIBUTETHREE;
}
public static enum IntegerAttributes {
ATTRIBUTEFOUR,
ATTRIBUTEFIVE,
ATTRIBUTESIX, | [
-0.1546577513217926,
-0.014291073195636272,
0.3686399459838867,
-0.030838755890727043,
0.11445009708404541,
0.4024762511253357,
-0.0714104175567627,
-0.01943352445960045,
0.02819504775106907,
-0.3155215084552765,
-0.07228633016347885,
0.7958511114120483,
-0.25068747997283936,
0.15032704174... | |
ATTRIBUTESEVEN;
}
@Override
public String getValue(String colName) throws Exception{
boolean colFound=false;
Object retValue = null; | [
-0.20216624438762665,
-0.05372822284698486,
0.18439693748950958,
-0.043583594262599945,
0.015254320576786995,
-0.10673558712005615,
0.4357481300830841,
-0.1997227817773819,
-0.15273424983024597,
-0.2468806952238083,
-0.3190743327140808,
0.6328315138816833,
-0.44951289892196655,
0.296333670... | |
for (EConstants.StringAttributes attribute : EConstants.StringAttributes.values()) {
if(colName.toUpperCase().equals(attribute)){
retValue = callAsStringMethod();
colFound=true;
} | [
-0.2752557694911957,
-0.15560050308704376,
0.5735763311386108,
-0.2270977646112442,
0.3261062204837799,
0.07472848892211914,
0.29247432947158813,
-0.7037976980209351,
-0.26379328966140747,
-0.20773671567440033,
-0.2867628037929535,
0.7227504849433899,
-0.42458513379096985,
-0.1610845923423... | |
}
for (EConstants.IntegerAttributes attribute : EConstants.IntegerAttributes.values()) {
if(colName.toUpperCase().equals(attribute)){
retValue = callAsIntegerMethod(); | [
-0.23583412170410156,
-0.10496009886264801,
0.5766924619674683,
-0.27308982610702515,
0.3044684827327728,
0.23781627416610718,
0.3135667145252228,
-0.7198668718338013,
-0.20546433329582214,
-0.16215366125106812,
-0.3718792796134949,
0.7631915807723999,
-0.47548869252204895,
-0.062930308282... | |
colFound=true;
}
}
if(!colFound)
throw new Exception("column not found"); | [
-0.19107794761657715,
-0.027063732966780663,
0.31111717224121094,
-0.45237094163894653,
0.3146655261516571,
-0.21897679567337036,
0.37770876288414,
-0.11316316574811935,
-0.005454620812088251,
-0.28698745369911194,
-0.283840537071228,
0.5168915390968323,
-0.5285850763320923,
0.126309484243... | |
if(retValue instanceof String )
return (String) retValue;
else
return retValue.toString();
}
}
```
Try this:
```
public String getValue(String colName) throws Exception {
final String name = colName != | [
-0.335166871547699,
-0.09279336035251617,
0.4958115220069885,
-0.19446904957294464,
0.11654041707515717,
-0.2876797318458557,
0.4769535958766937,
-0.26440221071243286,
-0.20837241411209106,
-0.2421812117099762,
-0.5608066916465759,
0.5925403237342834,
-0.4479694664478302,
0.140620172023773... | |
null ? colName.trim().toUpperCase() : "";
try {
EConstants.StringAttributes.valueOf(name);
return callAsStringMethod().toString();
} catch (Exception e1) {
try {
EConstants.IntegerAttributes.valueOf(name);
return callAsIntegerMethod().toString();
} catch ... | [
-0.24611970782279968,
-0.2948271930217743,
0.11522714048624039,
-0.4185127913951874,
0.2703862488269806,
0.126454696059227,
0.35800111293792725,
-0.464692622423172,
-0.09370186179876328,
-0.09339931607246399,
-0.5252653956413269,
0.5145150423049927,
-0.5324655175209045,
0.01380969677120447... | |
}
}
}
```
The method's now returning the appropriate value, according to the latest edit of the question.
**EDIT :**
According to Kirk Woll and Louis Wasserman's benchmark, looping through `values` is significantly faster than doing a `try/catch`. So here's a simplified version of the original code, expect it ... | [
-0.41954097151756287,
-0.00006709363515255973,
0.3172405958175659,
-0.14508695900440216,
0.3023822009563446,
-0.06867397576570511,
0.22893789410591125,
-0.4429915249347687,
-0.30111321806907654,
-0.4713195562362671,
-0.32108819484710693,
0.41552358865737915,
-0.5411772131919861,
-0.1191007... | |
return callAsStringMethod().toString();
for (EConstants.IntegerAttributes attribute : EConstants.IntegerAttributes.values())
if (name.equals(attribute))
return callAsIntegerMethod().toString();
throw new Exception("column not found");
}
``` | [
-0.4983469247817993,
-0.07673770934343338,
0.34036391973495483,
-0.3191665709018707,
0.295095831155777,
0.12344225496053696,
0.16851580142974854,
-0.4987056851387024,
-0.16136255860328674,
-0.1262693852186203,
-0.4752713739871979,
0.711394190788269,
-0.523321807384491,
-0.02272759750485420... | |
I can write a code.
In this I can take a Template Column & in this I build a RadCombobox.
When it's Index changed I want to affect the below text box.
Link the selected value of the Combo box is set as Text on Below TextBox.
Combo Box & Text Box are different Controls of Different Template Column.
I can Write Control ... | [
0.10061680525541306,
0.008417950011789799,
0.5916296243667603,
0.061131808906793594,
0.009719818830490112,
0.054728180170059204,
0.10323195904493332,
-0.5548216104507446,
0.0880964994430542,
-0.6765307784080505,
0.17818789184093475,
0.586046040058136,
-0.25297847390174866,
0.03948254510760... | |
this event like this :
```
protected void cmbGID_SelectedIndexChanged()
{
//code...
}
```
Any one plz tell me that parameters & tell me is that possible to set txtValue.Text = cmbGID.SelectedValue.ToString()...???
I got the solution of this problem...
This is working by following code :
```
protected void ... | [
-0.375032514333725,
-0.23943112790584564,
0.49129655957221985,
0.04193298518657684,
-0.031925179064273834,
-0.06960160285234451,
0.4216611683368683,
-0.1998244673013687,
-0.3523074984550476,
-0.5928288102149963,
-0.24558314681053162,
0.6192687749862671,
-0.238030344247818,
0.46212688088417... | |
ds.Clear();
ds = c.getDataSet(query);
cmbCtrl.DataSource = ds.Tables[0];
cmbCtrl.DataTextField = "NO";
cmbCtrl.DataValueField = "RecordID";
cmbCtrl.DataBind();
}
``` | [
-0.5094020366668701,
-0.0876135304570198,
0.5593075752258301,
0.15711627900600433,
0.02237488329410553,
-0.1586759239435196,
0.08227250725030899,
-0.1020657867193222,
-0.3087013065814972,
-0.34168463945388794,
-0.5979770421981812,
0.22297537326812744,
-0.31075575947761536,
0.57562720775604... | |
I am trying to make a quiz app, so there are 5 radio buttons with possible answers, and only 1 is correct. Then there's a submit button, which has an onClick="clickMethod" to process the submission.
My clickMethod looks like this:
```
public void clickMethod(View v){
RadioGroup group1 = (RadioGroup) ... | [
0.29667550325393677,
0.17831484973430634,
0.6458874940872192,
-0.07562194019556046,
0.03653683885931969,
-0.04022132605314255,
0.4190530776977539,
-0.4686252176761627,
0.11875921487808228,
-0.46476489305496216,
-0.023295773193240166,
0.7152044177055359,
-0.12902680039405823,
0.164406895637... | |
(RadioButton) findViewById(selected);
if (button1.getText()=="Right Answer")
Toast.makeText(this,"Correct!",Toast.LENGTH_SHORT).show();
else
Toast.makeText(this,"Incorrect.",Toast.LENGTH_SHORT).show();
}
```
However I can't get the IF stateme... | [
0.2010657787322998,
0.16082870960235596,
0.7909879684448242,
-0.5655765533447266,
0.1613607108592987,
-0.4775223135948181,
0.6704820990562439,
-0.529854416847229,
0.22396031022071838,
-0.42844104766845703,
-0.49662935733795166,
0.7720357179641724,
-0.47565189003944397,
0.23292751610279083,... | |
"button1.getText()" as parameter it does print the "Right Answer" string, but for some reason inside the IF statement it's not working, and the ELSE is always executed even when I check the right answer.
Does anyone know what might be happening or a better way to do this?
You should use the `equals` String method for ... | [
0.11367646604776382,
-0.08253400772809982,
0.7840069532394409,
-0.47498947381973267,
-0.0563243106007576,
-0.4054214358329773,
0.5188933610916138,
-0.4996859133243561,
-0.03820625692605972,
-0.5878887176513672,
-0.1525256186723709,
0.7834727168083191,
-0.4191519618034363,
0.153854414820671... | |
} else {
Toast.makeText(this,"Incorrect.",Toast.LENGTH_SHORT).show();
}
}
``` | [
0.2098129689693451,
0.4014211595058441,
0.04922403767704964,
-0.4879797399044037,
0.07937562465667725,
-0.25055810809135437,
0.37932088971138,
0.10797645151615143,
0.05543823912739754,
-0.6192993521690369,
-0.4635540843009949,
0.5777390003204346,
-0.13966940343379974,
0.3640856146812439,
... | |
I have a quite complex multi-join TSQL SELECT query that runs for about 8 seconds and returns about 300K records. Which is currently acceptable. But I need to reuse results of that query several times later, so I am inserting results of the query into a temp table. Table is created in advance with columns that match ou... | [
0.20160357654094696,
-0.08505744487047195,
0.4989416301250458,
0.15259964764118195,
0.06656184047460556,
-0.058447591960430145,
0.3376191258430481,
-0.261929988861084,
-0.27298295497894287,
-0.6854215860366821,
0.1390259712934494,
0.3687243163585663,
0.05899142846465111,
-0.042362801730632... | |
Spool).
Any idea why this is happening and how to speed it up?
Thanks!
You should use the `equals` String method for String comparison:
```
public void clickMethod(View v){
RadioGroup group1 = (RadioGroup) findViewById(R.id.radioGroup1);
int selected = group1.getCheckedRadioButtonId();
RadioButton button... | [
0.20144999027252197,
-0.05493684113025665,
0.9085457921028137,
-0.18257755041122437,
-0.040612637996673584,
-0.3874511122703552,
0.5321657061576843,
-0.47179102897644043,
-0.1338510662317276,
-0.5471695065498352,
-0.21647204458713531,
0.8177269697189331,
-0.26194387674331665,
0.23432543873... | |
I have two tables
**people**
```
name id
man1 456
man2 123
man3 789
```
**notes**
```
content id
testing 123
hello 456
```
I have two queries that select records from the table `people` if a note for that person exists.
`SELECT * FROM PEOPLE WHERE ID IN (SELECT ID FROM NOTES)`
```
name id
m... | [
-0.21032117307186127,
0.5092766284942627,
0.2496197372674942,
-0.015547163784503937,
-0.00034682280966080725,
0.41594529151916504,
-0.15266384184360504,
-0.48472240567207336,
-0.22545918822288513,
-0.9032119512557983,
0.2308240681886673,
0.10972610861063004,
-0.13624751567840576,
-0.117306... | |
set the value of the field based on whether a note exists.
```
name id does_note_exist
man1 456 yes
man2 123 yes
man3 789 no
```
What is the appropriate syntax to do this? Something like this would be what I'm looking for:
```
IF ID IN (SELECT ID FROM NOTES)
does_note_exist = yes
IF ID NOT... | [
-0.07956985384225845,
0.5911136865615845,
0.5324624180793762,
-0.11632689088582993,
0.022390007972717285,
0.04450312256813049,
-0.11793696880340576,
-0.6772094964981079,
-0.1521461308002472,
-0.4704124927520752,
-0.12050169706344604,
0.20438256859779358,
-0.30901971459388733,
-0.2079440057... | |
n.id IS NULL THEN 'no' ELSE 'yes' END AS does_note_exist
FROM people p
LEFT OUTER JOIN notes n
ON n.id = p.id
GROUP BY n.id
``` | [
-0.2299860268831253,
0.2387237548828125,
0.27950915694236755,
-0.151734858751297,
-0.09646571427583694,
-0.031160885468125343,
0.04254642128944397,
-0.5716673135757446,
-0.14353743195533752,
-0.3054794371128082,
-0.3004758954048157,
0.13639198243618011,
-0.2745749354362488,
0.2452491521835... | |
I want to stretch an elliptical object in an image until it forms a circle. My program currently inputs an image with an elliptical object (eg. coin at an angle), thresholds and binarizes it, isolates the region of interest using edge-detect/bwboundaries(), and performs regionprops() to calculate major/minor axis lengt... | [
0.27790990471839905,
-0.16986528038978577,
0.6823723912239075,
0.04800090193748474,
-0.06302361190319061,
0.0805722326040268,
-0.3133500814437866,
-0.11669653654098511,
-0.23964732885360718,
-0.7248032093048096,
0.12510408461093903,
0.3569532036781311,
0.26416319608688354,
0.52479040622711... | |
image, the binarized image looks like a white ellipse on a black background).
**EDIT**: I'd also like to apply this technique to the **gray-scale version of the image**, to examine what the stretch looks like.
code snippet:
```
rgbImage = imread(fullFileName);
redChannel = rgbImage(:, :, 1);
binaryImage = redChannel... | [
-0.12716861069202423,
-0.621496856212616,
0.7729116678237915,
-0.03387016803026199,
-0.20013824105262756,
0.18350082635879517,
0.12351885437965393,
-0.361674040555954,
-0.16472776234149933,
-0.705807089805603,
-0.5513651371002197,
0.2616986930370331,
-0.3262617886066437,
0.2666507363319397... | |
alpha = pi/180 * stats(1).Orientation;
Q = [cos(alpha), -sin(alpha); sin(alpha), cos(alpha)];
x0 = stats(1).Centroid.';
a = stats(1).MajorAxisLength;
b = stats(1).MinorAxisLength;
S = diag([1, a/b]);
C = Q*S*Q';
d = (eye(2) - C)*x0;
tform = maketform('affine', [C d; 0 0 1]');
Im2 = i... | [
-0.0031291458290070295,
-0.3965413272380829,
0.5037058591842651,
-0.3228636085987091,
-0.41318434476852417,
0.2616269886493683,
0.40623337030410767,
-0.5177668929100037,
-0.2723308205604553,
-0.7977309823036194,
-0.29611510038375854,
0.15260744094848633,
-0.35019662976264954,
0.34462070465... | |
In addition to jquery plugin options, I want to override those values with html5 data-attributes.
---
This is the desired format for the optionis:
```
var defaults = {
text: {
color: 'red',
opacity: 0.5
},
button: {
width: 100,
height: 30
}
}
```
I wanted to format the data-attr... | [
-0.23175965249538422,
-0.228306382894516,
0.639120876789093,
0.07783696055412292,
0.13497969508171082,
0.06436215341091156,
0.05476609990000725,
-0.1857973337173462,
-0.02337324060499668,
-0.5547081232070923,
-0.28911444544792175,
0.7801624536514282,
-0.10706740617752075,
-0.31855228543281... | |
could I format the data-attribute so that I can fetch the value with `o.text.color`?
Just pass an object formatted like a json string to the attribute, and jQuery data will parse it for you.
```
<div class="test" data-test='{ "test1":"Lorem","test2":"Ipsum" }'></div>
```
Also see [updated fiddle](http://jsfiddle.net... | [
0.14502306282520294,
-0.08202297240495682,
0.3019585907459259,
-0.004592971410602331,
0.07674887031316757,
-0.05559615045785904,
0.22300946712493896,
-0.4358815848827362,
-0.015931781381368637,
-0.4581056237220764,
0.10470825433731079,
0.5309640765190125,
-0.06556495279073715,
-0.368839889... | |
When I try to ask a service - I get an exception
> Unable to load metadata for return type
> 'System.Linq.IQueryable'
Inet says that service can not find model files. But I use code-first, and have no such files.
I use `Microsoft.Data.Services`.
You can say that my connection string is wrong.
But when I try to in... | [
0.12787534296512604,
0.08903882652521133,
0.3592064678668976,
0.18905109167099,
-0.01437232457101345,
-0.00688917376101017,
0.35158488154411316,
-0.1381043940782547,
-0.09082059562206268,
-0.526951253414154,
0.03184577077627182,
0.24608443677425385,
-0.3985846936702728,
0.4183012843132019,... | |
correct answer is given [here](https://stackoverflow.com/a/1573715/336527):
> `NaN` != `NaN` originated out of two pragmatic considerations:
>
>
> [...] There was no `isnan( )` predicate at the time that NaN was formalized in the 8087 arithmetic; it was necessary to provide programmers with a convenient and efficien... | [
-0.4541548788547516,
0.16742722690105438,
-0.21405653655529022,
0.26436811685562134,
-0.41168785095214844,
0.1452568620443344,
0.32826757431030273,
-0.10020004212856293,
-0.1605302095413208,
-0.18732856214046478,
0.008309051394462585,
0.38451534509658813,
0.0010054807644337416,
0.065841794... | |
them in hash-based containers, they couldn't do it.
If the committee foresaw future use cases, and considered them important enough, they could have gone for the more verbose `!(x<x & x>x)` instead of `x!=x` as a test for `NaN`. However, their focus was more pragmatic and narrow: providing the best solution for a num... | [
-0.028468141332268715,
0.3004283308982849,
-0.056633785367012024,
0.07583330571651459,
-0.38068127632141113,
-0.05442178249359131,
0.35633227229118347,
0.03685249760746956,
-0.2807183265686035,
-0.3284626007080078,
-0.08071625232696533,
0.08702461421489716,
-0.027352889999747276,
0.3901326... | |
that document confirms, NaN is a well-defined concept.
Furthermore, IEEE approach was to follow the regular mathematics rules as much as possible, and when they couldn't, follow the rule of "least surprise" - see <https://stackoverflow.com/a/1573715/336527>. Any mathematical object is equal to itself, so the rules of ... | [
0.00096029945416376,
0.1584172546863556,
-0.1268945038318634,
-0.029728641733527184,
-0.4692194163799286,
-0.15864916145801544,
0.16376635432243347,
-0.30792224407196045,
-0.359357625246048,
-0.02788398787379265,
0.15489353239536285,
0.30973130464553833,
0.15106339752674103,
0.308281153440... | |
made a mistake. Since very few people understood the IEEE committee approach, or cared about what exactly the standard says about NaN (to wit: most compilers' treatment of NaN violates the IEEE standard anyway), nobody raised an alarm. Hence, this mistake is now embedded in the standard. It is unlikely to be fixed, sin... | [
0.4143751859664917,
-0.009298738092184067,
-0.24166914820671082,
0.12778986990451813,
-0.11150050908327103,
-0.22206449508666992,
0.33437395095825195,
-0.013664605095982552,
-0.4701799154281616,
-0.17335250973701477,
0.15261821448802948,
0.32199493050575256,
-0.15569381415843964,
0.2437737... | |
Guido is not personally interested in this topic, and largely follows Tim Peters recommendation. If anyone has Tim Peters' arguments in favor of `NaN != NaN`, please add them in comments; they have a good chance to change my opinion. | [
0.4240996837615967,
0.42774996161460876,
-0.5994515419006348,
-0.029059184715151787,
-0.46151137351989746,
0.06084123253822327,
0.13195179402828217,
0.30244573950767517,
0.07006294280290604,
-0.2811409831047058,
-0.026127872988581657,
0.554142415523529,
0.2930109202861786,
0.16709735989570... | |
First of all, I have to apologize for not having a better title. Feel free to change it if you find a more appropriate one.
Basically, I have been bugged by the behaviour of Python's multiple inheritance. In my [previous SO question](https://stackoverflow.com/questions/10018757/how-does-the-order-of-mixins-affect-the-... | [
0.19660510122776031,
-0.08183687925338745,
-0.06530417501926422,
-0.20870205760002136,
-0.3047158420085907,
-0.2929246723651886,
0.25084930658340454,
-0.040875669568777084,
-0.3602082133293152,
-0.2143772840499878,
-0.34415963292121887,
0.549680769443512,
-0.5250109434127808,
0.04087436944... | |
print 'base check'
class AMixin1(UltimateBase):
def check(self):
print 'check A'
class BMixin1(UltimateBase):
def check(self):
print 'check B'
class CMixin1(UltimateBase):
def check(self):
print 'check C'
class AMixin2(UltimateBase):
def check(self):
print 'check A'
... | [
0.15074390172958374,
-0.16657666862010956,
-0.20253095030784607,
-0.04869280755519867,
-0.10578881204128265,
0.17591698467731476,
0.19119171798229218,
-0.40745097398757935,
-0.005706280004233122,
-0.3715443015098572,
-0.09008562564849854,
0.5320165157318115,
-0.8021679520606995,
-0.1996201... | |
return super(BMixin2, self).check()
class CMixin2(UltimateBase):
def check(self):
print 'check C'
return super(CMixin2, self).check()
class MyView1(AMixin1, BMixin1, CMixin1):
pass
class MyView2(AMixin2, BMixin2, CMixin2):
pass
class MyView3(AMixin1, BMixin2, CMixin2):
pass
class My... | [
0.1139320656657219,
-0.056924596428871155,
0.43661025166511536,
-0.08623059093952179,
-0.21604566276073456,
0.43390753865242004,
0.6044396162033081,
-0.4170263111591339,
-0.028097795322537422,
-0.8690486550331116,
-0.0999244749546051,
0.4910472631454468,
-0.29296740889549255,
-0.0661592632... | |
= MyView8()
myview1.check()
print '------------------------'
myview2.check()
print '------------------------'
myview3.check()
print '------------------------'
myview4.check()
print '------------------------'
myview5.check()
print '------------------------'
myview6.check()
print '------------------------'
myview7.check... | [
-0.17694535851478577,
0.303875207901001,
0.8488909006118774,
-0.11965616792440414,
-0.19447655975818634,
0.01254632230848074,
0.2188134491443634,
-0.5246299505233765,
-0.06882783770561218,
-0.4800845980644226,
-0.34074562788009644,
0.5782119631767273,
-0.303126722574234,
-0.185419470071792... | |
`AMixin1`, `BMixin1`, or `CMixin1`, it stops, because those classes do not call `super(..., self).check()`.
As Benn points out, this is described in the [official Python documentation](http://docs.python.org/library/functions.html?highlight=super#super). And if you think about it, it pretty much has to work this way. ... | [
0.1550515741109848,
-0.3619833290576935,
0.18971647322177887,
-0.38686829805374146,
-0.12753544747829437,
-0.35612598061561584,
0.6029234528541565,
0.03951244801282883,
-0.3863222002983093,
-0.24816399812698364,
-0.24522843956947327,
0.46515902876853943,
-0.5300385355949402,
0.169910758733... | |
I have created PHP GD image for captcha, file called `image.php`
each time it generates a dynamic captcha image.
---
In `signup.php` I have
```
<img alt="" src="image.php">
<input type="button" id="btn" value="cant read captcha">
<!--btn is to load another captcha-->
```
---
jscript.js
```
$("#btn").click(fun... | [
0.1435491144657135,
0.15038838982582092,
0.5640077590942383,
-0.2869069278240204,
-0.3305339813232422,
0.011792391538619995,
0.4196891784667969,
-0.21083466708660126,
-0.2926248610019684,
-0.849249541759491,
0.029839428141713142,
0.43338561058044434,
-0.4966479539871216,
0.1430511772632599... | |
is now working for me in all browsers
thanx every one | [
0.1447456330060959,
0.2699660062789917,
0.44039279222488403,
-0.0016503058141097426,
0.20037852227687836,
-0.22481191158294678,
0.41312670707702637,
0.5942390561103821,
-0.18909990787506104,
-0.8025574684143066,
-0.11527189612388611,
0.25983062386512756,
0.1237080916762352,
0.3527024984359... | |
I'm learning C++; I'm already fluent in PHP. I read up the differences between C++ and PHP. None of the articles that I read mentioned that PHP has far more built in functions than C++.
Right now, I'm trying to split a string in C++ and I found this: [Split a string in C++?](https://stackoverflow.com/questions/236129/... | [
0.5204222798347473,
-0.02120084874331951,
-0.33867865800857544,
0.12327627092599869,
-0.07306299358606339,
-0.6733672618865967,
0.11139339953660965,
0.10930706560611725,
-0.5551027059555054,
-0.22520987689495087,
0.02324267476797104,
0.6398282647132874,
-0.1755034476518631,
-0.008230954408... | |
complex things, for example, `explode` can be written using `split` and `strpos` instead.
Same thing for C++, I find that C++ is more lean in that aspect, sure sometimes you will have to write your own `explode`, or simply use some other library that someone else created.
As for which has more, I don't think it matte... | [
0.20391179621219635,
0.12016955018043518,
-0.33187419176101685,
0.10426479578018188,
-0.08738549798727036,
-0.3675079941749573,
0.10993609577417374,
-0.04697275161743164,
-0.2888610363006592,
-0.4280056059360504,
-0.061935584992170334,
0.7421785593032837,
-0.3271600008010864,
-0.0747084617... | |
I've got the following private message model
```
belongs_to :from_user, class_name: 'User'
belongs_to :to_user, class_name: 'User'
belongs_to :thread, class_name: 'Message', foreign_key: 'parent_message_id'
has_many :replies, class_name: 'Message'
attr_accessible :subject, :body
scope :original_message, where("parent_... | [
0.28212031722068787,
0.32334446907043457,
0.2825715243816376,
-0.04667116701602936,
-0.1786763221025467,
0.08897504210472107,
0.11777496337890625,
0.32312485575675964,
-0.3585470914840698,
-0.8018569946289062,
0.1037490963935852,
0.22766408324241638,
-0.06006895750761032,
0.397900819778442... | |
of the PHP functions are just simpler ways to do more complex things, for example, `explode` can be written using `split` and `strpos` instead.
Same thing for C++, I find that C++ is more lean in that aspect, sure sometimes you will have to write your own `explode`, or simply use some other library that someone else c... | [
0.3595903217792511,
0.16273196041584015,
-0.10272911936044693,
0.23943057656288147,
-0.42403146624565125,
-0.4936222434043884,
0.02421645261347294,
0.03141332417726517,
-0.1951235979795456,
-0.17913931608200073,
0.168038010597229,
0.6004552841186523,
-0.3301970362663269,
-0.094312377274036... | |
I have a problem trying to hide .php extension from the url
I have been asked to hide it and because they are on a shared host i don't think i have access to .htacess so is there another way to hide it through a php function that i would call everytime an anchor is being selected?
.htaccess is what you would have acce... | [
0.3843023180961609,
0.2615717947483063,
0.3061322271823883,
0.1872357428073883,
-0.023382259532809258,
-0.328141450881958,
0.38197484612464905,
0.3177424967288971,
-0.2996131479740143,
-0.6256638765335083,
-0.10302864015102386,
0.4100378155708313,
-0.2877175807952881,
0.3346900939941406,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.