Posts

php - All my links showing just home page, htaccess issue -

i unable visit page, menu link redirect me same home page. here htacess file, didn't understand after lot of googling even. kind regards options +followsymlinks rewriteengine on rewritebase / #redirect 301 /?action=main.cancel_newsletter http://www.mysite.us/cancel rewritecond %{query_string} ^action=main.cancel\_newsletter$ rewriterule ^/*$ http://www.mysite.us/cancel? [l,r=301] rewritecond %{query_string} ^action=main.market\_news$ rewriterule ^/*$ http://www.mysite.us/news? [l,r=301] rewritecond %{query_string} ^action=main.profiled\_companies$ rewriterule ^/*$ http://www.mysite.us/profiledcompanies? [l,r=301] rewritecond %{query_string} ^action=main.adregister$ rewriterule ^/*$ http://www.mysite.us/register? [l,r=301] rewritecond %{query_string} ^action=main.register$ rewriterule ^/*$ http://www.mysite.us/register? [l,r=301] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule .* /index.php [l] <ifmodule mod_security...

json - wpf databinding to downloaded data -

i having bit of trouble understanding correct way following: the data binding exists on internet json file. on timer tick, download , using javascriptserializer, deserialize class. now, want bind data when deserialize, creates new class, binding breaks (meaning have set itemssource or datacontext again). does know way around this? thanks! what control trying bind data to? if can bind observable collection data source, need clear observable collection before fetching data, , add fetched record collection post deserialization. if not use observablecollection, can add public properties viewmodel , refresh when data back. ensure refresh happens becuase view bound public properties of view model , not aware of object returned call.

How to insert JSON values into MySQL using PHP for an API creation? -

i have following json values: [newcomposemail={"msg":"test mail","senderuserid":"1006","subject":"test","to":"10002"}, composemail] my query is: insert `push_msg_table`(`pid`, `subject`, `msg`, `sentuserid`, `sent_time`, `upload_path`, `status`) values() i need insert these values mysql table. new json. try use in php json_decode(newcomposeemail,true); adding true proper array else return object in php if there multiple entries in json , have loop through json array, in order insert multiple entries in db

c# - Using Double datatype for if Statement -

double similarity = matcher.match(features1, features2); if (similarity== ?? ) // sould write here { application.exit(); } if feature1 , feature2 matches application should exit please me since double floating point type compare double using tolerance , e.g. double tolerance = 0.001; // instead of features1 == features2 if (math.abs(features1 - features2) <= tolerance) { application.exit(); }

javascript - Validation Twitter Bootstrap with Django -

i using django , twitter bootstrap. using following code validation. add more validations. example if variable django false return 'owner not exist'. tried following not working. <script type="text/javascript"> var test = {msg_owner|safe} $(document).ready(function() { $('#frm').bootstrapvalidator({ message: 'this value not valid', feedbackicons: { valid: 'glyphicon glyphicon-ok', invalid: 'glyphicon glyphicon-remove', validating: 'glyphicon glyphicon-refresh' }, fields: { 'owner': { validators: { notempty: { message: 'please enter owner' } test==false: { message: 'owner not exist' } } } }); }); </script> in server side ...

node.js - req param returns an empty array -

i using node.js , mongodb geolocation app , req param returns empty array exports.findpressure = function(req, res) { var queryobject = req.param('q'); console.log(queryobject); db.collection('pressure', function(err, collection) { collection.find( { loc: { $near :[ req.param('q') ] , $maxdistance : 5 }},{"value" : 1, _id : 0}) .sort({_id : -1}).limit(1).toarray(function(err, items) { res.send(items); }); }); }; the longitude , latitude values displayed in console listening on port 3000... connected 'weather' database 8.9068256,52.019347499999995 /pressure?q=8.9068256,52.019347499999995 200 27ms - 2b the url follows http://localhost:3000/pressure?q=8.9068256,52.019347499999995 if use values 8.9068256,52.019347499999995 getting value database if use req.param('q') returning empty array you seem passing values part of query string. req.query.q should contain comma-s...

c# - Parsing Tab delimited text files -

i have tab delimited file columns , rows example: rows might not have value columns. know "order" doesn't change third tab delimited thing column3 , on. column1 column2 column3 .... column12 .... column34 ... column50 123 34 abc 234 def as@ddd.com true 45 nyc wwe@dsds.com false now need read file not of columns important program. example need stuff values in column2, column12,column45 what approach suggest? try following approach static void main(string[] args) { datatable datatable = new datatable(); streamreader streamreader = new streamreader(@"c:\temp\txt.txt"); char[] delimiter = new char[] { '\t' }; string[] columnheaders = streamreader.readline().split(delimiter); foreach (string columnheader in columnheaders) { datatable.columns.add(columnheader); // i've added column headers here. } while (...