Adding block feature using swift and parse server - swift

So I'm dealing with app rejection "Guideline 1.2 - Safety - User Generated Content" and one of the features app want me to implement is "- A mechanism for users to block abusive users" Im not sure exactly how to put the code into action but know what i have to do which is
Step 1. Create class in Parse for blocked users, like: "Blocked"
Step 2. Create columns of type [String]: blockedBy & username (user is blocked)
Step 3. Query only users if current user is not in blocked list
Step 4. Add button to send PFObject to block a User
If someone can help i can provide info from my project. It would be much appreciated because I've been struggling with this for weeks.

Check out https://www.raywenderlich.com/98831/parse-tutorial-getting-started-web-backends tutorial. Great help, shows how to setup the local environment, the MongoDB, how to create a class within the local parse environment ran from the terminal, shows how to query, etc. Let me know if you have more specific questions I can help resolve.

Related

User Not Found in Db2-mx

I'm currently enrolled in Relational Database Basics, IBM Course. On the lab assignment, one of the steps is to Go to UI in the services page. However, after following the correct steps and clicking on Go to UI, the following message appears:
HWCUSR0012E: User rsc83832 is not found, please ensure that the userId exists.
What am i doing wrong and how can i fix it?
Thanks.

Setting a value in Frappe application isn't reflected in ERPNext GUI

I have added a 'number_of_members' value to the Customer DocType via customization.
In my application I have tried several ways to update the value. However the value never updates in the webpage. I feel like I'm missing some sort of save or update or commit step.
For example I have tried:
frappe.client.set_value('Customer', '00042', 'number_of_members', 8887)
frappe.set_value('Customer', '00042', 'number_of_members', 8887)
frappe.db.set_value('Customer', '00042', 'number_of_members', 8887)
and also
customer = frappe.get_doc('Customer', '00042')
customer.number_of_members = 8887
customer.save()
In each case I can do something like frappe.get_value, or frappe.get_doc and it shows the value is set to 8887. However it never updates in the web side. This is what makes me think I'm updating some sort of cache or database transaction and I need some way to save it, but have not had any luck.
I am mostly testing this via bench console if that has any bearing on it, but I've tried a couple of the methods in my application code as well.
Relevant documentation:
Frappe Developer API - Document
Frappe Developer API - Database
Turns out the answer is to call frappe.db.commit() after making changes. If someone can point this out in the documentation so I can better understand how I'm missing stuff, I would appreciate it.
I also noticed if you try to Save something in the UI before you send frappe.db.commit() the UI will hang.

External access to Magento instances

I've started investigating alternatives to my project and a few questions came out that I couldn't answer by myself.
The problem is: I want to create a web page able to access multiple Magento instances installed in the same server. Currently, I have one Magento instance per client and this project will access several Magneto instances to export reports from each one (for example).
The alternatives I thought til this moment are:
Have another Magento instance, create a new module within it that changes its 'database target' before triggering operations/queries;
Questions until this moment:
Can I 'change the database target' of a Magento instance?
How can I access data from a Magento instance without appeal to SOAP/REST?
I want to re-use some components (grids, tabs, forms..) from Magento, that's why I'm not considering an independent project (Zend, for instance) that can access this code from another projects. Does it make sense?
Any other idea?
==Edited==
Thanks by the tips and sorry by my ignorance. The comments let me believe that I'm able to execute something like this:
// File myScript.php
require '/home/DOMAIN1/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN1
require '/home/DOMAIN2/app/Mage.php';
Mage::app('default');
// get some products from DOMAIN2
Is it right? Can I execute require twice (and override things from first require)?
==Edited2==
I'm still trying to connect to several Magento instances from a single third party file. Is there any tip? I'm facing several/different errors at this moment.
The only thing I know is that I can still rely on SOAP to get the information I need, but this will be expensive.
Thanks!
The easiest way would be to include Mage.php from each shop instance. You would need to use namespaces or some other trickery to be able to load more then one.
Or if that doesn't work - make your own API in a separate file to get what you want from one shop, and combine the results in the PHP-file that calls the API.
Here's a sample on how to use Magento functionality outside of Magento:
require 'app/Mage.php';
if (!Mage::isInstalled()) {
echo "Application is not installed yet, please complete install wizard first.";
exit;
}
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
// your custom code here, for example, get the product model..
$productModel = Mage::getModel('catalog/product');

How to lock on to a cloned form in Delphi?

I am writing a chat program that has a bunch of clients connect to it and populate themselfs to a listview, I want to be able to click on each individual client and open up a form that looks like a chat, but I want to be able to do it to multiple clients at the same time.
I have made Form2 (the chat window) clone itself for every instance, however I need to know how to lock on to the cloned form to make changes such as Form2.RichEdit.Lines.Add
However when I try to do this it does not work because I'm not locking on to the right form since it is cloned I am assuming it is no longer Form2
Any info on this would be highly appreciated.
Update
I am going to go ahead a reword what I am trying to do.
I will explain what im trying to do: I have a chat program (server) that is listening for clients to connect via Indy10 sockets When the client connects it populates the ListView with the user name and when I click on the user name (the server) opens privatemessageform where I can chat with the client.
I want to be able to have multiple clients connected and I want to be able to click on as many as I want and have it clone the privatemessageform and have 2 separate chat windows to 2 separate clients
The problem is: When trying to click on the seccond user the program gets confused and cannot lock on to that seccond user's privatemessageform (clone).
And if any more info is needed and I mean anything at all please do not hesitate to ask I will be on for several hours and constantly checking this thread.
I've been stuck on this for 3 days so I would really love to get this resolved and move forward with my project. Any information is highly appreciated. Thanks in advance!
Open Project Options and remove Form2 from auto-creation list. Do not use that variable any more.
Rename TForm2 to some meaningful name. Once you would have ~10 forms in your program you would forget what you meant by numbers 2, 5, 7 ...
ALWAYS give variables meaningful names, that includes components, that includes forms. Here i will name TForm2 a TPrivMessageForm
Use a special array of variables to keep several forms, not a single global variable. For example like that:
Type TChatUser = string;
// to begin with, user is a name. Then it may become URL, or GUID or something
// complex like `record` or `class` or whatever
Type TPMForms = TDictionary<TChatUser, TPrivMessageForm>;
PMForms := TPMForms.Create;
Creating new private message window after clicked on user:
if not PMForms.ContainsKey(ClickedUser)
then PMForms.Add(ClickedUser, TPrivMessageForm.Create(Application) );
PMForms[ClickedUser].ChatWith := ClickedUser; // variable in ex-TForm2 to tell several instances apart
When such form is closed - it should via its OnClose
Remove itself from PMForms list (so no dangling pointers would remain)
chose caRelease for closing actions (making VCL actually free the form object)
See Also
http://delphi.about.com/od/beginners/a/using-t-dictionary-hash-tables-in-delphi.htm
http://docwiki.embarcadero.com/CodeExamples/XE4/en/Generics_Collections_TDictionary_(Delphi)
PS. Edit your question please and add TAG with your specific Delphi version.
PPS. download ready-made FLOSS chat programs and just read and learn how they do it. Maybe instead of opening a free-floating (cluttering desktop) form you'd better open Tab in PageControl. "Use the Source, Luke"
https://sourceforge.net/p/dreamchat/wiki/Home/
https://sourceforge.net/p/achat/wiki/Home/
http://www.visualirc.net/features.php
For the latter to find the sources one has to type two words "Visual IRC" at www.google.com and get http://sourceforge.net/p/visualirc/mercurial/ci/default/tree/ - this crucial information i did omitted in fair belief that a person interested in finding sources would be able to do it on his own.
PPPS. Those is not "cloned": cloned are separated objects. What you talk is several instances of the same form class. Like you may have two or more labels on the form, you can have two or more forms in your application.

The remote name could not be resolved: 'graph.facebook.com'

I'm using the FaceBook C# SDK for the first time.
Since I have a simple application I want to create I have picked up the sample Azure MVC application and modified it to point at my facebook application instance and secret as per the configuraiton guidance.
I want to retrieve a months status messages so I need authorisation which has worked thanks to CanvasAuthorize(Perms = "user_about_me") attribute.
However now when I goto the about view I get an error in the controller first:
dynamic result = fbApp.Get("me");
The actual error is listed as:
The remote name could not be resolved: 'graph.facebook.com'
Can anyone help me identify what I am doing wrong?
Many thanks,
_David
That sounds like a temporary connectivity issue. The server (or your computer) is having trouble resolving http://graph.facebook.com. Try to going to http://graph.facebook.com/microsoft in your browser and see what happens.
Make sure that you have the correct fb_key and fb_secret values. In my case I have added them in the web config file but when I read the values I have given a wrong name to retrieve. client_id and client_secret values were not set. As a result this error popped out.