Symfony mapping compiler pass - mapping

I'm using Symfony 2.5 freshly installed from the top of this page: http://symfony.com/download
I'm trying to register a mapping compiler pass following the instructions on this page: http://symfony.com/doc/current/cookbook/doctrine/mapping_model_classes.html
Note the "2.5 version" marker on top of the page.
However, the file used in the sample code:
Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass
does not exist in my install. Everything else is there.
Here's my composer.json:
"require" : {
"php" : ">=5.3.3",
"symfony/symfony" : "2.5.*",
"doctrine/orm" : "~2.2,>=2.2.3",
"doctrine/doctrine-bundle" : "~1.2",
"twig/extensions" : "~1.0",
"symfony/assetic-bundle" : "~2.3",
"symfony/swiftmailer-bundle" : "~2.3",
"symfony/monolog-bundle" : "~2.4",
"sensio/distribution-bundle" : "~3.0",
"sensio/framework-extra-bundle" : "~3.0",
"incenteev/composer-parameter-handler" : "~2.0"
},
"require-dev" : {
"sensio/generator-bundle" : "~2.3",
"phpunit/phpunit" : "4.2.*"
}
Any help appreciated.

I ended up opening an issue ticket at the Doctrine Bundle repository. It turns out there was a small typo in the Symfony doc, which has been fixed.

Related

Xcode: How to create alias for already added image

I wonder if it is possible to create alias for an image in Xcode so I don't have to add it multiple times (in order to override other targets resources, e.g. n : 1). While it is possible in Android ecosystem I hoped that Xcode/iOS has something similar, so I would expect something like this to work.
Imagine: Resources > Assets > MyAssetCatalog > foo > bar.pdf
So there is folder called foo with this content:
-- foo
--|-- Content.json
--|-- bar.imageset
--|--|-- Content.json
--|--|-- bar.pdf
--|-- bar_alias.imageset
--|--|-- Content.json
where there is something like this in alias' content file:
{
"images" : [
{
"filename" : "../bar.imageset/bar.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Any idea if something like this is supposed to work, or there is another way how to achieve this?

bitcoin transaction block height

Hi I check that in the blockchain.info or blockr.io or other block explorer when checking one transaction ( not my own wallet transaction ) I could see the return value of "block_height" which can be use to count the transaction confirmation using block_count - block_height.
I have my own bitcoin node with -txindex enabled and I add additional txindex=1 in the conf.
But when using "bitcoin-cli decoderawtransaction " the parameters was never there.
How do I turn on that ? Or is it a custom made code ?
Bitcoind run under Ubuntu 14.04 x64bit version 0.11.0
I disable the wallet function and install using https://github.com/spesmilo/electrum-server/blob/master/HOWTO.md
The decoderawtransaction command just decodes the transaction, that is, it makes the transaction human readable.
Any other (though useful) information which is not related to the raw structure of a transaction is not shown.
If you need further info, you might use getrawtransaction <tx hash> 1, which returns both the result of decoderawtransaction and some additional info, such as:
bitcoin-cli getrawtransaction 6263f1db6112a21771bb44f242a282d04313bbda5ed8b517489bd51aa48f7367 1
-> {
"hex" : "010000000...0b00",
"txid" : "6263f1db6112a21771bb44f242a282d04313bbda5ed8b517489bd51aa48f7367",
"version" : 1,
"locktime" : 723863,
"vin" : [
{...}
],
"vout" : [
{...}
],
"blockhash" : "0000000084b830792477a0955eee8081e8074071930f7340ff600cc48c4f724f",
"confirmations" : 4,
"time" : 1457383001,
"blocktime" : 1457383001
}

Some Images not loading on heroku?

So, I have an app running in production on heroku and for some odd reason the images associated with the rating system aren't loading. In other words, users have the ability to rate movies and there should be 5 star images displayed and they can choose how many stars that they rate the movie.
Now the stars show perfectly fine in development but this is how they appear in production:
When I right click and inspect element it says "Failed to load the given url"
I've also run these:
locally: rake assets:precompile
locally: RAILS_ENV=production bundle exec rake assets:precompile
production: heroku run bundle exec rake assets:precompile
and the images still aren't displaying, what am I doing wrong?
Thanks!
edit (so the path is wrong, now i should be using asset_path for the images but they're in a query plugin!!! How do I get around this so they can be pulled from the asset_path? BTW, they're star-off.png:
$.fn.raty.defaults = {
cancel : false,
cancelHint : 'cancel this rating!',
cancelOff : 'cancel-off.png',
cancelOn : 'cancel-on.png',
cancelPlace : 'left',
click : undefined,
half : false,
halfShow : true,
hints : ['bad', 'poor', 'regular', 'good', 'gorgeous'],
iconRange : undefined,
mouseover : undefined,
noRatedMsg : 'not rated yet',
number : 5,
path : 'img/',
precision : false,
round : { down: .25, full: .6, up: .76 },
readOnly : false,
score : undefined,
scoreName : 'score',
single : false,
size : 16,
space : true,
starHalf : 'star-half.png',
starOff : 'star-off.png',
starOn : 'star-on.png',
target : undefined,
targetFormat : '{score}',
targetKeep : false,
targetText : '',
targetType : 'hint',
width : undefined
};
I had this same issue and ended up just correcting the link direct in the raty.js with the actual precompiled links...
starHalf : 'star-half.png',
starOff : 'star-off.png',
starOn : 'star-on.png',
to this
starHalf : 'star-half-db15fb9b3561d5c741d8aea9ef4f0957bd9bc51aa1caa6d7a5c316e083c1abd5.png',
starOff : 'star-off-6aaeebdaab93d594c005d366ce0d94fba02e7a07fd03557dbee8482f04a91c22.png',
starOn : 'star-on-fd26bf0ea0990cfd808f7540f958eed324b86fc609bf56ec2b3a5612cdfde5f5.png',
That fixed my issue and got the starts to show correctly on Heroku after I recompiled everything.

Create custom migration script for bootstrap data and for performing some SQL related operations in Grails

I am working on a Grails project. In this I need to do two things related Migration Scripts as follows :
I made a script for boot strap data and also having BootStrap.groovy for boot strap data. My Code of Both scripts is as follows :
BootStrape.groovy
Mine DatabaseInit.groovy Script
Now I want to implement(or move the code of) both of these scripts in my migration script. How to achieve that, please give me some hint.
I need to do some SQL operations for removing some duplicate values from database as follow
UPDATE DatabaseName.TableName1 SET ColumName = 2 WHERE ColumName IN (
SELECT ColumName FROM DatabaseName.TableName2 st WHERE st.ColumName = 'XYZ');
DELETE FROM DatabaseName.TableName2 WHERE ColumName NOT IN (2);
How to write migration script for achieving this task.
It is a advisable idea that you keep your bootstrap file tiny ...no too much code inside and that good approach to follow , yours.
So , what you need is try to create a new migration scrip file even if you didn't have a change in your DOMAIN . Since ,this will help you add your sql script and then later will not execute them at every start up if they are once successfully created.
TODO on grails command line :
grails dbm-create-changelog
grails prod dbm-generate-gorm-changelog --add changelog-1.0.whatevername.groovy
Then ,
add the sql script inside changelog-1.0.whatevername.groovy file as follow :
1.Using sql file like
//sqlFile( path: "${ path to SQL file relative to changelog.groovy }")
//Used in a changeset, it looks like this:
changeSet(author: "username", id: "1305821637932-1") { //id:is to be changed
sqlFile( path: "books.sql")
}
2.Using by writing the scrip inside
changeSet(author: "username", id: "1305821637932-2") { //id : is to be changed
addColumn(tableName: "book") {
column(name: "flammable", type: "BIT") {
constraints(nullable: "false")
}
}
SQL("UPDATE DatabaseName.TableName1 SET ColumName = 2 WHERE ColumName IN (
SELECT ColumName FROM DatabaseName.TableName2 st WHERE st.ColumName = 'XYZ'))";
SQL("DELETE FROM DatabaseName.TableName2 WHERE ColumName NOT IN (2)");
}
Happy coding!! please refer this and this

JSON: Providing Constant Values

Though I'm using iOS, I don't think that's relevant here.
I need to be able to use a constant in two of the values for JSON. Reason: We're using different servers for Development and Production, and can't have the development data mixed with production Data. At build time we'll provide values based on the environment settings (development / production).
Thus, how can I use a constant value for "rsids" and server" in the JSON below:
{
"version" : "1.0",
"analytics" : {
"rsids" : "//I would like to put a Constant Here",
"server" : "",
"charset" : "UTF-8",
"ssl" : false,
"offlineEnabled" : true,
"lifecycleTimeout" : 300,
"privacyDefault" : "optedin",
"poi" : []
},
"target" : {
"clientCode" : "",
"timeout" : 5
},
"audienceManager" : {
"server" : "//I would like to put a Constant Here"
}
}
I would like to be able to do something like this:
NSStirng const *kServerURL = #"www.google.com"
"audienceManager" : {
"server" : kServerUrl
}
UPDATE
There is no Dictionary. I'm using the iOS SDK by Adobe for Site Catalyst. They have a JSON file that I have to edit and provide RSID and Server values. The JSON that you see in the question is the entire file.
The SDK has a library file (.a) also. Here are the docs: http://microsite.omniture.com/t2/help/en_US/mobile/ios/index.html#ADBMobile_Class_and_Method_Reference
If you need to change the value of the constant at build time you should be using #if/#ifdef and friends to do so.
#ifdef DEBUG
NSString const *kServerURL = #"www.google.com"
#else
NSString const *kServerURL = #"www.bing.com"
#endif
You'll have to create multiple files then. You can't have a JSON file be dynamic.
When creating your files from code, you can use constants. At the top of your .m file before the #implementation portion, defined them on multiple lines. One for development, one for QA, and one for production. Comment out the two you don't want and leave the one you do want. When using it, use the format.
"server":[NSString stringWithFormat:#"\"%#\"",kServerUrl];
It is often a good idea to have a dummy login that can safely communicate with your servers. Such a login would have an example set of data to be read, and any uploads would be ignored. This is handy for testing between the different environments, including production, and allows any apps submitted to the App Store to be fully tested with a valid login.

Resources