Posts

Showing posts from February, 2014

Add reference to same Nuget package but for different targets -

i have solution in visual studio 2013 more c# project files have source code in common targeting different platforms (.net, winrt, .net micro framework , on). csproj files under same directory. these projects use nuget package available above platforms itself. if add nuget package 1 of project (ex. .net), package.config file created , inside has reference target (ex. .net). package downloaded in packages folder. if try add same package different target project in solution, ui tells me package installed. it's true because package.config file there i'd have same package different target. so question following : how can add same nuget package different projects different targets ? thanks, paolo unfortunately, don't think nuget supports scenario. nuget expects packages.config file in same folder .csproj file. there should 1-to-1 relation between these files. should create separate folder each project rather keep .csproj files in same folder. if want s

Difference between upvar 0 and upvar 1 in TCL -

can let me know difference between upvar 0 , upvar 1 in tcl, how can use in real time. kindly, if explain example, makes me more clear. when calling bunch of procedures, stack of stack frames. it's in name. might visualise so: abc 123 456 bcd 321 456 cde 654 321 ok, we've got abc calling bcd calling cde . simple. the 0 , 1 in upvar how many levels go stack when looking variable link to. 1 means go 1 level (i.e., caller of current frame), cde bcd in our example, 2 go cde abc , 3 way global evaluation level overall scripts , callbacks run. 0 special case of this; means lookup in current stack frame. there's ability use indexing base of stack putting # in front of name, #0 indicates global frame, #1 first thing calls. the common use of upvar upvar 1 (and if leave level out, that's does). upvar 0 used when want different (usually easier work with) name variable. next common 1 upvar #0 , though global more common shorth

java - SocketTimedOut when connecting to https Url through CXF -

i facing problem cxf framework trying connect https backend service. since service out side of network using proxy connect. getting sockettimedoutexception when set readtimeout value 60000 default. when set timeout 0(infinite) gives connectionresetexception after while. wrote program on own used httpsurlconnection connect same service proxy , able work it. under feeling connection not happening later came know that have thrown connectexception rather socketexception. gave me relief , want know how can deal socketexception, both timeout , connection reset. please explain me whoever knows this. thanks, sachin you should blame on network or proxy, not codes. sockettimedoutexception , connectiontimedoutexception thrown when network blocked or weak. so, solution both exceptions smoothening network.

pom.xml - Error when building with maven: A required class was missing -

while build maven application(2.0.4). got following build error in pom.xml(eclipse): execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources failed: required class missing while executing org.apache.maven.plugins:maven-resources-plugin:2.6:resources: org/apache/maven/shared/filtering/mavenfilteringexception ----------------------------------------------------- realm = plugin>org.apache.maven.plugins:maven-resources-plugin:2.6 strategy = org.codehaus.plexus.classworlds.strategy.selffirststrategy urls[0] = file:/c:/users/nm28088/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.jar urls[1] = file:/c:/users/nm28088/.m2/repository/org/codehaus/plexus/plexus-utils/1.4.1/plexus-utils-1.4.1.jar urls[2] = file:/c:/users/nm28088/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar number of foreign imports: 1 import: entry[import realm classrealm[maven.api, parent: null]] -----------------------------

windows - ValueError: [u'path'] error when trying to install pysftp in python -

i'm trying install pysftp-0.2.8 on 64 bit windows 7 system, use 32 bit python 2.7. have microsoft visual studio 2012 express installed. when run python setup.py install from command line, get: raise valueerror(str(list(result.keys()))) valueerror: [u'path'] i have tried setting visual studio 2012 (vs11): set vs90comntools=%vs110comntools% in command line, didn't help. when try install package, fails on pycrypto dependency. else appears install correctly. pycrypto requires visual c++ 9.0, according error message receive. instead of messing that, downloaded pre-made installer pycrypto here: http://www.voidspace.org.uk/python/modules.shtml#pycrypto once that's installed, should have required dependencies. able import pysftp after doing that.

c# - Windows Phone 8 region-neutral resource file from external assembly -

i have windows phone 8 app project , portable library project resources used in phone app. it's developed in visual studio 2013 ultimate. i try use region-neutral resource files (e.g. appresources.en.resx instead of appresources.en-gb.resx). if place region-neutral resource files in phone app project works fine. if place resource files in portable library project default resource file used application. if use region-specific naming (appresources.en-gb.resx) resources files in portable library project ok too. class access resources: public class localizedstrings { private static appresources _localizedresources = new appresources(); public appresources localizedresources { { return _localizedresources; } } } reference class in app.xaml: <application.resources> <res:localizedstrings xmlns:res="clr-namespace:project.phone.app;assembly=project.phone.app" x:key="localizedstrings"/> </application.resources> example

objective c - UIAppearance for UINavigationBar ios8 -

in application have implemented custom view in place of uinavigationbar. there 14-15 screens. repeatedly created top view fro each screen. so while surfing solution avoid repetition. came across concept of uiappearance. don't know how implement it. have gone through basic concept of still confuse. my top view bit different each screen. in 4-5 screens there 2 buttons(back button on left , call button right) 1 label in center. then in other 4-5 screens there 2 buttons(cancel button on left , call button on right) 1 label in center. then in other 2-3 screens there 2 buttons(side menu button on left , call button on right) 1 label , icon in center. can tell me how achieve using uiappearance? in advance! you can't set buttons via uiappearance. if setting titletextattributes on each page (for say, font, size , color), can via uinavigationbar appearance this: [[uinavigationbar appearance] settitletextattributes:attributes]; the attributes pointer nsdictionar

java - Android listview first and last item selected on small screen device -

i have problem listview on devices small screen, when click on first item of list , scroll end, see last item selected color of first item. part of adapter code : public static class viewholder { textview mitemtitleview; } @override public view getview(final int position, view convertview, viewgroup parent) { viewholder = new viewholder(); if (convertview == null) { convertview = minflater.inflate(this.mlayoutid, parent, false); viewholder.mitemtitleview = (textview) convertview.findviewbyid(r.id.itemtitle); convertview.settag(viewholder); } else { viewholder = (viewholder) convertview.gettag(); } typeface futura_font = typeface.createfromasset(getcontext().getassets(), "fonts/futura.ttf"); viewholder.mradionameview.settypeface(futura_font); viewholder.mitemtitleview.settext("something"); return convertview; } device test : samsung galaxy s2 on android 2.3.7. screenshots : top

node.js - NodeJS is swallowing my exception thrown from a callback -

assume following code: mymodule.dostuff(options, function(err, results) { if (err) console.log('e', err); if (err) throw err; console.log(results); }); the offending code is: return new promise(function(resolve, reject) { try { throw new error('test error'); resolve('success'); } catch (ex) { console.log('r', ex); reject(ex); } }); and farther chain: self.adapter .collect(self.options) .then(function(data) { self.callback(null, data); if (self.runnable) { settimeout(self.collect.bind(self), 2000); } }, function(error) { self.callback(error); }); the 'e [error info here]' statement prints, throw statement apparently ignored. app happily continues doing whatever else instructed , not crash expected. why? i never found answer specific library using, after switching q library, exposed crucial step may have been

c# - Like doesn't escape special characters NHibernate -

i have problem nhibernate linq contains method, because want escape special characters in string example if type: lel%lel i want find lel%lel not lel4325234534lel to find values use following methods: tabarray = _session.query<tab>() .where(x => x.attr.contains(query)) .toarray(); i try using likeexpression didn't help. i say, should (our code) not nhibernate. can use this: how escape percentage sign in t-sql? i.e. replace % in c# [%] lel[%]lel and return expected .where(x => x.attr.contains(query)) // query == "lel[%]lel"

jpa - Maintaining multiple connection pools with spring/eclipse link -

we use spring , eclipse link (using eclipse link connection pool) we'd allocate 2 connection pools- default should used normally, second should used transactional methods requires new transaction (@transactional(propagation = propagation.requires_new)) is possible? thanks..

python - Integrate array using scipy -

i looking find area under curve. curve cannot translated equation satisfactory. coding pretty straightforward. from scipy.integrate import simps import numpy np y = np.array([1489.263705,1226.774401,5576.973322,1394.189836,1151.001948,867.5819289,773.5496598,1076.135273,1067.513122,3072.972271,2826.697242,1200.779848]) x = np.array([40126,40154,40193,40226,40295,40325,40352,40379,40406,40448,40476,40490]) print simps(y,x) since dataset isn't large, tried doing more manually in excel. once using =forecast function , 1 time manually splitting in linear equations between different measuring points. 3 different ways yield different results. =forecast (value = 686.6569835 ) , manual splitting (678.9578851) obvious - manual better, uses more points. python way yields 662.425396. question 1 - mathematics behind discret integration - surely linear, how come doesn't yield same result? question 2 - result correct , why? can integrate in several ways using scipy, h

node.js - Vulcanize with polymer in meteor -

right facing problem if use vulcanize package polymer here . although working in localhost not in production server. i have tried this no luck. anyone faced same problem? try using meteor-vulcanize , might help. can refer github repo shows how use polymer meteorjs. if not kindly elaborate more on exact problem facing - error message etc.

How to call user define function in sql server -

i'm creating query in sql server 2014 declare @ff varchar(33) set @ff='day'+cast((select day('2011-04-02')) varchar(2)) print @ff update customer set day1='p' userid=12 update customer set @ff=''+'f'+'' userid=15 print @ff select * customer it gives message 1 row effected there no change take place in table. please me solve problem you can't use variable column name in way do, second update needs done dynamic sql statement inject variable query string this: declare @sql nvarchar(max) set @sql = n'update customer set ' + @ff + ' = ''f'' userid=15' exec sp_executesql @sql with variable @ff defined as: declare @ff nvarchar(33) set @ff='day'+cast((select day('2011-04-02')) varchar(2)) this update column day2 have value f userid = 15 you rid of @ff variable , build query string directly: set @sql = concat(n'update customer set day', day('2011-0

string - add unbounded_Strings to enum ada -

i quite new programming , ada have don't know if easy thing or so, tried googling , searching site can't find it! i want add array of strings enum (or enum_def don't know is) first had name_type (name1, name2, name3, name4, name5, etc) and did things worked but want fill name_type (so without in it, maybe 1 starting name) array of unbounded_strings, add unbounded_strings 1 one. so thing : name_type () ustring_array array (1 .. 50) of unbounded_string; in 1 .. 8 loop ustring_array (i) := "get_name" -- name somewhere end loop; fill name_type strings ustring_array (not code, don't know how part ) so ustring_array ("name1", "name2", "name3", etc) , want name_type (name1, name2, name3, etc) individual pieces not strings so size of name_type defined number of strings in ustring_array is possible or asking impossible? if read the part connected io enumeration types in arm , find more or less answ

jquery - Unable to get label with axislabels.js -

i have been working on flot few days now. api awesome , evrything works fine except after including jquery.flot.axislabels.js, cannot display label name. i have worked on lot , tried available on this. below code snippet have been trying: $.plot($("#graph"), [ { data: d1, bars: { show:true, align: "center", barwidth: 0.5, horizontal: true, fillcolor: "#6199cc", linewidth: 0 }, xaxis: { axislabel: "label x-axis", axislabelusecanvas: true, axislabelfontsizepixels: 12, axislabelfontfamily: 'verdana, arial', max: 200, tickcolor: "#5e5e5e", color:"black" }, yaxis: { axislabel: "label y-axis", axislabelusecanvas: true, axislabelfontsizepixels: 12, axislab

c++ - OpenCL - need to recommended structure -

i have 2 files each 1 has 10000 points each point has 2 double number x , y. need operation on of these points, have 10000 0000 operations (10000 x 10000). first question: structure recommend? mean variable should pass kernel file? i have write script , executed 1000 point files (1000000 operations), have put points in 1 array (1000000 x 4) - 4 came x,y first file , x,y file - , passed kernel had 1000000 parallel threads. local_item_size = 125 global_item_size = 1000000 second question: think can improve structure , how? third question: script have written working correctly 1000 points files when run 10000 point files faced cl_createbuffer error (cl_invalid_buffer_size 100000000 * 4double input array). think (but not sure) reason huge number of generated threads (100000000)!! update: - hardware (intel(r) core(tm) i5-4570 cpu @ 3.20ghz, nvidia corporation gm204 [geforce gtx 980]). - have loop 1000 (3 ifs) operations each point, these operations done in kernel , result

c# - Year not displaying correctly with regex -

Image
using regex match line of text have discovered year still appearing 2015-01-07 , not 2015 . can see what's wrong regex? line of code: 2015-01-07 wed jan 07 11:03:43.390 dd started my regex: (?<date>(?<year>(?:\d{4}|\d{2})-(?<month>\d{1,2})-(?<day>\d{1,2})))\s(?<logentry1>.*)\s(?<logentry2>.*)\s(?<logentry3>.*)\s(?<time>(?<hour>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2}).(?<milli>\d{0,3}))\s(?<logentry>.*) why can not single out 'year'? ran through regex101.com , here capture group values: match 1 date [0-10] `2015-01-07` year [0-10] `2015-01-07` month [5-7] `01` day [8-10] `07` logentry1 [11-14] `wed` logentry2 [15-18] `jan` logentry3 [19-21] `07` time [22-34] `11:03:43.390` hour [22-24] `11` minutes [25-27] `03` seconds [28-30] `43` milli [31-34] `390` logentry [35-45] `dd started`

Which design pattern to use - Java? -

i have 3 classes, a , b , c extend d . there methods common class a , b , c have put in d there methods common a , b , b , c , c , a . can add in layer of inheritance i.e create class e (put common methods a , b ), d (put common methods b , c ) , f (put common methods c , a ) there design pattern relating this? you try use composition instead of inheritance. create other classes , let a/b/c have references objects of these other classes. way more flexible anyway.

How to use bootstrap.static with flask-bootstrap -

when use flask-bootstrap, use css/js resources cdn. if access url( http://127.0.0.1 ) without internet, css or js lost. how use local resources of flask-bootstrap? such as: lib/python2.7/site-packages/flask_bootstrap/static/css lib/python2.7/site-packages/flask_bootstrap/static/js thanks. from flask-bootstrap documentation : bootstrap_serve_local if true, bootstrap resources served local app instance every time. see cdn-delivery in flask-bootstrap details. set true in app's config , files served locally instead of cdn.

Function behave differently with similar input (C++) -

i trying work modbus protocol , right calculating lrc of messages. made function worked no issue whatever putting , noticed id did not worked 1 input , can't find logical explanation on why don't work. the function : void lrcstring(std::string example) { std::stringstream ss; std::string hex =example.substr(1, example.length()-5); std::vector<unsigned char> hexch; unsigned int buffer; int offset = 0; while (offset < hex.length()) { ss.clear(); ss << std::hex << hex.substr(offset, 2); ss >> buffer; hexch.push_back(static_cast<unsigned char>(buffer)); offset += 2; } unsigned char lrc=0x00; int i; (i=0;i<hexch.size();i++) { lrc=lrc+hexch[i]; } lrc = 0xff-lrc; // 1 complement lrc = lrc+1; // 2 complement //std::string s = std::to_string(lrc); //int deci = atoi(s.c_str()); int deci = lrc; int reste=deci % 16; std::string temp; int partiehexa=(deci-reste)/16; std::string temp2; std::cout << "deci : "

WordPress database error You have an error in your SQL syntax -

i facing error. wordpress database error have error in sql syntax; check manual corresponds mysql server version right syntax use near '' @ line 1 query select * wp_author_favorite post_id = 1743 , author_id = made require('d:\inetpub\vhosts\engeniuspark.in\sos.engeniuspark.in\wp-blog-header.php'), require_once('d:\inetpub\vhosts\engeniuspark.in\sos.engeniuspark.in\wp-includes\template-loader.php'), include('d:\inetpub\vhosts\engeniuspark.in\sos.engeniuspark.in\wp-content\themes\theme-name\single.php'), wp_authors_favorite_check you need give and author_id = value select * wp_author_favorite post_id = 1743 , author_id = 1234 /*for example*/ made require('d:\inetpub\vhosts\engeniuspark.in\sos.engeniuspark.in\wp-blog-header.php'), require_once('d:\inetpub\vhosts\engeniuspark.in\sos.engeniuspark.in\wp-includes\template-loader.php'), include('d:\inetpub\vhosts\engeniuspark.in\sos.engeniuspark.in\wp-c

sql server - SQL insert posted in wrong row order -

Image
i using node.js , mssql post values embedded device sql database. each interval increment row id , sensor value , "insert" database. however, when view database rows appear have been posted in wrong order (see screenshot). of missing entries appear later. i have debugged code , events taking place in correct order. happening somewhere in transaction. the code here: var sql = require('mssql'); //sql var = 0; //database configuration var config = { user: '*****', password: '******', server: '******', database: '*******', options: { encrypt: false // use if you're on windows azure } } //main activity function called every 1 second periodicactivity(); //setinterval function sets period , function called setinterval(function () { periodicactivity() }, 1000) // function periodicactivity() { = + 1; var y = math.random(); var connection = new sql.connection(config, function (err

c# - Checkbox refused to bind data -

Image
when data loaded gridview, boolean values should show in checkboxes. checkbox should in editable format. i getting number of errors: invalid cast, string not in valid format etc. i searched in google , here well. there number of devs faced same or similar issues , have managed solved. mon_s1 boolean (true, false). changed string test out following code snippets. 1 : changed values in db string , gives : system.formatexception: string not recognized valid boolean. , - 3 : same issue checked='<%# bool.parse(eval("mon_s1").tostring()) %>' 2 : bool values : system.invalidcastexception: specified cast not valid. checked='<%# eval("mon_s1") %>' 4 : shows empty editable checkbox checked='<%# eval("mon_s1").tostring().equals("1") %>' checked='<%# bind("mon_s1").tostring().equals("1") %>' but no matter combination of answers tried, it's not dis

android - How to listen SoftInputMethod's show/hide event? -

i try implement using broadcastreceiver in way. not work.the show/hide event never come receiver. filter = new intentfilter(); filter.addaction(intent.action_input_method_changed); filter.setpriority(intentfilter.system_high_priority); registerreceiver(receiver, filter); i hope nice man can me. that's all hope it's you. ongloballayoutlistener mongloballayoutlistener; private void performlistenkeyboard() { if (mongloballayoutlistener == null) { mongloballayoutlistener = new viewtreeobserver.ongloballayoutlistener() { @override public void ongloballayout() { final int screenheight = mrootview.getrootview().getheight(); int keyboardheight = screenheight - mrootview.getheight(); if (keyboardheight < screenheight / 3 || !isshowkeyboard) { return; } // keyboard show,do // @

multithreading - How can I do asynchronous programming but hide it in Python? -

am getting head round twisted, threading, stackless, etc. etc. , appreciate high level advice. suppose have remote clients 1 , 2, connected via websocket running in page on browsers. here ideal goal: for cl in (1,2): guess[cl] = show(cl, choice("pick number:", range(1,11))) checkpoint() if guess[1] == guess[2]: show((1,2), display("you picked same number!")) ignoring mechanics of show , choice , display , point want show call asynchronous. each client gets shown choice. code waits @ checkpoint() threads (or whatever) rejoin. i interested in hearing answers if involve hairy things rewriting source code. i'd interested in less hairy answers involve compromising bit on syntax. in python, widely-used approach async/event-based network programming hides model programmer gevent . beware: kind of trickery works making tasks yield control implicitly, encourages same sorts of surprising bugs tend appear when os threads involved. local re

ios - View controller before SWRevealViewController -

i have login view , when push 1 button must opened other view swrevealviewcontroller, how that? code , don't go. loginviewcontroller *loginviewcontroller = [self.storyboard instantiateviewcontrollerwithidentifier:@"menuviewcontroller"]; [self.navigationcontroller pushviewcontroller:loginviewcontroller animated:yes]; sorry english...

html - Same size for header and datas -

Image
hy guys! !i have image: i want resize first column minimum size , others must cover maximum width of page. i'll try in way, here css code: /* generic style*/ table, td, th { border: solid# ccc;border - width: 1 px 0;border - collapse: collapse } .check { padding: 5 px 0 px;width: 1000 px } .name { padding: 5 px 100 px;width: 1000 px } .family { padding: 5 px 40 px;width: 1000 px } .productcode { padding: 5 px 30 px;width: 1000 px } .descr { padding: 5 px 20 px;width: 1000 px } td { padding: 5 px 0 px;width: 1000 px } /* fixed header */ div.tablewrap { position: relative;width: 1000 px;padding - top: 20 px } div.tablewrap - inner { width: 1000 px;height: 230 px;overflow: auto } div.tablewrap thead tr { position: absolute;top: -3 px } here html code: <div class="tablewrap"> <div class="tablewrap-inner"> <div ng-controller="ctrlread"> <table class="tab

Send Audio Data over the network using socket in c++ -

can body tell me how can packet audio data , send client client can play audio has been received ? how program start recording audio microphone: { waveoutreset (hwaveout) ; waveinreset (hwavein) ; pbuffer1=reinterpret_cast <pbyte> (malloc(inp_buffer_size) ); pbuffer2= reinterpret_cast <pbyte> ( malloc(inp_buffer_size) ); if (!pbuffer1 || !pbuffer2) { if (pbuffer1) free (pbuffer1); if (pbuffer2) free (pbuffer2); messagebox (hwnd, szmemerror, null, mb_iconexclamation|mb_ok) ; return true ; } // open waveform audio input waveform.wformattag = wave_format_pcm ; waveform.nchannels = 1; waveform.nsamplespersec = 11025 ; waveform.navgbytespersec = 11025 ; waveform.nblockalign = 1 ; waveform.wbitspersample = 8 ; waveform.cbsize =

r - split column if variable number of pieces data.frame -

i want split column y of df below according '_' data incomplet. ( df representative portion of bigger data.frame ). df <- data.frame(x = 1:10, y = c("vuh_ftu_yefq", "sos_nvtspb", "pfymm_ucms", "tucbexcqzh", "n_zndbhoun", "wdetzaolvn", "lvohrpdqns", "wso_bsqwvr", "wx_gbkbxjl", "t_dbxkkvge")) i have tried using: df$z <- strsplit(df$y,'_') but error because number of pieces in each list different. how can this? assumptions: ) needed close out df in example. incomplete data means it's filled in left such value without intervening '_' first or datum. tidyr 's separate() : result <- separate(df, y, = c("z1","z2","z3") , sep ='_', = "drop") the key here extra = "drop" acco

algorithm - Generate all unique substrings for given string -

given string s , fastest method generate set of unique substrings? example: str = "aba" substrs={"a", "b", "ab", "ba", "aba"} . the naive algorithm traverse entire string generating substrings in length 1..n in each iteration, yielding o(n^2) upper bound. is better bound possible? (this technically homework, pointers-only welcome well) as other posters have said, there potentially o(n^2) substrings given string, printing them out cannot done faster that. there exists efficient representation of set can constructed in linear time: the suffix tree .

Regex find first occurance of either of two strings C# -

i need find whether "and" and/or "or" exist in string , if so, replace first occurrence "where". examples and item = 'blah' and replaced where. and item = 'blah' or product = 'foo' and replaced where. or item = 'blah or item = 'foo' first occurrence of or replaced where. if neither , nor or exist leave string is. i have following works if string contains both , and or, if string contains , not work because y equal -1 , x < y going false. it's been doing head, plus late here, charged caffeine appreciated. private string replacefilter(string filter) { int x = filter.indexof("and"); int y = filter.indexof("or"); string regesc = (x != -1 && x < y) ? "and" : "or"; var regex = new regex(regex.escape(regesc)); return regex.replace(filter, "where", 1); } edit in response @luaan, aware of sql injection , have taken pr

Applescript, Chrome: Make new tab at specified index -

i have simple applescript, reopens active tab in new tab tell application "google chrome" tell first window set theurl url of active tab set mytab make new tab @ end of tabs set url of mytab theurl end tell end tell so can open tab at end of tabs or at beginning of tabs , how can open new tab @ specified index of tabs. i'd open next tab after active tab. you can use term at after tab (number) ; this tell application "google chrome" tell first window set n active tab index set theurl url of active tab set mytab make new tab @ after tab n properties {url:theurl} end tell end tell

html - How to track users origin PHP by using example.com/index.php?ref=origin -

how track users origin in php , see people using ref= don't have idea how request works . my code $calling_url = mysql_real_escape_string($_server['http_referer']); url: http://example.com/index.php?ref=http://externalsite.com/page.html or http://example.com/index.php?ref=http%3a%2f%2fexternalsite.com%2fpage.html php: $ref = mysql_real_escape_string(rawurldecode($_get["ref"])); // $ref "http://externalsite.com/page.html" in both cases resources url tracking: using referrer urls better understand visitors referrers , search engines tracking alternative $_server['http_referer'] php variable

css - CSS3: Creating Dots above a image without a div container -

on website of nintendo online post image, has little dots on due css. too, without using div container around image. here current code: .image { background: url(http://nintendo-online.de/img/bg-game-header-cover.png) repeat; } <img class="image" src="http://media2.giga.de/2013/06/osx_hero_2x.jpg" height="250" width="500px"> what have change make visible? if set z-index 1 image goes 1 stage either. possible? use :before or :after http://jsfiddle.net/omjo21mk/ div { background: url(http://media2.giga.de/2013/06/osx_hero_2x.jpg) repeat; position: relative; min-height: 200px; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; } div:before{ content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url(http://nintendo-online.de/img/bg-game-header-cover.png) repeat; } <div&g

angularjs - Angular JS: ng-repeat in Marquee -

how use marquee ng-repeat in angular js? i tried <marquee> <span ng-repeat="item in allitems"> <img src="img/ticker.png" style="padding-top:3px;">{{item.news}} </span> </marquee> but doesn't seem work also, please suggest sliding news ticker designed in angular way. you have forgotten {{ }} marks <marquee> <span ng-repeat="item in allitems"> <img src="img/ticker.png" style="padding-top:3px;">{{item.news}} </span> </marquee> edit: since have edited question include solution marquee deprecated in html5, should use css solution, or angular 1 here simple fiddle marquee functionality, , a ticker

java - Using Apache HttpClient 4.3 with Android and other platforms -

i'm porting backup client called degoo windows android. client written in java 7 , we're targeting android 4.4 , above figured code, except ui pretty straightforward port. unfortunately noticed google has decided force use pre-beta version of apache httpclient 4.0 ( https://hc.apache.org/httpcomponents-client-4.3.x/android-port.html ). problem use httpclient 4.3 , need keep way. have been straightforward if we'd have target android. we'd use httpclient-android instead. however, code must still work other platforms. have dependencies have httpclient transitive dependency (e.g. httpmime). what elegant solution problem? should grab entire source code of httpclient, change namespace , have code use instead? we'd have same thing our dependencies depend on httpclient far haven't come better solution.

sql server - Show each row that is a duplicate -

i have table contains duplicate rows.for ex table originalurl newurl /blog /blog es/blog es/blog blog blog now duplicates follows output: originalurl newurl /blog /blog blog blog thanks "zohar peled" have achieved of through code http://sqlfiddle.com/#!6/c96cc/5 . but when add blog without (/) duplicate shown above.but isn't happening code.so me achieve this final update after yet goal post shifting, i've updated cte again. final update since if going change demands again i've had enough. please take advice future questions: defind problem can. provide accurate table structure , sample data ddl+dml. don't link sqlfiddle suffers lot of downtime. provide accurate expected output show efforts solve problem.

javascript - Send files to the client with jquery ajax and php -

i trying send files client via jquery, ajax, , php. using jquery v1.11.2 , xampp v3.2.1, here jquery code: <script> $(document).ready(function(){ $("#mybtn").click(function(){ $.ajax({ // post file name type: "post", data: { file: "testfile.xlsx" }, url: "sendfile.php", context: $("#result"), success: function(data, status, xhr){ $(this).html(data); } }); }); }); </script> sendfile.php: <?php function send_file($name) { // function ... send file client ob_end_clean(); $path = $name; //cek connection if lost connection client if (!is_file($path) or connection_status()!=0) return(false); //header //------------------------------------------------------------- header("cache-control: no-store, no-cache, must-revalidate"); header("cache-control:

winapi - How to set focus on a List View item? -

i trying write program selects , focuses specific item in list view. why calling listview_setselectionmark (or sending lvm_setselectionmark) not working set focus on list view item? after calling listview_setselectionmark, focus remains rather changing new location; when press arrow key moves focused item rather item specified. here snippet of code selects , focuses item: listview_setitemstate(this->m_hwndchild, index, lvni_selected, lvni_selected); listview_setselectionmark(this->m_hwndchild, index); listview_ensurevisible(this->m_hwndchild, index, false); setfocus(this->m_hwndchild); here full gist . each time press ctrl-r, selects random item of list view. the selectionmark has nothing focus. merely indicates item starts multiple selection. you need use lvis_focused item state instead: listview_setitemstate(this->m_hwndchild, index, lvni_selected | lvni_focused, lvni_selected | lvni_focused); listview_ensurevisible(this->m_hwndchild, index

java - Find inside coordinates of polygon in tile based map -

Image
if have of outer edges of polygons in list how go finding inside coordinates?? make matters simple drew following image represent problem: i need find inside of 'buildings' in tilebased game. outside walls - grey shaded cells. inside building - light blue cells. in event building not shown in view (right building) have solved issue adding entire green section (-1,-1, 0,-1, etc.) list. without following insane if search tree have no idea how solve this. posting here tips, code, or psuedo code. appreciated. much! :) edit @andrew thompson: think miswrote situaton. not duplicate linked to. don't have image. excel drawing did above example. example: i have list containing brown values: ie. {"1,1", "2,1", "3,1", "1,2", etc.} and need corresponding list of blue values: ie. {"2,2", "2,6", "3,6", "4,6", etc.} i toyed around a* algorithm week. there may other

java - Apache POI for doc to html with footnotes -

i using apache poi converting doc html. footnote not converted html. when converting doc file html footnotes available in doc file not present in html file/content. how can persist footnotes after conversion? do that.i hope you..! public static void readmydocument(string filename){ poifsfilesystem fs = null; try { fs = new poifsfilesystem(new fileinputstream(filename)); hwpfdocument doc = new hwpfdocument(fs); /** read content **/ readparagraphs(doc); int pagenumber=1; /** try reading header page 1**/ readheader(doc, pagenumber); /** try reading footer page 1**/ readfooter(doc, pagenumber); } catch (exception e) { e.printstacktrace(); } } public static void readparagraphs(hwpfdocument doc) throws exception{ wordextractor = new wordextractor(doc); /**get total number of paragraphs**/ string[] paragraphs = we.getparagraphtext();

javascript - Why is my line not appearing on the map? -

i'm having problems google maps javascript api. basically, draw polyline , not have code within initialize function, have is: function initialize() { var mapoptions = { center: new google.maps.latlng(1.37, 103.814), zoom: 11 }; var map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); } function test() { var itwcoordinates = [ new google.maps.latlng(1.1955, 103.566667), new google.maps.latlng(1.19875, 103.572333), new google.maps.latlng(1.188167, 103.660694), new google.maps.latlng(1.179444, 103.670722), new google.maps.latlng(1.130361, 103.740694), new google.maps.latlng(1.171444, 103.805), new google.maps.latlng(1.195972, 103.859833), new google.maps.latlng(1.20725, 103.88075), new google.m

jni - Android native "undeclared (first use in this function)" -

i quite new android-ndk. code const char *incstr = (*env)->getstringutfchars(env, str, null); if (incst && incst[0] != '\0') { char *outcstr = b64encode(incstr); return (*env)->newstringutf(env, outcstr); } i error 'incst' undeclared (first use in function) if (incst && incst[0] != '\0') { what did wrong? const char *incstr = (*env)->getstringutfchars(env, str, null); if (incst && incst[0] != '\0') { you declared incstr tried use incst without r

Hybrid Mobile App Analytics -

i'm try implement meaningful mobile app analytics. thought easy given abundance of platforms out there, can't seem find meets simple requirements. my app phonegap app built using angularjs, i'm constrained platforms phonegap plugins (that available phonegap build) or javascript web sdks. i have few simple technical requirements track navigation (page views - user navigated profile page) track custom events (user hit cancel when prompted enter credit card) track custom user properties (dimensions - eg. gender, location, age range) most of platforms seem provide programmatic access this. and few simple functional requirements drill down analysis of events - want see user x (not pii) hit cancel when prompted enter credit card, want drill down session , see flow of events , page navigation occurred user properties within session...so example can see never viewed "how works" page...and male. aggregate analysis of events - want see count of users (

javascript - Set the last td value on basis of his data using jquery -

i working on 1 table created using datatables. want set last td value using jquery. tried different codes no luck this. <script type="text/javascript"> $(document).ready(function() { $('#productstable tr').each(function() { alert($(this).closest('tr').children('td.two').text()); // alert($(this).closest('tr').find('td:eq(11)').text()); }); }); </script> i didn't proper value of last td. table html is: <table class="display table table-bordered table-striped datatable" id="productstable" aria-describedby="productstable_info"> <thead> <tr role="row"> <th class="sorting_desc" tabindex="0" rowspan="1" colspan="1" aria-label="date: activate sort column ascending" style="width: 45.777777671814px;">date</th> &l

php - Yii 2.0 - Input values saved as null in database -

in practice app, have table called 'music' 3 columns - id, title , artist. whenever try insert input values form database, new record added id has value, title , artist both null. below model: <?php namespace app\models; /** * model class table "music". * * @property integer $id * @property string $title * @property string $artist */ class musicentry extends \yii\db\activerecord { public $title; public $artist; public $id; public static function tablename() { return 'music'; } public function rules() { return [ [['title', 'artist'], 'required'], [['id'], 'safe'], ]; } } ?> while controller action looks so: public function actionmusicentry() { $model = new musicentry (); if (isset ( $_post ['musicentry'] )) { $model->load($_post); if ($model->save()) { yii::$app->session->setflash ( 'success', 'model