Posts

Showing posts from May, 2013

iphone - iOS app memory usage keeps going up in Xcode -

i'm new ios programming , have built iphone app can ask user question , return answer. building environment os x 10.9 , xcode 5.0.2. every time starts iphone simulator, debug navigator shows memory usage 13.5mb keeps going after returned home screen. after minute memory usage become stabilized around 17.5mb. normal behavior or need add memory management code? #import "quizviewcontroller.h" @interface quizviewcontroller () @property (nonatomic) int currentquestionindex; @property (nonatomic, copy) nsarray *questions; @property (nonatomic, copy) nsarray *answers; @property (nonatomic,weak) iboutlet uilabel *questionlable; @property (nonatomic,weak) iboutlet uilabel *answerlable; @end @implementation quizviewcontroller - (instancetype) initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if(self){ self.questions = @[@"from cognac made?",

Android - Store data in Array of Objects and display later in ListView -

i have 2 activities in tab-bar application. 1 activity (activity1) normal activity , other (activity2) listactivity. in activity1, there button stores every time tap on button data (date, value1,value2..) in array of objects. read possible intents. dont want start activity2 everytime tap on button. how can pass array activity2, can display them later after tapped more once on button in listview? edit : here code. nullpointerexception, doesn't store correctly. object hat serializable implemented. activity1: intent datenintent = new intent(this, loggeractivity.class); bundle bundle = new bundle(); bundle.putserializable("daten",adatensatz); datenintent.putextras(bundle); activity2: bundle bundledata = this.getintent().getextras(); datensatz[] adatensatz = (datensatz[]) bundledata.getserializable("daten"); you can pass array in 1 shot 1 activity in following way : bundle mybundle = new bundle(); b.putstringarray(key

vba - ms outlook 2013 addressentry ID is not unique -

everything read ms outlook says addressentry.id unique. mine don't appear be. here's code: dim anaddressentry addressentry dim listuniqueid string dim lastlistunique string dim kount integer lastlistunique = "none" kount = 1 20 each anaddressentry in session.addresslists.item(2).addressentries if anaddressentry.name = "testcontactgroup" listuniqueid = anaddressentry.id if lastlistunique <> "none" if lastlistunique <> listuniqueid stop end if end if lastlistunique = listuniqueid end if next next it runs same routine 20 times goes through contacts , looks name "testcontactgroup" gets it's addressentry.id. if isn't first time, compares last addressentry.id got contact. if aren't same, stops. understand it, should same. they're close same, except last few characters. here 2

sql - How to Convert a negative value received through a parameter to positive in the stored procedure code? -

i have concerns, i'm creating stored procedure work cafeteria system. user on cafeteria send me through parameter employee code , amount consumed. far have calculated this: if @amount< @subsidy (subsidy being 20 dollars per day) begin update creditsub set subsidy = subsidy - @amount, fecha = @currdate code = @code; end if @amount > @subsidy (being credit 100) begin update creditsub set @amountdif= @amount - subsidy, subsidy= 0, credit = credit - @amountdif, date = @currdate code = @code; end what i'm doing calculation if user insert less 20 dollars run first batch if greater it's going run second deducting 20 dollars of subsidy plus deducting rest of credit (being 100 dollars). now, if user cancels order, value returned me negative value "if employee orders 70 dollars of food, order must cancelled, system return -70 need take , summarize part of subsidy , part of credit if subsidy not spent on day. how s

opencl atomic operation doesn't work when total work-items is large -

i've working opencl lately. create kernel take 1 global variable shared work-items in kernel. kernel can't simpler, each work-item increment value of result, global variable. code shown. __kernel void accumulate(__global int* result) { *result = 0; atomic_add(result, 1); } every thing goes fine when total number of work-items small. on mac pro retina, result correct when work-item around 400. however, increase global size, such as, 10000. instead of getting 10000 when getting number stored in result, value around 900, means more 1 work-item might access global @ same time. i wonder possible solution types of problem? help! *result = 0; looks problem. small global sizes, every work items atomically increments, leaving correct count. however, when global size becomes larger number can run @ same time (which means run in batches) subsequent batches reset result 0. why you're not getting full count. solution: initialize buffer host side instead ,

Visual Studio 2013 c++ function syntax error -

Image
i'm using vs 2013, reason in c++ console application simple function declaration not work. going on? i have #include iostream , code inside int main () {...} body. -tsr update: here full program look @ comment in program. should write functions outside of main method. /* wrong code ----------------------------------------- */ #include <iostream> int main() { int printmessage () { } } /* correct code ---------------------------------------- */ #include <iostream> int printmessage () { } int main() { }

matlab - Multiple Microphone Recording -

i'm trying record 3 microphones simultaneously microphone array research. have 3 usb microphones connected macbook air via usb hub. in audio midi have them aggregate device. matlab isn't recognizing them, , still recording internal microphone in computer. add to: recobj1 = audiorecorder (22500,16,2); disp ('recording started') record(recobj1,5); recordblocking(recobj1,5); y = getaudiodata(recobj1); wavwrite(y,22500,16) to matlab record usb mic?

teamcity - How to set Bamboo variables from Powershell/Other scripts? -

in teamcity using service message feature, 1 can set value teamcity variables script environment: echo ##teamcity[foo 'booya'] if run in batch/powershell, can set teamcity variable foo booya . how can similar in bamboo? format build number in way. thank you. this feature not available in bamboo. it's open feature request. https://jira.atlassian.com/plugins/servlet/mobile#issue/bam-10282 i deal outputting html build info page build artifacts. includes bamboo number , our actual number. links bamboo site. hth av

Spynner downloads a zero-byte .jpg with browser.download(url, filename) - Python, PHP -

here code have tried. files 0 bytes. i've set imagedata=br.download(...) , reports 0 len(). i've been @ hours... ideas? pre_record_soup='[<img src='/show_pic.php?id=316600'>]' #simplified def func_get_pic(pre_record_soup, br=spynner.browser()): baseurl='http://www.testsite.com/' record in pre_record_soup: imagetag=record.find('img') filename = 'image.jpg' #set name of file afterdownload try: if imagetag: piclink = imagetag.find('img')['src'] else: piclink = 'basicimages/icons/icon.gif' filename = 'icon.gif' except typeerror: return none print baseurl+piclink #this prints expected link print filename #this prints filename want open('/home/myhome/'+filename, 'wb') handle: br.download(baseurl+piclink,handle) #not retriev

Jekyll: How to get markdown parsing inside blocks using Kramdown? -

per kramdown docs, setting option parse_block_html should allow processing of markdown (kramdown) syntax inside html blocks. in _config.yml , have settings as: --- name: blog name markdown: kramdown kramdown: parse_block_html: true --- then in post .md file, try like: # headline1 ------------ <div> # headline2 ------------ </div> the markdown content inside div not translated html upon jekyll build . missing? (also, there easier way in of other markdown syntaxes, e.g. redcarpet?) try use inner declaration, , remove indentation (unless want treated code): # headline1 ------------ {::options parse_block_html="true" /} <div> # headline2 ------------ </div>

c++ - vs2008 failed to capture exceptions with SetUnhandledExceptionFilter -

i'm writing crashreport.dll can used exe, long exe load it, captures exceptions, prompt user report, restart application, etc. i'm using setunhandledexceptionfilter , it's not working. seems vs2008 crt handling crash, when there's crash, popups dialog "microsoft visual c++ runtime library", exception callback not called. i googled lot, articles crt registers exception handler. when debug exe ollydbg, set break point @ setunhandledexceptionfilter , found called twice. first in crtstartup, it's before main second in main function, called code there's no more call it, , set api hook setunhandledexceptionfilter prevent further calling. any idea? thanks. the problem seems has project configuration, deleted old solution, created new , copy files new solution, works. don't know why. guys.

JBoss Wildfly - database login module -

jboss wildfly 8.0.0-final jsf 2.2.4 first created login using application-users.properties , application-roles.properties. added user add-user.bat web.xml <security-constraint> <web-resource-collection> <web-resource-name>admin resource</web-resource-name> <url-pattern>/admin/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>admin</role-name> </auth-constraint> <user-data-constraint> <transport-guarantee>none</transport-guarantee> </user-data-constraint> </security-constraint> <login-config> <auth-method>form</auth-method> <form-login-config> <form-login-page>/login.xhtml</form-login-page> <form-error-page>/error.xhtml</form-error-page> </form-login-config> </login-config> <security-role> <role-name>

One of my migrations is not running with the php artisan command in Laravel 4 -

i have several migrations running in laravel 4. use php artisan migrate:rollback , php artisan migrate commands populate tables. interestingly enough, 1 of migrations has stopped working (cannot roll back). of others working fine. haven't changed knowledge. the migration in question named: 2013_06_19_050252_create_artists_table.php and looks so: <?php use illuminate\database\migrations\migration; use illuminate\database\schema\blueprint; class createartiststable extends migration { /** * run migrations. * * @return void */ public function up() { schema::create('artists', function(blueprint $table) { $table->increments('id'); $table->string('url_tag')->unique(); $table->string('username'); $table->timestamps(); }); } /** * reverse migrations. * * @return void */ public function down(

integrate a C and C++ program -

i trying control drone using image processing. image capture drone opencv c++ program. drone control program c program. want integrate both programs run single program can both images , control drone. how do that? c program socket program send commands drone , c++ program capture image stream drone tcp socket. there way or should convert 1 whole program language? help. regards, shiksha you have number of options. easiest may rename *.c files *.cpp - may compile directly in c++. may have issues linking external libraries built using c compiler. these linking issues can resolved guarding each header include with extern "c" { #include "header_for_c_library.h" } if isn't feasible (e.g. if c project consists of lot of files, or want keep compiling in c), may want build c part static library , link c++ program. go in other direction - build c++ component static library , link c program. downside have write c wrapper c++ code take effort (or

amazon web services - how to pass in the user-data when launching AWS instances using CLI -

i'm using aws cli launch instances, , command is: aws ec2 run-instances what i'm expecting pass in script user-data. so, did: data= base64 ./my_script on mac osx, , pass data by: aws ec2 run-instances --user-data $data but, nothing happened after instance launched so, how should do? thanks!! there no need base64 encode data yourself. you can prefix file name/path file:// so, aws ec2 run-instances --user-data file://my_script or aws ec2 run-instances --user-data file:///full/path/to/my_script

python - Counting duration of a freeswitch call, if greater then 10 second nobody joined then play IVR -

how count duration of call? when user join 3200 , wait 10 seconds , nobody yet joined, 3200 want play audio file. but how count duration idea please? have tried following not working cause triggers after call hang up. need counter starts when call started. /usr/local/freeswitch/script/wait.py import os freeswitch import * def hangup_hook(session, what): consolelog("info","hangup hook %s!!\n\n" % what) return def input_callback(session, what, obj): if (what == "dtmf"): consolelog("info", + " " + obj.digit + "\n") else: consolelog("info", + " " + obj.serialize() + "\n") return "pause" def handler(session, args): new_api_obj = api() new_api_obj.executestring("pyrun postprocessing " + session.getvariable('caller_id_number')) session.answer() session.sethanguphook(hangup_hook) session.setinputcallback(inpu

javascript - How to change ReactJS styles dynamically? -

i trying run reactjs inside twitter bootstrap web app. have issues using styles. having div: ... <div class="ui-progressbar-value ui-widget-header ui-corner-left" style="width: 80%;"/> ... i'm writing dynamic progress bar, , make 80% change (look @ ** underneath). code writing in jsx: var task = react.createclass({ render: function() { return ( <li> <a href="#"> <span classname="header"> <span classname="title">{this.props.type}</span> <span classname="percent">{this.props.children}%</span> </span> <div classname="taskprogress progressslim progressblue" > <div classname="ui-progressbar-value ui-widget-header ui-corner-left" **style="width"+{this.props.value} +"%;" />** </div> </a> </li> ); } }); i rea

c# - find the second highest frequency of the character in the string -

i want find second highest frequency of character in string. example: abccddd o/p should : c i tried dictionary. storing in dictionary. moreover, sorting it. dont know how should proceed. string input = tb_input.text; dictionary<string, int> di = new dictionary<string, int>(); (int = 0; < input.length; i++) { if (di.containskey(input[i].tostring())) { int value = di[input[i].tostring()]; value++; di[input[i].tostring()] = value; } else { di.add(input[i].tostring(), 0); } } var items = di.values.tolist(); items.orderbydescending(x => x).tolist(); you're storing number of occurrences in items . should store character well: var items = di.orderbydescending(x => x.value).tolist(); return items[1].key; also, why start 0 ? should add 1 dictionary, when it's not there: else { di.add(input[i].tostring(), 1); } update just let know, can solved using linq:

javascript - how to split the value in database using explode function in php -

i have column in db contains set of sentence separated ';' want extract value , print 2 statement in 2 different div's. for example this cow;it gives milk output should be this cow gives milk you explode , foreach up <?php $str='this cow;it gives milk'; foreach(explode(';',$str) $k=>$v) { echo "<div id=div$k>$v</div>"; } output : <div id=div0>this cow</div> <div id=div1>it gives milk</div>

python - Why can't I change screens on click? -

i trying make game using kivy. have created start screen , game screen. app won't run , error "typeerror: bind() takes 0 positional arguments (1 given)". sounds there problem when try bind screen action "press start" image. from kivy.app import app kivy.uix.widget import widget kivy.uix.image import image kivy.core.window import window kivy.uix.screenmanager import screenmanager, screen kivy.uix.label import label kivy.uix.behaviors import buttonbehavior #beginning of screen manager code class menuscreen(screen): pass class game(screen): pass sm = screenmanager() sm.add_widget(menuscreen(name = "menu")) sm.add_widget(game(name = "game")) #end of screen manager code class iconbutton(buttonbehavior, image): pass class moveableimage(image): def __init__(self, **kwargs): super(moveableimage, self).__init__(**kwargs) self._keyboard = window.request_keyboard(none, self) if not self._keyboard:

android - How to show calendar view in application? -

can tell me how use calendar view in application? i want number of days selected user , need option select multiple days. android not offer calendar view in sdk.so developer can import , use calendarview display specified date in month view, or let user pick date it. try link here demo of calender view http://code.google.com/p/android-calendar-view/

php - arrays into function inside foreach -

i have function i've been using set class in div in html. until loaded function on page load , ran variables through each time div called. function setclass($flow, $low, $good) { if ($flow <= $low) return "tdy"; if ($flow <= $good) return "tdg"; return "tdr"; } i hardcode $low , $good needed. $low = (300); $good =(450); $class = (setclass($flow[1], $low, $good)); and on , on , on. can imagine have rather long scripts done in 30 or 40 lines. * edited * the goal color coded css table. below second column yellow. in between 2nd , 3rd green. above 3rd red. perhaps own distorted logic , there simple , common solution. i want put function inside loop , run array through it. have series of thresholds want loop through function. first column seperate array - flows second low threshold. third high threshold in function below low returns tdy. less third column returns tdg greater returns tdr $flows

c# - How to call parameterized Index Action in mvc3? -

public actionresult index(int id) { list<tablename> llistsong = new list<tablename>(); using (dbname dbcontext=new dbname ()) { llistsong = (from z in dbcontext.tablenamewhere z.songid ==id select z).tolist(); } foreach (var songchooesen in llistsong) { viewbag.selectedsong = songchooesen.songname.tostring(); } return view("index"); } this action has been defined in abccontrollers , want access action using url www.urlname/abc/12 not accessible. have used concept of routing in mvc3. please me you can try following route , routes.maproute( "abc_details", "abccontroller/{id}", new { controller = "abccontroller", action = "index" } );

python - getting error on browser in django -

i beginner in django , dont know how solve problem getting error on browser as: using urlconf defined in mysite.urls, django tried these url patterns, in order: ^admin/ the current url, api/entry/, didn't match of these. all files are: mysite/myapp/models.py : from tastypie.utils.timezone import django.contrib.auth.models import user django.db import models django.utils.text import slugify class entry(models.model): user = models.foreignkey(user) pub_date = models.datetimefield(default=now) title = models.charfield(max_length=200) slug = models.slugfield() body = models.textfield() def __unicode__(self): return self.title def save(self, *args, **kwargs): # automatic slug generation. if not self.slug: self.slug = slugify(self.title)[:50] return super(entry, self).save(*args, **kwargs) mysite/myapp/api.py : from tastypie.resources import modelresource myapp.models import entry

popularity - Algorithm for most popular posts based on likes, shares and views -

this question has answer here: popularity algorithm 5 answers i working on website have gazillions of stories. stories in formats: texts, videos, photos , other multimedia elements. stories can filtered on various basis of "new" contain latest stories first, "featured" stories marked featured manually , "popular" need come algorithm. so far doing taking average of facebook likes, number of shares (including both facebook, twitter or other shares) , number of views. doesn't me. because giving equal weight-age 3 metrics doesn't sound genuine reasons social spamming etc. looking forward algorithms rank popularity of stories. ----addition----- popularity algorithm discusses algorithm based on "likes" , algorithm based on categorize results in categories of timestamps: popular on day, week , month. whereas this has

Is there any way to shut off ring tones on the phone (mute the iPhone) via code in iOS 7? -

is there way shut off ring tones on phone (mute iphone) via code in ios 7? there 1 app in appstore found has logic shuts off phones ringer when iphone ringer switch set on. https://itunes.apple.com/us/app/silentalert/id506092189?mt=8 some piece of code or reference highly appreciated. went through many stack-overflow post without success. first, can specify have tried , have not been able working ? also see this related , possibly duplicate stackoverflow question . says isn't possible , mentions private apis apple appstore won't approve. for more information on private apis see this stackoverflow question . specifically need call toggleactivecategorymuted celestial private api or setmuted in avcontroller, rejected apple in terms of appstore submission. based on reading api documentation believe way referenced application works setting avaudiosessioncategory avaudiosessioncategoryaudioprocessing , making active session. if doesn't continue silence

perl - Exporting symbols without Exporter -

i learning how use packages , objects in perl. it has been suggested use exporter in order use functions , variables of module have package directive. i curious know whether there way export symbols without using exporter ? in other words, can exporter emulated in way? the reason ask due assumption exporter carries overhead functionality small, simple scripts must run fast possible don't need, , avoided including functionality few simple lines of code. maybe simple illustration of mean might help. say have module this my $my_string = "my_print"; sub my_print { print "$my_string: ", @_; } which allow lot of small scripts use my_print instead of print , simple require filename of module (and very little overhead). then, wanted use in module has package declaration, , no longer works, must use package declaration , therefore exporter in simple module work in new module. having been using perl quite while used fact quite simple, stra

Push Notifications are not properly received by android device -

i use push notification in android. every time response below. multicastresult(multicast_id=5497010412827061205,total=1,success=1,failure=0,canonical_ids=0,results: [[ messageid=0:1394436372955612%dea36ef2fbeed099 ]] i every time response above. messageid in response. means message deliver gcm server fine. sometime got push notification in device , sometime not. what reason behind ? i had similar issue. issue got solved when disconnected network , connected again. turning off mobile network , turning on solved me.

How to build the .s (asm) file in Android.mk file -

i integrating custom codec libstagefright in android source code. completed whatever explained custom wrapper codec integration android found problem have .s file in custom codec. i following local_cflags := -doscl_export_ref= -doscl_import_ref= not taking .s files build. i have found several solutions not answer links android ndk: how compiler architecture in android.mk dynamically what line mean? local_export_c_includes define symbol assembly (.s) source file in android.mk? http://netmite.com/android/mydroid/dalvik/vm/android.mk http://elinux.org/android_build_system https://cells-source.cs.columbia.edu/plugins/gitiles/toolchain/benchmark/+/8c231164b9a0a1b1b0784fe6d376ef201dce433d/gcstone/bench.mk please me issue thanks in advance. please try approach include .s files. important have fallback c implementation , assume have one. in codecs' android.mk file, ifeq ($(target_arch),arm) local_src_files += \ src/asm/file1.s \ src/asm/file

vhosts dont appear to be working on OS X Mavericks Apache installation -

i trying set apache server comes os x mavericks vhosts domain name resolves user level document webroot. have followed tutorial guided me through setting apache server php: http://coolestguidesontheplanet.com/get-apache-mysql-php-phpmyadmin-working-osx-10-9-mavericks/ as 1 guided me through setting vhosts: http://coolestguidesontheplanet.com/set-virtual-hosts-apache-mac-osx-10-9-mavericks-osx-10-8-mountain-lion/ following these tutorials, if type localhost in browser correctly resolves system level root (/library/webserver/documents/ folder). if use localhost/~myusername correctly resolves user level root (/users/myusername/sites/). however, whenever navigate domain, redirected system level root rather user level root. my vhosts file reads follows: <virtualhost *:80> servername localhost documentroot /library/webserver/documents/ </virtualhost> <virtualhost *:80> servername mydomain.com serveralias www.mydomain.com

algorithm - Accommodate maximum peoples in tour -

i have arrange tour. there n peoples want attend tour. of them enemies each other. (enemy of enemy may or may not enemy. if enemy of b, b enemy of a) if accommodate person in tour, can not accommodate enemy. now want accommodate maximum possible number of persons in tour. how can find number? ex: if there 5 tourists, , let's call them a-e. enemy b , d, b enemy of e, , c enemy of d. b c d e +---+---+---+---+---+ | - | x | | x | | +---+---+---+---+---+ b | x | - | | | x | +---+---+---+---+---+ c | | | - | x | | +---+---+---+---+---+ d | x | | x | - | | +---+---+---+---+---+ e | | x | | | - | +---+---+---+---+---+ in case following trips possible: empty, a, b, c, d, e, ac, ae, bc, bd, ace, ce, de etc. out of these, best tour ace accommodates 3 tourist , hence answer 3. my approach: i tried looping , trying combinations bitmaps, slow. i using dfs trying find better method. i tried work creating friendship graph , prepa

Custom queries with Breeze JS (Fiql + Breeze) -

im new breeze js, understand breeze has it's own query language related odata trying breeze js working custom query language, example fiql 1 of form make queries backend, can breeze run type of query language. overview of fiql :- http://jaxenter.com/tutorial-smarter-search-with-fiql-and-apache-cxf-46876.html (this not technical answer, @ it's advice) as mentionned website documentation : today, out of box, breeze product ships adapters asp.net web api , odata. ships .net components interface entity framework , generate breeze metadata entity framework model; ef model developed code first or database first. the breeze client in no way limited these technologies; merely first backend components available; we’d thrilled adapt breeze preferred server stack .

javascript - how to trigger this example with schedule date and time? -

visit the jsfiddle //wrap html inside wrapper div i.e. <div style="float:left;"><a href="https://www.2checkout.com/checkout/purchase?sid=1401348&quantity=1&product_id=8" rel="nofollow"><img src="http://www.interestingquestionstoaskagirl.msl37.org/wp-content/esg7/m-12.gif" title="" width="148" height="25" class="alignnone size-full wp-image-155" /></a></div> <div style="float:right;"><a href="http://www.msl37.org/wp-content/d/5.htm" rel="nofollow"><img src="http://www.interestingquestionstoaskagirl.msl37.org/wp-content/esg7/kas-34.jpg" title="" width="148" height="25" class="alignnone size-full wp-image-160" /></a></div> if change javascript this, trigger @ specified date , time // date , time want trigger function var triggerdatetime = new d

Saved image is different when read in matlab -

Image
i created matrix using calculation.i saved in bmp format.but when reading in matlab,the content of changes totally.only value 0 correct.all other pixels having values 255 .why this.how solve this?? showing image correctly when imsec command used i=1:length(pixel_matrix) pixel=char(pixel_matrix(i)); r=7; pixel_value=0; j=1:4 s=r-1; if(pixel(j)=='a') temp_bin=0; elseif(pixel(j)=='b') temp_bin=(2^r)+(2^s); elseif(pixel(j)=='c') temp_bin=(2^s); elseif(pixel(j)=='d') temp_bin=(2^r); end pixel_value=pixel_value+temp_bin; r=r-2; end pixel_row(i)=pixel_value; end i=1; j=1; m=1:length(pixel_row) pixel_value(i,j)=pixel_row(m); j=j+1; if(j==65) i=i+1; j=1; end end i=1:64 j=1:64 picture(i,j)=uint8(pixel_value(i,j)); end en

Python list true false statement -

i have question python list, how can iterate backwards setting buffer on list? mean keep in memory if path not true, iterate again? code example: def clientthread(conn): #infinite loop function not terminate , thread not end. # array of input data, check complete transaction pid while true: # recive true data data = conn.recv(4069) newpid = os.fork() if newpid == 0: child() else: bufsize = 0 input_data = [] input_miss = [] if data: # check data pids = (os.getpid(), newpid) print "parent: %d, child: %d" % pids # split line word = data.split(';') if word[0] == "start": channel = word[2] filename = word[6].rstrip() yearmonth = word[3] channelid = word

testing - (Integration) Test of Locale Storage (GWT) -

i have problems writing integration-test locale-storage in gwt-application. due fact locale-storage "client"-side db, have problems accessing through testing code. after bit of research found maybe way how it: http://code.google.com/p/gwt-test-utils/ is right way it, or should forget testing part (would bad)? if not how can handle it? gwt-test-utils indeed seems support storage : https://github.com/gwt-test-utils/gwt-test-utils/blob/master/gwt-test-utils/src/test/java/com/googlecode/gwt/test/storagetest.java …or use gwttestcase ; how feature tested in gwt itself. gwt 2.6 has upgraded htmlunit dependency should support local/session storage (i suppose); otherwise launch tests in real browser: http://www.gwtproject.org/doc/latest/devguidetestingremotetesting.html

php - Find the number of entries between two dates -

i building online hotel booking system , using php , mysql . in database scheme , table bookings refers booking dates . the below shows entries of bookings table :- id id_item the_date 1 1 2014-03-25 2 1 2014-03-26 3 1 2014-03-27 4 1 2014-03-25 5 2 2014-03-02 6 2 2014-03-02 7 3 2014-03-25 8 1 2014-03-26 9 1 2014-03-27 in table , id_item shows room category .in i d_item 1 there 2 rooms. in id_item=1 there 2 entries in between 25-03-2014 27-03-2014 .so 2 rooms booked . i want calculate how many number of entries in bookings "where id_item =1 , the_date between 25-03-2014 , 27-03-2014 ". select count(id) bookings id_item = 1 , the_date between '2014-03-25' , '2014-03-27'

rest - Angularjs appended $resource paramDefaults with special charaters -

i have following code var resource = $resource('https://api.mongolab.com/api/1/databases/' + db_name + '/collections/' + collectionname + '/:id', { apikey:api_key, id:'@_id.$oid'},{update:{ method:'put' } } ); when call $scope.projects = project.query({q:"+"}); referencing each key value in parameter object first bound url template if present , excess keys appended url search query after ?. i append request string in {}. cannot include special charaters. feature , how can implement special characters? i believe should urlencode values long sending them in url query

javascript - Can't get Dropzone.js to work? files always show with red x -

i trying dropzone.js work no success. have added dropzone.css , dropzone.js the plugin can found @ http://www.dropzonejs.com/ here div: <div id="divdropzone" class="dropzone square" style=" width:430px; heigh:300px; background-color:white; overflow-x:hidden; overflow-y:scroll;"></div> here js var mydropzone = new dropzone("div#divdropzone", { url: "/file/post"}); what happens dropzone displayed when drag or browse item shown red x , error on page: > post http://localhost:2627/file/post net::err_connection_reset you first need diagnose what's wrong. follow this answer here learn how view full error when file uploaded. remember, dropzone uses ajax, see errors you'll need use tool firebug or crome dev tools. in chrome tools can use network panel view error. dropzone item in red text. you'll know error is, , should able fix quickly.

Windows phone 8 json parsing -

what best possible ways parse json data in windows phone 8. need simple , robust json parser library example. there inbuilt support available in c# itslef? using c# , xaml app. need t parse json data web requests. use http://json2csharp.com/ create c# classes json , use json.net deserialize ti quite easily: await jsonconvert.deserializeobjectasync<rootobject>(jsontext);

c# - Cant find any way to group by multi dapper result -

i have query: const string query = @" select * [users] u left join [userroles] ur on [ur].[userid] = [u].[userid] left join [roles] r on [r].[roleid] = [ur].[roleid] left join [externallogins] el on [el].[userid] = [u].[userid]; "; and next class structure: public sealed class user : iuser<string> { public string id { { return this.userid.tostring(); } } public guid userid { get; set; } public string passwordhash { get; set; } public string securitystamp { get; set; } public string username { get; set; } public iqueryable<userlogininfo> userlogininfos; public iqueryable<role> roles; } and want ienumerable<user> dapper using single sql query (this @ start). var rows = connection.query(query).toarray(); if (rows.length == 0) { return null;

reporting services - SSRS Conditional Border Report -

i have report table component. want apply following logic: if value incid not null, border should " solid " (meaning should have border), if value incid null, border should " none " (meaning table should have no border). i used =iif(isnothing(fields!incid.value) = 1,"solid","none") doesn't work. problem? if apply , save settings , go expression, not saved. ok, this seemed problem.

sql - select mutiple rows from single column -

i have 2 tables tickets , tickets events tickets t-number t_street, t_zone,name 888 xyz abc 999 ddd rrr 1000 eee fff tickets _events te_system_ref te_event_code te_event te_userid 888 13000 off hold autodrop 888 11000 disocunt autodrop 888 10000 on hold autodrop 999 13000 offfhold smrithi 1000 11000 disocunt keerthi i need find out te_system_ref has both the te_events 13000 , 11000 select * ticket_events inner join tickets b on b.t_number = a.te_system_ref te_event_code = '13000' , //te_event_code in('13000','11000') or te_event in ('off hold' , 'disocunt') te_userid = 'autodrop' you can do select te_system_ref ickets _events te_event_code in('13000','11000')

jquery - How to get window width within an iframe? -

i want width of browser. i have code inside iframe alert($(document).width()); but display width of <div> element instead. i try code: alert($(window).width()); but same results. try this; parent.document.body.clientwidth

compilation - Self executable PHP files -

i'm writing scripts in php mangling data etc , able hand these on our client run without overhead of them having install php first. i wondering if there's way bundle php script create exe file? sounds might have compile php in clever way of kind , run file argument when it's executed. is there out there this? it'd handy! understand you'd end big executable because of overhead of having php executable bundled within it, think benefits outweigh down sides. any other suggestions? thanks, john.

javascript - V8: console.log implementation -

i'm using v8 in c++ app , add console.log() . there standard implementation can use? currently, have own dummy implementation it's quite incomplete. i found implementation node.js: https://github.com/joyent/node/blob/master/lib/console.js https://github.com/joyent/node/blob/master/lib/util.js of course need adopt code. uses nodejs global object process , stdout , stderr objects. here sample c++ code create such file objects: static void js_file_write(const v8::functioncallbackinfo<v8::value>& info) { int fd = (int) info.data().as<external>()->value(); auto isolate = isolate::getcurrent(); if( info.length() != 1) { isolate->throwexception( v8::exception::typeerror(jsstr("js_file_write: expects 1 arg"))); return; } if( !info[0]->isstring() ) { isolate->throwexception( v8::exception::typeerror(jsstr("js_file_write: expects string")));

Using require-dev with composer and laravel -

i using require-dev development tools dependencies. laravel debugbar, barryvdh ide-helper, etc... when production server , run "composer update --no-dev --no-scripts" seems ok. then, realize must remove "dev providers" app.php array. so whats point of using require-dev? there isnt "providers-dev" array? update: fixed it's not working. create file app/config/local/app.php this: <?php return array( 'providers' => append_config(array( 'barryvdh\debugbar\serviceprovider', 'way\generators\generatorsserviceprovider', 'barryvdh\laravelidehelper\idehelperserviceprovider', 'barryvdh\debugbar\serviceprovider', )) ); and on top of app/start/global.php $env = $app->detectenvironment(function(){ $hosts = array( 'localhost' => 'local', '127.0.0.1' => 'local', ); if(isset($hosts[$_server['se

WSO2 API Manager: exceeded the allocated quota -

what message mean in log? info {org.wso2.carbon.throttle.core.rolebasedaccessratecontroller} - cannot access service since have exceeded allocated quota. {org.wso2.carbon.throttle.core.rolebasedaccessratecontroller} my throtteling of service set unlimited, on service level on backend (post/get). we using wso2 1.6.0 please check throttling tiers have selected when creating application , subscription. throttling done based on restrictive tier. i.e if have selected bronze when creating application , unlimited when creating subscription, requests have quota of bronze subscription.

c# - Why does my Outlook becomes slow and sometimes unresponsive after starting an app to clear the clipboard? -

i had requirement disable copy paste , print screen key while website running. wrote wpf application keep clearing clipboard when open website link clicked , stop clearing close website button. problem when press open website button outlook client becomes slow , unresponsive. know has clipboard only. there way disable outlooks clipboard until button pressed. however code not required included bleow, or can downloaded dropbox : using system; using system.collections.generic; using system.linq; using system.text; using system.windows; using system.windows.controls; using system.windows.data; using system.windows.documents; using system.windows.input; using system.windows.media; using system.windows.media.imaging; using system.windows.navigation; using system.windows.shapes; using system.security.cryptography; using mysql.data.mysqlclient; using system.threading; using system.net.networkinformation; namespace ccb { /// <summary> /// interaction logic mainwindow.xaml

android - Tab Video in IOS browser -

i develop web site enable people videos youtube, dailymotion or vimeo (for now). i use iframe display videos on mobile device (ios/android). don't have problems. question : when go youtube.com iphone , read video, when video finished, "video tab" close automatically. same thing in dailymotion.com, not in vimeo.com. do people know how make in website ? maybe param don't know, javascript code ? thank !!

jquery - Tablesorter, PHP and AJAX -

i have problem when try sort table tablesorter.js. looks easy use it, in case doesn't work... first of all, explain application: 1.- have database several data 2.- developed web interface search data (html) 3.- wanted make interactive communication database, used ajax 4.- build querys , table results in php file so, in html file: <div id = "divresults"></div> and in header of file added jquery , tablesorter.js references , css file contento of css tablesorter $(document).ready(function() { $("#mytable").tablesorter(); } ); now, in php file have following code: <table id="mytable" class="tablesorter" style="font-size: 8pt; position:relative; top: -10px;" > <thead> <tr> <th><b>col1</b></th> <th><b>col2</b></th>

while trying to save record into Oracle 10g using java Swing the program terminates without executing -

hi, i'm trying save record oracle 10g using java swing program. when run program terminated import java.awt.event.*; import java.sql.*; @suppresswarnings("serial") class insert extends jframe implements actionlistener { jlabel label,label1,label2,label3,label4,label5; jtextfield tf1,tf2,tf3,tf4,tf5; jbutton btn; connection con; insert() { super("inserting employee records"); label1 = new jlabel("empid:"); label1.setbounds(20,20,100,20); tf1 = new jtextfield(50); tf1.setbounds(130, 120, 200, 20); label2 = new jlabel("employeename:"); label2.setbounds(20, 150, 100, 20); tf2 = new jtextfield(100); tf2.setbounds(130, 150, 200, 20); label3 = new jlabel("gender:"); label3.setbounds(20, 180, 100, 20); tf3 = new jtextfield(50); tf3.setbounds(130, 180, 200, 20); label4 = new jlabel("dob:"); la

date - How to convert month to other duration measurement types? -

for duration-related calculations need convert values measured in "months" other formats, such years, days, or hours. for example, proper way measure month in terms of days? 30 days? or 30.4375 days? (365.25 / 12) , format useful in cases? if have information on casual/business use cases such conversions helpful too. unfortunately, there's no single valid answer question. if business use, first check whether there existing relevant standards or business practices define "month" means in business context. if yes, should follow definition closely possible, silly or awkward may seem. for casual use, simplest solution pick use date manipulation library , whatever does. default behavior may not perfect, it's @ least close sensible compromise of many contradictory expectations users of such library may have. ok, if insist on rolling own solution? in case, first choice should make how want represent date / time values. there @ least 2

android - How to refresh SMS Listview automatically ? -

i creating sms app. sending , receiving sms application , can show them in listview. listview doesn't updated send or receive sms. have press button , after if again go listview activity new sms shown. how can make listview refresh automatically sms arrives or send ? code : public class chatactivity extends listactivity { private mylistadapter adapter; arraylist<string> item_id = new arraylist<string>(); arraylist<string> item_phone_num = new arraylist<string>(); arraylist<string> item_msg_body = new arraylist<string>(); arraylist<string> item_time = new arraylist<string>(); arraylist<string> item_flag = new arraylist<string>(); arraylist<string> items = new arraylist<string>(); private button btn_send; dbmanager manager; cursor cursor; viewholder holder12; string contact_for_chat; string contact_no; string message_body = ""; calendar c; simpledateformat sdf; string time; edittext et_chat;