Posts

Showing posts from June, 2015

html - jssor slider weird image size behaviour and white spacing with chrome -

i seem have bug jssor slider - seems limited chrome @ moment. my first problem similar - jssor slider - image shake bug - image shrinks every time before transition animation played , expands after transition animation ends. i've seen happen on chrome , firefox funnily enough doesn't happen on ie10. person figured out problem explain more in depth on had changed fix issue? my other problem quite big breaks website hiding page content big white spaces. chance happened have 21 images showing slider , when in chrome, every time transition animation played, whole height of slider (i.e. content right next slider, imagine on website, orange right side element next current text element) turn white nothing showing until animation ends. have tried see if happens on other browsers seems chrome now. now more stranger behaviour happens when scroll down page position (it's @ position), whole screen turns white except slider. when scroll page down more, page content returns! i

php - Codeigniter cannot get data from mysql table -

i following error while trying data database: error number: 1066 not unique table/alias: 'faq' select *from ( faq , faq )where faq_title = 'title 1' please me find mistake. here model: public function did_get_faq_data($title){ $this->db->select('*'); $this->db->from('faq'); $this->db->where('faq_title', $title); $query = $this->db->get('faq'); if ($query->num_rows() > 0){ return $query->result(); } else { return false; } } in query table name called 2 times. unnecessary. replace $query = $this->db->get('faq'); $query = $this->db->get(); bold 1 correct. public function did_get_faq_data($title){ $this->db->select('*'); $this->db->from('faq'); $this->db->where('faq_title', $title); $query = $this->db->get(); if ($query->num_rows() > 0){ return $query

internationalization - RFC2616 algorithm for default content using Accept-Language header -

i'm designing web service has content stored in database, , want ensure design compliant rfc2616 . however, i'm little unclear on correct way match content. if specify behaviour user story: given request content in 'en_gb' when server has content in 'en_us' , server has content in 'en_ca' , server not have content in 'en' server should return content in '???' question : language should server return content in? update : based on pawel-dyda's answer , believe stories should this: given request content in 'en_gb' when server has content in 'en_us' , server has content in 'en_ca' , server has content in 'en' server should return content in 'en' given request content in 'en_gb' when server has content in 'en_us' , server has content in 'en_ca' , server not have content in 'en' server should return content in server de

python - Listbox returned items not working -

using returned items listbox in command isn't being recognised. message saying "mybuff" not field name. should mybuff returned string? other times message: typeerror: selectbuffer() takes 2 arguments (1 given) import arcpy,sys,os tkinter import* class application(frame): def __init__(self, master=none): frame.__init__(self, master) self.grid() self.createwidgets(master) def createwidgets(self,master): #add listbox , populate self.buflist = listbox(master, height=4, width=17, selectmode=single) self.buflist.grid(row=0, column=0, rowspan=4, columnspan=2, sticky='w') self.buflist.insert(end, "select buffer") item in ["5m", "10m", "15m"]: self.buflist.insert(end, item) #add select button self.selectbutton = button(master, text='1. select',command=self.selectbuffer) self.selectbutton.grid(row=0, column=2, sticky

Separators in Xamarin.Forms -

Image
i'd use horizontal separator lines in form. far found out, xamarin.forms doesn't provide one. could provide snippet separators? update 1 according jason's proposal, looks fine: // draws separator line , space of 5 above , below separator new boxview() { color = color.white, heightrequest = 5 }, new boxview() { color = color.gray, heightrequest = 1, opacity = 0.5 }, new boxview() { color = color.white, heightrequest = 5 }, renders below separator line: you might try using boxview // sl stacklayout sl.children.add(new boxview() { color = color.black, widthrequest = 100, heightrequest = 2 }); although in test, width request not being followed. may bug, or other settings might interfering it.

Node.js streaming adventure lesson 6: declaring a variable vs. in-line function declaration -

learning node.js, nodeschool.io , i'm confused differences between following 2 code segments. difference fundamental node.js or js in general, i'm hoping expert can clarify me. the accepted answer lesson 6 following. notice through(...) piped in-line. var http = require('http'); var through = require('through'); var server = http.createserver(function (req, res) { if (req.method === 'post') { req.pipe(through(function (buf) { this.queue(buf.tostring().touppercase()); })).pipe(res); } else res.end('send me post\n'); }); server.listen(parseint(process.argv[2])); my solution (which fails) declare variable tr so: var http = require('http'); var through = require('through'); var tr = through(function(buf) { this.queue(buf.tostring().touppercase()); }); var server = http.createserver(function (req, res) { if (req.method == 'post') { req.pipe(tr).pipe(res);

javascript - Update component properties externally -

i trying wrap head around react . requrment have 2 components, both displaying same json data in 2 different ways. want call web api 2 method, return json result , re-render components variable holding data changes. since these 2 components need reflect same data, didn't want make $.ajax call twice. did small test component simulate part of process , can't figure out. i have following jsx code: var data = {text: "some text..."}; var testcomponent = react.createclass({ render: function() { return ( <div classname="testcomponent"> hello, world! testcomponent. {this.props.data.text} </div> ); }, updatedata: function() { this.setprops({data: data}); } }); react.rendercomponent( <testcomponent data={data} />, document.getelementbyid('content') ); setinterval(function() { data = {text: "some other text..."}; }, 1000); in setinterval meth

python - How to traverse all directories in windows install with multiple drives -

i'm writing script should cross platform (usable laymen without needing edit code). script traverse through directories on computer , process of files found. snippet of code in question follows: for dirpath, dirnames, filenames in os.walk("/"): file in filenames: #process files so on linux works fine since "/" root directory. however, on windows, "/" translates c:\, means on computer multiple drives (c:\, d:\, e:\ etc) other drives won't processed. how can make sure files on drives processed in both windows , linux 1 script? thanks maybe (untested) example checks drives if machine not linux platform: import sys if sys.platform == "linux" or sys.platform == "linux2": drives = ['/'] else: # http://nullege.com/codes/search/win32api.getlogicaldrivestrings import win32api drives = win32api.getlogicaldrivestrings() drives = drives = drives.split('\000')[:-1]

ruby on rails - Devise with Models User and Profile + Omniauth Facebook -

our app uses devise registration , works perfect user model , profile model. save registration infos form users table , create profile in profiles table on sql infos , nested user_id. the omniauth facebook working save things user model, want save name, username fetched facebook auth profile model devise registration do. table users | id | email | encrypted_password | reset_password_token | reset_password_sent_at | remember_created_at | sign_in_count | current_sign_in_at | last_sign_in_at | current_sign_in_ip | last_sign_in_ip | created_at | updated_at | role_id | provider | uid | table profiles | id | user_id | username | name | lastname | gender | birthday | created_at | updated_at | model user.rb class user < activerecord::base has_one :profile, :dependent => :destroy, autosave: true accepts_nested_attributes_for :profile # include default devise modules. others available are: # :confirmable, :lockable, :timeoutable , :omniauthable devise :d

swift - iOS8 Keyboard Extension clipsToBounds -

i'm trying write custom keyboard ios8 , far, minus odd hiccup, i've not had many issues. however, when create view , add subview of uibutton i've added keyboard view newly added view clipped @ top of keyboard view. can tell, hierarchy follows: uiview (popup) -> uibutton (actual "key") -> uiinputview with hierarchy, top-level uiview being clipped inside uiinputview . each uiview has had clipstobounds set false , , set uiview ( self.view ) false within uiinputviewcontroller , doesn't seem have helped. it restriction of extension system currently, it's silly i'm doing! this not possible. according the docs states "in addition, not possible display key artwork above top row, system keyboard on iphone when tap key in top row.", shame. thanks @spentak pointing out

How do I add arbitrary fields to a model in Django/MongoDB -

i thought part of power of mongodb being able add arbitrary fields db model @ time. in django mongodb, can add field model @ time without having merge everything, how add field 1 "row" in db table. in other words, don't want add field model definition, because may show on 1 or 2 rows, instead should added when row saved database.

c++ - Key down functions -

hey how make in c++: have variable, , when press key '+' should increase one, when press , hold key more 500ms, variable should start increasing 5 every 500ms while still holding button down, , should stop when release it. know of getactivekeystate() function, can't seem make work way want. how this? i don't know native c++ functions it's doable sfml libraries. if (event.type == event::keypressed){ if (sf::keyboard::iskeypressed(sf::keyboard::add)) { //start counter if(count < 5) sum++; else sum+=5; } } you can same thing winapi in both cases you'll need use multithreading/multiprocessing counter, or find way sync code. try adding sleep(500) sleep thread 500ms or similar.

android - How to use 3G network when connected to a WiFi network with no internet access? -

sometimes have connect nexus 5 wifi network share files other devices, network not have internet access. use 3g data connection while phone connected. have root access. there way achieve this? (not necessary simple way) my phone isn't rooted , don't have shell installed on test, off top of head maybe help? route -n - determine routes available route add default gw <<ip address>> - replace gateway's ip address want default. make sure run command root or sudo. i'm not familiar android shell access or internals of how android manages networking. know, entire 3g internet connection may shut down default when on wifi. if else fails, consider "mobile hotspot" app phone, , have devices connect (as bonus, have internet access too). more information on viewing default gateway route command

c# - How to set focus on listbox item? -

i have defined list box this: var listbox = new listbox(); listbox.items.add(1); listbox.items.add(2); listbox.items.add(3); and want set focus directly item in listbox. if this: listbox.selectedindex = 0; listbox.focus(); the focus set entire listbox, if press arrow down move selection item below, have press arrow twice. first time focus jumps entire listbox first item, , when can press arrow again , selection jumps down. i want set focus directly first item, don't have press arrow twice. var listboxitem = (listboxitem)listbox.itemcontainergenerator.containerfromitem(listbox.selecteditem); listboxitem.focus();

android - Square's Otto and Threads -

i have otto question. have runnable thread kick off. processing , posts result event on bus. within runnable class, bus retrieved calling getinstance of class: public final class busprovider { private static final bus bus = new bus(threadenforcer.main); public static bus getinstance() { return bus; } private busprovider() { // no instances. } } later on, activity uses same method: busprovider.getinstance() access bus , register events. however, @subscribe method never called: @subscribe public void ongeocodeposition(geocodeposition geocodeposition) { ..... } my assumption though forcing bus on particular thread, ie. threadenforcer.main, because spooling new thread on runnable, reason not receiving events later on within activity posting in on 1 thread , listening on , therefore not work? you should use threadenforcer.any

php - Programmatically clear cache on symfony 2 -

i'm trying empty symfony 2 cache through application if doing php app/console cache:clear . i've tried many different solutions, such as: //solution 1 $process = new process('php '.__dir__.'/../../../../../app/console cache:clear'); $process->settimeout(3600); $process->run(); //solution 2 $input = new stringinput(null); $output = new nullconfigurationoutput(); $command = new cacheclearcommand(); $command->setcontainer($container); $command->run($input, $output); //solution 3 $container->get('cache_clearer')->clear($container->getparameter('kernel.cache_dir')); i've tried rm -rf cache folder. none of them working i'm getting many errors. following error 1 i'm getting on solution 2 (which seemed best): failed start session: started php ($_session set). seems symfony trying rebuild page or reboot application during render process. how clear cache via php code? edit : i'm trying re

javascript - Can I inject provider into factory? -

i want create httprequestinterceptor use in .config of application. $httpprovider.interceptors.push('httprequestinterceptor'); i have provider , factory of requestinterceptor: angular.module('app.services', []) .provider('appprovider', [function () { var apiurl = "http://url/api"; var _authtoken = null; var _currentuser = null; this.$get = function($q, $http, $cookiestore) { var service = { getauthtoken: function() { return _authtoken ? $cookiestore.get('authtoken') ? (_authtoken = $cookiestore.get('authtoken'), _authtoken) : '' : _authtoken; } }; return service } }]) .factory('httprequestinterceptor', [function () { return { request: function(config) { config.headers = {'auth-toke': appprovider.getauthtoken()} r

sql server - Reporting Services access via Management Studio and a C# application -

Image
how grant access select reporting services drop down within management studio per below image. also, have colleague has full admin access when run below credentials set defaultcredentials seem still getting error: namespace reportingservicesjobsutility { public class program { public static void main(string[] args) { listjobssrs(); } public static void listjobssrs() { //create instance of reportingservice2010 called server server.reportingservice2010 rs = new server.reportingservice2010(); //user credentials running application used rs.credentials = credentialcache.defaultcredentials; //rs.credentials = new system.net.networkcredential("",""); //create array of jobs job[] jobs = null; try { jobs = rs.listjobs(); listrunningjobs(jobs); }

Android How to call newInstance Constructor -

i want display slideshow using viewpager imageview , textview . when called fragment.newinstance (int image,string value) constructor shows error below. did called constructor correctly or not? error: 06-09 15:26:17.746: e/androidruntime(14955): fatal exception: main 06-09 15:26:17.746: e/androidruntime(14955): process: com.example.launchactivity, pid: 14955 06-09 15:26:17.746: e/androidruntime(14955): java.lang.nullpointerexception 06-09 15:26:17.746: e/androidruntime(14955): @ com.example.launchactivity.launchsliderfragment.newinstance(launchsliderfragment.java:33) 06-09 15:26:17.746: e/androidruntime(14955): @ com.example.launchactivity.launchactivity$screenslidepageradapter.getitem(launchactivity.java:44) 06-09 15:26:17.746: e/androidruntime(14955): @ android.support.v4.app.fragmentstatepageradapter.instantiateitem(fragmentstatepageradapter.java:105) 06-09 15:26:17.746: e/androidruntime(14955): @ android.support.v4.view.viewpager.addnewitem(viewpager.java:83

Android Chromecast application crashes when using Proguard -

when export signed application package chromecast application eclipse using proguard crashes when execute on target devices. just add -keep class android.support.** { *; } to proguard configuration file proguard-project.txt !

indexing - is there any way to restore predefined schema to mongoDB? -

i'm beginner mongodb. want know there way load predefined schema mongodb? ( example cassandra use .cql file purpose) if there is, please intruduce document structure of file , way restoring. if there not, how can create index 1 time when create collection. think wrong if create index every time call insert method or run program. p.s: have multi-threaded program every thread insert , update mongo collection. want create index 1 time. thanks. to create index on collection need use ensureindex command. need call once create index on collection. if call ensureindex repeatedly same arguments, first call create index, subsequent calls have no effect. so if know indexes you're going use database, can create script call command. an example insert_index.js file creates 2 indexes colla , collb collections: db.colla.ensureindex({ : 1}); db.collb.ensureindex({ b : -1}); you can call shell this: mongo --quiet localhost/dbname insert_index.js this creat

python - Cython does not run properly -

i have installed cython on debian.but when run cython commmand line raises exception importerror: no module named compiler.main and when write from cython.compiler.main import main same exception. can see there cython directory whereas compiler.main exist.i have not been able figure out reason behind exception. i tried installing/uninstalling cython not getting anywhere. i tried install using pip , apt-get both.i installing on debian squeeze. thanks in advance.

c++ - Get Mouse Wheel movement data -

i have wrote window hook retrieve mouse events _handle = setwindowshookex(wh_mouse, (hookproc)keyevent, nullptr, getcurrentthreadid()); static lresult winapi keyevent(int ncode, wparam wparam, lparam lparam) { if(ncode >= 0) { mousehookstruct* mstruct = ( mousehookstruct*)lparam; msllhookstruct* mwheeldstruct = (msllhookstruct*)lparam; cmousehookcom::_this->reporteventw(mstruct->hwnd, wparam, mwheeldstruct); } return(callnexthookex(null, ncode, wparam, lparam)); } case wm_mousewheel: outputdebugstring(l"cmousehookcom-wm_mousewheel"); strm = (msllhookstruct*)extradata; zdelta = (short)(hiword(((msllhookstruct*)extradata)->mousedata)); _stprintf(buffer, l"cmousehookcom - wm_mousewheel delta %d %i", zdelta, short((strm->mousedata >> 16) & 0xffff)); outputdebugstring(buffer); if (zdelta

javascript - Ajax request in Chrome extension -

i developing extenion makes ajax request web server var xhr = new xmlhttprequest(); xhr.open(method, url, true); xhr.setrequestheader("content-type","application/json"); xhr.send(json.stringify(data)); xhr.onreadystatechange = function() { if(xhr.readystate == 4 && xhr.status == 204) { //debugger; alert("logged in"); flag = 1; _callback(xhr, xhr.readystate); } } and here able logged in status = 204 , once logged in trying go different directory example www.example.com/index/enter ajax request in same extension not able so. are sure you're expecting same http response code? it's server you're making requests sending different response different request url. 204 no reponse = there no response data 200 ok = there data

vb.net - GetTokenInformation returns invalid SID? -

while following this ran problem. <dllimport("advapi32.dll", setlasterror:=true)> _ private shared function openprocesstoken(byval processhandle intptr, byval desiredaccess integer, byref tokenhandle intptr) boolean end function <dllimport("advapi32.dll", setlasterror:=true)> _ private shared function gettokeninformation(tokenhandle intptr, tokeninformationclass token_information_class, tokeninformation intptr, tokeninformationlength uinteger, byref returnlength uinteger) boolean end function <dllimport("advapi32.dll", setlasterror:=true)> _ private shared function isvalidsid(sid byte()) boolean end function each p process in process.getprocesses dim processhandle intptr = openprocess(process_query_limited_information, false, p.id) if not processhandle = nothing dim tokenhandle intptr = nothing dim bool boolean = openprocesstoken(processhandle, token_read, tokenhandle)

ios - Creating a ScrollView within a TableView? -

Image
i'm trying pick brains around this... in app i've got table view lists load of recipes. button added programmatically each row of tableview show ingredients user needs. idea user click logo , it'll take them view information there. i wondering though if following possible within tableview: if so, how go doing it? i've looked around , can't find on issue.

php - htaccess redirect to dynamic subpages -

i trying use redirect same page query string. rewriterule ^fixtures(.*)$ views/fixtures.php rewriterule ^fixtures/(.*).([a-za-z_-]*) views/fixtures.php?date=$1 when click links page, nothing happens. in chrome debugger cancels request. any idea doing wrong? cheers it great see working example looking @ rewrite rules seems there might small issue regex. the issue can see first line expects like: example.com/fixtures*absolutelyanythingeleseontheurl* but think being overidden next line capturing 2 sections of url, after fixtures/ , after fullpoint a-za-z , _ or - . initial .* has taken care of that. rewriterule ^fixtures/(.*).([a-za-z_-]*) views/fixtures.php?date=$1 have tried this: rewriterule ^fixtures$ views/fixtures.php rewriterule ^fixtures/(.*) views/fixtures.php?date=$1 the above following: example.com/fixtures/ resolve views/fixtures.php , next line resolve following: e.g. example.com/fixtures/22-06-2014 views/fixtures.php?date=22-06-2

c# - Custom Colorful QR Code generation by embedding Logo -

i developing web based application using asp.net need generate colorful qr codes embedding client's logo inside qr code. need similar following link: http://mashable.com/2011/07/23/creative-qr-codes/ can please suggest free libraries .net can use? this functionality implemented using library shared @ https://qrcodenet.codeplex.com

core data - Predicate subquery for products associated by tag -

i have datamodel in core data such: store <--->> product <<--->> tag i'm looking create query matches products based on associated tags. typical use scenario choose search storea , output storeb. selecting storea list of storea products presented. let's pick producta list brings second viewcontroller. second viewcontroller lists relating productb's (because earlier set storeb output). i'm following this: predicate subquery return items matching tags want added store filter of products. subquery way go? how include filter selected store?

add banner is not loding second time using mopub sdk for android (4.0.4 ICS) -

i using mopub sdk advertise in 1 of application ,i have tested in other version 4.1 , 4.2 working fine android 4.0.4 (ics device: micro max canvas ) add load when application first time launch . after second time not working. have checked api call add hit server , response (html )also coming @ device side not displaying on device . found in 4.0.4 how resolve compatability issue..... this device specific issue(it may issue in micro max custom build os version above version works) .after ics , 4.1 5.0 supports not show issue on other devices.

html - Confirming password using JavaScript -

i need in making webpage. when user types password, want statement 'the password not same' in part. don't understand wrong code. <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title> login page </title> </head> <body> <form action="login_2.php" method="post"> <input type="hidden" name="action" value="login"> <input type="hidden" name="hide" value=""> <table class='center'> <tr><td>login id:</td><td><input type="text" name="id"></td></tr> <tr><td>password:</td><td><input type="password" name="password"></td></tr><br> <tr><td>confirm_password: </td><td

python - Filtering a list of dictionaries -

i have list of identical dictionaries list_dict = [{'id': 1}, {'id': 2}, {'id': 3}] now want filter particular dictionary value of id id = 2 i do list_filtered = [ dict dict in list_dict if dict['id'] == 2] above solution works if have long list inefficient iterate on whole list , check if id matches. other workarounds? make generator expression , 1 match @ time, this matcher = (d d in list_dict if d['id'] == 2) print next(matcher, none) when call next on same generator object, resume loop left, last time. print next(matcher, none) the second argument next default value return if generator expression exhausted.

debian - My custom cape's devicetree fails to load at boot, but can be loaded manually -

if load own device-tree overlay shell loads fine, if try load @ boot, won't so. missing? it debian beaglebone black set using bone-debian-7.4-2014-04-23-2gb.img.xz linux beaglebone 3.8.13-bone47 #1 smp fri apr 11 01:36:09 utc 2014 armv7l gnu/linux here change made /boot/uboot/uenv.txt : optargs=capemgr.enable_partno=bb-foo-gpio this output of dmesg | grep bone-capemgr : baseboard: 'a335bnlt,00a5,4049bbbk7400' compatible-baseboard=ti,beaglebone-black slot #0: no cape found slot #1: no cape found slot #2: no cape found slot #3: no cape found slot #4: specific override bone: using override eeprom data @ slot 4 slot #4: 'bone-lt-emmc-2g,00a0,texas instrument,bb-bone-emmc-2g' slot #5: specific override bone: using override eeprom data @ slot 5 slot #5: 'bone-black-hdmi,00a0,texas instrument,bb-bonelt-hdmi' slot #6: specific override bone: using override eeprom data @ slot 6 slot #6: 'bone-black-

proxy - WSO2 SECURITY USERNAMETOKEN ESB AND DSS -

proxyi'm trying build web service using esb wso2. service use dataservice data database need connect esb dss. when proxy , dataservice aren't securice work ok, when securice follow error <soapenv:fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <faultcode>wsse:invalidsecurity</faultcode> <faultstring>nonce value : 8/bkmsfns2gtj58fxyv43q==, seen before user name : usuarioprueba1. possibly replay attack.</faultstring> <detail/> </soapenv:fault> securizing dataservice not proxy work ok. send usernametoken , password created in user , roles esb , dss one possible scenario error is, if using header mediator send custom soap security header. for example, created proxy in [1], , may notice have put following element in soap message security header. <wsse:nonce encodingtype="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-

php - Close session without writing or destroying it -

is there way close php session without either writing or destroying it? missing or there 2 functions ( session_write_close() , session_destroy() ) reset session_status() php_session_none ? in other words, if have open session, can close without affecting external session data, can reloaded again. you can $_session = null . session unavailable data remains (does not deleted). consider have data in session: <?php session_start(); session_regenerate_id(); // fresh id echo session_id(); $_session['test'] = '12345'; print_r($_session); // echoes data in session data: test|s:5:"12345"; then in next request: <?php session_start(); echo session_id() . "<br>"; // echoes same id of last request $_session = null; print_r($_session); // echoes nothing echo "<br>"; echo session_status(); // echoes 2 (php_session_active) data still same: test|s:5:"12345"; ( php-fpm 5.4.29, recent nginx,

java - How to use values of build.properties in another property file using selenium webdriver -

i using eclipse selenium webdriver. have assigned url variable 'webdriver.url' in build.properties file. have created property file called 'expectedresults.properties'. want use value of variable webdriver.url of build.properties in expectedresults.properties file. possible use. if possible can please tell how be? thanks in advance. not clear whats objective is. 2 cases possible here - 1.assuming have url in 'webdriver.url' variable. can write second property file ('expectedresults.properties') properties prop = new properties(); outputstream output = null; try { output = new fileoutputstream("expectedresults.properties"); prop.setproperty("expected.url", webdriver.url); prop.store(output, null); } catch (ioexception io) { io.printstacktrace(); } 2 can read both property files & compare urls - properties prop = new properties(); inputstream input = null; try { input = new fileinputstream(&

java - Searching Linked lists of an Array and removing a link -

i have array of linked lists, , use 2 loops search through each linked list on array. tips on how remove item when have found it? public userapp(int max){ a= new user[max]; nelems=0; } int maxsize=100; userapp arr; arr= new userapp(maxsize); arr.insert("evans", "patty", 24); // insert 10 items arr.insert("smith", "doc", 59); arr.insert("smith", "lorraine", 37); arr.insert("smith", "paul", 37); arr.insert("yee", "tom", 43); arr.insert("hash", "doc", 21); arr.insert("stimson", "john", 29); arr.insert("evans", "jose", 72); arr.insert("yang", "doc", 22); arr.insert("creswell", "lucinda", 18); linkedlist[] mylist = new linkedlist[3]; mylist[0] = new linkedlist(); mylist[0].add(a[1]); mylist[0].add(a[2]); mylist[0].add(a[3]); mylist[1] = new linkedlist(); mylist[1].add(a[4]);

Developer guide for Google Chrome extension development on Android -

recently google chrome extensions on web store started appearing - 'available android' link redirects extension in play store. unlike firefox on android, there no tutorial on how develop , publish, chrome extensions on android. know 2 things. is tutorial google chrome extension development in android. do need upload extension in both google web store , play store ? or how publish extension such available android in play store. 1) there still no way make extensions chrome android ; links go native android apps associated extension. 2) according canonical answer , linking android app , chrome web store item done automatically in waves matching apps, , cannot influence process.

How to implement PhantomJS with Selenium WebDriver using java -

i'm going mad, really. have code: public class creazione extends testcase { private phantomjsdriver driver; private string baseurl; private boolean acceptnextalert = true; private stringbuffer verificationerrors = new stringbuffer(); @before public void setup() throws exception { file file = new file("c:/program files/phantomjs-1.9.7-windows/phantomjs.exe"); system.setproperty("phantomjs.binary.path", file.getabsolutepath()); driver = new phantomjsdriver(); baseurl = "http://www.gts.fiorentina.test/"; driver.manage().timeouts().implicitlywait(30, timeunit.seconds); driver.get(baseurl + "/account/login.aspx?returnurl=%2f"); finddynamicelement(by.id("tbusername_i"), 2000); driver.findelement(by.id("tbusername_i")).clear(); driver.findelement(by.id("tbusername_i")).sendkeys("rogai"); driver.findel

javascript - Accessing Java class from html web app -

i have dynamic web project. in src folder have java class couple of methods. let suppose index.html file have 2 buttons.on click of button how can call java class. there possibility of doing so? please suggest me in advance regards avinash create servlet handle get/post requests, invoke java code , return result. http://docs.oracle.com/cd/e19857-01/819-6518/abxbh/index.html http://www.oracle.com/technetwork/java/servlet-142430.html

sql server - In sql, How to get the highest unique primary key record, out of multiple foreign key of same ID records -

in project have stored procedure. alter procedure [dbo].[usp_selectallaspirantdetails] begin select distinct a.[aid] ,a.[name] ,a.[gender] ,a.[contactno] ,a.[emailid] ,a.[skillset] ,a.[experience] ,a.[companyname] ,aq.[qualification] ,aq.[institutename] ,aq.[yearofpass] ,aq.[percentage] ,max(aq.id) [aspirant] full join aspirantqualification aq on a.aid=aq.aid group a.aid,a.[name],a.[gender],a.[contactno],a.[emailid],a.[skillset],a. [experience],a.[companyname] ,aq.[qualification],aq.[institutename] , aq.[yearofpass],aq.[percentage] order a.aid desc in aspirant aid primary key , aspirantqualification foreign key. want last entered record aspirantqualification, if have entered 10th,inter, degree qualifications entered. want degree record of aid display in gridview. write as: create procedure [dbo].[usp_selectallaspirantdetails] begin ;with cte ( select aid

python - Implementing dynamic dropdown menu in django -

i want create dynamic drop-down menu car details so created 4 models models.py class companymake(models.model): company_name = models.charfield(max_length = 100) def __unicode__(self): return self.company_name class makemodel(models.model): company = models.foreignkey(companymake) model_name = models.charfield(max_length = 100) def __unicode__(self): return self.model_name class modelparts(models.model): company = models.foreignkey(companymake) model = models.foreignkey(makemodel) part_name = models.charfield(max_length = 100) def __unicode__(self): return self.part_name class modelyear(models.model): company = models.foreignkey(companymake) model = models.foreignkey(makemodel) year_value = models.integerfield() class userprofile(models.model): user = models.onetoonefield(user,primary_key=true) #image = models.imagefield(upload_to=get_photo_storage_path, null = true, blank=true) part = m

Is wordpress intefering with my PHP script? -

to isolate problem i'm having, have script receives post data, counts 50 time delay, , logs results file. i'm testing chrome restful client . when had wordpress installed on hosting, finding mysterious request causing script startup minute processing meant reason wouldn't response original post request. after deleted wordpress, instead of logging mysterious request instead following error around same time, minute runtime. still means don't response post request after script finishes (see php after error): status 500 internal server error show explanation loading time: 45612 request headers user-agent: mozilla/5.0 (windows nt 6.1) applewebkit/537.36 (khtml, gecko) chrome/35.0.1916.114 safari/537.36 origin: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo content-type: application/x-www-form-urlencoded accept: */* accept-encoding: gzip,deflate,sdch accept-language: en-gb,en-us;q=0.8,en;q=0.6 response headers date: tue, 10 jun 2014 10:54:36 gmt server: apa

jquery - display json response from ajax call in html table -

i below json response ajax call: {"items":[{"name":"mp 201spf_1c","productno":"123","commerceitemqty":1,"price":"$350.00","leaseornot":"false"},{"name":"mp 201spf_1c","productno":"456","commerceitemqty":4,"price":"$1,400.00","leaseornot":"false"},{"name":"mp 201spf_1c","productno":"789","commerceitemqty":4,"price":"$1,400.00","leaseornot":"true"}]} here code: $.getjson(ajaxresponse, function (data) { var tr; (var = 0; < data.length; i++) { tr = $('<tr/>'); tr.append("<td><h3>" + data[i].name + "</h3>""<p><strong>" + data[i].productno + "</strong></p>""<div>

php - Canceling all above operations, something like transaction "rollback", but not only database operations -

something databases transactions rollback function, work above operations, not database. example: first query database send service first other server second query database send service second other server if (some condition) { here need cancel above operations. if use database transaction `rollback` function, database changes canceled. there possible, cancel service sending (or may other, not database) operations also? } is there possible cancel previous operation in php?

c# - Unity, injecting instances to controller gives seemingly unrelated exception -

this want able (passing interface(s) controllers): public class testcontroller : controller { // get: test [httpget] public actionresult index(itestservice service) { var test = new testmodel(); test.greeting = "yo" + service.getstring(); test.name = "nils"; return view(test); } } this have put in global.asax.cs in application_start() try make work: // create new unity dependency injection container var unity = new unitycontainer(); unity.registertype<itestservice,testservice>(); // finally, override default dependency resolver unity dependencyresolver.setresolver(new ioccontainer(unity)); i have also, can see, created ioccontainer class looks follows: public class ioccontainer : idependencyresolver { private readonly iunitycontainer _container; public ioccontainer(iunitycontainer container) { _container = container; } pub

mysql select from table a where condition x and subselect -

i want count amount of registries in table specific amount of time determined @ table b. i looking proper way of this: select count(*) total table_a a.created >= '0000-00-00 00:00:00' , a.created <= (select table_b.end table_b.id = 13) basically, table_b consists of 3 columns: int primary key named 'id', datetime named 'start', , other datetime named 'end'. way have identified weeks of current year. just in case need that, proper way that: select count(*) total table_a a.created >= '0000-00-00 00:00:00' , a.created <= (select table_b.`end` table_b table_b.`id`=13)

wordpress theming - How to detect on which site am I? -

i using wordpress "multisite" different languages on site, , want know how can know on site i. can check page it, site, little bit tricky. have made site eng, , site fr, , couple more. so far have tried check url : stripos($_server['request_uri'],'/eng/') is there different way this? use get_current_blog_id() : http://codex.wordpress.org/function_reference/get_current_blog_id e.g. $blog_id = get_current_blog_id(); i'd like: if ( 1 === $blog_id ) { echo 'this eng site.'; } if there multiple language options test you'd better switch: switch ( $blog_id ) { case 1: echo 'this eng site.'; break; }

CrossWalk / Cordova build in INTEL XDK gives parsing error on older android OS releases -

i'm wanting crosswalk build intel xdk. builds fine , runs great on android phones, i'm using 4.2. when had users try it, of using 2.3.6 android releases have "parsing error" when tried install it. according forum crosswalk asked question answer was: crosswalk supports android 2.3.6 through current versions - if have problem on earlier version due bug in software. have scoured code & can't find error. the same code app runs using cordova build options on versions, it's crosswalk faster. does have thoughts on possible types of "coding errors" cause -- if going on? don't errors via chrome js debugger or jslint. thanks ;)

tcp - Kryonet server send raw byte array -

simple question, possible send raw byte array packet kryonet? client doesn't use kryonet , read bytes thanks kryonet based on simple tcp communication via nio along build-in kryo serialization. kryonet without kryo serialization tcp client/server, nothing more. or if want simple solution, can create wrapper entity having 1 attribute in form of byte[] , use customer serializer serialize byte[]. it's fastest way proof of concept etc.

powerpoint vba - Add an image to userForm with click event using vba -

Image
i created userform make possible create survey. looks @ beginning: clicking cross next "add answer" can add more rows can seen in other image: the problem have have add small arrows next checkboxes in new rows. move answers , down if user need change position of them. have add code move them. the creation of elements need in each row done in following way: private sub addanswer_click() image5.top = image5.top + 21 checkbox1.top = checkbox1.top + 21 checkbox2.top = checkbox2.top + 21 image7.height = image7.height + 21 image3.top = image3.top + 21 label1.top = label1.top + 21 label4.top = label4.top + 21 image2.top = image2.top + 21 tablet.top = tablet.top + 21 chart.top = chart.top + 21 label8.top = label8.top + 21 label9.top = label9.top + 21 labelorizontal.top = labelorizontal.top + 21 labelvertical.top = labelvertical.top + 21 labelnet.top = labelnet.top + 21 labelround.top = labelround.top + 21 labelpoints.top = labelpoints.top + 21 orizontal.top = orizonta