Posts

Showing posts from August, 2015

bower 1.0: what's the deal with .bower.json? -

i upgraded bower 1.0, did bower install , found bunch of new .bower.json files (note leading period). i found no references .bower.json on changelog or in docs. supposed .gitignore these? original bower.json without dot plus metadata. you can't delete them because bower uses metadata. decided leave original bower.json file untouched , create .bower.json 1 instead.

java - sql command not properly ended (where is my mistakes) -

i hope receive answer time i wrote below code don't know mistake seem correct think this code should insert more million records oracle xe wrote single insert statement when execute preparedstatement 1 one it's run took 6 hours !!!!!! because forced use thread.sleep() package tokenizing; import java.sql.*; import java.util.stringtokenizer; public class tokenextraction2 { public static void main(string[] args) throws exception { string mytext[]=new string[2276]; jdbc db=new jdbc(); string st1=null; int i=0; int j=0; string tokens[][]=new string [3000000][2]; st1="select ntext newstext "; resultset result=db.select(st1); while(result.next()) { mytext[i]=result.getstring("ntext"); ++i; } db.closedb(); i=0; stringbuilder st= new stringbuilder("insert tokens5(token,tokenlength) values"); w

c# - Special letters check -

how can check if textbox contains numbers, letters, , have special letters "õ, ä, ö, ü"? i use code check numbers , letters: regex.ismatch(value, "^[a-z0-9]+$", regexoptions.ignorecase) does how can strip non-ascii characters string? (in c#) contain pointers? you include unicode using \uxxxx syntax within regex additional letters want strip test for. regex.ismatch(value, "^[a-z0-9\u00c0-\u00f6]+$", regexoptions.ignorecase)

user - Easy linux permissions inquiry -

i want give user full rwx permission on directory (recursively), including files or subdirectories may created in future. not want make them owner of directory. syntax should use? - debbie you've got 2 choices: a) user in group owns directory tree use group permission: chmod -r g+rwx thedir b) user not in group owns directory tree use "everyone else" permission flags: chmod -r o+rwx thedir

sql server - SQL query one to many relationship join without duplicates -

i'm running queries in sql server 2008.. have sales table , payments table.. sale has multiple methods of payment (part giftcard + part cash or part credit + part cash etc..) want list sales , payments each sale in table. if left join on sales.saleid = payments.saleid duplicate sales rows when there more 1 matching payment rows.. so have been doing getting sales , count of how many matching payment rows there (select count(*) payments payments.saleid = sales.saleid) numofpayments . in php script check number of payments , if > 1 run query payment details. the output trying this ----------------------------------------------------- | saleid | saledate | amount | payments | ----------------------------------------------------- | 123 | 2013-07-23 | $ 19.99 | cash: $ 19.99 | | 124 | 2013-07-23 | $ 7.53 | cash: $ 7.53 | | 125 | 2013-07-23 | $174.30 | credit: $124.30 | | | | | giftcard: $ 50.00 | | 126 | 201

css3 - Javascript - getting element box-shadow details accurately -

i have come bit unstuck.. well near enough every css property has seperate parts ie. margin-left border-top-color transition-duration however, have searched around bit , seem's me not case box-shadow . example have 4 <input> 's, h spread & v spread & blur & color . , wan't change elements box shadow on change of these fields. after finding out there isn't specifics on box shadow, decided best way split box-shadow array using this element.style.boxshadow.split(' '); however result not come in right order shown in fiddle <div id="test" style="box-shadow: 1px 1px 3px #999;"> welcome </div> console.log( element.style.boxshadow.split(' ') ); is resulting in output ["rgb(153,", "153,", "153)", "1px", "1px", "3px"] the color different , order has changed doesn't sound reliable me. is there way can acuratelly get/set dif

gridview - DevExpress ComboBoxEdit in Grid does not drop down -

i have devexpress grid control dynamically loaded datatable . columns loaded datatable except 1 in want use comboboxedit selecting 3 different values. all rows show correctly, , comboxbox shows in grid each row. however, can't drop down. no matter there seems no values in dropdown, or not drop down other reason. when add value column shows in grid, still no response when clicking dropdown-button on combobox. the user should able select 1 of 3 values, not type or add values. here's call add rows gridview: f1grid.datasource = accounts; f1grid.refreshdatasource(); f1gridview.refreshdata(); this code i'm using initialize repository combobox: repositoryitemcombobox repositoryitembetvillk = new repositoryitemcombobox(); repositoryitembetvillk.items.clear(); repositoryitembetvillk.items.addrange(new string[] { "12", "24", "36"}); repositoryitembetvillk.showdropdown = showdropdown.singleclick; repositoryitembetvillk.allowdropdownwhenr

ios - using AFNetworking's AFXMLRequestOperation with tbxml -

how use afnetworking's afxmlrequestoperation , parse data using tbxml instead of default nsxmlparser...looks alternate method xmldocumentrequestoperationwithrequest not work in ios (as nsxmldocument not supported) you have implement own extension tbxml, or decide not use tbxml kissxml has extension: https://github.com/afnetworking/afkissxmlrequestoperation

casting - Cast child as far parent and then as direct child c# -

i can’t cast parent class child – keep getting invalid cast exception. i can’t overcome problem , rally use help. i’m developing application creates documents. there total of 20 documents. 19 of themare unique , 1 derives different 1 extending contents. certificates have common header information , document-specific body. so created document class. never instantiate document class directly, through children. 19 documents directly derived document class. document class defines fields , properties common documents along methods access sql database. constructors of each document (child), when initiated no argument call document ’s (parent) constructor passing integer helps constructor select unique information common database table, such unique title of document, disclaimer or footer note. each document created win form interface. created base interface common certificates , operates on header information contains methods common document - windowsform interactions. each

internet explorer - HTML Form FILE input behavior in Chrome vs. IE -

if try filename value html input object in ie returns full path , filename, in chrome returns base filename. there way make return full path , filename regardless of browser, or have jump on jquery that? god almighty hate stupid non-standard web "standards". code example: <input type="file" name="fn" id="fn"/> click on selection button in ie , navigate path "\server123\apps\folder1\setup.exe" , result shows in form, , gets processed in [submit] handler event, "\server123\apps\folder1\setup.exe". however, running same steps in chrome 22.x 28.x, displays "setup.exe" , hands through [submit] handler well. there way make handle full path , filename regardless of browser? chrome scrubs out path information security reasons. there no way access path information. fileinput.onchange = function(e) { console.log(e.target.value); // c:\fakepath }

pan google map to ISO 3166 country code on android -

i have android application allows user select default country. countries held iso 3166 codes there way automatically pan google v2 map chosen country using iso3166 code? is there way automatically nothing done automatically. manually seems automatic. ;) pan google v2 map themap.movecamera(cameraupdatefactory.newlatlngbounds(...)); to chosen country using iso3166 code? parse output of http://maps.googleapis.com/maps/api/geocode/json?address=gb&sensor=false to bounds.

Can Draw Order of Polygons Be Controlled in KML? -

i have adjacent polygons (clamptoground) portion of boundaries overlap. able control 1 appears on top. method i've found work far list polygon placemarks in stack order (last on list appears on top). however, i'd organize placemarks based on other logic , coding method specify polygon on top. note, i've tried using relativetoground , small elevation differences, leads potions of polygons fill disappear beneath topography. you can specify <gx:draworder> element (which google earth kml extension ) order polygons lines , rings in kml. note documentation (see below) specifies linestrings works lines, linearrings, , polygons. anywhere "linestrings" mentioned below replace lines, rings, , polygons. draworder support polygons undocumented reported issue . kml documentation: <gx:draworder> "an integer value specifies order drawing multiple line strings . linestrings drawn first may partially or obscured linestrings l

jquery mobile - Mobiscroll Default Date Value on Safari -

i'm using mobiscroll date scroller in app. have set initialize date database , set value of input field. here code: $(function(){ $("#requestdate").scroller({ preset: 'date', theme: 'jqm', display: 'modal', mode: 'scroller', dateorder: 'mdyyyy', dateformat: 'm/d/yyyy' }); var requestdate = $("#requestdate").val(); if(requestdate != ""){ requestdate = new date(requestdate); $("#requestdate").scroller('setdate', requestdate, true); } }); here form field: <input type="text" name="requestdate" id="requestdate" data-role="

class - How to display $ (dollar signs) in Django Admin? -

how can make under price variable can automatically have display $? so, instead of having 999.99, display $999.99. doing in django admin. here admin.py from django.contrib import admin purchaseorders.models import purchaseorder class purchaseorderadmin(admin.modeladmin): fields = ['product', 'price', 'purchase_date', 'confirmed'] list_display = ('product', 'price', 'purchase_date', 'confirmed', 'po_number') admin.site.register(purchaseorder, purchaseorderadmin) and here bit models.py from django.db import models import random class purchaseorder(models.model): price = models.floatfield() you can in couple of ways: add custom property in purchaseorder class purchaseorder(models.model): price = models.floatfield() @property def dollar_amount(self): return "$%s" % self.price if self.price else "" and reference dollar_amount instead of

R: Using ellipsis with a function that takes a arbitrary number of arguments -

many times, find myself typing following print(paste0(val1,',',val2,',',val3)) print output function variables separated comma. it handy when want copy generate csv file output. i wondering if can write function in r me. many attempts, following. ppc <- function(string1,string2,...) print(paste0(string1,',',string2,',',...,)) it works @ maximum of 3 arguments. > ppc(1,2,3) [1] "1,2,3" > ppc(1,2,3,4) [1] "1,2,34" ppc(1,2,3,4) should have given "1,2,3,4" . how can correct function? somehow believe possible in r. you don't need write own function. can paste . paste(1:3,collapse=",") # [1] "1,2,3"

javascript - Checking if input values are empty -

i'm trying create tool allows users generate css code. @ moment i'm working on input - when user leaves text input empty, i'd message appear. code have @ moment doesn't seem work in doing so, ideas? $("#btn-css").click(function() { if( $('input').attr(value) = "" ) { $('#output').append('all boxes must completed'); } else { $('.preview').attr('style', 'box-shadow: ' + $("#h-value").val() + 'px ' + $("#v-value").val() + 'px ' + $("#blur").val() + 'px ' + $("#spread").val() + 'px #' + $("#colour").val() + ';'); $('#output').append('box-shadow: ' + $("#h-value").val() + 'px ' + $("#v-value").val() + 'px ' + $("#blur").val() + 'px ' + $("#spread").val() + 'px #' + $("#colour").val() + ';

javascript - How to check equality between cells in table using jQuery -

Image
i have n-column table m-rows. want check equality between each cell in row. idea store each value in 2 dimensional array , run 'for loop' check if values equal think solution not efficient. storing cell values nth-child selector , put them temporary array. know more faster , easier solution? need compare m-values of each column , if values different row should removed table. for example: and after running "check differences" function result should be: table built div's <div class="provider"> <div class="row">1000</div> <div class="row">1500</div> <div class="row">1120</div> </div> <div class="provider"> <div class="row">1000</div> <div class="row">1200</div> <div class="row">1120</div> </div> <div class="provider"> <div class=&q

jquery - Mulitlpe dropdowns with hidden textfields -

i'm trying have text field show when select "other" drop down. works fine, on first instance. need work on multiple occasions per page. have tried .each(), .foreach() can't seem find right place it. how function on multiple dropdowns js: $(window).load(function(){ $('#myselect').change(function() { if($(this).val() == 2) $('#txtdata').show(); else $('#txtdata').hide(); }); } ) html: <select id="myselect"> <option value="" selected="selected">-select one-</option> <option value="no">no</option> <option value="2">yes</option> </select> <br /> <input type="text" id="txtdata" placeholder="please specify..." class="other" style="display:none;" /> i'm not sure trying see if helps you: jsfiddl

mysql - Run a query so that all values in any category that contains "Important" come first -

i have table whole bunch of rows. simplicity, we'll each row belongs categories a, b, c, or d. rows have values of important, not important, or boring. want sort such if category contains value important, values in category come first, important rows first. like: a - important a - important a - not important c - important c - boring b - boring b - boring d - not important d - boring select my_table.* my_table join ( select category, sum(importance='important') number_important my_table group category ) t using (category) order t.number_important desc, category, importance see on sqlfiddle .

javascript - jQuery keeps posting an extra message each time I click submit -

my jquery code acting weird. keeps posting copy of same message each time click on submit. example: hello 3 hello 3 hello 3 hello 2 hello 2 hello anyone have idea why happening? here code far: jquery(function ($) { var socket = io.connect(); var $messageform = $('#sendmessage'); var $messagetitle = $('#title'); var $messagebox = $('#message'); var $chat = $('#chat'); $messageform.click(function (e) { if ($.trim($("#title").val()).length === 0) { alert('you must provide valid input'); $messagetitle.val(''); $messagebox.val(''); return false; } if ($.trim($("#message").val()).length === 0) { alert('you must provide valid input'); $messagetitle.val(''); $messagebox.val(''); return false; } else { e.preventdefault();

vb.net - Keep form always on top of taskbar -

i'm trying keep form on top of taskbar, whenever taskbar selected/becomes focused, form goes behind it. have set topmost (me.topmost = true), appear doesn't keep on top. how keep form always on top of taskbar , keep on top when taskbar focused? i have figure out way keep form on top of taskbar. this, must have form set top most: me.topmost = true next, want create timer , have interval 1. timer keep start button focused: private sub timer1_tick(sender object, e eventargs) handles timer1.tick me.focus() end sub that's it, form stay on top of taskbar if taskbar becomes focused.

google spreadsheet - How to put the value of multiple cells in another sheet from a reference code -

Image
this problem: have 2 worksheets, 1 records , discriminates revenues , expenses: and other contains table price, revenue , taxes each product: now, need function receives code (or description name) of product on first worksheet , put values ​​(income, taxes, price) available in second worksheet, way: i thought of such solution, gives me parsing error: so if can share little of intelligence , mental power me, i'll grateful until nex aeon . have tried =vlookup(b4,tax_table!a:f,2,false) ?

iphone - Copy downloaded video to camera roll -

even though looks simple procedure, it's 3 hours i'm trying without success. missing stupid. so, have app downloading videos internet. videos correctly stored locally because can play them providing local url. but, can't succeed in copying videos camera roll. here do: alassetslibrary *library = [[alassetslibrary alloc] init]; alassetslibrarywritevideocompletionblock videowritecompletionblock = ^(nsurl *newurl, nserror *error) { if (error) { nslog( @"error writing image metadata photo library: %@", error ); } else { nslog( @"wrote image metadata photo library %@", newurl.absolutestring); } }; nslog(@"file %@", localpath); nsurl *url = [nsurl fileurlwithpath:localpath isdirectory:no]; [library writevideoatpathtosavedphotosalbum:url completionblock:videowritecompletionblock]; but output is: 2013-07-24 00:13:32.094 app[1716:907]

asp.net - Silverlight - Read version of another assembly in local directory -

all, i need read version number of assembly in local directory (my document directory exact) in out-of-browser app w/ elevated trust. cannot use assembly.load, assembly.loadfrom methods because these cannot used in silverlight (marked w/ security exception attribute). i know how load file.readallbytes(), need steps hands on manifest , version number. lk you can .net, not (directly) silverlight. that's because there no .net library (as far know) reads assemblies. with .net, can load assembly in separate app domain , version there. if desperate, can embed .net application (an .exe file) in silverlight application gets written out , executed silverlight. i've done before different problem. feel free ask me code either of issues if want pursue path.

node.js - Pipe to stdout and writeable stream -

i'm piping file through duplex string (courtesy of through ) , i'm having trouble printing information stdout and writing file. 1 or other works fine. var fs = require('fs'); var path = require('path'); var through = require('through'); // easy duplexing, i'm young catify = new through(function(data){ this.queue(data.tostring().replace(/(woof)/gi, 'meow')); }); var reader = fs.createreadstream('dogdiary.txt'); // woof woof etc. var writer = fs.createwritestream(path.normalize('generated/catdiary.txt')); // meow meow etc. // yay! reader.pipe(catify).pipe(writer) // blank file. t_t reader.pipe(catify).pipe(process.stdout).pipe(writer) i'm assuming because process.stdout writeable stream, i'm not sure how want (i've tried passing {end: false} no avail). still struggling wrap head around streams, forgive me if i've missed obvious : ) i think want is: reader.pipe(catify) catify.pip

sql - query, where field contains 2 t's -

is there way perform clause match 2 t's independent off located. such matthew -- work thanatos -- work thanatos t -- not work tom -- not work i've been googling cant find specific this any apreciated you try select * table field '%t%t%' , field not '%t%t%t%' i'm curious faster, or goat co's answer.

android - Action Bar Sherlock and Button Text Color -

i've implemented action bar sherlock in 1 of apps, , cannot figure out why text in buttons shows in white when haven't set color. remain default black color, when add color attribute layout file, button text color remains white. ideas on might wrong here? the default theme abs includes white text. change theme, @ : using actionbarsherlock without default android theme

xml - Java JaxB generation, How do I get a bigDecimal from my xsd? -

i have xsd annotation trying marshal java object. java end bigdecimal value. enter in xsd make this? using xjc ant task <xjc schema="my.xsd" destdir="generated" header="false" extension="true" /> here relevant xsd - <complextype name="size"> <attribute name="height" type="bigdecimal"></attribute> <!-- wrong--> </complextype> i end generated class - public class size { @xmlattribute(name = "height") protected bigdecimal height; } a jaxb (jsr-222) implementation generate java.math.bigdecimal decimal type (see table 6-1 in jaxb 2.2 specification). xml schema (schema.xsd) <?xml version="1.0" encoding="utf-8"?> <schema xmlns="http://www.w3.org/2001/xmlschema" targetnamespace="http://www.example.org/schema" xmlns:tns="http://www.example.org/schema" elementfor

javascript - Confusing Hovereffct -

i've created navigationbar: http://cdpn.io/tdnfv (with of 2 tutorials, cant post links here due low reputation, links on codepen) now can see, blue bar moving nicely, , under item 6, there increasing "disharmony" towards item6. not able identify piece of code responsible of this! not sure how change "default location" of moving bar, means position when there no hover events. i appreciate help, thank in advance. that little white spaces in between each <li> . there different ways of dealing this, favorite remove font size, restore in element contains text. ul { font-size: 0; } ul li { font-size: 18px; } p.s., that's neat concept.

Java- Concatenating Enums? -

this question has answer here: can enums subclassed add new elements? 15 answers i have java enum containing elements, , want second enum contains same elements first, plus additional ones. is there way tell java create new enum taking first , adding elements onto it? try question: can enums subclassed add new elements? the consensus is not possible

Database schema for calendar application -

i'm creating calendar application in each date has 1 of 3 states: available, maybe available, , unavailable. trying figure out best schema situation. one thought might have userdate model field state . problem db have #-of-users- x 365 rows each year - seems grow modestly sized app. another thought might have default state, , create userdate object when user has signified availability on date different default. seems convoluted though. has dealt situation before? suggestions on best way go this? when create new user, not want inserting records next 50 years of life. creating userdate object when there non-default value should do. you consider storing range of dates user if have lots of consecutive dates same status. example, if unavailable of december, represented single row. think sort of information want extract database, , how difficult each of possible designs.

python - Using pyinotify to 'live' refresh displayed file -

g'day, i've got raspberry pi, used display transaction log csv file on hdmi-connected display. display operate live 'scoreboard', such user can see log csv file (like airport/flight announcing board). i've been told pyinotify can monitor log csv file, , refresh file, without having close , reopen it? i've read through documentation, , searched web functionality, i've far come empty. don't have example code demonstrate i've tried (yet!), wanted ascertain first of whether functionality possible pyinotify, or whether should looking @ else. i'm using python 3.3. any guidance here amazing! thanks! ok, don't know if it's going here how can it: let's have file : echo "line 1" >> testfile.txt than write script (make sure point file): import os, pyinotify path = os.path.join(os.path.expanduser('~/'), 'testfile.txt') class eventhandler(pyinotify.processevent): def __init__(se

c++ - How do I get elements from boost::fibonacci_heap by handle? -

i using boost::fibonacci_heap class boost 1.53.0 maintain updateable priority queue. when want update element need compare element in heap new element want replace with. want replace elements in heap "smaller" versions want compare them before update. when insert elements store handle ( boost::fibonacci_heap::handle_type ). functions have seen in documentation fibonacci_heap take handle type provide sort of write access ( update() , decrease() , increase() etc.) , don't allow me inspect element identified handle before update it. is there way @ element in fibonacci_heap using handle only? you should able dereference handle. example of provided here: http://www.boost.org/doc/libs/1_50_0/doc/html/heap/concepts.html example site fibonacci_heap<heap_data> heap; heap_data f; fibonacci_heap<heap_data>::handle_type handle = heap.push(f); (*handle).handle = handle; // store handle in node so call (*handle) to reference class stored in

php - Getting proper return from Wordpress Loop -

y'all. so i'm trying our wordpress blog show on distinct page in our html-based website. i've done lot of research , have pretty idea how i'm supposed proceed (i think), don't think i'm pulling correct loop code it. the page here: www.cidermag.com/blog.php as can see, site returns value of "nothing found" though have 3 or 4 test posts published through wp dashboard. however, fact got part of loop return gives me hope i'm on right track.... per instructions found online, pulled loop code index.php file located in our /blog/wp-content/themes/twentytwelve folder. know have program specific values specific things need @ least blog showing right have starting point understanding beast. (i learn better doing reading.) any assistance appreciated can't seem find definitive answer on this. thank you! the loop php code: <?php require('blog/wp-blog-header.php'); ?> <?php if ( have_posts() ) : ?&g

php - Setting cookies in Android URL Connections -

i using code not setting cookie... url url = new url("http://10.0.2.2/test2.php"); httpclient httpclient = new defaulthttpclient(); cookiestore cookiestore = new basiccookiestore(); cookie cookie = new basicclientcookie("xxt", "5a5b98563c4aabd675b81e4ba0fdf6cf"); cookiestore.addcookie(cookie); cookie cookie2 = new basicclientcookie("xxt", "5a5b98563c4aabd675b81e4ba0fdf6cf"); cookiestore.addcookie(cookie2); httpcontext localcontext = new basichttpcontext(); localcontext.setattribute(clientcontext.cookie_store, cookiestore); httppost post = new httppost("http://10.0.2.2/test2.php"); httpresponse response = httpclient.execute(post, localcontext); toreturn = entityutils.tostring(response.getentity()); //inputstream = conn.getinputstr

python - Tkinter process not shown during run -

i running creature simulator in python 2.7 using tkinter visualizer. map made of squares, colors represent land types, , red square represents creature. use canvas.move, move red square around board. has move quite lot. know should start , should end. have run simulation, bit bit, , when regulated maybe 2 moves ie. sim isn't running i'm testing it. can see movements. when run sim, buzzes , can see of canvas map, no creature , no creature movement. question this. firstly, how can possibly slow down process can see movements? or why simulation run , show of tkinter? the simulation quite large , hard pick out important bits, code below more of simplification. matches how did tkinter stuff. sim added more calculations , loops. it's worth noting example works perfectly. driver.py: from tkinter import * import animation class alien(object): def __init__(self): #set canvas self.root = tk() self.canvas = canvas(self.root, width=400, height=40

jquery - Javascript: Show .div if two inputs have a value of x or y -

i have 2 inputs , div . able show div when both of inputs have value of 6 or 7. i'm new javascript. close i've been able come (which isn't, fear, close): var div = $('div').hide(); $('.first, .second').keyup(function() { var value = this.value; if (value == 6 || value == 7) { div.fadein(); } else { div.fadeout(); } }); jsfiddle $('.first, .second').keyup(function() { var value1 = $(".first").val(); var value2 = $(".second").val(); if ((value1 == 6 || value1 == 7) && (value2 == 6 || value2 == 7)) { div.fadein(); } else { div.fadeout(); } }); try above

How do I re-initialize jQuery resize wrapper? -

trying image resize , dragging using jquery ui. having issue this, below added automatically jquery iu. doesn't change original size if load different image. means keep original images width , hight though load different image dynamically. <div style="overflow: hidden; position: absolute; width: 493px; height: 370px; top: 0px; left: 0px; margin: 0px;" class="ui-wrapper"> this html <div id="photo-area"> <div id="photo-canvas"> <div class="design-mask">&nbsp;</div> <div class="photo-wrap"> <div class="photo-resize"> <img id="photo-mask" class="pp-photo" /> </div> </div> </div> and javascript $j(".photo-wrap").draggable({ containment: "#photo-canvas", opacity: 0.35, }); $j(".pp-photo").resizable({ aspectratio: true, gh

c++ - Does not show the data entry form as I want -

i'm doing simple banking system, in system doing account creation method create new account. when client enter, create new account, must enter personal data. know problem stupid , simple @ same time. the problem when client entering information, supposed show data follows. your first name: (and waits client input) your last name: ( andwaits client input) your age: ( , waits client input) your address: (and waits client input) natural occurs above, happens not that. that happens following. your first name: (doesn't waits client inputs continue ) last name: (and waits client input). your age: (waits client input) . your address: (doesn't waits client inputs continue ) press key continue . . . what happens same previous figure. i did not put codes, added important codes only. // struct store client information. struct bc_detail{ char cfistname[15]; char clastname[15]; unsigned short usage; char caddress[64]; }; // c

numpy - Transform DICOM Image to a list of XYZ coordinates and their values - Python -

here trying accomplish in python (please keep in mind i'm relatively new python): convert dicom image list of xyz coordinates along respective pixel values , export list .csv file. regenerate same image list of xyz coordinates , pixel values generated in previous task. so far, have been able read in dicom images , convert them array through use of pydicom , numpy. i've been able extract pixel , coordinate values through several loops , export list .csv. there has better way of doing maintain sort of quality control, because when try regenerate images (through use of set of loops), don't original image. i need both functions run separately in different python scripts. this have far: #raster through pixels , copy each value , coordinates arrays rc_cntr = 0 r in range(0,img_rows): c in range(0,img_cols): pixel = dcmarray[r, c] rarray[rc_cntr] = r carray[rc_cntr] = c

drupal 7 - How can i add Comment section for each Field-collection sections? -

how can add comment section each field-collection sections ? i have step1, step2,... etc. now user want add comment steps. thanks in advance. i thinks can entity reference.

itunesconnect - Unable to add Game Center achievement and leaderboard: Lightbox Save Failure: Failed to takeValuesFromRequest => null -

after adding information (language, title, pre-earned description, earned description, image) language in itunes connect achievement, , clicking save, message in popup lightbox save failure: failed takevaluesfromrequest => null i unable save language. unable add achievement @ since need language. anyone got same issue? related current ios dev center downage? thinking browser issue (itunes connect doesn't work outside of safari), tried safari initial google chrome. no luck. same error. back morning, added new leaderboard. guess bug might fixed now.

android - Drag and move a circle drawn on canvas -

i working on android application should allow user draw circle on canvas , drag . have been able draw lines , circles on it.but cant seem able drag it. is possible drag object drawn on canvas in android?.for example if detect touch within circle, how delete circle previous position , move current position? have tried invalidate() .but wont work if user has drawn multiple circle , wants move of them. it seems might have issues handling of multi-touch / drawing. there's usefull tutorials on android developer site , on android blog . based on able create example think quite similar you're trying achieve (without complete circle drawing - circles generated single touch): public class circlesdrawingview extends view { private static final string tag = "circlesdrawingview"; /** main bitmap */ private bitmap mbitmap = null; private rect mmeasuredrect; /** stores data single circle */ private static class circlearea { i

Asp.net webform & roled based permission for different folders -

i have following folder structure in asp.net webform application. _adminuser _moderatoruser _employeeuser images js css ckeditor app_code errorpages default.aspx news.aspx article.aspx so far had 1 type of user used edit contents of website. used authorise users , redirect authorised user folder '_adminuser' can make changes site. and below code in web.config enough me work without issue. <authentication mode="forms"> <forms loginurl="~/_login.aspx" timeout="2880"/> </authentication> <location path="_adminuser"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location> <location path="ckeditor"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location>

ROR + Error while installing Rails 4 -

in system, trying install rails 4 ruby2 . ruby 2 installed successfully. while installing rails4, made configuration per devkit. though error message. temporarily enhancing path include devkit... building native extensions. take while... error: error installing rails: error: failed build gem native extension. c:/ruby200-x64/bin/ruby.exe extconf.rb * extconf.rb failed * not create makefile due reason, lack of necessary libraries and/or headers. check mkmf.log file more details. may need configuration options. i not getting way resolve it. in advance.

excel - Comparing sheets difference -

lets have following sheets. want following logic of output. if columna value of sheet2 exists or not exists, return true or false value column. @ same time want if true, if sheet1 columnb (linked columna ) different sheet2 columnb output difference. see below example structure , @ bottom i'll output i'll see. sheet1: columna columnb 5.5 b 2.2 sheet2: columna columnb 1.1 d 2 output i'd get: sheet3 columna columnb true 4.4 false n/a try formula in sheet 3 for cell a1 type in below formula , drag copy other cells =if(isblank(sheet2!a1), concatenate("false", " n/a"), concatenate("true", " ", (sheet1!a1-sheet2!a1)))

Smart tv resolution issues -

Image
i creating samsung smart tv application 1280 x 720. using 4.1 sdk. designed html same resolution. problem when checked in emulator not showing full content. html view: my emulator view when click down button showing below content not displaying contents margin if prss left button. can me. check widget.info files, samsung tv apps store resolution used in file. default 960x540 ui cutted. for 1920x1080 resolution not suggested since smart tv series 4 (es4xxx/f4xxx) support resolution 768p , causing apps 1080p failing start or give black screen.

oop - How do I call the parent classes constructor with its original parameters in PHP -

i have code: class { var $arr = array(); function __construct($para) { echo 'not called'; } } class b extends { function __construct() { $arr[] = 'new item'; } } and b has own constructor construct($para) of never gets called. now call parent::__construct($para) class b need aware of parameters class needs. i prefer this: class { var $arr = array(); function __construct($para) { echo 'not called'; } } class b extends { function __construct() { parent::__construct(); // parameters class b created. // additional actions not need direct access parameters $arr[] = 'new item'; } } would work? i don't fact, classes extend class need define new constructor, once class changes parameters, want them call constructor of class when class b not overwrite own __construct() method. one solution not override parent constructor in first place. instead, define separate (initially-empty) init(

linux - Why can't .configure for libnettle 2.7.1 find -lgmp even though it is there? -

i'm trying compile gnutls arm on x86 machine (ubuntu 11.04 under virtualbox). right i'm stuck compiling libnettle. ./configure script can't find -lgmp , produces nettle without public key cryptography (no libhogweed ) need. message in config.log follows: for x86: configure:6976: checking __gmpz_getlimbn in -lgmp configure:7001: gcc -o conftest -l"/home/xena/gnutls/out/x86/lib/" conftest.c -lgmp >&5 /usr/bin/ld: cannot find -lgmp collect2: ld returned 1 exit status configure:7001: $? = 1 and arm: configure:6976: checking __gmpz_getlimbn in -lgmp configure:7001: arm-none-linux-gnueabi-gcc -o conftest -l"/home/xena/gnutls/out/arm/lib/" -mcpu=arm926ej-s -mthumb conftest.c -lgmp >&5 /usr/local/codesourcery/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lgmp collect2: error: ld returned 1 exit status configure:7001: $? = 1 those libraries there: xena@xena-virtualbox:~/

Error on starting HDFS daemons on hadoop Multinode cluster -

issue while hadoop multi-node set-up .as start hdfs demon on master (bin/start-dfs.sh) i did got below logs on master starting namenode, logging /home/hduser/hadoop/libexec/../logs/hadoop-hduser-namenode-localhost.localdomain.out slave: warning: $hadoop_home deprecated. slave: slave: starting datanode, logging /home/hduser/hadoop/libexec/../logs/hadoop-hduser-datanode-localhost.localdomain.out master: warning: $hadoop_home deprecated. master: master: starting datanode, logging /home/hduser/hadoop/libexec/../logs/hadoop-hduser-datanode-localhost.localdomain.out master: warning: $hadoop_home deprecated. master: master: starting secondarynamenode, logging /home/hduser/hadoop/libexec/../logs/hadoop-hduser-secondarynamenode-localhost.localdomain.out i did got below logs on slave @ hadoop-hduser-datanode-localhost.localdomain.log file can advise me , whats wrong set-up . 2013-07-24 12:10:59,373 info org.apache.hadoop.ipc.client: retrying connect server: master/192.168.0.1

SQL Server convert to optimal short date -

what optimal short date convert in sql sever use in predicate. i have date 2013-06-11 15:06:27.000 , want use short date part 2013-06-11 in predicate. what best short date convert in sql server purpose? msdn - date convert for sql2005+: note: select convert(datetime, convert(varchar, datetimecolumn, 12)) <operator> <const> isn't sarg able! so, if have index on datetimecolumn sql server can't seek ( index seek ) on column. instead, sql server use index scan , clustered index scan or table scan . if want filter rows on datetime column use datetimecolumn >= rangestart , datetimecolumn < rangeend or datetimecolumn between rangestart , rangeend predicates. how can generated rangestart , rangeend ? declare @selecteddate datetime; set @selecteddate='2013-06-11 15:06:27.000'; select dateadd(day,datediff(day,0,@selecteddate),0) start, dateadd(day,datediff(day,0,@selecteddate)+1,0) [end 1],

android - Move animated movieClips using buttons instead of arrow keys -

i'm trying develop game want character run when click button, , continue running if hold button. i'm new actionscript 3, i'm bit lost here. i've found code satisfies requirements; uses arrow keys, below: function moverunkei() { if (key.isdown(key.right)) { dx = 15; //speed runkei._xscale = 50; } else if (key.isdown(key.left)) { dx = -15; runkei._xscale = -50; } else { dx = 0; } runkei._x += dx; if (runkei._x < 100) runkei._x = 100; //30 if (runkei._x > 550) runkei._x = 550; if (dx != 0 && runkei._currentframe == 1) { runkei.gotoandplay("run"); } else if (dx == 0 && runkei._currentframe != 1) { runkei.gotoandstop("stand"); } } this.onenterframe = function(){ moverunkei(); } i need able using buttons. //////////////////////////////////////////////////////////////////////////////////// import flash.events.event; va