Posts

Showing posts from May, 2013

windows runtime - Why does MusicProperties->Year always return the current year? -

windows runtime - Why does MusicProperties->Year always return the current year? - i'm trying music properties each file in music library using storagefolder apis. after calling getfilesasync(commonfilequery::orderbyname) on music library i'm iterating on resulting ivectorview^ , calling storagefile->properties->getmusicpropertiesasync() each file, inherently slow have way, since queryoptions not supported on windows phone reason. anyway, after completing task every property right except musicproperties->year, 2014 every single 1 of on 900 music files on phone. here's short code snippet: create_task(lib->getfilesasync(search::commonfilequery::orderbyname)) .then([](ivectorview<storagefile^>^ songfiles) { auto taskptr = std::make_shared<std::vector<task<song>>>(songfiles->size); (size_t = 0, len = songfiles->size; < len; ++i) { storagefile^ song = songfiles->getat(i); (*taskptr)[

php - use of filter_input_array and array_filter on the same array -

php - use of filter_input_array and array_filter on the same array - i have variable set of identical input fields in form can empty. <input type="text" class="form-control" name="option[]" placeholder="fill in" /> <input type="text" class="form-control" name="option[]" placeholder="optional" /> <input type="text" class="form-control" name="option[]" placeholder="optional" /> the values of these input fields come array $_post["option"] i want filter $_post["option"] , using next code: $filter = array("option" => array("filter"=>filter_callback,"flags"=>filter_force_array,"options"=>"ucwords")); $optionfin = filter_input_array(input_post, $filter); but want utilize array_filter function remove empty fields can input filled in fields database doesn&

android - How to keep javadoc visible after obfuscating -

android - How to keep javadoc visible after obfuscating - i built nice javadoc documentation project jar file developers. but after run proguard in order obfuscat code javadoc documentation gone. i maintain javadoc on public methods in jar. know how maintain javadoc visible after obfuscating? thanks! javadoc extracted source files. not possible create javadoc class files, neither clean nor obfuscated. proguard operates on class files created compiling source files, , produces obfuscated class files it. unrelated javadoc creation. the output of javadoc processor goes directory structure. of course, can zip , give .jar extension provide javadoc well. i’ve seen (i.e, on apache commons) name library jar foo-bar-1.2.3.jar , zipped javadoc foo-bar-1.2.3-javadoc.jar . it thought provide javadoc separated binary, binary needs included in programme distribution relies on it, whereas javadoc interesting developer , increment size of programme without need if in same

video - How to get h264 bitrate -

video - How to get h264 bitrate - tried mediainfo, tried ffprobe -show_streams -i "file.mkv" (or raw file.h264) , gives me bit_rate=n/a . mediainfo gives nil @ all. the way found out creating .dga file indexing via megui , using bitrate calculator tool , setting same exact size source, shows average bitrate, way ridiculous , knows how accurate. well, h.264 raw-data not contain timing information. can extract frame size , giving frame-per-second parameter can calculate bitrate. wrote simple bash-script uses awk , ffmpeg (ffprobe). #!/bin/bash # mimic output of # mplayer -lavdopts vstats file -fps 30 -vo null # illustration usage: # ./vstats.sh file.hevc 30 ffprobe=$home/src/ffmpeg/ffprobe fps=$2 # default 30 fps : ${fps:=30} frames=$3 # numper of frames process : ${frames:=65536} awk -v fps="${fps}" -v frames="${frames}" ' begin{ fs="=" } /pkt_size/ { br=$2/1000.0*8*fps if (br > max_br) max_br=br acc

PHP JAVA bridge class not found complete steps if anyone know as path error -

PHP JAVA bridge class not found complete steps if anyone know as path error - well, question simple have 1 class file called apples.class , have apples.jar file. now apples.class file set within c:\program files\apache software foundation\tomcat 7.0\webapps\javabridge\web-inf\classes\apples.class second apples.jar file set within c:\program files\apache software foundation\tomcat 7.0\webapps\javabridge\web-inf\lib\apples.jar now, trying create object of apples.class file getting error of java.lang.exception: createinstance failed: new apples. cause: java.lang.classnotfoundexception: apples and code is: require_once("java/java.inc"); exec("java apples", $output); print_r($output);//working javaphp bridge fine $myobj = new java("apples"); //not creating object , homecoming me above error so if please help me out letting me know missing , how can create object of apples class. , sec main question set file

mysql - Selecting data where a column is maximum -

mysql - Selecting data where a column is maximum - i have mysql table below. id x y z 1 1 1 1 2 7 4 2 2 9 4 3 3 2 3 1 4 2 2 1 4 2 2 2 5 3 3 1 i want select x ( id=2 , y=4 , z maximum). have code cant understand add together max function. $check_x=mysql_query("select x hamdun_soft id='2' , y='4'"); please help me mysql. there right variant if need only 1 x maximum z select x hamdun_soft id = '2' , y= '4' order z desc limit 1 and variant subquery if there may not 1 x maximum z. select x hamdun_soft id = '2' , y = '4' , z = (select max(z) hamdun_soft id = '2' , y = '4') p. s. and don't forget mysql_* family of function deprecated now. can utilize mysqli_* or pdo . mysql

Limit marker movement from starting point (google maps API 3) -

Limit marker movement from starting point (google maps API 3) - i place marker on map draggable property true. want restrict moving marker not more 500 meters original position. how can it? there improve way tried? i tried drag event. measure distance code found on so. don't know how can prevent drag. seek returning false, seek view if function parameter has cancel or that. google.maps.event.addlistener(marker, 'drag', function(e) { var distance = application.getmapdistance(data[0].geometry.location, marker.getposition()); document.title = distance; if (distance > 500) homecoming false; //not working, e has no cancel or }); edit: apparently not happy question. yes basic logic set google marker position lastly good, way, marker flicker when moved outside bounds. pretty sure google can improve this. google.maps.event.addlistener(marker, 'drag', function(e) { var distance = application.getmapdistance

perl assign string on multiple lines -

perl assign string on multiple lines - i'd able assign concatenation of multiple strings variable. i'm looking this: $variable = 123 $string = "hello" + "this " + $variable + "string"; is possible along these lines in perl? from perlop #additive operators: additive operators binary + returns sum of 2 numbers. binary - returns difference of 2 numbers. binary . concatenates 2 strings. therefore, string concatenation need: $string = "hello" . "this " . $variable . "string"; perl

html - Simple Javascript Calculator -

html - Simple Javascript Calculator - i'm trying larn javascript , sense have decent grasp on fundamentals having problems making things want .. example.. trying create simple form in html calculates sum of 2 numbers.. here html , javascript: <head> <script type="text/javascript"> function adder(a,b) { var = document.getelementbyid('firstnum').value; var b = document.getelementbyid('secondnum').value; var numbers = new array(a,b); var sum = 0; (i=0; < numbers.length; i++) { sum += parseint(numbers[i]); } //this part need help document.getelementbyid('answer').write("first number: " + + " plus sec number: " + b + " " + sum).value; //this part need help </script> </head> <body> <form id="additionform"> + b = c : <input

Some custom fonts are not showing in Silverlight -

Some custom fonts are not showing in Silverlight - i'm using visual studio 2010. want build application displaying text custom fonts. fonts truetype fonts, editable attribute, , declared resource "copy always". but, @ design time, fonts replaced standard silverlight font, in xaml editor. illustration have 14 different versions of helvetica font (bold, oblique, italic, narrow, condensed... , mix of those). 3 correctly displayed, others using fallback font. if open ttf files windows font preview application looks ok. any thought of can wrong ? thanks help. after 2 months of hair pulling i've come simple solution : don't utilize - (dash) in embedded font names i hope can help somebody. silverlight fonts

django - unique_together constraint on multiple columns with NULL values -

django - unique_together constraint on multiple columns with NULL values - i have database of automotive parts includes branded & unbranded items. if brand name unavailable, full_name part.name , else brand.name + part.name . how can define unique_together constraint ensure uniqueness of full_name @ database level? current constraint allows multiple parts same name if brand name missing (i.e. brand_id foreignkey null ) class brand(models.model): name = models.charfield(max_length=100) class part(models.model); name = models.charfield(max_length=100) brand = models.foreignkey(brand, null=true, blank=true) def get_full_name(self): if self.brand_id: full_name = '%s %s'.format(self.brand.name, self.name) else: full_name = self.name homecoming full_name class meta: unique_together = (('name', 'brand'),) using : django 1.6 + postgresql 9.3 p.s. there's first-c

De-queue and linked list -

De-queue and linked list - i want know de-queue is? same linked list? if yes then, is "de-queue can represented linked list" ? or de-queue "singly linked list" or "double linked list" (like alias of them)?? de-queue double-ended queue. in queue have 2 basic operations: 1. add together element @ end of queue 2. remove element start of queue. de-queue supports total 4 basic operations: 1. add together element @ start. 2. remove element start. 3. add together element @ end. 4. remove element end. of course of study can add together other functionality getting value of first or lastly element without removing etc. can implement de-queue using info construction efficient implementations done using dyanmic array or doubly linked list. more details follow link http://en.wikipedia.org/wiki/double-ended_queue linked-list queue

jslint - TeamCity - MSBuild Code Analysis -

jslint - TeamCity - MSBuild Code Analysis - i've used jenkins ci few years , want larn teamcity. in jenkins tracked fxcop issues enabling code analysis on .net projects , telling violations plugin find code analysis xml files i.e. msbuild set file named [project name].codeanalysislog.xml in build output directory , utilize **/*/*codeanalysislog.xml find files violations plugin. teamcity has own fxcop runner don't want run fxcop 1 time again because msbuild has done me. i want able tell teamcity find xml files , have produce trend graph in same way jenkins violations plugin. i have similar issue stylecop, jslint , csslint. msbuild build tasks or batch commands run part of build produce xml output. utilize output create trend graphs. to knowledge teamcity different jenkins reports in sense takes them in html format. that's have had our code quality analysis product - convert our xml study html teamcity. due can't violation trend study when in

javascript - How to add method to existing object in Coffeescript? -

javascript - How to add method to existing object in Coffeescript? - lets object created function: myobject = somefunction(); so now, myobject object. how add together new method object? next not work in coffeescript: myobject.newmethod: (something) -> # stuff here i not able edit object definition in somefunction() , have add together method object after fact. proper syntax here? it myobject.newmethod = (something) -> . you utilize colon when declaring property, , assignment operator when assigning property. time declare property, when object beingness created. true in javascript. var myobject = {foo: 'bar'}; myobject.baz = 'quux'; the best practice not modify objects don't own (somefunction owns object). should instead create function takes kind of object argument. javascript coffeescript

Load txt from Github in html with JavaScript -

Load txt from Github in html with JavaScript - me , friend working on text, saved in txt format, has custom markup , stored in github repo. is possible load such txt's github html file javascript , parse them accordingly build html out of custom markup? know such tasks done on server side, provisional purposes, while work on txt's still in progress, possible without server? i tried load txt's simple xmlhttprequest (as described here) , cors request (as described here), both times got errors due cross-domain nature of requests. i've been wondering, @ possible? i asking because i'd host provisional website on github pages, not back upwards sites need backend logic. javascript github cors

c# - Entity Framework: Query is slow -

c# - Entity Framework: Query is slow - i having problems entity framework. have simplified create easier explain. these mssql tables i utilize next code cities each of countries in mssql database var country = new country() { cities = obj.counties.selectmany(e => e.cities).select(city => new dccity { name = city.name, population = city.population }) }; this returned json there bit more 40.000 records in city table. retrieve list countries , respective cities takes around 8 seconds. trying cut down this. know optimization tips accomplish this? you need query cities table first data: var cities = _context.cities.select(x => new { contryid = x.county.country.countryid, contryname = x.county.country.name, cityid = x.id, cityname = x.name }); var countrylookup = new dictionary<int, countrydto>(approximatelycountofcountries); foreach (var city in cities) { countrydto country; if (!country

How do you debug an Azure WebJob that won't start? -

How do you debug an Azure WebJob that won't start? - i have webjob triggered azure storage queue. when test locally works fine. when publish webjob (as part of azure website) , go azure management portal , seek start webjob, throws , error. i had running earlier, having problems deleted job in management portal , tried republish web site web job. any suggestions on how figure out what's going on? in old azure management portal there no clear way find kill process (stop job if there one). using new portal, looked @ processes running on site , there webjob running 26 threads. after killing process able start recent uploaded one. azure-webjobs

cakephp - ajax code for Select Box onchange event -

cakephp - ajax code for Select Box onchange event - i have select box menu(id,name) , have select box category (cid, cname) , must show category based on menu selected setting menuid " url ". here code: http://jsfiddle.net/l8su2/738/ echo $this->form->create('subcategorynew'); echo $this->form->input('menu_id', array('empty'=>'--select--','label'=>'menu','type'=>'select','options'=>$menunew, 'div' => false, 'id' => 'prodid', 'onchange' => 'test()', 'class' => 'form-control')); echo "</br>"; echo $this->form->input('category_id', array('type'=>'select','label'=>'category', 'div' => false, 'id' => 'total','options'=>$catnew, 'class' => 'form-control')); echo "</br>"

php - How to ignore character case of attribute's value? -

php - How to ignore character case of attribute's value? - i'm using curl fetch meta description of web page. here's fraction of code: $metas = $doc->getelementsbytagname('meta'); ($i = 0; $i < $metas->length; $i++) { $meta = $metas->item($i); $metaname = $meta->getattribute('name'); if($metaname == 'description') $description = $meta->getattribute('content'); } <meta name="description" content="<?php echo $description; ?>" /> it works ok, not perfectly. problem happens when character case of element's attribute or value different defined. example, code above not output content values if meta attribute "name" or value "description" uppercase(name,description) or capitalized(name,description). how work around without much codes? you can seek php's strcasecmp() example if (strcasecmp($m

How to configure AOP in Spring -

How to configure AOP in Spring - i haven't used aop before in spring before, i"m trying simple illustration working application. this code used: /** * product cache aspect manages product cache. * */ @aspect public class productcacheaspect { private static logger logger = logmanager.getlogger(productcacheaspect.class.getname()); @autowired private memcachedclient memcachedclient; @afterreturning( pointcut = "execution(* com.ideafactory.mvc.products.common.services.productservice.get(..))", returning= "result") public void logafterreturning(joinpoint joinpoint, object result) { logger.debug("executed point cut"); logger.debug(result); } } and think have configured correctly: @configuration @componentscan(basepackages = {"com.ideafactory"}) @propertysource(value = {"classpath:application.properties"}) @enablescheduling **@enableaspectjautoproxy

php - Split Input for use with Bank Numbers (input split into sections) -

php - Split Input for use with Bank Numbers (input split into sections) - i not seem able find reply this, though looking @ wrong thing. have yii application able create accounts , store peoples data. 1 such piece of info persons iban number. have single text input people can type country code , 22 digits necessary. able validate , error or save accordingly. 1 thing able have split input box. in single input iban appears so: es0012345678912345678912 i split so: es00 1234 5678 91 2345678912 this makes much more user friendly , easy read. can alter way looks on view when editing have 5 input boxes in single row, 1 takes 4, next 1 4 characters, next 1 4 etc. illustration of mean: can please point me in direction of how achieved. there type of split input can use, or need create 5 separate inputs , bring together them on submission , validate here? ability split saved entry across these 5 boxes much easier. many thanks as suggestion, if utilize model, add toge

How to use predicate transpose in SWI-Prolog? -

How to use predicate transpose in SWI-Prolog? - hi guys want utilize predicate transpose(matrix0, matrix) in swi-prolog holds when matrix0 , matrix lists of lists, , “columns” of each “rows” of other. problem when added :- ensure_loaded(library(clpfd)). source file , tried utilize it, got % library(occurs) compiled occurs 0.00 sec, 14 clauses % library(apply_macros) compiled apply_macros 0.00 sec, 44 clauses % library(assoc) compiled assoc 0.00 sec, 103 clauses error: /users/benjamin/documents/prologworkspace/test.pl:27: import/1: no permission import clpfd:transpose/2 user (already imported ugraphs) % library(clpfd) compiled clpfd 0.08 sec, 1,372 clauses % test compiled 0.08 sec, 1,388 clauses true. and got false when seek this: ?- transpose([['_','_'],['_','_']], x). false. any suggestion? give thanks you. import/1: no permission import clpfd:transpose/2 user (already imported ugraphs) you have name cl

Cordova CLI on OSX -

Cordova CLI on OSX - when trying build ios version of our app on osx (10.9), getting next error. have updated, uninstalled , reinstalled cordova no success. i have looked error see if has come across before no luck. have thought @ causing issue? $ cordova build ios error: unencoded < line: 0 column: 2 char: < @ error (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/elementtree/node_modules/sax/lib/sax.js:347:8) @ strictfail (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/elementtree/node_modules/sax/lib/sax.js:364:22) @ object.write (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/elementtree/node_modules/sax/lib/sax.js:671:11) @ xmlparser.feed (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/elementtree/lib/parsers/sax.js:48:15) @ elementtree.parse (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/elementtree/lib/elemen

uiview - iOS - Why setting and displaying subviews in initWithNibName doesn't work? -

uiview - iOS - Why setting and displaying subviews in initWithNibName doesn't work? - i have simple xib file layout is: which pale greenish uiview referenced iboutlet view_content in uiviewcontroller class. did next in initwithnibname:bundle: of viewcontroller.m: self = [super initwithnibname:nibnameornil bundle:nil]; if (self) { self.view_a = [[uiview alloc] initwithframe:cgrectmake(100, 100, 100, 100)]; self.view_a.backgroundcolor = [uicolor purplecolor]; [self.view_content addsubview:self.view_a]; self.view_b = [[uiview alloc] initwithframe:cgrectmake(150, 150, 100, 100)]; self.view_b.backgroundcolor = [uicolor bluecolor]; [self.view_content addsubview:self.view_b]; self.view_c = [[uiview alloc] initwithframe:cgrectmake(200, 200, 100, 100)]; self.view_c.backgroundcolor = [uicolor greencolor]; [self.view_content addsubview:self.view_c]; } homecoming self; i expected there 3 little squares, each different colors declared

html - Floating of image float footer also -

html - Floating of image float footer also - i have bit problem floating of image. i have simple page, have header article, perex , image of article, in 1 container contains footer @ bottom. i want image on left side of container, text floating around image right side, padded image few px, under header , footer should under whole thing, in container. but when m trying float text around image, doing this. here html: index.html.twig {% extends 'natalycooksblogbundle::layout.html.twig' %} {% block content %} <article class="article"> <header> <h1> header of article </h1> </header> <img class="pure-img article-image" src="{{ asset('uploads/articles/bug2.png') }}" float="right"> <p class="pe

ios - Better collisions detection than CGRectIntersectsRect -

ios - Better collisions detection than CGRectIntersectsRect - my character represented uiimageview 30 30 points. enemy image view 240 points wide , 45 points tall. appease cgrectintersectsrect determines collision between 2 rectangular boxes. i'm looking more detail. i'm not using spritekit or cocos2d or box2d or chipmunk. there improve cgrectintersectsrect corner collision detection , collision detection left , right sides , how programme it? ios

Marker with number in highcharts -

Marker with number in highcharts - i have scatter plot of values close each other 1 marker drawn. there way indicate there re more 1 entry on place. i'd add together number items on location. you can grab datalabels.formatter , utilize loop on each series / , each point check if points has same coordinates. sum , homecoming in funcion. highcharts

embedded - How to identify, what is stalling the system in Linux? -

embedded - How to identify, what is stalling the system in Linux? - i have embedded system, when user i/o operations, scheme stalls. action after long time. scheme quite complex , has many process running. question how can identify making scheme stall - nil literally 5 minutes. after 5 minutes, see outcome. don't know stalling system. inputs on how debug issue. have run top on system. however, doesn't lead issue. see here, jup_render taking 30% of cpu, not plenty stall system. so, not sure whether top useful here or not. ~ # top top - 12:01:05 21 min, 1 user, load average: 1.49, 1.26, 0.87 tasks: 116 total, 2 running, 114 sleeping, 0 stopped, 0 zombie cpu(s): 44.4%us, 13.9%sy, 0.0%ni, 40.3%id, 0.0%wa, 0.0%hi, 1.4%si, 0.0%st mem: 822572k total, 389640k used, 432932k free, 1980k buffers swap: 0k total, 0k used, 0k free, 227324k cached pid user pr ni virt res shr s %cpu %mem time+ command 850

excel - data extraction from xls using xlrd in python -

excel - data extraction from xls using xlrd in python - i trying extract info .xls file , making list getting list [u'elem1', u'elem2', u'elem3'] , if print separately as: elem1 elem2 elem3 what u thing , how remove it? here code... from xlrd import open_workbook xls=open_workbook('name.xls') sheets in xls.sheets(): list1=[] col in range(sheets.ncols): rows in range(sheets.nrows): list1.append(sheets.cell(rows, col).value) print(list1) in list1: print(i) you can define text string,while appending info list in list1.append(str(sheets.cell(rows, col).value)) remove [u' .the code be: xlrd import open_workbook xls=open_workbook('name.xls') sheets in xls.sheets(): list1=[] col in range(sheets.ncols): rows in range(sheets.nrows): list1.append(str(sheets.cell(rows, col).value)) print(list1) in list1: print python excel list xlrd

python - Sum the digits of a strings using type(int) -

python - Sum the digits of a strings using type(int) - i have seen question when googled tried else run programme fails, help me figure out why method wrong. def sumdigits(s): """assumes s string. if s 'a2b3dc' homecoming 5""" a=0 in string: if type(i) == int: a=a+1 homecoming sumdigits('ab23sdf'); this method homecoming me zero. why? use isdigit instead. i.isdigit() when iterate string string, need check if given chararacter digit. secondly string variable undefined, should utilize s instead. python

Communication between servlets in Java -

Communication between servlets in Java - i have 2 web application running on same server. i want send objects 1 servlet in application1 servlet in application2. how can that? will session object same both app if running on same server? how can share session object across applications? what if both web applications on different server? please provide link of article address above issue since unable find one. java servlets

dot - Graphviz set edge initial direction -

dot - Graphviz set edge initial direction - when draw diagram spline=ortho graphviz draws edges go downwards , left or right: +--[ ] | | v | [ ] +->[ ] how can specify edges should depart horizontally node? +--[ ]--+ | | v v [ ] [ ] this (version 2.38) not working. compass points not implemented spline=ortho. see issue 1992 graphviz dot

c++ - JSONCPP to Visual Studio -

c++ - JSONCPP to Visual Studio - i having problem getting jsoncpp library visual studio. i have downloaded library unsure how import project , utilize in c++ code. c++ visual-studio-2013 jsoncpp

android - Should I trust the Garbage Collector after calling Bitmap.recycle()? -

android - Should I trust the Garbage Collector after calling Bitmap.recycle()? - i have code loading image opengl texture. in process, end loading 3 bitmaps, since need load original bitmap (sized appropriately display) , reorient bitmap based on exif data. i'm calling .recycle() on each bitmap, i'm noticing memory doesn't seem change. here's memory monitor shows: as can see, after loading image i'm using 60mb of memory. when rotate device drops off bit comes up. leads me think there no leak, since memory never goes above that. when click gc button in memory analyzer, memory footprint drops dramatically around 8 mb. makes sense 3 bitmaps created during process recycled, can garbage collected. can see when rotate 1 time again , activity rebuilt, memory jumps right up. here's code show why many bitmaps created , when they're recycled. void layoutimage() { ... bitmap bitmap = loadorientedconstrainedbitmapwithbackouts(...);

python - Django models.Model superclass -

python - Django models.Model superclass - i create models.model class doesn't became part of database interface other models (i want avoid repeating code). something that: class interface(models.model): = models.integerfield() b = models.textfield() class foo(interface): c = models.integerfield() class bar(interface): d = models.charfield(max_length='255') so database should have foo (with a,b,c collumns) , bar (with a,b,d) not table interface. "abstract base of operations classes" abstract base of operations classes useful when want set mutual info number of other models. write base of operations class , set abstract=true in meta class. model not used create database table. instead, when used base of operations class other models, fields added of kid class. python django

sql server - SQL datediff with negative parameter -

sql server - SQL datediff with negative parameter - i finish noob sql , trying understand why query returns "115": select datediff(yy, -3, getdate()) datediff takes 3 parameter. first interval , sec start date , 3rd end date . passing -3 start date, there can show: select cast(-3 datetime) -- results in '1899-12-29 00:00:00.000' and because 2014 - 1899 115, result. sql sql-server date

php - WordPress site search causes apache authentication required -

php - WordPress site search causes apache authentication required - when using themes search, or content tabs, prompted authentication required (not wordpress login); however, can manually go article without issues, , can utilize both search , content tabs after entered credentials. figured have misconfigured somewhere, don't know where. i've looked in .htaccess, apache .conf site, nil stood out. help appreciated. i had provide public access /wp-admin/admin-ajax.php, can done adding next apache2.conf or .htaccess file. <files admin-ajax.php> allow satisfy </files> php wordpress apache .htaccess

c# - Associative array from text -

c# - Associative array from text - how parse text formated this? data name of group: name: value name: value name: value info name of group: name: value name of group: name: value name: value it can have multiple data , each info can have multiple named groups , within every 1 of them can multiple name value pairs number of spaces can vary within whole text means before first data there can 2 spaces , before sec none @ all. after parsing able associative array can access info in way data[0][name of group][value name] or doing foreachs , on. possible powerfulness of regular expression? i think can without regular expressions. scan input line line. if line contains string "data" increment data_index (initially set -1). if line looks "text:" set variable group_name text . if line looks "text_left:text_right" set variable name text_left ,

PHP Regex won't match -

PHP Regex won't match - i'm new php development (i'm learning myself many think) , regex, have next function among others in php file: function func($data) { $posdata = preg_replace( '/([^.0-9]+)/', '', $data); // should remove periods , numbers. if ( preg_match( '/^([01][0-9]|20|[01][0-9][.][0-9]{1,2}|0[.][0-9]{1,2})\z/' , $posdata ) ) { homecoming $posdata; } else { homecoming false; } } which supposed match eg: 20 | 0.25 | 12 | 08.54 | 15.6 , should not match 0, 7.12, higher 20 or period @ end. if check on regex101.com works fine, if run on site same page no function , pre-established info works fine. when send info trough form , utilize php file this: <?php include_once'/path/to/functions.php'; $text = $_post['text']; if ( $a = func($text) !== false ) { $b = func($text); echo $b; } else { echo "failed"; } ?> it matches 20 | 01 | 12 ,

twitter hosebird client maven usage -

twitter hosebird client maven usage - hi i'm noob in want larn how utilize hosebird client, downloaded readme don't understand how utilize that. installed eclipse java ee , maven in pc readme file in hbc don't see how connect eclipse. can help me list of thing have do? readme, have never used maven before. thanks class="snippet-code-html lang-html prettyprint-override"> ## getting started hosebird client broken downwards 2 modules: hbc-core , hbc-twitter4j. hbc-core module uses message queue, consumer can poll raw string messages, while hbc-twitter4j module uses [twitter4j](http://twitter4j.org) listeners , info model on top of message queue provide parsing layer. latest hbc artifacts published maven central. bringing hbc project should simple adding next maven pom.xml file: ```xml <dependencies> <dependency> <groupid>com.twitter</groupid> <artifactid>hbc-core</artifactid> &

Modifying string on java -

Modifying string on java - i must turn string type modified xpathes real xpathes java; for example; this kind of xpathes _html_1__body_1__form_1__input_3_ should turn /html[1]/body[1]/form[1]/input[3] i have no idea, please help me like lateralus said, strings immutable, can't alter these. however, having said that, can utilize replaceall homecoming modified version of string, illustration in case: string input = "_html_1__body_1__form_1__input_3_"; string output = input.replaceall("_(\\d+)_", "[$1]").replaceall("_", "/"); // output = /html[1]/body[1]/form[1]/input[3] edit as explanation of regex used in case: this method uses 2 separate regular expressions homecoming modified string. firstly, " _(\\d+)_ ", looks numbers surrounded 2 underscore characters _ , \\d regex short hand digit. surrounding brackets (...) capture number, can reference in replacement string. whe

c# - Lack of Memory for picturebox -

c# - Lack of Memory for picturebox - i create mini games work image box switch image. using switch. using max 30 images app. definitions: class unikatnihodnoty { public static list<button> buttonlist = new list<button>(); public static list<string> uhodnuteobrazky = new list<string>(); public static bool security = false; public static string pocetpokusu; public static string casnaobrazky; public static string casnatah; public static string bodykvitestvi; } this script loading image files: class nactenisouboru { string obrazky; string zadnikarta; string zadnistrana; public string hledanyobrazek; public list<string> obrazkylist = new list<string>(); public list<string> obrazkylistcontrol = new list<string>(); public nactenisouboru() { // cesty k souborům var currentdirectory = directory.getcurrentdirectory(); obrazky = currentdirectory + @