can a pass in passbook have no bar code? - ios6

I want to display bar code but only a coupon in my pass.
Can it work?
such as remove this code in pass.json:
"barcode" : {
"message" : "All you need is love",
"format" : "PKBarcodeFormatPDF417",
"messageEncoding" : "iso-8859-1"
}

To remove barcode from Pasbook' Pass just remove the whole barcode section from the pass.json and rebuild the pass.

Related

How to display infinity symbol in AngularJS

I want to conditionally display a value or an infinity symbol in my Web Page.
I wanted to do something like this ..
<td class="rs-table-text" ng-if="batch.est_completion_time ">{{batch.est_completion_time}}</td>
That is if batch.est_completion_time is not empty then display whatever is coming from json.
And the json looks like :
{
"batch_queue_name": "Batch Five",
"start_date": "05/01/2017 12:18 A.M.",
"end_date": "08/01/2017 03:37 A.M.",
"est_completion_time":"∞",
"completion_status": "42"
}
But it does not display the infinity symbol. Rather , it displays the ∞ text only.
How to achieve the same ?
In your controller, prepare the data as following :
$scope.est_completion_time = $sce.trustAsHtml(batch.est_completion_time);
In your HTML, you can display it as it is. Don't forget to add ng-bind-html in the outer DOM element.
Adding only ng-bind-html can do the job :
ng-bind-html="batch.est_completion_time"

Angulars JS with the filter & ng-repeat

First please apologize myself if I make any typing error (I am french).
Well, I am trainning on Angular JS and I would like to use the filter on one specific field but my problem is that the filter is based on many fieds.
here is my filter:
<div class=main_frame ng-repeat="x in artiste | filter: recherche_artiste">
<h2>x.name </h2><img ng-src={{x.picture}} />
</div>
My problem is that I would like that the filter impact only the artist name and not all the fields of my array "artiste".
in my app.JS, $scope.artiste is an array[100] who contains objects like:
Array[100]
0
:
Object
$$hashKey
:
"object:14"
_id
:
"57252e30bbcf354d21c5fc19"
age
:
38
name
:
"Mccarty Buckner"
picture
:
"http://lorempixel.com/800/500"
proto
:
Object
1
:
Object
$$hashKey
:
"object:15"
_id
:
"57252e304cf25e47b014303e"
age
:
39
name
:
"Nguyen Kane"
picture
:
"http://lorempixel.com/600/400"
proto
:
Object
The problem is when I hit on filter "HTTP" or simply "p" for example, the filter doesn"t work because as you can see above, http is contained in all the the picture field.
Otherwise, the filter works good if I hit "y" for example as there is no "y" in the "picture" fields neither in the _id field.
So my question is, is there any solution to apply my filter only on the "name" field, but keeping the corresponding "picture" field dynamically?
Thanks in advance for your help.
I precise, I am using slowly angular only since a short time ago so I am not an expert:)
ng-repeat="x in artiste | filter: {name : recherche_artiste}"

add a connected user in the list of followers Angular

I have a facilitator defined like this:
{"_id" : "alyssa", "_class" : "entities.profil.FacilitatorEntity","type" : "facilitator","cwsessionsAnime" : [{"$ref" : "cwsession",$id" : "1L"}],
"profilFollowEntity":[{"$ref" : "profil","$id" : "sissa"},
{"$ref" : "profil","$id" : "milou"}]}
and when I click a follow button I will have the id of the user connected added to the profilFollowEntitiy list
I defined ng-click="follow()" and in the controller I declared the method
$scope.follow= function(){
$scope.selectedFac.profilFollowEntity.push({$ref: profil, $id:$scope.user.username});
}
and I have declared a service before profilService.getUser($scope); to get the username of the connected user that I will add to the profilFollowEntity list. The methode .follow() doesn't work, can any one help me please, How could I do that, and thank you in advance

Why I dont see array's element when I do db.collection.find()?

I've got a mongo model like this:
attributes:[String]
But when I do : db.ads.find({})
I've got this:
{ "_id" : ObjectId("5571fe998f6319ed03235522"), "attributes" : [ ], "__v" : 0 }
I don't see the elements in the array "attributes" even if actually the array contains this: ["Meublé","Wi-Fi","Salle de sport"]
I would like to be able to do a command like db.ads.find({}) and see the element inside the array
Thanks
Are you doing this in the terminal or your code?
If you are using the terminal:
Use----> db.ads.find()
OR---> db.ads.find().pretty()
to make it look good
Please try to execute in your console the following query:
db.ads.find({"attributes": { $not: { $size: 0 } } })
in order to find all documents that have non-empty "attributes" array.
In your case it looks like you might have many documents with this array empty and db.ads.find() returns a cursor which shows in your console only 20 elements in each iteration (by default), so in first iteration you may be seeing only those that have no values in "attributes".
Hope this will help a little.

MongoDB Index Array only partly working

I know there is already a lot on this subject out there, but none of the questions do help me going on.
I have a File-Upload-System via GridFS which generates documents like this:
{ "_id" : ObjectId( "4f3723607b5c0b8d01060000" ),
"filename" : "7326_150970547928_746052928_2521002_2164327_n.jpg",
"filetype" : "image/jpeg",
"title" : "Indexed File 1",
"author" : "chewbacca",
"document" : "Rechnungen",
"keywords" : { "0" : "Darth",
"1" : "Vader",
"2" : "Haut",
"5" : "Putz",
"6" : "Pushy" },
"uploadDate" : Date( 1329013600519 ),
"length" : 61423,
"chunkSize" : 262144,
"md5" : "c73cce0bb6f349007635751f9a1a7ddd" }
As you can see I have a field 'keywords' which is an array of keywords.
I want to build a search-option to search this field comparable to a fulltext search.
Therefor I indexed the field 'keywords' seperately.
db.fs.files.ensureIndex({ keywords : 1 })
Now the problem is, that this works sometimes. Or to say yesterday it worked on some files, but on some it won't find anything.
Assuming I did the Indexing like above, I would think that
> db.fs.files.find({keywords : "Vader"})
would give me the document printed above. Or am I missing something??
(My only explanation why this could be, is: it takes a lot of time to create indexes and it ain't ready yet, which is practically impossible right, or that there is some problem with the options 'background', 'dropDups', 'unique' etc...
I tried everything. I dropped the Indexes with;
> db.fs.files.dropIndexes()
And created them again. Always controlling via
> db.fs.files.getIndexes()
But no, I can't get any results...
I also tried to make the indexing via PHP just after I saved the file in the database.
For that I use the following code:
$gridFS->ensureIndex(array('keywords' => 1), array("unique" => true));
Or also without the unique option.
As I said sometimes this works and I can query the keywords, but sometimes I can't. Or some keywords are found, but those of other documents not.
Could it be that indexes ain't made for every document equally???
Please somebody help me on that, I really don't get the issue here!
Thanks already.
I suggest you to use a true array in the keywords:
"keywords" : ["Darth", "Vader", "Haut", "Putz", "Pushy"],
So, the following is expected to work:
db.fs.files.ensureIndex({ keywords : 1 })
db.fs.files.find({keywords : "Vader"})

Resources