Posts

Showing posts from July, 2010

ios - Invalid Segment Alignment -

i'm trying load .ipa file (on mac using application loader). after few minutes error message error itms -9000 : "invalid segment alignment". .ipa file created flash builder 4.6, flex sdk version 4.6 (build 23201) air version 15. face isuus ? there post on that: https://forums.adobe.com/thread/1628933 basically still need wait new air sdk released correct problems. lot has happened on ios , more happen release of x64, let's see if adobe keeps up.

asp.net mvc - Can MVC work with cshtml ending routes? -

i want route .cshtml ending urls particular controller , action. mvc pipeline blocks such urls , returns 404: the type of page have requested not served because has been explicitly forbidden. however if routeexistingfiles set true routing starts working static files routed , since not process these requests 404 returned images, css , js files. (actually don't want requests static content go through mvc pipeline.) setting <add key="webpages:enabled" value="true" /> changes error type 'asp._page_views_cshtml' not inherit 'system.web.webpages.webpage'. and routing still not work.

android - When copy files on SDcard and manually eject SDcard after copy is complete last files have size of 0bytes -

in app make file encryption , i'm crypting file in reserve copy first , when process done replace original encrypted copy. use case when data on sdcard encrypting , user manually ejects sdcard data should in save state. have noticed such thing when file on sdcard replaced encrypted copy (process finished) , eject sdcard after when mount sdcard see last file processes have size of 0bytes. main thing see in log before ejection file copy complete , file had size sholud have(1,8mb example). in other apps such native file manager of samsung - files app, copy file on sdcard , after copy complete eject sdcard , size of file 0bytes. can explain nature of behavior? thank you

simd - Can multiple processes hide latency of SSE instructions? -

i'm in need of high-performance merging , came accross: efficient implementation of sorting on multi-core simd cpu architecture jatin chhugani et al. their aim performance out of 1 cpu, 1 part of solution use bitonic sorting network on simd level. hide latency of min/max , shuffle operations perform 4 sorting networks simultaneously (though think meant interleaved.). gives claimed 3.25x increase of performance. my problem relaxed, have multiple pairs of arrays need processed (read independent) can run multiple processes , gain higher throughput. though if oversubscribe amount of processes available cores, hide latency well? induced on higher level? or treading here in realm of hyperthreading , i'll never pass limit of 2 processes sharing same functional units in cpu-core? i of course try, changing existing code rather involved , i'd hear theories first. no, threading not effective solution pipeline bubbles. granularity doesn't fit: context switchin

android - Move listview item left and right by clicking on it -

Image
i want implement moving of listview item right or left clicking on have use code listv swiplistview have listview below, list item have 2 view left view (contain 1 textview ) , right view (contain 2 button) now when tap on row left view move left side , right view display, (row move left side) below now if again click on row right view move @ right side , textview display (row moves @ right) changes have done in ? or add animation in listview item click ?? in swiplistview.java change case motionevent.action_up: case motionevent.action_cancel: log("============action_up"); clearpressedstate(); if (misshown) { hiddenright(mpreitemview); } to case motionevent.action_up: showright(mcurrentitemview); case motionevent.action_cancel: log("============action_up"); clearpressedstate(); if (misshown) {

javascript - How to check whether the entered mobile is landline or mobile using PhoneFormat.js? -

this example form. have take 1 text box, enter mobile number , choose country drop-box menu, validating mobile number country have used http://www.phoneformat.com/ . here have given 1 method isvalidnumber(phno, country) validate phone number country (both landline number , mobile number). my requirement need allow mobile number, have used getnumbertype(phno) , not giving results, can me how check whether entered number landline or mobile number? <form name="fm" method="post"> <input type="text" name="phno" id="phno"> <br> <select id="ultra"> <option value="0">select</option> <option value="in">india</option> <option value="au">australia</option> <option value="cn">china</option> <option value="us"> america </option> </select><br><br> <i

sql - Query in java code is returning null values but its working fine on ODBC query tool -

with select field2 table1 in odbc query tool list of required values, same query java code list of "null" values. select field2 table1 field2 not null didn't help. field2 - varchar(255) part of code: connection conn = drivermanager.getconnection("jdbc:odbc:test"); statement statement = connection.createstatement(); resultset resultset = statement.exequtequery("select field2 table1"); while (resultset.next) system.out.println(resultset.getstring(1)); hm, solution of problem: while (rs.next()) { system.out.println(ioutils.tostring(rs.getcharacterstream("field2"))); } p.s. ioutils - class apache commons io p.s.s. .getbytes() - return me 255 symbols (there more symbols, used reader)

Vimeo force CC language -

trying embed vimeo video website , have put 5 different languages cc of video on vimeo. don't want user have change language in cc drop down in vimeo embed, assign in html/javascript (using geolocation select base language) can change cc language accordingly once video has started playing. we don't have yet, plan on offering way embed parameter , through javascript api in future.

material design - How to use paper-dialog polymer element? -

i using element adding opening , closing tags <paper-dialog><p>this it</p></paper-dialog> not getting shown up. need add script on top of should triggered on event? or there way make visible ? the dialog autohidden. toggle button. example, give dialog id="dialog" , make button on-tap="toggledialog" , be toggledialog: function() { this.$.dialog.toggle(); },

javascript - inserting variable into html page with innerhtml on page load -

i have inherited html page displays stats sales team. have inserted cut down version of here <html> <head> <title>test</title> </head> <body> <br> <div class="separator" style="clear: both; text-align: center;"></div><br> <div> <table border="2" cellpadding="10" cellspacing="0" style= "background-color: white; border-collapse: collapse; text-align: center; width: 900px;"> <tbody> <tr style= "background-color: #f7941e; color: white; padding-bottom: 4px; padding-top: 5px;"> <th> <div style="text-align: center;"> <span style= "font-family: verdana, sans-serif; font-size: small;">total accounts</span> </div> </th> </tr> <tr>

How to show in php only current weekday.After passing of current week only then next weekdays show -

i have code.that showing 5 business days(that correct). want current weekdays passed. after passing of current week next weekdays shows <?php for($i=0;$i<=4;$i++): ?> <label ><?php echo date('d-m-y', strtotime("+$i weekday")); ?></label> <label ><?php echo date('l',strtotime("+$i weekday")); ?></label><br> <?php endfor; ?> its output is: 19-nov-2014 wednesday 20-nov-2014 thursday 21-nov-2014 friday 24-nov-2014 monday 25-nov-2014 tuesday this showing next week days. want this: 17-nov-2014 monday 18-nov-2014 tuesday 19-nov-2014 wednesday 20-nov-2014 thursday 21-nov-2014 friday try this: $monday_this_week = date("y-m-d",strtotime('monday week')); <?php for($i=0;$i<=4;$i++): ?> <?php $date = date('d-m-y', strtotime("+$i days", strtotime($monday_this_week))); ?> <label ><

UML Use case for vending machine -

i new uml , need identifying actors , use cases simple scenario. have model vending machine. can't decide on set of actors , use cases , appreciate help. way model have customer actor, switchboard actor , vending machine. customer's use cases insert coins, select product, cancel order, collect change. switchboard use cases set timer (the user has time select product, after process canceled). finally, vending machine use cases find product, check money balance, dispense, return change. thank in advance :) from vending machine point of view, usecase sell item (or sell product). because of usecase model defines use full services provided modeled system in collaboration actors (actor external system). actions insert coin, find product etc. steps of procedure, define behavior of vending machine within sell item usecase execution. means, usecase model simple. usecase "sell item" connected actor "customer". switchboard part of vending machine , involve

php - Null exception in httprequest -

i trying values form mysql(xampp) database not working database name meeting_planner , table name participant try { httppost httppost; httpclient httpclient; httpclient = new defaulthttpclient(); httppost = new httppost( "http://10.10.10.159/my_folder_inside_htdocs/getdata.php"); system.out.println("after url"); responsehandler<string> responsehandler = new basicresponsehandler(); system.out.println("after response handler"); final string response = httpclient.execute(httppost, responsehandler); system.out.println("the response "+response); log.e("pass 1", "connection success "); } catch (exception e) { e.printstacktrace(); } getdata.php code here <?

visual studio 2010 - VS2010 linking of static library behave differently in separate solutions -

lets have solution s1 2 projects pdep , pmaster , respectively creating static , dynamic library. have configurations: release win32 : produces pdep.lib debug win32 : produces pdepd.lib release x64 : produces pdepx64.lib debug x64 : produces pdepx64d.lib pmaster link configuration done configuration properties -> linker -> input -> additional dependencies no #pragma comment(lib ) in code. no common properties references. what observe : in s1 both pdep , pmaster command line linker fine. ie /libpath:"c:\pdep\lib\x64\release" "pdepx64.lib" in solution s2 freshly created clicking on project pmaster, i have additional line absolute path specific version of pdep, regardless of configuration. ie /libpath:"c:\pdep\lib\x64\release" "pdepx64.lib" "c:\pdep\lib\pdepd.lib" how linker in s2 derives additional option "c:\pdep\lib\pdepd.lib" ? how rid of it? multiple possibilities: com

Groovy class to extract json returns null -

i'm in process of adding library of reusable functions. i've added class extract json soap response null in return. script below works fine, issue when add class. import com.eviware.soapui.support.types.stringtostringmap import groovy.json.jsonslurper import groovy.json.* responsecontent = testrunner.testcase.getteststepbyname("teststepname").getpropertyvalue("response"); slurperresponse = new jsonslurper().parsetext(responsecontent); log.info (slurperresponse.items[0].id); //write response property def addresponseid = slurperresponse.items[0].id testrunner.testcase.testsuite.setpropertyvalue("scheduleid", addresponseid) the class: import com.eviware.soapui.support.types.stringtostringmap; import groovy.json.jsonslurper; import groovy.json.*; class getxmlnode { def log def context def testrunner def responsesoaxmlstep def resultvalue def responsenodepath def responsecontent = "mycontent" def slurperresponse = "myresponse&qu

ember.js - Count how many errors with Ember-Validations? -

i display count of validation errors user. it implement message "you have x error(s) left" next submit button. is there way ? edit : i using ember-validations 2.0.0-alpha.1 , ember 1.8.0 in context of controller (without ember data). if try solution of sam: this.get('errors.length') // result [], empty array the errors key holds object, not array. each key of object refers property on model , points array of error messages, can things this.get('errors.firstname.length') . to find total number of errors, you'd have through each of model's properties , sum number of errors each one. http://emberjs.jsbin.com/luzesiyeqi/1/ edit: the .length property of errors object returning empty array because of code: https://github.com/dockyard/ember-validations/blob/master/addon/errors.js . literally key access on errors object initialized empty array. edit 2: based on said in comments not wanting loop through properties

linux - Checking if UDP port is opened already in C -

lang: c how can check if udp socket opened can increment used port , send on next socket, don't have idea how sockets server need. can't use port 0 have start @ specific port. solutions have right either implement own queue trace open ports or try read /proc/net/udp is there defined api? if no, can submit sample code trace opened ports used program? if port in use bind fail. if fails need increment port trying use. save when want use next port. bind returns -1 when fails. btw, using linux? can stablish max , min port number , when port want use reach max, set port equal min (this simplest method). other methods need shared memory or semaphores , locks.

.net - ADFS exception "AddressFilter mismatch at the EndpointDispatcher" -

i have adfs configured , running in internal network on ip 192.168.0.200 console application should able authenticate against adfs instance external network. in order achieve have configured nat rule follows: externaldomain.com:9443 -> 192.168.0.200:443 console app calls adfs way: string relyingpartyid = @"https://localhost:8099/"; string adfsendpoint = @"https://externaldomain.com:9443/adfs/services/trust/13/usernamemixed"; var binding2 = new usernamewstrustbinding(securitymode.transportwithmessagecredential) { clientcredentialtype = httpclientcredentialtype.none }; var trustchannelfactory2 = new wstrustchannelfactory(binding2, new endpointaddress(adfsendpoint)) { trustversion = trustversion.wstrust13 }; var channelcredentials2 = trustchannelfactory2.credentials; channelcredentials2.username.username = @"user"; channelcredentials2.username.pas

ios - How to include C++ library in Xcode -

i migrating android application, uses c++ library ios. c++ library provides main application functionality app. possible include c++ library in xcode project? i know apple llvm compiler can compile c code, possible solution may compile c++ code shared library , provide c wrapper able access c++ code objective-c. similar solution adopted android app , jni. yes, can. there 2 ways of doing this. the easiest way add sources inside ios project. if have sources of library , can add project, make sure have main file (and other objective c files) named .m .mm let xcode compiling c++. if want go static linkage, recommend create static library project , add same workspace objective c main project , declare dependency build target (check build targets / build schemas ... xcode stuff on here :) ). if want provide static library binary , go static linkage there (which don't recommend , no breakpoints , other pain along way) have keep in mind following : you need have s

kernel - Linux module compilation using multiple threads / jobs -

when trying compile linux module using -j2 getting following error: make[1]: warning: jobserver unavailable: using -j1. add `+' parent make rule. what correct way parallel build multiple source files when building linux kernel module ? thanks, itay

How to count the number of attributes of a java class? -

could explain me, how possible count number attributes of java class. need generic way, since classes can have different number of attributes. possible in java? field[] attributes = myclass.class.getdeclaredfields();

OrientDB classes / clusters design -

i design following using classes , clusters looking logical , efficient solution. i, have 3 types of users (very different) designed them classes extends user abstract class. my app based on geoloc. in order give best user experience in matter of response time speed (when performing scans etc..) i'm hesitating between 2 methods : having each usertype many clusters number of countries, select targetting concerned cluster. _______________________ | user (abstract class) | |_______________________| ^ | | ___________________ ___________________ ___________________ | usertype1 (class) | | usertype2 (class) | | usertype3 (class) | |___________________| |___________________| |___________________| | |

Handling User Defined shaders in OpenGL ES 2.0 framework -

i developing frame-based animation framework in opengl es 2.0 develop 3d graphics applications. i have used few pre-defined shaders (for color, texture, alpha....) attributes , uniform known. now want handle user given shaders. loading, compiling , linking these shaders fine. how map attributes , uniforms corresponding data. suppose, in user given shader, vertex data has passed attribute "a_vertex" . in other shader, may "a_myvertex" . name of attribute pass vertex data different different user given shaders. my question how handle mapping of shader attributes , uniforms in user given shaders. please give suggestions this. thanks...

ssh - In which folder placed site on linux hosting? -

given root ssh access linux hosting. i accustomed access site folders /www , other. , there saw /usr /bin /var , many other folders , scared me out. in folder should search site? launched search on directories slow... appreciate help! most of web servers i've worked have files in /var/www.

java - How to use Maven WAR overlay to extend a WAR with another project? -

i'm trying include war in project, extend it, similar question how extend/customize war project . far can tell, answer (use maven war overlays) seems right 1 project. however, can't figure out how can work. i included maven war plugin in pom.xml: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-war-plugin</artifactid> <version>2.3</version> </plugin> and added war dependency (local repository): <dependency> <groupid>nl.surfnet.apis</groupid> <artifactid>apis-authorization-server-war</artifactid> <version>1.3.6-snapshot</version> <type>war</type> </dependency> when compile , deploy application, works fine, parent project deployed is. had include .properties file, isn't included in war, in can plug in own classes override default behaviour of project. now want extend class, add custom behaviour, can'

django 1.8 cant serve img static file -

new problem: django app isnt able show image. using ubuntu, tried chrome , firefox. django 1.8 in local server (so run ./manage.py runserver). i have followed https://docs.djangoproject.com/en/dev/howto/static-files/ quite , read , searched more documentation on google, there isnt 1.8 , problem, last resource. here files: settings.py: ... static_url = '/home/user/escritorio/des/proyect/static/' media_root = '/home/user/escritorio/des/proyect/static/media/' urls.py: from django.conf.urls import include, url, patterns django.contrib import admin django.conf.urls.static import static import settings admin.autodiscover() urlpatterns = patterns('', url(r'^root/', include(admin.site.urls)), url(r'^index$', 'views.index.page',name='index'), ) if settings.debug: urlpatterns += patterns('', url(r'^media/(?p<path>.*)$', 'django.views.static.serve', { 'do

excel - Hiding multiple rows based on cell values -

i have algorithm works fine hide rows where, in specified named range, given row has value 0. it's straightforward enough: public sub masquerlignesazerorapport(rap worksheet) dim cell range rap.rows.hidden = false each cell in rap.range("ra_lignesazero") if round(cell.value, 0) = 0 cell.entirerow.hidden = true end if next cell end sub this, however, takes bit of time when calculation , screen updating turned off , have tried different other methods without success (using filter , hiding visible rows removing filter unhides rows, same goes setting row height 0). is there faster alternative ? can live slow algorithm welcome improvement macro may run against 1-6 reports in single run. here few optimizations: public sub masquerlignesazerorapport(rap worksheet) 'optimization #1: pointed out, turning off calculations ' , screen updating makes difference. application.calculation = xlcalculationmanual appli

javascript - Show a Selection When a Selection Option is Picked -

here's thing: if select: "africa", africa selection shown, rest hidden. "america", america selection shown, rest hidden. "asia", asia selection shown, rest hidden. , on. <select name="continent" id="continent" size="1"> <option value="pick continent">pick continent first.</option> <option value="africa" class="africa">africa</option> <option value="america" class="america">america</option> <option value="asia" class="asia">asia</option> <option value="europe" class="europe">europe</option> <option value="oceania , pacific" class="oceana">oceania , pacific</option> </select> <select name="africa" id="africa" size="1"> <option value="pick sub-region

php - HTML left arrow ("<") not working when creating PDF file -

i have problem fpdf class (very useful imho) i'm using in web page. have html table values, "arrows" chars in fact causing problem, but, left 1 ("<"). when try create pdf file works until finds character, , shows nothing after point. i've tried until this: str_replace("<","&#60;"); or str_replace("<","&lt;"); but nothing working far. know how make working? seems pdf recognize opening html tag , don't know how show char

Detect if mips gcc supports __thread directive -

i trying compile qt mips. toolchain little old ( mips-linux-gcc --version 4.1.0) i guessing doesnt have __thread directive. version of gcc need? there way detect if compiler supports @ compile time, if upgrade toolchain, can seamlessly so my copy of mips-linux-gcc version 4.5.3 supports __thread directive. don't know version first supported it.

angularjs - Prevent change state (page) in ionic -

i've page (app.photo) user upload , view photo. clicking view button call function: $scope.delphoto = function(idphoto,name) { $ionicloading.show({template: 'elimino la foto...', duration:500}); $http.post('http://www.digitalxp.it/public/speedjob/del_img.asp?nome='+name).success(function(data, status, headers){ alert("foto eliminata"); $state.go('app.profilo'); $http({method: 'get', url: 'http://www.digitalxp.it/public/speedjob/upjob.php?nome=amministratore'}).success(function(data){ $scope.photos = data; }).error(function(){ alert("error"); }); }).error(function(){ alert("foto non eliminata!")}); return false } my problem when function success, page change (go automatically app.welcome), add $state.go('app.profilo') cause bad effect (first go app.welcome , app.photo). possible refresh view app.photo???

ios - Is it necessary to use [unowned self] in closures of UIView.animateWithDuration(...)? -

uiview.animatewithduration(1, animations: { [unowned self] in self.box.center = self.boxtoprightposition }, completion: { [unowned self] completed in self.box.hidden = true }) is necessary avoid memory leak? no, not needed in case. animations , completion not retained self there no risk of strong retain cycle.

Divide a string in python using specific substring -

i have txt file information regarding bounding boxes in image. open txt file automatically read information , crop image using coordinates of bounding box. text file has following format: folder\file_0001.jpg 75 165 87 177 106.750000 108.250000 143.750000 108.750000 131.250000 127.250000 106.250000 155.250000 142.750000 155.250000 folder\file_0002.jpg 86 162 93 169 104.750000 110.750000 145.750000 114.250000 126.250000 139.750000 104.250000 155.250000 139.250000 159.750000 the useful bounding boxes coordinates first 4 integer after file name. how can separate values , use cropping images in python? you can use split split string on spaces, slice returned list elements out interested in. with open('text.txt') f: line in f: coords = line.split()[1:5] # use slicing 2nd through 5th elements

algorithm - function to find out how many magic squares are in rectangle made of n*m, where n,m - natural numbers -

Image
need write algorithm how solve exercise, suggestions? exercise: we have rectangle, divided n x m squares, natural numbers. write function counts how many magic squares inside rectangle. a magic square arrangement of k x k (k>=2) numbers , integers, in square grid, numbers in each row, , in each column, , numbers in main , secondary diagonals, add same number. construct 4 arrays: 1: every element element original array + 1 left. 2: every element element original array + 1 top. 3: every element element original array + 1 top left. 4: every element element original array + 1 top right. you array. have check every possible square fitting in array (there possibly better solution, can't think of any) looking in other four. since keep sums in array can see when checking array 3x3 (from top left) sums 15. means it's magic square. when not starting in top left it's little less obvious still easy. @ example below second magic square highlighted.

php - How do I display the user input in checkboxes? -

this php code checkboxes: <b>interests:</b> <input type="checkbox" name="interests" value="interests">nature/wildlife <input type="checkbox" name="interests" value="interests">arts/museum <input type="checkbox" name="interests" value="interests">neighbourhoods how display user input in next page? showing user has ticked. making appear interests: nature/wildlife arts/museum using $_post method showing full code: <head> <link rel="stylesheet" href="styles.css"> <style> #nav { text-align:left; } </style> </head> <body> <div id="header"> <h1> <img src="images/footprints.jpg"> singapore footprints</h1> </div> <div id="nav"> <form action=

python - import csv with different number of columns per row using Pandas -

what best approach importing csv has different number of columns each row using pandas or csv module pandas dataframe. "h","bbb","d","ajxxx dxxxs" "r","1","qh","dtr"," "," ","spxxt rixxls, raxxxd","1" using code: import pandas pd data = pd.read_csv("smallsample.txt",header = none) the following error generated error tokenizing data. c error: expected 4 fields in line 2, saw 8 supplying list of columns names in read_csv() should trick. ex: names=['a', 'b', 'c', 'd', 'e'] https://github.com/pydata/pandas/issues/2981 edit: if don't want supply column names nicholas suggested

database - Better / Other way of selecting data in cassandra -

imagine example table of products id | price | properties | description ---------------------------------------------------------------------------|--------------- 1 | 22.9 | color=red, weigth=10, width=100 | mountainbike 2 | 56.3 | shape=rectangle, weight=12, opaque=true | small toolbox 3 | 67 | shape=rectangle, weight=15, opaque=false, height=9, width=120 | big toolbox the column "properties" cassandra collection type "map" okay, first: why not using properties own columns? cause not specified properties items have, part ist dynamic. what want know is, there performant way of selecting specified item properties? like select price products properties.color = red , properties.weigth=10 , properties.width=100 i want match 1 product grants properties requested. so following situation shouldnt possible id | price | properties

c# - Preserve user folder location on browse for image? -

i using ajax file upload, , trying make when user browses image, next time go browse image end in same folder. in other words, if pick image foldera, next time go pick image start in foldera. not sure if implement on server side or on client side, or both. <div class="upload-photos-add" id="q0012_00" runat="server"> <asp:ajaxfileupload enableviewstate="false" id="ajaxfileupload2" contextkeys="0012.00" runat="server" allowedfiletypes="jpg,jpeg,png" onuploadcomplete="ajaxfileupload_uploadcomplete" onclientuploadcomplete="onclientuploadcomplete" onclientuploadcompleteall="onclientuploadcompleteall" onclientuploadstart="onclientuploadstart"></asp:ajaxfileupload> </div> i think should set default path in web.config below: <appsettings> <add key="uploadpath" value="../uploadfiles/"/> </app

Magento magmi No decimal Attributes created for sku error -

when importing grouped products using magmi 7.20 getting error every grouped product says "no decimal attributes created sku" does know causing error? this "normal" warning "grouped" products since have no price (being aggregate of other products have price) , magmi expects products have price. a fix done remove unnecessary warning.

java - Spring REST Service with IOC? -

in past did simple soap services using spring , ioc (application-context.xml state controller has 2 different daos etc. , spring sets them me) now trying rest service using spring. my controller looks this @restcontroller @requestmapping("/") public class mycontroller { private mydao1 mydao1; private mydao2 mydao2; @requestmapping("/name") public mytest getgreeting() { mytest tst = new mytest(1, "hallo "); return tst; } public void setmydao1(mydao1 mydao1) { this.mydao1 = mydao1; } public void setmydao2(mydao2 mydao2) { this.mydao2 = mydao2; } my rest-servlet.xml contains this: <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:p=&quo

javascript - Load another web page on click of a CSS box. CSS or js? -

i've got several css boxes on 1 of google sites pages wrap around js slider. i'm wanting link page on site through click on box rather clicking on text within box. i've done bit of research , haven't had luck. it's doable in css, javascript. i've tried switching around tag outside breaks slider. i've got snippet of code below: style (css) .box1 { background: ##ffd700; border-radius: 6px; cursor: pointer; height: 100px; line-height: 100px; text-align: center; transition-property: background; transition-duration: 1s; transition-timing-function: linear; width: 100px; position: relative; left: 0px; top: 0px; z-index:2; } .box1:hover { background: #990033; } html <div class="box1"><a href="https://www.google.co.uk" target = "_self"><font color = #ffffff>google</font></a></div> i've created jsfiddle here: http://jsfiddle.net

python - pygtk delete all the images in Table -

i have table images this: def __init__(self): ... self.tableau_img = gtk.table(rows=3, columns=6, homogeneous=false) self.box.add(self.tableau_img) ligne = 0 colonne = 0 in range(1,20): # place 20 images in 6 colums, 3 rows self.image = gtk.image() self.image.set_from_file("file.jpg") if != 1 , != 9 , != 17: ligne = ligne + 1 if == 7: colonne = 1 ligne = 0 if == 14: colonne = 2 ligne = 0 self.tableau_img.attach(self.image, ligne, ligne+1, colonne, colonne+1, xpadding=0, ypadding=5) i replace images in "def", need delete images before: def delete_img(self, x, y): ligne = 0 colonne = 0 in range(1,20): if != 1 , != 9 , != 17: ligne = ligne + 1 if == 7: colonne = 1 ligne = 0 if == 14: colonne = 2 ligne = 0 #self.tableau_img.remove(self.ima

ios - Using a String in another View Controller -

i have label in mainviewcontroller swift app i'm developing. part of mainviewcontroller determine user's location , display on screen. now, if user decides use location (instead of typing in own if looking city) want display title of next viewcontroller after press button. i'm not sure how accomplish this. i've tried declare var labeltext: string assigned string representing user's location global variable, compile error mainviewcontroller not initialized, , not build. can me out here? thanks! the best way pass string mainviewcontroller next viewcontroller (which i'm going refer nextviewcontroller). in nextviewcontroller, declare property called pagetitle: var pagetitle: string? i assuming there segue mainviewcontroller nextviewcontroller. in mainviewcontroller's prepareforsegue, pass string so: var viewc: nextviewcontroller = segue.destinationviewcontroller nextviewcontroller viewc.pagetitle = "title" then in nextviewco

ios - Enabling and disabling multiple buttons in view issue -

i have view 12 buttons. want able perform action's button once when tap , set specific button disabled. when tap on button want same thing happen + set other buttons enabled. there solution? you can give each button tag, , when tap on button using method viewwithtag can enable , disable each button: when create uibutton , can add: uibutton *button0 = ... button0.tag = 0; uibutton *button1 = ... button1.tag = 1; //and on in every action of buttons, must pass id object this: -(void)tapbuttonone:(id)sender { //with sender can retrive tag of button clicked uibutton *button = sender; int buttontag = button.tag //now can check every button , enable other haven't same buttontag //with first tag = 0 plus 12 last tag 11 i<12 (int = 0; i<12; i++) { //self.view if have added buttons on self.view, otherwise must write view uibutton *buttontemp = (uibutton *)[self.view viewwithtag:i]; if(buttontemp.tag != buttontag) {

django filtering querysets causes 'AppRegistryNotReady: Models aren't loaded yet.' with forms within models.py -

during development of our current django-project (django 1.7.1) reach task mark database-entries deleted , remove them user's sight not db. a fast straightforward solution found django-logicaldelete (exactly want do!) following instruction django-logicaldelete installed logicaldelete pip , added installed_app settings.py only thing left add logicaldelete in models.py , admin.py inherit it ... import logicaldelete class mymodel(logicaldelete.models.model){...} ... ... import logicaldelete class mymodeladmin(logicaldelete.admin.modeladmin){...} ... so far :) trying run project causes 'appregistrynotready: models aren't loaded yet.' - error: traceback (most recent call last): file "c:\python34\lib\site-packages\django\db\models\options.py", line 414, in get_field_by_name return self._name_map[name] attributeerror: 'options' object has no attribute '_name_map' during handling of above exception, excep

security - How to disable Network in Windows Server 2008 -

i have virtual machine on vmware workstation windows server 2008 r2. there not admin users. have have internet access theirs work (for example, use svn, maven , on). @ same time, have close access network them. have tried: i've tried turn off network discovery in network , sharing center . disables network via gui(explorer), users still can access other devices \\some_machine_pc . more that, users (which not admins) can change option in control panel. i've tried edit registry, adding such configuration: [hkey_current_user\software\microsoft\windows\currentversion\policies\network] "noentirenetwork "=dword:00000001 [hkey_current_user\software\microsoft\windows\currentversion\policies\explorer] "nonethood"=dword:00000001 but have not changed @ all. i've tried change network adapter config in wmware host-only: private network shared host. turns off internet. so, there other variants? you can create subnet vm, , don't rout

c# - Use Generic class with SqlDataReader GetValue -

i have code works ok database no null values public t getfield<t>(sqldatareader dr, string fieldname) { return (t)dr.getvalue(dr.getordinal(fieldname)); } then want control dbnull values, because exist in tables , upgraded function this: public t getfield<t>(sqldatareader dr, string fieldname) t : new() { var value = dr.getvalue(dr.getordinal(fieldname)); return value dbnull ? new t() : (t)value; } but now, cannot ask getfield<string> because string has no constructor 0 parameters. i have tried create function abstract one, no restrictions , string type this public string getfield<string>(sqldatareader dr, string fieldname) { var value = dr.getvalue(dr.getordinal(fieldname)); return value dbnull ? "" : value.tostring(); } but answer ambiguous definitions, because t includes string, restriction applied. i create independent functions each datatype, rather prefer abstract solution because way cleaner. did

c++ - Accessing protected members of derived class with CRTP -

i'm using crtp, , have problem accessing protected members of derived class. here example, close code: template< typename self> class { public: void foo( ) { self s; s._method( s); //error, because _method protected } protected: virtual void _method( const self & b) = 0; }; class b : public a< b> { protected: void _method( const b & b) {} }; i understood, must use friend keyword. can't understand put in class a< self> . know make void _method( const b &b) public in b , don't want it. using keywords in b impossible me either! i found solution. answers. need change line: s._method( s); //error, because _method protected to ( ( a< self> &) s)._method( s); and works! http://ideone.com/cjclqz

vb.net - Populating a textbox, if another textbox is populated -

i've got 2 textboxes in form. according title, when write in 1 textbox (a random one), need @ same time, in other textbox text (given in code) appears. 1 letter 1 letter 1)example random text: 1 textbox ) how you? 2 textbox) let's c 2)example random text: 1 textbox ) aim of project? 2 textbox) let's chill out mome thanks much you need determine responses questions. however, tackle letter letter problem. use substring method , length of current text. dim response string = "hello world!" private sub text(byval..) handles textbox1.changed textbox2.text = response.substring(0, textbox1.text.length) end sub as text changes in textbox typing in, output response corresponding length of text input. since event textbox.changed, each character entered update second textbox

pdf generation - Generate flattened PDF with Python -

when print pdf of source pdfs, file size drops , removes text boxes presents in form. in short, flattens file. behavior want achieve. the following code create pdf using pdf source (the 1 want flatten), writes text boxes form well. can pdf without text boxes, flatten it? adobe when print pdf pdf. my other code looks minus things: import os import stringio pypdf import pdffilewriter, pdffilereader reportlab.pdfgen import canvas reportlab.lib.pagesizes import letter directory = os.path.join(os.getcwd(), "source") # dir interested in fif = [f f in os.listdir(directory) if f[-3:] == 'pdf'] # pdfs in fif: packet = stringio.stringio() can = canvas.canvas(packet, pagesize=letter) can.rotate(-90) can.save() packet.seek(0) new_pdf = pdffilereader(packet) fname = os.path.join('source', i) existing_pdf = pdffilereader(file(fname, "rb")) output = pdffilewriter() nump = existing_pdf.getnumpages() page = e

jsonschema - Dredd (gavel) : Begin a Json Schema with an array (bug ?) -

i using markdown generate documentation (aglio), generate mocks (api-mock) , check integrity constraints (dredd). with dredd, no problem check object, no problem put or post, have problem lists. my lists arrays, when write schema : { "title": "videos list", "type": "array", "items": { "type":"object", "required":false, "properties": { "id": { "type": "string", "required": true } }, "required": true } } i same error time: body: json schema not valid! invalid type: object (expected [object object]/array) @ path "/items" i've tried, again , again, 3 hours, failed. please help! ps : sorry english, i'm french.

c++ - Why make a parameter const if you're going to do const_cast? -

there linked list example trying append node. part of code: void append(listelement<t> const* ptr, t const& datum) { listelement<t>* temp = const_cast<listelement<t>*>(ptr); // ... } what point in making ptr pointer const if you're going cast away? ptr isn't used anywhere in function, temp , wouldn't better make pointer non -const people know object might modified? is there reason make parameter const , const_cast 'ing away in body instead of making non-const? what point in making ptr pointer const if you're going cast away? none. it breaks function contract , example of getting lost in code design. to illustrate, this a: hey, can read object, read. b: okay, give me it, i'm going read it. b: writes on it