Posts

Showing posts from September, 2013

javascript - Use css for only one URL -

can target css class 1 url on wordpress site? .class {pointer-events:auto;} .class a[href="url"]{pointer-events: none;} this isn't working, there way? can javascript? i need disable add cart button page sample part (something shouldn't added cart). the other unique attribute data-product_id="32570" is there way target data-product_id="32570" in css? you can use css , target unique attribute think best way target this .class a[data-product_id="32570"] { ... } more documentation , uses here https://developer.mozilla.org/en-us/docs/web/css/attribute_selectors

java - ListSelectionListener null pointer error -

i'm trying specific color specific category display on south jpanel nullpointerexeception error. doing wrong? //this arrays holding category names , colors. try checking if selected index in list greater -1. //this arrays holding category names , colors. string[] cati = {"ingen", "matställen", "skolor", "kyrkor", "kollektiv trafik"}; color[] colors = {color.white, color.blue, color.green, color.yellow, color.pink}; // inner class in super class. class kategorifärg implements listselectionlistener { public void valuechanged(listselectionevent event) { if (kategorlista.getselectedindex() > -1) { system.out.println("does work?"); syd.setbackground(colors[kategorilista.getselectedindex()]); //syd south jpanel } } } -1 means no item in list selected. if error occurs on if statement, kategorlista null , needs initialized. sample code, p

ruby - Beginner array iteration & error code interpretation -

i kept getting following error. after research assumed because array access throwing error due (mistakenly) having nil value. my_solution.rb:24:in `count_between': undefined method `>=' nil:nilclass (nomethoderror) my_solution.rb:35:in `<main>' i'm new reading error codes, perhaps that's went wrong. got tunnel vision on line 24 , error suggested. couldn't fix it, out of desperation wound randomly changing (<=) on line 23 (<). fixed it. why did fix it? guess using (<=) made iterate "too far" , somehow returned nil? why did error code element on line 24 causing issue, when element on line 23? i'm new , trying less intimated error codes, curious experience. thanks guidance. # count_between method 3 arguments: # 1. array of integers # 2. integer lower bound # 3. integer upper bound # # returns number of integers in array between lower , upper # bounds, # including (potentially) bounds. # # if +

bash - Shell reading IP addresses from file -

i have long file feb 2 18:43:05 os sshd[14786]: [id 800047 auth.info] connection closed 2001:778:200:4280::37 feb 2 18:46:08 os sshd[14788]: [id 800047 auth.info] connection closed 158.129.0.37 feb 2 18:48:05 os sshd[14790]: [id 800047 auth.info] connection closed 2001:778:200:4280::37 feb 2 18:48:29 os sshd[14791]: [id 800047 auth.info] did not receive identification string 61.240.144.64 feb 2 19:46:08 os sshd[14853]: [id 800047 auth.info] connection closed 158.129.0.37 feb 2 19:48:05 os sshd[14855]: [id 800047 auth.info] connection closed 2001:778:200:4280::37 feb 2 20:21:42 os sshd[14892]: [id 800047 auth.info] accepted keyboard-interactive evakaz 2001:778:200:4001:e076:812f:23e7:7e62 port 47889 ssh2 feb 2 21:20:19 os sshd[14960]: [id 800047 auth.info] received disconnect 2001:778:200:4280::38: 11: disconnected user feb 2 21:21:08 os sshd[14963]: [id 800047 auth.info] connection closed 158.129.0.37 feb 2 22:31:01 os sshd[15100]: [id 800047 auth.info] received disconn

user interface - Basic Python methods & GUI assistance -

i'm new programming , green if comes python itself. started learning few days ago , need understanding , making code simpler. i'm working on simple gui, i've created. works fine i'm wondering how mix tkinter button widgets methods dont have create different 1 every time create new widget. should include variable values quite hard me understand , that's why i've come here help. ;d here i'm posting shortened version, original includes 10 buttons can imagine how crappy looks import tkinter tk def __init__(master): frame = frame(master) frame.pack() def toggle_text(): if button["text"] == "wl": button["text"] = "wyl" label["bg"] = "green" else: button["text"] = "wl" label["bg"] = "red" def toggle_text1(): if button1["text"] == "wl": button1["text"] = "wy

Perl Script Writes Labels on Several Lines -

so code this print "<div id=\"form\">\n"; print "<form name=\"confirm\" method=post action=\"\">\n"; print"<label for=\"name\">name:</label>\n"; print "<input type=\"text\" name=\"name\" class='forminput' id='name' value=\"$name\">\n"; print"<label for=\"amount\">£:</label>\n"; print "<input type=\"text\" name=\"amount\" class='forminput' id='amount' value=\"$amount\">\n"; print"<label for=\"comment\">comment:</label>\n"; print "<input type=\"text\" name=\"comment\" class='forminput' id='comment' value=\"$comment\">\n"; print "</form>\n"; the output follows name: [textbox] £: [textbox] comment: [textbox] is possibl

javascript - jQuery how to check if uploaded file is an image without checking extensions? -

newbie here. problem have written method checks uploaded file size , extension in order validate it. however, checking extensions not solution kind of validation may cause lot of problems. want check actual file type , validate without using extension method. have tried use jquery file validator no avail... snippet current code: <input type='file' id='imageloader' name='imageloader' accept="image/*" data-type='image' /> script: app.dispatcher.on("uploadpic", function() { $(":file").change(function() { if (this.files && this.files[0] && this.files[0].name.match(/\.(jpg|jpeg|png|gif)$/) ) { if(this.files[0].size>1048576) { alert('file size larger 1mb!'); } else { var reader = new filereader(); reader.onload = imageisloaded; reade

php - How to save encrypted data using Yii2 ActiveRecord and ActiveForm -

i have web application allowing users log in (s)ftp servers . s(ftp) servers credential data stored mysql database. passwords encrypted using php mcrypt function , rijndael_256 algorithm. i know possible password field in edit server form empty , password updated in database when new password written user in activeform field. here serverscontroller.php file: public function actionadd() { $addftpconnectionform = new addftpconnectionform(); if ($addftpconnectionform->load(yii::$app->request->post())) { if ($addftpconnectionform->addconnection(yii::$app->user->identity->member_id)) { yii::$app->session->setflash('alert-success', 'ftp сървърът беше успешно добавен.'); } else { yii::$app->session->setflash('alert-danger', 'Възникна грешка при добавянето на ftp сървъра.'); } $this->redirect(url::toroute('servers/list')); } return $

c# - Bearer token Authorization -

i having problem identity server 3 , bearer token authentication. basically, can call web api methods expired access token , web api authenticates user , returns data. i have set client have access token lifetime of 360 seconds , indeed case when check claim. how go ensuring web api cannot called expired access token. need set in identityserverbearertokenauthenticationoptions ? thanks. when request comes in first thing check if identity authenticated , authentication type "bearer". private static bool requestisauthenticated(httpactioncontext actioncontext) { return (actioncontext.requestcontext.principal.identity.authenticationtype == "bearer" && actioncontext.requestcontext.principal.identity.isauthenticated); } if returns false return httpstatuscode.unauthorized.

java - LEAK: ByteBuf.release() was not called in before it's garbage-collected. Spring Reactor TcpServer -

i using reactor-core [1.1.0.release] , reactor-net [1.1.0.release] using netty-all [4.0.18.final], reactor-spring-context [1.1.0.release] & spring reactor tcpserver [spring 4.0.3.release]. i have created simple rest api in netty health check: /health . have followed gs-reactor-thumbnailer code please see code follows: import io.netty.handler.codec.http.defaultfullhttpresponse; import io.netty.handler.codec.http.fullhttprequest; import io.netty.handler.codec.http.fullhttpresponse; import io.netty.handler.codec.http.httpheaders; import io.netty.handler.codec.http.httpmethod; import io.netty.handler.codec.http.httpresponsestatus; import io.netty.handler.codec.http.httpversion; import org.springframework.stereotype.service; import reactor.function.consumer; import reactor.net.netchannel; @service public class healthchecknettyrestapi{ public consumer<fullhttprequest> getresponse(netchannel<fullhttprequest, fullhttpresponse> channel,int portnumber){

How to check that multiple values are not equal in VBA? -

i want print list of 8 numbers worksheet, if unique. an ideal code along lines of if <> b <> c rather than if <> b , <> c , b <> c is possible, given values called array using code following: cells(2, 8) = numarr(i) cells(2, 9) = numarr(j) cells(2, 10) = numarr(k) cells(2, 11) = numarr(l) cells(3, 8) = numarr(m) cells(3, 9) = numarr(n) cells(3, 10) = numarr(o) cells(3, 11) = numarr(p) thanks! the quick , dirty way dictionary, requires unique key. keep dumping numbers in array until hit 1 that's in dictionary. make function , pass array it: private function allunique(incoming variant) boolean if not isarray(incoming) err.raise 13 dim candidates scripting.dictionary set candidates = new scripting.dictionary dim index long index = lbound(incoming) ubound(incoming) if candidates.exists(incoming(index)) exit function candidates.add incoming(index), index next index allunique = tr

SQL Server : want a column to be nullable only for existing and newly created rows -

is possible make column can null beginning, once has been set non-null value can never reset null ? i'm guessing might possible update constraint using both inserted , deleted table, seems complicated given goal of task. bonus question: since doesn't seem easy this, sign of bad design (on part of / sql server )? since you're allowing filed null when row inserted, you'll have use trigger update create trigger trigger1 on table1 update begin set nocount on declare @field1 varcahr(max) select @field1 = field1 inserted if @field1 null begin raiserror('a null values not allowed', 15, 1) rollback end end

Why is lambda expression necessary in this example? (Python) -

i'm learning little bit of tkinter in python, creating interactive windows. window i'm making 1 that, given dict of contacts , respective contact info, creates button each contact which, when pressed, displays contact info. the 2 sample contacts have named 'marvin' , 'minsky', , info stored in dict named book : import tkinter tkinter # 'phonebook' contact info 2 people. book = {"marvin": {"mobile": "1234567890", "email": "marvin@gmail.com"}, "minsky": {"mobile": "9087865342", "email": "minsky@yahoo.com"}} window = tkinter.tk() # make window object def showinfo(name): # displays info person button clicked # displays info configuring labels named 'mobile' , 'email', # using values in 'book' mobile.configure(text = book[name]["mobile"]) email.configure(text = book[name]["email"]) here&

java - Trying to test Enum's method -

im trying manually test enum rotation method next() it's returning me nothing, null. when assign variable tester = rotation.cw0 , call method next(), method should return cw90 returning nothing. please smb take i've done wrong in code? public class tester { public static void main(string[] args) { rotation tester = rotation.cw0; tester.next(); } } public enum rotation { cw0, cw90, cw180, cw270; // calling rot.next() return next enumeration element // representing next 90 degree clock-wise rotation after rot. public rotation next() { if(this == cw0) return cw90; else if(this == cw90) return cw180; else if(this == cw180) return cw270; else if(this == cw270) return cw0; return null; } public class tester { public static void main(string[] args) { rotation tester = rotation.cw0; system.out.println(tester.

Android Google+ Sign-in orientation handling -

i'm trying implement google+ sign-in on app i'm struggling handling orientation change while showing choose account popup. if user changes orientation of device, choose account popup appearing in duplicate. have same issue? or doing wrong? have followed this steps , if no rotation made, works fine , i'm able perform login. thanks in advance!

Rails 4 Eager load limit subquery -

is there way avoid n+1 problem when eager loading , applying limit subquery? want avoid lots of sql queries this: category.all.each |category| category.posts.limit(10) end but want 10 posts per category, standard eager loading, gets posts, not suffice: category.includes(:posts).all what best way solve problem? n+1 way limit amount of posts per category? from rails docs if eager load association specified :limit option, ignored, returning associated objects so given following model definition class category < activerecord::base has_many :posts has_many :included_posts, -> { limit 10 }, class_name: "post" end calling category.find(1).included_posts work expected , apply limit of 10 in query. however, if try category.includes(:included_posts).all limit option ignored. can see why case if @ sql generated eager load category.includes(:posts).all category load (0.2ms) select "categories".* "categories" post loa

javascript - Google Maps API v3 binding events to multiple maps -

i've got page 2 google maps on, using v3 api. have 1 pin each, same lat & long set each pin, although 1 of maps have other pins added @ later date (when can work!) maps generated looping through object, further maps can added if needed. what trying bind bounds_changed event once both maps, run map.setzoom() after map.fitbounds() has been run. event, however, binds last map set up, not reset zoom on first map. link jsfiddle replicating issue: http://jsfiddle.net/pkhb8mvz/7/ (for more clear example of event being bound to, change event listen on click rather bounds_changed try clicking on first map , watch zoom level change on second map) any appreciated! the problem map variable being redefined on each iteration of loop, time event listener callback runs operate on second google.maps.map object. simplest solution capture value of map variable on each iteration using closure, so: (function (map) { var listener = new google.maps.event.addlistener

angularjs - $$phase does not seem to update back to null -

i working on enterprise angular application, ruby pageobject testing. problem running $interval have kicks off $digest leading random failures. trying write javscript command page object can execute see if $digest running. came following... angular.element("#application").injector().get('$rootscope').$$phase this seems work, however, wanted create plunker demonstrate issue, however, plunker doesn't change $digest. when add following.... $timeout(function() { console.log("phase "+$scope.$root.$$phase); }) i see become null, how can show in ui? afaik can show $root.$$phase value on ui, shown $digest only, never shown null . because angular run digest cycle each 50ms update data-bindings, need @ databinding in angularjs .

ios - Converting NSIndexPath to NSInteger in Swift -

i have uitableview segue connects view controller. when user taps on cell, indexpath.row passed view controller can update content in view based on cell has been tapped. i aware of different methods of doing this, use nsuserdefaults() particular use. problem don't know how convert indexpath.row integer saved nsuserdefaults() . have tried: func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { println(indexpath.row) nsuserdefaults.standarduserdefaults().setobject(nsinteger(indexpath.row), forkey: "index") self.performseguewithidentifier("event", sender: self) } second view controller: override func viewdidappear(animated: bool) { println(nsuserdefaults.standarduserdefaults().integerforkey("event")) } at moment, when try print out indexpath.row in next view controller, returns 0. you aren't using same key nsuserdefaults.standarduserdefaults().setobject(nsinteger(indexpat

java api - Extract polygon geometry from citygml data using citygml4j library -

i have buildings' information stored in citygml file. trying extract building's polygon geometry using citygml4j library. have looked @ featurewalker class, unable polygon geometry. how go doing this? here code: citygmlcontext ctx = new citygmlcontext(); citygmlbuilder builder = ctx.createcitygmlbuilder(); citygmlinputfactory in = builder.createcitygmlinputfactory(); citygmlreader reader = in.createcitygmlreader(new file("/home/vishal/nww/sampledata/lod2_building_v100.gml")); while(reader.hasnext()) { citygml citygml = reader.nextfeature(); system.out.println("found class:" + citygml.getcitygmlclass() + "\nversion"+citygml.getcitygmlmodule().getversion()); //counting no of buildings citymodel citymodel = new citymodel(); if(citygml.getcitygmlclass() == citygmlclass.city_model) { citymodel = (citymodel)citygml; // counting no of buildings

phpunit - How do I load the file I need? PHP -

while might basic question, 1 assume use require_once , more complicated - @ least me. the issue having have project structure package structure in java. how ever use global name space. project structure looks like: projectname/ moduleone/ class.php composer.json tests/ phpunit.xml bootstrap.php class_test.php in above example class.php instantiated such: projectname\moduleone\class(); now issue how set our tests directory, because class_test.php use class.php , other classes 1 depends on, need way allow me instantiate in test, class in question. when ever attempt error saying cant find class in question trying instantiate. while might unusual way of doing things, project such each module can exported out using composer , auto loaded project using namespace have chosen, in case projectname . the issue seem having need each class outside tests/ directory auto loaded , ready go, such if class.php extends other class when class.php cal

java - Weblogic JMS URL to connect from Camel -

i using weblogic server: 12.1.1.0, spring 3.2.11.release , camel 2.13.4. i have following configuration: <bean id="jnditemplate" class="org.springframework.jndi.jnditemplate"> <property name="environment"> <props> <prop key="java.naming.factory.initial">weblogic.jndi.wlinitialcontextfactory</prop> <prop key="java.naming.provider.url">t3://localhost:7001</prop> <prop key="java.naming.security.principal">username</prop> <prop key="java.naming.security.credentials">the_password</prop> </props> </property> </bean> but message after deployment: 22-apr-2015 18.29.39 org.springframework.jms.listener.defaultmessagelistenercontainer refreshconnectionuntilsuccessful grave: not refresh jms connection destination 'cameltest' - retrying in 5000 ms. cause: j

Unable to run android application on emulator -

Image
hi have gradle android project import in android studio. when build application, gives me 'build successful'. when click on run , gives me edit configuration window instead of window need choose emulator. can tell me how run app? emulator working fine. notice on left of run button, choose app in drop down list , has android logo along it. logo has red cross on it. please see image below. glad if can advise how proceed. thanks

amazon web services - AWS Mobile Analytics Enviornment -

i'm implementing aws mobile analytics on app 2 environments, beta , production. it's working auto export configuration s3 + redshift have doubt environment data split. should have mobile analytics configuration auto export redshift? or should have 1 redshift , 2 apps (beta , production) sending data same redshift? in second case detect app data coming package name unique. thanks in advance! not quite sure of question asking, if trying filter events in redshift based on app, can filter based on application_app_id. go console , select app id you'd see events (let's call 'xxxxxxxxxxxx', in redshift cluster query: select * awsma.v_event application_app_id = 'xxxxxxxxxxxx'

c++ - console windows tapping into pc's USB recources -

is possible tap usb drivers / resources windows console app (win32 c++)? i detect connected hardware, send , receive midi usb keyboard. don't want build complete gui app small needs test own hardware on perf board. main purpose test software written pic microcontroller, it's faster debugging, rather compiling , running chip zif socket tot zif socket. i need directions, thank you. this possible. midi keyboards, check midiin... functions

linux - Why does this shell script not run? -

i'm trying run script echo "buscando instancias del servidor corriendo actualmente...." processid=$(ps -fea | grep jboss | grep -v grep | awk '{print $2}' | xargs) host=$(/sbin/ifconfig eth0 | grep -eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1) echo "$processid" echo "$host" if [ -z "$processid"] echo "hay instancias corriendo del servidor con id proceso: $processid" else echo "no hay instancias del servidor corriendo actualmente" fi but error: syntax error near unexpected token fi try adding space before closing brackt in if statement so: echo "buscando instancias del servidor corriendo actualmente...." processid=$(ps -fea | grep jboss | grep -v grep | awk '{print $2}' | xargs) host=$(/sbin/ifconfig eth0 | grep -eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1) echo "$processid" echo "$host" if [

swift - Non Standart UITabBarItem Action -

Image
i have uitabbarcontroller view so on every tabbar have viewcontroller. on center uitabbaritem need call modal uiviewcontroller. , should my uitabbarcontroller class like class planettabbarcontroller: uitabbarcontroller { override func viewdidload() { super.viewdidload() self.tabbar.tintcolor = ktintcolor var items = self.tabbar.items as! [uitabbaritem] let centredtabbar:uitabbaritem = items[2] self.tabbar.layer.borderwidth = 0.50 centredtabbar.image = ktabcentredbarimage self.tabbar.layer.bordercolor = uicolor.clearcolor().cgcolor self.tabbar.layer.borderwidth = 0 self.tabbar.shadowimage = uiimage() // self.tabbar.backgroundimage = ktabbarimage self.tabbar.backgroundimage?.imagewithalignmentrectinsets print( uidevice.currentdevice().modelname) if( uidevice.currentdevice().modelname != "iphone 6" && uidevice.currentdevice().modelname != "iphone

database - MS Access 2007 login form -

i working database in access, , creating login form restrict data password: anyone has password can access database if wrong password entered no database access granted after 3 unsuccessful logins, automatically close database. i tried code , don't know why doesn't work. part of code this: private sub btn_login_click() username.setfocus if username = "admin" , password = "test" msgbox "password correct", vbinformation, "cd shop" msgbox "welcome", vbinformation, "cdshop" docmd.close docmd.openform "switchboard" elseif username = "menager" , password = "menager" msgbox "password correct", vbinformation, "cd shop" msgbox "password correct", vbinformation, "cd shop" msgbox "welcome", vbinformation, "cd shop" docmd.close docmd.openform "swi

c++ - Qt 5.0 QScreen solidfill function -

i have fill screen solid color. looks in qt 4.8 version supported using following function. void qscreen::solidfill ( const qcolor & color, const qregion & region ) [virtual] now in qt5 see function deprecated in qscreen class. tried this: qscreen *screen = qguiapplication::primaryscreen(); qpixmap qpix = screen->grabwindow(0, 0, 0, desktop()->width(), desktop()->height()); qpix.fill(qt::black); i tried using qsplashscreen , works. looks overlay screen drawing on screen. is there straight replacement this? perhaps close blit? thanks in advance.

php - Check/Validate and reuse CodeIgniter session -

i have website website 20 api calls (rest). every call user/pass input required. the api calls can made c++, python, php, java, asp etc... the issue have creates tons of sessions. want change allow calls re-use session id assigned. so first call "authenticate", return token (encrypted session id) then decrypt token , check if session id exists in database. if does, want load or assign session i found pge ellislab explaining session not me since page creates new session. example: call #1: authenticate(user,password) call #2: get_report(token, 1) // report id 1 call #3: add_user(token, [array of user data]) how can reuse session in codeigniter? you need save token in session if not exist. 1) token form request username think user name unique you. 2) $this->load->library('session'); $user_data = $this->session->userdata('$username'); if(!empty($user_data)){ //use same session }else{ $this->session->set_user

pycharm code autocomplete does not work for python console with ipython -

Image
autocomplete works in edit window, not work in python console, has ipython environment. however, when run ipython in terminal window, ipython comes , autocomplete works. i using pycharm community version 4.0.6 under windows. suggest autocomplete key binding ctrl-space, however, found in edit window, tab works autocompleting. i had similar problem, namely wanted run different default environment in python console. settings, can change interpreter used python console. (see picture). should able set there right environment. make sure have installed ipython package in interpreter of choosing, ipython automatically become default interpreter of console . last can set/unset use of ipython settings...

Using PHP "prev" and "next" to Move Through an Array -

i have 2 "buttons" move array cursor next record or prior record. function using " next " move next (older) record works correctly. however, function move prior (" prev ") record (which toward top of array) not work correctly. suspect may related using " mysqli_data_seek ". belief set cursor current location , backtrack previous record. instead cursor continues moves forward if " next " used instead of " prev ". how can backtrack prior record? function return_next_issue() { // newer issue - moves towards top of array. // mysqli_data_seek($_session['result'], 0); while($row=mysqli_fetch_array($_session['result'], mysql_num)) { if($_session['issuenum'] == $row[0]) { break; } } prev($_session['result']);

python - How to create a histogram of 2D arrays in ipython -

i have use random number generator create 1000*1000 2d arrays. how can create histogram of 2d arrays? s1=np.random.rand(1000,1000) install , use matplotlib . code this: import matplotlib.pyplot plt s1=np.random.rand(1000,1000) plt.hist(s1) matplotlib gives ton of useful options, can read more them here .

c# - Disable Row Selection in Telerik Rad Grid View -

actually problem have created stack panel in grid view cell template when click on first item of stack panel white highlight appear @ top of cell .i want remove it there solution ? in advance here code <telerikcontrols:gridviewdatacolumn> <telerikcontrols:gridviewdatacolumn.celltemplate> <datatemplate> <stackpanel orientation="vertical" margin="0,0,0,5" height="auto"> <itimcontrols:label text="qty/value" name="lblqty" width="90" verticalalignment="bottom" margin="0,0,0,0" ></itimcontrols:label> <itimcontrols:textbox width="80" value="{binding qty,mode=twoway}" verticalalignment="top" margin="0,3,0,0" ></itimcontrols:textbox> </stackpanel> </datatemplate> </telerikcontrols:gridviewdatacolumn.celltemplate> </telerikcontrols:gridviewdata

android - How to store and large text data from SQLite database? -

i working on android project. tutorials app in providing 100 chapters. not getting how store these chapters in app's local database , how fetch on button click. want provide facility on button click next activity must opened , contents of chapters must loaded on activity. example. if click on button "chapter 1" 1st chapter must loaded sqlite database. have followed lots of tutorials not satisfied. please me. thank you!!! :) you have 2 choices: text type - sqlite support very long text source: http://www.sqlite.org/faq.html#q9 sqlite happy store 500-million character string there blob type: if don't want use text, can use blob instead ( need convert large text byte array when inserting/updating , convert byte array large text when loading db) for database design. can this: - book table ( _id, name, ...) - chapter table (_id, content (text,blob), book_id, chapter_number, ...);

java - How to set the consumer-tag value in spring-amqp -

i trying update consumer-tag more informative randomly generated string. have pattern use includes hostname + identifier + randomized string. works fine in our other services (ie: nodejs ampqlib ) because provide mechanism pass in value. however, our java services, use spring-amqp , looks there no way pass in consumer-tag value. took @ blockingqueueconsumer , hard-coded empty string: string consumertag = this.channel.basicconsume(queue, this.acknowledgemode.isautoack(), "", false, this.exclusive, this.consumerargs, this.consumer); is there way not empty string (which result in randomly generated one) besides creating our own type of consumer? thanks! you correct; it's not configurable; please open improvement jira , we'll take @ adding it. shouldn't take effort.

java - Error:(31, 39) error: cannot find symbol variable context -

this question has answer here: what “cannot find symbol” compilation error mean? 6 answers i integrating parse existing android application. said, following documentation, have managed create compile error of following: error:(31, 39) error: cannot find symbol variable context the code creates error below. import android.content.intent; import android.os.bundle; import android.provider.syncstatecontract; import android.support.v7.app.actionbaractivity; import android.util.log; import android.view.view; import android.widget.textview; import com.facebook.request; import com.facebook.response; import com.facebook.session; import com.facebook.sessionstate; import com.facebook.uilifecyclehelper; import com.facebook.model.graphuser; import com.parse.parse; import com.parse.parsefacebookutils; public class mainactivity extends actionbaractivity { // create, aut

PHP MySQL count events per location per user -

i'm trying build query using data 4 tables: bookings, users, events, locations bookings : +---------------------------------+ |book_id | event_id | person_id | +---------------------------------+ |1 | 1 | 2 | |2 | 2 | 1 | |3 | 2 | 2 | |4 | 1 | 3 | |5 | 3 | 1 | |6 | 3 | 2 | +---------------------------------+ users : +----------------------+ | user_id | name | +----------------------+ | 1 | joe | | 2 | jack | | 3 | jane | +----------------------+ events : +------------------------+ | event_id | location_id | +------------------------+ | 1 | 1 | | 2 | 3 | | 3 | 1 | +------------------------+ locations : +---------------------------+ | location_id | name | +---------------------------+ | 1 | lombard | | 2

ionic framework - How to print a specific item's title after clicking on their link -

hey wondering if me out in how can print specific item's title after clicking on link. code default menu start: in mainpage have: <ion-view view-title="main"> <ion-content> <ion-list> <ion-item ng-repeat="page in sidepages" href="#/abstractmain/mainpage/{{page.id}}"> {{page.title}} </ion-item> </ion-list> </ion-content> </ion-view> each item linked page view: <ion-view view-title="page"> <ion-content> <!-- display {{page.title}} --> <h1>hello</h1> </ion-content> </ion-view> and controller sidepages is: .controller('pagectrl', function($scope){ $scope.sidepages = [ { title: 'name 1', id: 1 }, { title: 'name 2', id: 2 }, { title: 'name 3', id: 3 }, { title: 'name 4', id: 4 }, { title: '

ajax - XHR Requests only start when tab is focused on IOS 7 Safari -

following use case: user clicks button on tab 1 app opens popup tab 2 (about:blank) severeal xmlhttprequest occur between app on tab1 , server app uses info create form post request tab1 target=tab2 ( action origin, eg. paypal) tab 2 loads form response etc this works pretty anywhere. on ios safari 7 seems not. on ios safari 7, popup opens stays on about:blank , because xmlhttprequest doesn't start because tab1 @ point no longer focused (the browser shows tab2). if user switches tab1, execution resumes , works. (but that's not intuitive). i cannot create xmlhttprequest before opening popup, because popup has created direct consequence of user action or end in popup blocker. therefore flow "user click starts request, request callback opens popup" not work. is there way around limitation other restructuring whole app (eg. loading http requests popup)?

soap - Advantage of PHP SoapClient classmap -

can tell me advantage of using classmap option within php soapclient? maybe practical examples? the classmap option can used map wsdl types php classes. example, class myloginresult { protected $serverurl; protected $sessionid; public function getserverurl() { return $this->serverurl; } public function getsessionid() { return $this->sessionid; } public function getserverinstance() { $match = preg_match( '/https:\/\/(?<instance>[^-]+)\.example\.com/', $this->serverurl, $matches ); return $matches['instance']; } } $client = new soapclient("books.wsdl", array('classmap' => array('loginresult' => "myloginresult"))); $loginresult = $client->getloginresult(); $instance = $loginresult->getserverinstance();

c++ - How to get Filename without extension in Unreal? -

i've been using below code filename , it's works fine me. file name without extension(.uasset). const fstring filename = fpaths::getcleanfilename(filepath); thanks in advance help. you can use fpaths::split that: fpaths::split(filename,path,filenamewithoutextension,extension);

menu - CMFCToolbar and CMFCMenubar displaying wrong tooltips -

question asked on https://social.msdn.microsoft.com/forums/vstudio/en-us/f64c99e5-f490-454f-951f-aee794e9506b/cmfctoolbar-and-cmfcmenubar-displaying-wrong-tooltips i using visual studio 2010, suspect bug still present on 2013 version, compared winfrm.cpp file , ontooltiptext equal on 2 files. the bug happening @ 7th, 8th or 16th element. although separators count elements counting, tooltips not appear on them. element can textual menuitem, popup menu or toolbar button. the string table defines are: #define ids_seven 7 #define ids_eight 8 #define ids_nine 9 #define ids_ten 10 #define ids_eleven 11 #define ids_twelve 12 #define ids_thirteen 13 #define ids_fourteen 14 #define ids_fifteen 15 #define ids_sixteen 16 and stringtable contents are: ids_seven "seven" ids_eight "eight" ids_nine "nine" ids_ten &quo

css - Can the contents of a table cell overflow vertically? -

Image
a table cell may have content overflows, explained in in fixed table layout : any cell has content overflows uses 'overflow' property determine whether clip overflow content. but can overflow vertical? table height algorithms says in css 2.1, height of cell box minimum height required content. so if understand correctly, shouldn't possible. can make happen on firefox: table { height: 0; border: 5px solid blue; } td { width: 100px; height: 100%; border: 5px solid red; } div { height: 100%; border: 1px solid; background-color: yellow; } <table> <tr> <td> <div>foo</div> <div>bar</div> </td> </tr> </table> am misunderstanding spec, or bug? §17.5.3 table height algorithms says css 2.1 not define how height of table cells , table rows calculated when height specified using percentage values. and shows

Performance issue on IBM RFT in chrome -

i using ibm rft scripts automation testing. facing 1 performance issue in chrome. while doing playback in google chrome taking 4 min per each click. new this. can 1 please me. it's been quite time question asked, rft 8.6.0.6 , chrome 46 , above, problem should not seen.

html - align inner div to center -

Image
i have 2 div, inner div & outer div. how align inner div center? here source code: <div class="menu"> <a href="adminhomepage.php?id=logout">manage staff</a> </div> here css: .menu{ margin: 100px auto; z-index: 2; opacity: 0.9; text-shadow: 2px 2px 5px #000000; width:300px; border-style: solid; border-width: 1px; } .menu a{ color: #fff; font-size: 35px; border-style: solid; border-width: 1px; } the outer div on center, inner 1 align left. how align center? add text-align: center; parent divs css .menu{ margin: 100px auto; z-index: 2; opacity: 0.9; text-shadow: 2px 2px 5px #000000; width:300px; border-style: solid; border-width: 1px; text-align: center; } .menu a{ color: #fff; font-size: 35px; border-style: solid; border-width: 1px; } <div class="menu"> <a href="adminhom

bash - Validate an IP before using scp -

i'm writing file transfer script , gets pretty complex. in beginning when generate ip address transfer from, want validate can indeed connect it. code in area looks this: user_id=$1 if [[ $group == "a" ]]; address="${user_id}@morgan.company.gov" elif [[ $group == "b" ]]; address="${user_id}@mendel.company.gov" else log_msg fatal "couldn't resolve group $group. exiting" exit 1; fi // here want test $address exists, , can connect right // have below. think there better way ssh -q $address exit if [ $? != 0 ]; log_msg fatal "couldn't resolve host, have login privileges $address" fi ... // lots of other things happen scp $address:$incoming_file $new_file what have works, doesn't seem elegant solution. i'd prefer not ssh , exit server, test connection. you can use shell function tests wether host has ssh port open or not: #!/bin/bash function isup(){ local ip=$

Clang-format breaks Objective-C string literals despite high penalty setting -

i prevent clang-format automatically breaking string literals in objective-c code. inside .clang-format file, have set penalty high number: penaltybreakstring: 2147483647 calling clang-format -i folder/**/*.m still breaks strings: old: #define dispo_no_data_easyscott nslocalizedstringwithdefaultvalue(@"dispo_no_data_easyscott", nil, [nsbundle mainbundle], @"bislang hast du noch keine dispo für diesen drehtag hochgeladen.\nbitte logge dich dafür online auf my.easyscott.com ein und lade die dispo im bereich „import / export“ hoch", @"anzeige in der dispo, wenn eine serververbindung besteht, jedoch auf dem server kein dokument hinterlegt ist (für easyscott). \n erzeugt einen zeilenumbruch"); new: #define dispo_no_data_easyscott \ nslocalizedstringwithdefaultvalue(@"dispo_no_data_easyscott", nil, [nsbundle mainbundle], \ @&

javascript - Either issues with code, or issues with server with a angular.js routing issue -

i trying learn angular.js , incorporate routes within app. problem running have hit snag creating routes. have 2 similar pages, , keep hitting 404's when fire app in local host. feel close because being read, , have no errors within console, still have yet entire routes operate. grateful if take quick @ code below , see if there need alter fix. i believe because of circumstances have 1 of 2 situations. either have issue code, or have issue server side routing. if code, hoping see if there issues , me out it. if problem server side routing, them have no idea do. below app.js file. feel if there have made mistake with, one, i'm not entirely sure. var app = angular.module('myapp', ['ngroute']); app.config(function ($routeprovider) { $routeprovider .when('/index/', { controller: 'maincontroller', templateurl: 'views/home.html' }) .when('/test/', { controller: 'testcontroller&#