Posts

Showing posts from February, 2014

json - How to get solr autocomplete single keywords from description(text all) field? -

if type (single word) in text box : ind then retrieves words starting ind in below description text: description : on other hand, denounce righteous indignation , dislike men beguiled , demoralized charms of indiana of moment, blinded desire, cannot foresee pain , trouble bound ensue; , equal blame belongs fail in duty through weakness of will, same saying through shrinking toil , pain. these cases indulgence simple , easy distinguish. in free hour then return above description text found "ind" contains words in above: indignation , indiana , indulgence . these words retrieved autosuggest in text box. i tried lots of examples , schema.xml customization failed.

openerp 7 - How to add appointment_date + 3 months filter in opnerp -

i wana add filter in employee on 3 months employees.what should do? coding that. =', ((context_today()-relativedelta(months=3)).strftime('%%y-%%m-%%d')))]" help="3 months" /> but coding no work.somebody me.

Quickblox android API for chat messaging free or not? -

i have used git hub code sample .it work want develop application using api confused api free or not.if not type of payment plan have. have visit quickblox website's plan section don't understand plan quickblox offers starter tier can use absolutely free. need register free quickblox account , add app there. each tier has particular server configuration. e.g. free tier can have 20/s chat messages, 1000 concurrent users, 20/s notifications etc (check details ). if feel free tier not enough you, can upgrade bigger plan time. besides if looking quality , support should pay attention pro , enterprise plans.

java - split() function for '$' not working -

this question has answer here: how split string in java 29 answers what special characters must escaped in regular expressions? 8 answers i'm doing simple code string splitstring = "122$23$56$rt"; for(int i=0;i<splitstring.split("$").length;i++){ system.out.println("i got :: "+splitstring.split("$")[i]); } when split splitstring.split("$") it giving me output [122$23$56$rt] why not splinting on '$'? string.split() takes in regex argument , $ metacharacter in java regex api . therefore, need escape it: string splitstring = "122$23$56$rt"; for(int i=0;i<splitstring.split("\\$").length;i++){ system.out.println("i got :: "+splitstring.split("\\$"

sql - Using Where on association's attributes condition -

i have user model has languages attribute array (postgres) a user has_many :documents , document belongs_to :user i want find document written users knows english , french @langs = ["english", "french"] document.joins(:user).where(user.languages & @langs != nil ) this doesn't work. what correct way this? schema languages t.string "languages", default: [], array: true try this: document.joins(:user).where("user.languages @> array[?]::varchar[]", @langs) this should work tried on models similar structure.

Rails 4 and devise - current_password cannot be blank -

i'm using devise user log in , trying fix strong parameter issue. found solution , followed , tried solving problem. below code in application controller. class applicationcontroller < actioncontroller::base # prevent csrf attacks raising exception. # apis, may want use :null_session instead. protect_from_forgery with: :exception before_filter :configure_permitted_parameters, if: :devise_controller? protected def configure_permitted_parameters devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :password, :first_name, :last_name, :user_name) } devise_parameter_sanitizer.for(:account_update) {|u| u.permit(:email, :password, :first_name, :last_name, :user_name, :current_paswword) } end end this code enables me create user user_name, first_name , last_name. however, when try edit account, keep getting problem when entering updating account. keeps stating current password cannot blank though have entered password field. can me out? in ad

c# - Error when the proxy code class is added to the project -

i have project created in framework 3.5 , proxy class created using wsdl.exe. i trying change framework 4.0 of service class in framework 3.5 , use same , created proxy class using wsdl. i tried extend proxy class , getting error saying " the type of namespace xxx not found ". the technology used asmx earlier. project uses service first in .net 3.5 changed .net 4.0. have referenced same dll "service.dll" framework 4.0 , using microsoft.web.services3 . summary: trying change framework of both projects(service , myapplication) , integrate proxy class generated wsdl.exe. how can resolve issue? i using .net c# 4.0. i created new project framework 4.0 same name , integrated proxy class.

asp.net mvc 3 - Get file name from path -

Image
how can split path file name 1_lighthouse_20140306143834816.jpg ? , split 1_lighthouse_20140306143834816.jpg 1 reference number 1 exist. use path.getfilename if(countuser.length > 0) { var file = path.getfilename(countuser[0]); .... and first character resulting string using string indexer char firstchar = file[0]; if(firstchar == '1') ..... }

xcode4 - viewController not changing to LandScape mode in ipad -

Image
i developing ipad related app.login screen not change landscape mode,i change xib , used shouldautorotatetointerfaceorientation didn't work out .can u mistakes there.i want app landscape.

parsing - check proxy and get timout with ruby-on-rails -

i have ruby on rails 4. how can check proxy , information abot proxy (timeout , etc.), if work? i parse page nokoriri through proxy. page = nokogiri::html(open("http://bagche.ru/home/radio_streem/", :proxy => "http://213.135.96.35:3129", :read_timeout=>10)) gem install curb require 'net/http' require 'net/ping' require 'curb' def proxy_check @proxies = proxy.all url = "ya.ru" @proxies.each |p| proxy = net::ping::tcp.new(p.proxy_address, p.proxy_port.to_i) if proxy.ping? @resp = curl::easy.new(url) { |easy| easy.proxy_url = p.proxy_address easy.proxy_port=p.proxy_port.to_i # easy.timeout=90 # easy.connect_timeout=30 easy.follow_location = true easy.proxy_tunnel = true } begin @resp.perform @resp.response_code rescue puts "curl_get -e- fail "+p.proxy_add

VB.NET Event addressof -

i set callback raised in class different class: public class camerawindow inherits system.windows.forms.control private m_camera camera = nothing ' camera property <browsable(false)> _ public property camera() camera return m_camera end set(value camera) ' lock monitor.enter(me) ' detach event if m_camera isnot nothing m_camera.newframe -= new eventhandler(addressof camera_newframe) timer.[stop]() end if m_camera = value needsizeupdate = true firstframe = true flash = 0 ' atach event if m_camera isnot nothing m_camera.newframe += new eventhandler(addressof camera_newframe) timer.start() end if

java - Have complication with ArrayList of ArrayList -

i implementing algorithm,for need use arraylist of arraylist .i want retrieve each arraylist main arraylist . eg: if main arraylist contains 5 arraylist , each arraylist in main list contains 5 rows. mainarraylist : [1,2,3,4,5,a , 2,3,4,5,3,b , 7,8,9,4,5,d] //1st arraylist [1,2,3,4,5,e , 2,3,4,5,3,n , 7,8,9,4,5,e] //11nd arraylist [1,2,3,4,5,f , 2,3,4,5,3,t , 7,8,9,4,5,q] //111rd arraylist [1,2,3,4,5,c , 2,3,4,5,3,b , 7,8,9,4,5,a] //1vth arraylist [1,2,3,4,5,r , 2,3,4,5,3,m , 7,8,9,4,5,z] //v th arraylist i need access each arraylist main list , print it's content row row i.e example print 1st arraylist main list. 1,2,3,4,5,a 2,3,4,5,3,b 7,8,9,4,5,d similarly need print arraylist in main list same above. you can using arraylist list<list<object>> twodimarray = new arraylist<arraylist<>>(); twodimarray.add(arrays.aslist("1","2","3"); for(list<object> list: twodimarray){

how to get last modified column name from mysql -

is possible particular updated column name record? if so, please me. since creating history table store updated column , values rest of tables. drop trigger if exists testing.hisupdate; create trigger testing.hisupdate after update on testing.emp each row insert testing.history (`id`,`revision_id`,`trx_code`, `trx_method`, `column_name`, `old_value`, `new_value`, `trx_timestamp`, `user_id`) select (select emp_id testing.emp order last_update desc limit 1), (select p.revision_id testing.history p p.id= (select emp_id testing.emp order last_update desc limit 1) order trx_timestamp desc limit 1) + 1, 'updt', 'update','null', (select p.new_value testing.history p p.id= (select emp_id testing.emp order last_update desc limit 1) order trx_timestamp desc limit 1), concat(p.emp_id,"/",p.emp_name,"/",p.salary,"/") new_value,

phpmyadmin - How to drop all tables with prefix bak_ -

would find , drop tables given prefix? drop table if exists 'bak_' there other tables "mmp_hdkji" not want drop. since you're using phpmyadmin, if peter's answer isn't liking, can shift-click select many tables @ once. from database structure page, can click checkbox in front of each table want. if, in case, there number ordered 1 after other, click top 1 shift-click bottom one. ones in between selected. once have tables selected, click "with selected:" dropdown , go "drop".

objective c - Cannot install cocoapods 0.29 -

i install cocoapods 0.29, , after attempting run pod setup, claims must install 0.29. can please explain me?? successfully installed cocoapods-0.29.0 parsing documentation cocoapods-0.29.0 1 gem installed bash-3.2$ pod setup setting cocoapods master repo up-to-date. [!] `master` repo requires cocoapods 0.29.0 - update cocoapods, or checkout appropriate tag in repo. update: after updating cocoapods, able run pod setup, still getting error 0.29 not being installed: (and also, when running pod --version, says i'm on 0.22.3???) bash-3.2$ sudo gem update cocoapods updating installed gems nothing update bash-3.2$ sudo pod setup setting cocoapods master repo up-to-date. setup completed (read-only access) bash-3.2$ pod install setting cocoapods master repo up-to-date. [!] `master` repo requires cocoapods 0.29.0 - update cocoapods, or checkout appropriate tag in repo. /users/me/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide/command.rb:210:in `rescue in run': unde

user interface - How can I program a calculator with a GUI using tkinter in Python? -

i'm taking computing gcse , 1 of tasks our controlled assessment create calculator gui. i'm able program simple calculator without gui don't understand how can done gui. below code got teampython.wordpress.com, vaguely understand helpful if explain each individual step me. # calc.py - python calculator tkinter import * class calc(): def __init__(self): self.total = 0 self.current = "" self.new_num = true self.op_pending = false self.op = "" self.eq = false def num_press(self, num): self.eq = false temp = text_box.get() temp2 = str(num) if self.new_num: self.current = temp2 self.new_num = false else: if temp2 == '.': if temp2 in temp: return self.current = temp + temp2 self.display(self.current) def calc_total(self): self.eq = t

javascript - a utility to extract js for jsfiddle -

i have page . if save html , js code in tags but when put code in script tags in js part of jsfiddle.com, won't load. code : <html> <head> <script> var selele=0; var brindex=0; function addselectbox () { selele=selele+1; var spantag = document.createelement ("span"); spantag.setattribute("id",selele); var parentdiv = document.getelementbyid ("main"); var selectelement = document.createelement ("select"); var selectelement1 = document.createelement ("select"); var selectelement2= document.createelement ("select"); var selectelement3 = document.createelement ("select"); var arr=new array("stocks","mutualfunds"); var arr2=new array("individual","401k","ira"); var arr3=new array("contains","equals"); var arr

android - i am getting null pointer exception when i am trying to download image... -

i want download image internet ...but getting null pointer exception want know major difference bw url connection , http connection if there pls tell tell me solution here code thank u public class detailsactivity extends activity { private textview textview1; private textview textview2; private textview textview3; private textview textview4; private textview textview5; //private imageview image; imageview image; static bitmap bm; progressdialog pd; string imageurl = "http://theopentutorials.com/totwp331/wp-content/uploads/totlogo.png"; bitmapfactory.options bmoptions; public class imagedownload extends asynctask<string, void, string> { protected string doinbackground(string... params) { // todo auto-generated method stub bmoptions = new bitmapfactory.options(); bmoptions.insamplesize = 1; loadbitmap(imageurl, bmoptions); return imageurl; } protected void onpostexecute(string imageurl) {

java - What can I use for user to input time and Converting a value from an EditText to an Integer -

1) want time value user ,time in amount of time in hours, minutes , seconds, without using edittext field. want use timepicker without , pm stuff. minutes , seconds. know can use? 2) want convert value edittext field integer use later in code ie perform operation multiplication. , tried parse , doesn't work. instead shows error. , i've seen code parsing long , figure similar operation. here's code : mins=(edittext)findviewbyid(r.id.edittext2); secs=(edittext)findviewbyid(r.id.edittext3); timehours = int.parseint(hours.gettext().tostring()); try this timehours = integer.parseint(hours.gettext().tostring()); instead of timehours = int.parseint(hours.gettext().tostring());

iphone - in-app purchase to use any feature of application -

is possible put in-app purchase before user use feature of application ? means user can allow use application after doing in-app purchase only. this explicitly forbidden apple , app rejected. if want so, make paid app.

c++ - Visual Studio 2013 linker confusion -

i following errors when compiling(running build in vs) latest project. have read other questions/answers here on site, far no luck fix issues. i know problems related linking different libraries, why problems don't know. the compiling has been working ok before, no can't rid of errors. any fine. here error list , configuration file >1>msvcprt.lib(msvcp100.dll) : error lnk2005: "void __cdecl std::_xlength_error(char const *)" (?_xlength_error@std@@yaxpbd@z) defined in libcpmt.lib(xthrow.obj) 1>msvcrt.lib(msvcr100.dll) : error lnk2005: "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@qae@abqbd@z) defined in libcmt.lib(stdexcpt.obj) 1>msvcrt.lib(msvcr100.dll) : error lnk2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception@std@@uae@xz) defined in libcmt.lib(stdexcpt.obj) 1>msvcrt.lib(msvcr100.dll) : error lnk2005: __vsnprintf_s defined in libcmt.lib(vsn

javascript - How do I create a named function expressions in CoffeeScript? -

how create named function expressions in coffeescript examples below? var = function b (param1) {} or return function link (scope) {} coffeescript doesn't support latter (named functions), former can achieved a = (param1) -> console.log param1

javascript - Click back button on browser shows raw script -

there ajax calls in page. have done used history api update history. in page /test make ajax request updates history , url set /test?query=true. on pop state ajax call made according current url. // called in click event ajax call create history. var stateobj = { query: 'query' }; history.pushstate(stateobj, null, ?query=true); // called on popstate window.onpopstate = function(event) { $.ajax({ method: 'get', url: window.location.href, datatype: 'script' }); } now when have state pused , url updated /test?query=true go other page /test2 , click browser button browser shows me raw js code js.erb file.

Total IIS server giving Internal server 500 error -

Image
i have iis server 7.5 . it's run fine yesterday. services/sites not working. total sites in server giving common error as internal server error : 500 this issue websites hosted on server. could show me route solve issue ? thank you.

Higher-order mixins in Sass -

it well-known sass supports higher-order functions, possible have higher-order mixins? this: @mixin foo($color) color: $color @mixin bar($mixin, $background-color) background-color: $background-color @include $mixin(complement($background-color)) @include bar(foo, white)

javascript - how to loop through anchor tags in a variable using Jquery -

i have js variable var content = "<p><a href="http://www.wikipedia.org">wiki</a></p>"; i need add class anchor tag. is possible in jquery ? you can use: $(content).find('a').addclass('myclass');

image - How we decide the region of computing SIFT Descriptor? -

a keypoint descriptor created first computing gradient magnitude , orientation @ each image sample point in region around keypoint location. confused meaning of "region". size of it? depends on keypoint's magnitude ? or kernel size of gaussian in scale level keypoint found ? or else ? it depends on "kernel size of gaussian in scale level" - in sense "what region original image take". depends on sift parameter - patchsize (usually=41) size window in pixels reproject region original image.

Android: Converting a set of functions into an equation -

i 99% sure cannot done, thought ask certain. i attempting create application calculates required dice roll action in popular tabletop war game. the following calculation in java int x = ((wsattacker * 2) - wsdefender); int y = (wsattacker - wsdefender); string result; // calculation +5 if (x <= -1) { result = "5+"; } // calculation +4 else if (x >= 0 && y <= 0) { result = "4+"; } // calculation +3 else if (y > 0) { result = "3+"; } else { result = "error"; } return result; now issue avoid copywriter infringement cannot mention name of game in application, , cannot hard code above calculation in app. this means difficult tell potential user app do. the solution can think of make application generic , allow user input calculation required in form

php - PDO with sqlite wont insert anything -

i have problem pdo (i new this). code not able insert table. i've tried every possible way came insert variables code (array, straight statement, , without inserting id null, etc.). $db = new pdo('sqlite:hpoi.sqlite'); $qry = $db->prepare('insert tbl_hpoifinds (user, hpoiid) values (?, ?)'); $qry->execute(array(null, $invoker, $id)); after this, table stays empty... when try use: $db->setattribute(pdo::attr_errmode, pdo::errmode_exception); i error: fatal error: uncaught exception 'pdoexception' message 'sqlstate[hy000]: general error: 10 disk i/o error' in /disk2/www/milerking.cz/dixi/projects/hpoi_plugin/hpoi.lib.php:39 stack trace: #0 /disk2/www/milerking.cz/dixi/projects/hpoi_plugin/hpoi.lib.php(39): pdostatement->execute(array) #1 /disk2/www/milerking.cz/dixi/projects/hpoi_plugin/hpoi.lib.php(23): hpoiright('dixxcz', 'riverofslime') #2 /disk2/www/milerking.cz/dixi/projects/hpoi_plugin/hpoi.lib.php(11): h

c# - Open radlistpicker popup programmatically -

i want open radlistpicker fullscreen popup when tap image in tap event, possible? if search using exact title used write post, find first link: http://www.telerik.com/forums/opening-a-listpicker-programatically .

php - Restrict user and guest actions for sending messages -

i building site (with cakephp) users able send sms messages. registered users have more rights guests. lets guests allowed send 5 messages every 24 hours while registered can send 20. how restrict them? so, guests, need identify them, should ip address, session, cookie.. maybe mix of all? store guest information in database, file or what? if store them in database, need truncate table every 24 hours...? as registered users, same thing applies. should track message counter in db, session, file... easiest way?

jsf 2.2 - No navigation/refresh after submitting a form -

here simple jsf page: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core"> <h:head> <title>facelet title</title> </h:head> <h:body> <h:form enctype="multipart/form-data"> hello<br/> <h:outputtext value="#{backingbean.currenttime}" /> <br/> <h:outputtext id="contatoreid" value="#{backingbean.counter}" /> <br/> <h:commandbutton value="add" action="#{backingbean.add}"> <f:ajax render="contatoreid"/> </h:commandbutton> <br/> <hr/> <h:commandbutton value="reset counter" action="#{backingbean.resetcounter}" /> </h:form> </h:body> </html> the

Reducing Size / Compressing JSON String in C++ -

is there way compress json string in c++ , overall size can reduced ? in case mobile app retreives xml create ccuserdefault, converts xml json using rapidjson. want reduce size or compress using cpp library. assuming want minimise size of string (as opposed general compression such gzip), library such rapidjson used. there's example in this unit test : roughly: stringstream s("{ \"hello\" : \"world\" "); stringbuffer buffer; writer<stringbuffer> writer(buffer); reader reader; reader.parse<0>(s, writer); expect_streq("{\"hello\":\"world\"}", buffer.getstring());

django: got an unexpected keyword argument while accessing ForeignKey _id-Field in Manager -

i have model looks this: class mentorship (models.model): mentor = models.foreignkey(settings.auth_user_model, related_name='mentor_user_id') mentee = models.foreignkey(settings.auth_user_model, related_name='mentee_user_id') objects = mentorshipmanager() def clean(self): print(self.mentor_id) # set , printed stdout print(self.mentee_id) # set , printed stdout if mentorship.objects.is_mentor(self.mentor_id, self.mentee_id): raise validationerror(_('this user mentor.')) the manager has function check if mentor of user, called while clean() ing instance: def is_mentor_for_goal(self, mentor_id, mentee_id, personal_goal_id): if self.exists(mentor_id=mentor_id, mentee_id=mentee_id): return true else: return false however exception while accessing mentor_id or mentee_id attribute in exists: django version: 1.6.1 exception type: typeerror exception value: exists(

ios - SKScene did not draw Scene after presenting a Picker/Browser -

i have viewcontroller in present skscene. before present skscene use uiimagepickercontroller in viewcontroller take picture , in -imagepickercontroller:didfinishpickingmediawithinfo: when uiimagepickercontroller dismiss start present scene , initialize : [self dismissviewcontrolleranimated:no completion:nil]; skview * skview = (skview *)self.view; skview.showsfps = no; skview.showsnodecount = no; // create , configure scene. multiplayerscene * scene = [[multiplayerscene alloc]initwithsize:self.view.frame.size andpicture:self.imageview]; scene.scalemode = skscenescalemodeaspectfill; // present scene. // --this works on simulator , not on physical device [scene setbackgroundcolor:[uicolor redcolor]]; // -- [skview presentscene:scene]; so, happened in simulator seems work image showing on screen,, on physical device picker dismiss , see gray background. i have tried 2 days fix think problem skscene isn't first responder or n

svn - Teamcity doesn't create label when built from branch -

i'm trying create flexible teamcity build configuration project. first, create svn vcs root from: svn://mycompany.com/myproject this repository contains of these folders: /trunk /versions/1.1 /tags/... then, configure checkout rules as: +: %checkoutrule% => . this means agent checkout sources parameter, defined user triggers build. %checkoutrules% can has value of "trunk" build trunk or "versions/1.1" build version 1.1 branch. at last, configure labeling %checkoutrule% => tags, means, every build should create tag. so, problem when trigger build "trunk", tag created, when trigger build version/1.1, tag not created. build version/1.1 has additional label: branch: versions/2.1:: versions/2.1 need help, how can avoid these problem? simple issue. update version 8.1. important updates me: * can configure branches label. default is +:<default> i changed to +:* and branch build

android - MSISDN Detection Mobility - -

i need msisdn number of device(blackberry ) on app running. know can done using wap. wanted know there common webservice using can msisdn number. or need create one. there way using can msisdn number. referred link - msisdn : sim card data? why provided function (from blackberry , android) fetch msisdn not reliable? there no standard way msisdn , depends on mobile operators. while 1 operator provide msisdn via http header authorized ip , domain, 1 provide msisdn via it's own web service. there may ways msisdn, don't think there common web service. nevertheless, can try msisdn via following http headers. x-msisdn x_msisdn http_msisdn http_x_msisdn http_x_fh_msisdn http_x_up_calling_line_id

c++ - Cannot get Sailfish contacts with QContactManager -

i try jolla's (sailfishos) phonebook contacts qcontactmanager. qcontactmanager *manager = new qcontactmanager(); qlist<qcontact> results = manager->contacts(); results list contains 0 contact. i check if there error: qcontactmanager::error error; qcontactmanager's error code noerror . then check available managers. manager->availablemanagers() org.nemomobile.contacts.sqlite invalid memory qcontactmanager *manager = new qcontactmanager(); qcontactmanager *manager = new qcontactmanager("org.nemomobile.contacts.sqlite"); in both case: manager no error, manager->managername() result invalid . on other hand, if create manager as: qcontactmanager *manager = new qcontactmanager("memory"); ... can use memory based qcontactmanager (for example save , contacts) normally.

Excel vba to check if a workbook has opened -

is there way check if excel file opened or not? if opened, how can close it? thanks in advance if workbook name not include period character, can simple as: sub testforopen() dim wb workbook, st string st = "phone" each wb in workbooks stwb = split(wb.name, ".")(0) if st = stwb wb.activate activeworkbook.close exit sub end if next wb end sub this 1 looks open workbook named phone.xls or phone.xlsx or .................. if found workbook closed.

In C++, OpenGL, Glut, how to bind image.c to a texture, where image.c comes from Gimp>Export>C source code -

so i've spent past 2 days looking through different kinds of 'solutions' question via google, there aren't many , ones i've find don't seem work. i'm exporting small test image .c resource file gimp, it's size 64x64 , has alpha channel. looks like: static const struct { unsigned int width; unsigned int height; unsigned int bytes_per_pixel; /* 2:rgb16, 3:rgb, 4:rgba */ char *comment; unsigned char pixel_data[64 * 64 * 4 + 1]; } ship = { 64, 64, 4, (char*) 0, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\237\237\237\377\237\237\237\377\237\237\237\377\237\237" "\237\377\237\237\237\377\237\237\237\377\237\237\237\377vzi\0vzi\0vz

xmpp:xep-0077 for iOS gives me errors -

i found in link below xep-0077 , added in xmpp-ios project. https://github.com/buddycloud/buddycloud-ios-client/tree/master/src/external_libs/xmpp/extensions/xep-0077 unfortunately many errors. i use xmpp framework robbiehanson ( https://github.com/robbiehanson/xmppframework ) , trying register new user within chat app. do have use xep-0077 (band-in registration), or there other ways register? thanks chris

php - Changing a field from a table depending on a mysql query -

the prototype software creating uses mvc framework. i trying change allowed field in entrylog table either "y" (yes) or "n" (no) depending on whether card associated driver authorised or not. the 4 tables involved card , driver , state , entrylog table. there card_driver table associates card driver. create table if not exists `card` ( `id` int(11) not null auto_increment, `startdate` date not null, `enddate` date not null, `state_id` int(11) not null, `referred_as` varchar(40) not null, primary key (`id`) ); create table if not exists `driver` ( `id` int(11) not null auto_increment, `title` varchar(40) default null, `supplier_id` int(11) not null, `referred_as` varchar(40) not null, primary key (`id`) ); create table if not exists `card_driver` ( `card_id` int(11) not null, `driver_id` int(11) not null ); cr

r - Merging two data frames with different sizes and missing values -

i'm having problem merging 2 data frames in r. the first 1 consists of 103731 obs of 6 variables. variable have use merge has 77111 unique values , rest na s value of 0. second 1 contains frequency of variables plus frequency of na s frame of 77112 obs 2 variables. the resulting frame need first 1 joined frequency merging variable, df of 103731 obs frequency each value of merging variable (so duplicates if freq > 1 , each na (or 0)). can me? the result i'm getting contains data frame of 1 894 919 obs , used: tot = merge(df1, df2, = "mergingvar", all= f, sort = f); also played lot ' all= ' , none of variations gave right df. why don't take frequency table of first table? a <- data.frame(a = c(na, na, 2,2,3,3,3)) data.frame(table(a, usena = 'ifany')) freq 1 2 2 2 3 3 3 <na> 2 or mutate plyr ddply(a, .(a), mutate, freq = length(a)) freq 1 2 2 2 2 2 3 3 3 4 3 3 5 3

android - CCLayer setTouchPriority has no effect -

i created layer, has sole purpose block ("swallow") touches, , feature can turned on , off. class basic, if receives touch swallows it: bool blockinglayer::init(){ // super init. if ( !cclayer::init() ) { return false; } settouchenabled(true); settouchmode(kcctouchesonebyone); settouchpriority(int_max); return true; } bool blockinglayer::cctouchbegan(cctouch *ptouch, ccevent *pevent) { cclog("blockinglayer swallowed touch!"); return true; } so default has bad priority, receives touches if no other class claimed it. in scene using layer set different priority when events occur: bool myscene::init(int unitnumber, ccstring* path){ // super init. ... _blockinglayer = blockinglayer::create(); this->addchild(_blockinglayer); return true; } bool myscene::cctouchbegan(cctouch *ptouch, ccevent *pevent){ _blockinglayer->settouchpriority(int_min); ... } now layer should have

windows - Script Powershell to list installed updates -

i'm new here, looking script me list windows updates , put them on excel, have lot of code works set apart display of dates, can help? here code: $system=get-wmiobject -class win32_operatingsystem -computer . $system=$system.csname $excel = new-object -com excel.application $excel.visible = $true $excel = $excel.workbooks.add() $updatesearcher = new-object -com "microsoft.update.searcher" $totalupdates = $updatesearcher.gettotalhistorycount() $patchlist=$updatesearcher.queryhistory(0,$totalupdates) write-host "nombre total de patches installés sur le poste [$system] :" $patchlist.count write-host "préparation du classeur excel...." $sheet = $excel.worksheets.item(1) $sheet.name = "patches installés" $sheet.cells.item(1,1) = "titre" $sheet.cells.item(1,2) = "description" $sheet.cells.item(1,3) = "date" $sheet.activate() $sheet.application.activewindow.splitrow = 1 $sheet.application.activewindow.free

asp.net - Lost listview datasource when button clicked -

i have radlistview. add datasource listview when page_load. when clicked button in same page. lost datasource of listview. why? how can fix it? try putting listview databinding code inside this. protected void page_load(object sender, eventargs e) { if(!ispostback) { mylistview.datasource = mydatasource; mylistview.databind(); } } you may want consider using updatepanels if wanting postback part of page, rather whole page.

ckeditor bidi force use direction rtl or ltr -

i'm using ckeditor 4 , allow customers use rtl or ltr directions - since i'm going send output email message want have direction attribute used. for reason, if i'm using hebrew or arabic version of ckeditor - omit rtl instead of writing it. there way force ckeditor write direction? i tried settings: config.language = 'he'; config.contentslangdirection = 'ltr'; i've looked in ckeditor documentation found nothing forcing direction tag. onkeypress textarea please call function function checkarabic( character ) { var arabic = /[\u0600-\u06ff]/; return arabic.test(character); } then if true set dir='rtl' html iframe.

c# - Get data from Stored Procedure without knowing the amount of columns -

i making web application in asp.net using c# , linq. i have made stored procedure converts result set pivot table , returns 'pivoted' result. how can select result in linq statement , attach datagridview? for example: number question answer 1 how old 15 1 live belgium 1 what's name dennis 2 how old 19 2 live germany 2 what's name tom 3 how old 26 3 live holland 3 what's name gary becomes: number how old live what's name 1 15 belgium dennis 2 19 germany tom 3 26 holland gary thanks you cannot make using linq. , in case don't think actyally need it. make data transformations inside app, not in stored proc. if anyway think possibl

sql server - Count number of occurrences of value in a PHP array -

i have loaded results of sql query array. fields computername, timeindays, room, keyed on computername. i find out how many times each timeindays occurrence happens. example values of array is: [stu-czc1087snc] => array ( [computername] => stu-czc1087snc [time_in_days] => 0 [room] => 4q08 ) [stu-czc02501qt] => array ( [computername] => stu-czc02501qt [time_in_days] => 12 [room] => 2r017 ) so want know how many computers have time_in_days = 12, , how many have time_in_days = 0 example. used plot graph. how do / best way of doing this? try this, $input array of arrays computer data: $result = array(); foreach($input $computername => $arr){ if(!isset($result[ $arr['time_in_days'] ])) $result[ $arr['time_in_days'] ] = 0; $result[ $arr['time_in_days'] ]++; } return $result; the result like: [ 12 => 2, //2 computers have time_in_days o

asp.net mvc - VS2013 IISexpress issue -

i making first project in visual studio 2013. when press f5 there error on visual studio console the program '[5740] iisexpress.exe' has exited code -1073741816 (0xc0000008) 'an invalid handle specified'. and browser showing error oops! google chrome not connect localhost:1311 can me vs2013 -> tool -> option -> project & solution-> web project -> use iis express 64 hope can you!

c# - Parsing XML - LINQ to XML or any other method -

i need extract thevalue of "file_name" attribute , innertext of the attributes values "m5" & "m6". name of file , number of classes , methods present in it. parsing method fine me. tried ways , extract file_name can't further down metric ids.. please help <?xml version="1.0" encoding="utf-8" ?> <sourcemonitor_metrics> <project version="3.4"> <project_name></project_name> <project_directory>e:\dev_2012\test\src</project_directory> <project_language>java</project_language> <ignore_headers_footers>false</ignore_headers_footers> <export_raw_numbers>false</export_raw_numbers> <metric_names name_count="15"> <metric_name id="m0" type="number">lines</metric_name> <metric_name id="m1" type="number">statements</metric_name>

iphone - IOS - Switch to alternate ViewController Programatically -

Image
i reasonably new ios below screenshot of app structure - there various tableviewcontroller / uiviewcontrollers connect tab bar controller - pretty standard guess. the colourful shot homepage - users able click on 1 of 4 tabs , navigate 1 of other pages - though i'm struggling on how to programatically. i have attached buttons ib-actions , have given screesn storyboard id's. the following code far - - (ibaction)btncult:(id)sender { uiviewcontroller *vc = [self.storyboard instantiateviewcontrollerwithidentifier:@"culture"]; [self presentviewcontroller:vc animated:yes completion:nil]; } this nothing - can give me tips on i'm going wrong? try add ibaction: [self.tabbarcontroller setselectedindex:0]; it should takes first tab, changing index change tabs(views)

javascript - AngularJS: delete charAt last index of "," -

how write code in angularjs delete character @ last index of ",". here equivalent java code: stringbuilder.deletecharat(stringbuilder.lastindexof(",")); please help. you str = str.replace(/,([^,]*)$/, "$1"); or var pos = str.lastindexof(","); str = str.substr(0, pos) + str.substr(pos + 1);

java - Disabling back button in browser -

this question has answer here: disable browser's button 19 answers i have requirment disable button while login page come. noted below code not working. function disablebackbutton() { window.history.go(); } window.onbeforeunload = disablebackbutton; for serverside have added serverside code below. response.setheader("cache-control", "no-cache"); response.setheader("cache-control", "no-store"); response.setheader("pragma", "no-cache"); response.setdateheader("expires", 0);%> try this: window.onload = function () { history.forward(); }; //force user redirect window.onunload = function() {}; // trick browsers ie

java - ArrayList that contains circles that move -

public class second extends jpanel implements actionlistener { arraylist<ellipse2d.double> circles = new arraylist<ellipse2d.double>(); timer t = new timer(5, this); double x=0, y=0, velx=1, vely=1; circles.add(new ellipse2d.double(x,y,10,10)); public void paintcomponent(graphics g) { super.paintcomponent(g); graphics2d g2 = (graphics2d) g; for(ellipse2d.double k : circles){ g2.draw(k); } g2.fill(k); t.start(); } } public void actionperformed(actionevent e) { if (x < 0 || x > 560) { velx = -velx; } if (y <0 || y >360){ vely = -vely; } //x+= velx; y += vely; repaint(); } i tried doing didnt work know how draw them , make them move think problem initializing arraylist error: multiple markers @ line - syntax error on token "add", = expected after token - syntax error on token(s), misplaced construct(s) error add circle you can execute add method inside

Mediawiki article permission, block special pages -

i need 2 things: i create article in mediawiki f.ex. financial data , block users except 1 user or user group called "financial". there way make simple, maybe while creating article? i block special pages users, how it? blocked editing, discussing etc , need block special pages users. first: if need set per article permission, using wrong tool. mediawiki designed open , highly collaborative, , working around a) require hacks , b) never entirely secure. (see mediawiki: security issues authorization extensions . in brief: there will ways users access content of restricted pages.) now, if still want try , restrict access pages, there few extensions choose from . among thoose extension:lockdown allow set per namespace permissions, , special page restrictions. have create 1 namespace per access setting, , put financial data in restricted namespace, e.g. restricted:financial localsettings.php (just example!): #add new user group $wggrouppermissions['t