text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
AddressId integer not null
REFERENCES Addresses
)
CREATE TABLE Organsations
(
OrganisationId integer not null primary key
OrganisationName nvarchar(500),
AddressId integer not null
REFERENCES Addresses
)
CREATE TABLE Addresses
(
AddressId inte... | [
-0.35111862421035767,
0.1637834757566452,
0.5374369621276855,
0.1102668046951294,
0.13794250786304474,
0.26033368706703186,
-0.12270248681306839,
-0.176171213388443,
-0.20949947834014893,
-0.7303839325904846,
-0.3965858221054077,
-0.07883406430482864,
-0.03970561549067497,
0.32799607515335... | |
primary key,
Type nvarchar(10),
Street nvarchar(500),
ZipCode nvarchar(50),
City nvarchar(500),
)
CREATE TABLE OrganisationMembers
(
OrganisationId integer not null
REFERENCES Organisations,
UserId integer not null
REFERENCES Users,
PRIMARY... | [
-0.10609381645917892,
0.029976164922118187,
0.821010172367096,
0.04853068292140961,
-0.06816569715738297,
0.14309176802635193,
0.007985539734363556,
-0.2606525421142578,
-0.3604028522968292,
-0.5573457479476929,
-0.5529549717903137,
-0.045796193182468414,
-0.3248387575149536,
0.28150910139... | |
)
CREATE NONCLUSTERED INDEX ixOrganisationMembers on OrganisationMembers(OrganisationId)
```
This translates to the following Entity RelationShip Diagram:

* Performance wise, the narrow images table is very good as it contains only a few bytes o... | [
0.15427666902542114,
-0.05544916167855263,
0.6573105454444885,
0.09831932932138443,
-0.09391628205776215,
-0.29694274067878723,
0.1974201500415802,
0.08458077162504196,
-0.47694098949432373,
-0.7783656120300293,
-0.1860605776309967,
0.38670438528060913,
-0.265580415725708,
0.17260228097438... | |
OrganisationMembers table has UserId as first field since there normally a lot more users than Organisations and you probably will want to show which organisations a user is member off more often than the inverse.
* The index on OrganisationId in OrganisationMembers is there to cater for queries where the list of membe... | [
0.11711316555738449,
0.09272219240665436,
0.6211220622062683,
-0.17963986098766327,
-0.0528532899916172,
-0.35018685460090637,
-0.11976497620344162,
-0.07554838061332703,
-0.6039514541625977,
-0.42399248480796814,
-0.3657328188419342,
0.024496328085660934,
-0.13496170938014984,
0.079033687... | |
I have discovered that it is possible to populate resource strings with variable information using string.format, see below:
```
String.Format(Resources.Temp.TempString, Resources.Contact.PhoneSales)
```
I can display this on my page using:
```
<p><%= String.Format(Resources.Temp.TempString, Resources.Contact.Phone... | [
0.0179386418312788,
0.05120358616113663,
0.5311766862869263,
0.01842413656413555,
0.08497773110866547,
0.010836046189069748,
0.24581757187843323,
-0.004769656807184219,
-0.26628461480140686,
-0.6882703900337219,
-0.36806219816207886,
0.46499907970428467,
-0.27484631538391113,
0.06672223657... | |
the content, that actual string).
**UPDATE:**
I have found a solution which works with some controls:
```
<asp:Label runat="server" ID="temp"><%= String.Format(Resources.Temp.TempString, Resources.Contact.PhoneSales) %></asp:Label>
```
However, this works doesn't work for Literal controls as they don't allow child... | [
0.19080223143100739,
-0.013196494430303574,
0.5900592803955078,
0.3023565709590912,
-0.07903385162353516,
0.09029997885227203,
0.42267242074012756,
-0.06795696914196014,
-0.20038530230522156,
-0.763526201248169,
-0.40357258915901184,
0.49773073196411133,
-0.15204556286334991,
-0.0118941087... | |
display content. | [
0.2218015044927597,
0.31578686833381653,
0.26377540826797485,
0.2692238688468933,
-0.17699134349822998,
-0.17904537916183472,
-0.412775456905365,
0.34117576479911804,
-0.22240737080574036,
-0.7610872387886047,
-0.6231176853179932,
0.35241028666496277,
-0.0992773175239563,
0.160538464784622... | |
How is it possible to submit an app to the AppStore which is not for general use? For instance I might want to do an invite-only free trial before making the app generally available for a fee.
Or I might want to be able to give free copies to specific people for promotion. Are these kind of things possible?
First of a... | [
0.034246284514665604,
0.21702702343463898,
0.4910508394241333,
-0.04104987904429436,
0.18150651454925537,
0.06724739819765091,
0.2683294117450714,
-0.021542521193623543,
-0.07267394661903381,
-0.6141598224639893,
-0.45891496539115906,
0.5203889608383179,
-0.4624589681625366,
-0.10203575342... | |
the program's main().
Getting killed by a signal is not a normal exit for a process so callbacks installed with `on_exit` and `atexit` aren't implicitly called. | [
-0.19105024635791779,
-0.036200083792209625,
0.043933555483818054,
0.0463387593626976,
0.25044041872024536,
-0.00986950658261776,
0.3759590983390808,
0.22844700515270233,
-0.033168189227581024,
-0.18583695590496063,
-0.510857343673706,
0.37210944294929504,
-0.5411161184310913,
0.4118618071... | |
I am encountering issues while deploying an ASP web application to HostMySite. The application has previously been deployed to their servers that are on different platforms without issues. However, for the current domain and server I continue to get the server error below.
Server Error in '/PropertyManagement' Applica... | [
-0.019344516098499298,
0.2740758955478668,
0.54838627576828,
-0.25789621472358704,
0.06984609365463257,
-0.3017093539237976,
0.6006456017494202,
-0.18302704393863678,
-0.11760270595550537,
-0.6219692826271057,
-0.2513807713985443,
0.2006053328514099,
-0.2258438766002655,
0.4805527925491333... | |
to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. I know that the code... | [
0.2552635371685028,
0.39190012216567993,
0.2698899805545807,
0.017487408593297005,
0.08950334042310715,
-0.1812727451324463,
0.41613712906837463,
0.04392797499895096,
-0.3661826550960541,
-0.46326932311058044,
-0.12338653206825256,
0.25472012162208557,
-0.2900032103061676,
0.33249527215957... | |
might be attempting to use this directory and what I can do to configure it to use a different directory that I have access to. I am new to ASP development and need help. Thanks!
Stack Trace:
[HttpException (0x80004005): The current identity (ADSAFESECUREWEB\C116018-fhmonlinea) does not have write access to 'C:\Windo... | [
0.03603444993495941,
0.3803824186325073,
0.9540455341339111,
0.274333655834198,
0.2494695782661438,
-0.34778738021850586,
0.3616897463798523,
-0.35740604996681213,
-0.5010042786598206,
-0.2755225598812103,
-0.15692053735256195,
0.2552543878555298,
-0.090691477060318,
0.1362275779247284,
... | |
and compiles your .aspx/.asmx/etc files and puts the compiled version in Temporary ASP.NET Files.
This must be writable so that your site can be compiled at runtime.
Edit: Here is [an MSDN article](http://msdn.microsoft.com/en-us/library/ms366723.aspx) explaining it.
As discussed in the comments, if the provider ref... | [
0.31073057651519775,
-0.0008659371524117887,
0.46762627363204956,
0.059102196246385574,
0.3814924657344818,
-0.4332217574119568,
0.22506769001483917,
-0.04634850099682808,
-0.358873575925827,
-0.8824912905693054,
-0.505933403968811,
0.5125793814659119,
-0.30461063981056213,
0.1494989693164... | |
My problem/issue
----------------
We are working on an opensource project which we have hosted on github. The project is written in Django and so we have our settings in a settings.py file. We have it open source not because we are too cheap for a subscription, but because we intentionally want it to be open source.
... | [
0.4718829393386841,
0.2530280649662018,
0.27114924788475037,
0.230823814868927,
-0.0324958860874176,
0.0067797815427184105,
0.16313740611076355,
0.07458911091089249,
-0.1315322071313858,
-0.585430920124054,
-0.07103465497493744,
0.5956357717514038,
-0.26840242743492126,
0.17933228611946106... | |
add this file locally and on the server, this way we all have our personal settings and sensitive data isn't stored on git.
The problem is that we now want to run our code on Heroku, which doesn't support the creation of files on the server, since heroku doesn't work like a normal server ( it works with a distributed ... | [
0.3729109466075897,
0.2368355542421341,
0.12013683468103409,
0.08687661588191986,
-0.1215398982167244,
-0.12868888676166534,
0.035876184701919556,
-0.06101950630545616,
-0.13212378323078156,
-0.8631740212440491,
0.1315561681985855,
0.43872180581092834,
-0.22913263738155365,
0.1992481052875... | |
on how to fix this
----------------------------------
There are two remotes:
* origin == Github
* heroku == Heroku
leaving out all the development and feature branches, we only have both the master branches (on Heroku and Github) to worry about.
My idea was to have the branches set up like this locally:
* master -... | [
0.058374203741550446,
-0.276527464389801,
0.6031795740127563,
0.34476301074028015,
0.02851065993309021,
-0.005340028554201126,
0.007204776629805565,
0.027545111253857613,
-0.24741344153881073,
-0.6636399626731873,
-0.20378293097019196,
0.5468757152557373,
-0.28805479407310486,
0.0921183973... | |
the .gitignore file to stop ignoring the site\_settings.py, so it will be committed to Heroku once we push to the heroku branch.
Once we have a new release we switch to heroku branch and merge master into heroku like so:
```
git checkout heroku
git pull
git merge master
```
Once we have sorted out merge conflicts f... | [
0.3670681416988373,
-0.30247560143470764,
0.39921826124191284,
0.21591392159461975,
-0.3822861909866333,
-0.21591684222221375,
0.17775504291057587,
-0.2138318121433258,
-0.11512279510498047,
-0.8684316277503967,
-0.3021703064441681,
0.4710712134838104,
-0.2689007520675659,
0.26107168197631... | |
info don't hesitate to ask :)
For starters, storing your config in files is the wrong way to go about this, so don't do it.
From the [12factor app](http://www.12factor.net/config):
> An app’s config is everything that is likely to vary between deploys
> (staging, production, developer environments, etc). This includ... | [
0.5694866180419922,
-0.11925531178712845,
0.4611375033855438,
0.18993926048278809,
0.3983207643032074,
-0.3393500745296478,
0.23192965984344482,
-0.1782565861940384,
-0.11887731403112411,
-0.6903827786445618,
-0.23251308500766754,
0.8477938771247864,
-0.41159719228744507,
-0.57519364356994... | |
of twelve-factor, which requires strict separation of config from
> code. Config varies substantially across deploys, code does not.
>
>
> A litmus test for whether an app has all config correctly factored out
> of the code is whether the codebase could be made open source at any
> moment, without compromising any... | [
0.45940032601356506,
-0.09028561413288116,
0.40342065691947937,
-0.018432965502142906,
0.33157575130462646,
-0.41889575123786926,
0.13597795367240906,
-0.41450315713882446,
-0.30076077580451965,
-0.6386641263961792,
-0.45370572805404663,
0.7709354758262634,
-0.45968836545944214,
-0.3156761... | |
the code.
>
>
> Another approach to config is the use of config files which are not
> checked into revision control, such as config/database.yml in Rails.
> This is a huge improvement over using constants which are checked into
> the code repo, but still has weaknesses: it’s easy to mistakenly check
> in a config... | [
0.11510207504034042,
-0.027192438021302223,
0.4616906940937042,
0.3515371084213257,
-0.06106575205922127,
-0.3140505254268646,
0.08959460258483887,
-0.04627789556980133,
-0.15068097412586212,
-0.6951475143432617,
-0.18934957683086395,
0.6727470755577087,
-0.5437042117118835,
-0.04879305511... | |
language- or framework-specific.
>
>
> The twelve-factor app stores config in environment variables (often
> shortened to env vars or env). Env vars are easy to change between
> deploys without changing any code; unlike config files, there is
> little chance of them being checked into the code repo accidentally;
>... | [
0.13428646326065063,
-0.001921742339618504,
0.34236449003219604,
0.06383220106363297,
0.02255028299987316,
0.04524381831288338,
0.0796273723244667,
-0.12722493708133698,
-0.18674343824386597,
-0.7492006421089172,
-0.4552333950996399,
0.5015778541564941,
-0.38293665647506714,
-0.33539107441... | |
as the development, test, and production
> environments in Rails. This method does not scale cleanly: as more
> deploys of the app are created, new environment names are necessary,
> such as staging or qa. As the project grows further, developers may
> add their own special environments like joes-staging, resulting... | [
0.08255406469106674,
-0.39392662048339844,
0.19824422895908356,
0.20818209648132324,
-0.053850624710321426,
0.19932305812835693,
0.09636557102203369,
-0.2741537094116211,
-0.2020336091518402,
-0.6747714877128601,
-0.30221620202064514,
0.4214938282966614,
-0.4503994286060333,
-0.16627068817... | |
managed for each deploy.
> This is a model that scales up smoothly as the app naturally expands
> into more deploys over its lifetime.
For Python, your config can be found in `os.environ`. For specific config, particularly the database you want to be using something like:
```
import os
import sys
import urlparse
#... | [
0.08094203472137451,
-0.20994317531585693,
0.5364144444465637,
0.12916748225688934,
0.278213769197464,
-0.021175770089030266,
-0.050620391964912415,
0.06722144037485123,
-0.5035635828971863,
-0.8778334856033325,
-0.17897456884384155,
0.4911413788795471,
-0.40580105781555176,
-0.16302113234... | |
in os.environ:
url = urlparse.urlparse(os.environ['DATABASE_URL'])
# Ensure default database exists.
DATABASES['default'] = DATABASES.get('default', {})
# Update with environment configuration.
DATABASES['default'].update({
'NAME': url.path[1:],
'USER': ... | [
-0.2624160647392273,
-0.23157931864261627,
0.6589297652244568,
0.26217904686927795,
0.4339444637298584,
-0.2749747633934021,
0.16171690821647644,
0.22411808371543884,
-0.26939448714256287,
-0.9179905652999878,
-0.47196564078330994,
0.44981849193573,
-0.32183176279067993,
-0.116316184401512... | |
'HOST': url.hostname,
'PORT': url.port,
})
if url.scheme == 'postgres':
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
if url.scheme == 'mysql':
DATABASES['default']['ENGINE'] = 'django.db.backends.mysql'
except Exception:
print... | [
-0.145824134349823,
0.1290784627199173,
0.2543694078922272,
-0.15473875403404236,
-0.3759416341781616,
-0.025887666270136833,
0.43031975626945496,
-0.11675728112459183,
-0.29433542490005493,
-0.5615895390510559,
-0.3938811123371124,
0.685553789138794,
-0.3601256310939789,
0.535755395889282... | |
I´m tryning to capture event of the front key´s Samsung galaxsy S but i don´t know the correct code, I check this:
```
if (event.getAction() == KeyEvent.ACTION_DOWN)
{
if(keyCode == KeyEvent.KEYCODE_HOME)
{
todoItems.add(0, myEditText.getText().toStri... | [
-0.09933491796255112,
-0.2003834992647171,
0.7238825559616089,
-0.27106285095214844,
0.15028969943523407,
-0.21317002177238464,
0.8449834585189819,
-0.4699177145957947,
-0.030330337584018707,
-0.4005463123321533,
-0.4271579086780548,
0.7428168058395386,
-0.26763609051704407,
-0.11352910101... | |
aa.notifyDataSetChanged();
return true;
}
}
```
too with `KEYCODE_DPAD_CENTER` but no capture the centre button
anyone know the keycode for this button?
Thanks you very much
For starters, storing your config in files is the wrong way to go about this, so don't do | [
0.42986392974853516,
0.048286572098731995,
0.36297810077667236,
-0.13266585767269135,
0.1573326140642166,
-0.26473096013069153,
0.32557904720306396,
-0.04205434396862984,
-0.04085436463356018,
-0.6163584589958191,
0.05666552484035492,
0.7448405623435974,
-0.4980294704437256,
-0.07210094481... | |
it.
From the [12factor app](http://www.12factor.net/config):
> An app’s config is everything that is likely to vary between deploys
> (staging, production, developer environments, etc). This includes:
>
>
> * Resource handles to the database, Memcached, and other backing
> services
> * Credentials to external ser... | [
0.4558505415916443,
-0.25597843527793884,
0.6854913234710693,
0.24907459318637848,
0.2833338677883148,
-0.1002916619181633,
0.01948367804288864,
-0.2373129427433014,
-0.011747823096811771,
-0.47766977548599243,
-0.58432936668396,
0.5699465870857239,
-0.11046953499317169,
-0.461079627275466... | |
test for whether an app has all config correctly factored out
> of the code is whether the codebase could be made open source at any
> moment, without compromising any credentials.
>
>
> Note that this definition of “config” does not include internal
> application config, such as config/routes.rb in Rails, or how ... | [
0.315285325050354,
0.057637766003608704,
0.4823170602321625,
0.11300010234117508,
0.18357513844966888,
-0.4853868782520294,
0.1367333084344864,
-0.3216697573661804,
-0.2601785659790039,
-0.6815198063850403,
-0.5546222925186157,
0.5688156485557556,
-0.492696076631546,
-0.23849506676197052,
... | |
as config/database.yml in Rails.
> This is a huge improvement over using constants which are checked into
> the code repo, but still has weaknesses: it’s easy to mistakenly check
> in a config file to the repo; there is a tendency for config files to
> be scattered about in different places and different formats, m... | [
0.2313552349805832,
-0.214593768119812,
0.33474594354629517,
0.15638819336891174,
-0.013166542164981365,
-0.014226214960217476,
0.08743654191493988,
-0.2829943299293518,
-0.15420857071876526,
-0.6887733340263367,
-0.2219603955745697,
0.5997012853622437,
-0.47653135657310486,
-0.19506753981... | |
are easy to change between
> deploys without changing any code; unlike config files, there is
> little chance of them being checked into the code repo accidentally;
> and unlike custom config files, or other config mechanisms such as
> Java System Properties, they are a language- and OS-agnostic standard.
>
>
> A... | [
0.10045185685157776,
0.2565191686153412,
0.307081401348114,
0.09383179992437363,
0.37777695059776306,
-0.11681627482175827,
0.04396364837884903,
-0.2629259526729584,
-0.4142838418483734,
-0.5605186223983765,
-0.5905823111534119,
0.4398995637893677,
-0.6400700211524963,
-0.3262259364128113,... | |
are created, new environment names are necessary,
> such as staging or qa. As the project grows further, developers may
> add their own special environments like joes-staging, resulting in a
> combinatorial explosion of config which makes managing deploys of the
> app very brittle.
>
>
> In a twelve-factor app, e... | [
0.12852834165096283,
-0.3289012312889099,
0.40372633934020996,
0.09451062232255936,
0.04105174168944359,
0.17171290516853333,
0.2141319364309311,
-0.24442605674266815,
-0.3259372115135193,
-0.72133469581604,
-0.3818379342556,
0.3378312587738037,
-0.42137691378593445,
-0.20787519216537476,
... | |
its lifetime.
For Python, your config can be found in `os.environ`. For specific config, particularly the database you want to be using something like:
```
import os
import sys
import urlparse
# Register database schemes in URLs.
urlparse.uses_netloc.append('postgres')
urlparse.uses_netloc.append('mysql')
try:
... | [
0.08104740083217621,
-0.2912871837615967,
0.7025374174118042,
0.08022159337997437,
0.21548627316951752,
-0.3411833643913269,
-0.0865776315331459,
0.05612080544233322,
-0.34792834520339966,
-0.6158285140991211,
-0.03675324097275734,
0.2056548148393631,
-0.2620612680912018,
0.083311423659324... | |
exists.
DATABASES['default'] = DATABASES.get('default', {})
# Update with environment configuration.
DATABASES['default'].update({
'NAME': url.path[1:],
'USER': url.username,
'PASSWORD': url.password,
'HOST': url.hostname,
'PORT': url.... | [
-0.08685080707073212,
0.21671773493289948,
0.7099181413650513,
0.1306607574224472,
0.5402625203132629,
-0.2924497127532959,
0.4460529685020447,
0.26286327838897705,
-0.046468887478113174,
-1.1403716802597046,
-0.15898491442203522,
0.4829397201538086,
-0.40143582224845886,
0.454592615365982... | |
})
if url.scheme == 'postgres':
DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'
if url.scheme == 'mysql':
DATABASES['default']['ENGINE'] = 'django.db.backends.mysql'
except Exception:
print 'Unexpected error:', sys.exc_info()
```
For more info on ... | [
-0.02899819426238537,
-0.02624724991619587,
0.34324368834495544,
-0.06622251123189926,
-0.13671356439590454,
0.01479523815214634,
0.4962029755115509,
-0.4209189713001251,
-0.26774099469184875,
-0.2763720750808716,
-0.35972848534584045,
0.7989529371261597,
-0.25679484009742737,
0.2327446341... | |
I am trying to create a function which will take arguments `arg1, arg2...` then pass them into a constructor for a new object C like so: `new C(arg1, arg2...)`, so to make a new instance of `C` the user would simply have to call `C(arg)` instead of `new C(arg)`. Here is my first attempt:
```
var C = function(a){ this.... | [
0.09996924549341202,
0.26831015944480896,
0.15802302956581116,
-0.3792288601398468,
-0.1187368780374527,
0.1500544399023056,
0.25527042150497437,
-0.36081236600875854,
-0.11453644186258316,
-0.46730342507362366,
0.07905833423137665,
0.6870511174201965,
-0.5075554251670837,
0.18393857777118... | |
take an arbitrary number of arguments and not use eval. I'm making a library implementing [Algebraic Data Types](http://en.wikipedia.org/wiki/Algebraic_data_type) in js.
---
Edit: The solution was to take [Jeremy's Idea](https://stackoverflow.com/a/9994434/139766) and adapt it to take an unbounded number of arguments... | [
0.023745227605104446,
-0.10343731939792633,
0.11527730524539948,
-0.11847419291734695,
-0.16042333841323853,
0.2728516459465027,
0.24451026320457458,
-0.5556592345237732,
-0.2315511852502823,
-0.2854258120059967,
0.003630061401054263,
0.4944562613964081,
-0.4564880430698395,
-0.01176834665... | |
back to C
return new C(newlessConstructorObj, arguments);
// Check to see if we got here from the line above, if so the arguments were passed in the second arg
var args = (arguments[0] === newlessConstructorObj) ? arguments[1] : arguments
// Do stuff with args
this.a = args[0];
}
C(0);
new C(... | [
-0.05128549411892891,
0.11993797868490219,
0.3178577125072479,
-0.3925936818122864,
0.02812173031270504,
0.006670551840215921,
0.37727463245391846,
-0.18749572336673737,
-0.1763661950826645,
0.026388326659798622,
-0.43204501271247864,
0.8484330773353577,
-0.4219989776611328,
0.052188307046... | |
return new C(a);
}
this.a = a;
}
```
so to create a new instance of "C":
```
c = new C(a);
```
and
```
c = C(a);
```
will both return a properly formed instance of C | [
-0.16496020555496216,
0.13275280594825745,
-0.15010493993759155,
-0.41957205533981323,
-0.013813849538564682,
-0.1633051335811615,
0.4305969774723053,
-0.16219405829906464,
-0.15641692280769348,
-0.39512720704078674,
-0.4690968692302704,
0.6147627830505371,
-0.4684891700744629,
0.360150098... | |
I want to be able to recognise ALL touches in an interface, no matter what was touched.
I've tried:
```
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
```
.. but this just recognises when the user taps on something that doesn't respond to taps (uiimages for instance)
The reason i need this abilit... | [
0.3353991210460663,
0.04520418494939804,
0.6701180934906006,
-0.20394065976142883,
-0.19577278196811676,
0.1319444179534912,
0.45752987265586853,
-0.19122324883937836,
-0.2002674788236618,
-1.025353193283081,
0.3551270663738251,
0.45233675837516785,
-0.061116158962249756,
0.074527822434902... | |
it is the best one.
```
@interface YourWindow : UIWindow {
NSDate timeOfLastTouch;
}
@end
@implementation YourWindow
- (void)sendEvent:(UIEvent *)event {
[super sendEvent:event];
NSSet *touches = [event allTouches];
UITouch *touch = [touches anyObject];
if( touch.phase == UITouchPhaseEnded ){
... | [
-0.17688512802124023,
-0.4616314470767975,
0.964806318283081,
-0.22340883314609528,
0.2657231092453003,
-0.2778569459915161,
0.42706143856048584,
-0.2631770968437195,
-0.06250355392694473,
-1.0733718872070312,
-0.11888954043388367,
0.6112696528434753,
-0.05353948101401329,
-0.1621177345514... | |
I was wondering if there was any way of changing the background in access. The standard grey is ok but I would like to change it to an image that shows instructions or what was updated last. Also, if I can allow a user to change the background to an image of their choice that would be cool as well.
Can this be done
I ... | [
0.7825523018836975,
-0.11968576163053513,
-0.021120429039001465,
0.17995963990688324,
0.19436556100845337,
0.31183263659477234,
0.008252239786088467,
0.5778958201408386,
-0.36008521914482117,
-0.7343395948410034,
0.616664707660675,
0.6535884141921997,
-0.18134425580501556,
0.07146444916725... | |
so I added a macro that allows them to disable the functionality. It works great. It was a little complicated to se up initially. Some of the modules below may have more stuff contained in them then what is needed for the purpose of this question. But here is what I did to make it work:
Add the Following modules to yo... | [
0.4829762279987335,
-0.19294951856136322,
0.605843186378479,
0.02063283696770668,
0.44577234983444214,
-0.2463550567626953,
0.016655610874295235,
-0.29603999853134155,
-0.5111585259437561,
-0.2633344829082489,
0.2603307068347931,
0.6538872122764587,
-0.1840437948703766,
-0.0122703192755579... | |
ThisFileToOpen function of the SetBackgroundImage module.
clsCommonDialog <-- Used to open the find file dialog box
modChangeMDI <--Used to change the background image
Create a table called $BackgroundLocation with the following fields. On my database this is contained in the backend database.
```
ID (AutoNumber, Pr... | [
-0.007917804643511772,
-0.16530157625675201,
0.6473973393440247,
-0.04935549199581146,
0.37136098742485046,
0.18639805912971497,
0.09463811665773392,
-0.18162135779857635,
-0.02563062682747841,
-0.5102773308753967,
-0.06467364728450775,
0.7694896459579468,
-0.4395354688167572,
-0.447387009... | |
the BackgroundSet macro to their own menu item.
When the database opens it will run the AutoExec by default. | [
0.11077362298965454,
-0.2113521248102188,
0.5271723866462708,
-0.033009860664606094,
0.09903424978256226,
0.07731032371520996,
-0.03400971740484238,
0.38889968395233154,
-0.20562748610973358,
-0.7219284772872925,
-0.26398029923439026,
0.707654595375061,
-0.38214221596717834,
-0.25131344795... | |
i came across a sample gdbinit file, which was having following statements. can anyone plz let me know what is so specific about the addresses (0x40000000, 0x80000000 and 0xBF000000) ? why the following check again them is letting me know of valid or invalid address ?
```
define dd
if ( ($arg0 & 0x40000000) || ($arg0 ... | [
-0.03138827532529831,
0.3342030346393585,
0.46181705594062805,
0.02413913421332836,
-0.03641059249639511,
0.20144808292388916,
0.36886775493621826,
-0.4697679281234741,
-0.026942430064082146,
-0.6964119076728821,
-0.09623371809720993,
0.5636045336723328,
-0.41280412673950195,
0.32647398114... | |
$data_addr=$esi
else
if ( ($edi & 0x40000000) || ($edi & 0x08000000) || ($edi & 0xBF000000) )
set $data_addr=$edi
else
if ( ($eax & 0x40000000) || ($eax & 0x08000000) || ($eax & 0xBF000000) )
set $data_addr=$eax
else
set $data_addr=$esp
end
```
any help will be greatly appreciated. thanks.
Most modern operating syste... | [
-0.28490495681762695,
0.2373710423707962,
0.5650330781936646,
0.1537274867296219,
0.39120757579803467,
0.10327862203121185,
0.03544672578573227,
-0.3971325755119324,
-0.1534677892923355,
-0.7163757085800171,
-0.20716090500354767,
0.24394221603870392,
-0.23474738001823425,
0.021619800478219... | |
not guarantee the accessibility of the given address), second part just uses the given register... | [
-0.10421939194202423,
0.11879157274961472,
0.30335986614227295,
0.16276158392429352,
0.08941679447889328,
-0.004273123107850552,
0.5727003812789917,
-0.09462567418813705,
0.2673078775405884,
-0.5682028532028198,
-0.4358951151371002,
0.23030224442481995,
-0.294147253036499,
-0.1537854224443... | |
Where can I find android SDK proxy setting?
I am working with ubuntu, thanks in advance.
All what I have is in below screen

I can only check this on my mac at the moment. The settings are stored in `~/.android/androidtool.cfg`
My settings current... | [
-0.03114268369972706,
0.3604758381843567,
0.505781352519989,
-0.009573525749146938,
0.004496025387197733,
0.10843271762132645,
0.5473966002464294,
-0.06218261644244194,
-0.05836440995335579,
-1.2115049362182617,
-0.08133257925510406,
0.697324812412262,
-0.12632732093334198,
0.1237675547599... | |
I have a list:
```
[['18411971', 'kinase_2', 36], ['75910712', 'unnamed...', 160], ...
```
* about 60 entries long
* each entry is a list with three values
I want to sort this bigger list by the first value in an order specified by another list which has them in the desired order.
The usual idiom is to sort using a... | [
-0.10941995680332184,
0.17134469747543335,
0.334888219833374,
-0.22912129759788513,
-0.1838582158088684,
0.33943983912467957,
0.2282598912715912,
-0.4842126667499542,
-0.14079585671424866,
-0.6066203713417053,
-0.14497926831245422,
0.20066088438034058,
-0.2722476124763489,
0.06670112162828... | |
4, 'fred']]
``` | [
0.02378055453300476,
0.4139951467514038,
0.22518649697303772,
-0.11761108040809631,
-0.4023629128932953,
0.30583229660987854,
0.06371424347162247,
-0.3066616952419281,
-0.37896472215652466,
-0.17498114705085754,
-0.24593572318553925,
0.5327328443527222,
-0.42929527163505554,
0.159168466925... | |
I'm trying to create a simple scene where I can walk around, with the criteria of being able to pan around and walk around with the keys. However, in my draw scene function, when I translate my scene than rotate, the panning around doesn't work properly as the entire scene just rotates around me, causing objects to go ... | [
0.20789121091365814,
-0.08144216239452362,
0.3314439058303833,
-0.055621188133955,
-0.21931347250938416,
0.11481267958879471,
0.11311603337526321,
-0.19631080329418182,
-0.2858700156211853,
-0.6164766550064087,
0.12778176367282867,
0.1676234006881714,
-0.36065614223480225,
-0.0581122785806... | |
anyway where I can put these 2 effects together?
This is the code that I use to draw my view:
```
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glPushMatrix();
glTranslated(xposition, 0, zposition); //This is where I translate my views
glRotated(yrot, 0, 1, 0); //
glEnableClientState(GL_NORM... | [
0.17371436953544617,
-0.22014982998371124,
1.150147795677185,
-0.09564711153507233,
-0.248819038271904,
0.29864370822906494,
0.4736616909503937,
-0.2536216974258423,
-0.3148522973060608,
-0.5149989724159241,
0.2639194428920746,
0.5103430151939392,
-0.3928460478782654,
0.02567407302558422,
... | |
scene, the entire thing rotates, which causes objects to clip through me and doesn't "pan" through the view anymore like when I rotate then translate my view.
<http://dl.dropbox.com/u/2747708/Screen%20Shot%202012-04-03%20at%2010.20.01%20PM.PNG>
I'm not sure how to comment on or add to Kendall's answer so I'll just add... | [
0.06766161322593689,
-0.26256605982780457,
0.8498064279556274,
-0.11879214644432068,
-0.09572211652994156,
0.3881773352622986,
0.18650342524051666,
0.04680103436112404,
-0.6124230623245239,
-0.44837674498558044,
0.05346640944480896,
0.09492983669042587,
-0.23282615840435028,
0.201925814151... | |
sin(direction)*forwardsBackwards;
movementZ = cos(direction)*forwardsBackwards;
```
If you need strafing as well you can do:
```
movementX = sin(direction)*forwardsBackwards+sin(direction+1.5707)*sideToSide;
movementZ = cos(direction)*forwardsBackwards+cos(direction+1.5707)*sideToSide;
```
Where sideToSide is 1 or... | [
-0.24241824448108673,
-0.03890233114361763,
0.49839675426483154,
-0.2758491337299347,
-0.42928600311279297,
0.3104732632637024,
0.4082840085029602,
-0.6003004908561707,
-0.5545834302902222,
-0.5880485773086548,
0.15789560973644257,
0.3439975380897522,
-0.058961156755685806,
-0.139380544424... | |
directions at once. If you want to make it so that doesn't happen add this before calculating movement:
```
if (!forwardsBackwards && !sideToSide )
{
forwardsBackwards *= 0.7071;
sideToSide *= 0.7071;
}
```
You could also replace .7071 with cos(45) if you need it to be extremely accurate.
Alternatively yo... | [
-0.10705968737602234,
0.030290769413113594,
1.0453174114227295,
-0.07127797603607178,
0.040827225893735886,
0.16540750861167908,
-0.020508376881480217,
-0.300156831741333,
-0.28217118978500366,
-0.5469754934310913,
0.0755285918712616,
0.629608690738678,
-0.18911153078079224,
-0.12463578581... | |
will rotate around, the pivot point. This is why you would clip through objects when rotating.
Also, you should perform "camera" rotation and translation immediately following a glLoadIdentity(); as you want everything else in your scene to move and rotate, as that is how an OpenGL "camera" functions. This is how it w... | [
0.1843348741531372,
-0.2186116874217987,
1.019858956336975,
0.03484228625893593,
-0.07144588977098465,
0.20814065635204315,
-0.23803114891052246,
-0.2883009910583496,
-0.4684181213378906,
-0.39972254633903503,
-0.17521633207798004,
0.6162429451942444,
-0.3675135672092438,
-0.16629756987094... | |
I am using the Moodle database to query the latest forum posts made by students and teachers for the relevant course they are enrolled in.
Here are the tables I need to join and an explanation in what they hold:
> mdl\_forum\_posts = "all posts are stored in this table"
>
> mdl\_forum\_discussions = "forums are ... | [
0.43302568793296814,
0.2178199142217636,
0.6430568695068359,
-0.2360970824956894,
-0.06701206415891647,
0.066920205950737,
-0.07055129110813141,
-0.04559827223420143,
-0.1511630117893219,
-0.7217189073562622,
-0.121164470911026,
0.0864778533577919,
0.08829176425933838,
-0.16075696051120758... | |
courses"
>
> mdl\_enrol = "instances of enrolment plugins used in mdl\_course"
>
> mdl\_course = "courses available in the system"
Here is my query:
```
SELECT l.time AS TimeofPost, l.action as Action, usr.id as UserID,
usr.firstname,usr.lastname, c.id as CourseID , c.fullname,
c.idnumber, fd.... | [
0.20847176015377045,
-0.08680271357297897,
0.5803124308586121,
0.033322762697935104,
0.34246402978897095,
0.5620617866516113,
-0.13450117409229279,
-0.2240733504295349,
-0.17258404195308685,
-0.48642170429229736,
-0.44549429416656494,
0.23195144534111023,
0.05879634618759155,
0.26053425669... | |
usr.id = ue.userid
LEFT JOIN mdl_enrol e ON ue.enrolid = e.id
LEFT JOIN mdl_course c ON e.courseid = c.id
WHERE (action = 'add post' OR action = 'add discussion')
```
The problem I have is that I am getting duplicate results.
No need to use the logs table - the fact that a post has been added and has a timestamp... | [
0.17249079048633575,
0.32318663597106934,
0.4619969129562378,
0.12421621382236481,
0.04989861696958542,
0.047371115535497665,
0.1059819906949997,
0.04448486492037773,
-0.4033629298210144,
-0.688451886177063,
-0.08596154302358627,
0.1929415613412857,
-0.08495759963989258,
0.4588606059551239... | |
they won't show up, but this isn't really necessary.
You are getting duplicates because there are multiple matches for each forum post e.g. enrol table has many instances for each course. This query makes sure you just get stuff where there is one.
```
SELECT fp.id,
usr.id as UserID,
usr.f... | [
0.27191147208213806,
0.19283470511436462,
0.5141529440879822,
0.26407375931739807,
0.1800595223903656,
0.11710910499095917,
-0.15807873010635376,
0.2871219217777252,
-0.008278708904981613,
-0.8606876134872437,
-0.20664945244789124,
0.22864291071891785,
-0.16103480756282806,
0.3047265708446... | |
c.fullname,
c.idnumber,
fd.name,
fd.timemodified as DiscussionCreatedOn,
fp.created AS TimeofPost,
fp.modified,
fp.subject,
fp.message | [
-0.1325725018978119,
-0.33332541584968567,
0.4657619893550873,
0.19095927476882935,
0.11118544638156891,
0.28987956047058105,
-0.05523926019668579,
0.31623008847236633,
-0.3594547212123871,
-0.5979186296463013,
-0.7959182858467102,
-0.007488655857741833,
-0.13129004836082458,
0.34411925077... | |
FROM mdl_forum_posts fp
INNER JOIN mdl_forum_discussions fd ON fp.discussion = fd.id
INNER JOIN mdl_forum f ON f.id = fd.forum
INNER JOIN mdl_course c ON f.course = c.id
INNER JOIN mdl_user usr ON fp.userid = usr.id
WHERE EXISTS (SELECT 1
FROM mdl_user_enrolments ue
INNER JOIN... | [
-0.09009094536304474,
0.05351744964718819,
0.6620405316352844,
0.0006868424243293703,
-0.04259246215224266,
0.24220015108585358,
-0.08889632672071457,
-0.35100147128105164,
-0.34102511405944824,
-0.6854761242866516,
-0.3962370455265045,
0.5012902617454529,
-0.24650830030441284,
0.050273481... | |
WHERE usr.id = ue.userid
AND e.courseid = f.course)
``` | [
-0.11305664479732513,
0.4271335303783417,
0.5941952466964722,
0.013349092565476894,
0.44579875469207764,
-0.00628295075148344,
0.15018761157989502,
0.13575108349323273,
-0.018930403515696526,
-0.6265875101089478,
-0.47532469034194946,
0.37715157866477966,
0.168033167719841,
0.3966597318649... | |
I want that when user click on any row of table base div.I insert id of that row into hidden
field array. Hence user can select multiple rows.And i want insert id into hidden field array
when click event will be invoke..
My html code is
```
<div id="originator_rates">
<% unless @orig_codes.blank? %>
... | [
0.10636592656373978,
0.12842890620231628,
0.6711562275886536,
-0.19284963607788086,
0.06259883940219879,
0.2164473831653595,
-0.16666337847709656,
-0.3002445101737976,
0.05020340159535408,
-0.972506046295166,
0.1925087571144104,
0.3160364329814911,
-0.39521148800849915,
0.2933652102947235,... | |
<%= hidden_field_tag 'code_id[]', :id => 'code_id' %>
</div>
<%end%>
<div>
```
my js code is
```
function rate_entry_select_originator(code_id) {
$('#code_id').push(code_id); //how i push values into array
}
```
No need to use the logs table - the fact... | [
0.22383877635002136,
0.20408324897289276,
0.5451227426528931,
-0.3683212697505951,
0.0806649848818779,
0.1687687784433365,
0.12754425406455994,
-0.13171041011810303,
-0.08994381129741669,
-0.6530947685241699,
-0.0018273111199960113,
0.08468061685562134,
-0.2652552127838135,
0.3195279538631... | |
is all you need. Also, you don't really want to use LEFT JOIN unless you expect null values, which should never be the case here. I've left in the link to the enrolment table so that if any students are unenrolled, they won't show up, but this isn't really necessary.
You are getting duplicates because there are multip... | [
0.43232887983322144,
0.2820061445236206,
0.1987670361995697,
0.2481204867362976,
0.20668475329875946,
0.032291144132614136,
-0.08321501314640045,
0.11203554272651672,
-0.2939493656158447,
-0.5530338287353516,
0.02133399061858654,
0.2942105233669281,
-0.07852397859096527,
0.1560076922178268... | |
as UserID,
usr.firstname,
usr.lastname,
c.id as CourseID,
c.fullname,
c.idnumber,
fd.name,
fd.timemodified as DiscussionCreatedOn, | [
-0.1433103233575821,
-0.23055841028690338,
0.6225130558013916,
0.08608223497867584,
0.2746160626411438,
0.2293991595506668,
-0.09260867536067963,
0.5252131223678589,
-0.051590774208307266,
-0.6933611035346985,
-0.6028913855552673,
0.3899138569831848,
0.07808362692594528,
0.1537091434001922... | |
fp.created AS TimeofPost,
fp.modified,
fp.subject,
fp.message
FROM mdl_forum_posts fp
INNER JOIN mdl_forum_discussions fd ON fp.discussion = fd.id
INNER JOIN mdl_forum f ON f.id = fd.forum
INNER JOIN mdl_course c ON f.course = c.id
INNER JOIN mdl_user usr ON fp.userid = usr.id... | [
-0.07228921353816986,
-0.18789690732955933,
0.6799218654632568,
-0.017331093549728394,
-0.033700283616781235,
0.33929088711738586,
-0.06436034291982651,
-0.37926727533340454,
-0.41865575313568115,
-0.75285404920578,
-0.27966415882110596,
0.2614613473415375,
-0.39876604080200195,
0.07608544... | |
FROM mdl_user_enrolments ue
INNER JOIN mdl_enrol e ON ue.enrolid = e.id
WHERE usr.id = ue.userid
AND e.courseid = f.course)
``` | [
0.03325771912932396,
0.31246569752693176,
0.792628824710846,
-0.12686732411384583,
0.29869306087493896,
0.26242634654045105,
-0.12839071452617645,
-0.17121484875679016,
-0.06466267257928848,
-0.8231581449508667,
-0.4143943786621094,
0.4825141429901123,
0.07270630449056625,
0.33096110820770... | |
I have been trying to understand Rx more deeply, by following Bart De Smetts MinLinq, and Jon Skeets 'Reimplementing' series I have built up a good understanding but...
Taking the following code as an example
```
var onePerSecond = Observable.Interval(TimeSpan.FromSeconds(1));
var evenNums = onePerSecond.Where(x => ... | [
0.009439211338758469,
-0.13602331280708313,
0.5029855966567993,
-0.16223154962062836,
0.06596821546554565,
0.06685017049312592,
-0.08533912897109985,
-0.39479756355285645,
-0.17746128141880035,
-0.7476364970207214,
0.19013579189777374,
0.3697383999824524,
-0.45402225852012634,
0.0946937203... | |
(or lambda equivelant), and therefore effectively be observing all notifications from the onePerSecond object, and in turn returning an IObservable that only contains values that the predicate found to be true?
Any help and thoughts very welcome, many thanks
James
By looking at the source code with ILSpy it's easy to... | [
-0.052242591977119446,
-0.1115347221493721,
0.37171247601509094,
-0.0808078870177269,
-0.28497114777565,
-0.09724391251802444,
0.26470285654067993,
-0.09847689419984818,
-0.06088146194815636,
-0.7120159268379211,
-0.20318816602230072,
0.6505215764045715,
-0.6091200709342957,
-0.05730758607... | |
}
if (predicate == null)
{
throw new ArgumentNullException("predicate");
}
return new AnonymousObservable<TSource>((IObserver<TSource> observer) => source.Subscribe(delegate(TSource x)
{
bool flag;
try
{
flag = predicate(x);
}
catch (Except... | [
0.22829878330230713,
-0.3767150938510895,
0.43984895944595337,
-0.05609753727912903,
-0.022153746336698532,
0.04731232672929764,
0.5100747346878052,
-0.3331327736377716,
-0.3344356417655945,
-0.6589854955673218,
-0.09297976642847061,
0.3657343089580536,
-0.5403366684913635,
0.1933885812759... | |
{
observer.OnError(error);
return;
}
if (flag)
{
observer.OnNext(x);
}
}
, new Action<Exception>(observer.OnError), new Action(observer.OnCompleted)));
}
``` | [
-0.03172725811600685,
-0.26467958092689514,
0.39750590920448303,
-0.06227032095193863,
0.09876701980829239,
-0.0482846200466156,
0.21250049769878387,
-0.2516231834888458,
-0.4331434965133667,
-0.4583326578140259,
-0.3210449814796448,
0.32637181878089905,
-0.6947343945503235,
0.111685551702... | |
I'm constantly confused by the rules for quoting and evaluating when I'm writing bash scripts. I know some of the basics, like the difference between '' and "" and ``, but I still seem to get it wrong far too often, and be reduced to experimenting with trying all sorts of different ways to say the same thing.
Any indi... | [
0.21798978745937347,
0.3749619722366333,
-0.05537315458059311,
-0.06858520954847336,
-0.4681320786476135,
0.0679030492901802,
0.4015876352787018,
-0.15607896447181702,
-0.17176860570907593,
-0.6910549998283386,
0.2148990035057068,
0.8153108358383179,
-0.02598629705607891,
-0.46628770232200... | |
to help people understand what was going on: <http://www.learningclojure.com/2010/11/syntax-quote-kata-for-confused.html>
I guess that I'm looking for something similar for bash, (which seems much more complicated). A good model, or a set of exercises that will help me form such a model, that will make me able to look... | [
0.30185264348983765,
-0.030619602650403976,
-0.6048175692558289,
0.1336820274591446,
-0.4002198576927185,
0.02690802700817585,
0.5032337307929993,
-0.2376668006181717,
0.13469602167606354,
-0.25482767820358276,
0.22030700743198395,
0.7670896649360657,
0.09213542938232422,
-0.06072359159588... | |
Quote Tutorial](http://www.grymoire.com/Unix/Quote.html) is awesome, and the Bash [FAQ](http://mywiki.wooledge.org/BashFAQ/)/[pitfalls](http://mywiki.wooledge.org/BashPitfalls)/[word splitting](http://mywiki.wooledge.org/WordSplitting) articles have tons of useful tips. A short summary:
**Unquoted** strings can contai... | [
0.4352604150772095,
0.06479021161794662,
0.24948236346244812,
0.1973586529493332,
-0.48803937435150146,
-0.014083144254982471,
0.28157511353492737,
-0.23435968160629272,
-0.15540964901447296,
-0.4240029752254486,
-0.04335876554250717,
0.47283291816711426,
-0.10595334321260452,
-0.192134097... | |
your shell does not support `$()`. Example:
```
current_dir=`pwd` # BAD! Don't do this!
```
That command is bad, because when the right hand side of an assignment is not quoted the shell performs [word splitting](http://mywiki.wooledge.org/WordSplitting) on it. It often leads to hard-to-reproduce bugs, because white... | [
0.12315920740365982,
0.0022447940427809954,
0.08786848932504654,
-0.10643414407968521,
-0.039542604237794876,
-0.14924636483192444,
0.4721970558166504,
-0.14586006104946136,
-0.10947179794311523,
-0.5567297339439392,
-0.17224211990833282,
0.7134953737258911,
-0.5060882568359375,
0.03983798... | |
commands (like `pwd`) will add a newline at the end of their output *anyway*, so you might have to remove that as well:
```
# Works for some commands, including pwd
current_dirx="$(pwd; echo x)"
current_dir="${current_dirx%$'\nx'}"
printf %s "$current_dir"
```
Double quotes can contain *any* character (Try `echo -ne... | [
-0.24467501044273376,
-0.09481306374073029,
0.3736206293106079,
0.12457814067602158,
-0.1227908656001091,
0.07666362076997757,
0.5489129424095154,
-0.2783321738243103,
-0.1094009205698967,
-0.25604191422462463,
-0.2727043032646179,
0.5985898971557617,
-0.38421809673309326,
0.02520177327096... | |
I want to have a `UIImage`as a background image on a `UIView.`
Here is my code:
```
UIColor *background = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"login.png"]];
self.view.backgroundColor = background;
[background release];
```
The Problem is, that the scale is not okay. It scaled 640 to 480, so I... | [
0.12997010350227356,
-0.2014589011669159,
0.7080137729644775,
0.12300607562065125,
-0.043557628989219666,
0.10688059777021408,
0.13412123918533325,
-0.06887464970350266,
-0.11343708634376526,
-1.036410927772522,
0.15146151185035706,
0.5541348457336426,
-0.11627759784460068,
0.0696645006537... | |
the pattern color is tiled as necessary to cover the given area.
That means it tries to create a pattern out of your image to fill the area. I think the optimal way to do it is so rescale your image to fit exactly the `UIView` size.
There is a nice answer here how to resize your image during runtime:
[The simplest w... | [
0.25537386536598206,
-0.22175033390522003,
0.5213399529457092,
0.07981173694133759,
-0.17737829685211182,
-0.030309241265058517,
0.2393133044242859,
-0.27075114846229553,
-0.2776946723461151,
-0.8844797611236572,
-0.13206486403942108,
0.4191044569015503,
-0.04656795784831047,
0.03819158300... | |
In [C++11](http://en.wikipedia.org/wiki/C%2B%2B11), there are two loops over all elements (range based for and for\_each). Is there any reason to prefer one over the other or are there situations where one is a better fit?
```
for (auto& elem: container) {
// do something with elem
}
std::for_each(container.begin()... | [
0.1455697864294052,
-0.04320063814520836,
0.0440109558403492,
-0.3345164954662323,
0.2527114152908325,
-0.13897408545017242,
0.10941039025783539,
-0.24762818217277527,
-0.20795519649982452,
-0.18736085295677185,
-0.5203993916511536,
0.4205414950847626,
-0.6572991609573364,
-0.3579886853694... | |
first is simpler and is similar to range based loops in other languages while the second also works for sequences that are not complete containers and the second is more similar to other `std`-algorithms.
1. Range-based `for` is obviously simpler to read and write. It is specialized for this task.
**EDIT:** You can br... | [
0.2268628180027008,
-0.2347813993692398,
-0.08698682487010956,
-0.17622672021389008,
-0.19531196355819702,
-0.2045629471540451,
0.32841113209724426,
-0.2490798830986023,
-0.1350279003381729,
-0.6327919363975525,
-0.1983289122581482,
0.6353753805160522,
-0.47132033109664917,
-0.108894847333... | |
a simple `range` class providing `begin` and `end` members, such as provided by Boost.)
Also `for_each` may be more elegant when otherwise using higher-order functions: it can be used as an argument to `bind`, and the third argument is already a functor.
Mainly it's a matter of style. Most readers probably prefer to ... | [
0.1543947160243988,
-0.025631269440054893,
0.09165097028017044,
-0.2140221744775772,
-0.1470278948545456,
-0.28313663601875305,
0.21229682862758636,
-0.2959105968475342,
0.10292360186576843,
-0.06328331679105759,
-0.4681081175804138,
0.764018177986145,
-0.3245571553707123,
-0.2753512859344... | |
I've got some nifty code that on user login, finds any other user logged in as that user and logs them out. It works just fine, but it doesn't offer any indication as to why these people are no longer logged in, so I'm trying to remedy that with Django's messaging system.
> You've been logged out because *somebody* ha... | [
0.39486032724380493,
0.33729803562164307,
0.2663554847240448,
-0.09147849678993225,
-0.10503313690423965,
-0.056205250322818756,
0.27738863229751587,
0.0950062945485115,
-0.41243860125541687,
-0.5271551609039307,
0.1587599217891693,
0.5596433877944946,
-0.03550373390316963,
0.1089598461985... | |
objects, I only have the *kicking* user's object.
So I'm working on options. I suppose I could write a model to log these sorts of messages, keyed by session id (which I have from every user), and then some middleware that checks the db for any messages for that session id *on every request* but that seems really wast... | [
0.4802282154560089,
0.2501858174800873,
0.10435525327920914,
0.2834521234035492,
-0.4702066481113434,
0.24794919788837433,
0.47354310750961304,
0.11836043000221252,
-0.37965643405914307,
-0.527693510055542,
0.1858709752559662,
0.25779569149017334,
-0.23949649930000305,
0.24470926821231842,... | |
comes looking with a similar problem.
First I had to set the storage backend to use sessions rather than whatever the default is. I thought the default was sessions, but from inspecting the database, I didn't see it.
```
# settings.py
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
```
Ne... | [
0.158993199467659,
-0.017844365909695625,
0.4080849885940552,
-0.11321604996919632,
-0.3274782598018646,
0.04558408260345459,
0.27152612805366516,
-0.4843754470348358,
-0.3998017907142639,
-0.5939247012138367,
0.015223945491015911,
0.6782488822937012,
-0.5817425847053528,
-0.01961766555905... | |
for session in Session.objects.filter(session_key__in=keys):
s = SessionStore(session.session_key)
# Hack to log the user out without expiring the session immediately,
# otherwise they'll never see their message
s["_auth_user_id"] = 0
# The _messages property is a list of Mess... | [
0.2576929032802582,
0.11250833421945572,
0.28031423687934875,
-0.06621084362268448,
-0.05222903937101364,
-0.11259995400905609,
0.7691251039505005,
-0.13630148768424988,
-0.5375494360923767,
-0.633673906326294,
-0.10199600458145142,
0.6653711795806885,
-0.34076493978500366,
0.2988346219062... | |
s.save()
```
And that's it. Originally, I just deleted the session, but this (admittedly hackish) way, I can log out the user and let them retain the session so they can see their message. | [
0.5520762205123901,
0.06615883111953735,
0.2862512171268463,
-0.04069105163216591,
0.09550096839666367,
-0.04121100530028343,
0.43756988644599915,
0.24600546061992645,
-0.1531733274459839,
-0.6165027022361755,
-0.271097332239151,
0.5610909461975098,
-0.2662530243396759,
0.43175825476646423... | |
I have a plist that looks like this:
```
<dict>
<key>Aaron</key>
<dict>
<key>number</key>
<string>1234</string>
<key>country</key>
<string>Spanien</string>
<key>year</key>
<string>1989</string>
</dict>
<key>Abagail</key>
<dict>
<key>number</key>
<string>1234</string>
<key>country</k... | [
-0.49285048246383667,
-0.024291986599564552,
0.5708291530609131,
-0.2676142752170563,
-0.5883340239524841,
0.7894853949546814,
-0.1316716969013214,
-0.24481041729450226,
-0.41340142488479614,
-0.5331435203552246,
0.4167945981025696,
-0.2320845127105713,
-0.146489679813385,
0.07450416684150... | |
object. My viewdidload looks like this
```
NSString *path = [[NSBundle mainBundle] pathForResource:@"vin"
ofType:@"plist"];
NSDictionary *dict = [[NSDictionary alloc]initWithContentsOfFile:path];
self.allNames = dict;
NSString *key2 = viewTitle;
NSLog(@"test %@", [di... | [
0.005545075982809067,
-0.037775762379169464,
0.6128826141357422,
-0.09734711796045303,
-0.158681258559227,
-0.16220834851264954,
0.40396180748939514,
0.2750978469848633,
-0.24755331873893738,
-0.7722879648208618,
-0.03267969936132431,
0.29784753918647766,
-0.08764582872390747,
0.2018327265... | |
I just started with GWT. I made the tutorial given [here](https://developers.google.com/web-toolkit/doc/latest/tutorial/gettingstarted?hl=bg-BG) . But when I created new project and added two buttons in a horizontal panel and then in the RootPanel it displayed me just the header I've made in the HTML file. Can you tell... | [
-0.15028689801692963,
-0.09158782660961151,
0.14947271347045898,
-0.31334587931632996,
0.0853448212146759,
0.40624091029167175,
0.16539035737514496,
-0.23894599080085754,
-0.2777748703956604,
-0.5789399147033691,
-0.2734646201133728,
0.39866626262664795,
-0.29332640767097473,
0.19144894182... | |
private HorizontalPanel mainHorizontalPanel = new HorizontalPanel();
private Label lastUpdatedLabel = new Label();
public void onModuleLoad() {
mainHorizontalPanel.add(newData);
mainHorizontalPanel.add(existingData);
mainHorizontalPanel.add(lastUpdatedLabel);
RootPanel.get("Sal... | [
0.1695115715265274,
0.033310629427433014,
0.5852466821670532,
0.09346217662096024,
0.368292897939682,
0.320488840341568,
0.22093947231769562,
0.07216892391443253,
-0.2723672688007355,
-0.423999547958374,
-0.5668580532073975,
0.2633972764015198,
0.26091423630714417,
0.1480470597743988,
0.... | |
Defences Organiser</title>
<script type="text/javascript" language="javascript" src="stockwatcher/stockwatcher.nocache.js"></script>
</head>
<body>
<h1>Diploma Defences Organiser</h1>
<div id="Salvation"></div>
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' st... | [
0.0391092486679554,
0.13510660827159882,
0.3245154917240143,
-0.5602903962135315,
-0.39447021484375,
0.11056467145681381,
0.6660053133964539,
-0.6141766905784607,
-0.5144369602203369,
-0.28816649317741394,
-0.1975591629743576,
-0.05179968848824501,
0.12724797427654266,
0.09737325459718704,... | |
Your web browser must have JavaScript enabled
in order for this application to display correctly.
</div>
</noscript>
</body>
</html>
```
And the XML:
```
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='Salvation'>
<!-- Inherit the core Web Toolkit stuff. ... | [
0.30469873547554016,
-0.005581303499639034,
0.3262220621109009,
-0.04048255458474159,
0.13636669516563416,
-0.14247186481952667,
0.3801635801792145,
-0.1663993000984192,
-0.154155895113945,
-0.7814797759056091,
-0.4611934721469879,
0.5434529781341553,
-0.20336470007896423,
0.06951805949211... | |
sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inheri... | [
0.2959135174751282,
0.025995461270213127,
0.8041991591453552,
-0.04496515542268753,
-0.1582493782043457,
-0.40025538206100464,
-0.04956698790192604,
-0.6616355180740356,
-0.3580366373062134,
-0.5292443633079529,
-0.5405616164207458,
0.36715084314346313,
-0.560571014881134,
0.61009675264358... | |
-->
<!-- Specify the app entry point class. -->
<entry-point class='org.elsys.salvation.client.Salvation'/>
<!-- Specify the paths for translatable code -->
<source path='client'/> | [
-0.23076720535755157,
0.1859535574913025,
0.34164485335350037,
-0.07808312773704529,
0.46963661909103394,
0.6191301941871643,
0.10575622320175171,
-0.1967504769563675,
-0.24580982327461243,
-0.6364912986755371,
-0.3105507493019104,
0.34803858399391174,
-0.47271883487701416,
-0.215651944279... | |
<source path='shared'/>
</module>
```
It turned out that you can not have annotations on methods that are accessed from within the same class, whether private or public. The annotations only work on public methods accessed by outsiders.
Hope that helps someone making the same mistake. | [
0.30366379022598267,
0.013058045879006386,
-0.0835888683795929,
0.31792590022087097,
-0.11563889682292938,
-0.4028399884700775,
0.45000123977661133,
-0.21032458543777466,
-0.11222707480192184,
-0.7446973323822021,
0.02756810560822487,
0.3621172308921814,
-0.18806609511375427,
0.12236613035... | |
```
SELECT DISTINCT _id, Game_name, Book, Chapter, Verse_start, Verse_stop, Scripture
FROM Bible_Game WHERE God's Kingdom
```
i have above code in sqlite select statement and it gives me following error.
```
android.database.sqlite.SQLiteException: unrecognized token: "'s Kingdom": , while compiling: SELECT DISTINC... | [
-0.5239059329032898,
0.49543917179107666,
0.15975035727024078,
0.023756440728902817,
-0.007155690807849169,
0.42300036549568176,
0.2988584637641907,
-0.17539016902446747,
-0.3083031177520752,
-0.8113000988960266,
0.17489485442638397,
0.1413012146949768,
-0.10574255883693695,
0.356580615043... | |
text strings must appear in single quotes. Any internal single quotes within the string must be escaped by doubling the quote character.
If my assumption about your intention is correct, the proper SQL to use is:
```
SELECT DISTINCT _id, Game_name, Book, Chapter, Verse_start, Verse_stop, Scripture
FROM Bible_Game ... | [
-0.040348347276449203,
0.4567182958126068,
0.33933594822883606,
-0.06791792809963226,
-0.11554916203022003,
0.09007646143436432,
0.2368292361497879,
0.20714128017425537,
-0.08670260012149811,
-0.45254573225975037,
-0.3773775100708008,
0.3515351414680481,
-0.28436240553855896,
0.17884576320... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.