Posts

Showing posts from July, 2010

design patterns - .net implementation of communication between aggregate roots in different bounded context -

this first time applying ddd concepts real world problem. i started 1 bounded context project relatively small. found myself classes identical i.e. similar names, similar properties different behaviour. starting think belong in different bounded contexts entities same , have different meaning in different context. supported fact application has 2 different user groups. i have done bit of reading on how 2 entities in different bounded context can communicate each other. think understand concept... have no idea how implement? there .net example somewhere? i.e. aggregate root in 1 bounded context publishing event aggregate root in bounded context? , aggregate root calling aggregate root in bounded context. and should each bounded context have own: service layer? repository , data layer? this may quote implementing domain driven design vaughn vernon. "perhaps common use of domain events when aggregate creates event , publishes it. publisher resides in module of m

sql - Why does NVL2 returns NULL when it's not expected? -

let preparation structure be create table resource1(id number, valuea varchar2(255)); create table resource2(id number, valueb varchar2(255)); create table ids(id number); insert ids select 1 dual union select 2 dual union select 3 dual union select 4 dual; insert resource1 select 1, 'abc' dual union select 2, 'def' dual; insert resource2 select 3, 'ghi' dual union select 4, 'jkl' dual; the following query select p.valuea, q.valueb , nvl2(p.valuea, q.valueb, p.valuea) from_nvl2 , case when p.valuea null q.valueb else p.valuea end from_case ids left join resource1 p on p.id = ids.id left join resource2 q on q.id = ids.id order ids.id; produces valuea valueb from_nvl2 from_case abc (null) (null) abc def (null) (null) def (null) ghi (null) ghi (null) jkl (null) jkl why from_nvl2 column contain nulls? i've been expecting from_nvl2 result in

Use a google form to update existing google spreadsheets -

i'm trying build google form fills out cells of existing google spreadsheet responses on google form. need of answers on google form come spreadsheet in drop down style menu. the existing spreadsheet being used organization have members log information on weekly basis, however, members continue fill out form incorrectly no matter how many times i've corrected them. reason i'm trying make process more automated. the way current spreadsheet set there multiple sheets different divisions of organization. in each sheet there column dedicated names in division, different name on each row of column. there columns dedicated specific weeks, week 1 information put column d , e, week 2 info in f , g, etc. ex: # | name | percent |... week 1 .... |... week 2 .... | .... 1 |.. bob..| 0%..... ..| info 1| info 2 | info 1| info2..| 2 | ..joe..| 99%......| info1.................................. i'd able to: make first question of form drop down menu

Define connection strings in sharepoint -

i'm new sharepoint. i'm trying connect sql database inside sharepoint webpart using spsqldatasource . code working well. need set connectionstring without refering web.config is there way define in variable kind of thing in sharepoint, user can define connectionstring in ui without editing web.config file. ? if want every webpart, web part custom property . for example: [webbrowsable(true), webdisplayname("connectionstring"), webdescription("the connectionstring."), personalizable(personalizationscope.shared), category("yourcategory"), defaultvalue("")] public string connectionstring { get; set; } it show sharepoint-option. think there better solutions out there, because have set every webpart , user needs permissions editing webparts.

sql server - Execute T-SQL stored procedure in update trigger with select from inserted as a parameter -

trying pass updated value stored procedure parameter inside update trigger. correct syntax achieve if possible? i looking way use select directly in call stored procedure (using execute ). there don't seem other way inside update trigger retrieve updated value select inserted most relevant solution somehow move select inside called stored procedure if returns record set can't modify , have scalar pass. don't have use local variable pass value, seems possible not elegant. thanks. if want column names , columns values got affected during update , save in audit table in database may try below trigger alter trigger [dbo].[tr_location_audit] on [dbo].[location] update declare @bit int , @field int , @maxfield int , @char int , @fieldname varchar(128) , @tablename varchar(128) , @pkcols varchar(1000) , @sql varchar(2000), @updatedate varchar(21) , @username varchar(128) , @type char(1) , @pkselect varchar(1000) --you need change

javascript - scribd set page not working -

i using scribd display pdf. clicking on page 3,middle,end links corresponding pages should load. pages not loading properly. , in ff not getting errors. in chrome console getting error. failed execute 'postmessage' on 'domwindow': target origin provided (' http://www.scribd.com ') not match recipient window's origin (' https://www.scribd.com '). can me out in this? <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>scribd javascript api demo</title> <script type="text/javascript" src='https://www.scribd.com/javascripts/scribd_api.js'></script> </head> <body> <div id="container"> <div id='col1'> <div id='embedded_doc'><a href='https://www.scribd.com'

2d games - Java Image Drawing -

i'm in process of making simple 2-d game, having trouble drawing images. below few classes relevant problem private vector<bullet> ammo = new vector<bullet>(100); public class bullet{ image img; int x, y, speed; boolean show; bullet(image img,int x, int y, int speed, boolean show){ this.x = x; this.y = y; this.speed = speed; this.img = img; this.show = show; } public void draw(imageobserver obs) { if(show) g2.drawimage(img, this.x, this.y, obs); } public void update(){ this.y -= 1; } } public class movement{ .... movement(....){ ..... } public void fly(){ ...... ammo.add(new bullet(bullet1, m.x, m.y, 7, true)); } public class myplane { keycontrol key; movement flight; image img; int x, y, speed, move = 0; int boom; ... } public void drawdemo() { ... for(bullet bu

java - Application is freezing when database is called -

i have lot of things implemented in componentadapter of java. since loading data database , displaying in jtable , added thread. show 1 method being called such componentadapter private class displayinitialrevenue_thread implements runnable { @override public void run() { displayinitialrevenue_method(); } } private void displayinitialrevenue_method() { //get dates combo string selectedcouple = revenueyearcombo.getselecteditem().tostring(); if(selectedcouple.equals("select year")) { return; } string[] split = selectedcouple.split("/"); //related db double totalamountinvested; //get data database dbconnector = new dbhandler(); dbconnector.makeconnection(); defaulttablemodel model = (defaulttablemodel) initialrevenuetable.getmodel(); model.setrowc

php - Need To redirect At home page If user Already logged in -

i using omniauth devise . controller bellow class omniauthcallbackscontroller < devise::omniauthcallbackscontroller def facebook # need implement method below in model (e.g. app/models/user.rb) @user = user.from_omniauth(request.env["omniauth.auth"]) if @user.persisted? sign_in_and_redirect @user, :event => :authentication #this throw if @user not activated set_flash_message(:notice, :success, :kind => "facebook") if is_navigational_format? else # session["devise.facebook_data"] = request.env["omniauth.auth"] redirect_to new_user_registration_url end end end this redirect user signup page if user signin , persist.what make change redirect user @ home page.......????? me out please have set after sign_in path ? #application_controller.rb def after_sign_in_path_for(resource_or_scope) case resource_or_scope when :user,

android - Adding SubtitleUrl is killing my app(ANR) -

hi guys may sound bit silly, when i'm loading hls stream url android videoview player begins streaming video fine, when add subtitle url same app crashes when seek, lose complete control on app , video stream not stop playing(i.e keeps playing in background). this i'm doing.(pls me figure out mistake im doing.thanks in advance) mvideoview.setvideouri(uri.parse(mprofileurl)); mvideoview.setmediacontroller(new mediacontroller(this)); if (null != msubtitleurl && android.os.build.version.sdk_int >= android.os.build.version_codes.kitkat) { new addsubtitleasync().execute(msubtitleurl); } } //*************************************************************************** class addsubtitleasync extends asynctask<string, void, inputstream> { progressdialog pd; @override protected void onpreexecute() { // pd = progressdialog.show(mparentnotifier.getparentactivty(), "", "", false, false); } @su

backbone.js - MarionetteJS - Not able to render the data using toJSON function -

i using handlebarsjs plugin render templates. getting error while call rendering function. when console this.model.tojson() , getting correct datas, console "homeedittemp" getting templates too.. but when pass data template getting error : uncaught typeerror: undefined not function here code : define([ 'jquery', 'underscore', 'backbone', 'marionette', 'hbs!scripts/templates/home/homeedittemp'], function ($,_,backbone, marionette, homeedittemp) { "use strict"; window.socialapp = window.socialapp || {}; socialapp.homeview = backbone.marionette.itemview.extend({ initialize : function (model) { this.model = model; }, render : function () { console.log(this.model.tojson()) // works fine console.log(homeedittemp) // works fine. this.$el.html(ho

How do I look up a Clojure keyword in IPersistentMap from Java? -

calling clojure library java program. ipersistentmap back. the keys clojure keywords :name etc. but seems can't map.valat(":name"); to pull out in java. i'm guessing that's because keys aren't normal java strings. they? , how can pull data out of ipersistentmap? have tried using clojure.read ? => map.valat(clojure.read(":name")) or maybe => // (:name my-map) mymap.invoke(clojure.read(":name")); clojure 1.6 java api https://github.com/clojure/clojure/blob/master/changes.md#21-java-api clojure's javadoc https://clojure.github.io/clojure/javadoc/

ios - Loop through array contents' names -

i want display .gif (so automatically playing video), therefore found out need use array of uiimages . now, have video containing 96 images, use loop naming them. possible? i tried following, unfortunatly not work: for (int = 0; i<97; i++) { [uiimage imagenamed:@"%d", i]; } so want loop this: nsarray *myarray = [nsarray arraywithobjects: (int = 0; i<97; i++) { [uiimage imagenamed:[nsstring stringwithformat:@"%d",i]]; } , nil]; so there way using for-loops in array? ideas? create property in .h file : @property(nonatomic, strong) nsmutablearray *images; initialise in viewdidload method : - (void)viewdidload { [super viewdidload]; self.images = [[nsmutablearray alloc] init]; } you need following : for (int = 0; i<97; i++) { uiimage *currentimage = [uiimage imagenamed:[nsstring stringwithformat:@"%d",i]]; [self.im

Regex in config for dynamic columns in logstash -

i have log file of have pasted 2 rows below: nov 26 14:20:32 172.16.0.1 date=2014-11-26 time=14:18:37 devname=xxxxcccfffff devid=xxxccvvgffdd logid=3454363464 type=traffic subtype=forward level=notice vd=root srcip=172.16.1.251 srcport=62032 srcintf="combo_lan" dstip=x.x.x.x dstport=x dstintf="wan2" sessionid=16172588 status=close user="x.x" group="open group" policyid=2 dstcountry="united states" srccountry="reserved" trandisp=snat transip=x.x.x.x transport=x service=http proto=6 applist="block_applications" duration=11 sentbyte=2377 rcvdbyte=784 sentpkt=6 rcvdpkt=7 identidx=5 utmaction=passthrough utmevent=webfilter utmsubtype=ftgd-cat urlcnt=1 hostname="tacoda.at.atwola.com" catdesc="advertising" nov 26 14:20:32 172.16.0.1 date=2014-11-26 time=14:18:37 devname=xxxxcccfffff devid=xxxccvvgffdd logid=3454363464 type=utm subtype=webfilter eventtype=ftgd_allow level=notice vd="r

When using git, every time I need to fix a bug, should I create a new branch from master ,or try to re-use a branch like "my_fix_bug" repeatly? -

after read this: git branch naming best practices think should create new branch master, naming "fix_[issue number]" it's easier know branch branch name. but colleague think it's better keep branch counts low, , doesn't think branch name issue. am using git branch wrong, or okay use git branch in different ways? don't forget "number of branches" isn't absolute in distributed version control system git. your local repo can use many branches @ needs. , yet: you can push limited number of it. you can push local branch under different name on remote repo for other rules , suggestions: " too many live branches in project ".

css - What's equivalent to "font-size-adjust"? -

i want specify 2 different fonts in font-family ( font-family:a, b; ) sizes of these 2 fonts different. it seems font-size-adjust onlys work in firefox. how can adjust second font size if first 1 not available? you cannot. conclusion should list fonts sufficiently similar in properties. well, there tricks used detect availability of font on basis of properties. use font (only) invisible inline test element containing text , compare, using javascript, width of test element measured width (allowing small difference, since different implementations of font may yield different widths). if widths don’t match, change font size setting element(s) have font-family: a, b , size suitable b. well, still have problem font b might not available either. messy, no real guarantee of success.

build - Writing makefile to compile several binaries -

i trying write makefile compile 87 files following names: file1.c, file2.c file3.c .... file87.c i trying compile them separate binaries names: file1, file2, file3 .... file87 in makefile need define following variables each , every 1 of them. this had originally . file1 = file1 $(file1)_src := \ mydir/file1.c \ mydir/another.c $(file1)_cflags := `pkg-config --cflags glib-2.0` $(file1)_ldflags := -l. `pkg-config --libs glib-2.0` file2 = file2 $(file2)_src := \ mydir/file2.c \ mydir/another.c $(file2)_cflags := `pkg-config --cflags glib-2.0` $(file2)_ldflags := -l. `pkg-config --libs glib-2.0` also @ end of makefile need store names of binaries binaries = $(file1) $(file2) ...... $(file87) i explored loops , define directive in make cannot understand how can neatly in non-cumbersome manner. please note cflags , ldflags same of them. any inputs or alternative approaches writing makefile welcome. i wrote based on seldon's

uploading php file type with php code -

i have following piece of code uploading different file types onto server. picture files , pdf. trying upload .php file getting error. $folder = $_post['folder_name']; $allowedexts = array("gif", "jpeg", "jpg", "png", "pdf", "php"); $temp = explode(".", $_files["file"]["name"]); $extension = end($temp); if ((($_files["file"]["type"] == "image/gif") || ($_files["file"]["type"] == "image/jpeg") || ($_files["file"]["type"] == "image/jpg") || ($_files["file"]["type"] == "image/pjpeg") || ($_files["file"]["type"] == "image/x-png") || ($_files["file"]["type"] == "application/pdf") || ($_files["file"]["type"] == "application/php

php - How to push a mysql result's fields up to become the property of a class -

how can push mysql result result's fields become property of class? for instance, result, object(articlemodel)[4] public 'item' => object(stdclass)[7] public 'article_id' => string '4' (length=1) public 'parent_id' => string '4' (length=1) public 'template_id' => string '4' (length=1) public 'type' => string 'page' (length=4) public 'url' => string 'home' (length=4) public 'title' => string 'home' (length=4) ... , on... i want this, object(stdclass)[7] public 'article_id' => string '4' (length=1) public 'parent_id' => string '4' (length=1) public 'template_id' => string '4' (length=1) public 'type' => string 'page' (length=4) public 'url' => string 'home' (l

java - How Can I Write A Program for File Synchronization Between Drives -

while working; there problem , c drives can not reachable anymore.now want write program sychronize desktop , d. way should follow. additionally ; tried perform without program following way failed. subst d: c:\users\geek\desktop creating virtual driver , map desktop , d driver . thanks you can java, c# or other platform with java can follow tutorial. watch directory changes copy changed files other drive. watching directory changes for c# can use class , apply same solution .net filesystemwatcher class reference or can use tool synchronization freefilesync good luck

emacs not accepting lambda in after-change-functions -

i'm attempting overload after-change-functions in given buffer through class method. notify-others-of-change arbitrary function. (defmethod set-after-change-functions ((server server-class) name-of-buffer) "adds appropriate after-change-functions given name-of-buffer." (with-current-buffer name-of-buffer (setq-local after-change-functions (cons (lambda (beg end prev-length) (notify-others-of-change server beg end prev-length)) after-change-functions)))) when attempting run on given buffer (passing in valid server object, checked), emacs yells @ me "symbol's value variable void: server" , after-change-functions goes nil, if there elements in before. however, when changed to (defmethod set-after-change-functions ((server server-class) name-of-buffe

html - How to align label and radio button? -

when read this... still haven't solved issue, i'm trying align label , radiobutton, have tried alot of "solutions", nothing works. have no css on radio buttons created myself. output: http://prntscr.com/5am898 my code: <div class="row"> <div class="col-md-12"> <div class="btnradio"> <label class="radio-inline" for="gal2015lbl"> <input name="galtab" id="gal2015" value="2015" type="radio">2015 </label> <label class="radio-inline" for="gal2014lbl"> <input name="galtab" id="gal2014" value="2014" type="radio">2014 </label> <label class="radio-inline" for="gal2013lbl"> <input name="galtab" id="gal2013" val

DCM4CHE refuse some DICOM with org.dcm4che3.net.NoPresentationContextException -

i have run dcm4che3 server, , dicom refused message org.dcm4che3.net.nopresentationcontextexception: no presentation context abstract syntax: 1.2.840.10008.5.1.4.1.1.6.1 - ultrasound image storage negotiated from documentation 1.2.840.10008.5.1.4.1.1.6.1 ultrasound image storage if check in service=storescp / acceptedimagesopclasses have computedradiographyimagestorage digitalxrayimagestorageforpresentation digitalxrayimagestorageforprocessing digitalmammographyxrayimagestorageforpresentation digitalmammographyxrayimagestorageforprocessing digitalintraoralxrayimagestorageforpresentation digitalintraoralxrayimagestorageforprocessing ctimagestorage enhancedctimagestorage ultrasoundmultiframeimagestorage mrimagestorage enhancedmrimagestorage enhancedmrcolorimagestorage ultrasoundimagestorage enhancedusvolumestorage secondarycaptureimagestorage multiframesinglebitsecondarycaptureimagestorage multiframegrayscalebytesecondarycaptureimagestorage multiframegrayscale

php - Opencart Shipping Method Required -

i have created new shipping module based on post below http://forum.opencart.com/viewtopic.php?f=142&t=30226 the shipping method checks members group user in, , if qualify free delivery based on cart price. works great, except when go checkout , select free shipping method comes error "warning: shipping method required!" the model shipping below, can shed light on this? <?php class modelshippingfreeusergroup extends model { function getquote($address) { $this->language->load('shipping/freeusergroup'); $customer_group_id = $this->customer->getcustomergroupid(); if ($customer_group_id < 1)$customer_group_id = 1; $cart_total = $this->cart->gettotal(); $strquery = "select * " . db_prefix . "members_delivery " . " price <= '" . $cart_total . "' , customer_group_id = '" . $customer_group_id . "' " .

how to catch double values from formatted text file in c# -

i want extract data excell file , edit fields , save in db excell file contains values alpha=10e-4 , beta=10e-4 want save example alpha , beta values in separate fields , store theme in double format how doing this: example if string file rr="alpha=10e-4 , beta=10e-4" string alpha=""; string beta=""; alpha=rr.substring(0,indexof(",")+1); alpha=alpha.replace("alpha=",""); alpha=alpha.replace(" , ",""); double alpha=convet.todouble(alpha); i pretty sure way not clever way of extracting values text file, , may not work when add space or how can this? parallels? using regular expressions, first, read file string variable , pass regex.matches: var input = file.readalltext(path); var matches = regex.matches(input, @"(\d+e\-\d)"); foreach (var match in matches) { }

Transfer Data from MySQL to Elasticsearch -

i develop website php, working mysql database storage engine. analyzing purpose use kibana (web based analytics , search dashboard). there 2 questions ask. is possible connect kibana mysql? used work elasticsearch , kibana. if kiban must work elasticsearch. there way transfer data mysql elasitcsearch? kibana works elasticsearch - you'll need copy data across elasticsearch. you try river service or else use triggers in mysql create posts elasticsearch.

java - H2 database keeps growing: How to analyze the output of the Recover tool? -

we use h2 long running process stores many short-lived “events” embedded h2 database. there’s high throughput of rows being inserted , deleted, frequency of events varies. on semi-productive system database file had grown 27 gib. after compacting thoroughly, file has 1.25 mib. that’s factor >20000! i understand h2 not compact during runtime mark , reuse free space , think should ok. @ point there should balance between used , free space , database file should not need grow further. h2’s recover tool recommended analyze such situations (with switch -transactionlog ). how interpret output of recover tool? first of all, statistics section @ bottom: ---- statistics ---- -- page count: 14147341, free: 14106216 -- page data bytes: head 612539, empty 20613944, rows 9040909 (32% full) -- free 99%, 14108082 page(s) -- data leaf 0%, 14779 page(s) -- data node 0%, 241 page(s) -- btree leaf 0%, 2644 page(s) -- btree node 0%, 564 page(s) -- free list 0%, 865 page(s) -- stream trunk

image - Java Bitmap RLE8 format -

does java imageio (or other image handlers) support bi_rle8 image format? thing have managed find bmpimagewriteparam have no idea whatsoever how use that. wonderful. see this example how write using imagewriter , using imagewriteparam (use instance of bmpimagewriteparam in case). scroll bit down find write example. instead of line: imagewriteparam param = writer.getdefaultwriteparam(); you should insert like: bmpimagewriteparam param = new bmpimagewriteparam(); param.setcompressionmode(imagewriteparam.mode_explicit); param.setcompressiontype("bi_rle8"); you can safely pass null thumbnails , metadata ( ... in example).

java - JAIN-SIP support for RFC 7339 -

is there way add custom via header in jain-sip ? adding oc-parametrs rfc 7339 . enter link description here place got following example, not sure if work. quote link: this achieved adding code implementation of javax.sip.message.message.addheader(header header) function. void addheader(header header) { if(!(header instanceof internalheaderobject) && header instanceof extensionheader) { extensionheader extensionheader = (extensionheader) header; header = headerfactory.createheader(extensionheader.getname(), extensionheader.getvalue()); } ... } i start saying can absolutely handle custom via headers in terms of sip long valid sip. rfc need use viaheader.set/getparameter if not missing something. the blog post talks creating own header classes, not relevant needs far can imagine. custom header classes tricky , inefficient. example jain sip automatically construct it's own viaheader instance inbound messa

how to get the value of a function from a button click in javascript? -

i new javascript , trying go through tutorials understand concepts. this function function tocelsius(fahrenheit){ (5/9) * (fahrenheit-32); document.getelementbyid("demotemp").onclick.tostring(); } and trying invoke here: <form> <br> enter number: <input type="text" name="firstname"> <!-- <input type="text" name="lastname"> --> <button type="button" onclick="tocelsius()"> new temp in celsius </button> </form> <p id="demotemp"></p> i want user able enter value , hit button tell them new temperature fahrenheit celsius just put result in inner html. function tocelsius(){ var fahrenheit = document.getelementsbyname("firstname")[0].value; var cel = (5 / 9) * (fahrenheit - 32); document.getelementbyid("demotemp").innerhtml = cel; }

c++ - Error while executing Eigenfaces algorithm in OpenCV -

i have problem code eigenfaces i've found on opencv tutorial page. the code this, same can find on related page ( http://docs.opencv.org/modules/contrib/doc/facerec/facerec_tutorial.html#eigenfaces-in-opencv ): /* * copyright (c) 2011. philipp wagner <bytefish[at]gmx[dot]de>. * released public domain under terms of bsd simplified license. * * redistribution , use in source , binary forms, or without * modification, permitted provided following conditions met: * * redistributions of source code must retain above copyright * notice, list of conditions , following disclaimer. * * redistributions in binary form must reproduce above copyright * notice, list of conditions , following disclaimer in * documentation and/or other materials provided distribution. * * neither name of organization nor names of contributors * may used endorse or promote products derived software * without specific prior written permission. * * see <http

jquery - Issue to include wp-config.php file in wordpress plugin file -

i working on plugin, in plugin create ajax (in plugin index file) when user write in search bar related posts title shows in drop down , result create other file "foo_get_posts.php" in plugin root directory. here code: function foo_search_form(){ ?> <div class="foo_search_field"> <form role="search" method="get" id="searchform" class="clearfix" action="<?php echo home_url( '/' ); ?>" autocomplete="off"> <input type="text" onfocus="if (this.value == '<?php _e("search posts...", "foo") ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e("search posts...", "foo") ?>';}" value="<?php _e("search posts...", "foo") ?>" name="s" id="s" /> <ul

How to return the value of a 2D array in java -

i have array class shown below, when run program, gives me error message: error: main method not found in class sarray, please define main method as: public static void main(string[] args) or javafx application class must extend javafx.application.application have no idea how should modify codes solve problem, cause seems there no need me have main method. public class sarray { public void sets(double[] s) {} public sarray(double[] s) { super(); } public double[][] gets(){ double[ ][ ] s = {{ x,x,x}, { x,x,x},{ x,x,x}}; for(int x = 0; x<s.length; x++){ for(int y = 0; y<s[x].length; y++){ system.out.println(s[x][y]); } } return s; } } apparently problem not related return type of gets project setup expects sarray have application entry point.

In python, how would I go about linking user input to a index in a list? -

i create binary puzzle python. @ moment made 6x6, 8x8 , 10x10 layout shown based on difficulty players wishes play. purpose of puzzle can compared game of sudoku, want input either 0 or 1 on given location player. below find have layout. if graad == 1: easy = [['a', 'b', 'c', 'd', 'e'], ['_','_','_','_','_','_','_'], [0,1,0,1,0,1,' |1'], [1,0,1,0,1,0,' |2'], [0,1,0,1,0,1,' |3'], [1,0,1,0,1,0,' |4'], [0,1,0,1,0,1,' |5'], [1,0,1,0,1,0,' |6']] = 0 while < len(easy): j = 0 s = "" while j < len(easy[i]): s = s + str(easy[i][j]) + " " j = j + 1 print (s) = + 1 now problem facing is, how can let python know when player fills in position 3 on column c , row 5 0 example? thinking of if statement checks input

eclipse - Android Studio cannot find symbol error -

i'm sorry if noob question have moved eclipse android studio , have never used gradle before. have imported 1 project eclipse depends on 3 libraries (uil,androidbootstrap,androidlockpattern).the libraries can seen under root directory of android studio project,but when click build keep getting following errors g:\androidstudioprojects\p3 authentication\p3authentication\src\main\java\com\p3authentication\captcha_verfication.java error:(11, 45) error: cannot find symbol class settings error:(25, 18) error: cannot find symbol variable matrix_width error:(27, 11) error: package settings not exist error:(28, 49) error: cannot find symbol variable action_verify_captcha error:(47, 28) error: cannot find symbol variable result_failed error:(58, 25) error: cannot find symbol variable extra_retry_count g:\androidstudioprojects\p3 authentication\p3authentication\src\main\java\com\p3authentication\compare_pattern.java error:(35, 18) error: cannot find symbol variable matrix_width error:(

C# string operation -

this question has answer here: get substring - before char 5 answers i have string: string str = "abc = def; \r\n header \r\n { \r\n def" in string want string before character { i.e, "header". i can index of { str.indexof('{') but how can string before '{' ? edited after codecaster comment string str = "abc = def; \r\n header \r\n { \r\n def" int length = str.indexof('{'); // if there no match - resulted value -1 string result = (length < 0) ? string.empty : str.substring(0, length);

ios - map geocode API gives Null response -

i'm using below code getting geocode response of particular address, nsstring *address = @"doha,qatar"; nslog(@"address : %@",address); nsstring *esc_addr = [address stringbyaddingpercentescapesusingencoding: nsutf8stringencoding]; nsstring *req = [nsstring stringwithformat: @"http://www.maps.google.com/maps/api/geocode/json?address=%@&sensor=false", esc_addr]; nsurl *url=[nsurl urlwithstring:req]; nslog(@"url : %@",url); nsdata *data=[nsdata datawithcontentsofurl:url]; nslog(@"data : %@",data); nserror *error=nil; id response=[nsjsonserialization jsonobjectwithdata:data options: nsjsonreadingmutablecontainers error:&error]; nslog(@"the json object: %@ or error is: %@", response, error); but response null. the response, 2014-11-27 16:35:48.961 myproj[15279:254055] address : doha,qatar 2014-11-27 16:35:48.961 myproj[15279:254055] url : http:/

asp.net - How to show data in a page temporally untill user confirms them? -

i developing website using asp.net. have page users can put advertisements website. has select location , ad category type contact details , post ad. after finishing has press button proceed. then hope took him new page showing him how ad show in website. if has modifications can go , again has press proceed button after editing it. if satisfied can confirms ad records should add database. so wondering temporary keep these data , show in page? my idea store these details in sessions or in cache. think session good. people saying should avoid using sessions @ cost because eat ups memory in server. going display not critical data. dont want security regarding data. tell me best way show user's entered data in page temporally until user confirm it?

java - Running JUnit tests with and without before/after hooks -

i have situation need able run suite of junit tests under 2 different "modes": with first mode, use @before , @after annotations/methods used; but... with second mode, not use these annotations/methods, run same @test methods for example: public class widgettest { @before void start() { // start work. } @after void stop() { // shutdown work. } @test public void testwidget() { // given/when/then, etc. } } in "mode #1", want @before , @after methods ( start() , stop() respectively) execute before/after testwidget() . in "mode #2", only want testwidget() method fire. the best can come is: public class widgettest { private boolean usehooks; // ctor, getter , setter 'usehooks'. @before void start() { if(usehooks) { // start work. } } @after void stop() { if(usehooks) { // shutdown work.

Backup android to ubuntu from recovery mode -

i have - stupidly enough - updated android phone newest 5.0 lollipop. update went bad , many hours later phone still unresponsive. can enter in recovery mode. have seen in forums many other users had same problem , turns out way out factory reset of phone. means total loss of phone data. have no backups (as far concerned) wondering if there simple way transfer data phone computer (ubuntu) while phone being in recovery mode. this tried already: started phone in recovery mode selected 'apply update adb' (as apparently way computer sees phone through $ adb devices) i type $ adb devices list of devices attached 02452a1acc14c9d4 sideload and then $ adb backup -apk -shared -all adb: unable connect backup my phone not rooted, pretty sure usb debugging activated. ideas? possible @ backup phone in recovery mode? thanks in advance. helps know phone have. key sequence needed boot recovery mode. i'd flashing clockwork mod recovery can mount phone

c++ - Change cl/link.exe default libraries from cmdline? -

i'm trying understand of fundamental windows libraries, c standard library. use vs 2013. i switched command line compiling in order try , have more control on libraries linked in, can see functions/headers resolve libraries. however, cl.exe (i haven't tried individual compilation/linkage) seems automatically including number of libraries, can compile , execute number of programs dependencies (core ones input/output) without specifying libraries myself. does cl.exe compiler automatically include number of libraries command line, if so, how can change this!? thanks! renzo.

validation - How do I custom validate collections withing MVC5 -

i building mvc5 application , have following viewmodels: public class userpartyviewmodel { public userpartyviewmodel() { entitlements = new collection<assignedclaims>(); } public guid partyid { get; set; } public string partyname { get; set; } public icollection<assignedclaim> assignedclaims{ get; set; } } public class assignedclaims { public assignedclaims() { claimvalues = new collection<assignedclaimvalue>(); } public string name { get; set; } public int max { get; set; } public int min { get; set; } public icollection<assignedclaimvalue> claimvalues { get; set; } } public class assignedclaimvalue { public guid claimvalueid { get; set; } public string claimvalue { get; set; } public bool assigned { get; set; } } contained in userpartyviewmodel assignedclaim name of "security" , assignedclaimvalue claimvalue of "user" if claimvalue of user assign