Posts

Showing posts from July, 2015

java - Specifying jaxb version to wsgen -

i'm suffering same error this question , can't use answer since i'm not using maven, i'm stuck on how specify version of jaxb use wsgen. i'm downloaded 2.2.7 jars , added them classpath, generated files still they've been generated using 2.2.4b1, presume included in jdk. anybody know how specify wsgen jaxb version want use?

c# - SpreadsheetGear throwing IndexOutOfRangeException inside constructor -

we use spreadsheetgear in 1 of our applications generating excel workbooks. i'm trying reuse of functionality in asp.net web application, far i'm stumped. i started off referencing our existing library in web application , making appropriate call ended receiving indexoutofrangeexception . i thought might problem in our code, reduced problem down webforms page calls following (which is, incidentally, first line of code in spreadsheetgear web forms example): spreadsheetgear.iworkbook workbook = spreadsheetgear.factory.getworkbook(); but i'm still getting exact same problem. i've no idea array out of bounds because it's coming inside obfuscated part of spreadsheetgear. stack trace: [indexoutofrangeexception: index outside bounds of array.] ᦿ..ctor(cultureinfo a_0) +2235 ᦿ..cctor() +27994 has else seen problem before? i dug bit further, , problem turned out setting in application_beginrequest . we had code doing work figure out locale ...

php - Storing array in multiple mysql columns -

iam struggling storing data dynamic form - rows can added/removed during filled. output form array: array ( [service] => array ( [0] => 1 [1] => 2 [2] => 3 ) [desc] => array ( [0] => complete service - description [1] => half service - description [2] => break service - description ) [price] => array ( [0] => 1000 [1] => 500 [2] => 800 ) [income_sum] => 2300 [odeslat] => odeslat ) table definition: column type comment id int(11) auto increment order_id int(11) null servis_id tinyint(4) null price int(11) null desc text null form definition: <form action="test.php" method="get" id="form"> <div class='container'> <select name='service[]'> <option value=""></option> <option value="1">complete service</option> <option value="2">half service</option> <option value="3"...

path - Regex check if a file has any extension -

i looking regex test if file has extension. define as: file has extension if there no slashes present after last "." . slashes backslashes. i started regex .*\..*[^\\] which translates to .* char, number of repetitions \. literal . .* char, number of repetitions [^\\] char not in class of [single slash] this test data (excluding ##, comments) \path\foo.txt ## want capture line \pa.th\foo ## regex captures line <-- problem here \path\foo ## line correctly filtered out what regex this? your solution correct. use this: ^.*\.[^\\]+$ sample @ rubular.

security - Is it acceptable to use the same CSRF Token for a whole session? -

is acceptable use same csrf token whole session? don't see reason change csrf token sessions extend no more couple hours. is there reason use single use tokens? in experience these cause bad user experience. i suggest reading owasp's csrf cheat sheet it valid option use single token entire session, beware site may contain vulnerabilities can circumvent csrf defenses. such xss or lack of encryption when sending/receiving sensitive pages. i use session tokens, added bit more. divided possible user actions tiers, highest tier contains sensitive actions , lowest tier common non-sensitive actions. highest tiers require users authenticate once more, while middle tiers need session crsf token. hope helps :)

How to troubleshoot CRM 2011 required field issues. -

i have been setting fields in standard forms required, simple stuff, point , click. part work fine. every once , while allow user fill in form (say case) , not fill in 1 or of required fields. happening same users know not rights issue. have nothing setup programmably. i thinking has them working crm 2011 (its on-prem version , have ie 11 , servers running rollup 15) because seem have restart ie 11 every once , while throughout day well. else getting or has come across issue? thanks in advance. as know, ie11 isn't supported in crm 2011. use ie9 rollup 15 , ie10 in compatibility mode issues. http://support.microsoft.com/kb/2935509 http://support.microsoft.com/kb/2784954

How do I change the publicly accessible option for Amazon RDS? -

when create new amazon rds instance, offered choose true/false "publicly accessible" option, there way change existing instance? edit: yes, possible change "publicly accessible" property "no" "yes". (and vice-versa) hooray! old answer left here historic purposes: no. it nice though, eh? workaround best option following: create snapshot of instance. launch new instance snapshot using publicly accessible option. evidence: john g's diplomacy in this post prevents him writing "no" did, answer "you can create snapshot of current rds database , launch publicly accessible option." makes pretty clear he's offering workaround because direct solution not available.

Admob on android Why do I get "AFMA_buildAdURL is not defined"? -

see last comment solution. i trying use admob android application. have tried pure code instantiation , xml , code instantiation. when try load ad, following: 10:06:52.575: i/ads(4827): use adrequest.builder.addtestdevice("hashedidformyphone") test ads on device. 10:06:52.585: i/ads(4827): starting ad request. 10:06:54.047: e/ads(1596): js: uncaught referenceerror: afma_buildadurl not defined (http://googleads.g.doubleclick.net/:1) 10:07:53.130: w/ads(4827): timed out waiting ad response. 10:07:53.130: i/ads(4827): scheduling ad refresh 60000 milliseconds now. 10:07:53.130: w/ads(4827): failed load ad: 2 note uncaught ref error happens less 2 seconds after trying load ad. here xml layout: <framelayout android:id="@+id/adlayout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center|top" android:layout_margintop="@dimen/search_layout_top_height...

javascript - How to get current date from kendoDatePicker not in the 'change' handler -

those approaches don't work: dateselectedfrom = $("#datepickerfrom").value - undefined dateselectedfrom = $("#datepickerfrom").value() - object has no method value() i know can use this.value() , works fine, method ondateselectedfromcalendar used different datetimepicker control (i have several on page) <input id="datepickerfrom" value="10/10/2011" /> $("#datepickerfrom").kendodatepicker({ change: ondateselectedfromcalendar }); function ondateselectedfromcalendar(e) { dateselectedfrom = $("#datepickerfrom").value; } documentation doesn't specify other options http://docs.telerik.com/kendo-ui/api/web/datepicker with kendo object have use data like: var d = $("#datepickerfrom").data("kendodatetimepicker").value(); see documentation here .

java - 2d array inside another array? -

is there anyway make array hold 2d array? i want somehow hold value of matrixfinal based on user enters can later use it. think i'd able if can hold these values in array these 2d arrays... how go doing this? public class driver { public static void main(string[] args) { int i, j, k, l ; int sum = 0 ; int matrixacolumnsize ; int matrixarowsize ; int raisebypower ; // querying user matrixarowsize = tools.queryforint("enter row size of matrix a: ") ; matrixacolumnsize = tools.queryforint("enter column size of matrix a: ") ; tools.verifymatrixsize(matrixacolumnsize, matrixarowsize) ; // verification of matrix size 10x10 max tools.verifymultiplication(matrixarowsize, matrixacolumnsize) ; // verification of matrix size raisebypower = tools.queryforint("by power raise matrix? ") ; tools.verifymatrixpower(raisebypower) ; // verification of power. ^6 max //maki...

java - 2D Array to Rectangles -

is there way parse 2 dimensional array rectangle object (x,y, width, height)?. need array of possible rectangles... {0,0,0,0,0} {0,0,0,0,0} {0,1,1,0,0} {0,1,1,0,0} {0,0,0,0,0} this give 4 rectangles (we looking @ 0): 0,0,5,2 0,0,1,5 3,0,2,5 0,5,5,1 i have tried this, gives area of biggest rectangle... public static int[] findmaxrectanglearea(int[][] a, int m, int n) { // m=rows & n=cols according question int corx =0, cory = 0; int[] single = new int[n]; int largex = 0, largest = 0; (int = 0; < m; i++) { single = new int[n]; // 1 d array used check line line & // it's size n (int k = i; k < m; k++) { // used run until // contains element int = 0; int y = k - + 1; // used row , col of comming // array int shrt = 0, ii = 0, small = 0; int mix = 0; int findx = ...

html - perfect left / right padding for columns -

if have number of block items in list, wondering if there way get 0 margin on left, 0 margin on right, and margins between items in middle right on items in list know how margin:0px 5px 5px 0px; this way there no margin on left, matches left of container, there 5px space on far right column... need margin-right 5px space in between items. any suggestions? div.container{ width:calc(100% - 100px); margin: 0 auto; height:100%; display:block; background:black; } div div{ height:200px; width:160px; display:inline-block; background:grey; margin:0px 5px 5px 0px; } ref: http://jsfiddle.net/ly2m3/1/ again items able against far left , right side of container have margins separate items. yes, add text-align: justify div.container element.

web - VLC embeded in HTML: Could not open location; you might not have permission to open the file -

i have problem playing videos through vlc web plugin embedded in html. getting error: could not open location; might not have permission open no video getting played. platform : ubuntu 12.04 lts, 32 bit. i use sudo chmod 777 foldername change folder's permission,but doesn't work either.

c# - failure to load file with accented characters using XElement -

i try following code didn't work correctly , idea please . string file = @"c:\program.xml"; xelement root = xelement.parse(file.readalltext(file).replace("\"", "'")); an example xml file : <?xml version="1.0" encoding="utf-8"?> <session xmlns="http://winscp.net/schema/session/1.0" name="test" start="2014-04-04t15:54:09.728z"> <upload> <filename value="d:\ftp\test2.txt" /> <destination value="/in/test2.txt" /> <result success="true" /> </upload> <touch> <filename value="/in/test2.txt" /> <modification value="2014-03-27t12:45:20.000z" /> <result success="false" /> </touch> </session> i need use xelement further treatment i think little bit confused xdocument xdoc=xdocument.load(filepath); that's nee...

python - Parsing links and strings from unstructured HTML data -

i have html string looks this: <p> type: <a href="wee.html">tough</a><br /> main type: <a href='abnormal.html'>abnormal</a> <br /> wheel: <a href='none.html'>none</a>,<a href='squared.html'>squared</a>,<a href='triangle.html'>triangled</a> <br /> movement type: <a href=forward.html">forward</a><br /> level: <a href="beginner.html">beginner</a><br /> sport: <a href="no.html">no</a><br/>force: <a href="pull.html">pull</a><br/> <span style="float:left;">your rating:&nbsp;...

PHP : Function - Return 2 variables (Boolean + $variable) -

issue resolved : here solution : function testcoreq() { $coreqtest = makecoreq(); if(empty($coreqtest)) { return array(true); break; } else { foreach ($coreqtest $ctest) { if($ctest['value'] == "true") { return array(true); break; } else { return array(false,$ctest['coreqid']); } } } } if(testcoreq()[0]) { //do } else { return testcoreq()[1] } i'm doing school project , hit kind of bump. i created function , want either return "true" (boolean) or "false" (boolean) + variable. i searched net quite bit wan't able find simple way . is there way this ? //thanks the function working when returning variable - assuming function returni...

Why we use interface as main concept in Java? -

this question has answer here: why use interface? standardization? 13 answers why implementing interfaces ? 8 answers can please provide me best use of interface, because further complete reading have not found proves why use interface. i have read interface not found solution why interface used. please explain me examples. the principle of interface simple: contract . an interface documented; methods of interface 1 thing , well, , implementations ensure contract fulfilled. for instance, let take simple interface, iterator . have collections.emptyiterator() fulfills interface. whatever class x, can declare: final iterator<x> iterator = collections.emptyiterator(); you guaranteed particular implementation correctly implement next() , .hasnext() , .remo...

mysql - PHPMYADMIN SQL Not Like Including Multiple Values -

i'm attempting make search query on phpmyadmin database users' emails not contain multiple not values. want search users not have accounts @ educational institutions. i.e. search users emails not include schoola.edu schoolb.edu or schoolc.edu. i believe it's similar not %schoola.edu%, %schoolb.edu%, %schoolc.edu% or like. appreciated. again! what want not %schoola.edu% , not %schoolb.edu% , not %schoolc.edu%

bash - Printing numbers from one list, not found in another -

my first list contains: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 .... list x contains: 5 10 15 20 ... i want print numbers in first list not found in list x, i.e: 1 2 3 4 6 7 8 9 11 12 13 14 16 17 18 19 ..... #!/bin/bash in $(seq 0 5 100) echo $i done i want print number not contain #for in $(seq 0 5 100) it's not clear if have actual lists, or tying generate list not contain multiples of 5. if it's latter, #!/bin/bash in {0..100}; (( $i % 5 != 0 )) && echo "$i" done where % equivalent mod .

c# - Ninject field inject not work in class with constructor -

in c# mvc project, used ninject ioc pattern, when using constructor injection works fine without problem when use field injection, null reference exception occurred _ordernotification. public class shopmanager { [inject] private iordernotification _ordernotification; public shopmanager(string shopname) { //do somethings } public int getnotifycount() { return _ordernotification.count(); } } also registered services in ninjectwebcommon, kernel.bind<iordernotification>().to<ordernotification>(); ninject version 3.0 try this: public iordernotification _ordernotification; public iordernotification ordernotification { { return _ordernotification ?? (_ordernotification = dependencyresolver.current.getservice<iordernotification>()); } set { _ordernotification = value; } } also can use without con...

Javascript function, if else, isNaN -

i need figure out i'm doing wrong, i've tried make function you're supposed enter 2 numbers in 2 different boxes , loop until put in valid number! (sorry code , english) var x = parseint(prompt("please enter number!")); var y = parseint(prompt("please enter number!")); function add(x, y) { var z = x + y; var = false; { if (isnan(x)) { alert("invalid entry. please enter number!") } else if (isnan(y)) { alert("invalid entry. please enter number!") } else { alert(x + " + " + y + " = "); = true; } while (i == false); } } add(x, y); there couple of problems code: your while misplaced. the parameters x , y don't make sense, because user needs input them. the prompts asking numbers outside of loop. here fixed code: function add() { { var x = parseint(prompt("please ent...

java - My array list to .txt file program is giving me several errors -

i have inventory application sets list of strings based on user input. supposed export strings .txt file. have never used filewriter before, , stuck. any appreciated. here relevant code: the 3 lines near end have 'writer.' in them giving me unreported exception ioexception; must caught or declared thrown . import java.util.*; import java.io.filewriter; public class mventory extends javax.swing.jframe { /** * creates new form mventory */ public mventory() { initcomponents(); } public class productinfo { string name; string des; string id; string num; public productinfo(string name, string des, string id, string num) { this.name = name; this.des = des; this.id = id; this.num = num; } } public static void inventory() { } //creat array arraylist<string> inventory = new arraylist<string>(); private...

How to replace certain items in a char array with an integer in C++? -

below example code not working way want. #include <iostream> using namespace std; int main() { char testarray[] = "1 test"; int numreplace = 2; testarray[0] = (int)numreplace; cout<< testarray<<endl; //output "? test" wanted 2, not '?' there //i trying different things , hoping (int) helped testarray[0] = '2'; cout<<testarray<<endl;//"2 test" want, hardcoded in //is there way based on variable? return 0; } in string characters , integers, how go replacing numbers? , when implementing this, different between doing in c , c++? if numreplace in range [0,9] can :- testarray[0] = numreplace + '0'; if numreplace outside [0,9] need a) convert numreplace string equivalent b) code function replace part of string evaluated in (a) ref: best way replace part of string in c , other relevant post on so also, since c++ code, might c...

How do you script ssh commands then background the session? -

i trying create single script starts ssh session, , execute commands on remote machine, backgrounds session. far i've been playing -f or -f -n options, don't know how bring session foreground verify commands executed correctly. or there way single script can start ssh session , continue inputting commands newly opened session? , background session? if none of work thinking way of doing script starts ssh session, upload , execute commands via script. any ideas on how this. it not clear trying do. i'll try helpful. a series of commands can issued sequentially in single ssh session using single quoted string commands separated semicolons. $ ssh user@remotehost 'ls; echo foo > bar; cat bar; rm bar' it return result of last command run. i'm confused why want background session. if need can start long running process on remote machine nohup , close session. if need series of commands run each depend on result of last one, don't ne...

mysql - php app to verify login -

trying understand how process form in php logs in. seems clumsy, there better way. let's user login userid , password. if enter information on form, jump next page: <?php if (isset($_post["id"])) { $con=mysqli_connect("localhost","user","pw","db"); $codefile = $_post["filename"]; $id = $_post["id"]; $fname = $_post["fname"]; $lname = $_post["lname"]; $res = mysqli_query($con, "select count(*) users id='$id' , fname='$fname' , lname='$lname'"); $row = mysqli_fetch_array($res); $count = $row[1]; if ($count == 1) { header("submit.php"); die(); } $res = $con->query('insert log values ($id, now(), $codefile)'); } ?> the above code should theoretically jump submit.php if 1 row comes because there matching user. not seem work. how request first column back? has no name because not nam...

Working with indexes in neo4j and py2neo -

i have started working py2neo , neo4j. i confused how go using indices in database. i have created create_user function: g = neo4j.graphdatabaseservice() users_index = g.get_or_create_index(neo4j.node, "users") def create_user(name, username, **kwargs): batch = neo4j.writebatch(g) user = batch.create(node({"name" : name, "username" : username})) key, value in kwargs.iteritems(): batch.set_property(user, key, value) batch.add_labels(user, "user") batch.get_or_add_to_index(neo4j.node, users_index, "username", username, user) results = batch.submit() print "created: " + username now obtain users username: def lookup_user(username): print node(users_index.get("username", username)[0]) i saw schema class , noticed can create index on "user" label, couldn't figure out how obtain index , add entities it. i want efficient possible, adding index on ...

python - Django cannot import LOCAL settings -

edit: playing around django 1.7... , python 3 i can't seem import local_settings.py settings.py file when using manage.py. if execute settings.py file directly, local_settings.py file imported fine, without errors. however, when run manage.py, complains not find local_settings.py module. settings.py , local_settings.py in same folder... any ideas? traceback (most recent call last): file "/home/cg/webdev/riv_com/lib/python3.4/site-packages/django/conf/__init__.py", line 94, in __init__ mod = importlib.import_module(self.settings_module) file "/usr/lib/python3.4/importlib/__init__.py", line 104, in import_module return _bootstrap._gcd_import(name[level:], package, level) file "<frozen importlib._bootstrap>", line 2231, in _gcd_import file "<frozen importlib._bootstrap>", line 2214, in _find_and_load file "<frozen importlib._bootstrap>", line 2203, in _find_and_load_unlocked file ...

android - In Xamarin the OnOptionsItemSelected is not called -

i read different articles here onoptionsitemselected not been called in android, because have same problem in xamarin.android. have menu in main activity, haven't used fragments @ all. menu read xml file: public override bool oncreateoptionsmenu(imenu menu) { menuinflater.inflate(resource.menu.main, menu); return base.oncreateoptionsmenu(menu); } and tried catch itemselected events using following code: public virtual bool onoptionsitemselected (imenuitem item) { string test; console.writeline ("test"); return true; } but doesn't work , event not called. tried other events like: public virtual bool onmenuitemselected (int featureid, imenuitem item) { string test; console.writeline ("test"); return true; } public void ongroupitemclick( imenuitem item) { // 1 of group items (using onclick attribute) clicked // ...

Splitting k - combinations into 2 in a specific manner in Matlab -

consider set, s = {1,2,3,4,5,6,7} i trying come function takes s input , gives me possible arrays: [ 1 ~ 2 ; 1 ~ 3 ; 1 ~ 4 ; 1 ~ 5 ; . . . ; 6 ~ 7 ] [ 1 2 ~ 3 ; 1 2 ~ 4 ; ...; 2 3 ~ 1 ; 2 3 ~ 4....; 5 6 ~ 7] . . . [ 2 3 4 5 6 7 ~ 1 ; 1 3 4 5 6 7 ~ 2 ; ... ; 1 2 3 4 5 6 ~ 7 ] here notice '~' sort of delimiter placed in between elements of k - combination such set appearing before delimiter unique in each array. for example, want both 7-combinations [ 2 3 4 5 6 7 ~ 1 ] , [ 1 2 3 4 5 6 ~ 7 ]. but want 1 of [ 1 2 3 4 5 6 ~ 7 ] , [ 1 3 4 5 6 2 ~ 7 ]. my code : clear k = 1:7 set = nchoosek(1:7,k); = 1:length(set) = setdiff(1:7,set(i,:)); p = nchoosek( , 2 ); % trialing a~b b has 2elements l = length( p ); s = repmat( set ( i,: ) , l,1); j = 1:l s1(j,:) = setdiff( s(j,:) , p(j,:) ); w(j,:) = [ s1(j,:) , 0 , p(j,:) ]; end ...

python - Django API caching, how to check it's setup correctly -

whats best way check if have setup caching correctly tastypie? have followed documentation on this: in settings added this: caches = { 'default': { 'backend': 'django.core.cache.backends.locmem.locmemcache', 'timeout': 60 }, 'resources': { 'backend': 'django.core.cache.backends.locmem.locmemcache', 'timeout': 60 } } in resource added: class incentiveresource(modelresource): class meta: queryset = incentive.objects.all() resource_name = 'incentive' allowed_methods = ['get'] always_return_data = true cache = simplecache(cache_name='resources', timeout=10) just write , run simple test check resources cache working: from django.test import testcase tastypie.cache import simplecache class cachetestcase(testcase): cache_name = 'resources' def test_cache(self): si...

c# - How to merger/combine data from two sql databases that have a same structure? -

Image
i writting program in c#, use sql server database. my program include blank database (sample database) allow users can create new database. for example: user 1 use program create new database (db1) on computer, import/enter data db1 user 2 use program create new database (db2) on computer, import/enter data db2 now, have both 2 database (db1, db2). know how merge/combine 2 databases have unique database contain users' data ? can me ? please see demo screenshot if use of procedures applicable application might use merge statement combine data. learn more merging follow http://msdn.microsoft.com/en-us/library/bb510625.aspx topic added output usage sample, shows how inserted row's pk insert in other related table. create table #teachers( [id] [int] identity(1,1) not null, [name] [nvarchar](15) not null ) create table #pupils( [id] [int] identity(1,1) not null, [name] [nvarchar](15) not null ) create table #createdteachers ([id] [i...

How to Copy/Paste large number of lines of code in a terminal -

i working on mysql source. need copy file 12,000 lines of code @ time , paste terminal/text document. how can perform task? use cat command allows select text , paste in terminal u require

node.js - Error install grunt-cli using npm -

i getting following error when installing grunt using npm nodejs. can tell trying have problems , how can fix it. have firewall there way download grunt , install? newbie , getting feet wet. your environment has been set using node.js 0.10.26 (x64) , npm. c:\users\testuser>npm install -g grunt-cli npm http https://registry.npmjs.org/grunt-cli npm http https://registry.npmjs.org/grunt-cli npm http https://registry.npmjs.org/grunt-cli npm err! error: 12812:error:140770fc:ssl routines:ssl23_get_server_hello:unknown protocol:openssl\ssl\s23_clnt.c:766: npm err! npm err! @ slabbuffer.use (tls.js:232:18) npm err! @ cleartextstream.read [as _read] (tls.js:452:29) npm err! @ cleartextstream.readable.read (_stream_readable.js:320:10) npm err! @ encryptedstream.write [as _write] (tls.js:366:25) npm err! @ dowrite (_stream_writable.js:226:10) npm err! @ writeorbuffer (_stream_writable.js:216:5) npm err! @ encryptedstream.writable.write (_stream_writable.js...

windows - Find Number of CPUs and Cores per CPU using Command Prompt -

i trying retrieve number of cpus , cores per cpu using command prompt. have executed following command: wmic cpu numberofcores, numberoflogicalprocessors/format:list i error: wmic' not recognized internal or external command, operable program or batch file i executing on windows server 2008 r2 machine. believe 'wmic' command compatible on windows. the directory running command promt 'c:\windows> any advice please? based upon comments - path statement has been changed/is incorrect or path variable being incorrectly used purpose.

CakePHP : when I change controller Session is death -

var $name = 'users'; var $components = array('auth', 'acl'); function beforefilter(){ //parent::beforefilter(); $this->auth->usermodel = 'user'; $this->auth->allow('register','login','step2','takeid'); } function login(){ if(!empty($this->data)){ if($this->auth->login()){ $this->session->setflash(__('zalogowany!')); $this->redirect('/'); } else { $this->user->invalidate('password', 'haslo lub login niepoprawny.!'); } } } function logout(){ $this->auth->logout(); $this->redirect('/'); } and f.e. when create: class userregisterscontroller extends appcontroller { var $name = 'userregisters'; var $components = array('auth', 'acl'); public function beforefilter() { $this->auth->usermodel ...

How to solve a duplicate div issue while using ajax and pushstate in Wordpress? -

i have isue implementing ajax in wordpress site. found function on http://www.franckmaurin.com/how-to-use-html5-history-with-wordpress-jquery/ and tried implement in wordpress theme. changed #main source code .container_right, adjust function use in theme. succeeded, when click on link in menu .container_right fades out, fades in, stated in function, being duplicated. can check on www.trzywu.pl/trzywu when clicking through menu links. ps. breaks existing jquery plugins on site. nevermind, found own solution. wrapped .container_right .container_right_wrapper , changed .container_right in function .container_right_wrapper, added css , seem working.

osx - cannot use GLSL 330 on mac mavericks -

i'm trying learn opengl , material using #version 330 in shaders. can compile successfully, when try run it, complains version 330 not supported. in source code, use free glut , opengl framework in xcode. if include these 2 lines of code glutinitcontextversion(3,1); glutinitcontextflags(glut_core_profile); it cannot compiled. my mac macbook pro mid 2012. should support opengl4.1 according apply. so how can compile version 330 shaders? os x requires request 3.2 core profile in order receive 3.3 or later context. because 3.2 removed functionally deprecated in 3.0. so if want use #version 330 shader code should this: glutinitcontextversion(3,2); glutinitcontextflags(glut_core_profile); edit apparently x11 doesn't support opengl higher 2.1 on os x. such, suggest switch glfw .

java - How to decode qr code from SD card -

i want decode qr code image on sd card, , don't want use external scanner. use zxing library. have code @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); textview txt = (textview)findviewbyid(r.id.textview1); imageview img=(imageview)findviewbyid(r.id.imageview1); img.setimageresource(r.drawable.qr); bitmap bt = bitmapfactory.decodefile(environment.getexternalstoragedirectory().getabsolutepath()+"/cameraapplicationse/qr.png"); img.setimagebitmap(bt); int [] pix = new int[bt.getwidth() * bt.getheight()]; luminancesource qr=new rgbluminancesource(bt.getwidth(),bt.getheight(),pix); binarybitmap bitmap = new binarybitmap(new hybridbinarizer(qr)); reader reader = new multiformatreader(); result result; try { result = reader.decode(bitmap); txt.settext(result.gettext()); } catch (notfoundexc...

Avoiding CSS classes on each html table cells? -

i have html table column cells' text must left-aligned , centered other columns. how can avoid setting css classes on each cell? can 1 simplify it? i have created example on jsfiddle . here html: <table id="mytbl"> <colgroup> <col class="col-1"> <col class="col-2"> <col class="col-3"> </colgroup> <tr> <td class="makeitleft">&nbsp</td><td class="makeitcenter">aaa</td><td class="makeitcenter">bbb</td> </tr> <tr> <td class="makeitleft">ddd</td><td class="makeitcenter">4</td><td class="makeitcenter">7</td> </tr> <tr> <td class="makeitleft">eee</td><td class="makeitcenter">2</td><td class="makeitcenter">6...

Java Generics - An Issue with Type Erasure? -

i have generic class, codominantpopulation , subclass of generic class, sexualpopulation , subclass of generic class ( population ). aforementioned classes defined follows: public class codominantpopulation<o extends codominantorganism> extends sexualpopulation<o> { public codominantpopulation(list<o> organisms) { super(organisms); } ... } public class sexualpopulation<o extends sexualorganism> extends population<o> { public sexualpopulation(list<o> organisms){ super(organisms); } ... } the codominiantorganism above subclass of sexualorganism , subclass (as may expected) of organism . within codominantpopulation , call function available codominantorganisms , called follows: // in codominantpopulation (o organism : population){ // organism must codominantorganism codominantgenotype.dominance dominance = organism.gettraitdominance(trait); ... } nonetheless, runtime throws: exception in t...

javascript - How can I set an if the query string is does come up as something other than -

how can make javascript if function if query string show other undefined. here code: var getquerystring = window.location.href.split("?")[1]; alert(getquerystring); basically wanted if function in javascript. here code: if (getquerystring = 1){ //add code } how can set javascript function? the bellow code should work you var getquerystring = window.location.href.split("?")[1]; if (typeof getquerystring !== 'undefined') { //your code goes here } else [ alert("query string not set"); }

tfs2012 - TFS Board Configuration Issue -

i trying configure tfs board new team project , able create work items, states, fields, etc. however, getting when trying configure tfs features. here questions: where can find "typefields/typefield[type='applicationtype'"? should go ahead , destroy work items , run feature enablement rid of tf400612? error/warning log: [warning] tf400612: existing work item type 'code review request' reused. if feature 'code review' not behaving correctly, can destroy existing work item type , rerun feature enablement. [warning] tf400612: existing work item type 'code review response' reused. if feature 'code review' not behaving correctly, can destroy existing work item type , rerun feature enablement. [warning] tf400612: existing work item type 'feedback request' reused. if feature 'feedback' not behaving correctly, can destroy existing work item type , rerun feature enablement. [warning] tf400612: existing work i...

jquery - Javascript on load event -

hey guys i'm new , i'm having problem meta tag. i'm trying create mobile website iphone interface. the problem though viewport meta tag not function on site. i decided use javascript code works gesture activated meaning script not function until user zooms in bit on screen. code's below, see if can help. thanks. <script type="text/javascript"> (function(doc) { var addevent = 'addeventlistener', type = 'gesturestart', qsa = 'queryselectorall', scales = [1, 1], meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : []; function fix() { meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1]; doc.removeeventlistener(type, fix, true); } if ((meta = meta[meta.length - 1]) && addevent in doc) { fix(); scales = [.25, 1.6]; doc[addevent](type, fix, true); ...

node.js - Nodejs asynchronus callbacks and recursion -

i this function scan(apath){ var files = fs.readdirsync(apath); for(var i=0; i<files.length;i++){ var stats = fs.statsync(path.join(apath,files[i])) if(stats.isdirectory()){ results.push(path.join(apath, files[i])) scan(path.join(apath,files[i])) } if(stats.isfile()){ results.push(path.join(apath,files[i])) } } } but asynchronously. trying asynchronous functions led me nightmare this. function scan(apath){ fs.readdir(apath, function(err, files)){ var counter = files.length; files.foreach(function(file){ var newpath = path.join(apath, file) fs.stat(newpath, function(err, stat){ if(err) return callback(err) if(stat.isfile()) results.push(newpath) if(stat.isdirectory()){ results.push(newpath) scan(newpath) } ...

svg - What is the best way in Android to have a scalable, complicated, colorizable shape? -

i want have, say, outline of dog in app maintains aspect ratio grows depending on available screen space. want able color fill on fly depending on user input. best way this? it's svg want android doesn't support that. stuck making custom view or doing manually in canvas? there way? i come wpf , in world can specify path in xaml exported blend automatically scales fit. there similar can generate outline somewhere else , import android drawable or custom view? basically, i'd avoid having draw complicated shape arc arc. the webview widget supports svg - @ least android 3.0 onwards. alternatively, use 1 of svg rendering libraries more lightweight solution. various derivatives , forks of svg-android support swapping colours @ runtime.

Debugging a C++ program in Intellij IDEA -

i have been run c/c++ program in intellij idea. how debug it? operation system ubuntu 12.04 , intellij idea version 13.0.3. path of gdb set /usr/bin/gdb. settings in run/debug configurations set own path. the problem occurs when start debugging, nothing happens in ide. how fix it?

ios - NSTimer is not calling in background method -

i got stuck in problem. i'm trying run timer in method in background resulting timer not initiating. got know timer can't initialized in background there way this? you can perform operation on main thread. [self performselectoronmainthread:@selector(inittimer) withobject:nil waituntildone:no]; and then - (void)inittimer { // init timer here. }

Display ssl-certificate details in WebControl inside Windows Phone app -

is there way retrieve , possibly validate certificate used on web page displayed in webcontrol in windows phone app? inside webcontrol display web page on ssl (https), has trusted verisign certificate. want give user option display detailed information certificate displaying ev-ssl certificate - when display organization name. i want give user feeling of trust through certificate information, issuer, organization, certificate used - pretty same way google chrome on ios does.

regex - Regular expression for URL Validator -

i have issue regular expression. need validate following url http://50.244.41.23/ http://myserver/ i have used following expressions regex urlrx = new regex(@"(http|https)://([0-9]*)", regexoptions.ignorecase); regex urlrx = new regex(@"(http|https)://(\b(?:\d{1,3}\.){3}\d{1,3}\b)", regexoptions.ignorecase); both working extent, doesn't serve exact purpose. gives success following strings, want expression fail such strings.. http://50.244.41.23\ http://256.244.41.23/ http://256.244.41.23.123/ can create apt regex validation above url. thanks sebastian here example regexes matching ipv4 addresses; "accurate" versions match valid addresses: http://answers.oreilly.com/topic/318-how-to-match-ipv4-addresses-with-regular-expressions/ by adding little more, should able match urls in form you're looking for. should match first (valid) ip address in question, not last (invalid) 3: ^https?://(?:(?:25[0-5]|2[0-4][0-9]|[01]?...

c# - Error converting value "System.Collections.Generic.List`1[]" to type 'WebApiTestDefinition.obJson'. Path '', line 1, position 63 -

i tried deserialize json data showing error this. public actionresult test(login log) { string sstudname = "ram"; httpclient client = new httpclient(); client.baseaddress = new uri(studentapi); client.defaultrequestheaders.accept.add(new mediatypewithqualityheadervalue("application/json")); // depends on whether want json or xml var loginresp = client.postasjsonasync(studentapi, log).result; if (loginresp.issuccessstatuscode) { //if (loginresp == null) //{ var msg = loginresp.content.readasstringasync(); objson res = jsonconvert.deserializeobject<objson>(loginresp.content.readasstringasync().result); return json(log, jsonrequestbehavior.allowget); //} //return redirect("/admission/registration"); } else { } ...

javascript - Operator assigning with a pre-increment -

for looping variables (usually array indexes) lot of pre-incrementing , modulus assigning in loop. in other languages like ++_index %= length; (broken version on multiple lines) _index++; _index = _index % length; this of course increases _index 1 , assigns modulus itself. but have problems doing in javascript horrible referenceerror: invalid left-hand side in assignment . i suspect doing trying assign modulus of variable called "++_index" of course, there none invalid. i tried using parentheses have read has _index correctly still seemed bust. (++_index) %= length; i have resorted using broken down version of ++_index; _index %= length; but cannot find documentation on issue @ hand. google-fu bringing people using = within if statements. could far superior google-fu direct me documentation can explain in more depth. said, suspect trying assignment ++_index , rather evaluate it, increment , pass reference variable next stage of assigning modulu...

c++ - Getting: error C2668: 'sqrt' : ambiguous call to overloaded function -

this question has answer here: c++ compiler error: ambiguous call overloaded function 4 answers trying build source code below example given in textbook. i'm using visual studio 2008. the compiler doesn't seem know sieve: 1>------ rebuild started: project: fig21.40, configuration: debug win32 ------ 1>deleting intermediate , output files project 'fig21.40', configuration 'debug|win32' 1>compiling... 1>fig21_40.cpp 1>c:\users\ocuk\documents\c++\chapter 21\fig21.40\fig21.40\fig21_40.cpp(27) : error c2668: 'sqrt' : ambiguous call overloaded function 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(581): 'long double sqrt(long double)' 1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(533): or 'float sqrt(float)' 1> c:...

transform html to pdf with itext and XMLWorker => exception runtime access denied -

i'm bored because try transform html text pdf xhtmlworker , it's failed ! this code : file tempdocpdf; com.itextpdf.text.document docitext; // crée un pdf vide docitext = new com.itextpdf.text.document(pagesize.a4); // crée le fichier en mémoire tempdocpdf = new file("c:/temp/",docdto.getnomdocument() + ".pdf"); docdto.setnompdf(docdto.getnomdocument() + ".pdf"); pdfwriter writer = pdfwriter.getinstance(docitext, new fileoutputstream(tempdocpdf)); docitext.addtitle(docdto.getnomdocument()); // permet de spécifier si les contrôles de navigation sont affichés writer.setviewerpreferences(pdfwriter.hidewindowui); // ouverture du document pdf (pret à enregistrer des données) docitext.open(); stringreader str = new stringreader("<b>test xmlworker</b>"); system.out.println("test 0"); xmlworkerhelper worker = xmlworkerhelper.getinstance(); system.out.println("te...

ios - Obj-c Arrays for coordinates - best practices? -

i have begun teaching myself obj-c , have undertaken large project in order learn principles of language come up. making game 14 tile board. in placing these felt best put coordinates each tile in .plist, access info , return out each coordinate. plist looks this: root ---> position on board ---> item 0 ---> tilex (number(4)), tile y (number(12)) ---> item 1 ...etc. etc. 13. now in code have as nsstring *path = [[nsbundle mainbundle] bundlepath]; nsstring *finalpath = [path stringbyappendingpathcomponent:@"wheeldata.plist"]; nsdictionary *plistdata = [nsdictionary dictionarywithcontentsoffile:finalpath]; nsarray *positiononboard = [nsarray arraywitharray:[plistdata objectforkey:@"position on board"]]; int numberofpositions = [positiononboard count]; nsmutablearray *positionx; nsmutablearray *positiony; nsmutablearray *arrayofpositionsx = [[nsmutablearray alloc] initwithcapacity:numberofpositions]; nsmutablearray *arrayofpositionsy = [[nsmutab...