Posts

Showing posts from August, 2010

java - Resource not found(404) when adding ContextLoaderListener and RequestContextListener in web.xml -

when adding contextloaderlistener web.xml got message of resource not found(404). when remove listener class web.xml index.php running adding <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.requestcontextlistener</listener-class> </listener> this 2 lines give me resource not found error eclipse kepler version.when adding these 2 lines in web.xml , prepare code heading error: java.lang.illegalstateexception: no webapplicationcontext found: no contextloaderlistener registered? i tried hard , new spring framework. can tell me setup needed listener or else? error in console: * jan 27, 2016 12:47:24 pm org.apache.catalina.core.standardcontext listenerstart severe: exception sending context initialized event listener instance of class org.springfr...

if statement - Excel Formula for less than 60 but greater than 30 -

my current excel formula is: =if([dvt contract end dates days left]<=0,"expired",if([dvt contract end dates days left]<60,"expiring soon","")) i want modify below : remove days less 30 , marked expiring more 30. try this =if([dvt contract end dates days left]<=0,"expired",if(and([dvt contract end dates days left]>30, [dvt contract end dates days left]<60),"expiring soon",""))

php - One to one relationship error on can't alter table when run artisan command -

i've multiple packages , users can have 1 package @ time, not multiple. so, i've created 1 one relationship , added foreign key in users table. here's relevant users table: public function up() { schema::create('users', function (blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('email')->unique(); $table->string('password', 60); $table->string('role'); $table->unsignedinteger('package_id'); $table->remembertoken(); $table->nullabletimestamps(); $table->foreign('package_id') ->references('id') ->on('packages'); }); } and here's packages table: public function up() { schema::create('packages', function (blueprint $table) { $table->increments('id'); $table->string(...

Android Robolectric unit test for Marshmallow PermissionHelper -

i wanna learn robolectric use unit tests on android marshmallow app. wrote permissionhelper methods make permission handling bit easier. started unit tests class, trying test simple method: public static boolean haspermissions(activity activity, string[] permissions) { (string permission : permissions) { int status = activitycompat.checkselfpermission(activity, permission); if (status == packagemanager.permission_denied) { return false; } } return true; } here robolectric test wrote far: @runwith(robolectrictestrunner.class) @config(constants = buildconfig.class) public class permissionhelpertest { private permissionhelper permissionhelper; private shadowapplication application; @before public void setup() { pictureactivity activity = robolectric.buildactivity(pictureactivity.class).get(); permissionhelper = new permissionhelper(activity, activity, 1); application = new shadowapplicatio...

java - manipulation with dynamically added textfield values -

jpanel consists 5 jtextfields . adding dynamically jpanels addbutton . , retrieving dynamically added jpanel values savebutton . code of savebutton : private void writefile(jpanel panel_name, printwriter file){ component[] children = panel_name.getcomponents(); (component sp : children) { if (sp instanceof subpanel) { component[] spchildren = ((subpanel)sp).getcomponents(); int count=1; (component spchild : spchildren) { if (spchild instanceof jtextfield) { string text = ""; if(count==1) text=((jtextfield)spchild).gettext(); if(count==2) text=((jtextfield)spchild).gettext(); if(count==4) text=((jtextfield)spchild).gettext(); if(count==5) text=((jtextfield)spchild).gettex...

itextsharp - How to edit PdfTemplate width (in Java) -

Image
is possible edit width of pdftemplate object before close of document ? in pdf process create document, , set template write total page number. set width doesnot works : // onopendocument pdftemplate pagenumtemplate = writer.getdirectcontent().createtemplate(10, 20); globaldatamap.put("mytemplate", pagenumtemplate) // onclosedocument font font = (font) globaldatamap.get("myfont"); string pagenum = string.valueof(writer.getpagenumber()); float widthpoint = font.getbasefont().getwidthpoint(pagenum, font.getsize()); pdftemplate pdftemplate = (pdftemplate) globaldatamap.get("mytemplate"); pdftemplate.setwidth(widthpoint); columntext.showtextaligned(pdftemplate, element.align_left, new phrase(pagenum), 0, 1, 0); an error in op's initial code you call columntext.showtextaligned string third parameter: string pagenum = string.valueof(writer.getpagenumber()); [...] columntext.showtextaligned(pdftemplate, element.align_left, pagenum, 0, 1...

php - Why is my code not retrieving the data in a graph? -

<?php session_start(); include "../../lib/mssql.connect.php"; $params = array($_post['year'], sha1($_post['month'])); $sql ="select count(*) totalguestbook_totalcount, month(guestbook_createddate) mth tbl_guestbook year(guestbook_createddate) ='2015' group month(guestbook_createddate)"; // run query $result = sqlsrv_query($conn, $sql, $params) while($row = sqlsrv_fetch_array( $result, sqlsrv_fetch_assoc)) { $dashboardresult[] = array('label' =>$row['guestbook_createddate'], 'values' =>$row['totalguestbook_totalcount']); } echo json_encode($dashboardresult); ?> do not include $params in query execution use: $result = sqlsrv_query($conn, $sql); instead of : $result = sqlsrv_query($conn, $sql, $params)

css3 - Images stretching in Flexbox on Firefox -

css3 flexbox working fine on safari , chrome, on firefox images stretched. how can fixed this? here example of code: body{ padding: 30px; } .img-wrapper{ display: -webkit-flex; display: flex; display:-moz-box -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; height: 350px; background-color: #eee; } <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/> <div class="row"> <div class="col-xs-4"> <div class="img-wrapper"> <img class="img-responsive" src="https://www.googledrive.com/host/0b_o3i6x00l9pufrrlwutm0wzug8" alt=""> </div> </div> <div class="col-xs-4"> <...

c++ - Mixing two arrays by alternating elements two by two -

what elegant algorithm mix elements 2 two in 2 arrays (of potentially differing sizes) items drawn in alternating fashion each array, leftovers added end? e.g. array 1: 0, 2, 4, 6 array 2: 1, 3, 5, 7 mixed array: 0, 2, 1, 3, 4, 6, 5, 7 don't worry null checking or other edge cases, i'll handle those. here solution not work properly: for (i = 0; < n; i++) { arr[2 * + 0] = a[i]; arr[2 * + 1] = a[i+1]; arr[2 * + 0] = b[i]; arr[2 * + 1] = b[i+1]; } it fiddly calculate array indices explicitly, if arrays can of different , possibly odd lengths. easier if keep 3 separate indices, 1 each array: int pairwise(int c[], const int a[], size_t alen, const int b[], size_t blen) { size_t = 0; // index size_t j = 0; // index b size_t k = 0; // index c while (i < alen || j < blen) { if (i < alen) c[k++] = a[i++]; if (i < alen) c[k++] = a[i++]; if (j < blen...

javascript - All series on a given axis must be of the same data type for line chart -

i'm working on line chart using google js , have given sample values testing , i'm getting error all series on given axis must of same data type script function drawchart() { // var data = google.visualization.arraytodatatable(chartdata); var data = new google.visualization.datatable(); data.addcolumn('number', 'year'); data.addcolumn('string', 'value'); data.addcolumn('number', 'quantity'); data.addrows([ [2008,'value1',36], [2009,'value2',27], [2010,'value3',39] ]); var options = { title: "company performance product category wise", pointsize: 5 }; var linechart = new google.visualization.linechart(document.getelementbyid('chart_div')); ...

testing - Run a specific test in a single test class with Spock and Maven -

i using spock framework testing (1.0-groovy-2.4 release). junit offers option run specific test using command line (with maven): mvn -dtest=testcircle#mytest test question : how can spock? this version has dependency on junit 4.12 , stated in junit documentation feature supported junit 4.x , spock should propose similar. after further investigation, answer probably: no, can't invoke specific test methods spock using surefire plugin feature. below reason. given following spock test case: import spock.lang.specification class hellospec extends specification { def hello = new main(); def sayhello() { given: "a person's name given method parameter." def greeting = hello.sayhello("petri"); expect: "should hello person name given method parameter" greeting == "hello petri"; println "hello hellospec" } } and given following plugins configuration: <...

php - Laravel 5.1 - Update name for current entry, must be unique to current User ID -

i've got code below in geckorequest file. works part, if try update entry , keep name fails saying name needs unique... no other entries have name apart current entry loaded in edit form. what best thing me check name unique current user allow me update same entry without changing name? public function rules() { switch($this->method()) { case 'get': case 'delete': { return []; } case 'post': { return [ 'morph' => 'required', 'sex' => 'required', 'genetics' => 'required', 'name' => "required|unique:geckos,name,null,id,user_id," . \auth::user()->id ]; } case 'put': case 'patch': { return [ 'morph' => 'required', ...

php - FormType default input value in same form -

i have entity named task , build symfony tasktype.php form. aim set enddate datetime field default input of startdate datime field (which required). i tried this, doesn't work. $builder->add('name'); $builder->add('startdate', 'datetime'); $builder->add('enddate', 'datetime', array( 'empty_value' => array('year' => 'year', 'month' => 'month', 'day' => 'day'), 'required' => false, 'data' => isset($options['data']) ? $options['data']->getenddate() : $options['data']->getstartdate(), )); exception: an exception occurred while executing 'insert task (name, startdate, enddate) values (?, ?, ?)' params {"1":"test","2":"2013-03-30 00:00:00","3":null}: sqlstate[23000]: integrity constraint violation: 1048 co...

c# - Remove Items From a CheckBox List -

here main form: <%@ page language="c#" autoeventwireup="true" codefile="checkdelete.aspx.cs" inherits="checkdelete" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org /tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <asp:checkboxlist id="chkitems" runat="server" style="width: 37px"> <asp:listitem value="a"></asp:listitem> <asp:listitem value="b"></asp:listitem> <asp:listitem value="c"></asp:listitem> <asp:listitem value="d"></asp:listitem> <asp:listitem value="e"></asp:listitem> <asp:listitem v...

mysql - How to delete duplicated rows with the same day? -

this question has answer here: deleting duplicates in mysql 4 answers my table looks like: id name value date 1 john 25 2013-03-23 16:42:35 2 john 25 2013-03-23 13:52:24 3 john 26 2013-03-22 03:12:43 4 gabriel 18 2013-03-23 10:21:07 5 rick 32 2013-03-21 04:37:29 how remove rows same name , timestamp date same day? example, table above should be: id name value date 1 john 25 2013-03-23 16:42:35 3 john 26 2013-03-22 03:12:43 4 gabriel 18 2013-03-23 10:21:07 5 rick 32 2013-03-21 04:37:29 there many ways it. 1 using subquery gets 1 record of name in each day , result of subquery joined on table. non matching rows filtered , deleted. delete tablename le...

accessing celery task results in chain within a group -

my workflow celery is: group1 = (task1, task2) chain2 = (task3, group1) group3 = (task4, task5, chain2) when start group3 , goes fine: task executed "dependency" need. tasks perform operation , return boolean. check result of every task. unfortunately, not able retrieve results: group3.results returns: true, true, tuple the tuple like: ('8a8b7c2c-db44-4096-ba29-93ad2cd63409', [('576966ec-0ce5-4d82-9ab5-a23da805299b', none), ('777c77a3-34d6-4021-943f-8c39e7e87311', none)]) and cannot handle chain result. if create asyncresult id 8a8b7c2c-db44-4096-ba29-93ad2cd63409 , can access results of subtask in group (i.e.: task1 , task2 results, no way task3 result). this method extremely complicated, cannot find specific in celery documentation, found method retrieve simple groups/chains results. given fact know workflow, best way access results?

AttributeError: 'function' object has no attribute 'add_subplot' when using matplotlib in ipython -

hi, trying code wesmckinney's python data analysis book in ipython environment,which built in anaconda. when typed simple code import matplotlib.pyplot plt fig = plt.figure ax1 = fig.add_subplot(2,2,1) traceback (most recent call last): file "<ipython-input-9-559e30a6412a>", line 1, in <module> ax1 = fig.add_subplot(2,2,1) attributeerror: 'function' object has no attribute 'add_subplot' an attributeerror arose, it's weird since anaconda surely installed matplotlib module. suggestion? thank you.

c - Makefile - wrong sequence of compiling -

in makefile below i'm trying compile 1 directory, make against trying in wrong order. it's starting compiling main.o , later goes straight compiling console. have no idea why it's not trying solve dependences before it. get: user@ubuntu:~/dokumenty/sysopy/cw1/zad3b$ make gcc -c -wall -i ./src/include src/main.c gcc -o macierze main.o main.o: in function `main': main.c:(.text+0x28): undefined reference `wczytaj' main.c:(.text+0x31): undefined reference `wczytaj' main.c:(.text+0x7e): undefined reference `suma' ... collect2: ld returned 1 exit status make: *** [console] błąd 1 here's makefile: ############ makra ############# cc = gcc cflags = -wall -i ./src/include lflags = vpath = ./src/operacje: ./src/we_wy: ./src/reszta ########### pliki ############## src_console = wczytaj_konsola.c wypisz_konsola.c src_file = wczytaj_plik.c wypisz_plik.c pliki.c src_function = suma.c roznica.c iloczyn.c macierz.c headers = suma.h rozn...

c# - How to show validation summary that corresponds exactly to the form submitted -

Image
the same problem discussed in post: multiple forms in mvc view: modelstate applied forms . i have followed along post , have several forms on same view, custom editor template, have created , registered custom model binder. here accompanying gist . when use html.validationresultfor() helpers in passwordeditorviewmodel.cshtml editor template desired results: <li class="error">@html.validationmessagefor(i => i.oldpassword)</li> <li class="error">@html.validationmessagefor(i => i.newpassword)</li> <li class="error">@html.validationmessage("passwordchangeerror.wrongpassword")</li> this code returns validation errors form i've posted. on other hand when use html.validationsummary() helper in same editor template validation result propagated across forms despite fact i've posted one: is normal behavior? or have missed in code? when using @html.validationsummary, not remembe...

ios - how to swipe cells in uitableview left and right, showing an image on left and an image on right -

Image
as illustrated, need achieve when swiping left, button image shows up, blue one, , when swiping right green button shows up, how this? use swift , xcode 6.4 this tried before asking, able show 2 options text in right of cell, don't want that, needed in illustration, , said, buttons need images not text. you can subclass uitableviewcell incorporate uipangesturerecognizer manipulates cell's contentview s frame , add buttons behind contentview . to see how can work detail, added example code on how below reference. adds tap gesture recognizer 'close' action on tap instead of selecting cell. also, requested in comments, here gif of how works (showing colors of buttons on side indication of action, can modify contentview 's frame overlapping buttons in subclass.) // // mwswipeabletableviewcell.swift // mw ui toolkit // // created jan greve on 02.12.14. // copyright (c) 2014 markenwerk gmbh. rights reserved. // import uikit protocol mwswip...

python subprocess run shell with gawk regular expression don't work -

the bash cmd : ps aux |grep tomcat |grep -ev grep |grep -o 'dcatalina.base=.*tomcat' |gawk -f'[ =]+' '{print $2}'" this works on bash , output is: /opt/backuplog/tomcat-6.0.44 however, want use cmd in python,so use subprocess out=subprocess.popen(cmd,shell=true,stdout=subprocess.pipe,stderr=subprocess.stdout) output,outerr = out.communicate() but output '' , want know how deal it use bash run it, command should be: cmd = '''bash -i -c "ps aux |grep tomcat |grep -ev grep |grep -o 'dcatalina.base=.*tomcat' |gawk -f'[ =]+' '{print $2}'"''' or can use subprocess.check_output : cmd = "ps aux |grep tomcat |grep -ev grep |grep -o 'dcatalina.base=.*tomcat' |gawk -f'[ =]+' '{print $2}'" subprocess.check_output(['bash', '-i', '-c', cmd])

regex - Jquery validate input to eight integers and two decimals -

i've tried code guess have error regex since it's true . besides regex, have problem keypress since i'm testing value before adding new char, don't want use keyup since don't know last char added (the user not input char @ end of input field). i appreciate solution, thanks. $('.myinputfield').keypress(function(){ var val = $(this).val(); var regextest = /^[0-9]{0,8}[.][0-9]{0,2}|[0-9]{0,8}$/; var ok = regextest.test(val); if(ok) return true; else return false; i think may want regex this: /^\d{0,8}(\.\d{0,2})?$/ you using . instead of \. , . match any character. the ? near end allows have ".12" or not have it. \d short-cut way of restricting digits. please consider not using keypress - keyup (better) or change (best) other options think about. if need "extremely responsive" feedback (can't use change ), consider doing (please use better approach simple css i...

javascript - Changing the background of a ChartJS on node js -

Image
i have following simple code running fine on node.js: var express = require('express'); var canvas = require('canvas'); var chart = require('nchart'); var app = express(); app.get('/', function (req, res) { var canvas = new canvas(400, 200); var ctx = canvas.getcontext('2d'); var data = { labels: ["january", "february", "march", "april"], datasets: [ { label: "my first dataset", fillcolor: "rgba(0,0,0,0)", //transparent strokecolor: "#f15a42", pointcolor: "#f15a42", pointstrokecolor: "#fff", pointhighlightfill: "#fff", pointhighlightstroke: "rgba(220,220,220,1)", data: [5, 9, 8, 1] } ] }; var mychart = new chart(ctx).line(data, {}); res.setheader('content-type', 'image/pn...

php - SQL error due to ' in variable contents -

this question has answer here: how can prevent sql injection in php? 28 answers good morning, i have issue sql insert command php. i'm trying following code: $teammatchtable = "insert team match table (lineupforward) values ('$homelineupforward')";` however contents of $homelineupforward variable is: alexandre d'acol; this resulting in error because of ' . what can solve problem? you can try this. $homelineupforward= mysql_real_escape_string($homelineupforward); $teammatchtable = "insert team match table ('lineupforward') values ('$homelineupforward')";

java - GridBagLayout fix space set by weight x/y -

i have frame following layout of 3 jpanels. ---------------------------- | | | | l | | | e | //toppanel | | f | | | t |----------------------| | p | | | n | //bottompanel | | l | | | | | ---------------------------- i achieved use of gridbaglayout this code layout public class uitests extends jframe{ public uitests(){ setlayout(new gridbaglayout()); //the 3 main panels jpanel leftpanel = new jpanel(); jpanel toppanel = new jpanel(); jpanel bottompanel = new jpanel(); leftpanel.setbackground(color.yellow); toppanel.setbackground(color.green); bottompanel.setbackground(color.pink); //position 3 main panels gridbagconstraints gbc = new gridbagconstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.gridheight = 2; gbc.gr...

PHP - Weird behaviour of mysqli -

im running strange problem of sudden: i have php script executing query: $query = "select shoporderid, paymentid shop_order done = 0 , paymentlockdate not null , unix_timestamp(orderdate + 7200 < unix_timestamp(now())"; the query fine, when print pma executes fine , gives me 12 results processed. now execute query , gather result: $handle = new mysqli( $config->getsqlhost(), $config->getsqluser(), $config->getsqlpw(), $config->getsqldbname(), $config->getsqlport() ); $result = $handle->query($query); now add thing, if try loop result: if(is_object($result) == true) { //is_object returns true! while($row = $result->fetch_assoc()) { //but error o.o } } i get: fatal error: call member function fetch_assoc() on non-object in /var/www/(and on...)/myscript.php on line 34 now weirdo thing is, if tests on object $result says: var_dump(is_object($result)); //bool(true) var_dump(get_class($result)); //st...

asp.net mvc - Web Api 2 controller to download wikipedia api and show json output on web -

i trying parse wikipedia api contain short text of article.i using asp.net mvc coding. wikipedia api https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exlimit=max&explaintext&exintro&titles=berlin&redirects= in json formatted. @ present have done - inside model created folder named wiki, , inside created 4 class named limits.cs, pageval.cs, query.cs, rootobject.cs. public class limits { public int extracts { get; set; } } public class pageval { public int pageid { get; set; } public int ns { get; set; } public string title { get; set; } public string extract { get; set; } } public class query { public dictionary<string, pageval> pages { get; set; } } public class rootobject { public string batchcomplete { get; set; } public query query { get; set; } public limits limits { get; set; } } now in controller class created webapi 2 contrller make model object show on web. in case new in ...

Convert a Java Future to a Scala Future -

i have java future object convert scala future. looking @ j.u.c.future api, there nothing use other isdone method. isdone method blocking? currently have in mind: val p = promise() if(javafuture.isdone()) p.success(javafuture.get) is there better way this? how wrapping (i'm assuming there's implicit executioncontext here): val scalafuture = future { javafuture.get } edit: a simple polling strategy (java.util.future => f): def pollforresult[t](f: f[t]): future[t] = future { thread.sleep(500) f }.flatmap(f => if (f.isdone) future { f.get } else pollforresult(f)) this check if java future done every 500ms. total blocking time same above (rounded nearest 500ms) solution allow other tasks interleaved in same thread of executioncontext .

machine learning - The convolutional neural network i'm trying to train is settling at a particular range of loss value, how should i avoid it? -

description: trying train alexnet similar(actually same without groups) cnn scratch (50000 images, 1000 classes , x10 augmentation). each epoch has 50,000 iterations , image size 227x227x3. there smooth cost decline , improvement in accuracy few initial epochs i'm facing problem cost has settled ~6(started 13) long time, been day , cost continuously oscillating in range 6.02-6.7. accuracy has become stagnant. now i'm not sure , not having proper guidance. problem of vanishing gradients in local minima? so, avoid should decrease learning rate? learning rate 0.08 relu activation (which helps in avoiding vanishing gradients), glorot initialization , batch size of 96. before making change , again training days, want make sure i'm moving in correct direction. possible reasons?

javascript - Issue with an developed ionic app for android -

currently working ionic app development can developed app using ionic framework if install application in phone or other android device phone stuck , restarts automatically.following plugin list used in app "google play services android" "keyboard" "pushplugin" "console" "device" "notification" "splashscreen" "whitelist" "toast" "diagnostic" "camera" "file" "file transfer" "inappbrowser" possible remove issue app please suggest me solution in adv...

sql server 2008 - Efficient way of filling up the table with million empty rows -

do know efficient way of filling table huge number of empty rows? inserting them using while clause not efficient. there better way of filling table empty rows this: declare @cnt int set @cnt = 1 while @cnt < 3 begin insert tab values( '1' ) set @cnt = @cnt + 1 end i know, if possible display let 1 mil rows (numbered 1 1000000) using select clause , cte (common table expressions) without using existing table. i appreciate help. here way generate sequence of numbers: select top (1000000) n = convert(int, row_number() on (order s1.[object_id])) yourtable sys.all_objects s1 cross join sys.all_objects s2 option (maxdop 1); create unique clustered index n on yourtable(n) -- (data_compression = page) ; see sql fiddle demo of 100 numbers being created. this code @aaron bertrand's article generate set or sequence without loops – part 1 . article includes other methods generate number sequence.

orchardcms - edit button not show in Orchard Zones 1.9.2 -

Image
i download orchard.web.1.9.2 , want add edit button in upper right corner. in tutorials show need log in admin , enable modules (content control wrapper , enable widget control wrapper). still didn't see button.

ruby on rails - How can I add school_id to my path? -

in search.html.haml, want user have ability click on teacher name , lead them teacher show page. however, requires me have school_id because teacher belongs school, , school has many teachers. now, wondering if there way me school_id path without breaking application. error rails throwing @ me is: no route matches {:action=>"show", :controller=>"teachers", :id=>"1", :school_id=>nil} missing required keys: [:school_id] here files: search.html.haml : .text-center / no search results announcement/notification - if @teachers.blank? %h2 xin lỗi, hệ thống chúng tôi không có thông tin về giảng viên mà bạn muốn tìm. - else - @teachers.each |teacher| %h2= link_to teacher.fullname, school_teacher_path(@school, teacher) #note %em khoa #{teacher.department}, trường #{teacher.school.name} teachers_controller.rb : class teacherscontroller < applicationcontroller before_action :find_school...

android - How to broadcast intent from native message -

server send sms mobile link/action/predefined string. on clicking of link call directly need application perform action. there possible way achieve ? user needs tap link can perform action. cannot register read sms receiver proceed once sms receives. in advance..

java - Isn't PDFBOX2.0 supported JDK 1.5? -

i want use pdfbox 2.0 in jdk 1.5 environment. i might read pdfbox supported in jdk 1.5 environment. in jdk 1.5, have done test. unsupported. so want know weather pdfbox 2.0 supported jdk 1.5 environment. from doc ( https://pdfbox.apache.org/2.0/migration.html ) : pdfbox 2.0.0 requires @ least java 6 packages migration pdfbox 2.0.0 environment pdfbox 2.0.0 requires @ least java 6 packages there significant changes package structure of pdfbox: jempbox no longer supported , removed in favour of xmpbox examples moved new package "pdfbox-examples" commandline tools moved new package "pdfbox-tools" debugger related stuff moved new package "pdfbox-debugger" new package "debugger-app" provides standalone pre built binary debugger

jquery - p:ajax taking a lot of time -

Image
i using empty p:ajax in p:selectonemenu , time taken send request , first response server approximately 1.02 secs. why taking time. 1 sec. empty ajax call much. following code : <p:selectonemenu id = "myid" value = "#{mybean.myattr}" styleclass = "myclass" disabled = "#{mybean.isdisalbed}"> <p:ajax /> </p:selectonemenu> attached image of time consumed on changing value in drop down. network response on option change.

caching - CakePhp Cache Clear All Models -

i have configuration in core.php $memcacheserver = '127.0.0.1:11211'; $engine = 'memcached'; cache::config('default', array( 'engine' => $engine, 'duration' => 3600, 'probability' => 100, 'prefix' => $prefix, 'servers' => array( $cacheserver // localhost, default port 11211 ), //[optional] 'groups' => array( 'catalogs', 'products', 'aro', 'aco', 'product_categories', 'available.cats', 'available.prod.cats', 'this.user.catalogs', 'temp.comp.fetch' , 'uc' ), 'persistent' => 'my_connection', // [optional] name of persistent connection. 'compress' => true, /...

Is there a way in C# to initialize jagged arrays similarly as in Java -

in java, can following: string[][] map = { {"1.0, ", "1.1, ", "1.2, ", "1.3, ", "1.0, "}, {"a, ", "b, ", "c, ", "d, ", "e, "}, {"x, ", "xx, ", "xxx, ", "xxxx, ", "xxxx, "}, }; but same code not compile in c#. in tedious way initializing sub-fields 1 one sure there better way. the closest thing can in c# add new [] before each array initializer: string[][] map = { new [] {"1.0, ", "1.1, ", "1.2, ", "1.3, ", "1.0, "}, new [] {"a, ", "b, ", "c, ", "d, ", "e, "}, new [] {"x, ", "xx, ", "xxx, ", "xxxx, ", "xxxx, "}, };

php - How do I get .png images with my foreach loop right? -

first of all, i'm sorry english, isn't best. now have foreach loops: @foreach(array_combine($land_keys, $land_values) $key => $value) @foreach($all_lands_flag $flag) @if(strtolower($key) == $flag) <tr> <td><img src="/flags/{{$flag}}.png"/></td> <td width="86%">{{$key}}</td> <td>{{$value}}</td> </tr> @endif @endforeach @endforeach the @ before php commands @if, @foreach because i'm using laravel framework. like can see have arrays in foreach , work's perfect, there aren't problems. it's more part: @foreach($all_lands_flag $flag) @if(strtolower($key) == $flag) <tr> <td><img src="/flags/{{$flag}}.png"/></td> <td width="86%">{{$key}}</td> <td>{{$value}}</td> ...

Set XML element to no namespace in XSD? -

i'm trying validate xml according xsd. in xml there tags namespaces , without. <my:person xmlns:my="http://my.namespace.com"> <my:name>john doe</my:name> <my:year>1988</my:year> <namespacelesselement>some value</namespacelesselement> </my:person> my xsd looks this. validation fails because according xsd, namespacelesselement has namespace. <?xml version="1.0" encoding="utf-8" standalone="yes"?> <xs:schema xmlns:mynamespace="http://my.namespace.com" xmlns:xs="http://www.w3.org/2001/xmlschema" targetnamespace="http://my.namespace.com" elementformdefault="qualified"> <xs:element name="person" type="mynamespace:person"/> <xs:complextype name="person"> <xs:sequence> <xs:element name="name" type="xs:string...

Youtube API and excel - retrieve username from cell (video URL) -

this excel macro homework. task display youtube video channel name, based on url. let's have column (each cell separate video url) , column b in want display names. i know using code: https://www.googleapis.com/youtube/v3/videos?id=<video_id>&key=<your_api_key>&part=snippet i can display basic data includes "channeltitle" variable. how display channel title? https://developers.google.com/youtube/v3/getting-started#part i'd fields = channeltitle . play around little or parse json in vba macro: parsing json in excel vba

sql server - Stored proc to perform same operations for different tables -

month registered users daily - total accounted time (hrs) oct 73 5.90 nov 70 6.40 dec 81 5.80 i have 3 tables in these same format , i've perform same operations these 3 tables. there possible way perform them using single query, in stored proc? try this, should make use of dynamic sql. create procedure dbo.proc1 @tablename varchar(256),@groupbycolumn varchar(256)='',@filter varchar(256)='' begin set nocount on; declare @cmd nvarchar(max)='' set @cmd='select * ' + @tablename +'' --using --set @cmd='select * ' + @tablename +' id='+@filter --using group columns --set @cmd='select '+@groupbycolumn+',max(column) ' + @tablename + ...

c# - No console output when using AllocConsole and target architecture x86 -

i have winforms project, , if user want's debug console, allocate console allocconsole() . all console output works target architecture set "any cpu", when change "x86" doesn't output ( console.read() still works expected). if open exe directly, output works. looks visual studio redirects it's own "output" window. i tried this answer, didn't work, tried console.setout(getstdhandle(-11)) , didn't work either. setting target architecture 'any cpu' no option me. so here 2 questions: why case when target architecture set x86? how can output console when running inside of visual studio? when "enable native code debugging" enabled, output consoles crated allocconsole redirected debug output window instead. the reason happens in x86 , not anycpu because can debug native code in x86 application. note behavior occurs consoles created allocconsole. console application's output not redirected. ...

java - Create a new ArrayList in Netbeans -

i'm new programming in netbeans , keep simple possible, please. so, right have 3 java files in same project: mainframe.java, edit.java , add.java. in mainframe-window have 2 buttons edit , add-window. in add-window enter text in text field , press button add arraylist , did this: public static void main(string args[]) { list<string> hey = new arraylist<string>(); } and button: private void btnfortsattactionperformed(java.awt.event.actionevent evt) { //the variable name of text field "txfcreate" string text = txfcreate.gettext(); hey.add(text); //the problem here netbeans cannot find "hey" symbol } next, in edit-window, have jlist show content of arraylist . have no idea know how code it:( public class { list<string> hey; public static void main(string args[]) { hey = new arraylist<string>(); } private void btnfortsattactionperformed(java.awt.event.actionevent evt) { //the varia...

AWS Flow Framework Hello world samples in Java for Amazon SWF -

i need implement hello world sample application in java using amazon swf(simple workflow webservice). please give me suggestion sample application. the using aws flow framework webinar demonstrates "hello world" sample. see official aws swf samples .

sql - Sum and show once a product in SSRS -

Image
i created table production data in ssrs if select 1 week in report dos not sum individual products i sum products each datetime. how can this? should show me result once line each product. if correct want group name can select date range of report. using dataset i've recreated scenario , created expected tablix. note there 2 different datum values , name values repeated across date range. using tablix following data arrangement. it produce tablix: let me know if helps you.

php - Wordpress database is not updating -

so have got issue wordpress on local machine running osx 10.10.5 i creating wordpress theme scratch , seems issue database. when create new post, not added database, next when try install plugin, not added database. thought down permissions, no. i have tried install php mcrypt on machine , playing lot apache/mysql/php config files well, maybe affected well? have removed mysql, still nothing. i running mamp local development thought should good, no if have been playing things can causing issue, think difficult solve or other, without knowing have changed when issue appear. i recommend reinstall mamp, wordpress , have been playing around. for self-experience, recommend don't change things don't know on site production site. make site testing or @ least, take backup before. have learned hard way :)

java - Unexpected behavior of DateTimeFormatter of Joda Time? -

i expecting datetimeformatter return null or nothing if method 'public string print(readableinstant instant)' passed null datetime (which readableinstant.) surprisingly returns current time instead of throwing error. bug ? here related code - import org.joda.time.*; import org.joda.time.format.datetimeformat; import org.joda.time.format.datetimeformatter; public class jodatest { public static void main(string[]args){ datetime dt = null; string ss = gettimeinaformat(dt); system.out.println(ss); } public static string gettimeinaformat(datetime time) { datetimeformatter dtf = datetimeformat.forpattern("mm-dd-yyyy hh:mm"); string datetime = dtf.print(time); // should throw error or return, return datetime; // string = "no date set" } } it behaves documented : parameters: instant - instant format, null means

AWS Linux configuring mysql with tomcat7 -

i've installed tomcat 7 , mysql 5.5 on aws linux micro instance. i'm trying figure out how configure tomcat 7 communicate mysql, have had no luck. i've been glassfish user, pretty simple through gui, tomcat, i'm not sure how configure this. i've looked @ apache documentation on tomcat 7, found myself more confused. not know files need edit , not know edit them with. need install mysql driver? use jdbc or jndi? app tapestry5 app uses hibernate, i'm not sure if matters. does know of nice guide or provide me example code on how this? record, have couple hours behind wheel of linux, i'm green when comes linux related. update i found following default configuration <!-- <resource name="userdatabase" auth="container" type="org.apache.catalina.userdatabase" description="user database can updated , saved" factory="org.apache.catalina.users.memoryuserdatabase...