Posts

Showing posts from July, 2014

activerecord - Remove a type modifier from schema with a migration in Rails -

let's pretend schema looks this: create_table "bunnies", force: true |t| t.datetime "created_at", null: false end how write migration removes "null: false" constraint on schema? this should it change_column :bunnies, :created_at, :datetime, null: true

excel conditional formatting with data -

i trying format different columns of excel sheet based on 2 conditions: if cell not contain letter "u" or letter "r" , if greater set number. for example, if have column of data, want 0.3 highlighted because greater set number of 0.00834 , not contain u or r. don't want 0.0071u highlighted or 0.0056j. any help? select cells/column(s) want conditional format applied (for example assume use column b:b ) check cell active - "white" cell in blue selection. (i assume it's b1 ) create new conditional format home -> conditional formatting -> new rule select "use formula determine cells format" enter following formula: =and(right(b1,1)<>"u",right(b1,1)<>"r",if(isnumber(b1),b1,value(left(b1,len(b1)-1)))>0.00834) make sure b1 active cell step 2. make sure not using $ fix row or column. note: formula assumes cells contain either proper numbers - or number , single letter @ end! set

mysql - Putting select count data into a Fetch Array Query row PHP -

i have script retrieves users same "dealership_id" "users" table, works fine. each user within these records has id (users_sales_guild_id) on table called "sales_list". what trying list total amount of sales each user has "sales_list" table next respective user currently prints logged in user's amount (john smith , value of 5), , not each individual amount, going wrong? how look name | position | sid | total sales | john smith | sales consultant | 23434 | 5 | details jane smith | sales consultant | 34234 | 9 | details john chan | sales manager | 43423 | 3 | details jane chan | sales consultant | 23344 | 7 | details how looks name | position | sid | total sales | john smith | sales consultant | 23434 | 5 | details jane smith | sales consultant | 34234

android - Specific styles for individual views -

short question: possible create theme , set specific styles individual views? lets want text color of textview in red , text color edittext in green. somithing (but isn't working): <style name="myapptheme" parent="android:theme.light"> <item name="android:windownotitle">true</item> <item name="android:textcolor">#0000ff</item> <style parent="@android:style/widget.edittext"> <item name="android:textcolor">#ff0000</item> </style> </style> update: the core element of app views draw on own. support theming have abstract “theme” base class has methods provide colors , drawables need. class derive several classes “blacktheme”, “whitetheme”… user can set right theme in settings. every additional information need user use dialogfragment default android widgets. in dialogfragments apply dialog style in oncreateview. @override p

emacs - Is it possible to downgrade packages installed with ELPA? -

i updated today packages in emacs elpa , after update i'm stuck variable binding depth exceeds max-specpdl-size error. since not easy debug, possible downgrade packages updated? can find elpa log can previous version of these packages? i second @lawlist's recommendation (setq debug-on-error t) in ~/.emacs file. can use emacs --debug-init similar result. said, kind of error here can prevent debugger showing up. recommend m-x report-emacs-bug , describe problem, along additional info find, including solution found, if any. as downgrading package, it's technically possible, there no ui support it. , there's no log of package installs either. please mention in bug-report well, since it's indeed idea try , keep track of things. sorry.

python - Closing connectionSocket throwing 'Invalid syntax with except IOError' -

i tried executing code, getting error message saying "invalid syntax". please me out, since new this. #import socket module socket import * connectonsocket.close() except ioerror: connectionsocket.send('\nhttp/1.1 404 not found\n\n') #close client socket connectionsocket.close() serversocket.close() please see informative tutorialspoint page great explanation of try/except/else/finally python code! your code should be: #import socket module socket import * try: connectonsocket.open() except ioerror: connectionsocket.send('\nhttp/1.1 404 not found\n\n') #close client socket finally: connectionsocket.close() serversocket.close() and if copying , pasting code cmd / terminal cannot have blank lines (if you'll indentation error). try/except/finally try : means 'try' something, ie. call function, method, etc. except (you can have multiple excepts): means if 'try' code did

MySQL query working in phpmyadmin but not in PHP -

i've created mysql view expecting 2 parameters , i'm able query without problems in phpyadmin following sql-string: set @date1 = '2014-02-06'; set @date2 = '2014-02-07'; select * _myquery it not work under php - i'm getting following error: you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'set @date2 = '2014-02-07'; select * _myquery' @ line 2 when it's working in phpmyadmin, shouldn't work under php? idea what's wrong? do need mysql variables? because select query not using them. can try with select * _myquery but if need use mysql variables, take @ this: mysql variables not working through php mysql query mysql variables , php

c# - System.Diagnostics.Debug.WriteLine being stepped over -

i using visual studio 2013 in asp.net mvc/c# project. i outputting output window using system.diagnostics.debug.writeline but reason vs has stopped running line. executing in debug mode. if step through code debugger jump on line. is controlled setting. have searched web nothing obvious jump out go project settings , see if there check mark in front of define debug constant . it's not there, although should default. if debug constant not defined - method referring removed compiler. that's why debugger acts code not there.

python - Separating list items into columns with single label call -

i need separate list items columns. problem don't know how many items in list when it's created (i'm making list using nltk's tokenizer). how put item 1 in column 1, item 2 in column 2, etc. i've put in simplified code below. right puts things in correct amount of columns, last item in list in each column. thanks. from tkinter import * import ttk root = tk() root.title("this space intentionally left blank") root.minsize(800,200) mainframe = ttk.frame(root) mainframe.grid(column = 0, row = 0) tokens = [0,1,2,3,4,5,6] numtok = len(tokens) tok = stringvar() x=0 while x < numtok: tok.set(tokens[x]) ttk.label(mainframe, textvariable=tok).grid(column=x+1, row=2) x += 1 root.mainloop() tkinter labels textvariable set update text if underlying stringvar changes. you creating single stringvar updating each loop causing labels have same text. try instead: from tkinter import * import ttk root = tk() root.title("thi

x11 - Installing Inkscape on Mavericks -

i have installed inkscape 0.48.2 on brand new mac mini running mavericks can never work crashes. once asked me x11 server have installed never worked ever since. should do? make sure installed xquartz x server. http://xquartz.macosforge.org/ to see logs can try command line: /applications/inkscape.app/contents/macos/inkscape

java ee - Maven ships dependencies inside war but not in jar -

i have 2 maven projects, 1 (i call core) ejb-jar (ejb) , other war (client). my client project consumes ejbs inside core...so far good. but i'm getting classnotfoundexception inside core application because can't find 1 class apache-beanutils...i have set dependency compile scope in it's pom.xml not shipped inside output jar. when check client.war package see every compile-scoped dependency inside web-inf/lib folder...but in core.jar don't see of it's dependencies...i'm totally confused this. can me? tried google before asking didn't find useful far..thanks. you can use maven assembly plugin bundle jars in 1 super jar. see this: question

sqlite - Can't retrieve auto generated primary key using Vici Coolstorage -

i'm using vici coolstorage in windows forms project access sqlite database. in every table in database there field called id defined integer primary key, auto increment field. i'm trying retrieve value of field after store object in database, value 0 instead of real id. vici coolstorage documentation states "if primary key defined autonumber (identity) field in database, can retrieve generated primary key after object saved", doesn't seem true unless i'm doing wrong. please me. code reproduce problem: <mapto("company")> public mustinherit class company inherits csobject(of company, integer) public mustoverride readonly property id integer public mustoverride property name string end class sub somemethod() dim c company = company.[new] c.name = "some name" c.save() messagebox.show(c.id) 'this prints 0!!! end sub thank you! had faced issue , figured out setting identity attribute on f

go - How do I get Type -

i'd (reflect)type type name. http://play.golang.org/p/c-9ipsafx0 package main import ( "fmt" "reflect" ) type name string func main() { fmt.println("hello, playground") var name name = "taro" fmt.println(name) fmt.println(gettype(name)) // fmt.println(gettype(name)) // want same gettype(name) } func gettype(v interface{}) reflect.type { return reflect.typeof(v) } how rewrite gettype function. there no way pass type argument function in go, ask not possible. if want use reflect module work types, need have value starting point.

How to make QtGui.QPushButton() current? -

i make button created mybutton = qtgui.qpushbutton() active (so if user hits enter keyboard key button pressed). on osx can see dialog box button in such 'active' state because colored in light blue ( , there form of "glowing=swimming" animation going on). attribute needs set make button current? try this: mybutton.setdefault(true) mybutton.setfocus()

Get the video time while playing android -

i want ask how time of video while plays. using videoview. let example, when playing video length of 10 minutes , in 4th minute, how can value of 4 minute? appreciated. thank you. below code in playing video. private void playvideo(){ mediacontroller mc = new mediacontroller(getactivity()); mc.setanchorview(videomovie); uri video = uri.parse(url); videomovie.setmediacontroller(mc); videomovie.setvideouri(video); videomovie.setonpreparedlistener(new onpreparedlistener() { @override public void onprepared(mediaplayer mp) { videomovie.start(); } }); } look tutorial , if want time of video while plays, code work well videoview.getduration()

How to set print outputs equal to a variable in Java? -

i'm new java , programming if question painfully obvious apologize in advance. what i'm trying set printed output of line equal variable can use variable add or subtract .3 depending on whether or not "-" or "+" sign typed in input. edit: import java.util.*; public class homeworkcalculator { public static void main(string[]args) { scanner in = new scanner(system.in); string grade, letter1, letter2; system.out.print("enter letter grade: "); grade = in.nextline(); letter1 = grade.substring(0,1); letter2 = grade.substring(1,2); double gpa = 0; if (letter1.equals("a")) gpa = 3.9; else if(letter1.equals("b")) gpa = 3.0; else if(letter1.equals("c")) gpa = 2.1; else if(letter1.equals("d")) gpa = 1.2; else if(letter1.equals("f")) gpa = 0; system.out.println(gpa); if(letter2.equals("+")) { system.out.println(gpa + 0.3); } else if(letter2.equals("-")) { system.out.prin

Tic Tac Toe Programming help C++ -

my main questions are, how tokens (x's , o's) appear on game board? have ask user row number , column number , token placed there. may able tell, new programming. have been @ hours , done. asking on here last resort. if of code done differently or more efficiently or isn't necessary or if did wrong, please let me know. out of ideas. finish program, more detailed be, better. appreciate it. confused , need advice finish this. my code far: #include <iostream> using namespace std; void createboard(int board[][3], char charboard[][3]); void printboard(char charboard[][3]); int checkwinner (int board[][3], int player); bool checkmove(int board[][3], int row, int column); void resetboard(int board[][3]); int main () { int board[3][3]; char charboard[3][3]; int player; int row, column; bool win = false; char again = 'y'; while (win == false) { createboard(board, charboard); printboard(charboard); cout

Query to change table collation in SQL Server 2008 -

in database, 1 table collation different other tables. i change table collation same other tables. now, can change table collation using ssms design use query change collation. currently, 1 table collation thai_ci_as , want change collation sql_latin1_general_cp1_ci_as . it's not possible drop table because contains data. never bad idea consult documentation . guessing @ source data type , nullability; can fill in table/column names: alter table dbo.tablename alter column columnname nvarchar(255) collate sql_latin1_general_cp1_ci_as not null; if can't check documentation, management studio sometimes show smart way (though doesn't choose things best way). go design screen, change collation, , instead of clicking ok, click script button.

Eclipse in Android adt bundle for windows not working properly -

i downloaded eclipse adt bundle windows http://developer.android.com/sdk/index.html and eclipse not behaving would. e.g. ctrl + shift + l pressed twice should open key binding alt + left should "go back" i tried go windows -> preferences , tried changing "go back" shortcut ctrl + q alt + left , restarted eclipse nothing. these things kind of bug when coding. how should go normal eclipse settings (when download eclipse standalone , add adt plugin) if above vague question answer me how change shortcuts mentioned in example above. thank in advance. the way changing shotcuts seems correct eclipse has these bugs sometimes, trust me.. you go eclipse's website , download stand alone version , install adb manualy folowing instructions on tis page https://developer.android.com/sdk/installing/installing-adt.html

Is there a limit to Google Webmasters Tools Api when fetching for crawl issues -

i tasked create admin tool download crawl issues 1 of our sites. used code https://github.com/eyecatchup/gwt_crawlerrors-php . the modification made use oauth 2.0 authentication since circumstances not allow me have access webmasters account. my implementation worked fine , able download csv files cross-checking results between api , web tool reveals api returns 16k+ entries while web tool has 40k+ . tested using google's oauth 2.0 playground , results show 16k+ entries also. is there limit imposed on google web masters tools api not mentioned in docs ?

html - jquery change custom attribute status -

i'm trying change custom attribute , having no luck. missing silly? html: <div class="favorite" status="off">&#9734</div> jquery: $(".favorite").click( function(){ var currentvalue = $(this).attr("status"); if(currentvalue == "off"){ $(this).html("&#9733;"); $(this).attr("status") = "on"; }else if (currentvalue == "on"){ $(this).html("&#9734;"); $(this).attr("status") = "off"; } } ); i can change star filled in, status never changes "on". missing? thanks! you need use setter version of .attr() (pass value set second argument). $(this).attr("status", 'on')

generate an array with values of another array in javascript -

i have array values thats supposed show images randomized. want create array randomized images' name var 1 = new array("0.jpg", "1.jpg");//first array of images for(i=0; i<=6;i++) { var random=math.floor(math.random()*(length));//randomize images of array 1 document.write('<img src="'+one[random])//display images // after array 1 randomized want create array randomized images array 2..how can this???? going have var shuffled=new array(one[random]); create second array doesnt work..any ideas? you can add randomize method array.prototype : array.prototype.random = function () { var result = [], = this.slice(); this.foreach(function () { result.push(that.splice(math.floor(math.random() * that.length), 1)[0]); }); return result; } then can shuffled array with: var shuffled = one.random(); demo

php - get the latest joomla version numer programmatically -

i working on maintenance function want latest version numbers(as strings) of popular cms , store them database. i've done wordpress part send head request " http://wordpress.org/latest " , versioin number string "3.8.1" filename "wordpress-3.8.1.tar.gz". now wondering how deal joomla, or if possible, magento. thanks in advance. try this, for long term support (lts) branch -( recommended) stable release http://update.joomla.org/core/list.xml short term support (sts) branch http://update.joomla.org/core/sts/list_sts.xml testing versions. http://update.joomla.org/core/test/list_test.xml all these xml files have link details zip files. hope helps..

how to avoid runtime error while displaying a message box in excel vba -

i trying display message box saying "file not chosen" if file not chosen.my problem message box getting displayed when click on ok runtime error 1004 saying "file not found or check spelling , location of file".can me how avoid error.thank you dim wbk1 workbook, wbk2 workbook, wbk3 workbook dim sh1 worksheet, sh2 worksheet, sh3 worksheet dim tmp1 string, tmp2 string, tmp3 string dim textbox1 string dim textbox2 string dim textbox3 string tmp1 = sheets("sheet1").textbox1.value if len(trim(tmp1)) = 0 msgbox "file not chosen" end if exit sub tmp2 = sheets("sheet1").textbox2.value if len(trim(tmp2)) = 0 msgbox "destination file not selected" end if exit sub tmp3 = sheets("sheet1").textbox3.value if len(trim(tmp3)) = 0 msgbox "mapping file not selected" end if exit sub set wbk1 = workbooks.open(tmp1) set wbk2 = workbooks.open(tmp2) set wbk3 = workbooks.open(tmp3) set sh1 = wbk1.sheets("inventory&

android intent - onNewIntent not called on restart -

i have alarm clock app, using alarm manager , broadcast receiver. app 1 single activity , 4 fragments. when alarm goes off onreceive method sends intent main activity, main activity receives intent in method onnewintent , moves correct fragment. works fine, except when alarm goes off after app has been closed. once destroy app, alarm still goes off , intent broadcast receiver fires, onnewintent method catch intent , move app correct fragment. here intent in broadcast receiver class moves main activity intent alarmintent = new intent( context, clockactivity.class ); alarmintent.addflags(intent.flag_from_background); alarmintent.addflags(intent.flag_activity_single_top); alarmintent.addflags(intent.flag_activity_new_task); alarmintent.putextra("alarm name", receivedalarm.getmname()); context.startactivity(alarmintent); here onnewintent method in main activity not getting called when ala

ios - Change border width of label in custom UICollectionCell -

i have custom uicollectionviewcell , have placed 2 uilabels in it. want change borderradius , borderwidth of labels in it. can tell me how this? doing in way, nothing happening: self.titlelabel.layer.borderwidth = 2.0; self.titlelabel.layer.bordercolor = [uicolor blackcolor].cgcolor; i putting these 2 lines in initwithframe method. if want set borderwidth of uilabel inside means why using self.titlelabel.layer.borderwidth = 2.0; instead of can directly use label name like, yourlabel1.layer.borderwidth = 2.0; yourlabel2.layer.borderwidth = 2.0; like wise can change borderradius also.

c# - updatePanel in Griview ItemTemplate has issue on postback -

in griditemtemplate , have update panel , check box , <itemtemplate> <asp:updatepanel runat="server" id="upchkoption"> <contenttemplate> <asp:checkbox runat="server" id="chkoption" autopostback="true" oncheckedchanged="chkoption_checkchanged"> </contenttemplate> </asp:updatepanel> </itemtemplate> first time running has no error , after postback , got error cannot unregister updatepanel id 'upchkoption' since not registered scriptmanager. might occur if updatepanel removed control tree , later added again, not supported. parameter name: updatepanel how can solve ? add updatepanel_unload onunload event of updatepanel : <asp:updatepanel id="upchkoption" runat="server" onunload="updatepanel_unload"> add in code behind protected vo

javascript - Railscast #383 add/remove uploader form and script via AJAX -

i've got uploader working railscast #383, there way add , remove uploader link via ajax? i need pass in "service" instance id. the code add or remove via ajax below: <%= s3_uploader_form post: images_url(:service_id => service.id), as: "image[url]" %> <%= file_field_tag :file, multiple: true %> <% end %> <script id="template-upload" type="text/x-tmpl"> <div class="upload"> {%=o.name%} <div class="progress"><div class="bar" style="width: 0%"></div></div> </div> </script> ok figured out. main problem having uploader coffeescript not executing again after form added via ajax. revised #136 railscast got basic ajax form working, in order uploader form working via ajax, included uploader coffeescript normal javascript in new.js.erb file. way when new.js.erb file executed, loads form , executes upl

javascript - Why do we use to detect type of object is function? -

why use in javascript application this: if ( typeof object.create !== 'function' ) { object.create = function( obj ) { function f() {}; f.prototype = obj; return new f(); }; } this called polyfill -- detects whether feature of javascript supported current users browser, , if it's not there, defines other scripts come page run on browser.

android - List view height return zero only for first item -

i trying list view heigh @ run time fit item height of screen. here code: in getview() int totalheight = activity.getlistview().getheight(); int rowheight = totalheight / getcount(); // divide number of items. activity.getlistview().setscrollcontainer(false); activity.getlistview().setverticalscrollbarenabled(false); convertview.setminimumheight(rowheight); in activity have programatically created list view both width , height match_parent. but tried debug , saw first item list view height 0 rest of items giving me proper height. why ? how fix ? it's due view has not been created yet. in situation height 0. you can height of view using like: final listview listview = activity.getlistview(); viewtreeobserver vto = listview.getviewtreeobserver(); vto.addongloballayoutlistener(new ongloballayoutlistener() { @override public void ongloballayout() { int totalheight = listview.getheight();

sockets - SCTP receive message function returning zero -

the client program have written uses sctp sockets communication. using sctp_recvmsg read data available particular user socket. have noticed @ times sctp_recvmsg returns 0 value instead of number of bytes read or -1 indicating error. have checked code , socket data being read not closed. can throw light on how can such behavior seen? thanks in advance. regards, sujay according this lksctp thread , sctp_recvmsg() returns 0 if other side closed connection when in 1-to-1 scp connection ( see here explanation of one-to-one , one-to-many connections) - is, when create socket sock_stream instead of sock_seqpacket . quoting: return values sctp_sendmsg , sctp_recvmsg not documented, suppose sctp_sendmsg return -1 , set errno econnreset same way sendmsg does. however, sctp_recvnmsg? plain recvmsg should return 0 if half-connection closed, there no half-connections in sctp. how function behave exactly? the sctp_recvmsg() return 0 on te

Getting error while executing getwritabledatabase() in android -

i have created 1 class database , multiple classes tables , multiple activity classess works fine when use database class instance in activity class @ same time when use database class instance in table class , run application control goes getwritabledatabase getting exception , application exited, below code 3 classes. database class. public class database extends sqliteopenhelper{ private static string dbname="manager"; private static int dbversion=2; sqlitedatabase db; public database(context context) { super(context, dbname, null, dbversion); // todo auto-generated constructor stub db=this.getwritabledatabase(); } @override public void oncreate(sqlitedatabase db) { // todo auto-generated method stub stocktable st=new stocktable(); db.execsql(st.stocktable); } @override public void onupgrade(sqlitedatabase db, int oldversion, int newversion) { // todo auto-gen

c# - How does Distinct() work on a List<> of anonymous type? -

this question has answer here: linq select distinct anonymous types 7 answers how distinct() work on list<> of anonymous type? property compare? or return same list? example: list<someobject> list; .... .... var result = list .where(i => i.condition) .select(i => new { name = i.name, date = i.date }); .distinct() .tolist() please note applied distinct on anonymous-type list. from msdn because equals , gethashcode methods on anonymous types defined in terms of equals , gethashcode methods of properties, 2 instances of same anonymous type equal if properties equal.

php - How i can sort 2 dimensional array? -

this question has answer here: how can sort arrays , data in php? 7 answers how sort array in descending order based on specific value [duplicate] 3 answers how can sort following array array ( [17] => array ( [network_id] => 17 [network_name] => m4n [total_transactions] => 4 [commission] => 6.08 [ordervalue] => 101 [pending] => 0 [approved] => 4 ) [18] => array ( [network_id] => 18 [network_name] => zanox [total_transactions] => 32 [commission] => 33.7 [ordervalue] => 1010.45 [pending] => 0 [approved] => 32 ) ) i want so

c++ - OpenGL Multithreaded sample in Ubuntu virtualbox -

i facing weird problem opengl sample on vbox 3d acceleration enabled guest: ubuntu 12.04 host: windows 7, nvidia graphics vbox version 4.3.6 guest additions installed this application runs on vbox when 3d acceleration disabled , have checked on stand alone linux pc well. when same run 3d acceleration enabled, not able gl function pointers giving errors - function no-op the app simple, main thread creates 2 threads. main thread - create thread 1, create thread 2 thread 1 - create x-window rendering thread 2 - create render thread (draw opengl quad on x-window). here code sample app. #include<stdio.h> #include<stdlib.h> #include<x11/x.h> #include<x11/xlib.h> #include<gl/gl.h> #include<gl/glx.h> //#include<gl/glu.h> #include <dlfcn.h> /*dlopen*/ #include <pthread.h> #include <unistd.h> /*sleep*/ display *dpy; display *dpy2; window root; glint

wso2 - How to use wso2cep in my case? -

i working wso2cep3.0. went through docs of wso2cep there no exaplanation wso2cep how use 1.what use of input event adapter :-in concern getting data client. 2. event builder means incoming data format specifier. 3. event formatter means outgoing data format specifier. 4 .output event adapter out put handler. how can use thing means program or event writer important how publish external world example http endpoint or https or jms. unable understand how start , can start. please suggest me know esb,dss,is,bps for typical cep usecase, configure input event adaptor connect event source, such jms endpoint, thrift endpoint(wso2event adaptor in cep 3.0.0) etc. event builder specifies how incoming message mapped. next execution plans have actual query (the processing part) of execution flow. cep engine processes events. event formatter formats output format needed. output event adaptor connects actual endpoint processed result published. go , publish jms endpoint, email, d

python - Alternative method to find if APNS certification file is valid? -

i'm having problem developing "provider" in apns . server trying send messages using apns-client , seems there no problems occuring while sending messages, device isn't receiving messages @ all. recently i've changed *.pem file new one. messages received while using previous *.pem file, i'm sure there no problems @ server connections , sending script (written in python). reason is, probably, because old *.pem file valid new *.pem file not. i desire have "error" response apns server if *.pem file invalid, seems apns server or apns-client library isn't returning error signals if *.pem file invalid. i've proved fact adding 1 hundred 'a' s line before before -----end rsa private key----- in *.pem, , running same python script. yes, still didn't receive error messages. since apns server returning no error messages, it's impossible check if *.pem file valid... aren't there methods check if *.pem file valid? h

How to remove duplicate devices in bluetooth connection using GKPeerPickerController in ios -

i want connect 2 ios devices via bluetooth using gkpeerpickercontroller. @ first time, connects after there problem in connction on can't connected. there duplicate devices listing in gkpeerpickercontroller alert while searching near devices. please me. i using following code search nearby devices via bluetooth. #pragma mark - gamekit peer picker -(void)startsearch { gkpeerpickercontroller *picker = [[gkpeerpickercontroller alloc] init]; picker.delegate = self; [picker show]; } -(void)peerpickercontrollerdidcancel:(gkpeerpickercontroller *)picker{picker.delegate = nil;} -(gksession *)peerpickercontroller:(gkpeerpickercontroller *)picker sessionforconnectiontype:(gkpeerpickerconnectiontype)type { nsstring *sessionidstring = @"mtbluetoothsessionid"; return [[gksession alloc] initwithsessionid:sessionidstring displayname:nil sessionmode:gksessionmodepeer]; } -(void)peerpickercontroller:(gkpeerpickercontroller *)picker didconnectpeer:(nsstring *)peerid tose

Android : Push data with notification -

i developing application. application client server based. the need of application that: i want push data server device without web service, push notification. want push data more in size compare notification , data may text, xml, json, .png, .jpg thing. i had tried push notification demo this link whenever there data added server, data should push server device notification. when user click on notification data gets display device, don't want fetch data after click on notification web server. please suggest me in middle of application. so please suggest me steps should follow achieve task. guide me valuable knowledge. the need of application that: 1. want push data server device without web service, push notification. want push data more in size compare notification , data may text, xml, json, .png, .jpg thing. 2. whenever there data added server, data should push server device notification. when user click on notification data gets display device, don

Grails cxf plugin - customize cxf endpoint display page -

i customize view of published endpoint page, generated cxf-plugin ( http://localhost:8080/myapp/services ). display of soap endpoints should have layout of entire app access restricted by spring security. question is, how possible accomplish? my first idea customize output of servlet via css, i'm struggling how done. problem here is, authorization information seem problem. another alternative create own controller , display information in customized fashion. problem here, i'm not aware of possibilities on information endpoints, wsdl documents , on, published via /services servlet. the third, worst solution (at least perspective) create own controller, http on /services, parse html , extract endpoint information via approach. perhaps has done before , can give me hint how endpoint information controller. thanks help!

Scheme - create a function from a list of functions -

hey i'm having trouble thinking , help. in scheme if i'm given list of functions (list square - double) need make function encompass list for example (let (f (co (list square - double)))) co function name combines would same (square (- (double n))) n number can following (f 2) => (16) (define (co functions) (lambda (n) (? functions))) i'm not sure go ?. know if map end getting functions applied number output list '(4 -2 4). any ideas appreciated hopefully it's not homework. > (define double (lambda (n) (* n 2))) > (define square (lambda (n) (* n n))) > (set! fs (list square - double)) > (define co (lambda (functions n) (cond ((null? functions) n) (else ((car functions) (co (cdr functions) n)))))) > (co fs 6) 144 > (co fs 4) 64 > (co fs 2) 16

html - table borders look white on a gray background -

Image
i know common question have looked every thread , nothing seems helping.the html ode messed up,however,i post right here.i have made borders none still appears white , looks awful.please help. <style type="text/css"> .auto-style4 { width: 114%; border: none; } .auto-style1 { width: 206px; text-align: right; border: none; } .auto-style2 { width: 935px; border: none; } .auto-style6 { width: 935px; text-align: center; background-color: #c0c0c0; border: none; } .auto-style7 { width: 198px; height: 23px; border: none; } .auto-style9 { height: 23px; border: none; } .auto-style10 { width: 198px; height: 196px; border: none; } .auto-style11 { width: 935px; text-align: left; height: 196px; border: none; } .auto-style1

google app engine - GAE, how to search a text string in datastore? -

i have table following definition entity(name = "historyvisitsdevicejpa") public class historyvisitsdevicejpa { @id @generatedvalue(strategy = generationtype.identity) private long id; private text pageaddress; private long date; @override public boolean equals(object o) { if (this == o) return true; if (o == null || getclass() != o.getclass()) return false; historyvisitsdevicejpa = (historyvisitsdevicejpa) o; if (!pageaddress.equals(that.pageaddress)) return false; return true; } @override public int hashcode() { return pageaddress.hashcode(); } // other setter , getter methods } i've stored url in pageaddress filed , it's time stamp in date field. want search in records based on pageaddress , pull list of matched objects. my query this: private static final string query_history_v

eclipse - Scroll Images in a scrollview Android -

hello relatively new android developing. trying create scroll view can scroll through multiples images vertically how do that? tried searching cannot seem find solution it? should add multiple image view in scroll view possible? if how? please help. use gridview that gridview viewgroup displays items in two-dimensional, scrollable grid. grid items automatically inserted layout using listadapter. take , try example or create relativelayout inside scrollview , add multiple imageview inside realtive layout..

how to connect google glass with web app -

i have created sample web app using mirror-api+php. how connect app google glass. particular process see web content on google glass screen. thanks. hi missing 1 important step, login non explorer account due unable see notifications on glass screen

xml - Regular expression to replace string in javascripts -

hi have 1 xml file want replace path in xml. xml hold path of images has many record below tile5url="images/balcony sunset pano_o_480_5.jpg" so want replace path . want replace "images/" other path "newfolder/images/" or anythings else have used javascript read xml using xmlhttprequest object , generate responsetext read xml thanks try this: /tile5url="(images\/[^"]+)"/ and replace with tile5url="newfolder/$1" demo http://regex101.com/r/gb4ot5

sql - Trigger to update table column after insert? -

i need update column in table after record added in same table here sql code create trigger [dbo].[employeeinsert] on [dbo].[app_employees] after insert begin set nocount on; declare @employeeid bigint select @employeeid = id inserted update [dbo].[app_employees] set [employeetotalnumberofannualleave] = [employeebalancetheinitialnumberofdaysofannualleavein] id=@employeeid end go and showing error msg 2714, level 16, state 2, procedure employeeinsert, line 17 there object named 'employeeinsert' in database. the error you're getting because have trigger already, in database. if want create again, need first drop existing trigger (or use alter trigger instead of create trigger modify existing trigger). but: fundamental flaw seem expect trigger fired once per row - not case in sql server. instead, trigger fires once per statement , , pseudo table inserted might contain multiple rows . given that table might contain multiple ro