text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
int row = Math.Max(0, Math.Min(rows, rows - rowFromBottom.Value - rowSpanFromBottom.Value));
Grid.SetRow((UIElement) d, row);
}
private static void OnRowSpanFromBottomChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var grid = GetContainingGrid(d);
int? rowFromBot... | [
-0.16080480813980103,
-0.48244497179985046,
0.7564805746078491,
-0.2591390013694763,
0.3173200786113739,
0.31524980068206787,
0.4216194748878479,
-0.25657376646995544,
-0.05410386621952057,
-0.4067800045013428,
-0.2568143606185913,
0.729555070400238,
-0.4214532673358917,
0.3965426385402679... | |
int rows = grid.RowDefinitions.Count;
int row = Math.Max(0, Math.Min(rows, rows - rowFromBottom.Value - rowSpanFromBottom.Value));
Grid.SetRow((UIElement)d, row);
Grid.SetRowSpan((UIElement)d, rowSpanFromBottom.Value);
}
public static int? GetRowFromBottom(DependencyObject obj)
{
... | [
-0.006569111719727516,
-0.22307172417640686,
0.679635763168335,
-0.13436800241470337,
0.20761629939079285,
0.5177831053733826,
0.4256356656551361,
-0.15944191813468933,
-0.18255791068077087,
-0.45516905188560486,
-0.4331185817718506,
0.7597636580467224,
-0.5238534808158875,
0.3700644671916... | |
static int? GetRowSpanFromBottom(DependencyObject obj)
{
return (int?)obj.GetValue(RowSpanFromBottomProperty);
}
public static void SetRowSpanFromBottom(DependencyObject obj, int? value)
{
obj.SetValue(RowSpanFromBottomProperty, value);
}
private static Grid GetContainingGrid(D... | [
-0.1255781203508377,
-0.5987861752510071,
0.5822221040725708,
-0.21132756769657135,
0.20202851295471191,
0.21757164597511292,
0.3230849504470825,
-0.1418560892343521,
-0.0075270445086061954,
-0.41495850682258606,
-0.30225053429603577,
0.6782752275466919,
-0.623665988445282,
0.1649481505155... | |
element = LogicalTreeHelper.GetParent(element);
grid = element as Grid;
}
return grid;
}
}
```
If you have any questions about what's going on here, feel free to ask. | [
0.04780660197138786,
0.016226019710302353,
0.060635846108198166,
0.020222214981913567,
0.09690172225236893,
-0.4622616469860077,
0.21581867337226868,
0.15808939933776855,
-0.06130280718207359,
-0.756601095199585,
-0.10811817646026611,
0.38410070538520813,
-0.3791985511779785,
0.04264485463... | |
I am building DB class, in the constructor I want to establish the connection with database, so that static dbLink is accessible by the rest of the functions inside that class. Is that a good approach?
As to the concrete question, surely it's legal to throw exceptions in a constructor. There's no other sane way to prev... | [
0.383973628282547,
0.25829407572746277,
-0.09323032200336456,
0.10923925787210464,
-0.17826148867607117,
-0.2948892116546631,
0.29769930243492126,
-0.07101205736398697,
-0.3127472996711731,
-0.3672475814819336,
-0.0914672464132309,
0.396846204996109,
-0.5107251405715942,
0.4438101053237915... | |
you're intending to keep the connection open as long as the instance of the "DB class" lives in Java's memory. This is in turn a very bad idea. The connection should instead be created in the very same `try` block as where you're executing the SQL query/queries. The connection should also be closed in the `finally` blo... | [
0.06636158376932144,
0.16933667659759521,
-0.051445260643959045,
-0.08502582460641861,
0.03260860964655876,
-0.40960779786109924,
0.44719037413597107,
-0.08812083303928375,
-0.2503971755504608,
-0.6912071108818054,
-0.3461386263370514,
0.22625420987606049,
-0.3293878734111786,
0.4296028316... | |
have been opened.
### See also:
* [How often should Connection, Statement and ResultSet be closed in JDBC?](https://stackoverflow.com/questions/5602772/how-often-should-statement-and-resultset-objects-be-closed-in-jdbc)
* [JDBC MySql connection pooling practices to avoid exhausted connection pool](https://stackoverfl... | [
-0.07193069159984589,
0.1904335618019104,
0.7610127925872803,
-0.20588591694831848,
0.06665373593568802,
-0.06504254043102264,
0.1743520349264145,
-0.1456192433834076,
-0.6787245869636536,
-0.5925957560539246,
-0.5991950631141663,
0.6623451709747314,
-0.11772960424423218,
0.078526124358177... | |
I have a query that transfers data from multiple slave tables into a single master table. Here's an example of one of my queries:
```
$insert = mysql_query("
INSERT IGNORE INTO master (title, description, keywords, url, uniqueid, city, state, zip, datetime, expiretime)
SELECT title, description, keywords, url, uniquei... | [
0.2407078593969345,
0.051702190190553665,
0.3153666853904724,
0.012330866418778896,
0.21545156836509705,
0.13233758509159088,
0.050056856125593185,
-0.40690216422080994,
-0.349734902381897,
-0.6997644305229187,
-0.01675078086555004,
-0.0868259072303772,
-0.41628849506378174,
0.557543694972... | |
and `city`)
It seems like mysql is completely ignoring the `IS NOT NULL` parameter. Does anyone know a solution?
Try replace `zip IS NOT NULL` to `TRIM(zip) <> ""` | [
0.4448513686656952,
-0.12085110694169998,
0.38430699706077576,
0.28777259588241577,
0.017301922664046288,
-0.4381406009197235,
0.4282015264034271,
0.10732650756835938,
-0.18598902225494385,
-0.5695112943649292,
-0.3364501893520355,
0.1620919406414032,
-0.560193657875061,
-0.089028954505920... | |
I'm doing research on doing builds using TFS2010 Team Build. At the moment we are using Nant Scripting to build .NET code as well as launching external processes to build VB6 projects. We are slowly converting our VB6 over to .NET but would like to gain the benefits of automating as much as possible. How can we launch ... | [
0.6105917096138,
0.015430889092385769,
-0.4687064588069916,
0.13933172821998596,
-0.21878385543823242,
-0.236252561211586,
0.2304995357990265,
0.3090584874153137,
-0.4361841082572937,
-0.6558833718299866,
0.07883872836828232,
0.49602198600769043,
-0.3073945939540863,
0.1303061544895172,
... | |
thread should be dispatched, another instance of a class won't help that. | [
0.4118961989879608,
-0.2768317461013794,
0.04262997955083847,
0.3138507306575775,
-0.16014212369918823,
0.028548797592520714,
0.14299863576889038,
-0.041083112359046936,
-0.3252089321613312,
-0.34948036074638367,
0.19664625823497772,
0.0874059870839119,
-0.16917525231838226,
-0.05146192759... | |
I want to make a gui for what i explained here [C# visual control for editing statements / equations / conditions?](https://stackoverflow.com/questions/9977898/c-sharp-visual-control-for-editing-statements-equations-conditions)
Basically its an expression editor. Each expression consists of a list of stuff, which can ... | [
-0.08921632170677185,
0.19112038612365723,
0.40914925932884216,
0.05019443482160568,
0.052027326077222824,
0.02706982009112835,
0.08721587806940079,
-0.3232443630695343,
0.052165187895298004,
-0.5788589715957642,
0.010646011680364609,
0.7820460796356201,
-0.3010295033454895,
-0.11166139692... | |
open a window to change the comparator or the variable name etc. The labels must obviously arrange themselves inside the control they are bound to.
Thing is, i dont know if there is already a way to do it automatically. I'd like those labels to arrange themselves just like the words arrange on this page. While it fits... | [
0.2393895834684372,
0.060592204332351685,
0.37415146827697754,
0.2910844683647156,
0.21236586570739746,
-0.2700314223766327,
-0.016064099967479706,
-0.08608093112707138,
-0.30996018648147583,
-0.6867727041244507,
-0.03700011596083641,
0.5172495245933533,
-0.20325006544589996,
-0.0506603121... | |
as the name implies, are meant to have only a ***single*** instance floating around. Data freezing the main thread should be dispatched, another instance of a class won't help that. | [
0.3000428378582001,
-0.15901875495910645,
0.0746489018201828,
0.31249499320983887,
-0.16577771306037903,
-0.17654560506343842,
0.32515642046928406,
0.28736546635627747,
-0.3449363112449646,
-0.3170543909072876,
-0.16724900901317596,
0.004858444910496473,
-0.23567180335521698,
0.51200723648... | |
I have a class that holds a list containing `boost::shared_ptrs` to objects of another class.
The class member functions that give access to the elemets in the list return raw pointers. For consistency I'd also like to be able to iterate with raw pointers instead of shared\_ptrs. So when I dereference the list iterato... | [
0.06131195276975632,
-0.10732211172580719,
0.19314369559288025,
-0.07649420201778412,
-0.23548974096775055,
0.18990764021873474,
0.1280367225408554,
-0.6263909935951233,
-0.08234207332134247,
-0.5563024282455444,
-0.1229318305850029,
0.9057495594024658,
-0.18958590924739838,
-0.00574224954... | |
std::list;
using std::tr1::shared_ptr;
using boost::transform_iterator;
using boost::make_transform_iterator;
using std::tr1::mem_fn;
using std::tr1::function;
struct Foo {};
struct Bar
{
typedef shared_ptr< Foo > Ptr;
typedef list< Ptr > List;
typedef function< Foo* (Ptr) > Functor;
typedef transform_iterato... | [
-0.034200962632894516,
-0.18268682062625885,
0.44627052545547485,
-0.3282613754272461,
-0.052449893206357956,
0.10388690233230591,
0.342905730009079,
-0.7647455930709839,
0.14026296138763428,
-0.3273576498031616,
-0.40905019640922546,
0.7826852202415466,
-0.39645037055015564,
-0.1657244563... | |
`Iterator` using type-erasure if you saw the need (I think Adobe offers a free `any_iterator` class template for this purpose.) | [
0.059276822954416275,
-0.037917610257864,
0.12603974342346191,
-0.08103011548519135,
-0.037607837468385696,
-0.4632248878479004,
-0.012041352689266205,
0.0053846705704927444,
-0.21704651415348053,
-0.16381555795669556,
-0.5167031288146973,
0.456617534160614,
-0.3014286756515503,
-0.1249373... | |
I have a problem with the Android projects in Eclipse.
I am working on Mac OS Lion and when I went to continue an Android project it gives me an error on the project icon. Moreover when I went to see the error Eclipse does not gives me an error anywhere in code.
What can I do to solve this problem? Any suggestions?
... | [
0.14841920137405396,
0.11261973530054092,
0.03044210746884346,
-0.11974483728408813,
-0.08013878762722015,
-0.06005633994936943,
0.10119716823101044,
0.039395809173583984,
-0.14492972195148468,
-0.5599194169044495,
0.2797011137008667,
0.6312000155448914,
-0.36831754446029663,
0.13614130020... | |
// TODO Auto-generated method stub
AlertDialog.Builder builder = new AlertDialog.Builder(view.getContext());
builder.setNeutralButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
... | [
0.5332902669906616,
-0.2921445965766907,
0.4805977940559387,
-0.37860164046287537,
0.19905444979667664,
0.01611446961760521,
0.3912040591239929,
-0.5176267623901367,
0.0910259261727333,
-0.5615531206130981,
-0.06059974804520607,
0.5368110537528992,
-0.6175342202186584,
-0.12203706800937653... | |
does not exit the app
dialog.dismiss();
}
});
}
```
I get the error: *The method onPreferenceClick(Preference) of type new Preference.OnPreferenceClickListener(){} must override a superclass method*
This problem is only on Mac OS X Lion. I don't know where is the probl... | [
-0.01102524995803833,
0.32342249155044556,
0.5189449191093445,
-0.18888486921787262,
0.2499365657567978,
-0.19001729786396027,
0.7410189509391785,
-0.1880444884300232,
-0.34412142634391785,
-0.5998876094818115,
-0.12634749710559845,
0.6232591271400452,
-0.5464694499969482,
0.02623686939477... | |
is the problem now ?
Here's an option using [Boost transform\_iterator](http://www.boost.org/doc/libs/release/libs/iterator/doc/transform_iterator.html):
```
#include <list>
#include <boost/iterator/transform_iterator.hpp>
#include <tr1/memory>
#include <tr1/functional>
using std::list;
using std::tr1::shared_ptr;
us... | [
-0.48030999302864075,
-0.15985682606697083,
0.7191565632820129,
-0.34357646107673645,
0.12012353539466858,
0.17395038902759552,
0.2165101170539856,
-0.5267048478126526,
-0.08311710506677628,
-0.27133095264434814,
-0.5739440321922302,
0.9653028249740601,
-0.5098251700401306,
-0.068561755120... | |
compiler handy to test it out. You could also hide the concrete type of `Iterator` using type-erasure if you saw the need (I think Adobe offers a free `any_iterator` class template for this purpose.) | [
0.3384924530982971,
0.023462150245904922,
-0.30553776025772095,
0.33159980177879333,
-0.2155304253101349,
-0.28373590111732483,
0.20749039947986603,
0.11947742104530334,
-0.15287818014621735,
-0.4848009943962097,
-0.06761337071657181,
0.5946995615959167,
-0.22230499982833862,
-0.3686175644... | |
Is it possible to replace the map that the google maps web applet uses? I mean like replacing a certain URL that the applet retrieves the maps from. Also, what format are they in? Are they all just images (one for each zoom level) or are they dynamically generated?
Sure you can replace the whole map. Google maps consis... | [
0.09414265304803848,
-0.20466813445091248,
0.4311477243900299,
0.5787224769592285,
-0.08963579684495926,
-0.01058044284582138,
-0.01881146803498268,
0.11822044104337692,
-0.3821486532688141,
-0.7841320037841797,
-0.02020229399204254,
0.38480356335639954,
-0.2508462965488434,
0.051068738102... | |
On the next zoom level this tile gets divided into 4 subsections, which form the next zoom level. Therefore on zoom level 1 you have 4 tiles and so on..
In general the number of tiles per zoom level is as follows:
`number_of_tiles_per_zoom_level`=`4`^`zoom_level`;
That means on zoom level 21 there are 4398046511104 ... | [
0.10863738507032394,
-0.17044170200824738,
0.7244820594787598,
0.10778834670782089,
-0.025035513564944267,
0.20027951896190643,
0.11094140261411667,
-0.6051959991455078,
-0.5154860615730286,
-0.7421454191207886,
-0.07942032068967819,
0.5925127267837524,
-0.14648625254631042,
-0.15180231630... | |
I'm using C++ map to implemented a dictionary in my program. My function gets a structure as an argument and should return the associated value based on `structure.name` member which is `char named[32]`. The following code demonstrates my problem:
```
map <const char *, const char *> myMap;
myMap.insert(pair<const cha... | [
-0.08011312037706375,
0.26762664318084717,
0.21611380577087402,
-0.22977522015571594,
-0.15732017159461975,
0.323748916387558,
0.4146769642829895,
-0.5743728876113892,
0.2107708752155304,
-0.8304888010025024,
0.00044668905320577323,
0.42096588015556335,
-0.5441744923591614,
-0.003412939375... | |
code to watch the values passed and I still cannot figure the problem.
Thanks!
Pointer comparison, not string comparison, will be performed by `map` to locate elements. The first two work because `"test"` is a string literal and will have the same address. The last does not work because `buf` will not have the same ad... | [
-0.006928106304258108,
-0.0767015889286995,
0.12796153128147125,
0.01834685727953911,
-0.03980439528822899,
0.16725733876228333,
0.4310440421104431,
-0.32802075147628784,
-0.06142613664269447,
-0.7646975517272949,
-0.08014120906591415,
0.6008664965629578,
-0.2536778151988983,
-0.1280875355... | |
I tried to write code to solve the standard Integer Partition problem ([Wikipedia](http://en.wikipedia.org/wiki/Partition_%28number_theory%29)). The code I wrote was a mess. I need an elegant solution to solve the problem, because I want to improve my coding style. This is not a homework question.
**While this answer i... | [
0.21781575679779053,
0.38192132115364075,
-0.012579147703945637,
-0.17826467752456665,
-0.1850632280111313,
0.1264864057302475,
0.28151968121528625,
-0.5467779636383057,
0.040121134370565414,
-0.49214959144592285,
-0.039870236068964005,
0.2981460988521576,
-0.4643584191799164,
0.1369432955... | |
answer.add(tuple(sorted((x, ) + y)))
... return answer
...
>>> partition(4)
set([(1, 3), (2, 2), (1, 1, 2), (1, 1, 1, 1), (4,)])
```
If you want all permutations(ie (1, 3) and (3, 1)) change `answer.add(tuple(sorted((x, ) + y))` to `answer.add((x, ) + y)` | [
-0.22377613186836243,
0.035611480474472046,
0.6412265300750732,
-0.1753210425376892,
-0.18245206773281097,
0.3277711868286133,
0.04335704445838928,
-0.5835734605789185,
-0.19471852481365204,
-0.604945957660675,
-0.5075974464416504,
0.0967215970158577,
-0.49291089177131653,
0.10242489725351... | |
I have a multidimensional array of arrays (source below), where my keys and values are arbitrary strings. I want to create a new array (desired below), where the hierarchy stays the same, but every KEY is restructured into its own array, with the key itself becoming a 'title' value, and any subarrays are continued unde... | [
0.19138197600841522,
0.11824902147054672,
0.22491063177585602,
0.09452785551548004,
0.319437712430954,
0.07783298939466476,
0.14109064638614655,
-0.43021851778030396,
-0.10031476616859436,
-0.4539952278137207,
-0.10253435373306274,
0.5435043573379517,
-0.21376046538352966,
0.28489923477172... | |
[Blue] => two
)
[Bravo] => Array (
[Blue] => three
)
)
```
Desired Array:
```
Array (
[0] => Array (
[title] => Alpha
[children] => Array (
[0] Array([title] => Red, [children]= > false) | [
-0.02527209185063839,
0.20763984322547913,
0.024391965940594673,
-0.27001166343688965,
0.056651219725608826,
0.024178843945264816,
0.3831233084201813,
-0.8617900013923645,
0.10702846199274063,
-0.5971067547798157,
-0.47042444348335266,
0.5066462159156799,
-0.49658504128456116,
-0.075507290... | |
[1] Array([title] => Blue, [children]= > false)
)
)
[1] => Array (
[title] => Bravo
[0] Array([title] => Blue, [children]= > false)
)
)
)
```
Note: I don't care about the final nodes/leafs in my new array.
You can do te conversion without passing a reference to ... | [
0.2644871175289154,
-0.14471733570098877,
0.24107752740383148,
0.07259383052587509,
0.3490365743637085,
-0.3586949110031128,
0.44161123037338257,
-0.36521705985069275,
0.10680484026670456,
-0.7448915839195251,
-0.49139007925987244,
0.5390698313713074,
-0.33964917063713074,
-0.1156381368637... | |
destination array.
```
function convert_array($from){
if(!is_array($from)){
return false;
}
$to = array();
foreach($from as $k=>$v){
$to[] = array(
'title' => $k,
'children' => convert_array($v)
);
}
return $to;
}
```
[Codepad example](http://co... | [
0.01850306987762451,
-0.11314694583415985,
0.484208345413208,
-0.36407312750816345,
0.32946133613586426,
0.1254749745130539,
0.03638358414173126,
-0.2979884445667267,
-0.006067486014217138,
-0.6446889638900757,
-0.30871519446372986,
0.5348080396652222,
-0.238550066947937,
0.174150526523590... | |
I am writing a web application that will execute a command on the local Windows server and need to display the output. The Popen() call in my code executes fine on the Python interpreter but gives a nasty error when executed via IIS. Thanks!!!!
Error text:
> Traceback (most recent call last):
>
>
> File "C:\python... | [
0.11296302825212479,
0.389602929353714,
0.6759201884269714,
-0.29322758316993713,
-0.12487423419952393,
0.10538329929113388,
0.5647451281547546,
-0.3506260812282562,
-0.10886368900537491,
-0.8647879362106323,
-0.024224132299423218,
0.4244639277458191,
-0.4305284917354584,
0.063481420278549... | |
is invalid
```
from subprocess import *
print "Content-type:text/html\r\n\r\n"
print "<html>"
print "<head>"
print "<title>FSPCT app</title>"
print "</head>"
print "<body>"
print Popen('ipconfig', shell=True, stdout=PIPE).communicate()[0]
print "</body>"
print "</html>"
```
It looks like the IIS server doesn't have ... | [
0.06476491689682007,
0.42621251940727234,
0.5250418186187744,
-0.08787661045789719,
-0.111778125166893,
-0.3460663855075836,
0.49987301230430603,
-0.16163598001003265,
-0.10662348568439484,
-0.5326715111732483,
-0.42375123500823975,
0.3443559408187866,
-0.5012262463569641,
0.42848747968673... | |
written to it, and returns end-of-file immediately when read from. Perfect for this.
Try modifying your code like this:
```
import os
...
with open(os.devnull, 'r+') as nul:
print Popen('ipconfig', shell=True, stdin=nul, stdout=PIPE, stderr=nul).communicate()[0]
```
(In the upcoming Python 3.3, you can now pass... | [
0.11479873210191727,
-0.011278302408754826,
0.5491428971290588,
-0.3380170464515686,
-0.17369653284549713,
0.11583640426397324,
0.3079993724822998,
0.059141870588064194,
-0.09106738865375519,
-0.6706667542457581,
-0.16008372604846954,
0.6933026909828186,
-0.3502437472343445,
0.028528297320... | |
In the snippet below, how can I get the jquery autocomplete plugin to:
1. Update a hidden field with the UserID
2. Update '#MessageTo' with the full name
I believe I need to use .result, but I can't figure out the syntax. Please note that I'm using ASMX so I must do a post (don't want to enable security risk)
```
... | [
-0.0183033999055624,
-0.16147272288799286,
0.44414928555488586,
-0.1325903981924057,
0.11826037615537643,
0.021364323794841766,
0.35433605313301086,
0.10324759781360626,
0.014503305777907372,
-0.563401997089386,
-0.3314473330974579,
0.7980241179466248,
-0.3956058621406555,
-0.3279827535152... | |
var postParams = "{ pattern: '" + $("#MessageTo").val() + "' }";
return jQuery_1_7_1.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: '/Services/Users.asmx/GetNames', | [
-0.00882643274962902,
-0.2894163727760315,
0.5748924016952515,
-0.14268715679645538,
-0.06383202224969864,
0.23919540643692017,
0.36438053846359253,
0.031532373279333115,
-0.09718617051839828,
-0.6981204748153687,
-0.3062724769115448,
0.4440593421459198,
-0.40986841917037964,
0.18787266314... | |
data: postParams,
dataType: "json",
success: function (data) {
response($.map(data.d.Users, function (c) {
return { | [
-0.150477334856987,
-0.49673640727996826,
0.5974131226539612,
0.08940622210502625,
0.11849319189786911,
0.4538652002811432,
0.1323898285627365,
-0.3210807144641876,
-0.3230801224708557,
-0.7767357230186462,
-0.42935869097709656,
0.5528042912483215,
-0.20603904128074646,
0.20233221352100372... | |
label: c.FullName,
value: c.UserID
};
})); | [
-0.4285047948360443,
-0.09980101883411407,
0.6261551976203918,
-0.45583581924438477,
0.31143811345100403,
-0.2909989655017853,
0.14981162548065186,
-0.14980445802211761,
0.2714613974094391,
-0.392417848110199,
-0.8653679490089417,
0.5921125411987305,
-0.3377423584461212,
0.518177330493927,... | |
}
});
}
});
```
I see some similar posts but not in conjunction with ASMX.
I believe you are interested in updating other HTML elements on the page, when the user selects something from an autocomplete-enabled textbox - is that right?
The code you have above probably works already, to provid... | [
0.5147688984870911,
0.024326065555214882,
0.2295025885105133,
-0.03637894615530968,
-0.34883779287338257,
-0.21924705803394318,
0.1916479468345642,
0.17532247304916382,
-0.24584384262561798,
-0.4780939817428589,
-0.12241041660308838,
0.42397308349609375,
-0.3957502245903015,
-0.10159672796... | |
To do that, use the `select` member of the autocomplete options.
```
$("#MessageTo")
.autocomplete({
dataType: "json",
autoFocus: true,
minLength: 3,
source: function (request, response) {
var postParams = "{ pattern: '" + $("#MessageTo").val() + "' }";
re... | [
-0.11374662071466446,
-0.46069151163101196,
0.3993276059627533,
-0.24351906776428223,
0.14459101855754852,
0.17692270874977112,
0.32706117630004883,
0.12769745290279388,
-0.2351633906364441,
-0.809486448764801,
-0.35070154070854187,
0.7649773359298706,
-0.3990493416786194,
-0.0573848374187... | |
type: "POST",
contentType: "application/json; charset=utf-8",
url: '/Services/Users.asmx/GetNames',
data: postParams,
dataType: "json",
success: function (data) { | [
-0.14094920456409454,
-0.09234031289815903,
0.3692310154438019,
-0.2703002691268921,
0.059862833470106125,
0.28690609335899353,
0.4013656973838806,
0.1535370796918869,
-0.05681054666638374,
-0.5192099809646606,
-0.8271991014480591,
0.4944614768028259,
-0.19964809715747833,
0.26963531970977... | |
response($.map(data.d.Users, function (c) {
return {
label: c.FullName, | [
-0.14105205237865448,
-0.6834852695465088,
0.8497121334075928,
-0.15885040163993835,
0.11238986998796463,
0.31752777099609375,
0.11820027232170105,
-0.3380785286426544,
-0.15507397055625916,
-0.7170387506484985,
-0.391708642244339,
0.48263514041900635,
-0.34951362013816833,
0.2986501753330... | |
value: c.UserID
};
}));
}
});
},
select: function (event, ui) { | [
-0.40008848905563354,
-0.43856000900268555,
0.3514072299003601,
-0.17507100105285645,
0.17519676685333252,
0.124717578291893,
0.03249429538846016,
-0.35143086314201355,
0.1788870096206665,
-0.3540928363800049,
-0.5664911866188049,
0.6024167537689209,
-0.3361279368400574,
0.2482130825519561... | |
var v = ui.item.value;
$('#MessageTo').html("Something here" + v);
$('#Hidden1').html("Something else here" + v);
// update what is displayed in the textbox
this.value = v;
return false;
}
});
```
Also: | [
0.2051575630903244,
-0.1915467381477356,
0.62949538230896,
-0.26263731718063354,
-0.067878358066082,
0.10907399654388428,
0.5655912160873413,
-0.09919530153274536,
-0.25757238268852234,
-0.5134537816047668,
-0.5979281663894653,
0.5682222247123718,
-0.4429570436477661,
0.14415523409843445,
... | |
your use of ASMX is irrelevant. From the perspective of autocomplete, it's just a source for data. Also, the use of POST is irrelevant. It is possible to configure ASMX on the server side to allow HTTP GET. It's not a security hole if you enable it. It's just a different way of accepting requests.
The autocomplete bo... | [
0.48666104674339294,
0.005552331916987896,
-0.10103677213191986,
0.3733241558074951,
-0.2762749195098877,
-0.23222216963768005,
0.28440558910369873,
0.27209123969078064,
-0.4136662781238556,
-0.37648794054985046,
-0.09760747849941254,
0.4528118968009949,
-0.43279772996902466,
-0.1886559426... | |
(I'm using Google Translate).
Currently developing a system of vehicles (30,000 vehicles, 10 000 users), and during this period only ran tests on the local environment.
Here then came the problem: when I sent to Cloud Server, mysql now consume 100 ~ 140% of the processing, making it the site falling around 5 ~ 30 min... | [
0.1227557510137558,
0.18349160254001617,
0.5965394973754883,
0.21780607104301453,
-0.050893042236566544,
0.4769027531147003,
0.12801672518253326,
0.21375659108161926,
-0.33288756012916565,
-0.6741644144058228,
0.04168069362640381,
0.24445201456546783,
0.2722421884536743,
0.1497108340263366... | |
contract -> Plans -> ads
ads -> (vehicles, parts, services)
vehicles -> (brand, model, version, category, color, fuel)
banners -> banners channels -> local banners
Information regarding the application:
debug: 0
caching enabled (10-1 hour per page \*)
In my own experience running heavy apps with CakePHP and MySQL ... | [
0.33300742506980896,
0.1606561243534088,
0.7453457713127136,
0.12858648598194122,
-0.013356233015656471,
-0.1638590693473816,
0.12375696003437042,
-0.4006185233592987,
-0.28964030742645264,
-0.8251466751098633,
-0.08364126831293106,
0.42508846521377563,
0.08956572413444519,
-0.373085588216... | |
associated models will grow too, fetching recursively more and more datas.
A good practice is to always specify the fields you need. Also, for spectific queries, you should unbind associated models you don't need.
For complex queries, don't hesitate to write optimized queries by hand, using the `query()` function.
... | [
-0.2452966421842575,
-0.1656898707151413,
0.28966572880744934,
0.32233279943466187,
-0.11171472817659378,
-0.04805886000394821,
0.17180149257183075,
-0.18799780309200287,
-0.15230068564414978,
-0.6753659844398499,
-0.036231908947229385,
0.7375750541687012,
-0.36203715205192566,
-0.15989159... | |
in production, such as [APC](http://fr2.php.net/manual/en/intro.apc.php) or [XCache](http://xcache.lighttpd.net/). | [
0.5515549182891846,
-0.13756227493286133,
0.11417827010154724,
-0.12476596236228943,
0.1219034269452095,
0.050335805863142014,
-0.22271060943603516,
0.30454549193382263,
-0.46884289383888245,
-0.4320964217185974,
-0.8185783624649048,
0.1292300522327423,
0.07844673842191696,
-0.067443475127... | |
I need to convert from Keys to strings used in Sendkeys method.
Sample:
Key.Enter to {ENTER}
Is there any easy way to do that? I could not find it.
```
if (key == Key.Enter)
SendKeys.SendWait({ENTER});
```
I need tomething that convert ALL keys..
If key == Key.a, I will just send a. But, if it is a command k... | [
-0.027873560786247253,
-0.14425227046012878,
0.43391838669776917,
-0.05961914733052254,
0.030478866770863533,
-0.2720603942871094,
0.35857316851615906,
-0.4727649688720703,
0.012515973299741745,
-0.6174036860466003,
0.03545922413468361,
0.9806892275810242,
-0.46856489777565,
0.118866026401... | |
this example :
**Enum Wrapper Class**
```
class KeyEnumWrapper {
public System.Windows.Forms.Keys key { get; set; }
public KeyEnumWrapper(System.Windows.Forms.Keys key) {
this.key = key;
}
public string ToString() {
return "{" + key.ToString().ToUpper() + "}... | [
0.06053243950009346,
-0.27130326628685,
0.5781924724578857,
-0.21712160110473633,
0.18057382106781006,
-0.10511425137519836,
0.2543533742427826,
-0.30020442605018616,
-0.2629421353340149,
-0.6660448908805847,
-0.423869252204895,
0.6243138313293457,
-0.31763342022895813,
0.37762489914894104... | |
Form1_KeyUp(object sender, KeyEventArgs e) {
KeyEnumWrapper wp = new KeyEnumWrapper(e.KeyCode);
SendKeys.SendWait(wp.ToString())
}
``` | [
-0.0327722430229187,
-0.30884599685668945,
0.6357426643371582,
-0.42633551359176636,
0.17824381589889526,
-0.27370429039001465,
0.4408014416694641,
-0.4779604971408844,
-0.08687984943389893,
-0.6714441776275635,
-0.6266337633132935,
0.4512769281864166,
-0.4874664545059204,
0.17672325670719... | |
I have a simple image upload form on my website where users can upload multiple images at once. I want to have my images organized in folder based on the month and year in the following format: MONTH-YEAR, so each time new upload starts I first check whether that folder exists or not, and create one if it doesn't exist... | [
0.6018035411834717,
0.15034259855747223,
0.6383338570594788,
0.1234128475189209,
-0.2799798846244812,
0.3346858620643616,
0.0956299901008606,
0.05847323313355446,
-0.6228362321853638,
-0.6353174448013306,
0.3981587588787079,
0.1732323318719864,
-0.0957024022936821,
0.10579957813024521,
-... | |
all the images can be uploaded without any problem. Here is my code:
```
$folderName = date('m-y');
$pathToUpload = './uploads/photos/' . $folderName;
if ( ! file_exists($pathToUpload) )
{
$create = mkdir($pathToUpload, 0777);
$createThumbsFolder = mkdir($pathToUpload . '/thumbs', 0777)... | [
0.37780705094337463,
-0.21088027954101562,
1.1624977588653564,
0.1162312850356102,
0.1341915875673294,
0.129573792219162,
0.15245363116264343,
-0.20370380580425262,
-0.25836706161499023,
-0.8401275873184204,
-0.10644259303808212,
0.4061938524246216,
-0.3562540113925934,
0.15477313101291656... | |
$pathToUpload;
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '9999';
$config['file_name'] = $imgName . '.jpg';
$this->upload->initialize($config);
$upload = $this->upload->do_upload("Filedata");
```
Any ideas why the upload doesn't work for the very first time?
Don't listen to t... | [
0.010187842883169651,
0.03700830787420273,
0.5996072292327881,
0.19527293741703033,
0.22562851011753082,
-0.12968537211418152,
0.5491220355033875,
-0.21687377989292145,
-0.13260768353939056,
-0.6079453825950623,
-0.24816982448101044,
0.7274011969566345,
-0.4430283010005951,
-0.252963602542... | |
which I suspect is where you're failing anyway.
If that's not the case, then somehow you don't have privileges, which seems unlikely if you can upload files.
Additionally, you might have a stat cache problem. Try running `clearstatcache()` before `do_upload()` | [
0.19779907166957855,
0.10595826804637909,
0.049252934753894806,
0.3540329039096832,
0.4563077986240387,
-0.3990921378135681,
0.5276383757591248,
0.07957503199577332,
-0.3774375915527344,
-0.7800178527832031,
-0.1054951623082161,
0.6157971024513245,
0.000011206166163901798,
-0.0601984336972... | |
See demo here: [jsfiddle demo](http://jsfiddle.net/7k3BT/5/)
I have a table that will contain a series of icons with text underneath each one.
What should happen is that the background and font of the text should change when cursor hovers and the image should be part of the link.
The problem is the paragraph ta... | [
-0.11242014169692993,
-0.23147833347320557,
0.631902813911438,
0.003947579767554998,
-0.07501587271690369,
-0.06558238714933395,
0.04915096238255501,
-0.35436588525772095,
-0.3010401427745819,
-0.8583577871322632,
0.03783414140343666,
0.45691362023353577,
-0.3590972423553467,
-0.1443786174... | |
desired behavior but the [a] and [p] tags are mismatched.
Can someone explain
- why the paragraph tag seems to 'block' the background changing color?
- why the mismatched tags allow this to work?
- is there a cleaner way to implement this behavior? (w/o mistmatched tags)
Thanks!
Don't listen to these guys.... | [
0.1809149831533432,
0.13496096432209015,
0.35727429389953613,
-0.10861081629991531,
0.050305068492889404,
-0.0634130910038948,
0.8755173087120056,
-0.2725372910499573,
-0.12519031763076782,
-0.5551829934120178,
-0.2619198262691498,
0.7765845656394958,
-0.4141061007976532,
-0.08077901601791... | |
all missing directories needed to create the thumbs folder, which I suspect is where you're failing anyway.
If that's not the case, then somehow you don't have privileges, which seems unlikely if you can upload files.
Additionally, you might have a stat cache problem. Try running `clearstatcache()` before `do_upload(... | [
0.06265682727098465,
0.036523278802633286,
0.28876206278800964,
0.48498639464378357,
0.5044737458229065,
-0.3845773935317993,
0.5236783027648926,
0.24249367415905,
-0.5274215936660767,
-0.7329222559928894,
-0.2151298075914383,
0.5118454098701477,
-0.1531042456626892,
-0.14122430980205536,
... | |
This is my VM
```
public class CountriesViewModel
{
public string CurrentCountry { get; set; }
public IEnumerable<Country> Countries { get; set; }
}
```
With my Controller
```
public class FiltersController : Controller
{
public ActionResult _ShipToCountry(IEnumerable<Cou... | [
0.04614976420998573,
-0.6380800008773804,
0.9866167306900024,
0.014157346449792385,
0.34220612049102783,
-0.21151669323444366,
-0.015796581283211708,
-0.20755259692668915,
-0.5810507535934448,
-0.6302696466445923,
-0.1494285762310028,
0.2541257441043854,
-0.43752139806747437,
0.14093890786... | |
string currentCountry = "AE")
{
var viewModel = new CountriesViewModel
{
Countries = countries.OrderBy(x => x.Name),
CurrentCountry = currentCountry | [
-0.05827832967042923,
-0.25014644861221313,
0.9810076951980591,
0.18838028609752655,
0.5113662481307983,
0.08339198678731918,
-0.1559116244316101,
0.300324410200119,
-0.5076383352279663,
-0.590007483959198,
-0.3448309600353241,
0.1039142832159996,
-0.20488591492176056,
0.3298715353012085,
... | |
};
return PartialView(viewModel);
}
}
```
And finally the View
```
@Html.DropDownListFor(x => x.Countries,
new SelectList(Model.Countries.ToList(),
"Code", "Name", Model.CurrentCountry))
```
Where Model.CurrentCountry is the Code.
... | [
-0.052038293331861496,
-0.33496445417404175,
0.8607079982757568,
0.07685043662786484,
0.13510192930698395,
-0.04942944273352623,
-0.07522107660770416,
0.14656978845596313,
-0.3655901849269867,
-0.7928072810173035,
-0.4355625510215759,
0.35158413648605347,
-0.031321678310632706,
0.405423611... | |
is rendered correctly
```
...
<option value="UA">Ukraine</option>
<option value="AE">United Arab Emirates</option>
<option value="UK">United Kingdom</option>
....
```
But no Country gets selected, what am I missing?
You should set `CurrentCountry` prop to expression if not also you cannot get the selected country on... | [
0.017296353355050087,
-0.3195505142211914,
0.6111491918563843,
-0.0636642798781395,
0.44282498955726624,
0.18232114613056183,
0.21197721362113953,
0.02212498150765896,
-0.3824145495891571,
-0.3174947202205658,
-0.7463484406471252,
0.05225257948040962,
-0.23357689380645752,
-0.0299214310944... | |
I have a basic database for a shop with product, sales and customer tables. I need to generate an invoice for each customer every 3 months to show the customers total expenditure.
What I'm not sure about is the way to go about this. Should I have an invoice table?
Any help or tips greatly appreciated.
**Here is my ans... | [
0.09243828058242798,
0.11863518506288528,
0.38665133714675903,
0.03316142037510872,
0.09621330350637436,
0.34847456216812134,
-0.15459156036376953,
-0.3990895748138428,
0.06393895298242569,
-0.8296728134155273,
0.19868125021457672,
0.5917051434516907,
0.18278154730796814,
0.007252817507833... | |
private long id;
...
}
```
Since I use microsoft SQL server, I have to use `@TableGenerator`. More information can be found here <http://en.wikibooks.org/wiki/Java_Persistence/Identity_and_Sequencing#Table_sequencing> | [
0.07941184192895889,
0.08337308466434479,
0.1603788435459137,
-0.051546014845371246,
0.20343117415905,
-0.16511410474777222,
-0.18307042121887207,
0.13556964695453644,
-0.4481773376464844,
-0.45374709367752075,
0.07227552682161331,
0.3290516436100006,
-0.21504634618759155,
0.22614744305610... | |
I am wondering how easy it is for a user/browser to manipulate or execute Javascript code manually.
The reason I ask is that I am planning on making a browser-based game. I am using Javascript instead of Java because I want to make it accessible to as many platforms as possible.
Here is a general example of what I me... | [
0.5371875166893005,
-0.1341688632965088,
-0.09623537212610245,
0.08709073811769485,
-0.061217546463012695,
0.007900561206042767,
0.2691437304019928,
-0.1259022057056427,
-0.11137526482343674,
-0.5976467132568359,
0.1367039978504181,
0.6088880300521851,
-0.09332311898469925,
-0.058242045342... | |
a couple which were generated during the battle.
So would a player be able to manipulate the stored variables or call one of my JS functions (such as one which leads to an AJAX call being made)?
If so then how could I guard against it? I could verify each action with the server but that is bandwidth-intensive.
Hit `... | [
-0.10995324701070786,
0.13264413177967072,
0.28517353534698486,
0.0452340766787529,
0.033070821315050125,
-0.08172094821929932,
0.4212760925292969,
-0.10501914471387863,
-0.07253316044807434,
-0.3830585181713104,
-0.19372715055942535,
0.6941751837730408,
-0.3143376111984253,
0.291819155216... | |
local variables. Just make sure you declare them all properly with `var`.
Also, make sure you obfuscate the code to make it harder to modify, and take special care when accepting communications such as highscore submissions. I like to encrypt mine with a made-up-on-the-spot method (such as converting from base 10 to b... | [
0.27862149477005005,
0.025672156363725662,
0.1632266640663147,
0.029763374477624893,
-0.029672376811504364,
-0.030864404514431953,
0.5124229192733765,
0.1952463835477829,
-0.14638641476631165,
-0.4627610146999359,
-0.13941030204296112,
0.7370238900184631,
-0.022082088515162468,
0.090884447... | |
can resume the game if the user reloads the page.
All in all, you can't stop cheaters, but you can make it really hard for them. | [
0.12456238269805908,
-0.2167537361383438,
0.33671462535858154,
0.44454044103622437,
0.16634336113929749,
-0.622178852558136,
0.5053868889808655,
0.1038438007235527,
-0.5287575125694275,
-0.2749235928058624,
-0.1500980705022812,
0.567497193813324,
0.12403672188520432,
-0.1225220337510109,
... | |
I use simple\_form in my app.
How do i give the blank value in my selects a different text than "" ?
I just find an option to include blank or not.
It depends on how you are constructing your options for select. If you're doing it like the code below, just pass a string into the :include blank.
```
select("post", "p... | [
0.16196219623088837,
-0.13332083821296692,
0.21159586310386658,
-0.12977443635463715,
0.0707223042845726,
0.4839532673358917,
0.07312969118356705,
-0.10083141177892685,
-0.15800918638706207,
-0.657427966594696,
-0.12781234085559845,
0.7716309428215027,
-0.24040259420871735,
-0.271248102188... | |
shows up in the dropdown being first. So in your case, you could change the second answer to look like this:
```
options_for_select([["Some text here", ""], ["Dollar", "$"], ["Kroner", "DKK"]])
``` | [
0.08431542664766312,
-0.17812663316726685,
0.3705909252166748,
-0.03113640658557415,
0.16223232448101044,
0.2118329405784607,
-0.19327186048030853,
-0.190782368183136,
-0.18895255029201508,
-0.1749073714017868,
-0.2187788337469101,
0.45805370807647705,
0.002720567397773266,
-0.243637606501... | |
all goes well suddenly i dont know why a fatal error occurred can any one please tell me the solution ???
Warning: include(lang.php) [function.include]: failed to open stream: Operation not permitted in /var/httpdocs/dev52/include.php on line 59
Warning: include() [function.include]: Failed opening 'lang.php' for in... | [
-0.47957921028137207,
-0.17366497218608856,
0.5026129484176636,
0.12613175809383392,
0.36789873242378235,
-0.20492708683013916,
1.0263080596923828,
-0.06659981608390808,
-0.12209775298833847,
-0.09474991261959076,
-0.374487966299057,
0.6850795149803162,
-0.458087295293808,
0.10001462697982... | |
on line 265
Fatal error: Call to undefined function geoip\_open() in /var/httpdocs/dev52/include.php on line 266
It is not a requirement to use an id. In fact, you aren't required to use html lists either.
The following example uses a `<div>` as the container and `<span>` elements as the selectable items.
```
<div ... | [
-0.24783775210380554,
-0.004066223278641701,
0.6477541327476501,
-0.12486642599105835,
-0.3362008333206177,
0.07875803858041763,
0.19480165839195251,
-0.6117512583732605,
-0.18291117250919342,
-0.501168429851532,
-0.39929625391960144,
-0.016227131709456444,
-0.35746997594833374,
-0.1458725... | |
<img src="..." />
<img src="..." />
</p>
<p data-album="Birthdays">
<img src="..." />
<img src="..." />
<img src="..." />
</p>
<script>
$("[data-album]").selectable({ filter: 'img' });
</script>
``` | [
-0.13808806240558624,
-0.29546576738357544,
0.481148898601532,
-0.3281416594982147,
-0.02619936875998974,
0.009369422681629658,
0.25670748949050903,
-0.32764577865600586,
-0.23338183760643005,
-0.7435600757598877,
-0.4812871813774109,
0.18155887722969055,
-0.4199586808681488,
0.03153892233... | |
Would you please explain me the difference between these two CSS classes syntax:
```
.element .symbol {}
```
and
```
.element.large .symbol {}
```
I don't understand the difference between the two. The first line indicates two different classes to which are applied the same styles. But about the second, what's th... | [
0.23920710384845734,
0.03768948093056679,
0.11805126816034317,
-0.09510502964258194,
-0.09480658173561096,
-0.07139777392148972,
-0.1346524953842163,
0.08599255979061127,
-0.3405175507068634,
-0.7319009304046631,
-0.2204630821943283,
0.3291766941547394,
-0.44431090354919434,
0.087404765188... | |
CSS entry would affect the `<div>` tag in the middle.
Your second example means that the first class requires two classes to be affected. Other than that it's equal to the first one.
```
<div class="element large">
<div class="symbol" />
</div>
```
So if the HTML looks like this, the CSS values will be applied ... | [
0.11192407459020615,
-0.102303147315979,
0.12957854568958282,
-0.02168767899274826,
-0.2151256501674652,
-0.042884133756160736,
-0.045731429010629654,
-0.1611945480108261,
-0.2872382402420044,
-0.8417306542396545,
-0.2555358409881592,
0.11904188990592957,
-0.337609201669693,
0.186258241534... | |
I'm having a pretty big problem trying to create navigation on my page. If the mouse enters an element then it selects it, then if you use arrow keys it will select the elements relative to the selected one. However this is an issue when the arrow keys cause the page to scroll, because (depending on the position of the... | [
-0.11995743960142136,
0.006965442094951868,
0.4153026342391968,
0.2635490894317627,
-0.015296757221221924,
0.05704785883426666,
0.25638478994369507,
0.10868190228939056,
-0.20266467332839966,
-0.7120392918586731,
0.3688294291496277,
0.3604431748390198,
-0.3027220070362091,
0.07328670471906... | |
but none of my solutions seemed to work. Any help is appreciated, thank you.
It sounds like you should bind the "select when mouse enters" event on `mousemove` and unbind said event on `mousestop`. `mousestop` does not exist on its own, so you will have to create it somehow or use a plugin (there are at least a few out... | [
-0.07071574777364731,
-0.13222217559814453,
0.4814283549785614,
0.06021066755056381,
0.07703513652086258,
-0.03634341061115265,
0.2450849562883377,
-0.1711338460445404,
-0.13414297997951508,
-0.744428813457489,
0.026003416627645493,
0.36547377705574036,
-0.11964353919029236,
0.127298370003... | |
In my application an activity starts a service which runs as a separate process, I want to debug the Activity as well as the service but debugger does not stop at the breakpoints in service?
Thanks for help.
Temporarily make it not be a separate process.
@CommonsWare | [
0.6790390610694885,
0.21086657047271729,
-0.032226625829935074,
0.213361456990242,
-0.2870860993862152,
-0.408223420381546,
0.7605981826782227,
-0.03360448405146599,
-0.30424755811691284,
-0.5359476804733276,
0.023207059130072594,
0.2894938588142395,
-0.23939073085784912,
0.349026352167129... | |
Imagine I have two protocols:
```
@protocol A
@end
```
and
```
@protocol B <A> // Protocol B conforms to protocol A.
@end
```
And also two variables:
```
id<A> myVar = nil;
```
and
```
id<B> otherVar = //correctly initialized to some class that conforms to <B>;
```
Then, why can't I assign 'otherVar' to 'm... | [
-0.03382166475057602,
0.15491802990436554,
0.3255622982978821,
-0.33370935916900635,
0.02849731408059597,
-0.11238129436969757,
0.28301647305488586,
-0.566689133644104,
-0.13094206154346466,
-0.6531493663787842,
-0.07467858493328094,
0.21730919182300568,
-0.24852469563484192,
0.08466669172... | |
nil;
myVar = otherVar; // << warning
}
// declaration follows use, or is not visible:
@protocol B <A>
@end
```
whereas the properly ordered version produces no warning:
```
@protocol A
@end
@protocol B <A>
@end
void fn() {
id<A> myVar = nil;
id<B> otherVar = nil;
myVar = otherVar;
}
``` | [
0.12396585941314697,
-0.030204415321350098,
0.41253989934921265,
-0.4361562728881836,
0.027022868394851685,
-0.3443903923034668,
0.4556102454662323,
-0.5092278718948364,
-0.10334830731153488,
-0.4836081862449646,
-0.42297983169555664,
0.224061518907547,
-0.26794469356536865,
0.418714076280... | |
I can not find a mod\_go for deploying Go web applications. Is there any other way to run web applications in Go with an Apache web server (or even IIS)?
**Update**: Now after doing Go full time for nearly a year; doing this (Go with Apache) is nullifying the very purpose of Go (Performance in terms of being highly co... | [
0.06440449506044388,
-0.13309015333652496,
0.3116227686405182,
0.10325153172016144,
-0.32549145817756653,
-0.3881166875362396,
0.5782244205474854,
0.1681065410375595,
-0.2556321918964386,
-0.588932991027832,
-0.1080043762922287,
0.7225620150566101,
-0.14145484566688538,
0.03508022800087929... | |
a thing.)
A go web app by itself is a capable web server. You can listen to port 80 in your app and then directly run it on your server. Trust me: it really works!
But if you are not doing that (for reasons such as having other virtual servers on the same machine, load balancing, etc.), you can use a HTTP server such... | [
0.22293680906295776,
-0.13380783796310425,
0.38280946016311646,
0.1544015258550644,
-0.05028174817562103,
-0.18983781337738037,
0.6065425276756287,
0.040377311408519745,
-0.2857601046562195,
-0.40925052762031555,
0.006153751630336046,
0.6350760459899902,
-0.1782768964767456,
-0.32927945256... | |
it with Apache, but [this](http://httpd.apache.org/docs/2.2/mod/mod_proxy.html) should help.
I recommend your Go web app by itself or nginx as a HTTP proxy. | [
-0.22224201261997223,
-0.2524755597114563,
0.4611585736274719,
0.31062445044517517,
-0.3444483280181885,
-0.26569509506225586,
0.051683682948350906,
0.24010610580444336,
-0.18606001138687134,
-0.5043051242828369,
-0.2656394839286804,
0.6357342600822449,
-0.29956430196762085,
-0.18099942803... | |
I am having two buttons and an Image Control.
Now When I click 1st button I am trying to load an Image as shown below.
```
Dim openPicker As New FileOpenPicker
openPicker.ViewMode = PickerViewMode.Thumbnail
openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary
openPicker.FileTypeFilter.Add... | [
0.16213740408420563,
-0.42863714694976807,
0.8416743874549866,
-0.2188463658094406,
-0.17759621143341064,
-0.15792524814605713,
0.03594527021050453,
-0.2913762331008911,
-0.36740967631340027,
-0.6003310680389404,
0.08940093964338303,
0.7581201195716858,
-0.3309134840965271,
0.1790598481893... | |
image.SetSource(stream)
Image1.Source = image
LayoutRoot.Visibility = Windows.UI.Xaml.Visibility.Collapsed
txtImgdisplay.Text = file.Path
Else
txtImgdisplay.Text = "Invalid File"
End If
```
Now when I Click 2nd button I need to save that Image after some modifications to the s... | [
0.19527769088745117,
-0.16671638190746307,
0.7826756238937378,
0.00034557070466689765,
-0.1738947033882141,
-0.29120463132858276,
0.2820056080818176,
-0.11325367540121078,
-0.3836485743522644,
-0.9991162419319153,
-0.16531839966773987,
0.5835370421409607,
-0.5272877216339111,
0.21962487697... | |
it.
```
Dim fileSavePicker As New FileSavePicker()
fileSavePicker.FileTypeChoices.Add("PNG", New String() {".png"})
fileSavePicker.FileTypeChoices.Add("JPG", New String() {".jpg"})
fileSavePicker.FileTypeChoices.Add("BMP", New String() {".bmp"})
fileSavePicker.FileTypeChoices.Add("TIFF", New String() ... | [
0.28229501843452454,
-0.5829533338546753,
0.8347285985946655,
-0.05315301939845085,
-0.06970743834972382,
-0.2709014117717743,
0.3385932743549347,
-0.17757055163383484,
-0.15187190473079681,
-0.6856940984725952,
-0.436897873878479,
0.6349069476127625,
-0.4292081594467163,
0.204117685556411... | |
txtImgdisplay.Text = saveFile.Path
Image1.Source = image
Dim copyFile As StorageFile = Await saveFile.CopyAsync(Windows.Storage.KnownFolders.PicturesLibrary, "sample - Copy.png")
Else
txtImgdisplay.Text = "Invalid File"
End If
```
There's no mod\_go. (At least I've not heard of such a t... | [
0.08678732067346573,
-0.09221439808607101,
0.6601883172988892,
0.13533705472946167,
-0.023773403838276863,
-0.3780820369720459,
0.6437095403671265,
-0.20922134816646576,
-0.4142985939979553,
-0.6734240055084229,
-0.32475635409355164,
1.2146551609039307,
-0.6382244825363159,
-0.078624948859... | |
if you are not doing that (for reasons such as having other virtual servers on the same machine, load balancing, etc.), you can use a HTTP server such as nginx or Apache as a HTTP proxy in front of your Go app. I use nginx and it's great. [Here's an outdated but still very useful](http://nf.id.au/posts/2010/10/deployin... | [
-0.026629239320755005,
-0.10518134385347366,
0.30158424377441406,
0.14518992602825165,
-0.3308936357498169,
-0.21070478856563568,
0.09096147865056992,
0.3225845992565155,
-0.38224974274635315,
-0.6701403260231018,
-0.03734984248876572,
0.5775625109672546,
-0.06668995320796967,
-0.303841978... | |
Im trying to work with a path and replace the home directory with a tilde in bash, Im hoping to get it done with as little external programs as necessary. Is there a way to do it with just bash. I got
```
${PWD/#$HOME/\~}
```
But thats not quite right. It needs to convert:
```
/home/alice to ~
/home/alice/ to ~/
/h... | [
0.09539340436458588,
0.22581599652767181,
0.31609031558036804,
-0.26597076654434204,
-0.11713079363107681,
0.03191607818007469,
0.3633291721343994,
-0.3670538067817688,
-0.014307309873402119,
-0.7630758881568909,
0.10683772712945938,
0.4336501359939575,
-0.13375408947467804,
-0.15926979482... | |
`~'. */
char *
polite_directory_format (name)
char *name;
{
char *home;
int l;
home = get_string_value ("HOME");
l = home ? strlen (home) : 0;
if (l > 1 && strncmp (home, name, l) == 0 && (!name[l] || name[l] == '/'))
{
strncpy (tdir + 1, name + l, sizeof(tdir) - 2);
tdir[0] = '~';
... | [
-0.4616276025772095,
-0.0262535959482193,
0.6356682777404785,
-0.698196530342102,
0.40135976672172546,
0.39909374713897705,
0.5135778784751892,
-0.22872482240200043,
0.3013157844543457,
-0.8995116353034973,
-0.5723679661750793,
0.5221964716911316,
-0.02590877190232277,
0.31244808435440063,... | |
return (name);
}
```
See [this unix.stackexchange answer](https://unix.stackexchange.com/a/207214):
> If you're using bash, then the `dirs` builtin has the desired
> behavior:
>
>
>
> ```
> dirs +0
> ~/some/random/folder
>
> ```
That probably uses Bash's own C code that you pasted there. :)
And here's how you ... | [
-0.06336691975593567,
-0.1131826639175415,
0.19937540590763092,
-0.4407675564289093,
-0.15999704599380493,
-0.3513402044773102,
0.0530032180249691,
-0.31332647800445557,
-0.006234284956008196,
-0.4144674837589264,
-0.16722479462623596,
0.9872351884841919,
-0.29070907831192017,
-0.020541923... | |
I've written a script that changes values for a certain date in an excel sheet. When I create a new excel file using `copy`, it copies everything over correctly except for the year portion of the date. For example, it will go from 4/5/2012 to 4/5/2008. It appears that all dates go back four years. Here's the code:
```... | [
0.3416544497013092,
0.33931705355644226,
0.48589444160461426,
-0.10859405994415283,
-0.00826308038085699,
-0.027228444814682007,
-0.11842689663171768,
0.0022561245132237673,
-0.2763805091381073,
-0.39789697527885437,
0.17054630815982819,
0.20582614839076996,
0.06334774941205978,
0.51036071... | |
import xlrd, xlwt, xlutils
import datetime
from xlutils.copy import copy
print 'Opening excel sheet...'
book = xlrd.open_workbook('test.xls', on_demand=True, formatting_info=True)
print 'Creating and editing new excel sheet...'
wbook = copy(book)
print 'Done creating new excel sheet'
sh = book.sheet_by_index(0)
#itera... | [
0.34434089064598083,
-0.04556186869740486,
0.5467541813850403,
-0.023008674383163452,
-0.10978671908378601,
0.1527625173330307,
-0.12945406138896942,
-0.13990390300750732,
-0.10447336733341217,
-0.5747312307357788,
-0.3814763128757477,
0.39805692434310913,
-0.32570523023605347,
0.021332649... | |
= sh.cell_value(3, colnum+4)
#if xlrd finds a date
if date:
#grab date data | [
-0.0549841932952404,
-0.264936238527298,
0.2829716205596924,
-0.3444157838821411,
0.34369415044784546,
-0.23976707458496094,
0.050006866455078125,
0.10416744649410248,
-0.20109333097934723,
-0.28310292959213257,
-0.5846673250198364,
-0.07400402426719666,
-0.07243872433900833,
0.29679277539... | |
year, month, day, hour, minute, second = xlrd.xldate_as_tuple(date\
, book.datemode)
#if dates are within the month currently being edited
if month == 04: | [
0.12421879172325134,
0.12256677448749542,
0.5267045497894287,
-0.016208844259381294,
0.10689593851566315,
0.1323176622390747,
0.1875925064086914,
0.333922415971756,
-0.3954116404056549,
-0.24701298773288727,
-0.4030555188655853,
-0.238644540309906,
0.05641569197177887,
0.5553956031799316,
... | |
#format excel date information to work with parkh dict
format = str(month) + "/" + str(day) + "/" + str(year)
print 'Editing ' + format
#clear cells to eliminate old information | [
-0.06221197172999382,
0.19524526596069336,
0.4796328842639923,
-0.01477736234664917,
0.06959599256515503,
-0.1775800883769989,
0.09836380928754807,
-0.15546222031116486,
-0.11810990422964096,
-0.3979305624961853,
-0.41813579201698303,
-0.09694014489650726,
0.15851908922195435,
0.1053257286... | |
wbook.get_sheet(0).write(6, colnum+6, "")
wbook.get_sheet(0).write(5, colnum+6, "")
wbook.get_sheet(0).write(7, colnum+6, "")
#iterate through hour segments for that day
for x in parkh[format]: | [
0.1597697138786316,
-0.1150117889046669,
0.3877620995044708,
-0.05679371580481529,
0.04454945772886276,
0.10100904107093811,
0.2551500201225281,
-0.0019481047056615353,
0.18158380687236786,
-0.5872198343276978,
-0.22926722466945648,
0.3819153904914856,
-0.27361658215522766,
-0.078719809651... | |
#if regular hours, insert in "HOURS" row
if x[0] == 'Park Hours':
wbook.get_sheet(0).write(6, colnum+6, x[1])
#if extra magic | [
0.49930164217948914,
-0.27747002243995667,
0.5852062702178955,
0.06587711721658707,
0.17482715845108032,
-0.27616825699806213,
0.6248446702957153,
-0.1895143985748291,
-0.1809302419424057,
-0.2524527609348297,
-0.36415398120880127,
0.5865962505340576,
0.05425577610731125,
-0.03261982277035... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.