Posts

Showing posts from January, 2011

quartz.net - RAMJobStore (quartz_jobs.xml) to AdoJobStore Data Move -

my team , trying figure out way "load up" our sql server database quartz.net schema installed. <add key="quartz.datasource.default.provider" value="sqlserver-20"/> for demo's, we've been storing our job-setups in .xml (quartz_jobs.xml). my question : is there way "load up" scheduling data .xml (quartz_jobs.xml) (quartz.simpl.ramjobstore), , "save off" adojobstore (quartz.impl.adojobstore.jobstoretx) ? the reason our "start up" data written placed in .xml. right now, way see putting jobs adojobstore "coding them up" in c# code through quartz.net object model. or "playing back" profiled tsql (using sql profiler) :( direct question above "(getting xml sql-server)".....the higher level question "how 1 populate adojobstore start data...that isn't "coding them up" in c# code. edit: i'm putting in code works......using marko's (accepted answ

c++ - CreateProcess() From Memory Buffer Doesn't Work On Windows 7 -

i searching awhile how read exe memory , execute directly memory. i've passed answer useful createprocess memory buffer . fortunately i've found code implementing mentioned idea. after tweaking got work. #include <windows.h> #include <stdlib.h> #include <stdio.h> void runfrommemory(unsigned char* pimage,char* ppath) { dword dwwritten = 0; dword dwheader = 0; dword dwimagesize = 0; dword dwsectioncount = 0; dword dwsectionsize = 0; dword firstsection = 0; dword previousprotection = 0; dword jmpsize = 0; image_nt_headers inh; image_dos_header idh; image_section_header sections[1000]; process_information peprocessinformation; startupinfo pestartupinformation; context pcontext; security_attributes secattrib; char* pmemory; char* pfile; memcpy(&idh,pimage,sizeof(idh)); memcpy(&inh,(void*)((dword)pimage+idh.e_lfanew),sizeof(inh)); dwimagesize = inh.optionalheader.si

asynchronous - C# SqlClient asynch locking up program -

i've been having difficulty getting queries in c# run asynchronously. followed example beginexecutereader() on msdn, while query running, program's window frozen. want give idea program working , not frozen, thought begin/end methods let do. swapped out huge query simpler 1 readability here. private void mysqlhandler() { statuslabel.text = "connecting database..."; string constr = string.format("data source=server;initial catalog=master; integrated security=sspi"); sqlconnection con = new sqlconnection(constr); //go ahead , set these string commandstring = @"select top 1 * mytable"; sqlcommand command = new sqlcommand(commandstring, con); //try block connecting database try { con.open(); statuslabel.text = "querying database"; //try block querying database try { command.commandtype = commandtype.text; iasyncresult

php - CodeIgniter Upload Library not returning file extension -

for reason stack overflow removing top line, start saying hi , thank looking. just title says code igniter isn't returning files extension type. have tried $upload_data = $this->upload->data(); $ext = $upload_data['file_ext']; but returns empty string. if var dump $upload_data get, can see has no file type. bug? missing something? else works intended except can't retrieve file extension in order put in db. array (size=14) 'file_name' => string '123456' (length=6) 'file_type' => string '' (length=0) 'file_path' => string 'uploads/' (length=8) 'full_path' => string 'uploads/123456' (length=14) 'raw_name' => string '123456' (length=6) 'orig_name' => string '' (length=0) 'client_name' => string '' (length=0) 'file_ext' => string '' (length=0) 'file_size' => string '

php - Why is using a Spry menu killing my <p> tags? -

in reference testing site's page: http://thepfjstudios.com.au/testing/content/newabout.php i have spry menu on left side, when being used, seems kill <p> tags in content section on right side. the .css file used is: http://thepfjstudios.com.au/testing/spryassets/sprymenubarvertical.css and .js file in same folder sprymenubar.js i've been playing 2 days , can't figure out why there no longer space between paragraphs in content section on right side. if don't use spry menu, content section shows fine. i post code here 3 pages relevant question , take large space. sprymenubarvertical.css on 12 line defines: * { margin:0; padding:0} margin:0 affecting paragraphs. suggest delete line , adjust menu's styles suit needs. edit: think should tell how figured out in case encounter similar problem in future. here steps google chrome, , should similar in other browsers. right click on affected element (in case, of paragraphs). select i

c# - Find first free element -

i looking query return first number not available in list int[] list = new int[] { 1,4,2,5,6,7 }; for above example expect have result 3. perhaps this: int result = enumerable.range(1, list.length) .where(i => !list.contains(i)) .firstordefault(); this return 0 if list contains integers 1 n .

ubuntu - Unable to remove rpath from executable -

i cross-compiling arm platform. amongst many library files i'm linking, few of them have rpath. i don't know coming from, because copied libraries needed single folder, , add them project netbeans (under ubuntu linaro compiler). if compile command line output same. i tried patchelf, not remove rpath. program per se works (for instance, if create path looking when searching libs). any idea how fix it? have tried using chrpath ? , might available in distribution packages

scala - class SomeClass in package x cannot be accessed in com.a.y.x -

i'm attempting un-spring ioc several java classes , load them directly in scala code. naturally i'm finding there name space conflicts between package like com.a.x.someclass and com.a.y.x.someclass i've tried using import name space resolvers like import com.a.y.x.{ someclass => yyysomeclass } import com.a.x{ someclass => xxxsomeclass } that cleans imports, referring classes later in classes show error hovers in typesafe scalaide, , after clean compilations. when compile gradle scala plugin, or via typesafe scalaide scala 2.10.2 or 2.10.3, following type of un-useful error messages: class someclass in package x cannot accessed in com.a.y.x the problem occurs if try use class com.a.y.x doesn't have name space conflict. if try of scalac flags, i've been able warning out that's different ( during typer stage ): class someclass in package x cannot accessed in y.this.x i'd know if there's way expand first package reference.

linux - Bash Script Properties File Using '.' in Variable Name -

i'm new bash scripting , have question using properties .properties file within bash script. i have seen bash properties file uses'.' between variable names, example: this.prop.one=someproperty and i've seen them called within script like: echo ${this.prop.one} but when try set property error: ./test.sh: line 5: ${this.prop.one}: bad substitution i can use properties if without '.' in variable names, , include props file: #!/bin/bash . test.properties echo ${this_prop_one} i able use '.' in variable names, and, if @ possible, not have include . test.properties in script. is possible? update: thanks answers! well, strange. i'm working bash script looks (a service glassfish): #!/bin/bash start() { sudo ${glassfish.home.dir}/bin/asadmin start-domain domain1 } ... ...and there property files (build.properties): # glassfish glassfish.version=2.1 glassfish.home.dir=${app.install.dir}/${glassfish.target} ...

java - Garbage Collector Listeners -

i read small article @ point adding callbacks weakreference objects triggered upon garbage collection. now, no mater how search, cannot find it. i need way execute code whenever weak referenced object destroyed. know can done, don't remember how or whether need weakreference or else weakhasmap? use referencequeue s archieve that. might want phantomreference s, too, depending on you're trying (but weakreference s work queues, too). create reference queue , pass second argument reference-constructor. when gc remove object, reference enqueued , can using remove() (blocking) or poll() (non-blocking) on queue. there alternative: implementing finalize . it's less flexible though , runs in thread, (so still have concurrency - addition of not knowing thread execute it). referencequeue superiour in aspects.

ruby - Rails Paperclip skip upload if image is already present -

im trying import of thousands of items , of them use same image. want check before uploading image if 1 exists same name can save time , resources. using amazon s3 storage. cant seem find in documentation it. know can image.exists? do in model not upload image still set in database point existing image. rails 3.2.12 paperclip 3.2.1 validates_attachment_content_type :image, :content_type => ['image/jpeg', 'image/png', 'image/gif', 'image/pjpeg'] has_attached_file :image, :storage => :s3, :s3_credentials => "#{rails.root.to_s}/config/s3.yml", :path => "images/:attachment/:style/:filename", :styles => { :original => '64x64', :small => '32x32' } i've run exact problem before well, , never found solution this. think it's because of design of paperclip every record needs unique attachment. you try copying existi

jquery - How to change class name tag a with specific href? -

here problem. <a class="selected" href="#tab-general">general setting</a> <a href="#tab-setting1">method 1</a> this time, it's auto selected #tab-general. after click button want auto select #tab-setting1. try thing didn't work: var text='#tab-setting'+1; $('.selected').attr('class',''); $('a[href$=text]').attr('class', 'selected'); thanks help. text variable. change $('a[href$=text]').attr('class', 'selected'); //this selector not read value of variable `text` to $('a[href$='+text+']').attr('class', 'selected'); i suggest similar below. html: <a class="link selected" href="#tab-general">general setting</a> <a class="link" href="#tab-setting1">method 1</a> jquery: $('.link').on("click",function(){

Converting inline Javascript to external -

i have following inline javascript (to show version on mouseover) have working. i've been told needs external, created .js file , linked in head, removed tags can't working linked js file. i'm new this, , i'm sure simple i'm not understanding, appreciated. <!doctype html> <html> <head> <title>template_test</title> <link href="styles.css" rel="stylesheet" type="text/css" media="screen"> </head> <body> <div class="section group box"> <img src="icon-student.png" width="75" height="75"> <h1>sub title section</h1> <p>ut molestie mattis ultrices. suspendisse malesuada turpis non neque tincidunt dignissim. curabitur venenatis vehicula augue, ac venenatis felis aliquam ut. curabitur aliquet turpis nec lorem commodo.</p> </div> <div id="versionhidden" on

css - After first onClick, animation no longer plays in FF 23, IE 10 -

i'm trying write basic content slider using css , javascript. there 1 php variable, sets width. while in chrome, works correctly. click left many times want , each time shows animation correctly. click right moves right correctly. when switch firefox 23 or ie 10, stops working right. the best way can explain it, click left, shows animation. click left again, , every time click left after, timeout changes slide. no animation. oddly enough, @ anytime click right button, shows correct animation first time, , again, time out changes slide, no animation. can go , forth. slide 1 slide 2, shows animation. slide 2 slide 1, shows animation. it's there 1 thing i'm missing. switching 1 direction other key. "resetting" something... ? thanks help, following code, locations , examples. you can see live at: http://musicwhynot.com/slide.php working in chrome. fire fox , ie fail. jsfiddle. doesn't work in browser , first time i've used it, @

jquery - Getting modal dialog to respond to Enter -

i have modal dialog box, below, reads input field when save button clicked. works fine. i'd trigger save button function when enter entered in input field. there simple way that? thanks dialog1$ = $('<div></div>').appendto('body') .html("<div><h6>save . . .</h6><input id='user-input' type='text'></div>"); $('#user-input').val(g.last_save_name); dialog1$.dialog({ modal: true, title: 'save websheet', zindex: 10000, autoopen: true, width: 'auto', resizable: false, buttons: { save: function () { savepage($("#user-input").val()); $(this).dialog("close"); } }, }); you bind keypress event div/element contain

python - Global name 'start' is not defined: Tkinter -

i getting error "global name 'start' not defined" code snippet below. start(panel) call in displayimage(img) causes image want see displayed in gui; without no image shows up; must doing something. yet above error. i'm running program in ubuntu 12.04. btw, new both python , tkinter. way rid of error? edit: adding of image occurs during runtime button click calls loadpicture(file). import numpy np tkinter import * import cv2 cv tkfiledialog import askopenfilename import tksimpledialog td import math mt pil import imagetk, image ### general functions ############################################# def raisefilechooser(): global filename filename = askopenfilename() loadpicture(filename) def loadpicture(file): # set global variable other uses global img img = cv.imread(file, 1) img = cv.cvtcolor(img, cv.color_rgb2bgr) displayimage(img, display1) def displayimage(image, panel): temp = image.fromarray(image) bk = imag

f# - Unexpected keyword 'type' in implementation file -

in vs 2008, f# 2.0, when compile ml script have error unexpected keyword 'type' in implementation file #indent "off" pragma type hw <'o,'m> = cat of <'m->'o>*<'m->'o>*<'o->'m>; original datatype ('o,'m) hw = cat of ('m->'o)*('m->'o)*('o->'m); you wanted type hw<'o,'m> = | cat of ('m -> 'o) * ('m -> 'o) * ('o -> 'm)

jquery - Mathias placeholder plugin bug on IE8 -

so implemented placeholder plugin , have bug on ie8 <asp:textbox id="ctlusername" runat="server" placeholder="user id" maxlength="100"></asp:textbox> <asp:textbox id="ctlpassword" runat="server" placeholder="password" textmode="password" maxlength="12"></asp:textbox> where user id placeholder becomes value of textbox, dont :( by way text box has focus onload. the password works :) and jquery $('input, textarea').placeholder();

sql server - how to separate comma in SQL -

i data field: maritalstatus=m;youngest=[-0.999,0.999]; split to: field name = maritalstatus , data m field name = youngest , data [-0.999,0.999]; how write sql? that's bit of fun substring , charindex it's doable 2 pieces of information extract: select substring(@string, charindex('=', @string) + 1, charindex(';', @string) - charindex('=', @string) - 1) maritalstatus, substring(@string, charindex('=', @string, charindex(';', @string)) + 1, len(@string) - charindex('=', @string, charindex(';', @string))) youngest

django - Limit the number of records in a Model that can have a value per user -

i have model boolean field named is_active . want limit number of models user can have value of boolean field true 1. class mymodel(models.model): user = models.foreignkey(user) is_active = models.booleanfield(default=false) #...more fields ... initially going add unique_togeather = ("user", "is_active") entry meta -- of course limit number of false entries user can have -- need unlimited. ideally, i'd solve @ database level prevent race conditions. the models being created celery tasks importing data using mymodel.objects.get_or_create() -- possible race condition occur due level of concurrency celery workers. you should create custom clean method on model. from django.core.exceptions import validationerror django.db import models class mymodel(models.model): user = models.foreignkey(user) is_active = models.booleanfield(default=false) #...more fields ... def clean(self): if not self.pk , mymo

asp.net mvc - Why online Jquery Datepicker work, but local Jquery Datepicker not work in MVC project -

i have issue in mvc project. i tested in create.cshtml add code : <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <script> $(function() { $( "#datepicker" ).datepicker(); }); and textbox input : <input type="text" id="datepicker"> and worked, when click or keypress on textbox, datepicker popup show up. but when want javascript , css file run locally in pc put in _layout.cshtml (behave general in page) : @scripts.render("~/scripts/jquery-1.9.1.js") @scripts.render("~/scripts/jquery-ui.js") @styles.render("~/content/themes/base/jquery-ui.css") @rendersection("scripts", required: false) and remark direct link jquery online (source) in create.cshtml , a

lua - Generating an integer divisible by 90 with math.random() -

is possible make math.random() return numbers divisible 90? function random_90(lower, upper) return math.random(math.ceil(lower/90), math.floor(upper/90))*90 end print(random_90(100, 1000)) remember call math.randomseed() once before using math.random() . , it's better call math.random() several times before using real because in implementations, first few numbers may not random. math.randomseed(os.time()) math.random(); math.random(); math.random();

jvm - Java delay in execution between non-blocking statements -

i have come upon strange issue in 1 of our java programs. once in while randomly threads delayed 25 seconds in execution. happens 1-2 minutes , application normal processing. telephony application strict time requirements not acceptable. calling class ocsihandling ocsihandler = new ocsihandling(this.arg0); ocsihandler.run(); constructor public ocsihandling() { //this last statement of constructor after initializations logger.info("[" + refid + "][ocsi] sms idp"); } class method run(){ //this first statement of method executed delay logger.info("[" + refid + "][ocsi] in run()"); } sample log during issue info 2014-02-07 06:03:27,674 [thread-143840672] 100 - [mgw070214060327d384][ocsi] sms idp info 2014-02-07 06:03:49,771 [thread-143840672] 123 - [mgw070214060327d384][ocsi] in run() there delay in execution, 49-27 = 22 seconds program running -server option 32 bit hotsp

Which one to use for calling REST in dojo -

i need call rest api provided google maps engine in link https://developers.google.com/maps-engine/documentation/requests i need make request these api using dojo framework please let me know 1 use dojo/request, dojo/request/xhr.. 1 have use.. , how can decide 1 used based on what? thanks chiru i think should looking @ dojo/request/script . reason you're trying load cross-domain data, , browsers block xhr requests cross domain. if don't want use jsonp (it's kind of "hack" commonly used on web), google maps api support setting access-control-allow-origin header, means cross domain requests google maps api work (look @ google maps api docs more information). drawback work in modern browsers afaik.

The screen will push to bottom in ScrollView when I add a listview in android -

i working on listview can expandable ,that means include listview in scrollview, different listview default behavior , listview height actual size , , scroll through scroll view instead of listview. below code implementation , problem , when listview expand screen push bottom, how can keep screen view @ top? thanks listadapter customadapter = new leadersadapter(this,r.layout.leader_record_row, records); results.setadapter(customadapter); updatelistviewheight(results); public static void updatelistviewheight(listview mylistview) { listadapter mylistadapter = mylistview.getadapter(); if (mylistadapter == null) { return; } //get listview height int totalheight = 0; int adaptercount = mylistadapter.getcount(); (int size = 0; size < adaptercount ; size++) { view listitem = mylistadapter.getview(size, null, mylistview); listitem.measure(0, 0);

AngularJS: Injecting a factory / service with identical name but under different module -

let's have 3 factories of same name dserrorlog each under different module angular.module('module1').factory('dserrorlog', function () { return { show: false, msg: "" }; }); angular.module('module2').factory('dserrorlog', function () { return { show: false, msg: "" }; }); angular.module('module3').factory('dserrorlog', function () { return { show: false, msg: "" }; }); how inject correct instances correct module 1 e.g. dserrorlog under module3 controller? suppose syntax such module3.dserrorlog won't work here. angular.module('mainapp', ['module1', 'module2', 'module3']) app.controller('mainctrl', function ($scope, dserrorlog) { }); cool question! it turns out order include them affects 1 get. each module in add overwrite injector. in example dserrorlog module3 if inject normally. turns out can still injector other modul

Jquery Tabs on click option -

i'm using jquery tabs. on click, i'm trying display alert message (and make coloring changes). neither of works -- i'm not sure why when move out of tabs part regular html works perfectly. here's relevant code: in addtab() jquery tabs: tabcontenthtml = "<div class=\"favorite\" status=\"off\">&#9734</div>" my own javascript code: $(".favorite").click( function(){ alert("in here"); var current_status = $(this).attr("status"); if(current_status == "off"){ $(this).html("&#9733;"); $(this).css({"color":"gold"}); $(this).attr("status", "on"); }else if (current_status == "on"){ $(this).html("&#9734;"); $(this).css({"color":"#efefef"});

ios - Can anyone tell me how to rotate UIStepper clockwise vertically which will get the plus on top and minus down? -

i have used uistepper besides textbox in app , have rotated vertically below: [m_stepper1 settransform:cgaffinetransformconcat(cgaffinetransformmakerotation(m_pi_2), cgaffinetransformmakescale(0.4, 0.4))]; gives me plus sign below , minus sign on top. can me out rotate stepper clockwise? @jugale : thank answer. just substitute m_pi_2 -m_pi_2 , stepper rotated clockwise.

c# - Dynamically Sort by lambda expression -

i m doing sorting in application shown below . public iqueryable<users> selectall(string ssortexpression, string ssortorder) { if (ssortorder == "asc") { switch (ssortexpression) { case "firstname": return usersrepository.entities.orderby(x => x.firstname); case "lastname": return usersrepository.entities.orderby(x => x.lastname); default: return usersrepository.entities.orderby(x => x.id); } } else { switch (ssortexpression) { case "firstname": return usersrepository.entities.orderbydescending(x => x.firstname); case "lastname": return usersrepository.entities.orderbydescending(x => x.lastname); default: return usersrepository.entities.orderbydescending(x => x.username); }

python - I am trying to run a Collatz conjecture sequence to see if it always ends at 1, but my number is stuck at 999. Why is this? -

here code: def iseven(number): return number % 2 == 0 def run(x): z = x while z != 1: if iseven(z) == true: z = z/2 print z else: z = (3*z)+1 print z else: print 'got one!' #to see if collatz indeed work x+=1 it works until 999, @ continues indefinitely, print got one! 999 , raising segmentation fault: 22 . how fix this? use sys.setrecursionlimit stop 999 repeating forever. here edited version of code. put sys.argv[] well, fun because imported sys . sys.argv[] gets argument after run program this: python myscript.py 13.5 in this, sys.argv[1] 13.5 . set recursion limit pretty high, downfall of segmentation fault: 22 still occurs, , haven't found way rid of that. import time import sys while true: try: var = int(sys.argv[1]) break except indexerror: print 'you have enter number!' var = int(raw_input('

generics - Using raw type with interface in Java -

i'm trying find information raw types , possible use interface following way: public class globalconverter { public interface listener { void onready(object t); } public void convert(string string, class<?> resultclass, listener listener) { try { listener.onready(resultclass.newinstance()); } catch (illegalaccessexception e) { } catch (instantiationexception e) { } } public void test() { convert("test", myclass.class, new listener() { @override public void onready(object object /* possible myclass object ? */) { } }); } } what i'm trying achieve above, end user onready callback return resultclass type of object. hints/explanations highly appreciated. thanks. i'll make listener generic: public interface listener<t> { void onready(t t); } and convert method should generic: public <t> vo

json - play.data.Form understanding subclassing in Java play framework -

i use play.data.form feature of play!framework having problem following classes. could tell me if there way make forms aware of nested paths such inheritance structures? far have tried making work json. here digest of code. @jsoninclude(jsoninclude.include.non_empty) public class contactparam implements ientityparam<contact> { private long id; private string name; private list<contactfieldparam> contacts; private long companyid; //standard getters , setters } with details being defined follow: @jsonsubtypes({ @type(emailfieldparam.class), @type(phonefieldparam.class), @type(socialnetworkfieldparam.class), @type(addressfieldparam.class), @type(websiteurlfieldparam.class) }) @jsontypeinfo(use = jsontypeinfo.id.name, include = jsontypeinfo.as.property, property = "ctype") @jsoninclude(jsoninclude.include.non_empty) public abstract class contactfieldparam implements ientityparam<contactfiel

osx - difference between ~/bin vs /usr/local/bin on mac -

i have few exec scripts want run on command line. which folder should place them in ~/bin or /usr/local/bin ? what difference between both of these folders? which used when? use ~/bin (or similar location inside home directory) if want scripts available only user account (not other user accounts, including root). essentially, this'd personal bin folder can whatever want without disturbing other users. you'll have add path (in ~/.bash_profile, ~/.profile, or whatever). if want scripts available under user accounts or don't have other user accounts or don't care, use /usr/local/bin instead. this'll save hassle of editing path, , more standard location.

node.js - Querying sub documents mongoose nodejs -

Image
i have below document structure in sample app the models student , phone. have configured below var mongoose = compound.mongoose; var phoneschema = new mongoose.schema({ type: string, number: string }); var studentschema = new mongoose.schema({ name: string, dept: string, year: string, phone: [phoneschema] }); var phone = mongoose.model('phone',phoneschema); var student = mongoose.model('student',studentschema); phone.modelname = 'phone'; compound.models.phone = phone; student.modelname = 'student'; compound.models.student = student; i able insert student document , multiple phone documents within student shown. i trying query subdocument compound.models.student.findone({ "name" : "prabhu" }, function(err, student){ console.log(student); console.log("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");

ld - Linker ignores options from g++ -

i'm trying create object file without @-suffix g++: g++ -wl,--add-stdcall-alias -c test.cpp or g++ -wl,--kill-at -c test.cpp but none of options works. using: mingw32 g++ v4.4, ld v2.19.1 thanks!

simple library project with playframework 2 -

i wondering best approach create simple library project playframework2 or sbt. the project contain several java classes no web dependencies, , included in few different play projects library jar. is there way create stripped down play or sbt project create small jar? i saw there sub-projects in play/sbt library project utilized in more 1 application, , built , published maven repository artifact. project setup included in continous build/integration environment. thanks in advance, matt a better way write play module. easy create. see blog: http://www.objectify.be/wordpress/?p=363 to use module, apps' build.sbt or build.scala include module dependency.

amazon dynamodb - AWS Error Code: ValidationException, AWS Error Message: Consistent reads are not supported on global secondary indexes -

i started using amazon dynamodb , have issue query. i have table dev_testgame1_mail id primary hash key , following 3 global secondary indexes, fromplayerid (hash key) toplayerid (hash key) + isread (range key) toplayerid (hash key) + enddate(range key) i have above code query, **dynamodbmail hashkobject = new dynamodbmail(); hashkobject.settoplayerid(playerid); condition enddaterangekeycondition = new condition(); //enddaterangekeycondition.withcomparisonoperator(comparisonoperator.null).withattributevaluelist(new attributevalue().withb(utils.convertdatetobytebuffer(dateutil.getutcdatetime()))); enddaterangekeycondition.withcomparisonoperator(comparisonoperator.null); dynamodbqueryexpression<dynamodbmail> queryexpression = new dynamodbqueryexpression<dynamodbmail>(); queryexpression.withhashkeyvalues(hashkobject).withrangekeycondition("enddate", enddaterangekeycondition); que

php - CakePHP how to assign database connection dynamically -

i have constant value called client_url on boostrap: $clienturl = explode('/', $_server['request_uri']); define("client_url",$clienturl[2]); i've debugged , gets, example, 'client1', or 'client2', etc. need use value when defining configuration array, such as: on database.php class database_config { var $default = array( 'datasource' => 'database/mysql', 'persistent' => false, 'host' => 'localhost', 'login' => '*****', 'password' => '****', 'database' => 'client3', 'prefix' => '' ); var $clientdb = array( 'datasource' => 'database/mysql', 'persistent' => false, 'host' => 'localhost', 'login' => '****', 'password' => '****', 'database' => 'client3

java - Convert an object to a JSON string with thrift json serialization -

i'm new thrift. need convert data object json string thrift json serialization. i tried in way. tserializer serializer = new tserializer(new tsimplejsonprotocol.factory()); string json = serializer.tostring(object_name); in here error, object_name should in tbase . how can resolve ? in here error, object_name should in tbase. next time, please post exact error message (use copy+paste), makes easier of us. how can resolve this? whatever want serialize thrift, must descendant of thrift's tbase class. achieve writing thrift idl , save file (e.g. mydatastructs.thrift ): struct employee { 1: string name 2: string surname 3: i32 age } next, pass file thrift compiler , tell him generate c# code it: thrift -gen csharp mydatastructs.thrift this gives class derived tbase: public partial class employee : tbase { private string _name; private string _surname; private int _age; // properties public string name {... }

c# - Not able to display date in view mvc -

i had model [datatype(datatype.date)] [display(resourcetype = typeof(resources.resources), name = "txtdateofbirthday")] public datetime? dateofbirth { get; set; } and need display in view date, doesn't work. view such: @html.labelfor(model => model.dateofbirth, new {@class = "control-label"}) @html.textboxfor(model => model.dateofbirth, new {@class = "form-control", @type = "date"}) @html.validationmessagefor(model => model.dateofbirth)

html5 - How to manage multiple scenes in easeljs? -

i impelemting game in easeljs. need add different scenes in different html files. dont know how it. mean, when clicked object in file. must pass different file , load functuanilities. searched problem answers in same file adding , removing different containers. i not sure trying do. when multiple html files, referring content exported flash/toolkit? if so, have work combine content 1 "application". other loading html files iframes, there isn't straightforward way of loading html file application (akin loading swf flash application). can describe more different scenes, how constructed, , trying accomplish?

internationalization - i18n in chinese language in play 2.0 framework -

i have created messages.zh file in conf folder of play project.when starting application showing me error mentioned below if copy paste same content in messages.en working properly.i suppose problem file extension.but extension should put chinese message file.kindly suggest me how resolve issue. this error facing while starting application string matching regex \z' expected but �' found thanks check encoding of messages.zh file. believe needs utf-8.

launching Email application on Android via hyperlink -

i trying start email application hyperlink(in webpage). looked many questions/answers couln't find 1 matches problem. i know searches open app should use scheme in link: launch custom android application android browser example:in custom applicaiton's manifest file can define: <intent-filter> <data android:scheme="my.special.scheme" /> <action android:name="android.intent.action.view" /> </intent-filter> and in webpage can reach app: <a href="my.special.scheme://other/parameters/here"> but not application can reach manifest file. so, when try open email hyperlink use <a href ="mailto:">email</a></li> and opens email opens screen can edit , send email. want open application can see inbox ( main page of application) when try <a href ="email:">email</a></li> it says there no application start. should use there ? <data andro

java - How should I receive text input when using surface view for an Android game -

i've created android game based on this tutorial . have lot of development experience, these first steps java , mobile platform. the game created single activity drawn on surfaceview , 'screens' specified break up. have no xml layout. oncreate main class best place see how it's set up. androidfastrenderview extends surfaceview. public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); getwindow().setflags( windowmanager.layoutparams.flag_fullscreen | windowmanager.layoutparams.flag_keep_screen_on, windowmanager.layoutparams.flag_fullscreen | windowmanager.layoutparams.flag_keep_screen_on); boolean isportrait = getresources().getconfiguration().orientation == configuration.orientation_portrait; int framebufferwidth = isportrait ? 480 : 800; int framebufferheight = isportrait ? 800 : 480; bitma

java - Repeatable not found when using Spring 4 PropertySource -

we using spring 4.0.1.release in combination jdk6 (this fixed). of course have done config in java usage of @propertysource annotation. leads annoying warning message(s) when compile project gradle: org\springframework\context\annotation\propertysource.class(org\springframework\context\annotation:propertysource.class): warning: cannot find annotat ion method 'value()' in type 'java.lang.annotation.repeatable': class file java.lang.annotation.repeatable not found this caused usage of not (in jdk6) existing repeatable class , glad it's warning. love clean output of gradle , annoying because may obfuscate other "real" warnings (like checkstyle...). maybe faced same problem , got (not hack) solution situation. want see clean output again. i think problem in spring 4 , use @repeatable annotation, has been introduced in java 8 . therefore, if you're not using java 8 you'll continue see problem, @ least until issue fixed.

c++ - Writing SEH translator -

class seh_exception : public std::exception { public: seh_exception(uint se_code, pexception_pointers se_info); seh_exception(const seh_exception& old); ~seh_exception(); const char *what() const; }; void translate_seh_exception(uint se_code, pexception_pointers se_info) { throw seh_exception(se_code, se_info); } now, do in constructor? couldn't find information on how long *se_info exist, means shouldn't save se_info in private field later use — should copy it. or maybe not? and what's what() ? supposed conjure underlying string on-demand? again, allocating memory in constructor seems not idea in case. i've implemented storing se_code , se_info without deep-copying, , generating formatted message in constructor, , works, though not know if supposed work. i intend use in "catch, log happened, terminate" scenario. you don't need own class achieve this, can throw pexception_pointers . se_code available

android - String with multiple fonts and textSize in the same textView -

Image
i have put in same textview string substrings of different sizes , colors. how can do? you need create string html tags , set string textview html.fromhtml below: ((textview) findviewbyid(r.id.txt)).settext( html.fromhtml("<font color=\'" + "#457548" + "'\" >" + "your text" + "</font>"), textview.buffertype.spannable) more information go to: how-display-html-android

objective c - iOS MKMapView - stop map view from re-centering to the user's location if the user has panned/dragged the map view -

i have mkmapview in have set: [self.mapview setshowsuserlocation:yes]; i want show user's location, , update location if he/she moves. when didupdateuserlocation gets called seems map re-centers user's location, if user have panned app see region. want able track user's position, let user explore map. didupdateuserlocation looks this: - (void)mapview:(mkmapview *)mapview didupdateuserlocation:(mkuserlocation *)userlocation { _currentlocation = userlocation; [self.mapview setregion:mkcoordinateregionmake(cllocationcoordinate2dmake(self.currentlocation.coordinate.latitude + 0.0015, self.currentlocation.coordinate.longitude), mkcoordinatespanmake(0.01, 0.01)) animated:no]; [...] } any ideas on should achieve want? as long set showsuserlocation property of mkmapview yes, user location automatically updated (cf apple docs). you should remove "setregion" line, because line centers view on user location.

asp.net - How to display images in datalist from database? -

i have datalist image control aspx code is <asp:datalist id="datalist1" runat="server" repeatdirection="horizontal" repeatcolumns="4"> <itemtemplate> <div> <asp:image id="image1" imageurl='<%#eval("image") %>' runat="server" height="75px" width="75px" /> </div> </itemtemplate> </asp:datalist> the code i'm trying images database is pageddatasource objds = new pageddatasource(); string query = "select * icon"; sqlconnection con = new sqlconnection(); con.connectionstring = system.configuration.configurationmanager.connectionstrings["iconbankconnectionstring"].connectionstring; try { sqlcommand cmd = new sqlcommand(query, con);