Posts

iphone - how to check key available or not in json response in ios -

after request server , recieve 2 different type of response if success response this [{"id":5,"is_default":0,"name":"dutch","language_id":3},{"id":4,"is_default":1,"name":"french","language_id":2}] other response type {"status":102,"response":"empty record list."} is way detect whether "status" key available or not in response in objc. thanks found solution //break result tag if([[responsestring jsonvalue] iskindofclass:[nsdictionary class]]){ nsdictionary *dict = [responsestring jsonfragmentvalue]; if([dict count]==2){ return; } //nothing load } the response dictionary, see if have key looking can use nsdictionary methods: // assume have created dictionary, jsonresponse, json // first, keys in response nsarray *responsekeys = [jsonresponse allkeys]; // see if array contains key looki...

excel - Function without return doesn't work -

i have macro calls function: function escreve_mapa(row integer, lastcolumn integer, equipamentos interger, abrangencia string, medias) dim cell range dim colunas range dim integer sheets("mapa de sinais (tabela)").select cells(row, "a").value = abrangencia cells(row, "b").value = equipamentos set cell = range("c" & row) set colunas = range(cell, cell.offset(0, lastcolumn - 3)) = 0 each cell in colunas if medias(i, 1) > 0 cell.value = round(medias(i, 0) / medias(i, 1), 2) end if = + 1 next cell end function but when gets function returns error user-defined type not defined any idea why? you've got typo in functions (although doesn't return sub) arguments. equipamentos interger should equipamentos integer

javascript - Jquery Text editor issue -

the following code of page want use jquery text editor (jqte). however, after trying nothing seems working. have included required files in same folder aspx page.the jquery reference included on masterpage. <%@ page title="" language="c#" masterpagefile="~/masterpage.master" autoeventwireup="true" codefile="articleview.aspx.cs" inherits="articles_articleview" %> <asp:content id="content1" contentplaceholderid="head" runat="server"> <link href="jquery-te-1.3.6.css" rel="stylesheet" type="text/css" /> <script src="jquery-te-1.3.6.min.js" type="text/javascript"></script> </asp:content> <asp:content id="content2" contentplaceholderid="contentplaceholder1" runat="server"> <div></div> <div> <textarea class="jqte-test" na...

PHP sessions getting unset -

i'm using session variable store login data. locally, works smooth, logs in nicely , doesn't log out inbetween pages. but when put same files on server, reason logged out. i've found this post, , tried using following code prevent caching of dynamic pages: header("cache-control: no-cache, must-revalidate"); header("expires: sat, 26 jul 1997 05:00:00 gmt"); // date in past though doesn't seem work. there other possible solutions problem? edit: note session_start() on every page. edit 2: did little further investigation , appears of links link www.mysite.com when on mysite.com . going new page makes $_session[] vars aren't set, , when returning previous page button can see $_session[] still set. sessions use cookies, when change domains (www.site.com site.com) cookies aren't being transmitted. set webserver have 1 canonical url, , redirect (for example, standardize on site.com, redirect www.site.com site.com). ...

listview - Android on Long Click is not working properly - custom list -

my custom listview not working properly. works fine till didnt scroll end, scroll end onclick feature stop working, m using custom list extending base adapter.. i have set click listener on toogle , it, have set focusable false in custom row. but thing noticed whenever list stop taking clicks, following error generated in logs. 05-18 17:54:02.674: w/keycharactermap(4343): can't open keycharmap file 05-18 17:54:02.674: w/keycharactermap(4343): error loading keycharmap file '/system/usr/keychars/cy8c-touchscreen.kcm.bin'. hw.keyboards.65537.devname='cy8c-touchscreen' 05-18 17:54:02.674: i/keycharactermap(4343): using default keymap: /system/usr/keychars/qwerty.kcm.bin list view <listview android:id="@+id/main_list" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margintop="3dp" android:cachecolorhint="#00000000" android:clickable=...

logging - Python logger not respecting setLevel? -

i've spent bit of time looking through site @ python logger questions hoping resolved there. i've set logger 2 stream handlers have both different formats , levels of logging, here's functional snippet codebase: import os import time import logging log_levels = [logging.error, logging.warning, logging.info, logging.debug] test_result_levelv_num = 51 # http://stackoverflow.com/a/11784984/196832 def status(self, message, *args, **kws): self._log(test_result_levelv_num, message, args, **kws) logging.addlevelname(test_result_levelv_num, "result") logging.logger.result = status def setup_logging(level=0, quiet=false, logdir=none): logger = logging.getlogger('juju-test') ffmt = logging.formatter('%(asctime)s %(name)s %(levelname)-8s: %(message)s') cfmt = logging.formatter('%(name)s %(levelname)s: %(message)s') #logger.setlevel(0) if level >= len(log_levels): level = len(log_levels) - 1 if logdir...

plugins - How to dynamically hide/remove some menus from navigation? -

i'm working on wordpress plugin inserts pages using wp_insert_post() on activation. these pages used different purposes (user account dashboard, edit account info, change password, login, logout, etc...). issue these pages menus displayed frontend users not correct because non logged-in user example should not see logout menu or menu private page until authenticated. now, i'm stucked @ how that. idea ? i stress plugin login process seperated wp login wordpress can not assign restrictions , roles specific pages, posts or terms default. you create two separated menues , add custom logic template. if(is_user_logged_in()) { wp_nav_menu('foo'); } else { wp_nav_menu('bar'); }