text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|

The attached picture shows the results page of the search engine that I'm building. For each return result, the user may click on the result (i.e. "Food Science") and it will expand out accordion-style to reveal information about that particular resu... | [
0.6607916951179504,
0.2954268455505371,
0.4808099567890167,
-0.20963869988918304,
0.03116217628121376,
0.2218428999185562,
0.2537774443626404,
0.010011683218181133,
-0.5373620986938477,
-0.470987468957901,
-0.20595291256904602,
0.386128306388855,
0.12386121600866318,
0.09909611195325851,
... | |
pull the title of the result that was clicked, and I have it set where I want to log the click, but I don't know how to do it since JQuery is client side and PHP is server side.
**How can I use the JQuery to trigger a PHP function so that I can query the database to insert the click logs into my table?**
Below is th... | [
-0.025310121476650238,
-0.20718733966350555,
0.8574807047843933,
-0.36537376046180725,
0.34179407358169556,
-0.14863964915275574,
-0.04995683953166008,
-0.2340489774942398,
-0.28452613949775696,
-0.3601047694683075,
-0.07790674269199371,
1.0420798063278198,
-0.3201780915260315,
-0.02330334... | |
$(this).next().slideDown('normal');
$(this).next().slideDown(test_accordion);
// SEND CLICK ACTION TO LOG INTO THE DATABASE
alert($(this).find('h3:last').text()); // displays the title of the result that was just clicked
}
else {
$(this).removeClass('on... | [
0.0026786199305206537,
-0.19602461159229279,
0.4455939531326294,
-0.4064282178878784,
0.5248363614082336,
-0.09691576659679413,
0.369419127702713,
-0.2011815905570984,
-0.006032278761267662,
-0.2818043529987335,
-0.457540363073349,
0.719748854637146,
-0.38730862736701965,
0.215409100055694... | |
$(this).next().slideUp('normal');
$(this).next().slideUp(test_accordion);
}
});
}
```
You can do something like this (untested):
Define a javascript variable to track the order of the clicks, outside your click function:
```
var order = 0;
```
Add this into your click function, at the bo... | [
-0.12972909212112427,
-0.20275360345840454,
0.5509461760520935,
-0.36164408922195435,
0.11104868352413177,
0.12278012186288834,
0.3443719148635864,
-0.2659893035888672,
-0.1603839248418808,
-0.5851227641105652,
-0.10626128315925598,
0.7517926096916199,
-0.5581837892532349,
-0.0039151078090... | |
= $(this).index() + 1; // might have to modify this to get correct index
$.post("logClick.php", {sessionID:sessionID, query:query, pos:pos, order:order});
```
In your php script called "logClick.php" (in the same directory):
```
<?php
// GET AJAX POSTED DATA
$str_sessionID = empty($_POST["sessionID"]) ? ... | [
-0.32431402802467346,
-0.11282406747341156,
0.393436074256897,
-0.16923759877681732,
-0.32458916306495667,
0.08323541283607483,
0.41363516449928284,
-0.07786017656326294,
-0.12405084073543549,
-0.7455947995185852,
-0.1854570060968399,
0.6383655667304993,
-0.3916197121143341,
-0.10143906623... | |
require_once "dbconnect.php"; // include the commands used to connect to your database. Should define a variable $con as the mysql connection
// INSERT INTO MYSQL DATABASE TABLE CALLED 'click_logs'
$sql_query = "INSERT INTO click_logs (sessionID, query, pos, order) VALUES ('$str_sessionID', '$str_qu... | [
0.2760172486305237,
-0.01930089294910431,
0.7794725894927979,
-0.14887818694114685,
0.2651970088481903,
-0.12268469482660294,
0.1211467832326889,
-0.6093287467956543,
0.07224764674901962,
-0.6880155801773071,
0.095482237637043,
0.5765448808670044,
-0.5421809554100037,
0.4104805290699005,
... | |
}
else echo "No data found to log!";
?>
```
You can add a callback function as a third parameter for the $.post() ajax method if you want to see if errors occured in the script:
```
$.post("logClick.php", {sessionID:sessionID, query:query, pos:pos, order:order},
function(result) {
$('#result').html(res... | [
-0.2566460072994232,
-0.27936387062072754,
0.5330702066421509,
-0.24283692240715027,
-0.14628809690475464,
0.11792576313018799,
0.4637870192527771,
-0.3203980326652527,
-0.2146790623664856,
-0.6021264791488647,
-0.23654402792453766,
0.5542940497398376,
-0.5784533023834229,
-0.0346083603799... | |
value of this variable between pages using either GET or POST. You can then save the value in a hidden input and easily read it with jQuery. (Or you could also use cookies).
Example (put this in every results page):
```
<?php
$order = empty($_POST["order"]) ? $_POST["order"] : "0";
$html="<form id='form_session... | [
-0.10157112032175064,
-0.11744990199804306,
0.8160706162452698,
-0.197077676653862,
-0.16206355392932892,
-0.05194375291466713,
0.5314778089523315,
-0.21035924553871155,
-0.23977355659008026,
-0.6773087382316589,
-0.3113522231578827,
0.3723520338535309,
-0.4196805953979492,
0.1096991822123... | |
the order value and the form action, and then submit the form using javascript/jQuery:
```
$("a.next_page").click(function(event) {
event.preventDefault();
var url = $(this).attr("href");
$("input[name='order']").val(order);
$("#form_session").attr('action', url).submit();
});
```
All the 'next' and 'previou... | [
-0.1930844932794571,
-0.19815468788146973,
0.826134204864502,
-0.20102505385875702,
-0.16952770948410034,
0.26811495423316956,
0.0006368107278831303,
-0.3683783710002899,
-0.20399928092956543,
-0.7054537534713745,
-0.4741453230381012,
0.509916365146637,
-0.37500128149986267,
0.049104619771... | |
```
String sql = "update `library`.`memebers` set 'STATUS'='" + "1" +"' where mem_id = '"+str+"'";
int i = st.executeUpdate(sql);
```
Error in 2nd line above:
```
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server v... | [
-0.2479555308818817,
0.3453473150730133,
0.25894632935523987,
-0.25146111845970154,
0.04914223030209541,
0.03620573505759239,
0.5714808702468872,
-0.5614308714866638,
-0.1317044049501419,
-0.7900439500808716,
-0.245296910405159,
0.4988729953765869,
-0.24263900518417358,
0.11256710439920425... | |
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.jav... | [
-0.2610345780849457,
-0.1756492704153061,
0.6457635164260864,
0.12304391711950302,
-0.4804728031158447,
0.2144624888896942,
0.2508898079395294,
-0.6531685590744019,
-0.6161406636238098,
-0.6452347636222839,
-0.27654358744621277,
0.3365253210067749,
-0.2461623102426529,
0.08870945125818253,... | |
Frames.Addmembers.access$000(Addmembers.java:21)
at Frames.Addmembers$1.actionPerformed(Addmembers.java:83)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultBu... | [
-0.06170951575040817,
-0.07163180410861969,
0.5498536825180054,
-0.3140811324119568,
-0.2055082619190216,
0.6654359698295593,
0.2754059433937073,
-0.9204514026641846,
-0.6966592073440552,
-0.547568678855896,
-0.19823144376277924,
0.5530017614364624,
-0.5275055766105652,
-0.1652060598134994... | |
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.Lightweight... | [
-0.39464181661605835,
-0.11180488020181656,
0.5598886013031006,
-0.15301430225372314,
-0.20082180202007294,
0.5265372395515442,
0.1639743596315384,
-0.3368765413761139,
-0.3705013394355774,
-0.6958293914794922,
-0.3263663947582245,
0.6263942718505859,
-0.17883552610874176,
-0.2022189050912... | |
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)... | [
0.46337616443634033,
0.2833482325077057,
0.2946658730506897,
-0.21456857025623322,
-0.02982785366475582,
0.08668667823076248,
0.1162262037396431,
-0.13746196031570435,
-0.15775522589683533,
-0.4945378303527832,
-0.0034037246368825436,
0.5845474004745483,
-0.6518959999084473,
-0.13615381717... | |
rows.
```
SELECT c.company_name,
CASE
WHEN u.company_name IS NULL THEN 'N'
ELSE 'Y'
END AS user_has_company
FROM companies c
LEFT JOIN (
SELECT *
FROM users
WHERE user_name = 'x1'
) u
ON u.company_name = c.company_name
ORDER BY user_has_company DESC, c.company_name
```
This query will return an... | [
-0.2238767147064209,
0.4929041862487793,
0.7060859799385071,
-0.22731424868106842,
0.1274435669183731,
0.23391225934028625,
-0.5573394894599915,
0.18873022496700287,
-0.49530115723609924,
-0.4195901155471802,
-0.3606885075569153,
0.1916162669658661,
-0.3973090648651123,
0.46514347195625305... | |
I have a JSON string that looks like this:
```
{
"package1": {
"type": "envelope",
"quantity": 1,
"length": 6,
"width": 1,
"height": 4
},
"package2": {
"type": "box",
"quantity": 2,
"length": 9,
"width": 9,
"height": 9
}
}
```
I'm using the Json.NET LINQ to JSON functionality ... | [
0.18673856556415558,
0.07742515206336975,
0.2401372492313385,
-0.2764607071876526,
0.08608470112085342,
0.05133442208170891,
-0.0052971914410591125,
-0.22408562898635864,
-0.18576963245868683,
-0.6661288738250732,
-0.15126273036003113,
0.4576234519481659,
-0.26024526357650757,
-0.114320017... | |
string has package1 and package2 so I'm wondering how I can get it to return the integer 2. Sometimes I might only have one package, in which case, I'd like it to return the integer 1. Other times I might have 20 packages (in that case I'd like it to return 20).
My JObject looks like this:
```
JObject o = JObject.Par... | [
-0.21565327048301697,
-0.154283344745636,
0.3071734309196472,
-0.4336193799972534,
-0.027123015373945236,
0.12835745513439178,
0.42734354734420776,
-0.15658335387706757,
-0.20729860663414001,
-0.7673724889755249,
-0.30264154076576233,
0.6597488522529602,
-0.6347364783287048,
-0.07804821431... | |
I have query like this :
```
SELECT EXTRACT(MONTH FROM d.mydate) AS synmonth, SUM(apcp) AS apcptot
FROM t_synop_data2 d
WHERE d.mydate
BETWEEN '2011-01-01' AND '2011-12-31'
AND d.idx_synop = '06712'
GROUP BY synmonth
```
This query adds all rain (apcp) in a month like this :
```
1 32.8 => from 2011.01.01 to 201... | [
0.043992768973112106,
0.1308422088623047,
1.0055147409439087,
-0.12927661836147308,
-0.3099936246871948,
0.3344251811504364,
0.5983178615570068,
-0.41746023297309875,
-0.49986502528190613,
-0.467896968126297,
-0.11149201542139053,
-0.005736489314585924,
-0.20166102051734924,
0.193706303834... | |
to adds apcp from day 2 in the month to day 1 next month and then return a result like above.
```
1 132.8 => from 2011.01.02 to 2011.02.01
2 27.2 => from 2011.02.02 to 2011.03.01
3 21.0
4 21.8
5 88.5
6 131.4
7 118.6
8 57.1
9 80.9
10 84.6
11 1.1
12 143.5 => from 2011.12.02 to 2012.01.01
```
I t... | [
0.08925340324640274,
0.08912581950426102,
1.047255039215088,
-0.18520939350128174,
-0.2697864770889282,
0.2915925681591034,
0.09450272470712662,
-0.6018244028091431,
-0.38550809025764465,
-0.5683956146240234,
-0.3200119435787201,
-0.06435062736272812,
-0.18262851238250732,
0.01305885985493... | |
AS d
WHERE ADDDATE(d.mydate,-1) BETWEEN '2011-01-01' AND '2012-12-31'
AND d.idx_synop = '06712'
GROUP BY synmonth
```
You can check the result by adding two columns like this:
```
SELECT EXTRACT(MONTH FROM ADDDATE(d.mydate,-1) ) AS synmonth
, SUM(apcp) AS apcptot
, MIN(d.mydate) AS date_min
, MAX(d.mydate) AS date_m... | [
-0.25519895553588867,
-0.42794790863990784,
0.9202402830123901,
-0.1469319611787796,
-0.2051255851984024,
0.7549343705177307,
-0.045060496777296066,
-0.57218337059021,
-0.41027238965034485,
-0.25161486864089966,
-0.30963361263275146,
-0.1609010249376297,
0.21528466045856476,
0.272024273872... | |
might be a silly question nonetheless:
I'm playing around with the following code:
```
$a='a';
if ($_GET['a'] == $a)
echo 'true';
else
echo 'false';
```
Now, is there any way to send data to break the verification? Obviously the way it could've been done in an SQL injection won't go.
Just wondering how se... | [
0.3887348473072052,
0.3369819223880768,
0.2010957896709442,
0.07125884294509888,
-0.31425321102142334,
-0.048444364219903946,
0.47881197929382324,
-0.09296320378780365,
-0.21150586009025574,
-0.06936240941286087,
0.1642940789461136,
0.5832790732383728,
-0.04801396653056145,
-0.093235410749... | |
if you're expecting `"a"` and only `"a"` it probably shouldn't be a user input.
Validation (or sanitation), means to take whatever string they might throw at you, and make sure it's valid for whatever purpose you want it to. If it's sent to the database, pass it through `mysql_escape_string()` or use prepared statemen... | [
0.7190807461738586,
0.07298463582992554,
-0.13693413138389587,
0.004334559198468924,
-0.23476792871952057,
-0.17022040486335754,
0.5622016787528992,
-0.24168983101844788,
-0.2453942596912384,
-0.5046075582504272,
-0.22063639760017395,
0.22960209846496582,
-0.05729633569717407,
-0.005716202... | |
Hey I have an application with a bunch of inproc caching and entity framework. When I want to write an update to an entity I reattach the cached copy. I track all things I've attached in the life cycle of the context so I don't try to attach them twice.
I have an error occurring on attach (very rarely in most cases th... | [
0.27190494537353516,
0.29923033714294434,
0.12213782221078873,
0.13870154321193695,
-0.028578633442521095,
-0.19670769572257996,
0.2883579134941101,
-0.035593241453170776,
-0.27600371837615967,
-0.3565436899662018,
0.2328835129737854,
0.6622971296310425,
-0.20439980924129486,
0.20989206433... | |
a really careful look at the entity which looks normal. I think this issue is due to the attachment/detachment of a foreign key when fixups runs.
Is there a good way to get any more info on this error or can it occur for reasons other than that the entity was in a state which EF wasnt expecting?
EDIT:
DB Diagram (no... | [
0.1520480364561081,
-0.057595305144786835,
0.29328474402427673,
0.023570163175463676,
0.09170496463775635,
-0.24600021541118622,
0.545059084892273,
-0.13265113532543182,
-0.17135697603225708,
-0.5365669131278992,
0.006657870020717382,
0.43918147683143616,
-0.28749457001686096,
0.0847962498... | |
you apparently have in your model in addition to the many-to-many relationship. For example the following code would throw the exception:
```
using (var context = new MyContext())
{
var person = new Person
{
CurrentLocationId = 1,
CurrentLocation = new Location { Id = 2 }
};
context.Peo... | [
-0.39028167724609375,
-0.27494290471076965,
0.2894838750362396,
-0.024429097771644592,
0.4053366780281067,
-0.13443267345428467,
-0.190204918384552,
-0.010324584320187569,
-0.20112885534763336,
-0.5928870439529419,
-0.34211501479148865,
0.5982163548469543,
-0.27889055013656616,
0.354280650... | |
exception is thrown. (Having `CurrentLocation` as `null` though is allowed.)
In my opinion this exception can only be thrown for foreign key associations because only for this type of association you have properties that define referential constraints at all in your model. It cannot be thrown for independent associati... | [
-0.33122146129608154,
0.2342589944601059,
-0.06591277569532394,
-0.014827660284936428,
-0.1217629462480545,
-0.08978882431983948,
0.17693090438842773,
-0.1410776525735855,
-0.25930994749069214,
-0.29329532384872437,
0.026939047500491142,
0.42874449491500854,
-0.5146816968917847,
0.03130596... | |
How can I get the `application` directory path in CodeIgniter?
Is there any 'not dirty' way to do that?
I was looking through the constants but the most closer one I found was the `BASEPATH` which returns a full path to the `/system` directory, so basicly I can `str_replace` system with the application - but I'm just... | [
0.2718236446380615,
-0.04268379881978035,
0.4936683773994446,
0.16053517162799835,
0.028143692761659622,
0.05597889423370361,
0.31306564807891846,
-0.1031128540635109,
-0.17466279864311218,
-0.8156176209449768,
0.11790265887975693,
0.5371115207672119,
-0.45323383808135986,
-0.0254970211535... | |
define('APPPATH', $application_folder.'/');
}
else
{
if ( ! is_dir(BASEPATH.$application_folder.'/'))
{
exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
}
define('APPPATH', BASEPATH.$application_folder.'/');
}
``` | [
-0.3090769648551941,
0.07095631211996078,
0.37537434697151184,
-0.4028618633747101,
0.46937650442123413,
0.16231191158294678,
0.47817274928092957,
-0.281853586435318,
0.09870074689388275,
-0.8214218020439148,
-0.2677229344844818,
0.761874794960022,
-0.7739842534065247,
-0.23992548882961273... | |
I want to call an internal function once an ajax call back function is activated. Because there is a delay I want to know if my local variables will still be correct when it is called, particularly this.response\_element as it is used by the call back function.
The callback function is initiated when ajax `status == 2... | [
-0.22631052136421204,
-0.2200898379087448,
0.8114973902702332,
-0.17899426817893982,
-0.11359096318483353,
-0.159006267786026,
0.2689228653907776,
-0.4634838402271271,
0.1302732527256012,
-0.6274276971817017,
-0.3987291753292084,
0.9306554794311523,
-0.2227628529071808,
-0.2309743613004684... | |
new ControlSignIn().invoke();
};
ControlSignIn.prototype.invoke = function( )
{
if( CONSTANT.VALIDATE_ON === 1 )
{
if( !this.text_object.checkEmpty() )
{
this.message_object.display( 'empty' );
return false;
}
if( !this.text_object.checkPattern( 'email'... | [
-0.28670668601989746,
-0.2718263268470764,
0.7392694354057312,
0.06705859303474426,
0.29088833928108215,
-0.034933216869831085,
0.26988816261291504,
-0.5342206358909607,
-0.00034523941576480865,
-0.7001882195472717,
-0.18093299865722656,
0.35722947120666504,
-0.6699771285057068,
0.22132027... | |
this.message_object.display( 'email' );
return false;
}
if( !this.text_object.checkPattern( 'pass' ) )
{
this.message_object.display( 'pass' );
return false;
}
}
/* new internal call_back */ | [
-0.3181872069835663,
-0.08600446581840515,
0.5032405853271484,
-0.3694220781326294,
0.06910332292318344,
-0.00794045627117157,
0.5686497092247009,
-0.24622273445129395,
0.043794285506010056,
-0.6622565984725952,
-0.5577815175056458,
0.5107470750808716,
-0.4982527196407318,
0.11906628310680... | |
AjaxNew.use( ajaxSerialize( this.form_element ) + '&ajax_type=ControlSignIn', ControlSignIn.invoke.callBack );
function callBack( server_response_text )
{
ajaxType( server_response_text, this.response_element, 'respond' );
}
/* Removed
Ajax.repeatUse( ajaxSerialize( this.form_element ) + '&a... | [
-0.40272343158721924,
-0.2256849706172943,
0.5653826594352722,
-0.07604269683361053,
-0.3015919625759125,
-0.10188232362270355,
0.5210293531417847,
-0.13996121287345886,
-0.09525206685066223,
-0.9977352023124695,
-0.21448101103305817,
0.6343564987182617,
-0.4218807518482208,
-0.22717778384... | |
to the "application" folder
if (is_dir($application_folder))
{
define('APPPATH', $application_folder.'/');
}
else
{
if ( ! is_dir(BASEPATH.$application_folder.'/'))
{
exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
... | [
-0.2538193166255951,
0.19448363780975342,
0.6696986556053162,
-0.3788771331310272,
0.5200694799423218,
0.18646490573883057,
0.402877539396286,
-0.20613627135753632,
0.034656986594200134,
-0.7765418291091919,
-0.4925612211227417,
0.8174092173576355,
-0.6925742030143738,
0.01674395240843296,... | |
```
"<Keyboard>" does not set the required layout_height attribute:
(1) Set to "wrap_content"
(2) Set to "fill_parent"
"<Row>" does not set the required layout_width attribute:
(1) Set to "wrap_content"
(2) Set to "fill_parent"
"<Row>" does not set the required layout_height attribute:
(1) Set to "wrap_content"
(... | [
-0.012668670155107975,
-0.0001925965625559911,
0.3979656994342804,
-0.3118468225002289,
0.21460078656673431,
0.18326790630817413,
0.09446591138839722,
-0.4499170184135437,
-0.07289012521505356,
-0.8242554068565369,
-0.28427258133888245,
0.5586700439453125,
-0.30898934602737427,
0.066618986... | |
not be found:
- Keyboard (Fix Build Path, Edit XML)
- Row (Fix Build Path, Edit XML)
- com.example.android.softkeyboard.LatinKeyboardView (Fix Build Path, Edit XML, Create Class)
```
It means that your xml keyboard layout file is missing `android:layout_width` and/or `android:layout_height` for some of the components.... | [
-0.025092123076319695,
0.20258617401123047,
0.4462566375732422,
-0.07955645769834518,
0.24384433031082153,
0.31140947341918945,
0.05443491414189339,
0.14276589453220367,
-0.12466073781251907,
-0.8086198568344116,
-0.13045428693294525,
0.8670417666435242,
-0.2555314302444458,
-0.05717882513... | |
Ok this is seemingly impossible to get right. I have a text box and a select box. I want them to be the same width exactly so they line up on the left margin and the right margin.
```
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
input, select {
width: 200px;
... | [
0.46138718724250793,
0.0786375179886818,
0.5966081619262695,
-0.11694564670324326,
0.0018868137849494815,
-0.0630548745393753,
-0.08603966981172562,
-0.20828478038311005,
-0.24431554973125458,
-0.6600981950759888,
0.07628345489501953,
0.3885760009288788,
0.1260136067867279,
-0.029461409896... | |
</style>
</head>
<body>
<input type="text" value="ABC"><br>
<select>
<option>123</option>
</select>
</body>
</html>
```
That would do it you think, right? Nope. The select box is 6px shorter in Firefox. See screenshot. 
Oh wait, better test in Chrome...


Can someone tell me how to line t... | [
0.1942494958639145,
0.003914238885045052,
0.6780924797058105,
-0.05427316576242447,
-0.13008341193199158,
0.010270437225699425,
0.29420650005340576,
-0.3569032549858093,
-0.2197006493806839,
-0.9184197187423706,
0.07356976717710495,
0.6371102333068848,
0.031604573130607605,
-0.124358341097... | |
The key is to use the **box-sizing: border-box** property so when you specify the width that *includes* the border and padding. See [excellent explanation here](http://www.reddit.com/r/webdev/comments/s8u0p/wow_this_speced_behavior_was_the_source_of_so/c4c6cuy). Then the browser can't stuff it up.
Code is below, have ... | [
0.5684229135513306,
-0.14409151673316956,
0.5786138772964478,
0.10974679887294769,
-0.09109051525592804,
-0.2895159423351288,
0.3051988482475281,
-0.37707555294036865,
-0.34874504804611206,
-0.7354839444160461,
-0.11801495403051376,
0.5038158297538757,
-0.297756165266037,
-0.00375649495981... | |
<head>
<style type="text/css">
input, select {
width: 200px;
border: 1px solid #000;
padding: 0;
margin: 0; | [
-0.20210498571395874,
-0.11343789100646973,
0.9987127780914307,
0.051312003284692764,
-0.08693268150091171,
0.15466710925102234,
-0.014298186637461185,
-0.4334869384765625,
-0.20123785734176636,
-0.4762280583381653,
-0.3298613429069519,
0.16311229765415192,
0.14949366450309753,
-0.00289376... | |
height: 22px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
input { | [
0.013870742172002792,
-0.024549275636672974,
0.8423441648483276,
0.04417811706662178,
-0.06470821052789688,
0.115227609872818,
0.09582847356796265,
-0.328305184841156,
-0.3476356863975525,
-0.4770202934741974,
-0.30807071924209595,
0.25010019540786743,
0.038806475698947906,
-0.104013353586... | |
text-indent: 4px;
}
</style>
</head>
<body>
<input type="text" value="ABC"><br>
<select>
<option>123</option>
<option>123456789 123123123123</option>
<option>123456789 123123123123 134213721381212</option>
</select> | [
-0.18566027283668518,
-0.08207140117883682,
0.34729689359664917,
-0.11273791640996933,
-0.006875752005726099,
0.366702139377594,
0.053770288825035095,
-0.36496782302856445,
-0.08742274343967438,
-0.590381920337677,
-0.521084725856781,
0.6710004210472107,
-0.37387514114379883,
-0.1630643010... | |
</body>
</html>
```
Just one final warning you may not want input buttons, checkboxes etc to be included in this styling so use the `input:not([type='button'])` to not apply it to certain types or use `input[type='text'], input[type='password']` to specify ones you do want it to apply to.
This is because the `<input ... | [
0.4630230963230133,
-0.15772943198680878,
0.6601858735084534,
-0.02641131728887558,
-0.10109392553567886,
-0.1389600783586502,
0.41682901978492737,
-0.4379732608795166,
0.0385199673473835,
-0.7891167998313904,
-0.10909877717494965,
0.45697498321533203,
-0.3593670129776001,
-0.1932291835546... | |
have two options:
1. Explicitly set the border, padding and margin values to be the same for both elements
2. A CSS reset stylesheet to be included before your own CSS stylesheets
I would go with option 1. because option 2. requires a lot of work and you'll end up with tons of unnecessary CSS. But some web developers... | [
0.4111597239971161,
-0.1995953917503357,
0.18459612131118774,
0.11942986398935318,
0.060371339321136475,
-0.054415084421634674,
0.09397150576114655,
-0.4049296975135803,
-0.10502499341964722,
-0.8116202354431152,
-0.12456569820642471,
0.6879475116729736,
-0.18243944644927979,
-0.3930219113... | |
I've looked at similar questions on SO, but nothing quite matches my issue as far as I can tell.
The exception message:
> Could not load file or assembly 'CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot fi... | [
-0.06060083582997322,
0.4014607071876526,
0.531662106513977,
-0.08480267971754074,
-0.11807886511087418,
-0.07740452140569687,
0.282199889421463,
0.19641457498073578,
-0.28939059376716614,
-0.7711537480354309,
-0.007299365475773811,
0.678986132144928,
-0.3475581109523773,
0.475905239582061... | |
for this web application.
It is blowing my mind that it cannot find the file in the GAC. This is an IIS application; is there some sort of permissions issue? I would think IIS would have access to the GAC.
Some suggestions of what to do would be appreciated.
It turns out the answer was ridiculously simple, but mystif... | [
0.23311243951320648,
0.2941702902317047,
-0.08943754434585571,
-0.15774422883987427,
0.23727211356163025,
-0.16167229413986206,
0.2719947397708893,
-0.17969270050525665,
-0.304484486579895,
-0.5520901083946228,
-0.03620445355772972,
0.46963852643966675,
-0.42926424741744995,
0.370049566030... | |
I have a table that contains messages to and from users. How can I use SQL to select all of the messages that the user sent. I want to group the results by MessageSenderUserID. I also want to return only the most recent per recipient.
I tried to use MAX in a having clause, but it seems that's not the correct solution.... | [
0.05609942227602005,
0.03165702521800995,
0.6285944581031799,
-0.027052754536271095,
-0.2504715919494629,
0.4119986593723297,
0.0894225537776947,
-0.34035050868988037,
-0.347756564617157,
-0.5272156000137329,
-0.02850693091750145,
0.403637170791626,
-0.09816894680261612,
0.0890970155596733... | |
top 1 item in a group:
```
select top 1 with ties
MessageID,
MessageSent,
MessageSenderUserID,
MessageRecipientUserID
from [Messaging_Message]
order by row_number() over (partition by MessageSenderUserID
order by MessageSent desc)
```
Trick is in order by - results are... | [
-0.7419002056121826,
-0.19749228656291962,
0.4205445647239685,
0.03753580152988434,
-0.2741847336292267,
0.4020393192768097,
0.10293451696634293,
-0.5666049718856812,
-0.3751494586467743,
-0.610944926738739,
-0.5767261981964111,
-0.10615575313568115,
-0.4500005841255188,
-0.093350097537040... | |
Oh joy of applied mechanic! | [
0.42869114875793457,
0.5377955436706543,
0.22194473445415497,
0.13921526074409485,
-0.21849755942821503,
-0.48786258697509766,
0.020349206402897835,
0.5056514739990234,
-0.14894311130046844,
-0.5440860390663147,
0.1083560362458229,
0.5679936408996582,
0.4182080924510956,
0.6672547459602356... | |
I'm building a web-app which is communicating with a database. I want the web-app to download all info from my database and then save it locally so it can be accessed and edited (even if the user is offline) locally and then synced back to my database (when the user is online).
Every row in my database consists of 2 ... | [
0.3727060556411743,
0.37201324105262756,
0.20426183938980103,
0.24186454713344574,
0.015312083065509796,
0.33783063292503357,
0.1380731761455536,
-0.057027667760849,
-0.12410445511341095,
-0.5923769474029541,
0.24392186105251312,
0.1074908971786499,
-0.0606406033039093,
0.3030106723308563,... | |
data on the users device somehow? Like retrieving the database via JSON and than storing it locally in a javascript array which the user can access and work on (as mentioned: the later part should be able to work even if the user is offline). All input on this is greatly appreciated. Am I at least thinking in the right... | [
0.4574957489967346,
0.20380495488643646,
0.35213804244995117,
0.2758448123931885,
-0.018748942762613297,
-0.07165002077817917,
0.18071159720420837,
-0.05744442716240883,
-0.27088287472724915,
-0.4852852523326874,
-0.01432510931044817,
0.5754331946372986,
-0.0481049045920372,
-0.22554945945... | |
are using web technologies to develop your mobile app is to use SQLite.You can store, retrieve your data in offline or online mode. Also another advantage is you can port your database to any mobile device or Desktop app if you decided to go native.
If you have more question or require help contact me and i can give ... | [
0.575177013874054,
0.30202093720436096,
0.25422403216362,
0.20173154771327972,
0.16016100347042084,
0.056700851768255234,
0.014033976010978222,
0.0806763768196106,
-0.2569452226161957,
-0.8803083300590515,
0.17471711337566376,
0.40154966711997986,
-0.17355073988437653,
0.1016109362244606,
... | |
some native API's on the device. I recommend Sencha: <http://www.sencha.com/products/touch/> (Really nice framework base on Html5, JS, CSS3) | [
0.010829182341694832,
-0.016862014308571815,
0.24132829904556274,
0.007665584795176983,
-0.18167363107204437,
0.10843999683856964,
0.33402910828590393,
0.0653526708483696,
0.063105009496212,
-0.693303644657135,
-0.06110144034028053,
0.671625554561615,
-0.002520581940189004,
-0.187413647770... | |
I want to run an if before updating a form view;
if yes then..."message" & cancel update query
if no continue update query.
i've tried this but i'm getting a "obeject instance not set to null instance......" on the first line of the if? and the item updates regardless
```
Private Sub FormView2_ItemUpdating(sender As... | [
0.30919256806373596,
-0.08042073249816895,
1.0161370038986206,
-0.0997871607542038,
0.190515398979187,
-0.11155705153942108,
0.3898138403892517,
-0.4207409918308258,
0.12044250220060349,
-0.6790533065795898,
-0.1664324700832367,
0.4913914203643799,
-0.30123838782310486,
0.3006902039051056,... | |
it has already been responded to"
Else
HolidayDetailsdatasource.Update()
End If
```
Anyone aware of a better was of achieving something like this?
exact error:
```
System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object.
Source=W... | [
0.07227566093206406,
0.060169681906700134,
0.6865182518959045,
0.18115933239459991,
-0.15630510449409485,
0.05821666494011879,
0.7826728224754333,
-0.5429713129997253,
-0.26413199305534363,
-0.5281534790992737,
-0.19239917397499084,
0.42046329379081726,
0.023711327463388443,
0.041176330298... | |
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
at Sys... | [
-0.21854901313781738,
-0.08180547505617142,
0.7494999170303345,
-0.1708536297082901,
0.10460837930440903,
0.03071783483028412,
0.18401524424552917,
-0.3768930733203888,
-0.3280528485774994,
-0.8152673840522766,
-0.4055168032646179,
0.5032545924186707,
0.021618109196424484,
-0.0427982471883... | |
solve your problem. | [
0.03747672960162163,
0.5094025731086731,
-0.17763034999370575,
0.2851730287075043,
0.15301357209682465,
0.2507392466068268,
0.332181453704834,
0.317959725856781,
-0.36040088534355164,
-0.4818113446235657,
-0.3019368350505829,
0.44761285185813904,
-0.5687540769577026,
-0.16769948601722717,
... | |
Sorry for this most likely simple question.
I am running a script on submission of the form (code below), but first I would like to validate the form (contains one text box which must be an email) before the code is executed.
The script below is taken from here to ensure the form data is passed along to the colorbox ... | [
0.4519972503185272,
0.029813727363944054,
0.33526021242141724,
0.39347290992736816,
-0.010249770246446133,
-0.26274311542510986,
0.2892468273639679,
0.012699751183390617,
-0.10658819228410721,
-0.8086476922035217,
0.11434420943260193,
0.5805245041847229,
-0.041813429445028305,
0.2420205622... | |
command still runs even if it doesn't validate and i am not sure how to edit it so it doesn't.
```
$(document).ready(function() {
$("input#SearchButton").colorbox({href: function(){
var url = $(this).parents('form').attr('action');
var ser = $(this).parents('form').serialize(); //alert(url+'?'+ser);
retu... | [
0.04482920840382576,
-0.21519450843334198,
0.941021203994751,
-0.19844010472297668,
0.44133898615837097,
0.12801438570022583,
0.45320993661880493,
-0.514873206615448,
-0.16861017048358917,
-0.37450242042541504,
-0.51412034034729,
0.8040271401405334,
-0.10625389963388443,
0.1432601809501648... | |
an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must co... | [
-0.26142361760139465,
-0.03009972535073757,
0.6769466996192932,
-0.013786345720291138,
0.058357272297143936,
-0.10927040129899979,
0.5215019583702087,
-0.12063169479370117,
0.008559690788388252,
-0.7595725059509277,
-0.5777097940444946,
0.3839206397533417,
-0.2523665130138397,
-0.298314750... | |
is:
```
<input name="submit" type="image" onclick="MM_validateForm('email','','RisEmail');return document.MM_returnValue" src="images/go-button.gif" alt="Go! Get quote now!" align="top" : id="SearchButton"/>
```
In a nutshell: I want to tigger the code in the first snippet if the form validates using the code in th... | [
0.4542813301086426,
-0.0646592304110527,
1.0635474920272827,
-0.09454001486301422,
-0.09711427241563797,
0.14054688811302185,
-0.035214152187108994,
-0.31560954451560974,
-0.15233393013477325,
-0.49484533071517944,
-0.23000723123550415,
0.7865163087844849,
-0.3275144100189209,
-0.054594188... | |
> **Possible Duplicate:**
>
> [Compare two Lists for differences](https://stackoverflow.com/questions/675699/compare-two-lists-for-differences)
this is myfunction
```
public List<String[]> comparableListsAreTheSame(List<String> baseList, List<String> resultList, int type)
{
if (type == 1) { }
... | [
0.24042291939258575,
-0.11171798408031464,
0.6344754695892334,
-0.12476204335689545,
-0.4551204741001129,
0.07303828746080399,
0.346783310174942,
-0.5084453821182251,
-0.34086528420448303,
-0.5902531743049622,
0.5374521017074585,
0.07148091495037079,
-0.40457502007484436,
0.187072083353996... | |
List<String> Result = resultListCopy.Except(baseListCopy, StringComparer.InvariantCultureIgnoreCase).ToList(); //Keep unique values
List<String[]> blocksComparisonSet1 = new List<String[]>(); //we add blocks based on list1; so we could output them to excel
List<String[]> blocksComparisonSet2 = new Lis... | [
0.12840838730335236,
-0.27966418862342834,
0.6785720586776733,
-0.14244444668293,
-0.16387023031711578,
-0.015584796667098999,
0.1819084733724594,
-0.8721998333930969,
-0.5115020871162415,
-0.41030216217041016,
-0.168508380651474,
0.19783547520637512,
-0.5802120566368103,
-0.21504943072795... | |
> 0 || Base.Count > 0)
{
foreach (String resultLine in Result) //loop over all lines in list 1
{
bool found = false; //if element in base i
String[] resultLineArray = resultLine.Split('*'); //get array from the string | [
0.1422196328639984,
-0.4000932276248932,
0.2984992265701294,
-0.47948625683784485,
0.03948816657066345,
-0.021045558154582977,
0.4501952528953552,
-0.703392744064331,
-0.11622295528650284,
-0.06218364089727402,
-0.24386732280254364,
0.09806952625513077,
-0.4800758361816406,
-0.055743984878... | |
foreach (String baseLine in Base)
{
String[] baseLineArray = baseLine.Split('*');
if (resultLineArray[0].Equals(baseLineArray[0]) && resultLineArray[1].Equals(baseLineArray[1]) && resultLineArray[2].Equals(baseLineArray[2]) && resultLineArray[3].Equals(baseLineArr... | [
0.07340285181999207,
-0.03768433257937431,
0.46196165680885315,
-0.497823029756546,
0.04701462760567665,
0.23027023673057556,
0.13132460415363312,
-0.47082266211509705,
0.040469422936439514,
-0.23164181411266327,
-0.031881172209978104,
0.4069911539554596,
-0.1896500587463379,
-0.2955822348... | |
{
String[] NA = new String[2]; //keep results
NA[0] = baseLine; //[0] for base
NA[1] = resultLine; //[1] for result | [
0.09609004855155945,
-0.29905572533607483,
0.20673702657222748,
-0.2636294364929199,
-0.11328273266553879,
0.2387334406375885,
0.40138986706733704,
-0.6436401009559631,
-0.21006587147712708,
-0.19326812028884888,
-0.20017223060131073,
0.2612185478210449,
-0.09507058560848236,
0.03821875527... | |
blocksComparisonSet1.Add(NA);
found = true;
}
}
if (!found) | [
0.1007099449634552,
-0.16454322636127472,
-0.3764561712741852,
-0.10124112665653229,
0.09089608490467072,
-0.12921671569347382,
0.7573610544204712,
-0.2175316959619522,
-0.2950402498245239,
-0.3608095347881317,
-0.170168936252594,
0.154182568192482,
-0.41599586606025696,
0.0544328838586807... | |
{
String[] NA = new String[2]; //keep results
NA[0] = "N/A"; //[0] for base
NA[1] = resultLine; //[1] for result | [
-0.0029999176040291786,
-0.28635817766189575,
0.16870339214801788,
-0.2658676505088806,
-0.05277698487043381,
0.29176563024520874,
0.42192259430885315,
-0.6576412320137024,
-0.23700375854969025,
-0.17711803317070007,
-0.34010520577430725,
0.2540915906429291,
-0.1424371600151062,
0.07223124... | |
blocksComparisonSet1.Add(NA);
}
}
//-----------------------------------------------------------------
foreach (String baseLine in Base) //loop over all lines in list 2
{
bool found = false; | [
-0.0655650869011879,
-0.22563958168029785,
-0.14871466159820557,
-0.1615300178527832,
0.0010096357436850667,
-0.08346925675868988,
0.657862663269043,
-0.23446647822856903,
-0.15053676068782806,
-0.2503763735294342,
-0.2954787313938141,
0.1638103723526001,
-0.4494361877441406,
-0.2459277957... | |
//if element in base i
String[] baseLineArray = baseLine.Split('*'); //get array from the string
foreach (String resultLine in Result)
{
String[] resultLineArray = resultLine.Split('*'); | [
0.3185042142868042,
-0.4630369544029236,
0.2238006591796875,
-0.37406450510025024,
0.0121869295835495,
0.14100275933742523,
0.1461888551712036,
-0.642337441444397,
-0.09690655767917633,
-0.08244458585977554,
-0.20645448565483093,
0.366071492433548,
-0.10567370057106018,
-0.1529342532157898... | |
if (resultLineArray[0].Equals(baseLineArray[0]) && resultLineArray[1].Equals(baseLineArray[1]) && resultLineArray[2].Equals(baseLineArray[2]) && resultLineArray[3].Equals(baseLineArray[3]))
{
String[] NA = new String[2]; //keep results
NA[0] = baseLine... | [
0.05991610884666443,
-0.2420722246170044,
0.2301061898469925,
-0.32441914081573486,
-0.05170385167002678,
0.1139015480875969,
0.320095032453537,
-0.7374534010887146,
-0.02534468099474907,
-0.29955312609672546,
0.1009596437215805,
0.2330315113067627,
-0.20259681344032288,
-0.176473066210746... | |
NA[1] = resultLine; //[1] for result
blocksComparisonSet2.Add(NA);
found = true;
} | [
0.002474480541422963,
-0.15837840735912323,
-0.2072605937719345,
-0.2318924069404602,
-0.033582765609025955,
0.18544426560401917,
0.6333344578742981,
-0.4859086573123932,
-0.2202049195766449,
-0.32889723777770996,
-0.057205066084861755,
-0.007398270070552826,
-0.1798059046268463,
0.1936081... | |
}
if (!found)
{
String[] NA = new String[2]; //keep results
NA[0] = baseLine; //[0] for base | [
0.1362611949443817,
-0.28047245740890503,
-0.1424797773361206,
-0.38041064143180847,
0.17054329812526703,
-0.01118948683142662,
0.3229943513870239,
-0.3738689720630646,
-0.022949175909161568,
-0.24204696714878082,
-0.05298226699233055,
0.38162052631378174,
-0.06873754411935806,
0.002330736... | |
NA[1] = "N/A"; //[1] for result
blocksComparisonSet2.Add(NA);
}
}
}
//-----------------------------------------------------------------
if (blocksComparisonSet1.Any() || blocksComparisonSet2.Any()) //check if we have any values in | [
-0.21232886612415314,
-0.005650702398270369,
-0.05486010015010834,
-0.2518731653690338,
0.06342817842960358,
0.12143907696008682,
0.5699151158332825,
-0.34203362464904785,
-0.29750263690948486,
-0.4936871826648712,
-0.11582960933446884,
0.15905067324638367,
-0.15759716928005219,
0.15585666... | |
out differences lists. if we do, merge them
{
blocksComparisonFinal.AddRange(blocksComparisonSet1); //add records from one list to final list
blocksComparisonFinal.AddRange(blocksComparisonSet2); //add records from second list to final list
HashSet<String[]> s = new HashSet<S... | [
-0.2486758530139923,
-0.2508791387081146,
0.411873459815979,
-0.18453949689865112,
-0.12183774262666702,
0.3076118230819702,
0.28427234292030334,
-0.4758528470993042,
-0.39626023173332214,
-0.5183170437812805,
-0.12859126925468445,
0.17927628755569458,
-0.5601621866226196,
0.13512405753135... | |
blocksComparisonFinal = blocksComparisonSet1.Union(blocksComparisonSet2, new ArrayEqualityComparer<string>()).ToList();
return blocksComparisonFinal;
}
```
I am new to C# and programming in general and I did multiple loops and matched everything in pretty barabric way. Can I approach it more professional ... | [
0.3476127088069916,
0.1427382230758667,
0.5342771410942078,
-0.2073884904384613,
-0.17298080027103424,
0.10549444705247879,
0.25095656514167786,
-0.4060625731945038,
-0.3282436430454254,
-0.4558510482311249,
-0.10539019107818604,
0.5977123379707336,
-0.33124101161956787,
0.0030938871204853... | |
I'm trying to make a 10-band equalizer and the `kAudioUnitSubType_NBandEQ` audio unit seems the way to go, but Apple's documentation doesn't cover how to set/configure it.
I've already connected the nodes but it errors out when I try to connect the EQNode with the iONode (output): <https://gist.github.com/2295463>
Ho... | [
0.045201078057289124,
0.2089359313249588,
0.5100803971290588,
-0.22861362993717194,
-0.11399433761835098,
0.07156219333410263,
0.2525310516357422,
-0.6510930061340332,
-0.07069786638021469,
-0.7379022836685181,
-0.08852372318506241,
0.5282266736030579,
-0.41482385993003845,
-0.079560577869... | |
configured as any one of the types described in “Mutitype EQ Unit Filter Types” (page 68)."
Source: <http://developer.apple.com/library/ios/DOCUMENTATION/AudioUnit/Reference/AudioUnit_Framework/AudioUnit_Framework.pdf>
But still no example.
**IMPORTANT Update (17/05):** I recommend everyone to use my DSP class I relea... | [
0.38156643509864807,
-0.307653546333313,
0.5609733462333679,
0.04381580650806427,
-0.015828344970941544,
-0.22626635432243347,
0.20036709308624268,
-0.5345092415809631,
-0.039058852940797806,
-0.8069941401481628,
0.035357143729925156,
0.612942099571228,
-0.46125519275665283,
0.020896475762... | |
IIR filter. You can find 2nd order Butterworth coefficients on musicdsp.org, or more generally by Googling. Matlab will also calculate them for you, if you have access to a copy. I used musicdsp.org. You'd create 10 vDSP\_deq22 filters, run your audio through each one, multiply that band by a specified gain, and then a... | [
0.2258814573287964,
-0.349748432636261,
0.5349612236022949,
-0.13114602863788605,
-0.34131234884262085,
0.12669265270233154,
0.21198341250419617,
-0.84373939037323,
0.034360870718955994,
-0.7335005402565002,
0.23196940124034882,
0.6422719359397888,
-0.45239341259002686,
0.21578150987625122... | |
I've got an ajax call that collects XML, and based on that data creates a number of divs on which I attach click() jquery listeners. When clicked, I want those divs to call a function and to pass a parameter into that function. However, by the time the click is called the value of the parameter has changed. Here's an e... | [
0.3455181419849396,
0.07364143431186676,
0.38954687118530273,
-0.05968005955219269,
-0.14186260104179382,
-0.14221538603305817,
-0.07914391905069351,
0.04438481479883194,
-0.04636703059077263,
-0.5741398930549622,
-0.015925195068120956,
0.6299962401390076,
-0.3448109030723572,
-0.052244804... | |
url: "/echo/xml/",
dataType: "xml",
data: {
xml: "<the>xml</the>"
},
success: function(xml) {
console.log('success');
$('#test').show(); | [
0.44889771938323975,
0.0066759842447936535,
0.2874821126461029,
0.18452590703964233,
0.017798220738768578,
-0.03498076647520065,
0.29715439677238464,
-0.2114030420780182,
0.328806072473526,
-0.16546042263507843,
-0.45187050104141235,
0.4098556935787201,
0.06498540937900543,
0.2331521809101... | |
var text = "CORRECT";
$('#test').click(function() {
insertText(text);
console.log(text);
});
text = "WRONG";
}
});
}
x();
}); | [
-0.18454156816005707,
-0.020128075033426285,
0.4412820041179657,
-0.32508397102355957,
0.3351876437664032,
0.11991956830024719,
0.5033342242240906,
-0.2478603571653366,
0.29518964886665344,
-0.32743391394615173,
-0.5592809319496155,
0.7994477152824402,
-0.42947515845298767,
0.0702815949916... | |
function insertText(t) {
$('#test').html(t);
}
```
I want the text to show up as CORRECT, not WRONG.
I know this is a bit of a convoluted example but I'm trying to simulate my actual code as much as possible in terms of scope and what is going on. By the time the `click()` function gets called based on a c... | [
0.5196857452392578,
0.008107619360089302,
0.10207132995128632,
-0.12324365973472595,
0.18645079433918,
0.07335472106933594,
0.3030170500278473,
-0.06576522439718246,
0.2429787516593933,
-0.4340958595275879,
0.05196724086999893,
0.968539834022522,
-0.4541260898113251,
-0.2533625066280365,
... | |
loop as it runs through the XML and don't want to hang on to all that data into variables for use later.
You cannot pass in the redirection character (>) as an argument to spawn, since it's not a valid argument to the command.
You can either use `exec` instead of spawn, which executes whatever command string you give i... | [
0.6067755222320557,
-0.3752932548522949,
0.14886987209320068,
0.02254772000014782,
0.1216450184583664,
-0.022924359887838364,
0.5262875556945801,
-0.42566561698913574,
-0.11591088026762009,
-0.233754500746727,
-0.23090960085391998,
0.3195919394493103,
-0.6802005171775818,
0.175085470080375... | |
So I've searched high and low but couldn't find an answer to my question. What I basically need is the behavior provided by Android's ViewFlipper or ViewPager but I want to display portions of the left and right views, to indicate the user there are elements to scroll, instead of having the selected view occupying the ... | [
0.2613190710544586,
-0.1740269958972931,
0.43344810605049133,
0.12815971672534943,
-0.10195359587669373,
0.1652134358882904,
0.16036561131477356,
-0.18831686675548553,
-0.17107625305652618,
-0.5732057690620422,
0.3884890675544739,
0.7001588940620422,
-0.19962921738624573,
-0.05340172350406... | |
view group, à la cover flow (<http://www.inter-fuser.com/2010/01/android-coverflow-widget.html>)?
(P.S. I don't want to use the Gallery widget, that component sucks).
This is what we need to display once a view is selected (left and right views are still displayed):
. This method can receive a negative value which will make the fragments/views to overlap each other. To arrive at the desired layout, we first dynamically calculated the left and right margins by a percentage of the screen. This can be done statically as well but s... | [
0.1494397521018982,
-0.258735716342926,
0.7352211475372314,
0.06210317462682724,
-0.4140208065509796,
-0.014551602303981781,
0.12959814071655273,
-0.21257252991199493,
-0.10463789105415344,
-0.7660229206085205,
0.13299940526485443,
0.3672507703304291,
-0.13780704140663147,
0.22419221699237... | |
than one view being displayed by the ViewPager.
All you have left to do is to either apply a transform (scale) to the views to the left and right (Android 3.0+) or add some more margins around them to shrink them to the right size (pre 3.0).
The OnPageChangeListener.onPageScrolled() can be used to track the ViewPager... | [
0.03449896723031998,
-0.49221909046173096,
1.1422520875930786,
0.11240553110837936,
0.0924517810344696,
0.1056521013379097,
0.0664815828204155,
-0.30141595005989075,
-0.028582124039530754,
-0.9905751347541809,
0.17521925270557404,
0.8964307308197021,
-0.24255703389644623,
0.169476300477981... | |
int positionOffsetPixels) {
// positionOffset varies from 0 to 1 and indicates how far the view is
// from the center of the ViewPager. When a view is selected (centered), this
// value is 0.
// Fades the text in an out while the ViewPager scrolls from one view to another.
// O... | [
-0.4291881024837494,
-0.3564215898513794,
0.8683760762214661,
-0.1852329671382904,
-0.014803929254412651,
0.26194125413894653,
-0.15506218373775482,
-0.04786589369177818,
0.00785267073661089,
-0.7194986939430237,
-0.07170533388853073,
0.39642322063446045,
-0.10422816127538681,
0.0236068721... | |
the screen and
// do not scroll along with the views.
if (positionOffset < 0.5) {
setTextViewAlpha(1 - positionOffset * 2);
} else {
setTextViewAlpha((positionOffset - 0.5f) * 2);
}
// It's surprisingly complicated to get the current object being displaye... | [
-0.071053646504879,
-0.23391452431678772,
0.8291832208633423,
-0.10187079757452011,
-0.031892091035842896,
0.07195489853620529,
0.01975604146718979,
0.09164626151323318,
-0.09289415925741196,
-0.7092369198799133,
-0.23395270109176636,
0.5605159401893616,
-0.016206618398427963,
0.1200613752... | |
// a ViewPager (there's no getCurrentObject method). ScaleableFragment is just
// a custom class to allow an adapter to cache it internally and also correctly
// manage a fragment's lifecycle and restore from a saved state.
ScaleableFragment sampleFragment = (ScaleableFragment) ((ShowHeroShotIma... | [
0.12188395112752914,
-0.2670978009700775,
0.4123968482017517,
0.21537503600120544,
-0.03636459633708,
0.06986713409423828,
0.3597336411476135,
-0.2968590259552002,
-0.29540500044822693,
-0.5727053284645081,
0.037922389805316925,
-0.022961191833019257,
0.05445506423711777,
0.362650752067565... | |
will be scaled down. The RATIO_SCALE
// is 0.3 in our case, which makes the side views 70% of the size of the
// center view. When centered, the scale will be 1. When
// fully scrolled, the scale will be 0.7.
float scale = 1 - (positionOffset * RATIO_SCALE);
// Just a shortcut t... | [
0.12331947684288025,
-0.3353632688522339,
1.1035844087600708,
0.0014666578499600291,
-0.108949676156044,
0.19394659996032715,
0.17029932141304016,
-0.3087683618068695,
0.055723775178194046,
-0.6455161571502686,
0.1829303652048111,
0.6218588948249817,
0.26580899953842163,
0.0395329259335994... | |
// Now, if not in the last element, scale the next one up (in opposite direction).
if (position + 1 < pager.getAdapter().getCount()) {
sampleFragment = (ScaleableFragment) ((ShowHeroShotImageFragmentPagerAdapter) pager.getAdapter())
.getItem(position + 1);
scale = pos... | [
-0.22053362429141998,
-0.45975515246391296,
0.879966676235199,
-0.28614622354507446,
0.12207704037427902,
0.23619432747364044,
0.1683533638715744,
-0.6618650555610657,
-0.24690426886081696,
-0.6143017411231995,
-0.14440731704235077,
0.2512589395046234,
0.10121002048254013,
0.15803311765193... | |
sampleFragment.scaleImage(scale);
}
}
// Once scrolling is done. Make sure the views are in the right scale (1 for center,
// 0.7 for sides). Required as the onPageScrolled() method does not guarantee it
// will interpolate to 1.0 precisely.
@Override
public void onPageScrollStateChange... | [
0.34138160943984985,
-0.4200006425380707,
1.0666916370391846,
-0.07396961003541946,
0.15460187196731567,
0.006842498667538166,
0.36842989921569824,
-0.506504476070404,
0.007579735014587641,
-0.5639742612838745,
-0.049199365079402924,
0.5676275491714478,
-0.1653960794210434,
0.1536947637796... | |
ScaleableFragment sampleFragment = (ScaleableFragment) ((ShowHeroShotImageFragmentPagerAdapter) pager
.getAdapter()).getItem(pager.getCurrentItem());
sampleFragment.scaleImage(1);
sampleFragment.enableClicks();
if (pager.getCurrentItem() > 0) {
sa... | [
-0.10546424984931946,
-0.3627520799636841,
1.0000203847885132,
-0.08510317653417587,
0.09618259966373444,
0.1551481932401657,
0.4892079532146454,
-0.7554247975349426,
-0.22066597640514374,
-0.46581387519836426,
-0.06973646581172943,
0.16631776094436646,
-0.1992136836051941,
0.2638988196849... | |
.getItem(pager.getCurrentItem() - 1);
sampleFragment.scaleImage(1 - RATIO_SCALE);
sampleFragment.disableClicks();
}
if (pager.getCurrentItem() + 1 < pager.getAdapter().getCount()) { | [
-0.09531655162572861,
-0.3884163200855255,
0.5925963521003723,
-0.1922788769006729,
0.1756167709827423,
0.14274249970912933,
0.3533226549625397,
-0.7022376656532288,
-0.04261819273233414,
-0.4467030167579651,
-0.38886284828186035,
0.33309319615364075,
-0.3800603747367859,
-0.02721571363508... | |
sampleFragment = (ScaleableFragment) ((ShowHeroShotImageFragmentPagerAdapter) pager.getAdapter())
.getItem(pager.getCurrentItem() + 1);
sampleFragment.scaleImage(1 - RATIO_SCALE);
sampleFragment.disableClicks();
}
}
}
};
```
This is it. I... | [
-0.028821628540754318,
-0.08344081044197083,
0.8400012254714966,
-0.11315605789422989,
0.2635103762149811,
0.12701795995235443,
0.6600987911224365,
-0.6536588668823242,
-0.09247581660747528,
-0.34027716517448425,
-0.11002001166343689,
0.2876720130443573,
-0.2161247730255127,
0.072844602167... | |
hope this is enough to get someone else started.
P.S. On 3.0+ enable hardware acceleration. Without it, the scrolling looked choppy on a samsung galaxy tab 10.1. | [
0.1693798154592514,
-0.090667724609375,
0.8159371614456177,
0.29968762397766113,
0.1035492941737175,
-0.023656275123357773,
0.35409268736839294,
0.24232779443264008,
-0.2726617157459259,
-0.828027606010437,
0.19771338999271393,
0.37285828590393066,
0.08755587786436081,
-0.3051559031009674,... | |
First: apologies for the question title, I don't actually know what the problem is so I don't know how to ask about it.
I want to diff my master with upstream master (should be origin/master, based on the way my remotes are set up).
But: origin was put there *after* I had been working on it locally for a while, so it... | [
-0.08566191792488098,
0.09326207637786865,
0.44040653109550476,
0.15657199919223785,
-0.006127339322119951,
0.12989187240600586,
-0.0867178663611412,
-0.12165766209363937,
-0.29770076274871826,
-0.7296341061592102,
0.25201740860939026,
0.3614997863769531,
-0.24528683722019196,
0.5343183279... | |
or path not in the working tree.
$ git diff master origin/master --
fatal: bad revision 'origin/master'
```
Hm.
```
$ git remote -v
origin git@example.com:example (fetch)
origin git@example.com:example (push)
```
okay, that looks right.
```
$ git branch -a
... # nothing from origin
```
Hm.
```
$ git fetch -... | [
-0.3053516745567322,
0.010612099431455135,
0.569949746131897,
0.08868599683046341,
0.3136981129646301,
-0.05822502449154854,
0.3364367187023163,
-0.04868995398283005,
-0.2977113425731659,
-0.5041658878326416,
-0.20364506542682648,
0.5345622897148132,
-0.04988783225417137,
0.516684293746948... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.