Posts

Showing posts from July, 2010

Intent with Countdown crashes android app -

my android app crashes when reaches countdown 0 . below part of code related it. final countdowntimer countdown=new countdowntimer(60000, 1000){ public void ontick(long millisuntilfinished) { tvtime.settext((millisuntilfinished / 1000)+"'s"); } public void onfinish() { try{ tvtime.settext("time over"); this.cancel(); toast.maketext(getapplicationcontext(),"answer: "+ originalword, toast.length_long).show(); intent i=new intent(lastjumble.this,scorecard.class); i.putextra("username",username); i.putextra("totalques", totalques); i.putextra("count", count); startactivity(i); } catch (exception e) { // todo: handle exception } ...

mysql - Create new records from a field with comma delimited values -

i have poorly created table want update. set as id name value because given name can have more 1 value right value field varchar , populated comma delimited values: 12,15,92 i create update or create table query make separate records table with id | name | value 1 | bob | 5,6,9 2 | alice| 5,9 3 | ted | 1 ends as 1 | bob | 5 2 | bob | 6 3 | bob | 9 4 | alice | 5 5 | alice | 9 6 | ted | 1 in searching online appear pretty common issue , found 1 of several functions splitting delimited fields records here: http://kedar.nitty-witty.com/blog/mysql-stored-procedure-split-delimited-string-into-rows

javascript - upload multiple images into different divs -

i have 2 buttons, want both upload 2 different files , display these inside of 2 different divs. code works fine 1 image. how modify code able handle 2 images? thanks! my code @ moment is: html: <div class="span12"> <span class="btn btn-default btn-file"> browse 1 <input type="file" onchange="readurl(this);"></span> <span class="btn btn-default btn-file"> browse 2 <input type="file" onchange="readurl(this);"></span> <div class="place-image" id="myimage"> <div class= "place-content" id="myimage2" onkeypress="return (this.innertext.length <= 16)"> <p contenteditable="true">sale<br>40%</p> </div> </div> javascript: <script> function readurl(input) { if (input.files && input.files[0]) { ...

Java's compiler not retaining generic method annotations? -

i encountering issue java's generic type erasure , runtime annotations , not sure whether doing wrong or bug in java compiler. consider following minimal working example: @target({ elementtype.method, elementtype.type }) @retention(retentionpolicy.runtime) @inherited public @interface myannotation { } public interface mygenericinterface<t> { void hello(t there); } public class myobject { } public class myclass implements mygenericinterface<myobject> { @override @myannotation public void hello(final myobject there) { } } now when query information myclass.hello reflection expect hello method still has annotation, not: public class mytest { @test public void testname() throws exception { method[] declaredmethods = myclass.class.getdeclaredmethods(); (method method : declaredmethods) { assert.assertnotnull(string.format("method '%s' not annotated.", method), method ....

rest - How to specify a parameter in an HTTP GET request -

i developing rest api , make request retrieves in json format user specified "username", like: { id: "559d7ced2de324e22a78998b" firstname: "fname" lastname: "flast" username: "testpassword" password: "testusername" address: "123 road" city: "washington dc" state: "california" zipcode: "2345" phonenumber: "234523452345" email: "email@gmail.com" } the path /users, like: http://localhost:8080/users my question is, how make request call specifies username. is this: http://localhost:8080/users/?username=testusername ? this java method. using spring rest: /* user username */ @requestmapping(method=requestmethod.get, value="{username}") public user getuserbyusername(@pathvariable string username) { return repo.findbyusername(username); } it right format http://localhost:8080/users?username=testusername if have more 1 p...

Scroll down a notepad file using java -

i want scroll down notepad file in order capture screenshots, when try capture screenshot able capture visible part, have tried multiple ways nothing seems work. can suggest solution this? in advance!! i'm using below code jframe frame = new jframe(); frame.setsize(200, 200); frame.setvisible(true); try { thread.sleep(2000); } catch (interruptedexception e) { throw new runtimeexception(e); } robot robot = new robot(); robot.keypress(keyevent.vk_alt); robot.keypress(keyevent.vk_printscreen); robot.keyrelease(keyevent.vk_printscreen); robot.keyrelease(keyevent.vk_alt); try { thread.sleep(2000); } catch (interruptedexception e) { throw new runtimeexception(e); } string shot = "screenshot"+com.getuniquename()+".png"; transferable t = toolkit.getdefaulttoolkit().getsystemclipboard()....

android - Failed to complete Gradle execution when i use "compile project" -

this first gradle file apply plugin: 'com.android.application' apply plugin: 'com.neenbedankt.android-apt' apply plugin: 'com.google.gms.google-services' android { compilesdkversion 21 buildtoolsversion "21.1.2" defaultconfig { applicationid "it.hairlookapp.hairlook" minsdkversion 15 targetsdkversion 21 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } debug { debuggable false } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) apt 'com.bluelinelabs:logansquare-compiler:1.1.0' compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.android.support:support-v4:22.2.0' compile 'com.b...

jquery - Move an element when page is scrolled -

i want control various div elements upon page scroll, similar lamoulade.com . i want 300px x 300px div move left right when scroll down, , right left when scroll up. how can achieve that? $(document).ready(function () { $(window).scroll(function () { if ($(this).scrolltop() > 100) { $('.scrollup').fadein(); } else { $('.scrollup').fadeout(); } }); } here's common example makes scroll top button appear when page has been scrolled little. can use same technique make other changes dom / animation on screen scroll points.

swing - Add MouseListener to java.awt.Image -

is there way can add mouselistener image? took @ this stackoverflow question, didn't answer how java.awt.image , there no graphics2d image class. or @ least 1 i've found. edit: to clarify, let me try explain: with ellipse2d , can say: if(ellipse2d.contains(mousex, mousey) { ...do } is possible java.awt.image (i.e. image.contains() ) also, how image gets added jpanel: image image = item.geticon().getimage(); //item.geticon() returns javax.swing.imageicon g.drawimage(image, imagex, imagey, null); you can put image in jlabel , add listener jlabel imageicon image = item.geticon(); jlabel labelwithimage = new jlabel(image); labelwithimage.addmouselistener(new mouseadapter() { @override public void mouseentered(mouseevent e) { system.out.println("mouse entered on image"); } }); panel.add(labelwithimage);

ios - View Object for Dropdown selection -

i'm looking create ui in swift xcode, can't find correct object it. have array of elements (think tableview). want select subset of these elements. when object not clicked on (dropped down) want display list of selected elements. ideas use? waiting [element a] [element d] selected [element a*] [element b] [element c] [element d*] [element e] thanks

php - Increment char in for loop -

i know how can make : php function exists ? for ($i=0; $i < 26; $i++) { // echoes "a" ... b ... c ... } php supports perl-style character incrementing so use for($char = 'a'; $char !== 'iw'; $char++) { echo $char, php_eol; } which print out a iv .... important use !== in terminating comparison though

linux - How to make a script run in buildroot as a boot script after init -

i building custom initramfs buildroot busybox used automated fdisk partitioning. how/where put script file busybox boots , executes automatically. how make script run in buildroot boot script after init you cannot use 1 script file both purposes. you'll need 1 script execution on target, , method on host modify target's prototype filesystem. the typical method of installing scripts , files target's filesystem generated buildroot specify "post-build script". script executed before root filesystem tar ed or ubinize d. from section 4.1 customizing generated target filesystem of buildroot user manual : in buildroot configuration, can specify path post-build script, gets called after buildroot builds selected software, before rootfs packages assembled. destination root filesystem folder given first argument script, , script can used copy programs, static data or other needed file target filesystem. a subdirectory board under build...

swift - How to call a method with conditional binding only if other property exists -

so wondering if possible call method uses other property in conditional binding if other property not nil in 1 liner. something pseudo code: if let foo = method(prop), bar = prop { // foo } this invoke method(prop) if prop in not nil: if let prop = prop, let foo = method(prop) { // foo }

html - Windows Phone - Hyperlinks Requiring Long Press -

so i've run in issue when testing site on nokia lumia 920, seems occurring on site. basically, when pressing hyperlink, nothing happens apart hover effect being applied very, briefly, , grey opacity background appearing. link clicked i'm having hold finger down short amount of time, not quite long enough context menu opens. is there can work out causing or fixes can try? i have tried following on body doesnt' seem have helped any: -ms-touch-action: manipulation; /* ie10 */ touch-action: manipulation; /* ie11+ */ thanks

javascript - Regular Expression is not working using onkeyup function -

$(function(){ $('#addaction').click(function(){ count += 1; $('#extras').append('<div class="row"><div class="col-md-1">delivery fee: </div><input id="price_' + count + '" name="prices[]' + '" type="text" onkeyup="javascript:this.value=this.value.replace(/[^0-9.]/g, \'\');" /></div>' ); }); }); i don't know why regular expression not replacing value empty string. if want add alphabet value in numeric field, alphabet value should remove numeric field, tried, not working, kindly tell me proper solution. javascript: needed href attribute of anchor elements. <input type="text" onkeyup="this.value=this.value.replace(/[^0-9.]/g, '');" />

c# - Get the selected color from Colors listBox -

Image
i'm trying shows colors in listbox . using example and here's code <window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" xmlns:local="clr-namespace:wpfapplication1" xmlns:sys="clr-namespace:system;assembly=mscorlib" x:class="wpfapplication1.mainwindow" x:name="window" title="all colors" width="640" height="480" > <window.resources> <objectdataprovider methodname="gettype" objecttype="{x:type sys:type}" x:key="colorstypeodp"> <objectdataprovider.methodparameters> <sys:string>system.windows.m...

rust - 'Unresolved name' inside macro despite 'ident' designator -

i'm playing around rust macro system in order learn more how works. wrote simple macro takes identifier , adds list of numbers it. macro_rules! do_your_thing { ( $v:ident; $($e:expr),+ ) => { let mut $v = 0; $( $v += $e; )+ }; } fn main() { do_your_thing!(i; 3, 3, 3); println!("{}", i); } if run this program , compiler complain 3 times 'i' being unresolved name every repetition inside macro '$v += $e;' <anon>:5:13: 5:15 error: unresolved name `i` <anon>:5 $v += $e; ^ i know macros in rust hygienic. why used ident designator. possible there additional syntactic context repetition $(...)+ ? update after dk.'s answer did little digging , found hygiene argument --pretty option. basically, annotates syntax contexts after macro expansion happened. after running rustc -z unstable-options --pretty expanded,hygiene main.rs on initial prog...

Is it possible to have a customizable Chrome (or Chromium) installation file? -

i added 2 extensions google chrome want send extern users, not "technical" people (i mean don't have skills). instead of showing them how can download , add extension google chrome, want simplify task sending them installation file of chrome (or chromium) contains these 2 extensions. so, in case, thing have normal installation (with .exe file since use windows) there installing normal google chrome! after that, have chrome includes these 2 extensions. can tall me how can that? because have no idea of it.. thank you!! chrome has instruction doing here: https://developer.chrome.com/extensions/external_extensions . should able via registry addition. note, of chrome 33, need publish extension store, , add update urls. chrome not allow installation otherwise security reasons.

javascript - Using ng-checked on checkbox in nested ng-repeat is always true -

i using nested ng-repeats display content on page. nested ng-repeat displays checkbox , checked status of checkbox should set boolean value of data in ng-repeat. using ng-checked , passing in truthy value, however, checkboxes checked regardless of value. i have simplified code demo displays behaviour jsfiddle . html <div ng-app="myapp"> <div ng-controller="mycontroller"> <div ng-repeat="item in myarray"> <h3>{{ $index }}.&nbsp;{{ item.title }}</h3> <div ng-repeat="child in item.subarray"> <h4>({{ child.id }}). {{child.title}} </h4> <input type="checkbox" ng-checked="child.result" /> <h6>answer is: {{ child.result }}</h6> </div> </div> </div> </div> javascript var myapp = angular.module('myapp', []); funct...

c# - Export Datatable to Excel File (.XLSX) -

i use code export datatable excel file (.xlsx) dim attachment string = "attachment; filename=excel.xlsx" response.clearcontent() response.addheader("content-disposition", attachment) response.contenttype = "application/vnd.ms-excel" dim tab string = "" each dc datacolumn in dt.columns response.write(tab + dc.columnname) tab = vbtab next response.write(vblf) dim integer each dr datarow in dt.rows tab = "" = 0 dt.columns.count - 1 response.write(tab & dr(i).tostring()) tab = vbtab next response.write(vblf) next response.end() when download file message : "excel cannot open file 'excel.xlsx' because file format or file extension not valid " i use excel 2010 any ideas why ?! your creating tsv - tab separated value. instead .xlsx try using .tsv

Using variable to recursively hash files in Python gives false hash -

i trying print our md5 hashes files within directory recursively using python, i'm having problems variable in open command producing false hashes. here's code: import os import hashlib blocksize = 65536 md5_hash = hashlib.md5() root, dirs, files in os.walk('/path/to/folder'): filename in files: os.chdir(root) open(filename, 'rb') cur_file: print filename while true: data = cur_file.read(blocksize) if not data: break md5_hash.update(data) print md5_hash.hexdigest() if change "filename" variable specific file, this: with open('nameoffile.txt', 'rb') cur_file: then correct hash produced, leading me believe loops faulty in way. on right track that? can fix variable or loops work properly? you never reset hash object, i.e. calculate hash of concatenation of files. try moving md5_hash = hashlib.md5(...

java - Arabic text displayed as ??? in Android -

i trying display arabic text in android application, arabic text displayed ???. it works fine when set text of textfield directly xml file using android:text="مثل" , when try set java code mtextview.settext("مثل"); , displays question marks character (???). according answer how support arabic text in android? , arabic supported android 3.x , above. if android:text works fine , setting code not, source files (*.java) not using utf-8 encoding. need check editor/ide settings - android studio go settings -> editors -> file encodings , check files , project encoding.

ruby on rails - ActiveAdmin Formtastic getting multi-select to work -

i know how make multi-select form stated in documentation. http://www.rubydoc.info/github/justinfrench/formtastic/formtastic/inputs/selectinput f.input :name, :as => :select, :collection => ["justin", "kate"] it's not clear me had put inside permit_params in order form request go through. i'm doing through company model. have activeadmin.register company permit_params :name controller def create puts params company = company.new(permitted_params[:company]) if company.save redirect_to admin_companies_path else redirect_to new_admin_company_path, alert: 'please fill fields' end end form |f| f.inputs f.input :name, :as => :select, :collection => ["a","b","c"] end end end when submit form "b" , "c" selected, see following in params[:company] "company"=>{"name"=>["", ...

c++ - What are copy elision and return value optimization? -

what copy elision? (named) return value optimization? imply? in situations can occur? limitations? if referenced question, you're looking the introduction . for technical overview, see the standard reference . see common cases here . introduction for technical overview - skip answer . for common cases copy elision occurs - skip answer . copy elision optimization implemented compilers prevent (potentially expensive) copies in situations. makes returning value or pass-by-value feasible in practice (restrictions apply). it's form of optimization elides (ha!) as-if rule - copy elision can applied if copying/moving object has side-effects . the following example taken wikipedia : struct c { c() {} c(const c&) { std::cout << "a copy made.\n"; } }; c f() { return c(); } int main() { std::cout << "hello world!\n"; c obj = f(); } depending on compiler & settings, following outputs are valid : he...

Search Function in ZenDesk php api -

hello want create simple php if function in php search in zendesk specific user open ticket if system add message comment opened ticket if not system create ticket on behalf of user. here code i'm using found on blog (i'm complete newbie) // begin search open tickets on zendesk $zendesk = new zendesk(zd_apikey, zd_user, zd_site); $data = $zendesk->call("/search.json?query=status<solved requester:a#3b4edcfgiyfms3bbgzeszjl3drdx1y1ikgffxn7zyattij6wehup6wkorkfgozlvnb5@email.email type:ticket", $create, "get"); if ($data->results) { $ticket_id = (string) $data->results[0]->id; //use end-user's email address, not agent's email address case other api end-points. $user_email = 'a#3b4edcfgiyfms3bbgzeszjl3drdx1y1ikgffxn7zyattij6wehup6wkorkfgozlvnb5@email.email'; $zendesk = new zendesk(zd_apikey, $user_email, zd_site); $update = json_encode( array( 'request' => array( 'comment' =...

javascript - KnockoutJS Populate observableArray using TypeScript -

how can populate observablearray (knockoutjs) using typescript? have class viewmodel. without typescript load data using $.getjson(); , map it. function viewmodel() { var self = this; self.list_data = ko.observablearray([]); $.getjson('/home/get', function (data) { var mapped = $.map(data, function (obj) { return new aclass(obj); }); self.list_data(mapped); }); } this class far, loading data in constructor , json data array. have tried map no luck. how store/map in list_data = ko.observablearray([]); in typescript class? class myviewmodel { constructor() { $.getjson('/home/get', function (data) { alert(data); }); } list_data = ko.observablearray([]); } thanks edit: here data server: [{ "product": "102289", "artworkid": 19431, "isdownloaded": 1 }, { "product": "272203", "artworkid": 19423, "isdow...

networkx - Find All paths in a Directed Cyclic Graph -

actually working on text based directed graph having each word node in graph , edges between 2 adjacent words in sentence of text. i need find paths start node end node. is there library python can me task? i tried doing networkx , problem networkx outputs simple paths (simple paths pretty short long sentence in input , don't contain information of sentence). , need more complex paths task. you need write algorithm dfs (depth first search) or bfs (breadth first search) collect paths. below example collect possible paths source destination written in java. package com.nirav.modi; import java.util.arraylist; import java.util.collections; import java.util.hashmap; import java.util.iterator; import java.util.linkedhashset; import java.util.list; import java.util.map; import java.util.nosuchelementexception; import java.util.set; class graph<t> implements iterable<t> { /* * map nodes i...

linux - transmission-daemon possible uploading bug? -

i'm wrecking brains since week ago problem transmission daemon in raspberry pi 2b. tried set uploading speed 1kb/s seems not work correctly. have torrents downloaded if hold transmission opened noticed (using system monitor) system uploading data 20 kb/s: when close transmission-daemon process uploading chart decreases 0 , when launch time transmission-daemon process keeps uploading data... paste below /etc/transmission-daemon/settings.json configuration file content: "alt-speed-down": 50, "alt-speed-enabled": false, "alt-speed-time-begin": 540, "alt-speed-time-day": 127, "alt-speed-time-enabled": false, "alt-speed-time-end": 1020, "alt-speed-up": 1, "bind-address-ipv4": "0.0.0.0", "bind-address-ipv6": "::", "blocklist-enabled": false, "blocklist-url": "http://www.example.com/blocklist", "cache-size-mb": 4, "dht...

cannot resolve the symbol R in android studio -

i have tied deleting these permission manifest file manually, , tried building project, unfortunately, every time these codes getting generated after build project finish. , in codes showing error "symbol r cannot recognised" how can make working.? `<uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices" /> <uses-permission android:name="android.permission.access_fine_location"/> <uses-permission android:name="android.permission.access_coarse_location "/> try tools -> android -> sync project gradle files if doesn't work check have latest version of sdk. check xml files too.

multithreading - Java Synchronisation with and without static variable -

i have been studying synchronization in java , tried run following program public class example { public static void main(string[] args) { counter countera = new counter(); counter counterb = new counter(); thread threada = new counterthread(countera); thread threadb = new counterthread(counterb); threada.start(); threadb.start(); } } class counterthread extends thread { protected counter counter = null; public counterthread(counter counter){ this.counter = counter; } public void run() { for(int i=0; i<2; i++){ counter.add(i); } } } class counter { long count = 0; public synchronized void add(long value){ this.count += value; system.out.println(this.count); } } when run above code , gives me same output when run example cl...

python - Retrieve value of nested tag and store it in nested dictionary -

i’m trying store values between xml tags list , it’s not working. i’m having trouble wrapping head around this. following code gives attributeerror: 'list' object has no attribute 'find' here code: import xml.etree.elementtree et tree = et.parse(‘//storage1//harison/dev/gis/cocalig.xml’) root = tree.getroot() input['merchandise_db'] = {'host': root.findall('cali_merchandise_db_ref').find('host').text, 'db_name': root.findall('cali_merchandise_db_ref').cali_merchandise_db_ref.find('db_name').text, 'schema': root.findall('cali_merchandise_db_ref').cali_merchandise_db_ref.find('schema').text, 'user': root.findall('cali_merchandise_db_ref').cali_merchandise_db_ref.find('user').text, 'pwd': root.findall('cali_merchandise_db_ref').cali_merchandise_db_ref.find('password').text} input['incident_db'] = {'host': root.find...

-1 returns second to last item in python list -

i using python 3.4 write script pull data yahoo finance's chartapi page using urllib pull data , store in text file , numpy unpack it. however, when ever try access last element in list using [-1] end second last element instead of last element. here relevant code: import urllib.request import numpy np def n_year_data(symbol): tempfile = 'temp.txt' open(tempfile,'w+') # clear previous content yahoochartapi = 'http://chartapi.finance.yahoo.com/instrument/1.0/'+symbol+'/chartdata;type=quote;range=1y/csv' urllib.request.urlopen(yahoochartapi) f: sourcecode = f.read().decode('utf-8') splitsource = sourcecode.split('\n') eachline in splitsource: splitline = eachline.split(',') if len(splitline) == 6: if 'values' not in eachline: savefile = open(tempfile,'a') linetowrite = eachline+'\n' sa...

java - Spring JPA Hibernate duplicate -

Image
hi new world. making own application spring jpa hibernate. have entity class. works duplicates attributes. code this: import java.util.date; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.generatedvalue; import javax.persistence.id; import javax.persistence.joincolumn; import javax.persistence.manytoone; import javax.validation.constraints.notnull; @entity public class event { @id @generatedvalue private integer id; public integer getid() { return id; } @column(nullable = false) public void setid(integer id) { this.id = id; } /*------------------------------ title ------------------------*/ private string title; @column(nullable = false) public string gettitle() { return title; } @column(nullable = false) public void settitle(string title) { this.title = t...

meteor - dynamic search with operator like in mongodb -

i newbie meteor , mongodb.. want ask how search data dynamically in mongodb.. here example template.maintemplate.itemsfounded = function() { return item.find({itemname:{$regex: session.get('searchitemname')}}); }; template.templatesearchitem.events({ 'click .searchitem' : function() { var $itemname = $('#textboxsearchitemname'); session.set('searchitemname', '/'+ $itemname.val()+ '/'); } }); when runs, display nothing.. can me? sorry silly question.. thanks the problem come fact not building regex simple string this: session.set('searchitemname', '/'+ $itemname.val()+ '/'); in order build regex should create new regexp object use in mongo $regex query. should rewrite "itemsfounded" not proper way declare helpers in meteor: template.templatesearchitem.events({ 'click .searchitem' : function() { var $itemname = $('#textboxsearchite...

Is there a way to configure the proxy settings using TestNG -

i want configure use of proxy server in tests. want bypass proxy settings while run scripts locally. since proxy server not reachable form local host not able run scripts locally. there way can direct scripts when use proxy settings , when not? you not telling how run tests (ant, maven, eclipse, suite file,...). btw, can configure proxy ( system.setproperty("http....", "..."); ) depending on logic in @beforesuite method.

assembly - Self modifying code always segmentation faults on Linux -

i found article self modifying code , tried examples, segmentation faults. fas can understand, there violation in memory permissions. code segment (r)ead/e(x)ecute , attempt of writting results fault. there way test program either changing memory permissions @ runtime or before? i'm using linux , example written in gas assembly. .extern memcpy .section .data string: .asciz "whatever" string_end: .section .bss .lcomm buf, string_end-string .section .text .globl main main: call changer mov $string, %edx label: push string_end-string push $buf push $string call memcpy changer: mov $offset_to_write, %esi mov $label, %edi mov $0xb, %ecx loop1: lodsb stosb loop loop1 ret offset_to_write: push 0 call exit end: so after modification suggested osgx here working code.(actually if assemble&link&run crashes if watch using gdb modifie...

c++ - I am unable to compile Mednafen from the source code -

i tried compile medanfen source in windows using code::blocks. (the compiler gcc came mingw.) however, can't figure out problem is. source code available http://mednafen.sourceforge.net/ when click on build button without changing anything, error. here build log: -------------- build: debug in virtualdragon (compiler: gnu gcc compiler)--------------- mingw32-gcc.exe -wall -g -i..\..\mednafen\src\cdplay -i..\..\mednafen\src\cdrom -i..\..\mednafen\src\compress -i..\..\mednafen\src\cputest -i..\..\mednafen\src\demo -i..\..\mednafen\src\desa68 -i..\..\mednafen\src\drivers -i..\..\mednafen\src\drivers_dos -i..\..\mednafen\src\gb -i..\..\mednafen\src\gba -i..\..\mednafen\src\hash -i..\..\mednafen\src\hw_cpu -i..\..\mednafen\src\hw_cpu\c68k -i..\..\mednafen\src\hw_cpu\huc6280 -i..\..\mednafen\src\hw_cpu\v810 -i..\..\mednafen\src\hw_cpu\z80-fuse -i..\..\mednafen\src\hw_misc -i..\..\mednafen\src\hw_misc\arcade_card -i..\..\mednafen\src\hw_sound -i..\..\mednafen\src\hw_sound\gb_apu ...

Regex replace only matched strings - C# -

i'm trying work out how use regex.replace method needs, need find particular word doesn't have "a-z" letters either side of , replace matches word. in example below search " man " occurrences , replace " coach ". use regex pattern " [^a-z](man)[^a-z] " capture want. //string search "the man managed football team" //after using regex.replace expect see "the coach managed football team" //but "the coach coachaged football team" you need \b aka word boundary . \b assert position @ word boundary (^\w|\w$|\w\w|\w\w) use \bman\b see demo. https://regex101.com/r/yg7zb9/31 your regex replace 5 characters always. \b 0 width assertion doesnt consume character. string strregex = @"\bman\b"; regex myregex = new regex(strregex, regexoptions.multiline); string strtargetstring = @"the man managed football team"; string strreplace = @"coach"; return myregex.re...

Spring Batch Mongodb example not working -

i running spring batch example http://www.mkyong.com/spring-batch/spring-batch-example-xml-file-to-database/ without customization, when tried project getting following output. mongodb not shows collection. please guide me asap what's wrong going here. slf4j: failed load class "org.slf4j.impl.staticloggerbinder". slf4j: defaulting no-operation (nop) logger implementation slf4j: see http://www.slf4j.org/codes.html#staticloggerbinder further details. exit status : unknown also mongodb not show collections > use test switched db test > show collections system.indexes > reportconverter.java package com.mkyong.converter; import java.math.bigdecimal; import java.text.numberformat; import java.text.parseexception; import java.text.simpledateformat; import java.util.date; import java.util.locale; import com.mkyong.model.report; import com.thoughtworks.xstream.converters.converter; import com.thoughtworks.xstream.converters.marshallingcontext; import com....