w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Check Message If read and unread
read message inbox: 1. Add new field in inbox message table named `is_read` type `int`. 2. And write a select query to select is_read and check whether it is 0 or 1. 3. If 'is_read' = 0 write a CSS style and if 'is_read' = 1 write a different CSS style for the font. 4. And you can fix your self 0 as unread and 1 as read. 5. Then write a update query for 'is_read' as 1 , When selecting the inbox message.

Categories : PHP

mark read unread messages (jsp pages)
I think it is nothing but changing the status in table for that message. When User does any read, delete operation, you can make an ajax call (So that things will go smooth and no waiting for server interactions for changing status) based on some parameter. At server side write one function which based on parameter, either change message status to modify/delete/unread/read in you table. JSP will simply read the status and act accordingly.

Categories : Jsp

Div selected - Unread Message - read messsage like facebook inbox
Here is a slightly different approach. You could use just jQuery events. the HTML <div id ='001' class='message unread'>Message 1</div> <div id ='002' class='message unread'>Message 2</div> <div id ='003' class='message unread'>Message 3</div> and the jQuery: $(document).ready(function(){ $(".message").click(function() { // we get the clicked element ID var id_msg = $(this).attr('id'); // we read the cookie, to remove the previous selected class to the last_read element var last_read = $.cookie('last_read'); $('#' + last_read).removeClass("inbx_selected"); // we set the cookie, so we keep can remove the selected class in the next click $.cookie('last_read', id_msg); //

Categories : Javascript

Find all unread emails using Exchange Web Service 2010 then mark as read?
There is not a good way to mark a MessageType as read using EWS v1. See this MSDN blog post for a workaround if you are stuck with EWS v1. EWS v2 introduced the IsRead property as writable (message.IsRead = true; message.Update();), which makes it trivial. You can use the EWS v2 managed API for Exchange 2007 and above, but it is a separate installation. See the MSDN page on EWS Managed API 2.0 for more.

Categories : C#

Fetch folder names and total read/unread in a single query
select f.name FolderName, count(m.id) TotalMessagesCount, sum(m.date_read < m.date) TotalUnreadMessagesCount from email_folders f left join email_messages m on f.id = m.id_folder group by f.id I really wonder why date_read < date means Unread for you. Having the date_read set to null makes more sense to me be considered as Unread.

Categories : PHP

notifications feature reducing similar activity by summing count
The following link mysql count duplicates solved the problem! SELECT name, food, COUNT(*) AS count FROM your_table_name GROUP BY name, food just do some changes to the variable name

Categories : PHP

How to set up the recipient id in public activity
tracked recipient: ->(controller, model) { model && model.user } assuming Tom is the user of tracked object. Otherwise change model.user as per your application

Categories : Ruby On Rails

How to add AsycnTask to a public class with no activity?
This is thrown when you execute a network operation in UI thread. This is illegal since HoneyComb. All you've to do is do the network operations in doInBackground method of AsyncTask. Also be sure that you've permissions for internet in manifest.

Categories : Android

TalkBack should not read the contentDescription only read Activity label
I can found the solution from following Link . Answered by Mr.Alanav Ice Cream Sandwich and above have an "Explore by touch" feature that allows users to simply touch the screen to hear feedback and does not require a directional controller.on below ics we need directional controller like di-pad or eyes free keyboard.

Categories : Android

android how to load a specific Activity to access public methods
If MainActivity is starting your current activity (TabActivity) you could use the startActivityForResult() / setResult() methods. Here is an explanation of the workflow taken from the docs: Sometimes you want to get a result back from an activity when it ends. For example, you may start an activity that lets the user pick a person in a list of contacts; when it ends, it returns the person that was selected. To do this, you call the startActivityForResult(Intent, int) version with a second integer parameter identifying the call. The result will come back through your onActivityResult(int, int, Intent) method. When an activity exits, it can call setResult(int) to return data back to its parent. It must always supply a result code, which can be the standard results RE

Categories : Android

How do I add x-amz-acl:public-read to an Amazon S3 Secure Url
Do you want all files in this bucket(or bucket prefix) to be publically readable? Instead of setting authorization in the request you can use a bucket policy: https://forums.aws.amazon.com/thread.jspa?messageID=185968#185968

Categories : Node Js

Read public posts from Blogger using API
For accessing a public feed it is way simpler than what you are doing. There are a bunch of classes built into the .Net framework for processing RSS feeds, you can start with SyndicationFeed. To get the feed items (blog posts) is quite simple: XDocument feed = XDocument.Load(rssUrl); //rssUrl is the URL to the rss page that (most) blogs publish SyndicationFeed sf = SyndicationFeed.Load(feed.CreateReader()); foreach (SyndicationItem si in sf.Items) { ..you've now got your feed item... } Note that this will give you the feed items but it won't give you the full web page that they appear in. (although you will get a URL for that).

Categories : C#

How to search for and read Xively public feeds
a4o, It sounds like you are getting the basics of it. You do need a Master API Key as opposed to a device specific one in order to use the global feed search function. I just tested and you are correct that a non "private access" key will return private feeds that you own. It won't let you do anything with the feed with that key, but it does return the info. I will bring this bug to the attention of the Xively developers so they can sort it out. To answer your question, as far as I can tell there is no way to get a device's read API key using a master key. The only time a key is returned is during the activation process for a device: https://xively.com/dev/docs/api/product_management/devices/activate_device/ Alternatively, you can list all of your feeds, but they will not return a feed

Categories : Misc

How to use openssl lib pem_read to read public/private key from a string
Try this: char* mKey="-----BEGIN RSA PRIVATE KEY----- MIICXAIBAAKBgQCDT4ntP3Fqj73RQW32B6hCDHMG64GtxeQDZ5BcQnQSRB3S/EwM gpZwuGYwTb7E65pdAAQ0e5na2d7yIGZX4MoDRGaDbYgdxr49J430cVLRU1r9EW+O qZQERyGYefxWOqBaNZL2PBclS/qf+AxRh1WnD8aY5V5zNItgVV4Bv9w4YQIDAQAB AoGAMd6xaXNg5bG1y5Vn57q8wmjr/sLOu2qe0FQy1Xc/kfhgw1Kip1WpQSInXU0J mMxKEewBrNUMd7urGpYHiHSNA+QXiIp3qxGy7PrmZrPSrJImPxAE02YaUGDoh+6o ZJc7xXCw2bwX8Fth8Duj2KNcIDuWuieybfzwTYKKJG3J04ECQQDxSa4gq/0SiiZ2 c8YTn9wCTwqezmdI8SWsWXRnpXt1BhejokvLFbqpfQZ6m9LLYvpUsihZ2QkBXUl/ 1/uNu+aJAkEAi1Ey/7fjJJSJalNUgF3lKQdTqUlYI/9O9/98zPOcDmXcKlLNpf+f TV3nhK3vsewYqsx3Tu9bMKBVTE0dv+/NGQJAHfYyQyhYMpcpE4hozkMJhNffz7x9 otcfAHnTNJOd8vggs1cR5lP6a9V0moEC+fJ+d0nwLMgAkETPParKN91fUQJAEWMB 3V4ir+cFu0pJCngtaFBsxXzMzjlHrrWo6p8gg798mZ+Z4LSlOe+VPD7E4kyXy4EX BrfihpAL9SjOpKyVyQJBAPD3E4Z7TH

Categories : C++

How to read any facebook user public timeline using iOS Social framework?
So my question is how to reach the feed of a "simple" user (for exemple "shireesh.asthana"), so that I can read it's "message"? The reason could be - The <user> has no public posts, The <user> has Turn off Platform in the App Settings (of-course, the <user> here is not the user in session) P.S. Shireesh Asthana (who works at Facebook), don't have any public posts

Categories : IOS

(Android) Read Public or Shared Spreadsheet, Google Docs
First, Documents List API is depricated. Use Drive API instead. You can achieve the same goal by Files.insert(). Second, use spreadsheets api to read spreadsheet. You can also use Spreadsheet service of Google Apps Script. You don't have to publish to the web if you use either one of these two.

Categories : Android

Read File in chunks and then read line by line using LineNumberReader. Repeat this activity
As far as I think, this error arises when the JVM fails to allocate more objects (String in your case) due to the lack of memory as your program has already occupied a lot of it. Please place a call System.gc() somewhere inside the loop and check whether it works.

Categories : Java

IBM Worklight 6.0 - "Error: Unable to read repository at http://public.dhe.ibm.com/ibmdl..."
See this topic: http://www.eclipse.org/forums/index.php/t/270718/ Try starting Eclipse with -vmargs -Djava.net.preferIPv4Stack=true.

Categories : Eclipse

How to write/read RSA public and private keys in a j2me CLDC application
I have used RecordStore (RMS) to store the keys. Three data types can be stored in Recordstore: String, byte and Int. However, the components of the RSA keys are BigInteger data types. Thus, i have obtained a "string" representation/equivalent of each of the key components as follows; //method for serializing the key components public void SerializeRSAKeyPair() { BigInteger mod = RSAprivKey.getModulus(); String mods = mod.toString();// converts to String representation BigInteger privExp = RSAprivKey.getExponent(); String privExps = privExp.toString(); // converts to String representation BigInteger pubExp = RSAprivKey.getPublicExponent(); String pubExps = pubExp.toString();//..same BigInteger dp = RSAprivKey.getDP(); String dps = dp.toString(); BigInteger dq = RSAprivKey.getDQ();

Categories : Java

Rails 4 - Toaster notifications rather than flash notifications
What I'd recommend is to make a new flash type for this sort of thing and then render that as JS in your layout. ApplicationController def toast(type, text) flash[:toastr] = { type => text } end app/views/layouts/<your layout>.html.erb # (or in a partial to be reused in various layouts) # the <script> tag isn't needed if code snippet is # included in an existing script block, of course. <% if flash[:toastr] %> <script type="text/javascript"> <% flash[:toastr].each do |type, message| %> toastr.<%= type %>(<%= message.inspect %>) <% end %> </script> <% end %> So this way you get all the standard behavior you're used to from the flash object and you get easy to understand javascript written in your views

Categories : Javascript

InjectView in an Activity read as a parameter
Inject it as a field of the class. You can't inject directly into a method body. public class myClass { @InjectView(R.id.myTextView) private TextView myTextView; public void myMethod(final Activity activity) { // Use here a TextView from that activity - how to inject it? myTextView.setText("something"); } }

Categories : Android

the current activity only read the nfc card detected
Use foreground mode. See my test app here.

Categories : Android

Get unread conversations gmail
With GmailContract.Labels.NUM_UNREAD_CONVERSATIONS.toString(); you're just converting the enum to string. You need a Cursor object to iterate through labels and then acquire the number with cursor.getInt(GmailContract.Labels.NUM_UNREAD_CONVERSATIONS) Check this code for iterating through accounts and labels.

Categories : Android

Pass data object to an Activity from another activity (Fragment -> its Activity-> new Activity)
I assume your ZEvent implements Parcelable... If it does, then put in in the intent using putExtra (instead of creating new Bundle and using putExtras), and extract the same way using getParcelableExtra. // Put final Intent intent = new Intent(context, <class>); intent.putExtra("MY_EVENT", obj); // <-- Should be parcelable // Get. ZEvent obj = intent.getParcelableExtra("MY_EVENT");

Categories : Java

using LINQ to Twitter to read public tweets, do i need to register my app at Twitter
Twitter recently shut down API v1.0 and everything now runs on API v1.1, including LINQ to Twitter. API v1.1 requires authentication on all endpoints. So, you will have to create an application and use OAuth. There are demos with the LINQ to Twitter Downloads and with the downloadable Source code. There is a Samples page for various technologies. You can also read the Documentation, which includes explanations of all APIs. I recently added a Twitter API Map so you can match Twitter API endpoints with LINQ to Twitter queries.

Categories : Twitter

Unread chat messages in mysql and php
SELECT author, count(author) as 'nr' FROM messages WHERE recipient='$_SESSION[id]' and viewed=0 GROUP BY author this will give you 2 columns each row: the first is the author id and the second (labeled 'nr', change it as you wish) the number of unread messages from that author. Please note: your code may be vulnerable to sql injection. Take extra care and possibly learn about prepared statements. PS: note that $_SESSION[id] raises a warning because id is an undefined constant, as it is now. remember to put quotes around it.

Categories : Mysql

How to retrieve only unread emails with ruby mail gem?
This question was answered in Need help on reading emails with "mail" gem in ruby However the answer was not accepted - don´t know why. Also the question did not mention "unread email" nor the [mail-gem] tag so it was not obvious to search. The answer points to the solution on the ruby-gem issues report https://github.com/mikel/mail/issues/258

Categories : Misc

How to display unread count to the android app icon?
Unfortunately, You can't do that on application icon. Android doesn't allow that. But you can do that using widget. There are many question related this, check it first. Question 1 Question 2 Question 3 Widget Example Widget Link Update : 24/04/2015 Now this is possible for some launcher app. Check this example1 and example2

Categories : Android

Is there any pattern that provide similarities of public static, private and public methods and vars in JS?
"Static" methods in JavaScript are usually achieved by simply assigning a function to a property of the constructor function object: function MyClass() {} // Constructor MyClass.staticMethod = function () {};

Categories : Javascript

Singleton object w/ Private/Public: Public function dependency problems
You can simply define the functions inside (or alongside) the constructor and just "attach" them to the new instance. This way the functions are free to refer to one another as required: function PKMNType_Engine(){ "use strict"; function getEffectiveness(defenseType, offenseType){ return 1; } return { PKMNTypes_getEffectivness: getEffectiveness, PKMNTypes_getMatchup: function(type1, type2, offensiveType){ var output = getEffectiveness(type1, offensiveType) * getEffectiveness(type2, offensiveType); return output; } }; }

Categories : Javascript

How to get the number of unread tweets of a user using twitter gem in rails app
Twitter API doesn't have such an option for user_timeline. But, since you have to store your last login time anyway, you can store the last tweet ID you read and then get all tweets with IDs higher than that. def twitter(username, last_tweet_id = nil) # this will display the latest 10 tweets if you # have never read the user's timeline before opts = last_tweet_id ? { :since_id => last_tweet_id } : { :count => 10 } Twitter.user_timeline(username, opts) end Then you can use the method this way: # will get all tweets newer than 365677293978398720 @twitter = twitter('pallavi_shastry', 365677293978398720) # will get 10 latest tweets @twitter = twitter('pallavi_shastry')

Categories : Ruby On Rails

python imaplib - mark email as unread or unseen
You can easily clear the Seen flags with this command: tag UID STORE -FLAGS (Seen) but your software will probably be more robost if you only set the Seen flag in the first place after you have successfully processed a message. That way, if anything goes wrong while you are processing a message (even if the connection to the IMAP server is broken) the flag remains unset and you can retry that message the next time the script runs. You do this by avoiding the IMAP server's automatic setting of the Seen flag by using BODY.PEEK instead of BODY. In Python, I think that STORE command should be issued like this but I haven't tried it. connection.uid('STORE', '-FLAGS', '(Seen)')

Categories : Python

Javascript; Server-less retrieving of unread emails with Gmail API
According to the official Gmail API doc there are two ways to access emails: using IMAP/SMTP calling https://mail.google.com/mail/feed/atom Browsers doesn't provide access to TCP to JavaScript and therefore IMAP/SMTP will not help here. After trying, the server behind https://mail.google.com/mail/feed/atom doesn't seem to support CORS. So no luck here neither. Apparently, a server is needed (or something like packaged apps that gives TCP access)

Categories : Javascript

Chrome extension - Background page and unread items
It looks like you never reset the unread items to "read" on the server, so every time you will ping the server, it will reply with the same number and will thus display that number again. So you can do a couple of things: when you click your button and reset the badge to 0, you can send a request to the server to mark all the items as read. Which request will of course depend on your server and what it accepts. That way, the unread count on the server will always be up to date and your extension can be very "stupid": whatever is returned by the server is the current number of unread items. if you can't do that, you'll have to save some information locally to your extension and figure out the unread count yourself. What I mean by that is that instead of just requesting the unread count y

Categories : Javascript

How mark gmail message as unread (unseen) MailSystem.NET
using library http://mailsystem.codeplex.com/ Source: http://mailsystem.codeplex.com/discussions/269058 add reference: activeup.net.common, activeup.net.imap4, activeup.net.mail code: Imap4Client imap = new Imap4Client(); imap.ConnectSsl("imap.gmail.com", 993); imap.Login("aaaaa@gmail.com", "xxxxxxx"); imap.Command("capability"); Mailbox inbox = imap.SelectMailbox("inbox"); int[] ids = inbox.Search("UNSEEN"); if (ids.Length > 0) { ActiveUp.Net.Mail.Message msg_first = inbox.Fetch.MessageObject(ids[0]); //ignore this gmail_data stuff // undefined in this scope // checking to make sure it's a "new" unread msg //if (gmail_data != msg_first.Date.ToString()) //{

Categories : C#

How to unread count message display in app icon in android
Unlike iOS, Android has no concept of icon badges where you can show unread counts and such stuff. If you really really want it, you'll have to implement a homescreen widget that looks like your launcher icon, and draw your badge over it manually. However, this is not recommended for Android, and having one random app do this may confuse the user.

Categories : Android

Get latest unread mail from specific folder using outlook
I managed to got it work by doing this way: Dim app As Microsoft.Office.Interop.Outlook.Application = Nothing Dim ns As Microsoft.Office.Interop.Outlook._NameSpace = Nothing Dim inboxFolder As Microsoft.Office.Interop.Outlook.MAPIFolder = Nothing Dim subFolder As Microsoft.Office.Interop.Outlook.MAPIFolder = Nothing Dim destinationDirectory As String = Directory.GetCurrentDirectory & "Output" If Not Directory.Exists(destinationDirectory) Then Directory.CreateDirectory(destinationDirectory) End If Try app = New Microsoft.Office.Interop.Outlook.Application() ns = app.GetNamespace("MAPI") ns.Logon(Nothing, Nothing, False, False) inboxFolder = ns.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox)

Categories : Vb.Net

Are "public" and "public final" redundant for interface methods?
You cannot have a final method declared in an interface. Fields are always final but methods are always abstract (and never final). You cannot define an interface method that is to be implemented only by classes in the same package.* From section 9.3 of the Java Language Specification: Every field declaration in the body of an interface is implicitly public, static, and final. It is permitted to redundantly specify any or all of these modifiers for such fields. and from section 9.4: Every method declaration in the body of an interface is implicitly public (§6.6). Every method declaration in the body of an interface is implicitly abstract, so its body is always represented by a semicolon, not a block. It is permitted, but discouraged as a matter of style, to redundantly

Categories : Java

Read contact using Intent.PICK activity doesnt work for dual sim in android
Android does not have support for dual-SIM devices at the SDK level. Various manufacturers have modified Android to support multiple SIM cards. You will need to contact your device manufacturer and inquire about how to obtain contact data from the second SIM.

Categories : Android

Django, display count of unread messages in base template
You can write a simple tag which can do this for you. def unread_messages(user): return user.messages_set.filter(read=False).count() #replace the messages_set with the appropriate related_name, and also the filter field. (I am assuming it to be "read") register.simple_tag(unread_messages) and in the base template: {% load <yourtemplatetagname> %} {% if request.user.is_authenticated %} {{ request.user|unread_messages }} {% endif %}

Categories : Django



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.