Posts

Showing posts from April, 2011

uiimageview - Asynchronous images loading again and again in the Uitableview cells -

having trouble asynchronous images don't know why having weird problem. applying asynchronous images load technique images not freezing once loaded on scrolling again loading. - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath{ static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell=[self getcellcontentview:cellidentifier]; } [cell setbackgroundcolor:[uicolor redcolor]]; nslog(@"%i",[discussionarray count]); nsdictionary *dict=[discussionarray objectatindex:indexpath.row]; uilabel *textlabel1 = (uilabel *)[cell viewwithtag:1]; uilabel *textlabel2 = (uilabel *)[cell viewwithtag:2]; uilabel *textlabel3 = (uilabel *)[cell viewwithtag:3]; uiimageview *avatarimage = (uiimageview *)[cell viewwithtag:4]; uiimageview *new_oldimage = (uiimageview *)[cell vieww

compiler errors - Java Lang nullpointer exception in animation example? -

import java.awt.*; import javax.swing.imageicon; import javax.swing.jframe; public class images extends jframe { public static void main(string[] args) { displaymode dm = new displaymode(800,600,32, displaymode.refresh_rate_unknown); images = new images(); i.run(dm); } private screen s; private image bg; private image pic; private boolean nloaded; animation a; public void run(displaymode dm) { nloaded = false; s = new screen(); try{ s.setfullscreen(dm, this); loadpics(); movieloop(); try{ thread.sleep(50000); }catch(exception ex){} }finally{ s.restorescreen(); } } public void movieloop(){ long startingtime = system.currenttimemillis(); long cumtime = startingtime; while(cumtime-startingtime < 5000) { long timepassed = system.currenttimemillis() -

ember.js - Ember-data transactions and resubmitting forms -

Image
i'm using ember(+data) , have built simple signup form, i'm having trouble getting form (and ember-data transaction) work after server-side validation error. i'm following https://github.com/dgeb/ember_data_example guide how use transactions, , works happy path, after server-side validation error, can't ember-data resubmit api request when click submit. i did digging around, , think i'm missing step related resetting transaction after model becomes invalid or that... github , app you can try app , reproduce problem @ http://emb.herokuapp.com/ you can examine full source code @ https://github.com/justinfaulkner/ember-data-resubmit repro you can trigger fake server-side error completing form in app using e-mail address @ @example.com . rails api respond 422 , errors object keyed username/email field. the field should highlighted in red error -- edit email address should valid, , click submit again. developer tools open in chrome, don't see

matlab - Removing outliers from a grey-scale image -

Image
question i have images sequence representing depth information i'd clean. there outliers (values intensity below 25, 0-255 range) filled acceptable alternative (an average value localised specific area guess). can see simple way this? i've tried use median filter (filter size of 10) substituting undesired values nan, did worsen situation, improves instead substituting them general average value. p.s. has suggested me use fast wavelet reconstruction , not know start... implemented solution (so far) the solution implemented (before reading inpaint_nans suggested tmpearce ) is: duplicate original image; filling invalid pixels general average value; use circular disk of ray 10 blurring it; replacing invalid values in original image got point 3. run median filter of size 10. img2 = img; img2(img < .005) = mean(img(:)); h = fspecial('disk',10); img3 = imfilter(img2

c# - What data type should an MVC model class use to back/represent a database column of type Image? -

in playing along "programming razor," i've run conundrum. if have table these columns: id int title nvarchar body ntext photo image ...how should corresponding mvc model class declared? have: public class blogpost { public long id { get; set; } public string title { get; set; } public string body { get; set; } public byte[] fauxtoe { get; set; } } ...but byte array image (probably jpg or png) guess, @ best. it may not perfect answer i'm trying help. according programming entity framework dbcontect j.lerman should used store images... [column(typename = "image")] public byte[] photo { get; set; } however, it's code first, after db generated type of columns was... varbinary(max). and here other book programing entity framework: code first, schema created. the parameter provided column annotation specific database mapping to. want store photo in sql server image field. long it’s possible coerce

java - Identify specific class when multiple classes of same name -

i have 2 projects included genxml project, framework1 , framework2 . framework2 updated version of framework1 , both have class abstractscreentest.class . there anyway in code below can specify project want interact with? classpathscanningcandidatecomponentprovider provider = new classpathscanningcandidatecomponentprovider(true); provider.addincludefilter(new assignabletypefilter(abstractscreentest.class)); set<beandefinition> components = provider.findcandidatecomponents(candiatepackage); (beandefinition component : components){ cls = class.forname(component.getbeanclassname()); classlist.add(cls.getname().tostring()); } you add @deprecated annotation old (out-dated) class , verify component not contain deprecated annotation. for (beandefinition component : components){ cls = class.forname(component.getbeanclassname()); if (!cls.isannotationpresent(deprecated.class) { classlist.add(cls.getname().tostring()); } } of course, assumes th

access vba - .findfirst vba access2010 unbound form runtime error -

i have following vba code populate unbound fields in unbound form in access 2010 : private sub combo0_afterupdate() dim d database dim rsexp recordset dim criteria string set d = currentdb set rsexp = d.openrecordset("expasset", db_open_dynaset) criteria = "[serial_number]=" & [combo0] rsexp.findfirst criteria me!name = rsexp("user") me!type = rsexp("type") me!model = rsexp("model") me!notes = rsexp("notes") me!department = rsexp("department") me!status = rsexp("status") rsexp.close end sub i getting error on line rsexp.findfirst criteria runtime error 3077 syntax error (missing operator) in expression. i have changed code criteria = "[serial_number]=" & str([combo0]) runtime error 13 type mismatch. give opportunity examine criteria you're asking .findfirst use. may not expect. dim strcriteria string 'strcriteria = "[serial_number]=" &

php - jQuery Submitting form Twice -

i know question has been answered few hundred times, have run through load of potential solutons, none of them seem work in instance. below form , code submitting form. fires off php script. know script isn't cause of submit, i've tried form manually , submits once. the 1st part of jquery code relates opening lightbox , pulling values table underneath, have included in case whatever reason potential problem. jquery code: $(document).ready(function(){ $('.form_error').hide(); $('a.launch-1').click(function() { var launcher = $(this).attr('id'), launcher = launcher.split('_'); launcher, launcher[1], $('td .'+launcher[1]); $('.'+launcher[1]).each(function(){ var field = $(this).attr('data-name'), fieldvalue = $(this).html(); if(field === 'invoiceid'){ $("#previouspaymentsload").load("function

Kendo grid change indicator and cancel not working -

i'm new kendo , kendo grid i'm trying learn how use master detail kendo grid detail grid supposed support batch editing. data available in local javascript object. this jsfiddle demonstrates problems i'm seeing. here's how grid being created - see jsfiddle complete snippet - $("#grid").kendogrid({ datasource: items, detailinit: createdetail, columns: [ { field: "item", width: "200px" }, ] }); function createdetail(e) { $("<div/>") .appendto(e.detailcell) .kendogrid({ datasource: { batch:true, transport: { read: function (options) { options.success(e.data.subitems); } } }, editable:true, pageable:true, toolbar: ["save", "cancel"], columns: [ { field: &quo

Char injected into string of Java class when file sync'd from Git into Jenkins workspace -

i have java class has following: public static final blob copyright_mark = new blob("div.legal_footer span", "© " + new simpledateformat("yyyy").format(new date()) + " acme llc. rights reserved."); the project class stored in git repo , pulled jenkins job run unit tests. when file pulled jenkins job workspace, character injected before copyright symbol in string: public static final blob copyright_mark = new blob("div.legal_footer span", "© " + new simpledateformat("yyyy").format(new date()) + " acme llc. rights reserved."); this causing test failure. the java class encoded utf-8. project can built , test run locally without problems. jenkins instance running on osx. code written on mac. i'm stumped why file being altered when pulled workspace. any suggestions of check? you need declare in configuration file/parameter/environment variable encoding used utf-8. having file

jquery - Bootstrap Carousel / Preload images -

i've searched haven't been able find out way preload images using bootstrap carousel. building portfolio site lot of images , right bootstrap carousel works after images loaded. any ideas? i'm pretty sure images in bootstrap carousel aren't loaded dynamically, loaded page. therefore there isn't reason preload. preloading used when images loaded onto page dynamically. when happens, page has load image separate page, causing undesirable lag between dynamic addition , image downloading/appearing. because bootstrap's carousel has it's images included in html , hidden javascript, images loaded page, resulting in whatever preloading achieve you. tl;dr: can't it's done you.

Large .img file processing in R (GIS) -

i working u.s. national landcover dataset (nlcd) classify habitat type @ more 150 sites across northeast u.s. dataset large (15gb) cannot upload here, comes in .img format @ 30m resolution. have gps coordinates center point of sites. able extract proportion of landcover classes in 1 square kilometer around point. questions are: 1) how upload .img files r? 2) how extract information around gps coordinates proportions of different habitat classes? has worked dataset in r before? if use help. cheers, israel use raster package can process files disk, reading in chunks @ time. the raster package has extract function buffer argument. set buffer appropriate value ( 1000 if map units metres , want km radius)

php - OWASP 2010 - Security Misconfiguration example -

i working php , owasp 2010 top 10 , need :) i need example of how use security misconfiguration , think need know how bug can know how prevent. i've tried find via google got concept of it. need actual example can understand clearlier :) so there's 1 example of a6 - security misconfiguration in php. well, there 1 until 5.4.0. called register_globals . if had register_globals on, opened several potential doors vulnerabilities. another misconfiguration if have display_errors on in production. problem, because errors disclosed user (potentially giving them clues filesystem structure , potential vulnerable error-producing parts of application.

ios - EAAccessory with car Bluetooth -

i developing app needs detect if iphone connected car. using eaaccessory. question eaaccessory detect this? car bluetooth(on able connect iphone , play music) mfi ? if use bluetooth le, don't need join mfi. i've never used it, don't know how works. but if use bluetooth 2.1, need join mfi first. can connect device bluetooth module in setting -->bluetooth. in app, accessorylist = [[nsmutablearray alloc] initwitharray:[[eaaccessorymanager sharedaccessorymanager] connectedaccessories]]; this should able tell connected accessories.

osx mountain lion - Xcode error 100021 -

Image
today, added small piece of functionality (a few lines of code only, else identical) app want publish on mac app store. this app on store, , change i've made in code itself, publishing should work before, being xcode we're talking about, came error: and nothing else. happens when go archive manager, , try go through distribute... dialog. ideas on how debug and/or did xcode screw up? latest xcode (4.6.1) on latest os x (10.8.3). more of clue answer here, ran same problem , turned out because of symbolic links copied app "copy files" build step. however, in case i'd tried bundle in nvidia cg library , had added "copy files" entry copy framework. hence culprit obvious: cg.framework directory has bunch of symbolic links. whether , proper solution don't know, changed "copy files" copy code library itself. copy files destination: frameworks subpath: cg.framework cg in sdk/cg/cg.framework/versions/1.0 hopefully ends here

android tabhost - TabActivity and getTabHost() aren't working in my eclipse. How to solve these problems? -

here code there're problems here why tabactivity scratch in eclipse? gettabhost() getting error? can fix code? i'll try learn androidhive.com see tutorial when write in eclipse, it's failed. package com.uavero.androidtablayout; import android.os.bundle; import android.app.tabactivity; import android.content.intent; import android.view.menu; import android.widget.tabhost; import android.widget.tabhost.tabspec; public class tablayout extends tabactivity{ @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_tab_layout); tabhost tabhost = gettabhost(); // tab photos tabspec photospec = tabhost.newtabspec("photos"); // setting title , icon tab photospec.setindicator("photos", getresources().getdrawable(r.drawable.icon_photo_tab)); intent photosintent = new intent(this, photosactivity.class); photospec.setcontent(photosintent);

visual c++ - 2 timer using OnTimer(UINT_PTR ID) with vc++ -

i want use 2 timer, 1 reading sensor, , give command robot, using visual studio vc++ 2010 class library. first timer on if button 1 clicked, , second timer using button 3. but when click button 2, read sensor working though have not press button 1, , vice versa. here program: what wrong code? const int ctimer1 = 1; const int ctimer2 = 1; void cenvsconfigdlg::onbnclickedbutton1() { settimer(ctimer1,1000,null); } void cenvsconfigdlg::onbnclickedbutton2() { killtimer(ctimer1); } void cenvsconfigdlg::onbnclickedbutton3() { settimer(ctimer2,10,null); } void cenvsconfigdlg::onbnclickedbutton4() { killtimer(ctimer2); } void cenvsconfigdlg::ontimer(uint_ptr id){ if(id==ctimer1){ char buffer[30],tempstr[5]; int sensor[6]; dword nbytes; messagebeep(0); //read sensors if(!writefile( hnd_serial, "1", 1, &nbytes, null )){killtimer(ctimer1);messagebox(l"write com port fail!");return;} sleep(30); if(!readfile(

xcode - iPhone 6.1 simulator leaves zombie process that can not be killed! -

i debugged app using xcode's iphone 6.1 simulator. after stop app using xcode's stop button, found there dummy process still seen using "ps ux" command. example, runed app called "iapnoob", when app running on simulator, see process: chandler 781 0.0 0.5 875156 20332 ?? sx 11:26上午 0:00.33 /users/chandler/library/application support/iphone simulator/6.1/applications/ 29fae7ca-3c0e-4b52-a916-572fef640a76/iapnoob.app/iapnoob when stopped app using xcode's stop button, process turned to: chandler 781 0.0 0.0 0 0 ?? z 11:26上午 0:00.00 (iapnoob) time , time, kind of dummy process caused system nasty slow. tried kill process, using kill -9, not work. can 1 tell me how solve problem? ps:i tried quit simulator, not kill zombie process. pps: tried method quit app double clicking "home" button on simulator , kill app, however, still leaves zombie process in activity monitor force quit simulat

java - implementing a method from one class to another? -

i making program airplane seating arrangements class , ended making 2 tostring methods when run program tostring method in airplane class making not work specifically: str= str + seats[i][j].tostring(); i believe deleting tostring method in seat class , somehow putting airplane class tostring method fix problem or make simpler. what's wrong? airplane class: public class airplane { private seat [ ] [ ] seats; public static final int first_class = 1; public static final int economy = 2; private static final int fc_rows = 5; private static final int fc_cols = 4; private static final int economy_rows = 5; private static final int economy_cols = 6; public airplane() { seats = new seat[fc_rows][economy_cols]; } public string tostring() { string str = ""; (int i=0; i<fc_rows; i++) { (int j=0; j<economy_cols; j++) { str= str + seats[i][j].tostring(); } str = str + "\n"; }

media - ios: playing video with arbitrary nsinputstream -

i pass nsinputstream mpmovieplayercontroller, or mpmovieplayerviewcontroller, or whatever else. the input stream leverages protocol not supported apple's frameworks. i tried creating custom nsurlprotocol (which kind of works on device (not simulator)), mediaplayer tries cache , causes application crash when allocates 250mb. , video never plays. any ideas on how proceed? know apps out there this. i don't want have build own media player, seems likely, no? there examples of how coremedia , not ffmpeg (etc)? codec selection not important me - ability play while streaming on proprietary protocol. thanks! the custom_io branch of kxmovie looking for. of videos aren't playing perfectly, it's start. https://github.com/kolyvan/kxmovie/tree/custom_io

Using File::Find::Rule to get the list of files in Perl -

i trying identify list of .cpp files in repository. using following script: use file::find::rule; use strict; use warnings; @files = file::find::rule->name('*.cpp'); print dumper @files; i following output: $var1 = bless( { 'mindepth' => undef, 'maxdepth' => undef, 'extras' => {}, 'subs' => {}, 'iterator' => [], 'rules' => [ { 'args' => [ '*.cpp' ], 'rule' => 'name', 'code' => 'm{(?-xism:^(?=[^\\.])[^/]*\\.cpp$)}' } ] }, 'file::find::rule' ); i not find references online fetching list of files. can please point

java - adding jtextfield automatically record from corresponding jtextfield value -

Image
my question when insert first name in jtextfield corresponding last name of record show automatically in jtextfield? it means dont want insert same data again , again..once insert record in database next time same record inserted automatically in next form so here give me snippet? in advance @mirroredfate (to comments in answer here) never use keylistener, use documentlistener, there can determine possible users inputs types inside jtextcomponents import java.awt.gridlayout; import javax.swing.*; import javax.swing.event.documentevent; import javax.swing.event.documentlistener; public class textlabelmirror { private jpanel mainpanel = new jpanel(); private jtextfield field = new jtextfield(20); private jtextfield field1 = new jtextfield(20); public textlabelmirror() { field.getdocument().adddocumentlistener(new documentlistener() { @override public void changedupdate(documentevent e) { updatelabel(

get timezone from location name in Ruby on Rails -

this question has answer here: ruby gem finding timezone of location 5 answers as can timezone country code like c = tzinfo::country.get('us') zones = c.zone_identifiers this returns zones of country. but need specific zone of location i.e. "washington, usa" there way timezone location name? so can timezone giving location name("washington, usa") you download geonames db , compare lat/lng nearest place (with timezone) in db download database of cities geonames.org convert compact lat/lon -> timezone list

php - Can't write to MYSQL DB after moving to a new server -

i've pinged make sure connected server , can read reasons don't need go into. of db calls this: $sql="insert shoeboxvideos set vidid='$vidid', email='$email' "; $result = mysql_query($sql); and worst of all, before moved new server worked fine. don't understand blocking editing database. possible there db settings somewhere in admin? are sure you're on moved db? , not still connected old db? have confirmed connecting db , executing query goes ok? mysql_connect(...) or die('failed connect'); , mysql_query(...) or die(mysql_error()); (change syntax if using pdo or mysqli.) have checked mysql user permissions of mysql user logging in? can user doesn't exist on new location. or exists twice, less rights granted on 1 host connecting with

xml - XSD Validation Error : cos-all-limited.1.2: An 'all' model group must appear in a particle with -

i have , xsd gives following error during schema generation. org.xml.sax.saxparseexception; systemid: file:/d:/basil/projects/myproducts.xsd; linenumber: 577; columnnumber: 50; cos-all-limited.1.2: 'all' model group must appear in particle '{'min occurs'}' = '{'max occurs'}' = 1, , particle must part of pair constitutes '{'content type'}' of complex type definition. @ com.sun.org.apache.xerces.internal.util.errorhandlerwrapper.createsaxparseexception(errorhandlerwrapper.java:198) @ com.sun.org.apache.xerces.internal.util.errorhandlerwrapper.error(errorhandlerwrapper.java:134) @ com.sun.org.apache.xerces.internal.impl.xmlerrorreporter.reporterror(xmlerrorreporter.java:437) @ com.sun.org.apache.xerces.internal.impl.xs.traversers.xsdhandler.reportschemaerr(xsdhandler.java:4124) @ com.sun.org.apache.xerces.internal.impl.xs.traversers.xsdhandler.reportschemaerror(xsdhandler.java:4107) @ com.sun.org.apa

How to check the status of call command in dos batch file -

i have batch file name xyz.bat these content @echo off echo 1.cleaning 4 project. call apacheant\bin\ant -buildfile clean-all.xml when first call end write on console build succeed or build failed. how verify call failed or passed on condition basis want decide next call execution. echo 1.building 4 project. call apacheant\bin\ant -buildfile build-all.xml @echo on echo 1.building 4 project. call apacheant\bin\ant -buildfile build-all.xml >logfile.txt findstr "succeed" logfile.txt >nul if errorlevel 1 (echo build failed) else (echo build succeeded) naturally, echo ... replaced 'set antstatus=succeed` if required. don't try use errorlevel control processing since many commands change errorlevel report own status. it may possible ant returns status on termination. check with echo %errorlevel% after ant step. if returns errorlevel, don't need create , interpret logfile. the if errorlevel syntax if errorlevel n

asp.net mvc 4 - AutoMapper not working **Probably failing for navigation properties** -

i have 2 classes: class - country >> id, name, list class - city >> id, name, countryid, country i have countryviewmodel , cityviewmodel classes identical above classes. i have written following in global.asax.cs: automapper.mapper.createmap<country,countryviewmodel>(); automapper.mapper.createmap<city,cityviewmodel>(); after retrieving entities datbabse, firing following line map models view models.: automapper.mapper.map(country, system.type.gettype("country"), system.type.gettype("countryviewmodel")); this giving "object reference not found" error on above line. make sure global.asax.cs includes call automapper.mapper.assertconfigurationisvalid() make sure mapped properly. i've never used non-generic syntax map before, generic version should work is: automapper.mapper.map<country, countryviewmodel>(country);

Java multithreading on producer-consumer -

i following video tutorial on java multi-threading. introduces on using java implement famous "producer-consumer" problem. it used wait() , notifyall() ensure proper communication between producer threads , consumer threads. the tutor intentionally created several producer threads while 1 consumer threads, left question unanswered: "it best practice have equal number of producer , consumer threads, if there more producer threads consumer, there problems". however, didn't specify problem is. imagine situation basket full. experts here? thanks. you have number of producers , number of consumers. if producers produce fast, queue fill up, until memory problems or producers forced stay idle until there's place left in queue. if consumers consume fast, stay idle of time.

c# - How searching files on the client-side from a webservice placed on the server? -

i have webservice. webservice calling server side. , when service looking c-drive, he's looking in server area. when expected c-drive on client-side. if (!file.exists(filename)) // filename = "c:\\temp\myfile.pdf"; must on client-side. looks on server-side. throw new filenotfoundexception(string.format("file not found: '{0}'!", filename)); i want see "c:\temp\myfile.pdf" on client-side , "\\myserver\c$\temp\myfile.pdf" on server-side. what have do? try following code, fileinfo fi = new fileinfo(@"\\myserver\share\myfile.pdf"); bool exists = fi.exists; note: have transform file path above format. updated conversion part, string filename = path.getfilename(@"c:\share\myfile.pdf"); string clientpath= @"\\myserver\share\"; fileinfo fi = new fileinfo(path.combine(clientpath,filename)); bool exists = fi.exists;

ios6 - How to send serial number of pass to device -

now in step when device generate request webserviceurl/version/devices/devicelibraryidentifier/registrations/passtypeidentifier?passesupdatedsince=tag how server send serial of pass , send last updated/tag; need convert timestamp string lastupdated string? error console: apr 5 13:45:24 cammobs-ipod4 passd[21] <warning>: serial #s task (for device b6511c0dd47d04da449ce427b27fea74, pass type pass.cam-mob.passbookpasstest, last updated (null); web service url http://192.168.1.202:8888/passeswebserver/) encountered error: server response malformed (missing response data) query database , identify serials (if any) match devicelibraryidentifier , passtypeidentifier , have changed since passesupdatedsince tag. hold these in array. then send array device, or send 204 response if there no serials need updating. $serialsarray = array("abc123", "dec456"); // array should populated database. if (!empty($serials)) { echo json_encode(array('

ruby on rails - how to get song cover art using TagLib -

here's code able song's picture/cover art. taglib::mpeg::file.open("song_file_name.mp3") |file| tag = file.id3v2_tag cover = tag.frame_list('apic').first mime_type = cover.mime_type picture = cover.picture end how can convert value of picture url or image's source? you should store content of picture in file, save it, , make available on web server. try like: taglib::mpeg::file.open("song_file_name.mp3") |file| tag = file.id3v2_tag cover = tag.frame_list('apic').first mime_type = cover.mime_type picture = cover.picture extension = case cover.mime_type when 'image/jpeg', 'image/jpg' 'jpg' when 'image/gif' 'gif' else raise "mime not found" end file_name = "my_file.#{extension}" file.open(file_name, "w") |f| f.write(picture) end end

c# - windows phone 8 xaml not getting updated -

has faced issue? i've tried recreating entire solution, checking build action & copy output settings, etc. way can update xaml uninstalling app, , redeploying every time. i fixed going folder of source code , removed 'read-only'.

sql - postgresql: Force Quotes on Header -

i try force quotes on header. copy ( select * "table" ) <path> csv header force quote *; with this, header , in quotes except header. want have exact opposite. to <path> csv header force quote header; and to <path> csv force quote header; did not work. any idea how manage this? no such option available in postgresql's copy support, @ least in 9.2 , older. you've observed, headers aren't quoted - or rather, they're in auto-quote mode they're quoted if contain delimiter or other special character: \copy (select 1 "first value", 2 "second value", 3 "third value, comma") '/tmp/test.csv' (format csv, header true, force_quote *); produces: first value,second value,"third value, comma" "1","2","3" you need transform csv via more flexible external tool understands weird , wonderful favours of csv in use, or use external tool p

php - jquery check box some ideas -

im trying make checkbox disable computation in query here form code: <input type="hidden" name="stud_no[]" value="<?php echo $row['student_no'];?>"> <input type="text" name="prelim[]" value="<?php echo $row['prelim_pts']?>" id="prelim_<?php echo $row['student_no'];?>" class="txtprelim" ></td> <td><input type="text" name="midterm[]" value="<?php echo $row['midterm_pts']?>" id="midterm_<?php echo $row['student_no'];?>" class="txtmidterm" ></td> <td> <input type="text" name="final[]" value="<?php echo $row['finals_pts']?>" id="final_<?php echo $row['student_no'];?>" class="txtfinal" ></td> <td> <input type="text" name="average[]&qu

python - openerp cutomer tree view -

Image
here code module, have inherited res.partner table , added column partner_ref. need in myproject have show customer referred whom. , list of referred customer current customer. here table definition: from osv import fields, osv import logging _logger = logging.getlogger('realty') class cust_ref(osv.osv): _description = "reference" _inherit = 'res.partner' _columns = { 'partref_id' : fields.many2one('res.partner', 'referred by', required=false), } cust_ref() and here xml code : <?xml version="1.0"?> <insignierp> <data> <record id="partner_reference_ref_form" model="ir.ui.view"> <field name="name">realty.res.partner.form.inherit</field> <field name="model">res.partner</field> <field name="arch" type="xml">

ios6 - What I have to do for logging error by passbook web service reference -

in logging errors, device sends post request webserviceurl/version/log, server have in point ? to log output php log can use like: $log_items = json_decode(@file_get_contents('php://input'))->logs; foreach($log_items $key => $log_message) error_log("passbook error log: " . $log_message, 0);

java - How to use Annox to Add @XmlRootElement When Generating JAXB Model from WSDL? -

i have following wsdl <?xml version='1.0' encoding='utf-8'?> <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.m2m.no/resourcemanager" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns2="http://schemas.xmlsoap.org/soap/http" xmlns:ns1="http://www.m2m.no/resourcemanager/2013/03" name="resourcecontrollerimplservice" targetnamespace="http://www.m2m.no/resourcemanager"> <wsdl:types> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:tns="http://www.m2m.no/resourcemanager/2013/03" targetnamespace="http://www.m2m.no/resourcemanager/2013/03" version="1.0"> <xs:element name="resourcefault"> <xs:complextype> <xs:complexcontent> <xs:extension base="tns:root"> <

asp.net - textbox and lable display -

i new asp.net , facing small problem in it. problem set display="dynamic" textbox , label showing erroe , there equal tag display="dynamic" textbox , lable...., code is: <tr> <td align="right" style="padding-right: 5px; width: 50%;" > <asp:label id="lblfirstname" runat="server" text="firstname :"></asp:label> </td> <td align="left" style="padding-left: 5px; width: 50%;" > <asp:textbox id="txtfirstname" runat="server" width="70%"></asp:textbox> <br /> <asp:requiredfieldvalidator id="rfvfirstname" runat="server" display="dynamic" controltovalidate="txtfirstname" errormessage="you can't leave empty." style="color: #ff0000;">

css - Select elements with specific class in specific div -

lets have div class divclass, , have elements class elementclass. how can select elements class: elementclass in divs class: divclass? depends, does matter @ level elementclass situated in divclass? if not, use: .divclass .elementclass { //properties here } if want select elementclass direct descendants of divclass, use: .divclass > .elementclass { //properties here } don't overspecify using div.divclass unless it's necessary.

javascript - jquery .on function -

i've updated jquery script 1.9.1 , function stoped working .live() . i have got .on() working doesnt remove item list, have update page see result. generate html-code: for (var = 0; < o.length; i++) { $('#listinserts').append('<div>' + o[i].text + '<a class="del" rel="'+ o[i].dataid +'" href="#">x</a></div>'); } code before $('.del').live('click', function() { delitem = $(this); var dataid = $(this).attr('rel'); $.post('dashboard/xhrdeletelisting', {'dataid': dataid}, function(o) { delitem.parent().remove(); }, 'json'); return false; }); code after $(document).on('click','.del', function() { delitem = $(this); var dataid = $(this).attr('rel'); $.post('dashboard/xhrdeletelisting', {'dataid': d

ios - Assign new object to parameter object in block -

say have block so: object someobject = nil; block = ^(object *obj){ if(obj == nil) obj = [[object alloc] init]; }; block(someobject); //someobject still nil block(someobject); //it assign again, instead of not nslog(@"result: %@", someobject); //still nil it seems though cant assign things parameters in blocks way, there way it? block acts on different objects, , needs assign if object nil. in state, object assigned in scope (so obj assigned, not someobject ). ive tried using __block dont think thats for. when comes parameters, blocks act functions. doing here similar how nserrors being handled apple's api. try this: object * someobject = nil; block = ^(object **obj){ if(obj != nil && *obj == nil) *obj = [[object alloc] init]; }; block(&someobject); //someobject still nil block(&someobject); //it assign again, instead of not nslog(@"result: %@", someobject);

vba - What is the best way to prevent Access database bloat -

intro: i creating access database system rolled out multi-user functionality. creating database in access 2000 (old school know) there quite lot of bugs , random mysterious problems occur when database gets passed 40-60mb. my question: has got solution how can shrink down or prevent bloat? details: i using many local tables combined sql tables , front-end links back-end sql server. have tried compact , repair ever shrinks 15mb , after user has used database few time bloat expands on 50-60mb! let me know if more detail needed rough outline of problem. many thanks! here's ideas follow. you said have lot of local tables. split local tables off yet access database. you'll have 2 back-ends (1 sql server & 1 access), , front end. create batch file opens local tables backend database /compact option. so, this: "c:\prog...\microsoft...\officexx\ c:\projectx_backend.mdb /compact" then run batch file on daily basis using scheduled tasks.

jquery / javascript to sum field only if checkbox on same row is checked -

i have jquery / javascript function totals number of cubes in order. works 100% , below. function calculatetotalvolume() { var grandtotalcubes = 0; $("table.authors-list").find('input[name^="cubicvolume"]').each(function () { grandtotalcubes += +$(this).val(); }); $("#grandtotalcubes").text(grandtotalcubes.tofixed(2)); } as mentioned above works great. need second function total same field if checkbox named treated checked. each row has checkbox named treated table dynamically generated, counter appended name each time hence use of name^="treated" i after below doesn't work: function calculatetotaltreatedvolume() { var grandtotaltreatedcubes = 0; $("table.authors-list").find('input[name^="cubicvolume"]').each(function () { if($("table.authors-list").find('checkbox[name^="treated"]').checked){ alert('10');

iphone - cocos2d taking screenshot in a part of layer? -

i want take screenshot middle part of layer(it's image) without menus positioned in upper , lower part of screen.is possible take part of layer image? //normal screenshots -(uiimage *) screenshotwithnode:(ccnode*)node { [ccdirector shareddirector].nextdeltatimezero = yes; cgsize winsize = [ccdirector shareddirector].winsize; ccrendertexture* rtx = [ccrendertexture rendertexturewithwidth:winsize.width height:winsize.height]; [rtx begin]; [node visit]; [rtx end]; return [rtx getuiimage]; }

c# - Get index of first detected space after a certain index in a string -

in string format (mostly replace chars different symbols rendering test on ui), have detect % , skip chars util first space % char , has repeated instances in string. e.g. abcd%1$s efgh %2$d ijkl .in string, have index of % , find index of first space that. basically, have skip %1$s & %2$d sort of formatting placeholders. hope, not putting in complex way here. you can pretty easily, grab index if first percent sign , leverage index find first space there: var start = mystring.indexof("%"); var spaceindex = mystring.indexof(" ", start) of course value of mystring string represented in question.

sql - Pass multiple values to get CSV output -

create procedure temp ( @mid smallint ) begin select tranid, [monthvalue]=(case when @mid=1 jan when @mid=2 feb when @mid=3 mar when @mid=4 apr when @mid=5 may when @mid=6 jun when @mid=7 jul end) tbltran m tranid=1 , m.month = @mid end this stored procedure parameter @mid i'm using generate report using ssrs. if single value passed parameter works fine. for example- transaction table tranid | apr | may | jun | jul 1 | 50 | 30 | 11 | 30 2 | 51 | 39 | 100 | 30 if execute with exec 4 result expect tranid | monthvalue 1 | 50 **-- ie aprils value** but need pass multiple values parameter exec 4,5,6 and desired result should be tranid | monthvalue 1 | 50,30,11 ***-->comma separated values of columns how can acheive result this?? you can use split function, e.g. create function dbo.splitints ( @list varcha

java - Loading applet in browser throws Classnotfound exception -

when tried run applet in firefox browser, prompted install java plugin. have downloaded , installed plugin java 7 update 17 . later, tried load applet again, im getting error. in browsers. friends can load applet though. please me resolve this. thanks java plug-in 10.17.2.02 using jre version 1.7.0_17-b02 java hotspot(tm) client vm user home directory = c:\users\administrator c: clear console window f: finalize objects on finalization queue g: garbage collect h: display message l: dump classloader list m: print memory usage o: trigger logging q: hide console r: reload policy configuration s: dump system , deployment properties t: dump thread list v: dump thread stack x: clear classloader cache 0-5: set trace level cache: initialize resource manager: com.sun.deploy.cache.resourceproviderimpl@17825dd security: property package.access value sun.,com.sun.xml.internal.bind.,com.sun.xml.internal.org.jvnet.staxex.,com.sun.xml.internal.ws.,com.sun.imag